procmail
[Top] [All Lists]

Re: Help matching the value of a variable

2001-10-04 11:34:10
Louis LeBlanc <leblanc+procmail(_at_)acadia(_dot_)ne(_dot_)mediaone(_dot_)net> 
writes:
Hey all.  I'm trying to match based on a variable passed into
procmail.  The variable indicates the folder the message is to be
delivered to, and I want to toss the message if it is set to a certain
value and the subject matches.

I really suck at recipes, so don't laugh:

:0
* $EXTENSION webmaster ??
* ^Subject: .* Returned mail
{
 EXTENSION=trash
}

Anyone care to correct the variable match?

To quote the procmailrc(5) manpage:

       variablename ??
            Match the remainder of  this  condition  against  the
            value of this environment variable (which cannot be a
            pseudo variable).  A special case is if  variablename
            is equal to `B', `H', `HB' or `BH'; this merely over-
            rides the default header/body search area defined  by
            the initial flags on this recipe.


Note that you probably want to anchor the regexp on both ends so that
you match the exact value only and not, for example, "webmasters-suck".

        :0
        * EXTENSION ?? ^^webmaster^^
        * ^Subject: .* Returned mail
        {
            EXTENSION=trash
        }


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>