procmail
[Top] [All Lists]

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

1997-08-08 06:03:00
On Fri, 08 Aug 1997 13:47:23 +0200,
Martin Terpstra <terpstra(_at_)ats(_dot_)nld(_dot_)alcatel(_dot_)nl> wrote:
<... How do I say, "if one of these matches, do the action"? ...>
:0
* ^From.*peter
* ^From.*alex
* ^From.*erwin
$BIGMAILBOX
Or is there another way to solve this.

You can say "if none of them, do nothing, else save to $BIGMAILBOX":

:0
* ! ^From.*peter
* ! ^From.*alex
* ! ^From.*erwin
{ }
:0E:   # Yes, you want the second ":" here
$BIGMAILBOX

Do note that "From.*alex" will match, for instance, 
"From: Notorious Sociopathic Spammer <alexsen(_at_)savetrees(_dot_)com>" and 
"From: His name was not Alexander the Grape <grape(_at_)netcom(_dot_)com>"
... well, you get the idea. Probably you should restrict the regexps
somewhat to avoid this potential source of trouble. (Hint: look at the
\< and \> shorthands, and maybe do something to verify that the
address either has an @ immediately after the user id or none at all.)

Hope this helps,

/* era */

You might want to look at 
<http://www.iki.fi/~era/procmail/mini-faq.html#from>
... if the #from part doesn't work in your browser, scroll.

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>