[rt-users] (ab)use of --extension with rt-mailgate

Emmanuel Lacour elacour at easter-eggs.com
Thu Aug 19 12:10:05 EDT 2010


On Thu, Aug 19, 2010 at 04:42:29PM +0100, Carl Vincent wrote:
> Hi,
> 
> I've had a situation for a while where mail sent to several addresses all goes to the same queue, but I'd like to set ownership automatically based on which address it was actually sent to. Also I'd like to keep the address->owner mapping out of RT, ideally in the aliases file where the address->queue mapping is.
> 
> When looking to see if I could hack on rt-mailgate to enable this to happen, I found the code for the --extension parameter could put stuff into the X-RT-Mail-Extension header of the message. It only seems to be documented for certain values, but it will allow anything to go into the header.
> 
> So I've implemented a solution where my aliases file says:
> 
> bob: "|/path/to/rt/bin/rt-mailgate --queue Main --action correspond --url http://rt.example.org/ --extension for-bob"
> 
> And an on-create scrip that checks for the header and if it matches /^for-(\w+)/, try and give ownership to the matched value as a username.
> 

Why your scrip doesn't just look at the Delivered-To header of the mail
??



More information about the rt-users mailing list