Hello, on 04/26/2008 03:43 AM Richard Kurth said the following: >>> I what to read the email headers that are in a Qmail mailbox so that I >>> can run it threw a filter and see what mail bounced for what reason. >>> How do I do this being that the ownership on Qmail mailboxes are >>> diferent from the owner that runs php and apache >>> >> >> You can use this class to parse the messages and extract the addresses >> from bouncing messages. >> >> http://www.phpclasses.org/mimeparser >> >> > I have looked at this many times I just can't figure out how to use it. > All I what to do is grab the mail out of the mailbox and see way it bounced > then add that info to my program for the email user that sent it. I think the safest way is to setup a POP3 mailbox to receive the bouncing messages and then use POP3 client class like this to fetch and process the bounced messages one by one. http://www.phpclasses.org/pop3class The MIME parser class can parse messages passed as strings or from files. The POP3 class provides a stream wrapper that allows PHP to treat messages in a POP3 mailbox as if they were real files. This way you can connect the POP3 class directly to the MIME parser class. Take a look at the parse_message.php script for an example of this. The MIME parse class has a Decode function to parse the message, and the Analyze function to tell which kind of message is what you have passed and eventual parameters related to that type of message. In the case of the bounces returned as message/delivery-status, the MIME parse returns the boucing addresses and associated bouncing reasons. Take a look at the test_message_decoder.php example script to see it in action. -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php