Webform front end to RT, how to get email address?

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@example.org
To: rt@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@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@example.org.

We want it to be set to luser@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.

Fix your web form to set the From header correctly?

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@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@example.org
To: rt@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@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@example.org.

We want it to be set to luser@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

We’re thinking of doing something similar. I was ‘planning’ on using
CommandbyMail and have the app put the username information on the
outgoing e-mail into RT. So the webform would ask for name, e-mail,
problem. The e-mail submitted to RT would look something like:

Requestor:theirName@domain.com
Description: the problem they typed above

And so on. That’s what we were thinking anyway, unless there’s a reason
why this can’t be done??

Helmuth

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@example.org
To: rt@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@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@example.org.

We want it to be set to luser@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

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 sales@bestpractical.com or call us at +1 617 812 0745.

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com