diff options
author | Kory Prince <korylprince@gmail.com> | 2018-03-22 13:52:31 -0500 |
---|---|---|
committer | Leonardo Arena <rnalrd@alpinelinux.org> | 2018-03-26 07:26:06 +0000 |
commit | 8a968286ba9850a24c8244137f5bdca3f78cd893 (patch) | |
tree | 4de0574a9798e434b562a68455ad094e2117c9d1 /community/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch | |
parent | b9f20e63a6482a743f83d534ec840b80bb346f8e (diff) | |
download | aports-8a968286ba9850a24c8244137f5bdca3f78cd893.tar.bz2 aports-8a968286ba9850a24c8244137f5bdca3f78cd893.tar.xz |
community/rt4: fix email patch for v4.4.2
Fixes #8712
Diffstat (limited to 'community/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch')
-rw-r--r-- | community/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/community/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch b/community/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch index 581b615dc6..ae48036cc5 100644 --- a/community/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch +++ b/community/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch @@ -1,29 +1,65 @@ -From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> +From 0fa9baf1004fb02a370cc78c1586f3207b1712b8 Mon Sep 17 00:00:00 2001 +From: Kory Prince <korylprince@gmail.com> +Date: Thu, 22 Mar 2018 13:00:02 -0500 Subject: [PATCH] email: allow envelope from overriding from templates Add X-RT-Envelope-From header that will override the envelope from if using sendmailpipe mail sending. +--- + lib/RT/Interface/Email.pm | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) -diff -ru rt-4.2.9.orig/lib/RT/Interface/Email.pm rt-4.2.9/lib/RT/Interface/Email.pm ---- rt-4.2.9.orig/lib/RT/Interface/Email.pm 2014-10-23 18:49:38.000000000 -0300 -+++ rt-4.2.9/lib/RT/Interface/Email.pm 2014-10-31 08:14:48.557121324 -0200 -@@ -754,7 +754,8 @@ +diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm +index 7466c0f78..b90bc1a73 100644 +--- a/lib/RT/Interface/Email.pm ++++ b/lib/RT/Interface/Email.pm +@@ -740,7 +740,14 @@ sub MailError { + } + + sub _OutgoingMailFrom { +- my $TicketObj = shift; ++ my (%args) = ( ++ Ticket => undef, ++ envelope_from => undef, ++ @_, ++ ); ++ ++ my $TicketObj = $args{'Ticket'}; ++ my $envelope_from = $args{'envelope_from'}; + + my $MailFrom = RT->Config->Get('SetOutgoingMailFrom'); + my $OutgoingMailAddress = $MailFrom =~ /\@/ ? $MailFrom : undef; +@@ -754,8 +761,9 @@ sub _OutgoingMailFrom { if ($QueueAddressOverride) { $OutgoingMailAddress = $QueueAddressOverride; } else { - $OutgoingMailAddress ||= $Queue->CorrespondAddress +- || RT->Config->Get('CorrespondAddress'); + $OutgoingMailAddress ||= $envelope_from -+ || $Queue->CorrespondAddress - || RT->Config->Get('CorrespondAddress'); ++ || $Queue->CorrespondAddress ++ || RT->Config->Get('CorrespondAddress'); } } -@@ -824,6 +825,9 @@ + elsif ($Overrides->{'Default'}) { +@@ -823,6 +831,9 @@ sub SendEmail { + my $msgid = Encode::decode( "UTF-8", $args{'Entity'}->head->get('Message-ID') || '' ); chomp $msgid; - ++ + my $envelope_from = $args{'Entity'}->head->get('X-RT-Envelope-From'); + chomp $envelope_from; -+ + # If we don't have any recipients to send to, don't send a message; unless ( $args{'Entity'}->head->get('To') - || $args{'Entity'}->head->get('Cc') +@@ -901,7 +912,7 @@ sub SendEmail { + if ( $args{'Bounce'} ) { + push @args, shellwords(RT->Config->Get('SendmailBounceArguments')); + } elsif ( RT->Config->Get('SetOutgoingMailFrom') ) { +- my $OutgoingMailAddress = _OutgoingMailFrom($TicketObj); ++ my $OutgoingMailAddress = _OutgoingMailFrom( $TicketObj, $envelope_from ); + + push @args, "-f", $OutgoingMailAddress + if $OutgoingMailAddress; +-- +2.15.1 + |