procmail
[Top] [All Lists]

Re: no exit on delivering recipe

1998-08-25 15:19:30
Hello Rik,

  (Copied to procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de)

:0:
   * ^From:.*validusername
   * ^From:.*valid.*lastnamex
   * ^From:.*valid.*lastnamey
   * ^From:.*valid.*lastnamez
   $DEFAULT
                                          #Should exit here on match!!

This recipe is only satisfied if ALL conditions are met (ANDed). You
can rewrite it in either of the following ways to do the OR which you
appear to expect. I prefer the second for conditions which have a lot
of common strings, such as the version you present.

This is not an uncommon problem.

  I am ashamed I missed this:  The man page makes it ABSOLUTELY clear
that conditions are ANDed.

  Thanks to Rik for the gentle answer and the pointers to solutions.

1. use DeMorgan's law

 :0
 * ! ^From:.*validusername
 * ! ^From:.*valid.*lastnamex
 * ! ^From:.*valid.*lastnamey
 * ! ^From:.*valid.*lastnamez
 {  }
 :0 E:
 $DEFAULT

2. use a compound condition
 :0:
 * ^From:.*valid(username|.*lastname[xyz])
 $DEFAULT
 
--
    Peter deFriesse                             UNIX Systems Administration
    Email: peter(at)oit.umass.edu         [All standard disclaimers apply:]

<Prev in Thread] Current Thread [Next in Thread>