Multiple Reply Addresses For A Single Queue

Hi All,

I have multiple email addresses associated with a single queue
For ex: abc@xyz.com as well as pqr@lmn.com pointing to the same queue “queue-one”

We only have an option to set either of these email address in the Reply Address field in the Queue Creation form.
However, I want to configure the reply address dynamically based on the email address…
For ex: If an end user sends an email to abc@xyz.com, auto-alert should be sent via that email as well as upon replies by end user, it should be redirected to the same email address
and vice versa for pqr@lmn.com

Has anyone configured this in RTracker…? Need help around this…

@knation @knation2 @GreenJimll

You can set the Reply-To header in your email templates, so add some Perl code using {} to decide what the outgoing Reply-To address should be.

The other option would be to overlay the function in RT::Interface::Email that handles setting the header

Isn’t this too difficult? I’d try to adapt the reply Template. When you put on the first line some code which sets From address based on Requestor addres, it should work as desired. See Customizing/Templates - RT 4.4.5 Documentation - Best Practical

I’m wondering why you just don’t have two queues? You can have the same group(s) of privileged users associated with each, same scrips, etc but each would have a different reply-to email address and you would mail into each one separately. Seems much easier to me. What am I missing?

basically we have multiple sub-orgs and there’s a need to keep some of the functions are common across these sub-orgs
for instance: network related, infosec related tickets

now these sub-orgs will have their own support email id for these functions but we want to just have one queue catering to these requests and reply-to address should be identified on the basis of the sub-org or the origin of the ticket.

hope this clears the requirement!

any reference to take a look at…?

how do I dynamically set the reply address based on the requestor…? also I want it to be decided by the queue email address.
for ex: if an end user is sending to abc@xyz.com, reply address should be abc@xyz.com and so on

Docs for customizing templates can be found here:
https://docs.bestpractical.com/rt/5.0.2/customizing/templates.html#Headers

I’d try something like this in a template:

RT-Attach-Message: yes
From: {
my $from = '111@111.com';
$from = '222@222.com' if ($Ticket->RequestorAddresses =~ /\@gmail.com/);
$from = '333@333.com' if ($Ticket->RequestorAddresses =~ /\@yahoo.com/);
$from = '444@444.com' if ($Ticket->RequestorAddresses =~ /\@hotmail.com/);
$from;
}

{$Transaction->Content()}

Well, after this you get the right From but RT will add Reply-To address to your queue addres. To avoid that add to the template header once more the same for Reply-To. So the final template would be:

RT-Attach-Message: yes
From: {
my $from = '111@111.com';
$from = '222@222.com' if ($Ticket->RequestorAddresses =~ /\@gmail.com/);
$from = '333@333.com' if ($Ticket->RequestorAddresses =~ /\@yahoo.com/);
$from = '444@444.com' if ($Ticket->RequestorAddresses =~ /\@hotmail.com/);
$from;
}
Reply-To: {
my $from = '111@111.com';
$from = '222@222.com' if ($Ticket->RequestorAddresses =~ /\@gmail.com/);
$from = '333@333.com' if ($Ticket->RequestorAddresses =~ /\@yahoo.com/);
$from = '444@444.com' if ($Ticket->RequestorAddresses =~ /\@hotmail.com/);
$from;
}    

{$Transaction->Content()}

thanks for the snippet… can this be implemented in a way where in all the auto-replies such as upon ticket creation, replies from technicians to enduser via rtracker, closure and any other mail related activities to follow the approach as expected…?

You can put this to whatever Template you want. Just look to Scrips, find what Templates they use and modify the Templates. Slightly updated code for efficiency (not so many database queries) is here:

RT-Attach-Message: yes
{
my $header1 = "From: ";
my $header2 = "Reply-To: ";
my $requestor = $Ticket->RequestorAddresses || "";
my $from = '111@111.com';
$from = '222@222.com' if ($requestor =~ /\@gmail.com/);
$from = '333@333.com' if ($requestor =~ /\@yahoo.com/);
$from = '444@444.com' if ($requestor =~ /\@hotmail.com/);
$from = $header1 . $from . "\n" . $header2 . $from;
$from;
}

{$Transaction->Content()}

A queue is a temporary holding location for messages that are waiting to enter the next stage of processing or delivery to a destination. Each queue represents a logical set of messages that the Exchange server processes in a specific order.

targetpayandbenefits