procmail
[Top] [All Lists]

Re: rules be or'ed instead anded

2001-09-29 10:10:03
On Sat, Sep 29, 2001 at 12:50:45AM -0700, Andrew Edelstein wrote:
Please do not reply to me privately on Procmail list postings, when the
content of your reply is of interest to the list.
Sorry.. didn't see that, I just replyied it..

On Sat, Sep 29, 2001 at 04:23:46AM -0300, Marcelo Ricardo Leitner wrote:
On Sat, Sep 29, 2001 at 12:04:33AM -0700, Andrew Edelstein wrote:
That's what the | does. That character (when used in a regexp) means, 
literaly "or".
---end quoted text---
yes.. but then to match a subject and a to field i would have to do:
* (^To:.*(email1|\
email2|\
email3)|\
^Subject:.*hi)

Wrong. That matches a Subject: OR a To:.
Yes, that's what I mean, put the three emails plus something with hi on subject 
on that mailbox..

If you want to match a Subject: AND a To:, you would do:

* ^To.*(email1|email2|email3)
* ^Subject:.*hi

i would like to have just
* ^To:.*email1
* ^To:.*email2
* ^To:.*email3
* ^Subject:.*hi
got it?

Yes, I got it. What you would like to have and what you can have are two
different things.
What you don't "got" is that multiple conditions in a procmail recipe (where a
"condition" is a line beginning with "* ") are AND'd. To define paramaters
that are logically OR'd they must be in the same procmail condition. If you
would like to put each paramater on a seperate physical line, you will need to
use the line-continuation syntax procmail uses.
Here we got it. I was thinking about some flag to the recipient like the E 
flag, but not for recipients, but for the rules..

You could, if you REALLY wanted to, write this as

* ^To:.*email1|\
  ^To:.*email2|\
  ^To:.*email3|\
  ^Subject:.*hi
Yes.. that's what I want.. but this is kind of ugly! :)

While this is perhaps VISUALLY clearer, it's AWFULLY redundant and efficiency
would probably suffer.
And what do you recommends to me for not loosing performace?

This is without addressing the use of "To:.*" v. "TO" or "TO_", which is
another issue.
That's another question that I coudn't undestand from the manpage..
How do I use it?
---end quoted text---

-- 
Marcelo R Leitner <mrl(_at_)matrix(_dot_)com(_dot_)br>
ICQ #: 29966851
Kill'em All ... And Justice For All.
_______________________________________________
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>