procmail
[Top] [All Lists]

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

1997-08-08 08:46:00
era eriksson wrote:

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

Works very nicely. Thank you !


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.)

The names I used where just examples to indicate the 'challenge'
(we never have problems, only challenges ;-)


Hope this helps,

/* era */

You might want to look at
<http://www.iki.fi/~era/procmail/mini-faq.html#from>

Looks good, this faq. I just started using procmail and it looks
very powerfull. 

Bye !

-- 
Martin Terpstra                     Alcatel Telecom Nederland
Software Design Engineer            Engineering & Development
phone :  +31 (70) 3079-407          Burgemeester Elsenlaan 170
fax   :  +31 (70) 3079-191          2288 BH  RIJSWIJK
mailto:terpstra(_at_)ats(_dot_)nld(_dot_)alcatel(_dot_)nl  NETHERLANDS