procmail
[Top] [All Lists]

Re: regarding OR's on multiple lines

2008-06-16 13:01:15
TLD Procmail wrote:
All,

  I used to know how to do this, but for the life of me
cannot remember.  How do I set multiple lines that act
as OR's?

  Let's say for sake of an example that I want to catch
anything not to me and not from my domain, but that
potentially has a series of catch phrases in the subject
line:

:0:
* H ?? ! ^TO_tld\(_dot_)procmail(_at_)stimulacra\(_dot_)com
* H ?? ! ^From:.*stimulacra\.com
* H ?? ^Subject:.*(phrase1|phrase2|phrase3)    OR
* H ?? ^Subject:.*(phrase4|phrase5|phrase6)    OR
* H ?? ^Subject:.*(phrase7|phrase8|phrase9)
/mail/has_catch_phrase

If you just try to add a "|\" at the end of your conditions above you're making continuations that repeat the "* H ??". Something's gonna break.

Here's a method that doesn't use scoring. I found a "sort of" searchable archive but its search engine is almost useless. I had to search on my name then skim through various old messages of mine to relocate this method (which was NOT originated by me).

This snippet does not take into account your first two AND bits that you want to always match before getting into the "OR" portion. Another set of brackets should take care of that. Sean?? Fix me?

When I use this I normally put a SINGLE condition on each line. that way I can add/delete conditions at will without being careful of (|) operators.

I use this a lot when a single entity has several different email addresses that they may send ^From. or to group all email from family members into a single folder with a single recipe.

This will deliver into /mail/has_catch_phrase if ANY of the conditions match.

#OR using "NOT AND"
:0
* ! ^Subject:.*phrase1.*
* ! ^Subject:.*phrase2.*
* ! ^Subject:.*phrase3.*
{ }
:0 E:
/mail/has_catch_phrase


Gerald
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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