Possible to extract 'To:' mail field?

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

Try extractcustomfield values extension, it supports also to parse the mail header.

Torsten

Kühne + Nagel (AG & Co.) KG, Geschäftsleitung: Hans-Georg Brinkmann (Vors.), Uwe Bielang (Stellv.), Bruno Mang, Alfred Manke, Thorsten Meincke, Mark Reinhardt (Stellv.), Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persönlich haftende Gesellschaft: Kühne & Nagel A.G., Sitz: Contern/Luxemburg Geschäftsführender Verwaltungsrat: Klaus-Michael Kühne-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com rt-users-bounces@lists.bestpractical.com
To: rt-users@lists.bestpractical.com rt-users@lists.bestpractical.com
Sent: Mon Mar 03 03:56:23 2008
Subject: [rt-users] Possible to extract ‘To:’ mail field?

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@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

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.

}

~JasonOn 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


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com