Bug #17989 [Opn->Csd]: sometimes a space is added to FROM adr.

From: Date: Tue, 26 Oct 2010 06:30:34 +0000
Subject: Bug #17989 [Opn->Csd]: sometimes a space is added to FROM adr.
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-4985@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=17989&edit=1 ID: 17989 Updated by: jon@php.net Reported By: a dot bagnini at softime90 dot com Summary: sometimes a space is added to FROM adr. -Status: Open +Status: Closed Type: Bug Package: Net_SMTP Operating System: Ubuntu 10.4 Package Version: 1.4.4 PHP Version: 5.2.4 -Assigned To: +Assigned To: jon Roadmap Versions: New Comment: -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 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. Previous Comments: ------------------------------------------------------------------------ [2010-10-25 10:23:07] andreab 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 = "mail.serdata.it"; $port = "587"; $username = 'user@dom.com'; $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 ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=17989&edit=1

« previous php.pear.bugs (#4985) next »