From b268e66b4b96c4e2b8b44eae8161e7557b6eaf7c Mon Sep 17 00:00:00 2001 From: kink Date: Fri, 25 Jul 2003 21:02:32 +0000 Subject: [PATCH] Add support for Mail-Followup-To to devel. In short, Reply To All will set To to the value of this header if set. http://cr.yp.to/proto/replyto.html http://www.ietf.org/proceedings/98dec/I-D/draft-ietf-drums-mail-followup-to-00.txt I'm not a real DJB-enthousiast, but reportedly quite some software uses this header; no harm in supporting it if it's present. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5421 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + class/mime/Rfc822Header.class.php | 4 ++++ src/compose.php | 25 ++++++++++++++++--------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 337536d8..721af7e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -64,6 +64,7 @@ Version 1.5.0 -- CVS display preferences in stead of Default. - Updated 'action' to be 'smaction' so that plugins can modify the submit/action of forms. This was suggested for the gpg plugin, but might be useful elsewhere. + - Add support for Mail-Followup-To header. ************************************** *** SquirrelMail Stable Series 1.4 *** diff --git a/class/mime/Rfc822Header.class.php b/class/mime/Rfc822Header.class.php index ca5ade5e..9f495f24 100644 --- a/class/mime/Rfc822Header.class.php +++ b/class/mime/Rfc822Header.class.php @@ -21,6 +21,7 @@ class Rfc822Header { $from = array(), $sender = '', $reply_to = array(), + $mail_followup_to = array(), $to = array(), $cc = array(), $bcc = array(), @@ -125,6 +126,9 @@ class Rfc822Header { case 'reply-to': $this->reply_to = $this->parseAddress($value, true); break; + case 'mail-followup-to': + $this->mail_followup_to = $this->parseAddress($value, true); + break; case 'to': $this->to = $this->parseAddress($value, true); break; diff --git a/src/compose.php b/src/compose.php index 5211cf68..451a5a50 100644 --- a/src/compose.php +++ b/src/compose.php @@ -694,16 +694,23 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se $body = ''; break; case ('reply_all'): - $send_to_cc = replyAllString($orig_header); - $send_to_cc = decodeHeader($send_to_cc,false,true); - case ('reply'): - $send_to = $orig_header->reply_to; - if (is_array($send_to) && count($send_to)) { - $send_to = $orig_header->getAddr_s('reply_to'); - } else if (is_object($send_to)) { /* unnessecarry, just for falesafe purpose */ - $send_to = $orig_header->getAddr_s('reply_to'); + if(isset($orig_header->mail_followup_to) && $orig_header->mail_followup_to) { + $send_to = $orig_header->getAddr_s('mail_followup_to'); } else { - $send_to = $orig_header->getAddr_s('from'); + $send_to_cc = replyAllString($orig_header); + $send_to_cc = decodeHeader($send_to_cc,false,true); + } + case ('reply'): + // skip this if send_to was already set right above here + if(!$send_to) { + $send_to = $orig_header->reply_to; + if (is_array($send_to) && count($send_to)) { + $send_to = $orig_header->getAddr_s('reply_to'); + } else if (is_object($send_to)) { /* unneccesarry, just for failsafe purpose */ + $send_to = $orig_header->getAddr_s('reply_to'); + } else { + $send_to = $orig_header->getAddr_s('from'); + } } $send_to = decodeHeader($send_to,false,true); $subject = decodeHeader($orig_header->subject,false,true); -- 2.25.1