Bugfix invalid DKIM-signature with zero To-addresses
When using PHP's mail() function, and when there are no To-addressees (e.g. only BCC), then the DKIM-signature was not correct. There was a discrepancy between how mail() was called (empty $to) versus the DKIM-signature ('undisclosed-recipients:;').
This commit is contained in:
parent
fadcb6abe1
commit
0bddcf9141
|
|
@ -1892,6 +1892,12 @@ class PHPMailer
|
|||
$toArr[] = $this->addrFormat($toaddr);
|
||||
}
|
||||
$to = implode(', ', $toArr);
|
||||
|
||||
//If there are no To-addresses (e.g. when sending only to BCC-addresses)
|
||||
//the following should be added to get a correct DKIM-signature.
|
||||
//Compare with $this->preSend()
|
||||
if(trim($to) == '') { $to = 'undisclosed-recipients:;'; }
|
||||
|
||||
|
||||
$params = null;
|
||||
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
||||
|
|
|
|||
Loading…
Reference in New Issue