procmail
[Top] [All Lists]

Re: Multiple sort lines problem

2009-05-28 09:57:46
On Thu, May 28, 2009 at 10:55:27AM +0100, Arthur Dent wrote:
On Thu, May 28, 2009 at 11:42:53AM +0200, Holger Wahlen wrote:
* Arthur Dent wrote:
:0:
* ^TO_kiddie2\@(mymail|mydomain)
* ^Received.*for..kiddie2\@(mymail|mydomain)
INBOX/Kiddie2

Now - My Problem:
It seems that in the first part Procmail sequentially tests through each
line until it finds a match (or not), but in the sorting part only the
first line is checked. If there is no match it goes to the next set of
tests.

Clearly I have misunderstood something. What should I do to get this to
work as I intend?

Well, what *do* you intend? Multiple conditions are "anded" by default,
so the snippet above only delivers the message to INBOX/kiddie2 if
*both* conditions match; if either one doesn't, processing goes on to
the next recipe.

So what do you want - have the message put in that box if at least one
of the two conditions matches, not necessarily both?

Yes, precisely.

What confuses me is that in the first section it *does* (or at least
seems to) work through sequentially and if any one of the conditions is
met (i.e. does NOT match the regex) it delivers to INBOX/Possiblespam.

OK - Your response has caused me to do some thinking (always dangerous)
and I think I may be beginning to understand...

Because my first set of tests is a negative check as soon as one matches
the test fails and it drops out. Only if *all* the tests fail (ie my name
doesn't appear) does the first set of rules deliver into
INBOX/PossibleSpam.

So - on to the next section. I now understand that the way I had it set
up, both (or all) tests had to match for the mail to be delivered. How
do I set it so that if any one of the tests matches it will be
delivered?

Am I right?

I have been looking into the mailinglist archives and in an unrelated
thread I saw something about "scoring". I have therefore tried this:

:0:
* 1^0 ^TO_(me|myothername)\@(mymail|mydomain)
* 1^0 ^Received.*for..(me|myothername)\@(mymail|mydomain)
INBOX/Me

...etc.

It seems to work. Is that a valid solution or is there a better method
of achieving what I want?

Thanks again

Mark

Attachment: pgpkZqhLjYumL.pgp
Description: PGP signature

____________________________________________________________
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>