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

Bug #17317 Invalid periods in mailbox not marked as invalid
Submitted: 2010-04-16 16:55 UTC Modified: 2011-01-14 19:52 UTC
From: ray_harris Assigned: alec
Status: Closed Package: Mail (version 1.2.0)
PHP Version: 5.3.0 OS: Vista
Roadmaps: 1.2.1    
Subscription  


 [2010-04-16 16:55 UTC] ray_harris (Ray Harris)
Description: ------------ Both RFC822 and RFC2822 prohibit the local part of an address from beginning with a dot, ending with a dot, or containing two consecutive dots. When using the Mail_RFC822::parseAddressList function, email addresses with these errors are not marked as invalid. Invalid Addresses: .name@example.com name.@example.com first..last@example.com All are reported as valid by parseAddressList. Test script: --------------- require_once 'Mail/RFC822.php'; $addr1 = '.name@example.com'; $addr2 = 'name.@example.com'; $addr3 = 'first..last@example.com'; $result1 = Mail_RFC822::parseAddressList($addr1); $result2 = Mail_RFC822::parseAddressList($addr2); $result3 = Mail_RFC822::parseAddressList($addr3); var_dump($result1, $result2, $result3); Expected result: ---------------- Results should be PEAR_Error objects. Expected value for $result1 without backtrace: object(PEAR_Error)[2] public 'error_message_prefix' => string '' (length=0) public 'mode' => int 1 public 'level' => int 1024 public 'code' => null public 'message' => string 'Validation failed for: .name@example.com' (length=41) public 'userinfo' => null Actual result: -------------- Results are anonymous address object arrays. Actual value for $result1: array 0 => object(stdClass)[2] public 'personal' => string '' (length=0) public 'comment' => array empty public 'mailbox' => string '.name' (length=5) public 'host' => string 'example.com' (length=11)

Comments

 [2011-01-14 19:52 UTC] alec (Aleksander Machniak)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alec -Roadmap Versions: +Roadmap Versions: 1.2.1
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.