From 0a7df4a32e86a103a5f1fe801374383a195ba1a5 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 03 Jun 2013 03:59:14 -0400
Subject: [PATCH] Fix so bounces addresses in Sender headers are skipped on Reply-All (#1489011)

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

diff --git a/CHANGELOG b/CHANGELOG
index dc74f81..991eebc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Fix so bounces addresses in Sender headers are skipped on Reply-All (#1489011)
 - Fix bug where serialized strings were truncated in PDO::quote() (#1489142)
 - Fix displaying messages with invalid self-closing HTML tags (#1489137)
 - Fix PHP warning when responding to a message with many Return-Path headers (#1489136)
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index 3787da3..47dfa52 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -318,7 +318,8 @@
         $fvalue .= $v;
       if ($v = $MESSAGE->headers->cc)
         $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
-      if ($v = $MESSAGE->headers->get('Sender', false))
+      // Use Sender header (#1489011)
+      if (($v = $MESSAGE->headers->get('Sender', false)) && strpos($v, '-bounces@') === false)
         $fvalue .= (!empty($fvalue) ? $separator : '') . $v;
 
       // When To: and Reply-To: are the same we add From: address to the list (#1489037)

--
Gitblit v1.9.1