[rt-users] Exchange "From:" and "To:"

Peter Wieland peter at wieland.no
Tue Feb 9 08:02:07 EST 2010


I send emails from a system I use to customers with a BCC to rt.
After arriving, the ticket has:

From: my_email_address
To: customer_email_address

Fine, but now I want to exchange these values into:

From: customer_email_address
To: my_email_address

Spent a couple of hours in the mailing list archives and tried several  
solutions but am still stuck.

Tried a script (which I found here) with user defined action for  
cleanup:

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);
$RT::Logger->debug("my value for ToEmailAddress is " . "$addr");
$self->TicketObj->AddWatcher(Type=>'Requestor', Email => $addr);
}
$self->TicketObj->DeleteWatcher(Type=>'Requestor', Email =>  
'my_email_address');

but no log output is produced. I stripped everything away but

my $Transaction = $self->TransactionObj;
my $header = $Transaction->Attachments->First->GetHeader('To');
$RT::Logger->debug("debug?" );

but there is still no log output. Only after commenting the my $header  
line, I get log output.

What am I doing wrong? Thanks for any help.

Regards
Peter




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100209/dbb409e7/attachment.htm>


More information about the rt-users mailing list