procmail
[Top] [All Lists]

Re: Bounce Management

2001-01-25 12:10:41
kevin(_at_)interq(_dot_)or(_dot_)jp wrote:
The flow might go something like:
1. Mail comes in
2. procmailrc read
3. forward to remote address and copy to mailbox
4. local mailbox is full; bounce and return to sender

So far so good.

5. forward to remote address is bounced because either the forward
address' mailbox is full or the address is blocked

When you forward it, you need to insert "X-Loop:" or similar header
(man procmailex and search for "Loop:").

6. bounce due to full mailbox or bad address comes back and we repeat
steps 1-6

Check for ^FROM_DAEMON or ^FROM_MAILER (man procmailrc and search for
FROM_) to prevent the bounces -- X-Loop should be your friend here
also.

Timo has an example of how to avoid mail loops while forwarding:

    http://www.uwasa.fi/~ts/info/proctips.html#forward


How can we craft a much more intelligent forward recipe such that this
endless bouncing doesn't happen more than 3-4 times?  I say 3-4 times
because there's a chance that the problem might fix itself with the user
getting a clue and downloading both their local and remote mailboxes.

Let me encourage you to abandon this thinking.  How long does a bounce 
take -- 10 seconds?  A full minute?  It occurred to me that you could
maybe sleep for 10-20 minutes before re-trying a bounce, but that runs 
the danger of using up processor resources.


Should we be adding headers each time mail is forwarded and perhaps
maintain a count that is incremented and then dumped if the count reaches
a certain limit?  Something like, if you see "X-Forwarded-To: <address>",
and <address> matches the destination, drop it?  Or, if "X-Bounce-Count:
<count>" reaches 5, drop it?

You could do that, but I still think it's a bad idea.

Something to investigate -- if you send a mail like this:

    To: user(_at_)remoteaddr
    X-Forwarded-To: user(_at_)remoteaddr

and it bounces, what will the headers look like?  This maybe?

    From: MAILER-DAEMON
    To: localuser(_at_)localaddr
    X-Forwarded-To: user(_at_)remoteaddr

??  Or will it say:

    From: MAILER-DAEMON
    To: localuser(_at_)localaddr
    Subject: returned mail, etc.

    blah blah

    ==== Original message follows ====

    To: user(_at_)remoteaddr
    X-Forwarded-To: user(_at_)remoteaddr

like that?

If the latter, then you'll need to look in the message BODY as well as 
the header when counting up the "X-Forwarded-To: user(_at_)remoteaddr"
lines.  But I still think it's a fundamentally Bad Idea to re-try once 
the thing bounces.

hth
-- 
Neither I nor my employer will accept any liability for any problems
or consequential loss caused by relying on this information.  Sorry.
Collin Park                         Not a statement of my employer.
_______________________________________________
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>