diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-05-01 11:11:39 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-05-01 11:12:12 +0200 |
commit | 283ac978524b62383afaa784c4ec62ca4b96882f (patch) | |
tree | ffce11d52a13b80565f01b4b0d7082726ac6905c /program/steps | |
parent | 9b82062f5a5e439edd0a7a3b352ce8159b3aa797 (diff) |
Fix Reply-To header handling in Reply-All action (#1489037)
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/mail/compose.inc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index b0591d085..dae1d43e5 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -320,6 +320,17 @@ foreach ($parts as $header) { $fvalue .= (!empty($fvalue) ? $separator : '') . $v; if ($v = $MESSAGE->headers->get('Sender', false)) $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) { + $from = rcube_mime::decode_address_list($v, null, false, $MESSAGE->headers->charset, true); + $to = rcube_mime::decode_address_list($MESSAGE->headers->to, null, false, $MESSAGE->headers->charset, true); + $replyto = rcube_mime::decode_address_list($MESSAGE->headers->replyto, null, false, $MESSAGE->headers->charset, true); + + if (count($replyto) && !count(array_diff($to, $replyto)) && count(array_diff($from, $to))) { + $fvalue .= (!empty($fvalue) ? $separator : '') . $v; + } + } } } else if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) { |