Do not fill reply-to if the FROM address is the same as the reply-to

This commit is contained in:
Hadi Nategh 2018-11-20 15:13:40 +01:00
parent 10fa9cdd47
commit 037ce6d9fe

View File

@ -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;
}