Hello Manuel,
First: thanks for proving this class alowing people to decode mime mail without Pear.
My question/problem:
I was working on some content checking to filter out unwanted mail and noticed that in a testmail (sent from outlook via exchange) some returned header fields where empty.
(I used var_export ($decoded[$message]); instead of var_dump($decoded[$message]); in test_message_decoder.php)
Looking at the raw mailfile I found that in the From: and Return-Path: fields the text between the quotes was missing.
"Correct" decoded header fields:
From: "Lastname, Firstname" <
[email protected]>
Return-Path: "Lastname, Firstname" <
[email protected]>
Returning empty field data:
From: <
[email protected]>
Return-Path: <
[email protected]>
I have to add that browsing thrue the headers of lots of mail in my mailbox I could not find any header that had the working format for the Return-Path field.
It seems that when the (in this example) quoted part of these fiels is empty the class does not check if it can retrieve the content between the "<>".
(I also noticed that there is an extra trailing space returned by the class when there is data in front of the <> data in the two mentioned fields.)
In addition you may notice that "Lastname, Firstname" isn't an email address but (in this case) the name as displayed in the outlook addressbook.
In fact I'm wondering how to e.g. return an email with a header like this to the originator using the return or from data if the mail is rejected by my script.
Worst case I won't get any address data from the class and even when the quoted part exists it's possibly the addressbook name instead of the email address.
Any tips on how to proceed and access the data between <> in the two address fieds?
Thanks,
Mario