PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RFC822 - parsing email addresses

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
mkrivan



Joined: 12 Apr 2008
Posts: 2
Location: Hungary

PostPosted: Sat Apr 12, 2008 6:28 pm    Post subject: RFC822 - parsing email addresses Reply with quote

I have tried the following code:

$email = '"Test" <any@mydomain.hu> (any)';
$addresses = Mail_RFC822::parseAddressList( $email, 'anydomain.hu', FALSE );

It always raise an exception.

If I change the comment so the username part of e-mail and comment become different, everything works fine.

$email = '"Test" <any@mydomain.hu> (any1)';
$addresses = Mail_RFC822::parseAddressList( $email, 'anydomain.hu', FALSE );

This works fine.

Is there somebody how already knows a solution for this problem?
Thanks in advance.

Miklos
Back to top
View user's profile Send private message
mkrivan



Joined: 12 Apr 2008
Posts: 2
Location: Hungary

PostPosted: Sat Apr 12, 2008 9:15 pm    Post subject: Found the bug Reply with quote

I have found something in the RFC822.php package so I think I could repaire the problem.

The main problem was int the function validateMailbox(&$mailbox);
The strange row was:
$_mailbox = substr( $_mailbox, strpos($_mailbox, $comment)+strlen($comment)+1 );

If I change it to
$_mailbox = substr( $_mailbox, strrpos($_mailbox, $comment)+strlen($comment)+1 );

The problem disappear. I think the block is too complicated anyhow it would be nice to simplify it. I will write some suggestion to the authors soon.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software