procmail
[Top] [All Lists]

Re: I need procmail to "bounce" a message to the sender

1996-05-23 06:54:22
John Black <jblack(_at_)runningman(_dot_)com> writes:
I need a little help here with a recipe, and I know that someone out there
knows how to do this. I have my procmail recipe up and running, and I love
it. I could not have done it without the assistance of many of you, so thanks.

Here's a little background. Say I have ten aliases forwarding to ten
different ISPs (user1, user2, ...user10). Everything works fine if mail is
sent to one of the ten users, but if someone sends mail to <user99>, then I
have procmail set up to send the message to a default folder since there is
no <user99>.

I'd like to change this so that mail set to someone other than one of the
ten users would be sent to the default folder (as it does now), and a
message would be "bounced" back to the sender with a message like:
...


Rather than sending a message back, I would suggest actually bouncing it
by returning an error code to sendmail.  This will cause DSNs and stuff
like that to work properly, and many programs recognize sendmail's bounce
messages so they can specially handle them.

:0
* conditions that match these messages.  In fact, you can just
* use the conditions of your current "default folder" recipe
{
    # The default folder recipe sans conditions
    :0 c
    Default_Folder

    # EX_NOUSER = 67
    EXITCODE = 67

    :0 ih
    |echo "Please check the address and try again" >&2
}