With qmail, you might try, in ~/.qmail:
|preline /usr/bin/procmail
|/var/qmail/bin/bouncesaying 'Whatever you want to say here'
and then in ~/.procmailrc
#
# default exitcode=99 if the procmailrc script delivers the
# message; exitcode=0, (yes, that is correct; 99 is the normal
# exit, 0 is the exception handling,)
#
EXITCODE=99
.
.
.
:0
* this
* and
* that
this-and-that file
.
.
.
:0
* an
* exception
{
#
# exception handling ...
#
EXITCODE=0
/dev/null
}
where the last conditional will bounce the message back to the
sender's envelope address, with the error message "Whatever you want
to say here".
John
BTW, the reason you want to do it this way is that qmail-local, (the
qmail delivery agent,) has a lot of very useful variables set in the
environment, (such as all the envelope variables-which may not be the
same as what's in the message header-which can be
changed/manipulated,) and qmail-local invokes ~/.qmail, but not
procmail, (preline does that.)
At any rate, as per man qmail-local, the recommended way of doing it
is to run bouncesaying(1) out of ~/.qmail.
Also, see man qmail-control for the exit codes.
nbari(_at_)unixmexico(_dot_)com writes:
when puting
|bouncesaying "whatever you want here."
Instead of putting EXITCODE=100
i get this :
procmail: Skipped "|/var/qmail/bin/bouncesaying "This address no longer
accepts mail." "
--
John Conover, conover(_at_)rahul(_dot_)net, http://www.rahul.net/~conover
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail