Autoassign User based on Email Address

Hello,

I am looking for a way to autoassign a user based on the email
address. So the queue would still be “support” but emails sent to
user@rt would be opened in the support queue assigned to “user”. Can
this be done with mailgate?

Thanks,
Max

I’ve been digging through the wiki but I have yet to find a solution
to this. Is it possible to autoassign a user based on the to: address?
I want to be able to send email to foo@rt which will create a ticket
in the support queue assigned to foo.

Thanks in advance,
Max

Hi Max,

This is possible and probably not too difficult.

You can get the “To:” addresses from the original e-mail using:
my @OriginalTo =
$self->TicketObj->Transactions->First->Attachments->First->GetHeader(‘To’);

or if this is an “On Create” scrip, you might be able to use (this is
untested):
my @OriginalTo = $self->TransactionObj->GetHeader(‘To’);

This will give you an array @OriginalTo of all the addresses that were on
the “To:” header. If the e-mail had several addresses then you’ll have to
figure out which one you want.

Then do your queue and owner assignments like this:
$self->TicketObj->SetOwner($username);
$self->TicketObj->SetQueue(“support”);

So an e-mail sent to bob@rt.yourcompany.com would end up in your “support”
queue assigned to user “bob@rt.yourcompany.com”. Warning - This will cause
RT to try this assignment on every new ticket sent to it. If this is not
what you want, then you need to do some conditional checking to make sure
that the $username is one of your support techs and then bail if it’s not
the case.

This might need some tweaking, but the basic recipe should work.

Regards,
Gene

At 11:08 AM 12/4/2007, Max Clark wrote:

I’ve been digging through the wiki but I have yet to find a solution
to this. Is it possible to autoassign a user based on the to: address?
I want to be able to send email to foo@rt which will create a ticket
in the support queue assigned to foo.

Thanks in advance,
Max


The rt-users Archives

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

Gene LeDuc, GSEC
Security Analyst
San Diego State University

Thank you. I will work on this today.On Dec 4, 2007 12:18 PM, Gene LeDuc gleduc@mail.sdsu.edu wrote:

Hi Max,

This is possible and probably not too difficult.

You can get the “To:” addresses from the original e-mail using:
my @OriginalTo =
$self->TicketObj->Transactions->First->Attachments->First->GetHeader(‘To’);

or if this is an “On Create” scrip, you might be able to use (this is
untested):
my @OriginalTo = $self->TransactionObj->GetHeader(‘To’);

This will give you an array @OriginalTo of all the addresses that were on
the “To:” header. If the e-mail had several addresses then you’ll have to
figure out which one you want.

Then do your queue and owner assignments like this:
$self->TicketObj->SetOwner($username);
$self->TicketObj->SetQueue(“support”);

So an e-mail sent to bob@rt.yourcompany.com would end up in your “support”
queue assigned to user “bob@rt.yourcompany.com”. Warning - This will cause
RT to try this assignment on every new ticket sent to it. If this is not
what you want, then you need to do some conditional checking to make sure
that the $username is one of your support techs and then bail if it’s not
the case.

This might need some tweaking, but the basic recipe should work.

Regards,
Gene

At 11:08 AM 12/4/2007, Max Clark wrote:

I’ve been digging through the wiki but I have yet to find a solution
to this. Is it possible to autoassign a user based on the to: address?
I want to be able to send email to foo@rt which will create a ticket
in the support queue assigned to foo.

Thanks in advance,
Max


The rt-users Archives

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


Gene LeDuc, GSEC
Security Analyst
San Diego State University