[rt-users] Possible to extract 'To:' mail field?
Jason A. Smith
smithj4 at bnl.gov
Mon Mar 3 07:40:42 EST 2008
Hi Tom,
We have a Scrip which needs to look at some of the original email
headers, here is the portion which does the header extraction:
my $Transaction = $self->TransactionObj;
my $header = $Transaction->Attachments->First->GetHeader('To');
my @addr = Mail::Address->parse($header);
foreach my $addrobj (@addr) {
my $addr = lc $RT::Nobody->UserObj->CanonicalizeEmailAddress($addrobj->address);
# $addr is now set to one of the To recipients.
}
~Jason
On Mon, 2008-03-03 at 13:26 +1030, Tom Lanyon wrote:
> Greetings,
>
> For a queue which has multiple email addresses reaching it, we wish to
> pull out statistics of which addresses are being used and set up some
> custom fields based on it.
>
> I could do this via a few extensions to rt-mailgate, but was wondering
> if there's any way to extract the initial To field from the Ticket
> object so I can do this in a Scrip?
>
> Thanks,
> Tom
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
More information about the rt-users
mailing list