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

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


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
postedOct 26, '10 at 5:30a
activeOct 26, '10 at 5:30a

1 user in discussion

Jon: 1 post



site design / logo © 2022 Grokbase