procmail
[Top] [All Lists]

Re: Else rules

2002-03-22 17:09:44
At 16:24 2002-03-22 -0700, Scott Palmer did say:
[snip]

Everything Philip said, plus:

      :0
       * ? formail -x"To" -x"To:" \
       | egrep -is -f /etc/procrcs/receive.lst
       | formail -A "X-NoFilter: Does not want filtering"

Since the ELSE rule after this is what invoked the filters which presumably this recipe is defining as unwanted, this recipe doesn't need to do anything - you could use a null body bracing, *OR* you could invert the conditions (an exclamation before the ? on the condition line and use the condition on the INCLUDERC rule, unless you have some dire need to have this "X-NoFilter" header added when you can so easily just skip the filtering:

        :0 E
       * ! ? formail -x"To" -x"To:" \
              | egrep -is -f /etc/procrcs/receive.lst
        { INCLUDERC=/etc/procrcs/ruleset.rc }


Also, rather than modifying the message, don't forget that you can set a procmail VARIABLE, and check that elsewhere, which will save you the cost of the external process (and leave the message unaltered):

        :0 E
       * ! ? formail -x"To" -x"To:" \
              | egrep -is -f /etc/procrcs/receive.lst
        {
                NOFILTER=TRUE
        }

then elsewhere:

        :0
        * ! $NOFILTER ?? TRUE
        { do something }

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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