Home » Mail » Mail » Bug #1869
invalid email address not recognized when validating
Details
| Submitted | 2004-07-14 09:17 UTC |
|---|---|
| From | lars_stegelitz at col dot wunderman dot com |
| Assigned | jon |
| Status | Closed |
| Package | |
| PHP Version | 4.3.7 |
| OS | Win2K |
| Roadmaps | (Not assigned) |
Comments
[2004-07-14 09:17 UTC] lars_stegelitz at col dot wunderman dot com
Description:
------------
The Mail_RFC822::parseAddressList() routine does not validate correctly. We tried to validate an obviously wrong email address, but it passed the validation.
In some cases an invalid email address may prevent an email to be sent at all - even if the other addresses are valid.
see Code snippet below for details
Reproduce code:
---------------
(code mainly ripped off the documentation, but the address was changed...)
require_once 'Mail/RFC822.php';
$address = '<Herr Braun@gibbetnich>';
# validate address
$addresses = Mail_RFC822::parseAddressList($address, NULL, TRUE, TRUE);
print_r($addresses);
Expected result:
----------------
$addresses == NULL
as stated in the documentation:
Table 29-1. Possible PEAR_Error values
Error: NULL
code: every
Error message: The given address string is not RFC822 compliant
Reason: The error code contains a description of the error.
Solution:
Actual result:
--------------
Array
(
[0] => stdClass Object
(
[personal] =>
[comment] => Array
(
)
[mailbox] => Herr Braun
[host] => gibbetnich
)
)
[2004-07-26 22:56 UTC] esm at baseclass dot modulweb dot dk
> Just going to say 'Me too!'? Don't clutter the database with that please !
Well - I'll clutter it anyway and go 'Me too!'. This is a significant problem - so I just want to let the dev. of this fine package now that we're using his work and we appreciate it, and that we'd like to validate our email addresses :)
Acebone
[2004-08-05 08:55 UTC] roger at ecstatic dot com
MAIL_RFC822 doesn't even extend the PEAR base class, and
appears to be entirely broken.