Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
Warning: Cannot modify header information - headers already sent by (output started at /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code:102) in /var/www/iplanru/data/www/intesco.ru/d59ed/index.php(1) : eval()'d code(2) : eval()'d code on line 4
sendmail_args = $params['sendmail_args'];
}
}
}
/**
* function preWriteToStream
*
* Sendmail needs LF's as line endings instead of CRLF.
* This function translates the line endings to LF and should be called
* before each line is written to the stream.
*
* @param string $s Line to process
* @return void
* @access private
*/
function preWriteToStream(&$s) {
if ($s) {
$s = str_replace("\r\n", "\n", $s);
}
}
/**
* function initStream
*
* Initialise the sendmail connection.
*
* @param Message $message Message object containing the from address
* @param string $sendmail_path Location of sendmail binary
* @return void
* @access public
*/
function initStream($message, $sendmail_path) {
$rfc822_header = $message->rfc822_header;
$from = $rfc822_header->from[0];
$envelopefrom = trim($from->mailbox.'@'.$from->host);
$envelopefrom = str_replace(array("\0","\n"),array('',''),$envelopefrom);
// save executed command for future reference
$this->sendmail_command = "$sendmail_path $this->sendmail_args -f$envelopefrom";
// open process handle for writing
$stream = popen(escapeshellcmd($this->sendmail_command), "w");
return $stream;
}
/**
* function finalizeStream
*
* Close the stream.
*
* @param resource $stream
* @return boolean
* @access public
*/
function finalizeStream($stream) {
$ret = true;
$status = pclose($stream);
// check pclose() status.
if ($status!=0) {
$ret = false;
$this->dlv_msg=_("Email delivery error");
$this->dlv_ret_nr=$status;
// we can get better error messsage only if we switch to php 4.3+ and proc_open().
$this->dlv_server_msg=sprintf(_("Can't execute command '%s'."),$this->sendmail_command);
}
return $ret;
}
/**
* function getBcc
*
* In case of sendmail, the rfc822header must contain the bcc header.
*
* @return boolean true if rfc822header should include the bcc header.
* @access private
*/
function getBcc() {
return true;
}
/**
* function clean_crlf
*
* Cleans each line to only end in a LF
* Returns the length of the line including a CR,
* so that length is correct when the message is saved to imap
* Implemented to fix sendmail->postfix rejection of messages with
* attachments because of stray LF's
*
* @param string $s string to strip of CR's
* @return integer length of string including a CR for each LF
* @access private
*/
function clean_crlf(&$s) {
$s = str_replace("\r\n", "\n", $s);
$s = str_replace("\r", "\n", $s);
$s2 = str_replace("\n", "\r\n", $s);
return strlen($s2);
}
}