[rt-users] webform front end to RT, how to get email address?
Gene LeDuc
gleduc at mail.sdsu.edu
Mon Jan 7 11:45:15 EST 2008
The easy way to do this is to have your app spoof the sender of the mail so
that it appears to come from luser at foo.com instead of your app. That's how
we do it.
The more complicated way is to use a scrip to extract the information from
the body of the e-mail and then create a user and set the owner to that
user. Here's how you can get the user e-mail from the body of the e-mail,
but I've never tried creating an RT user via a scrip. As always, this
might need a little tweaking.
### Extract fields from e-mail
my $Transaction = $self->TransactionObj;
my $CurrentUser = $Transaction->CurrentUser;
my $Content = $Transaction->Content;
my $UserFlag = "Sender email: "
my ($Orig) = $Content =~ /$UserFlag(.*)\n/s;
chomp $Orig;
### $Orig should have the e-mail address from the e-mail body now
Regards,
Gene
At 03:44 PM 1/5/2008, C Thala wrote:
>Our organization has a webform frontend for our users to submit their
>requests. The webform sends an email which gets fed into rt-mailgate
>which gets their issue injected into the proper queue. Here is a
>sample email sent to rt-mailgate:
>
> From: webform at example.org
> To: rt at example.org
> Subject: submission to customer service web page
>
> This email has been sent from the example.org Customer Service web page.
> Email send to: Business Management
> Sender name: L User
> Sender email: luser at foo.com
> Subject: i have a problem
> Message Body: help me
>
>The problem is that the ticket owner for each new ticket is the
>envelope sender address of the webform, eg. webform at example.org.
>
>We want it to be set to <luser at foo.com>, because they submitted the
>form. How can we get RT to use this as the owner of the ticket? I know
>the answer probably involves a scrip of some sort, but I don't know
>where to start.
>
>Any help appreciated.
--
Gene LeDuc, GSEC
Security Analyst
San Diego State University
More information about the rt-users
mailing list