in reply to email bouncebacks

You want VERPs.

The problem is there's no standard for parsing a bounce message (well, DSNs are a sort of standard, but nobody follows them). To make this work, you'll have to write a filter for every mail program in existence, to pull out the right data. This doesn't sound that bad, but there are more mail server software packages than you think...

There is one thing that's standard, however---where the bounce messages go. Bounce messages are always sent to the envelope sender of the message. So if there was only some way to encode the recipient into the envelope sender, so you'd know who the bounce message was coming from...

Oh, wait, that's right---That's what VERP does! :-)

The idea is that you use a different envelope sender for each message you send out, and encode the recipient into that, along with whatever other information you'll find useful. For example, a message to me from your list might be from <jalspach-bouncemanager-sgifford=tir.com@jalspach.com>. If the message bounced, it would be sent to this user, and the mail server for jalspach.com could tell what address caused the bounce by looking at who the bounce was sent to.

This requires that your mail software supports extension addresses. qmail supports these with dashes---I can configure my system so that sgifford-anything goes to my account. sendmail does the same thing but with plus signs---sgifford+anything.

Once you've got that, you set up a program to handle mail for the account (jalspach-bouncemanager, in the above example), have it look at the envelope information, and write that information to a database or text file.

Hope that helps!

Replies are listed 'Best First'.
Re: Re: email bouncebacks
by McD (Chaplain) on Dec 04, 2003 at 16:27 UTC
    You're spot on with the VERP suggestion, but:

    (well, DSNs are a sort of standard, but nobody follows them)

    Actually, DSNs are overall very popular - just writing a simple DSN parser will recognize a large majority of "bounces".

    There is one thing that's standard, however---where the bounce messages go. Bounce messages are always sent to the envelope sender of the message.

    Not entirely true.

    Bounce messages are supposed to go to the envelope FROM address, according to the spec, but they don't always - sometimes, they go to the header From: address instead. It's not a lot - about 1% of bounces, in my experience - but it's some.

    Qmail rocks - but to catch ALL bounces, you also need to consider those that are directed to the header From: address as well.

    Peace,
    -McD