From 037ce6d9fe3340aee0cd8d33aeeb24619e1cd552 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 20 Nov 2018 15:13:40 +0100 Subject: [PATCH] Do not fill reply-to if the FROM address is the same as the reply-to --- mail/inc/class.mail_compose.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mail/inc/class.mail_compose.inc.php b/mail/inc/class.mail_compose.inc.php index 01168e3f53..4686a5c4b0 100644 --- a/mail/inc/class.mail_compose.inc.php +++ b/mail/inc/class.mail_compose.inc.php @@ -1746,10 +1746,11 @@ class mail_compose } } + $fromAddr = Mail::parseAddressList($addHeadInfo['FROM'])[0]; foreach((array)$headers['REPLY-TO'] as $val) { $rfcAddr=Mail::parseAddressList($val); $_rfcAddr = $rfcAddr[0]; - if (!$_rfcAddr->valid) continue; + if (!$_rfcAddr->valid || ($_rfcAddr->mailbox == $fromAddr->mailbox && $_rfcAddr->host == $fromAddr->host)) continue; if($_rfcAddr->mailbox == 'undisclosed-recipients' || (empty($_rfcAddr->mailbox) && empty($_rfcAddr->host)) ) { continue; }