procmail
[Top] [All Lists]

Re: Is there a option to OR the conditions instead of AND

1997-08-08 06:00:00
Martin Terpstra writes:

hello

if have a number of recipes something like this:

-----
:0
* ^From.*peter
$BIGMAILBOX

:0
* ^From.*alex
$BIGMAILBOX

:0
* ^From.*erwin
$BIGMAILBOX
----

All to the same mailbox. 
Does an option exist to change the above recipe into this ?

:0
* ^From.*peter
* ^From.*alex
* ^From.*erwin
$BIGMAILBOX

Or is there another way to solve this.

man procmailrc:
...
     E    This recipe only executes if the immediately  preceding
          recipe was not executed.  Execution of this recipe also
          disables any immediately following recipes with the 'E'
          flag.  This allows you to specify `else if' actions.

 So, all we need to do is:

:0
* ! ^From.*peter
* ! ^From.*alex
* ! ^From.*erwin
{
 # no match - do nothing
}

:0E
{
 $BIGMAILBOX
}