procmail
[Top] [All Lists]

Re: Dealing with sub-hosts' bounced email

2002-04-09 13:25:36
At 08:15 2002-04-09 +0100, David Cross did say:
I run a server where a few friends host their websites.

You posted this a few days ago.

A few now run small mailing lists via CGI scripts, and I get all the
bounced mail sent back to me at the "root" account - foo(_at_)localhost

Suggestion: make it a requirement that they send the mail with *THEIR* address as the return address. THEIR delivery problems shouldn't be your mess to clean up. Since it is YOUR server, you should be able to enforce this policy.

I notice a common data set in all these bounces and now wish to send
each person's bounces back to them.

You mean forward bounces to the admins of the respective lists.

Every bounce that comes back always have in it (viewed from a UNIX
mailbox perspective) an originating address in the format
address(_at_)domain(_dot_)com usually on a line like:

From: "Name 1" <info(_at_)domain1(_dot_)com>
From: "Name 2" <info(_at_)domain2(_dot_)com>

This means WHAT to us? Is this the address you want to bounce to, does it identify in some way which list, and therefore which address to bounce to? Please explain the significance - CORRELATE the above to something meaningful in the context of handling the messages. Most of us are well aware that bounce messages come From: an address someplace.

When downloaded into a local mail client the error message will
sometimes have one or more attachments. Such messages at the server end
appear with headers (part) thus:

[snip]

It is not uncommon for bounced messages to include the original message as a MIME chunk - this has been going on for several years now. Procmail doesn't parse MIME - this is all just part of the body to it -- which means you can scan the body and locate stuff there, whether it is in a plaintext, or a MIME chunk.

Does anyone have a recipe/s that will check the error message for an
email address originating at a domain and/or address at that domain and

Bounced messages are inconsistent in format, may include multiple addresses (and therefore shouldn't be resent to anyone other than the listadmin, and frankly, that is where the darn bounce should be going anyway). Your first order of business should be to ensure that those lists bounce directly to their respective admins.

If you're asking to post-process the bounced mail to direct each set of bounces to their respective listowner, I'd start with setting it up so that the bounces properly go there to begin with, then evaluate whether these bounces are really important - if the addresses still have delivery problems, won't the next delivery through the CGI mailing list generate a fresh set of NDNs? Why waste the time to process old bounces if the admin will still receive notification the next time a message is sent anyway?

The priority for this might be a bit different if these were non-list messages, but list mail is inherently a low priority thing, and errors are genereally reocurring.


If this is a stack of old mail messages in a mailbox, MOVE that mailbox out of the mailspool or whatever (so that it is not being added to), and run:

        formail -s procmail -m bouncehandler.rc < bounces.mbx


# bouncehandler.rc
# simple script to MANUALLY process bounces messages

# because this isn't running within a live mailspool, and you should properly
# configure scripts to bounce to their respective admins, this shouldn't need
# x-loop (see list archives).

# checks the BODY
:0B
* ^From:(_dot_)*somelistaddr(_at_)domain\(_dot_)tld
! thatlistadmin(_at_)theirdomain(_dot_)tld

:0B
* ^From:(_dot_)*someotherlistaddr(_at_)domain\(_dot_)tld
! someotherlistadmin(_at_)theirdomain(_dot_)tld

# anything not processed above, drop into a mailbox for further review
# later, you can rename this mailbox and process it through a further modified
# version of this script.
:0:
unhandled.crap.mbx


---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>