* Found my bug
[squirrelmail.git] / functions / smtp.php
index 64db214aae750a3c437db1e9252353c4abf37734..52d554bb63e8e007e96d09a80dce7dda909e36e8 100644 (file)
                  $tmp = str_replace("\r\n", "\n", $tmp);
                  $tmp = str_replace("\r", "\n", $tmp);
                  $tmp = str_replace("\n", "\r\n", $tmp);
-                 $tmp .= "\r\n";
+                 if (feof($fp) && substr($tmp, -2) != "\r\n")
+                    $tmp .= "\r\n";
                  fputs($fp, $tmp);
                  $length += strlen($tmp);
               }