cfortune / PHP-Bounce-Handler

This class can be used to parse bounced message reports. It parses e-mail messages with multipart report content type formatted according to RFC 1892 and 1894 documents. If the bounce is not well formed, it also tries to extract some useful information. Exim is supported, partially. Please send bounce messages from your busted MTA, I'll extend the class to support them. It can extract the the address of the recipient that bounced as well the mail server response status code.
http://anti-spam-man.com/php_bouncehandler/
118 stars 72 forks source link

I want specific non-fatal messages to precede others and interpret long sentences. #26

Open rmast opened 7 years ago

rmast commented 7 years ago

The newest version I found still can't cope with lines that have been split up by different rules of the max. linesize, like The mail system

<xxxxxxxxxxxxxxxxxxxxxx>: maildir delivery failed: "Sorry, the user's maildir has overdrawn his diskspace quota"

so I'll come up with a new version. I'm trying to get this library to read IMAP-mails as well. Probably the well maintained IMAP-implementation will lower the needed complexity for header and body interpretation.

At the moment I have an IMAP-user with some really bounced e-mails, for which I want all possible retries and mailbox full messages to appear before a 550 as a last resort appears. I even think about being more clear about not knowing, just answer 9.9.9 or something, as 550 already could be anything.

The resulting status can then be updated to the mail-relation records, to be able to decide to keep them. As I'm not confident I'll ever succeed at matching 100% I could imagine it would be convenient just to be able to click on some link with the mail-relation-record just to open the original e-mails without having to search for them.

rmast commented 7 years ago

I forked for these fixes. I didn't include IMAP-functionality to keep the testset in file-format.

Apart from the concatenation of broken lines, there also is a 'recurse'-function that doesn't recurse but just skip the line on which the recipient is found. This line sometimes contains the most crucial message however, so I chose not to skip it.