Commit f9c4caf1 authored by Christian Loos's avatar Christian Loos Committed by Alex Vandiver
Browse files

Allow queue id as key for OverrideOutgoingMailFrom hash

A queue name is easily changed within the WebUI and maybe the admin forget to
also update the OverrideOutgoingMailFrom setting. It more reliable to use the
queue id instead the queue name as the hash key.
parent e1fbb34a
......@@ -565,7 +565,7 @@ address of the queue as it is handed to sendmail -f. This helps force
the From_ header away from www-data or other email addresses that show
up in the "Sent by" line in Outlook.
The option is a hash reference of queue name to email address. If
The option is a hash reference of queue id/name to email address. If
there is no ticket involved, then the value of the C<Default> key will
be used.
......@@ -440,14 +440,15 @@ sub SendEmail {
my $Overrides = RT->Config->Get('OverrideOutgoingMailFrom') || {};
if ($TicketObj) {
my $QueueName = $TicketObj->QueueObj->Name;
my $QueueAddressOverride = $Overrides->{$QueueName};
my $Queue = $TicketObj->QueueObj;
my $QueueAddressOverride = $Overrides->{$Queue->id}
|| $Overrides->{$Queue->Name};
if ($QueueAddressOverride) {
$OutgoingMailAddress = $QueueAddressOverride;
} else {
$OutgoingMailAddress ||= $TicketObj->QueueObj->CorrespondAddress
|| RT->Config->Get('CorrespondAddress');
$OutgoingMailAddress ||= $Queue->CorrespondAddress
|| RT->Config->Get('CorrespondAddress');
elsif ($Overrides->{'Default'}) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment