procmail
[Top] [All Lists]

Re: Bouncing a message

2002-01-16 23:17:16
When Nick asked,

can someone point me to a tutorial on bouncing mails?
I just want to bounce mail as if it was never received.

Paul advised him,

| Assuming, you're using procmail as your local delivery agent, you can:

... or in most cases if you're invoking procmail from ~/.forward, but not if
you're running procmail from a shell prompt, a shell script, or a cron job
...

| :0
| * [your conditions go here]
| { EXITCODE=67 }

However, procmail will still deliver a copy of the message to your folders.
If you really want not to see it at all, you need to do this:

 :0
 * conditions
 { EXITCODE-67 }
  :0A
  /dev/null

| If you're running procmail from a .forward file, you probably can't
| simply tell the MTA to treat is as rejected, and may have to generate
| your own bounce message based on the header material you get.

Actually, that's rarely the case.  Most MTAs (Smail is an egregious
exception) will get the exit status from a pipe in ~/.forward and react
accordingly.  Qmail even includes a utility named bouncesaying that is
designed for that very purpose:

 :0 # delivering recipe, no need to dump to /dev/null afterward
 * conditions
 | bouncesaying "We don't take mail from trash like you."



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