RT 4.4.4 - Queue-specific template overrides feature problem


Our setup of RT is like this:

We are located at many places around our country, and for each location we have an uniq email address, and we have created a uniq queue for each location, and we are using the RT::Extension::ExtractCustomFieldValues to automatic look at the To: email header and find out what queue the incoming email/ticket should be placed in. All that works perfect!

Example, we have an email adress “email_1@nnn.nnn”, and we have a queue “email_1” in RT, and when someone use the email adress “email_1@nnn.nnn” to send us an email - the new ticket is placed in the queue “email_1” automatic when a ticket is created inside RT.

In all our templates we have this line at the top,

From: “Company nnnn - Location nnnnnn” nnnnn@nnn.nnn

I wanted instead of just showing when someone recieving email from RT the “nnnn@nnn.nnn” as the From: - I also wanted to have some info ahead of the email adress, like used in the templates above.

The only problem with this setup is that all the queues are having the same From: address when we do any transaction with a ticket, and we want each queue to have their own uniq From: address when we do any transaction in a queue. I found this
and started doing some test based upon that, and so far it seems to be working, I have now uniq From: adress for a queue when I do a reply, inform requestor that a ticket is reopening, forward transaction, forward ticket. And if I reply from inside another queue not having uniq templates it’s using the standard templates.

The problem is with the autoreply template when the email comes into RT and RT creates a ticket, and RT send out an autoreply with info about ticket number etc.

I have done exactly the same to have a uniq template for a queue based upon the same name as the standard autoreply template, and have a uniq From: header but RT doesn’t use the uniq autoreply template for the queue the ticket belongs to, instead RT is using the standard autoreply template.

I suppose it has to do with the sequence how RT deals with a ticket creation, and that the autoreply is done before a ticket is moved into a queue, and therefore RT uses the standard autoreply template.

I read somewhere in the RT documentation that if you used the alphabetically sorted listing of the scrips you could choose what scrips runs first and second etc. In my scrips list I have at top a scrips named “000.ExtractCustomFieldValues_move_ticket_to_correct_queue”, and below that I have “001.On Create Autoreply to Requestors”.

Any ideas why autoreply choose the standard template instead of queue’s uniq autoreply template?

Is there other clever way to make any outgoing transactions to check what queue does this ticket belong to, and then make a From: header based upon that queue, instead of creating all these uniq queue templates - that’s alot of work to create for 50 queues for all the different transaction templates, and if we are changing the standard templates, I have to edit all the uniq templates for 50 queues, sigh…

Thanks, bye

You have a unique email address that maps to a unique queue right?

Instead of using the extract custom field values extension you can map each email to their respective queue, see the mailgate documentation.

You can have each email point to a queue, for example, maybe you have “europe@nnn.nnn”:

Europe:         "|/opt/rt4/bin/rt-mailgate --queue Europe --action correspond
              --url http://rt.mycorp.com/"

Then as an admin RT user you can go to Admin->Queues->Some queue and set the “Reply address” which will be the address that corresponds on tickets in that queue will be “from”.

1 Like


Yes, we have uniq email adress for each place in the country, not aliases or something that remaps into a main email adress. And we have a uniq queue for each uniq email address.

I will look into your suggestion next week.

Just a quick question to this solution, as I don’t want just a simple From: adress when we send out any transactions from RT. Will this help to have a uniq From: address for a queue that not only have an outgoing email address but a “name” attached to the email adress, like I wrote.

Example; From: "Company - Location nnnnnn" <nnnnn@nnn.nnn>

When someone gets our reply their email software will show that the email comes from “Company - Location nnnnn”.

Thanks for your suggestion, bye

You can look at this config option:


Maybe that is what you are looking for? You can have the name be the RT user’s name and then the actual from address that the recipient will reply to will be the “reply address” from the queue config page.


Sorry I used the word “name” in my last reply, as I’m not sure what that part of the email address is called. We don’t wan’t the RT personell names part of the From: since we want all reply to come from the “Company”, and the RT personell could have their own name in the signature if they want.

Thanks, bye


I have now changed all the email adresses we use from using “extract custom field” extension to instead directly move into queue using mailgate feature, and now the autoreply unique templates works correct, like the unique templates for reply etc.

Thanks for the help, bye!