procmail
[Top] [All Lists]

Re: rules be or'ed instead anded

2001-09-29 08:33:20
On 29 Sep, Marcelo Ricardo Leitner wrote:
| Hi,
| 
| I'm trying to get the rules of a recipient get or'ed instead and'ed, and I'm 
having troubles with that..
| 
| I wanna make something like this:
| 
| :0
| * ^From:.*email1
| * ^From:.*email2
| * ^From:.*email3
| friends.in
| 
| instead of what I was using before,
| :0
| * ^From:.*(email1|email2|email3)
| friends.in
| 
| Can anyone help me with this, even telling me how to put the regexp in 
multi-lines..?
| 

There have been other responses that answer the question directly,
especially the way the last sentence is composed. It's also not very
clear because the original question refers to recipients, then uses
From: as an example, then morphs into a completely different question
in a separate private exchange. But I can't help thinking Marcelo is
looking for something like:

:0:
* 1^0 ^From:.*email1
* 1^0 ^From:.*email2
* 1^0 ^From:.*email3
friends.in

which will succeed if a message is From: any of the 3 email addresses
(i.e. the conditions are effectively "or'ed" not "and'ed").

Another option, a little more resource intensive, but possibly making
maintenance of the list of addresses more easily maintainable:

:0:
* ? formail -xFrom: |fgrep -if data.friends
friends.in

where the file data.friends looks like:

email1
email2
email3

-- 
                   /"\
Don Hammond        \ /     ASCII Ribbon Campaign
Raleigh, NC US      X        Against HTML Mail,
                   / \      and News Too

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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