summaryrefslogtreecommitdiff
path: root/program/steps/mail/compose.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-05-01 11:11:39 +0200
committerAleksander Machniak <alec@alec.pl>2013-05-01 11:11:39 +0200
commitd2dff5e86505675961bf5a847e7a502b8131dee6 (patch)
tree1135ffe8169ebdd7bb127cdd2468812bbb5de12a /program/steps/mail/compose.inc
parent61943150d9c8dfdb710cc22b4cff1e54beaf7574 (diff)
Fix Reply-To header handling in Reply-All action (#1489037)
Diffstat (limited to 'program/steps/mail/compose.inc')
-rw-r--r--program/steps/mail/compose.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index cb22bf8ba..7205d12da 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -329,6 +329,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))) {