procmail
[Top] [All Lists]

Re: boolean usage

1996-03-08 18:23:54
My question is: Realizing that procmail condition lines are normally
and'ed and *not* or'ed, is it possible that a Boolean operator such as
*NOT* might be used to establish a condition in an rc.script?

While this has already been answered on the list, I thought I'd point
out that there are a few ways to do a logical OR of conditions.
Someone posted a solution here that involved using procmail's scoring
system, but I figured you could do it without scoring by taking
advantage of De Morgan's rule:

not (not a and not b) = a or b

Or in procmail syntax, if the "and" condition version is

:0
* condition1
* condition2
action
rest_of_file

Then the "or" condition version can be written as

:0
* ! condition1
* ! condition2
{
  rest_of_file

  :0           # Would these lines be needed?
  DEFAULT      # They are done by default at the end of
  :0           # the RC file but does the E flag in the
  ORGMAIL      # condition below know or care that this is
               # inside a block?
}

:0 E
action

Has anyone tried this?  Does it work?  If there are flaws in it,
would they be relatively easy to overcome?

-- 
Tim Pickett                                     
tlm(_at_)yoyo(_dot_)cc(_dot_)monash(_dot_)edu(_dot_)au
"Her daddy'll *love* that."                    
tbp(_at_)molly(_dot_)cs(_dot_)monash(_dot_)edu(_dot_)au

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