From a9035b15612e90f549082561ab9664c2fda7f23b Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sat, 18 Jul 2015 10:19:34 -0400
Subject: [PATCH] Fix so *-request@ addresses in Sender: header are also ignored on reply-all (#1490452)

---
 CHANGELOG                      |    1 +
 program/steps/mail/compose.inc |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 00131a5..c14022d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,6 +14,7 @@
 - Fix handling of non-break spaces in html to text conversion (#1490436)
 - Fix self-reply detection issues (#1490439)
 - Fix multi-folder search result sorting by arrival date (#1490450)
+- Fix so *-request@ addresses in Sender: header are also ignored on reply-all (#1490452)
 
 RELEASE 1.1.2
 -------------
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index c529fc4..326b817 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -352,8 +352,12 @@
             if ($v = $MESSAGE->headers->cc)
                 $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
             // Use Sender header (#1489011)
-            if (($v = $MESSAGE->headers->get('Sender', false)) && strpos($v, '-bounces@') === false)
-                $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
+            if ($v = $MESSAGE->headers->get('Sender', false)) {
+                // Skip common mailing lists addresses: *-bounces@ and *-request@ (#1490452)
+                if (empty($MESSAGE->headers->others['list-post']) || !preg_match('/-(bounces|request)@/', $v)) {
+                    $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
+                }
+            }
 
             // When To: and Reply-To: are the same we add From: address to the list (#1489037)
             if ($v = $MESSAGE->headers->from) {
@@ -677,7 +681,6 @@
 
     return $out;
 }
-
 
 function rcmail_compose_editor_mode()
 {

--
Gitblit v1.9.1