From 5777c73d3dd93687e4b970b7d5662d77b0f342b9 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Mon, 17 Jun 2013 20:31:07 +0000 Subject: [PATCH] When replying to original recipient, also reset the identity used to send the mail from git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14381 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/compose.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/compose.php b/src/compose.php index 6be4dff8..7c051643 100644 --- a/src/compose.php +++ b/src/compose.php @@ -1028,6 +1028,22 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se if (!empty($orig_to)) { $send_to = $orig_to; + + // in this case, we also want to reset the FROM + // identity as well (it should match the original + // *FROM* header instead of TO or CC) + // + if (count($idents) > 1) { + $identity = ''; + foreach($idents as $i => $id) { + if (!empty($id['email_address']) + && strpos($orig_from, $id['email_address']) !== FALSE) { + $identity = $i; + break; + } + } + } + } } -- 2.25.1