Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.1

Bug #18563 SMTP data is being terminated prematurely
Submitted: 2011-05-25 21:58 UTC
From: slusarz Assigned: jon
Status: Closed Package: Net_SMTP (version 1.5.2)
PHP Version: 5.3.6 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2011-05-25 21:58 UTC] slusarz (Michael Slusarz)
Description: ------------ Rather nasty bug - a mail message sent via SMTP using a resource stream will be prematurely terminated if a line begins with a period. The problem is that fgets() will return the "\n" at the end of the previous call, so a call to quotedata() will not catch a period at the end of the line. And you can't modify quotedata() to search for periods at the beginning of the string because there is no guarantee that the data coming from fgets() begins at the end of the line. (fgets() is pretty worthless; fread() is your friend) Additionally, we need to explicitly check for false as the return from the string reading function. A terminating line consisting of just "0", for example, would be skipped without this check.

Comments

 [2011-05-25 21:59 UTC] slusarz (Michael Slusarz)
 [2011-05-25 22:10 UTC] jon (Jon Parise)
-Status: Open +Status: Assigned -Assigned To: +Assigned To: jon
 [2011-05-26 08:01 UTC] jon (Jon Parise)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.