From 3ee5a7200afc62d8eda2c0ce77743af4951147a3 Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 9 Dec 2010 19:10:44 +0000 Subject: - Improved Mail-Reply-To and Mail-Followup-To headers handling --- program/steps/mail/compose.inc | 20 ++++++-------------- program/steps/mail/func.inc | 8 ++++++-- program/steps/mail/sendmail.inc | 13 +++++++------ 3 files changed, 19 insertions(+), 22 deletions(-) (limited to 'program/steps/mail') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 8358559a6..45b95c937 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -267,19 +267,11 @@ function rcmail_compose_headers($attrib) $param = 'replyto'; $header = 'reply-to'; - case 'mailreplyto': - case 'mail-reply-to': + case 'followupto': + case 'followup-to': if (!$fname) { - $fname = '_mailreplyto'; - $param = 'mailreplyto'; - $header = 'mail-reply-to'; - } - - case 'mailfollowupto': - case 'mail-followup-to': - if (!$fname) { - $fname = '_mailfollowupto'; - $param = 'mailfollowupto'; + $fname = '_followupto'; + $param = 'followupto'; $header = 'mail-followup-to'; } @@ -354,10 +346,10 @@ function rcmail_compose_headers($attrib) $fvalue = $MESSAGE->get_header('cc'); else if ($header=='bcc' && !empty($MESSAGE->headers->bcc)) $fvalue = $MESSAGE->get_header('bcc'); + else if ($header=='reply-to' && !empty($MESSAGE->headers->others['mail-reply-to'])) + $fvalue = $MESSAGE->get_header('mail-reply-to'); else if ($header=='reply-to' && !empty($MESSAGE->headers->replyto)) $fvalue = $MESSAGE->get_header('reply-to'); - else if ($header=='mail-reply-to' && !empty($MESSAGE->headers->others['mail-reply-to'])) - $fvalue = $MESSAGE->get_header('followup-to'); else if ($header=='mail-followup-to' && !empty($MESSAGE->headers->others['mail-followup-to'])) $fvalue = $MESSAGE->get_header('mail-followup-to'); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 9e485eb36..750cf6f61 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -927,10 +927,14 @@ function rcmail_message_headers($attrib, $headers=NULL) else $header_value = trim($IMAP->decode_header($value)); - $output_headers[$hkey] = array('title' => rcube_label($hkey), 'value' => $header_value, 'raw' => $value); + $output_headers[$hkey] = array( + 'title' => rcube_label(preg_replace('/(^mail-|-)/', '', $hkey)), + 'value' => $header_value, 'raw' => $value + ); } - $plugin = $RCMAIL->plugins->exec_hook('message_headers_output', array('output' => $output_headers, 'headers' => $MESSAGE->headers)); + $plugin = $RCMAIL->plugins->exec_hook('message_headers_output', + array('output' => $output_headers, 'headers' => $MESSAGE->headers)); // compose html table $table = new html_table(array('cols' => 2)); diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index a796c7ba7..07f32b8ac 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -322,15 +322,16 @@ $headers['Subject'] = trim(get_input_value('_subject', RCUBE_INPUT_POST, TRUE, $ if (!empty($identity_arr['organization'])) $headers['Organization'] = $identity_arr['organization']; -if (!empty($_POST['_replyto'])) - $headers['Reply-To'] = rcmail_email_input_format(get_input_value('_replyto', RCUBE_INPUT_POST, TRUE, $message_charset)); +if (!empty($_POST['_replyto'])) { + $reply_to = rcmail_email_input_format(get_input_value('_replyto', RCUBE_INPUT_POST, TRUE, $message_charset)); + $headers['Reply-To'] = $reply_to; + $headers['Mail-Reply-To'] = $reply_to; +} else if (!empty($identity_arr['reply-to'])) $headers['Reply-To'] = rcmail_email_input_format($identity_arr['reply-to'], false, true); -if (!empty($_POST['_mailfollowupto'])) - $headers['Mail-Followup-To'] = rcmail_email_input_format(get_input_value('_mailfollowupto', RCUBE_INPUT_POST, TRUE, $message_charset)); -if (!empty($_POST['_mailreplyto'])) - $headers['Mail-Reply-To'] = rcmail_email_input_format(get_input_value('_mailreplyto', RCUBE_INPUT_POST, TRUE, $message_charset)); +if (!empty($_POST['_followupto'])) + $headers['Mail-Followup-To'] = rcmail_email_input_format(get_input_value('_followupto', RCUBE_INPUT_POST, TRUE, $message_charset)); if (!empty($_SESSION['compose']['reply_msgid'])) $headers['In-Reply-To'] = $_SESSION['compose']['reply_msgid']; -- cgit v1.2.3