PHP Classes

Problem getting sender (header from)

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Problem getting sender (header from)  >  (Un) Subscribe thread alerts  
Subject:Problem getting sender (header from)
Summary:Problem getting sender (header from)
Messages:11
Author:Hans Frank
Date:2010-03-29 19:36:52
Update:2010-04-11 17:30:23
 
  1 - 10   11 - 11  

  1. Problem getting sender (header from)   Reply   Report abuse  
Picture of Hans Frank Hans Frank - 2010-03-29 19:36:52
Hello Manuel,

I got a problem getting the sender (from-field) from a maybe malformed e-mail. Is it possible to extend your MIME-Parser to handle this format?
What would be the best way to send you this e-mail for testing?

The error message is: Warning: Address extraction error from header from: multiple addresses must be separated by commas: at position 1810 line 33 column 63

Thanks a lot in advance!

  2. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-03-29 20:11:37 - In reply to message 1 from Hans Frank
I need to have an example to see what can be done.

  3. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Hans Frank Hans Frank - 2010-03-30 07:36:37 - In reply to message 2 from Manuel Lemos
Here is the header row:

From: "Lx-Office -"@ip-10-226-103-83.eu-west-1.compute.internal>User helfen User <[email protected]>

It is a released mail from amavis.

best regards

  4. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-04-03 20:39:51 - In reply to message 3 from Hans Frank
Well I can make it tolerate the > character and accept it as character separator, but I am not sure if it is a good idea.

  5. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Hans Frank Hans Frank - 2010-04-05 08:25:36 - In reply to message 4 from Manuel Lemos
Thanks for the reply.

In my case it would be good if the mimeparser tolerates this kind of adresses. Other e-mail clients (Outlook or Zarafa) can handle this address.
In Zarafa it is displayed as:

[email protected]>User

So, I would appreciate it if you can integrate it.

Thanks a lot in advance!

  6. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-04-07 09:33:34 - In reply to message 5 from Hans Frank
> characters are not allowed in domains, so it is odd that those programs considered that character as part of the e-mail address domain.

Multiple addresses must be separated by comma. But I can make the class tolarate that case ignoring the > character. In that case the parser returns two addresses like this. If it is OK for you, I can publish the fix to handle that case. Just let me know.

array(2) {
[0]=>
array(1) {
["address"]=>
string(55) "Lx-Office [email protected]"
}
[1]=>
array(2) {
["address"]=>
string(17) "[email protected]"
["name"]=>
string(16) "User helfen User"
}
}

  7. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Hans Frank Hans Frank - 2010-04-08 11:15:56 - In reply to message 6 from Manuel Lemos
Hello Manuel,

this sounds good to me. Please publish this fix - I will test it soon!

Thank you!

  8. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-04-08 20:19:08 - In reply to message 7 from Hans Frank
OK, I just uploaded the fixed version.

  9. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Hans Frank Hans Frank - 2010-04-09 09:07:37 - In reply to message 8 from Manuel Lemos
Hello,

the fixed version works well (2 e-mail addresses), but I still get this error message:

Warning: Address extraction warning from header from: multiple addresses must be separated by commas: at position 1810 line 33 column 63

Is it still necessary?

Thanks!

  10. Re: Problem getting sender (header from)   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-04-09 17:55:21 - In reply to message 9 from Hans Frank
That is just a warning because the address is malformed. The class tolerates many types of malformed messages. That is just one of them. If you do not care, just ignore the warnings.

 
  1 - 10   11 - 11