Custom actions for inserting multiple mixed v4/v6 IP addresses into a custom field

I cannot seem to get a scrip that will accept multiple comma-seperated addresses from an email (or any correspondevent for that matter), only one address will be accepted.

The scrip I am using is a custom action that looks like this:

my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $body = $Transaction->Content();
my $cf = new RT::CustomField($RT::SystemUser);
my $id;
my $msg;
my $queue = 'Testes';

#---IPS
if($body =~ /X-addresses\:(.*)\n/i){
my $iplist = $1;
($id,$msg) = $cf->LoadByNameAndQueue (Name=>'ip-addresses', Queue=>$queue);
($id,$msg) = $Ticket->AddCustomFieldValue (Field => $cf, Value =>$iplist);
}
return(1);

I’m not opposed to being told I’m going about this the wrong way; present practice for my RT install is to have a web form submit requests, currently that request will have an IP address field that is picked up by a similar scrip (in addition to x-fqdn, x-contact, x-OS, and other information being collected) and I was thinking a comma-seperated list of mixed ipv4,ipv6 could be snarfed in one line and, as long as RT’s address parser validated it, we’d be in business.

:heavy_check_mark: Never use your HawkID’s email address and password anywhere else!
Emory Lundberg, Security Friend
Information Security & Policy Office, University of Iowa

I’m wondering about this one …

Our internal staff uses comments to put information in tickets for co-workers that can’t be viewed by customers.
Customer information is shared via correspondence.

Last week, a staff member deleted (accidentaly) the requestor of a ticket. There were no other cc’s or admin cc’s.
When the staff member clicked on Reply, RT did not sent a outgoing mail, but the message was flagged as Correspondence.

So I would like to make a check that returns an error to the user when he/she tries to reply on a ticket with no watchers.
Should I try to do it with a scrip or should I adapt the Email.pm?

I cannot seem to get a scrip that will accept multiple comma-seperated addresses from an email (or any correspondevent for that matter), only one address will be accepted.
The scrip I am using is a custom action that looks like this:

I’d suggest looking at what RTIR’s IP address parsing routines are
doing.

You’ll want lib/RT/Action/RTIR_FindIP.pm in the RTIR tarball.

Also, keep in mind that if you create an Multiple Value IP Address
custom field, you still need to add your multiple values one at a time
(like if you were adding multiple values to a normal multi-value CF).

-kevin

Our internal staff uses comments to put information in tickets for co-workers that can’t be viewed by customers.
Customer information is shared via correspondence.

Last week, a staff member deleted (accidentaly) the requestor of a ticket. There were no other cc’s or admin cc’s.
When the staff member clicked on Reply, RT did not sent a outgoing mail, but the message was flagged as Correspondence.

So I would like to make a check that returns an error to the user when he/she tries to reply on a ticket with no watchers.
Should I try to do it with a scrip or should I adapt the Email.pm?

You may want to grant the ShowOutgoingMail right and turn on the
SimplifiedRecipients configuration which will make a box appear above
the reply box indicating who will get this email. Turning off
SimplifiedRecipients will get you a much more detailed view below the
reply.

-kevin

Our internal staff uses comments to put information in tickets for co-workers that can’t be viewed by customers.
Customer information is shared via correspondence.

Last week, a staff member deleted (accidentaly) the requestor of a ticket. There were no other cc’s or admin cc’s.
When the staff member clicked on Reply, RT did not sent a outgoing mail, but the message was flagged as Correspondence.

So I would like to make a check that returns an error to the user when he/she tries to reply on a ticket with no watchers.
Should I try to do it with a scrip or should I adapt the Email.pm?

You may want to grant the ShowOutgoingMail right and turn on the
SimplifiedRecipients configuration which will make a box appear above
the reply box indicating who will get this email. Turning off
SimplifiedRecipients will get you a much more detailed view below the
reply.

-kevin

View exact outgoing email messages and their recipients is granted.
SimplifiedRecipients is turned on.

But they should see an info/error box that informs them that they are replying to nobody (thus making a comment instead of a reply; although is is marked as correspondence in RT 4).

Our internal staff uses comments to put information in tickets for co-workers that can’t be viewed by customers.
Customer information is shared via correspondence.

Last week, a staff member deleted (accidentaly) the requestor of a ticket. There were no other cc’s or admin cc’s.
When the staff member clicked on Reply, RT did not sent a outgoing mail, but the message was flagged as Correspondence.

So I would like to make a check that returns an error to the user when he/she tries to reply on a ticket with no watchers.
Should I try to do it with a scrip or should I adapt the Email.pm?

You may want to grant the ShowOutgoingMail right and turn on the
SimplifiedRecipients configuration which will make a box appear above
the reply box indicating who will get this email. Turning off
SimplifiedRecipients will get you a much more detailed view below the
reply.

View exact outgoing email messages and their recipients is granted.
SimplifiedRecipients is turned on.

Great, but the empty box isn’t enough for your users? You could
customize that by making a local overlay of the
ShowSimplifiedRecipients component, or by submitting a patch to add a
callback to make it cleaner to insert a warning.

But they should see an info/error box that informs them that they are
replying to nobody (thus making a comment instead of a reply; although
is is marked as correspondence in RT 4).

You mean it’s effectively a comment because you have no Requestors or
Ccs, but since you recorded it as a Correspondence by clicking Reply,
RT is correctly recording it in the transaction as such. RT is never
going to be changed to say “Huh, there are no requestors, I’ll relabel
this a comment”.

-kevin

thus making a comment instead of a reply; although is is marked as
correspondence in RT 4.

It is a correspondence, not a comment. If someone logged into RT had
the ability to see tickets but not see comments, they’d see the message
(properly).