Skip to content
Snippets Groups Projects
Commit e30622cb authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX Bcc must not appears to recipient when using SMTPs lib

parent c45c24f8
No related branches found
No related tags found
No related merge requests found
......@@ -527,7 +527,7 @@ class CMailFile
if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail();
if (! empty($bounce)) $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers, $bounce);
else $res = mail($dest,$this->encodetorfc2822($this->subject),$this->message,$this->headers);
else $res = mail($dest, $this->encodetorfc2822($this->subject), $this->message, $this->headers);
if (! $res)
{
......@@ -840,7 +840,7 @@ class CMailFile
// Receiver
if (isset($this->addr_cc) && $this->addr_cc) $out.= "Cc: ".$this->getValidAddress($this->addr_cc,2).$this->eol2;
if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2;
if (isset($this->addr_bcc) && $this->addr_bcc) $out.= "Bcc: ".$this->getValidAddress($this->addr_bcc,2).$this->eol2; // Question: bcc must not be into header, only into SMTP command "RCPT TO". Does php mail support this ?
// Delivery receipt
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $out.= "Disposition-Notification-To: ".$this->getValidAddress($this->addr_from,2).$this->eol2;
......
......@@ -484,14 +484,20 @@ class SMTPs
// and send it out "single file"
foreach ( $this->get_RCPT_list() as $_address )
{
/*
/* Note:
* BCC email addresses must be listed in the RCPT TO command list,
* but the BCC header should not be printed under the DATA command.
* http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server
*/
/*
* TODO
* After each 'RCPT TO:' is sent, we need to make sure it was kosher,
* if not, the whole message will fail
* If any email address fails, we will need to RESET the connection,
* mark the last address as "bad" and start the address loop over again.
* If any address fails, the entire message fails.
*/
* After each 'RCPT TO:' is sent, we need to make sure it was kosher,
* if not, the whole message will fail
* If any email address fails, we will need to RESET the connection,
* mark the last address as "bad" and start the address loop over again.
* If any address fails, the entire message fails.
*/
$this->socket_send_str('RCPT TO: <' . $_address . '>', '250');
}
......@@ -1020,7 +1026,7 @@ class SMTPs
/**
* Returns an array of addresses for a specific type; TO, CC or BCC
*
* @param string $_which Which collection of adresses to return
* @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc')
* @return string|false Array of emaill address
*/
function get_email_list($_which = null)
......@@ -1169,9 +1175,17 @@ class SMTPs
if ( $this->getCC() )
$_header .= 'Cc: ' . $this->getCC() . "\r\n";
/* Note:
* BCC email addresses must be listed in the RCPT TO command list,
* but the BCC header should not be printed under the DATA command.
* So it is included into the function sendMsg() but not here.
* http://stackoverflow.com/questions/2750211/sending-bcc-emails-using-a-smtp-server
*/
/*
if ( $this->getBCC() )
$_header .= 'Bcc: ' . $this->getBCC() . "\r\n";
*/
$host=$this->getHost();
$host=preg_replace('@tcp://@i','',$host); // Remove prefix
$host=preg_replace('@ssl://@i','',$host); // Remove prefix
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment