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

Bug #17989 sometimes a space is added to FROM adr.
Submitted: 2010-10-25 14:23 UTC
From: andreab Assigned: jon
Status: Closed Package: Net_SMTP (version 1.4.4)
PHP Version: 5.2.4 OS: Ubuntu 10.4
Roadmaps: (Not assigned)    

 [2010-10-25 14:23 UTC] andreab (Andrea Bag)
Description: ------------ Sometimes a space is added at the end of FROM: address (before the terminator CR/LF). That caused some SMTP server (Eudora EIMS 3.3.9) to refuse the address as malformed. The problem was in method: mailFrom($sender, $params = null) at line: } elseif (is_string($params)) { $args .= ' ' . $params; } in case of $params=empty string, the function add a space at end of address. I solved with: } elseif (!empty($params) && is_string($params)) { // may be !empty($params) alone is enaugh....... $args .= ' ' . $params; } Best regards Andrea Bagnini Test script: --------------- $host = ""; $port = "587"; $username = ''; $password = 'mypsw'; $headers = array ('To' => $to, 'From' => $from, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'localhost' => 'myserver', 'debug' => false, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); Expected result: ---------------- The FROM: address must NOT contain any blanks Actual result: -------------- The FROM: address DOES contain a blank (ASCII 32) before the CR/LF terminator


 [2010-10-26 10:30 UTC] jon (Jon Parise)
-Status: Open +Status: Closed -Assigned To: +Assigned To: jon
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.