Parsing Bounces for permanent and temporary errors

2001-07-30 Thread PHP Webmaster

Hello,

I am looking for any prior work or tutorial that
explains the best way to parse bounced email messages
to see if the failure reason is permanent (eg username
not found) or temporary (eg user's mailbox full).

It would be great if anyone could point me toward a
list of phrases or things from different isp's
standard bounced messages I could look for in my
parser with regex.

Thanks!

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/



Re: Parsing Bounces for permanent and temporary errors

2001-07-30 Thread Henning Brauer

On Mon, Jul 30, 2001 at 01:03:19AM -0700, PHP Webmaster wrote:
> Hello,
> 
> I am looking for any prior work or tutorial that
> explains the best way to parse bounced email messages
> to see if the failure reason is permanent (eg username
> not found) or temporary (eg user's mailbox full).

For qmail it's easy, http://cr.yp.to/proto/qsbmf.txt (? I always mix up the
letters...). Unfortunately there is no generic format to use.
For your app, a bounce can be treated just so - as bounce. Temporary errors
(code 4xx) are handled by the sending MTA and you only get a bounce from it
when the queuelifetime is exceeded. A temproray error lasting that long may
be treated as permanent error... 
permanent errors, code 5xx, are returned very fast.
You may want to look into ezmlm's way of handling bounces, that's very
efficient.

> It would be great if anyone could point me toward a
> list of phrases or things from different isp's
> standard bounced messages I could look for in my
> parser with regex.

This is a nearly impossible task. You _may_ have luck scanning for 3 digit
numbers starting with 4 or 5, but that will most probably result in a huge
amount of false positives.

RFC 2821 has more about bounces, though there is no common bounce format.

-- 
* Henning Brauer, [EMAIL PROTECTED], http://www.bsws.de *
* Roedingsmarkt 14, 20459 Hamburg, Germany   *
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)