procmail
[Top] [All Lists]

Re: ORing conditions

1997-05-10 10:38:00
John Gianni asked,

| But, what's the difference between those two suggestions, and the simpler:
| --------------------------------------------------------------------------
|  :0
|  * rule1 | rule2 | rule3
|  ...
| 
| A simple example being:
|  :0
|  * ^Subject:.*hello|Dear|World
|  IN.foo

(Yes, John may have meant "* ^Subject:.*(hello|Dear|World)", but that's a
 separate concern.)

As I explained in my post in response to Axel Thimm's original question, if
the rules are all straight regexps we generally WILL want to do what John
illlustrated, but sometimes we have rules that cannot be combined into a
single condition.

For example, one cannot combine

1. a straight regexp with a negated regexp (unless one of them can be
   expressed the other way);

2. an exit code (inverted or straight) with a regexp (negated or straight);

3. a straight exit code with an inverted exit code (unless one of the
   commands is something [like test or lockfile] that can be told to invert
   its own exit code);

4. a size comparison with anything else (even another size comparison); or

5. two regexps that have different search areas

into a single condition line.  When we want to OR two or more conditions
that cannot be put together like that, we need another method.

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