Rt-mailgate and exim

I recently installed rt2 onto a machine that was using exim as it’s
MTA. While configuring the various aliases I figured there ought be a
better way. So I hacked at my exim.conf for a bit (with help from a
friend) and ended up with a machine where I can send mail to
rt-queue+action@host, and it will DTRT.

basicly I told exim that I had a local user “rt” (I don’t) and that -
was a prefix and + was a suffix, and that it should send all mail for
this user to a transport. The transport just execs rt-mailgate with
the relevant command line flags.

my end setup will have my hacked exim.conf on the rt2 host, and my
domain’s main mail server will have aliases like:
abuse: rt-abuse+correspond@rt2
I find this much simpler than having big long aliases somewhere.
anyhow, I figured I’d share…

in the TRANSPORTS section of my exim.conf I’ve added:

my rt hack

driver = pipe
command = "/usr/local/rt2/bin/rt-mailgate --queue ${quote:$local_part} --action ${quote:${substr_1:$local_part_suffix}}"
prefix = ""
suffix = ""
user = www-data

and in the DIRECTORS section I’ve added:
driver = smartuser
suffix = +*
prefix = *-
new_address = ${quote:${lc:${local_part}}}@${domain}
transport = local_delivery_rt

have fun