procmail
[Top] [All Lists]

Re: procmailrc: bounce action

1999-12-23 03:11:13
"ntgiao" <ntgiao(_at_)hotmail(_dot_)com> writes:
In .procmailrc file, is there an action command to bounce the message back
to the original sender?  If not, what is a reasonable way selectively bounce
message (or forwarding it to the sender)?

If your MTA pays attention to return codes, the setting EXITCODE to a
non-zero value should work as it will cause procmail to return that value
when it exits.  Note that processing is not terminated by an assignment
to EXITCODE, so if you want to immeadiately return failure at that point
you'll need to deliver the message to /dev/null or unset HOST or something
like that to make procmail stop processing.  Exitcodes of 64-72 or so are
given particular meaning by sendmail and some other MTAs.  The exact values
are listed in the header file /usr/include/sysexits.h on most systems,
so try looking there for details.

Usage would run something like:

        EXITCODE = 69   # EX_UNAVAILABLE = 69
        HOST

The comment is just so you can remember which EX_ value that number is.

sendmail, postfix, and qmail all pay attention to return codes.  Last I
heard, smail doesn't.  I don't know about others.


Philip Guenther

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