Determine Queue based off of email domain

I am trying to get RT setup to place new tickets in a particular queue based
off the senders mail domain. We use RT at work to handle support tickets for
our customers in the building. I have 3 different email domains that would
be sending us tickets.

For example I have the following domains that would send us email

@abc.com - company’s email account (I have control over this domain)
@jkl.com - Operational department that we support (email is handled by there
main office)
@xyz.com - Outside agency that we maintain a hosted financial system for

I would want anyone sending an email to techsupport@abc.com to have a ticket
created in a particular queue depending on the email domain they are a part
of.

Example:
@abc.com - goes to the ABC Ticket Queue
@jkl.com - goes to the JKL Ticket Queue
@xyz.com - goes to the XYZ Ticket Queue

Is there a way to do this with RT’s Scips or would I be better off trying to
filter mail for this criteria with postfix?

Thanks,
Dustin

Check out procmail, this is what you are looking for!

Torsten

Kuehne + Nagel (AG & Co.) KG, Geschaeftsleitung: Hans-Georg Brinkmann (Vors.), Dirk Blesius, Reiner Heiken, Bruno Mang, Alfred Manke, Christian Marnetté, Mark Reinhardt, Jens Wollesen, Rainer Wunn, Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878, Persoenlich haftende Gesellschaft: Kuehne & Nagel A.G., Sitz: Contern/Luxemburg Geschaeftsfuehrender Verwaltungsrat: Klaus-Michael KuehneVon: rt-users-bounces@lists.bestpractical.com rt-users-bounces@lists.bestpractical.com
An: rt-users@lists.bestpractical.com rt-users@lists.bestpractical.com
Gesendet: Sat Mar 20 03:30:30 2010
Betreff: [rt-users] Determine Queue based off of email domain

I am trying to get RT setup to place new tickets in a particular queue based off the senders mail domain. We use RT at work to handle support tickets for our customers in the building. I have 3 different email domains that would be sending us tickets.

For example I have the following domains that would send us email

@abc.com - company’s email account (I have control over this domain)
@jkl.com - Operational department that we support (email is handled by there main office)
@xyz.com - Outside agency that we maintain a hosted financial system for

I would want anyone sending an email to techsupport@abc.com to have a ticket created in a particular queue depending on the email domain they are a part of.

Example:
@abc.com - goes to the ABC Ticket Queue
@jkl.com - goes to the JKL Ticket Queue
@xyz.com - goes to the XYZ Ticket Queue

Is there a way to do this with RT’s Scips or would I be better off trying to filter mail for this criteria with postfix?

Thanks,
Dustin

Hello Dustin Berube,

Am 2010-03-19 22:30:30, hacktest Du folgendes herunter:

I would want anyone sending an email to techsupport@abc.com to have a ticket
created in a particular queue depending on the email domain they are a part
of.

Example:
@abc.com - goes to the ABC Ticket Queue
@jkl.com - goes to the JKL Ticket Queue
@xyz.com - goes to the XYZ Ticket Queue

Is there a way to do this with RT’s Scips or would I be better off trying to
filter mail for this criteria with postfix?

Puzzeing around…

I have 11 Request-Tracker for 7 different domains runing on a singel
"courier" server. Where is the problem?

You create three accounts for

techsupport@abc.com
techsupport@jkl.com
techsupport@xyz.com

and each is handled seperateley.

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant

Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
http://www.tamay-dogan.net/ Michelle Konzack
http://www.can4linux.org/ Apt. 917
http://www.flexray4linux.org/ 50, rue de Soultz
Jabber linux4michelle@jabber.ccc.de 67100 Strabourg/France
IRC #Debian (irc.icq.com) Tel. DE: +49 177 9351947
ICQ #328449886 Tel. FR: +33 6 61925193

signature.pgp (189 Bytes)

Hello Dustin Berube,

Am 2010-03-19 22:30:30, hacktest Du folgendes herunter:

I would want anyone sending an email to techsupport@abc.com to have a
ticket
created in a particular queue depending on the email domain they are a
part
of.

Example:
@abc.com - goes to the ABC Ticket Queue
@jkl.com - goes to the JKL Ticket Queue
@xyz.com - goes to the XYZ Ticket Queue

Is there a way to do this with RT’s Scips or would I be better off trying
to
filter mail for this criteria with postfix?

Puzzeing around…

I have 11 Request-Tracker for 7 different domains runing on a singel
"courier" server. Where is the problem?

You create three accounts for

techsupport@abc.com
techsupport@jkl.com
techsupport@xyz.com

and each is handled seperateley.

I agree I would like to go this route as well, however I don’t have
administrative access to two of the three domains and there is a lot of
politics involved (I work in the local government sector). Two of the
domains are handled by separate entities. I had a hard enough time just
getting them to agree to email a helpdesk account instead of individual
people.

Hello Dustin,

Am 2010-03-20 13:47:16, hacktest Du folgendes herunter:

I agree I would like to go this route as well, however I don’t have
administrative access to two of the three domains and there is a lot of
politics involved (I work in the local government sector). Two of the
domains are handled by separate entities. I had a hard enough time just
getting them to agree to email a helpdesk account instead of individual
people.

I have a similar problem, but this was solved by forwarding ANY messages
to support@shity-domain.tld to my server shity-support@mydomain.tld.

And now I can do whatever I have to do with this account and push the
mail back over the <mail.shity-domain.tld>.

Does not requie bigintervention on the customers side. Only Forwarding
and accepting mails from my domain as relay.

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator
24V Electronic Engineer
Tamay Dogan Network
Debian GNU/Linux Consultant

Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
http://www.tamay-dogan.net/ Michelle Konzack
http://www.can4linux.org/ Apt. 917
http://www.flexray4linux.org/ 50, rue de Soultz
Jabber linux4michelle@jabber.ccc.de 67100 Strabourg/France
IRC #Debian (irc.icq.com) Tel. DE: +49 177 9351947
ICQ #328449886 Tel. FR: +33 6 61925193

signature.pgp (189 Bytes)

Check out procmail, this is what you are looking for!

Torsten

Tortsen,

Thanks for pointing me into the right direction with procmail. Here’s the
solution that I came up with (hopefully it will be helpful to someone else).

/etc/procmailrc

Set Variables

SHELL=/bin/sh
LOGFILE=/var/log/procmail.log
LOG="— Logging ${LOGFILE} for ${LOGNAME}—\n “
VERBOSE=yes
RT_MAILGATE=”/opt/rt3/bin/rt-mailgate"
RT_URI=“http://192.168.0.29/ticket

LOGABSTRACT=no

ABC

:0

  • ^From: .*@abc.com
    |/usr/bin/perl $RT_MAILGATE --queue “abc’s Office” --action correspond --url
    $RT_URI

JKL

:0

  • ^From: .@jkl.org
    |/usr/bin/perl $RT_MAILGATE --queue “JKL” --action correspond --url $RT_URI

XYZ

:0

  • ^From: .*@XYZ.org
    |/usr/bin/perl $RT_MAILGATE --queue “XYZ” --action correspond --url $RT_URI

All others

:0

  • !^From: .@abc.com|.@jkl.org|.*@xyz.org
    |/usr/bin/perl $RT_MAILGATE --queue “External Users” --action correspond
    –url $RT_URI

A couple of things you might have missed…

Set Variables

SHELL=/bin/sh
LOGFILE=/var/log/procmail.log
LOG="— Logging ${LOGFILE} for ${LOGNAME}—\n “
VERBOSE=yes
RT_MAILGATE=”/opt/rt3/bin/rt-mailgate"
RT_URI=“http://192.168.0.29/ticket

LOGABSTRACT=no

ABC

:0

  • ^From: .*@abc.com
    |/usr/bin/perl $RT_MAILGATE --queue “abc’s Office” --action correspond --url
    $RT_URI

JKL

:0

  • ^From: .@jkl.org
    ^^^^^^^^^^^^^^---- you are missing a ‘*’ on this line

|/usr/bin/perl $RT_MAILGATE --queue “JKL” --action correspond --url $RT_URI

XYZ

:0

  • ^From: .*@XYZ.org
    |/usr/bin/perl $RT_MAILGATE --queue “XYZ” --action correspond --url $RT_URI

All others

:0

  • !^From: .@abc.com|.@jkl.org|.*@xyz.org
    ^^^— you don’t need this line, procmail only does one delivery
    unless you use the ‘c’ flag

Dustin-

I think the best way to handle that would be thru your postfix
configuration. Just send each alias to a different Q…

http://www.postfix.org/VIRTUAL_README.html#virtual_alias

Once you have email being delivered to those aliases -follow the wiki and
pipe your email to rt-mailgate and specify the queue.

http://wiki.bestpractical.com/view/ManualEmailConfig

Matt

Matt,
I don’t disagree with you, using the procmail recipes was the best option in
this scenario due to politics. The outside entities that I deal with will
not change the support email address so I had to make it work with what I
had.

Actually the procmail recipes I posted are working extremely well in this
environment. Basically postfix is just passing the messages over to procmail
for filtering and delivery. I set the mailbox_command directive in
/etc/postfix/main.cf to equal this:

mailbox_command = /usr/bin/procmail