procmail
[Top] [All Lists]

Re: ORing conditions

1997-05-08 13:34:00
Axel Thimm <thimm(_at_)physik(_dot_)fu-berlin(_dot_)de> writes:
I'd like to combine rules with OR. I can use
...
and so on, but this is cluttering the rc-file.
Another thought is defining a variable instead of performing some
(complicated) actions in the {...} and later ask for the variable to perform
the action.
Finaly I though of inverting the conditions, e.g.
:0
* ! rule1
* ! rule2
{ } # empty action
:0 E
{
 ...
}
Does this work (any possible pitfalls)? What is the preferred method?


Applying de Morgan's law and doing the inversion you show works just
fine.  You can also us procmail's scoring ability to do ORing:

        # 987654321 looks infinitely large to the scoring engine,
        # so that a match will cause the whole recipe to succeed
        # instantly.
        :0
        * 987654321^0 rule1
        * 987654321^0 rule2
        * 987654321^0 rule3
        {
            ...
        }

Which is prefered???  What's the prettiest color?  Ice-cream or fudge
brownies?   Blonde, brunet, or red-head?  Perl or python?  Emacs or
vi?  Liberal or Tory?

It's totally your call.  To (mis?)quote John Stuart Mill: you are
condemned to be free.


Philip Guenther

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