procmail
[Top] [All Lists]

Re: cannot bounce mail successfully

2001-09-03 00:24:21
On Fri, Aug 31, 2001 at 10:58:04PM -0700, Andrew Edelstein wrote:
You probably need to tell your MTA that delivery was successful (that is, that
the message was successfully handed off to the LDA), before it will remove the
message from the queue. If it thinks the LDA is failing, it will attempt to
redeliver for a certain amount of time.

I knew this but made the mistake to reset the EXITCODE variable after sending
the customized error message. After this the recipe finished and the
EXITCODE couldn't get set to 0 or another error different from EX_TEMPFAIL.

Here is my working recipe:

###########################################################################

:0 w
| $DELIVERMAIL $LOGNAME

:0 e
{
   EXITCODE=$?

   :0 w
   * EXITCODE ?? 75
   {

     REC=`formail -zx"To:"`
     EXITCODE=0

     :0
     * ^X-Loop: bounce(_at_)pure(_dot_)ch
     /dev/null

     :0
     | formail -rk -I"Subject: Problem for $REC. Probably Mailbox full." \
        -A"Precedence: junk" -A"X-Loop: bounce(_at_)pure(_dot_)ch" | $SENDMAIL

   }
}  

HOST
###########################################################################

 Werner
_______________________________________________
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>