On Fri, Aug 31, 2012 at 05:49:36PM +0000, Lundberg, Emory wrote: > 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
> 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.
>
>
>
> ✔ Never use your HawkID's email address and password anywhere else!
> Emory Lundberg, Security Friend
> Information Security & Policy Office, University of Iowa
>
>
>
>
>
pgpSYlW22340r.pgp
Description: PGP signature
