Try something like this:
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 should now be set to: [EMAIL PROTECTED]
}
~Jason
On Thu, 2008-01-03 at 16:48 +0100, Raphux wrote:
> Hello list,
>
> I'm trying to find how to retrieve -in a scrip- the original "To:" from
> a mail submitted ticket.
>
> Details :
> I have a single entry queue (called "support"), with multiple email aliases.
> The main adress of that queue is [EMAIL PROTECTED]
>
> In my postfix configuration, I created some aliases, like :
> [EMAIL PROTECTED] ==> [EMAIL PROTECTED]
> [EMAIL PROTECTED] ==> [EMAIL PROTECTED]
>
> Emails arrive correctly into the support queue, and in the first ticket
> history entry, I do have the "To: [EMAIL PROTECTED]", which is
> good for me.
>
> I would like to access this information ([EMAIL PROTECTED] here)
> in a scrip, in order to correctly set a custom field.
>
> It is maybe obvious, but I can't find how to do this.
>
> Anyone?
>
--
/------------------------------------------------------------------\
| Jason A. Smith Email: [EMAIL PROTECTED] |
| Atlas Computing Facility, Bldg. 510M Phone: +1-631-344-4226 |
| Brookhaven National Lab, P.O. Box 5000 Fax: +1-631-344-7616 |
| Upton, NY 11973-5000, U.S.A. |
\------------------------------------------------------------------/
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
If you sign up for a new RT support contract before December 31, we'll take
up to 20 percent off the price. This sale won't last long, so get in touch
today.
Email us at [EMAIL PROTECTED] or call us at +1 617 812 0745.
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com