summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-09 08:44:21 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-08-09 08:44:21 +0000
commit1ed20aaeed5b43de831c93a1cbf6d1f9fffb25b7 (patch)
treeed11640245f31821adfa1ef60a80539a7efa3889 /roundcubemail/program
parent167e4cb780ebaf87ad102defc3c33b50e6407422 (diff)
- Fix handling Mail-Reply-To header in Reply All action
git-svn-id: https://svn.roundcube.net/trunk@5032 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/steps/mail/compose.inc18
1 files changed, 6 insertions, 12 deletions
diff --git a/roundcubemail/program/steps/mail/compose.inc b/roundcubemail/program/steps/mail/compose.inc
index d726d8c86..1934194ce 100644
--- a/roundcubemail/program/steps/mail/compose.inc
+++ b/roundcubemail/program/steps/mail/compose.inc
@@ -274,18 +274,12 @@ else if (count($MESSAGE->identities)) {
$ident = format_email_recipient($email, $sql_arr['name']);
// select identity
- if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) {
+ if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT, RCUBE_COMPOSE_REPLY))) {
if ($MESSAGE->headers->from == $ident) {
$from_idx = $idx;
break;
}
}
- // reply to self, force To header value
- else if ($compose_mode == RCUBE_COMPOSE_REPLY && $MESSAGE->headers->from == $ident) {
- $from_idx = $idx;
- $MESSAGE->compose['to'] = $MESSAGE->headers->to;
- break;
- }
// set identity if it's one of the reply-message recipients
else if (in_array($email, $a_recipients) && ($from_idx === null || $sql_arr['standard'])) {
$from_idx = $idx;
@@ -335,13 +329,13 @@ foreach ($parts as $header) {
$mailfollowup = $MESSAGE->headers->others['mail-followup-to'];
$mailreplyto = $MESSAGE->headers->others['mail-reply-to'];
- if ($MESSAGE->compose['to'])
- $fvalue = $MESSAGE->compose['to'];
- else if ($MESSAGE->reply_all == 'list' && $mailfollowup)
+ if ($MESSAGE->reply_all == 'list' && $mailfollowup)
$fvalue = $mailfollowup;
else if ($MESSAGE->reply_all == 'list'
&& preg_match('/<mailto:([^>]+)>/i', $MESSAGE->headers->others['list-post'], $m))
$fvalue = $m[1];
+ else if ($MESSAGE->reply_all && $mailfollowup)
+ $fvalue = $mailfollowup;
else if ($mailreplyto)
$fvalue = $mailreplyto;
else if (!empty($MESSAGE->headers->replyto))
@@ -385,7 +379,7 @@ foreach ($parts as $header) {
$mailto = mb_strtolower(rcube_idn_to_utf8($addr_part['mailto']));
if (!in_array($mailto, $a_recipients)
- && (empty($MESSAGE->compose['from_email']) || $mailto != $MESSAGE->compose['from_email'])
+ && ($header == 'to' || empty($MESSAGE->compose['from_email']) || $mailto != $MESSAGE->compose['from_email'])
) {
if ($addr_part['name'] && $addr_part['mailto'] != $addr_part['name'])
$string = format_email_recipient($mailto, $addr_part['name']);
@@ -396,7 +390,7 @@ foreach ($parts as $header) {
$a_recipients[] = $addr_part['mailto'];
}
}
-
+
$fvalue = implode(', ', $fvalue);
}