Need help to parse email

I am getting tickets from a online reply form I have no control over that
sends the email from the site and includes the users email address as a
key=>value pair, i.e. email: test@test.com. I need to rewrite the header so
that the email is seen to come from that email address in the body so that
the ticket lists the submitters email address as the requestor.
How can I achieve this?

Chris Mason

At Friday 4/22/2005 09:03 AM, Chris Mason (Lists) wrote:

I am getting tickets from a online reply form I have no control over that
sends the email from the site and includes the users email address as a
key=>value pair, i.e. email: test@test.com. I need to rewrite the header so
that the email is seen to come from that email address in the body so that
the ticket lists the submitters email address as the requestor.
How can I achieve this?

Chris Mason

At first I thought you could do this via scrips - parse the message body
for the new email address and use the Ticket API to set the requestor. But
the problem with that is that you don’t have control over the order in
which scrips execute - RT may have already autoreplied to the original
“requestor” email address before your custom scrip makes the change to the
correct requestor.

So I think you’ll have to modify the code that process incoming email -
take a look at the Gateway method of lib/RT/Interface/Email.pm. You have
access to the MIME entity there so you may be able to rewrite the From header.

Or - lib/RT/Interface/Email/Auth/MailFrom.pm seems to be where RT
determines the user by parsing the From header - you could maybe modify
that instead.

Steve

Was discussed on the list several times:
http://marc.theaimsgroup.com/?t=109909121200001&r=1&w=2
There is should be other duscussions on the lists.

You can write script that rewrite email before it gets into RT.

Chris Mason (Lists) wrote: