procmail
[Top] [All Lists]

Re: Bounce Mail

1997-07-12 03:08:00
On Jul 11, Steve Knouse wrote
What action line do I use to bounce mail?

There are two alternatives. Write your own "bounce" message:

| ( formail -rt ; cat /path/to/body_of_the_bounce.txt ) | $SENDMAIL -t

or, you can direct the MDA to bounce it. The following recipe will illustrate
the latter:

:0
* ^Subject: bounce me
{
        EXITCODE=67
        HOST
}

Now, the content of the bounce message will depend on the number
assigned to EXITCODE, and on the fact which MDA you are
using. Sendmail, the most frequently used MDA, interprets the number
according to /usr/include/sysexists.h. For example, 67 is in my
sysexits.h aliased to EX_NOUSER, which means "no such user". So, if my
MDA is Sendmail, the recipe above will bounce the message saying:
Sorry, there is no such user here (regardless, of course, of whether
the user really exists or not).

I believe most other MDAs behave as Sendmail. Qmail, however, has a
different numbering scheme; if you are using it, you'll have to check
its documentation.


        Antti-Juhani

Ps. I bounce all mail bcc'd to me with the EX_NOUSER code (67) and all
mail to me greater than fifty thousand bytes are bounced with
EX_UNAVAILABLE (69, service unavailable). Mailing lists are
exceptions. - AJK

--
              :self-reference: /n./ See self-reference.
                                                      (The Jargon File 4.0.0)

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