Custom headers in outbound mail

We’d like to add another header in outbound emails from RT to indicate the name of the queue. eg X-RT-Queue.

Is there any way to do this other than modifying the source (making upgrading a mess), or modifying each and every one of the templates?


So that you’re not modifying core code, you can create a local overlay of the file and just overlay one sub routine from that file.

If you create the file:

You can then add the package RT::Action::SendEmail; and overlay an existing subroutine that gets called like SetRTSpecialHeaders and add your code to include the custom header

You can create separate correspond scrips per Queue that use separate templates for each Queue respectively. Then add your custom header in the templates defining the queue that sent the email.

New line characters are key on templates, add your custom header before the body of the email.

For example i will modify the “Correspondence in HTML” template
The italics parts (lines before the new line charter) are the header part of the email sent.
The normal text is the body of the email.

Original :

RT-Attach-Message: yes
Content-Type: text/html

{$Transaction->Content( Type => “text/html”)}

Modified :

RT-Attach-Message: yes
Content-Type: text/html
X-RT-Queue: MyQueue

{$Transaction->Content( Type => “text/html”)}

This technique has survived for me from 4.4.1 to 5.0.1, and needs 0 perl lines to work