-implented function clean_crlf
authorvanmer <vanmer@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 3 May 2004 22:22:44 +0000 (22:22 +0000)
committervanmer <vanmer@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 3 May 2004 22:22:44 +0000 (22:22 +0000)
-Implemented to fix sendmail->postfix rejection of messages with attachments because of stray LF's

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7353 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/deliver/Deliver_SendMail.class.php

index 44095a613cd6dcf11081869d56a107d6ba77fc0f..57e92ae34df9fa973c8623f6affce48385bd334f 100644 (file)
@@ -47,6 +47,24 @@ class Deliver_SendMail extends Deliver {
     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 
+    */
+    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);
+    }
     
 }
 ?>