fixed some problems in sqimap_read_body(). Please test it out.
[squirrelmail.git] / functions / smtp.php
index 9f595ca09dc354979055ebc3eb07ef12dfc64dd4..dae83a2a6f22fdf9516ebcec33721d531cd80ae9 100644 (file)
             $more_headers["In-Reply-To"] = $hdr->message_id;
             $more_headers["References"]  = $hdr->message_id;
          }
-         sqimap_mailbox_close($imap_stream);
       }
 
+      // In order to remove the problem of users not able to create
+         // messages with "." on a blank line, RFC821 has made provision
+         // in section 4.5.2 (Transparency).
+         $body = ereg_replace("\n\.", "\n\.\.", $body);
+         $body = ereg_replace("^\.", "\.\.", $body);
+
       // this is to catch all plain \n instances and
       // replace them with \r\n.  
       $body = ereg_replace("\r\n", "\n", $body);