one more identity action to process
[squirrelmail.git] / class / deliver / Deliver_SendMail.class.php
index 109a5d30b9a5828535bd7801ecba0c6ab18fe0f8..dab811769bc4fda3272589beebe220a72f7c75cd 100644 (file)
@@ -2,7 +2,7 @@
 /**
  * Deliver_SendMail.class.php
  *
- * @copyright Copyright (c) 1999-2004 The SquirrelMail Project Team
+ * @copyright Copyright (c) 1999-2005 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Delivery backend for the Deliver class.
@@ -15,7 +15,7 @@
 
 /** This of course depends upon Deliver */
 require_once(SM_PATH . 'class/deliver/Deliver.class.php');
+
 /**
  * Delivers messages using the sendmail binary
  * @package squirrelmail
@@ -27,15 +27,15 @@ class Deliver_SendMail extends Deliver {
     *
     * 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. 
-    *  
+    * 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);
+           $s = str_replace("\r\n", "\n", $s);
        }
     }
 
@@ -43,63 +43,63 @@ class Deliver_SendMail extends Deliver {
     * 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 
-    */    
+    * @access public
+    */
     function initStream($message, $sendmail_path) {
         $rfc822_header = $message->rfc822_header;
-       $from = $rfc822_header->from[0];
-       $envelopefrom = trim($from->mailbox.'@'.$from->host);
+        $from = $rfc822_header->from[0];
+        $envelopefrom = trim($from->mailbox.'@'.$from->host);
         $envelopefrom = str_replace(array("\0","\n"),array('',''),$envelopefrom);
-       if (strstr($sendmail_path, "qmail-inject")) {
-           $stream = popen (escapeshellcmd("$sendmail_path -f$envelopefrom"), "w");
-       } else {
-           $stream = popen (escapeshellcmd("$sendmail_path -i -t -f$envelopefrom"), "w");
-       }
-       return $stream;
+        if (strstr($sendmail_path, "qmail-inject")) {
+            $stream = popen (escapeshellcmd("$sendmail_path -f$envelopefrom"), "w");
+        } else {
+            $stream = popen (escapeshellcmd("$sendmail_path -i -t -f$envelopefrom"), "w");
+        }
+        return $stream;
     }
 
    /**
     * function finalizeStream
     *
     * Close the stream.
-    *  
+    *
     * @param resource $stream
     * @return boolean
     * @access public
-    */    
+    */
     function finalizeStream($stream) {
-       pclose($stream);
-       return true;
+        pclose($stream);
+        return true;
     }
 
    /**
     * 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, 
+    * 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 
+    * Implemented to fix sendmail->postfix rejection of messages with
     * attachments because of stray LF's
     *
-    * @param string $s string to strip of CR's 
+    * @param string $s string to strip of CR's
     * @return integer length of string including a CR for each LF
-    * @access private 
+    * @access private
     */
     function clean_crlf(&$s) {
         $s = str_replace("\r\n", "\n", $s);
@@ -107,7 +107,7 @@ class Deliver_SendMail extends Deliver {
         $s2 = str_replace("\n", "\r\n", $s);
         return strlen($s2);
     }
-    
+
 
 }
-?>
+?>
\ No newline at end of file