PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail » Bug #1434

parseAddressList won't parse unqualified addresses

Details

Submitted2004-05-18 21:19 UTC
Fromespen at hhkol dot dk
StatusBogus
PackageMail
PHP Version4.3.4
OSDebian Linux
Roadmaps(Not assigned)

Comments

[2004-05-18 21:19 UTC] espen at hhkol dot dk

Description:
------------
The problem is that parseAddressList version 1.13 now returns PEAR error on input, which was previously accepted. Earlier versions (1.10) accepted addresses which were unqualified (no @xxx-part), but now it returns an error. This behaviour is also inconsistent with imap_rfc822_parse_adrlist.

Chuck, this issue might also have been mentioned here:
http://lists.horde.org/archives/sork/Week-of-Mon-20040426/001565.html

I would like to add that it would be nice, if this didn't produce errors as well:

Mail_RFC822::parseAddressList(' "|/usr/bin/vacation -a me@test.com" ', "")

That is, stuff which is enclosed in quotes should just be returned without errors. Again, imap_rfc822_parse_adrlist does this. I need this so I can use Mail_RFC822 to parse .forward-files.

Reproduce code:
---------------
Mail_RFC822::parseAddressList("mymailbox", "")
Mail_RFC822::parseAddressList("john, joe", "")

Expected result:
----------------
I expect an array with the mailboxes.

Actual result:
--------------
I get a PEAR error:

pear_error Object
(
[error_message_prefix] =>
[mode] => 1
[level] => 1024
[code] =>
[message] => Validation failed for "mymailbox"
[userinfo] =>
[backtrace] => Array
(
[0] => Array
(
[file] => /usr/share/php/PEAR.php
[line] => 528
[function] => pear_error
[class] => pear_error
[type] => ->
[args] => Array
(
[0] => Validation failed for "mymailbox"
[1] =>
[2] => 1
[3] => 1024
[4] =>
)

)
[1] => Array
(
[file] => /usr/share/php/Mail/RFC822.php
[line] => 199
[function] => raiseerror
[class] => pear
[type] => ::
[args] => Array
(
[0] => Validation failed for "mymailbox"
)

)

[2] => Array
(
[file] => /usr/share/php/Mail/RFC822.php
[line] => 171
[function] => parseaddresslist
[class] => mail_rfc822
[type] => ->
[args] => Array
(
)

)

[3] => Array
(
[file] => /home/espen/wm/espen-vacation-bak/test.php
[line] => 8
[function] => parseaddresslist
[class] => mail_rfc822
[type] => ::
[args] => Array
(
[0] => mymailbox
[1] =>
)

)

)

[callback] =>
)