Fix: Option MAIN_MAIL_SENDMAIL_FORCE_BA and MAIN_FIX_BUGGED_MTA was not
complete.
This commit is contained in:
parent
cc648e7eb2
commit
22d1847250
@ -104,11 +104,15 @@ class CMailFile
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// We define end of line (RFC 822bis section 2.3)
|
// We define end of line (RFC 821).
|
||||||
$this->eol="\r\n";
|
$this->eol="\r\n";
|
||||||
// eol2 is for header fields to manage bugged MTA with option MAIN_FIX_FOR_BUGGED_MTA
|
// We define end of line for header fields (RFC 822bis section 2.3 says header must contains \r\n).
|
||||||
$this->eol2=$this->eol;
|
$this->eol2="\r\n";
|
||||||
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA)) $this->eol2="\n";
|
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
||||||
|
{
|
||||||
|
$this->eol="\n";
|
||||||
|
$this->eol2="\n";
|
||||||
|
}
|
||||||
|
|
||||||
// On defini mixed_boundary
|
// On defini mixed_boundary
|
||||||
$this->mixed_boundary = "multipart_x." . time() . ".x_boundary";
|
$this->mixed_boundary = "multipart_x." . time() . ".x_boundary";
|
||||||
@ -547,6 +551,7 @@ class CMailFile
|
|||||||
/**
|
/**
|
||||||
* Write content of a SMTP request into a dump file (mode = all)
|
* Write content of a SMTP request into a dump file (mode = all)
|
||||||
* Used for debugging.
|
* Used for debugging.
|
||||||
|
* Note that to see full SMTP protocol, you can use tcpdump -w /tmp/smtp -s 2000 port 25"
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -646,7 +651,11 @@ class CMailFile
|
|||||||
|
|
||||||
// Sender
|
// Sender
|
||||||
//$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2;
|
//$out.= "Sender: ".getValidAddress($this->addr_from,2)).$this->eol2;
|
||||||
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
|
$out.= "From: ".$this->getValidAddress($this->addr_from,3,1).$this->eol2;
|
||||||
|
if (! empty($conf->global->MAIN_MAIL_SENDMAIL_FORCE_BA))
|
||||||
|
{
|
||||||
|
$out.= "To: ".$this->getValidAddress($this->addr_to,0,1).$this->eol2;
|
||||||
|
}
|
||||||
$out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2;
|
$out.= "Return-Path: ".$this->getValidAddress($this->addr_from,0,1).$this->eol2;
|
||||||
if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2;
|
if (isset($this->reply_to) && $this->reply_to) $out.= "Reply-To: ".$this->getValidAddress($this->reply_to,2).$this->eol2;
|
||||||
if (isset($this->errors_to) && $this->errors_to) $out.= "Errors-To: ".$this->getValidAddress($this->errors_to,2).$this->eol2;
|
if (isset($this->errors_to) && $this->errors_to) $out.= "Errors-To: ".$this->getValidAddress($this->errors_to,2).$this->eol2;
|
||||||
@ -738,7 +747,11 @@ class CMailFile
|
|||||||
|
|
||||||
// Make RFC821 Compliant, replace bare linefeeds
|
// Make RFC821 Compliant, replace bare linefeeds
|
||||||
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
|
$strContent = preg_replace("/(?<!\r)\n/si", "\r\n", $strContent);
|
||||||
|
if (! empty($conf->global->MAIN_FIX_FOR_BUGGED_MTA))
|
||||||
|
{
|
||||||
|
$strContent = preg_replace("/\r\n/si", "\n", $strContent);
|
||||||
|
}
|
||||||
|
|
||||||
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged
|
//$strContent = rtrim(chunk_split($strContent)); // Function chunck_split seems bugged
|
||||||
$strContent = rtrim(wordwrap($strContent));
|
$strContent = rtrim(wordwrap($strContent));
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user