aboutsummaryrefslogtreecommitdiffstats
path: root/main/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-07-06 10:21:15 +0300
committerTimo Teräs <timo.teras@iki.fi>2011-07-06 10:24:35 +0300
commit0e902e56b891ec024aba7b56e4edf0010d359cd0 (patch)
tree0d1e9f7a9420b36a13d5f662c9aa41a8ca22c0c5 /main/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch
parent2a12c1f8d7a9d2a292f74b915bd3ab55ecc4b3bc (diff)
downloadaports-0e902e56b891ec024aba7b56e4edf0010d359cd0.tar.bz2
aports-0e902e56b891ec024aba7b56e4edf0010d359cd0.tar.xz
main/rt4: create rt4 user, fix package permissions
* also add a patch to allow overriding of envelope-from from a template
Diffstat (limited to 'main/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch')
-rw-r--r--main/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/main/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch b/main/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch
new file mode 100644
index 0000000000..a7bbf33d9b
--- /dev/null
+++ b/main/rt4/0001-email-allow-envelope-from-overriding-from-templates.patch
@@ -0,0 +1,50 @@
+From f2f3542e163c534a437944089b801f6134c6b02a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
+Date: Wed, 6 Jul 2011 09:56:57 +0300
+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 | 11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
+index 620ca60..8bd94eb 100644
+--- a/lib/RT/Interface/Email.pm
++++ b/lib/RT/Interface/Email.pm
+@@ -343,7 +343,10 @@ sub SendEmail {
+
+ my $msgid = $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')
+@@ -408,16 +411,16 @@ sub SendEmail {
+
+ # SetOutgoingMailFrom
+ if ( RT->Config->Get('SetOutgoingMailFrom') ) {
+- my $OutgoingMailAddress;
++ my $OutgoingMailAddress = $envelope_from;
+
+ if ($TicketObj) {
+ my $QueueName = $TicketObj->QueueObj->Name;
+ my $QueueAddressOverride = RT->Config->Get('OverrideOutgoingMailFrom')->{$QueueName};
+
+ if ($QueueAddressOverride) {
+- $OutgoingMailAddress = $QueueAddressOverride;
++ $OutgoingMailAddress ||= $QueueAddressOverride;
+ } else {
+- $OutgoingMailAddress = $TicketObj->QueueObj->CorrespondAddress;
++ $OutgoingMailAddress ||= $TicketObj->QueueObj->CorrespondAddress;
+ }
+ }
+
+--
+1.7.1
+