procmail
[Top] [All Lists]

Re: Autoresponder problem

2000-08-21 20:16:30
"Stephen Sayers" <ssayers(_at_)gtnet(_dot_)gov(_dot_)uk> writes:
I am using procmail 2.10 with formail on Solaris 2.5.1. I have set up an

I think you mean "3.10" instead of "2.10": procmail version 2.10 came
out in 1991.  Either way, you should consider upgrading to a newer
version.

...
However, the procmail rule is not invoked if the sender address has "mail"
in it. e(_dot_)g(_dot_)mail(_at_)some(_dot_)domain(_dot_)
I assume that procmail thinks that any address with "mail" in it is from a
mailer and that the macro FROM_DAEMON expands to a regular expression that
will match anything with mail in the email address.

Correct.


I would be grateful if someone can confirm whether this is the case and give
me a procmail recipe/rule that will reply to all email addresses including
those with mail in them except mail delivery subsystems and the like.

Well, if you _want_ the recipe to respond to message from daemon and/or
mailer-like programs, then don't use that ^FROM_DAEMON recipe.  That'll
increase your risk of being involved in a mail loop, so you should step
back a moment and ask why you want to reply to such messages.  If the
sender for which the problem is occuring is an actual person and not
some system/daemon/automatic account then you should suggest that their
account name was poorly choosen and the problem is therefore
self-inflicted.  If that won't fly and you need this to work for them,
then bitch loudly and special case their address.  See below.


Procmail Recipe
-----------------------

XLOOP="X-Loop: Mail responder"

:0 H
*!^FROM_DAEMON
*!^X-Loop: Mail responder
{
   # Send a standard reply in all cases.
   :0 Hc
       | (/opt/procmail/bin/formail -r -t -A"$PRIORITY"\
        -A"$XLOOP" -A"$FROM";\
       cat <$MAILDIR/data/standard_reply ) | $SENDMAIL -t

   :0
       ! nobody
}

Hmm, the 'H' flag on the outer recipe is superfluous as that's the
default.  As for the innder recipe, I think you meant to use the 'h'
flag instead, to feed just the message header into the action of the
recipe instead.  As for the forwarding to nobody, why not just remove
the 'c' flag from the previous recipe?  In fact, why not eliminate the
nested block entirely?


        # The value of the X-Loop: header field should look like an
        # email address, preferably qualified into your own domain.
        # That way you'll be guaranteed that it's globally unique.
        XLOOP = "X-Loop: mail-responder(_at_)your-domain-here"

        # Rather than use a full path for formail, we'll just add the
        # directory to our PATH:
        PATH = $PATH:/opt/procmail/bin

        # If the message is from a daemon, and not Mr. Problem User,
        # then...
        :0
        * ^FROM_DAEMON
        * ! ^(From|Sender):(.*[^-a-zA-Z0-9_.])?problem-user's-address
        {
                # ...do nothing here...
        }
        # ...but skip this recipe
        :0 Eh
        * ! $ ^$XLOOP
        | ( formail -rt -A"$PRIORITY" -A"$XLOOP" -A"$FROM"; \
            cat data/standard_reply
          ) | $SENDMAIL $SENDMAILFLAGS -t

           

Philip Guenther

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