Set requestor from email body

Hello,

I’d like to be able to forward mails which arrive at my address to RT
and have RT extract the requestor’s address from the forwarded mail,
instead of using the sender address (which is me in this case).

I cannot use something like the “Mail Redirect” extension to
Thunderbird, which redirects mails retaining the original sender
address, since the incoming mails are encrypted for me and need to be
forwarded unencrypted.

I know there is “Extract custom fields from mail”, but this is not a
custom field. Does anyone know a solution for this?

Thanks,
Andreas

I know there is “Extract custom fields from mail”, but this is not a
custom field. Does anyone know a solution for this?

The ExtractCustomFieldValues extension can be used to set other
fields, but honestly, you’ll write less code if you steal one of the
snippets from the wiki snippets page that fetches the mail body.

With ECFV you’d have to write the same ‘remove requestor, add
requestor’ code, it’d just simplify the matching.

-kevin

Hello Andreas,

This is a scrip (on create), it does something like you want. This is fot
RT3.8. You have to finish it by replacing the regex part where I wrote “YOU
HAVE TO PUT SOME REGEX HERE”

Ákos

Scrip head ### you don’t really need this whole heade

my $scname = “SC”.$self->ScripObj->id.“-3 TX”.$self->TicketObj->id."
“.$self->ScripObj->Description.” - ";
my $log = 1;
$RT::Logger->debug( "$scname: Ticket: ". $self->TicketObj->Id ) if ($log);
my $requestor_address = $self->TicketObj->RequestorAddresses;
my $content = $self->TransactionObj->Content;
return 1 unless $content;
$RT::Logger->debug( “$scname Text attachment has found.” ) if ($log);
$RT::Logger->debug( “$scname content: $content” ) if ($log);

End oh head

SetRequestor

if( $content =~ m/YOU HAVE TO PUT SOME REGEX HERE to extract the email
address from the mail body like From:John Doe <(john.doe@yyyyyy.yyy)>/m )
{
$RT::Logger->debug( “$scname .SetRequestorFromBody: START $1” ) if
($log);
$self->TicketObj->DeleteWatcher( Type => “Requestor”, Email =>
$requestor_address );
$self->TicketObj->AddWatcher( Type => “Requestor”, Email => $1 );
}

$RT::Logger->debug( “$scname : END” ) if ($log);

1;On Thu, Jan 30, 2014 at 9:24 AM, Andreas Heinlein aheinlein@gmx.com wrote:

Hello,

I’d like to be able to forward mails which arrive at my address to RT and
have RT extract the requestor’s address from the forwarded mail, instead of
using the sender address (which is me in this case).

I cannot use something like the “Mail Redirect” extension to Thunderbird,
which redirects mails retaining the original sender address, since the
incoming mails are encrypted for me and need to be forwarded unencrypted.

I know there is “Extract custom fields from mail”, but this is not a
custom field. Does anyone know a solution for this?

Thanks,
Andreas