procmail
[Top] [All Lists]

RE: new user: what am I doing wrong with this recipe?

2002-09-16 09:01:49
Terry Poperszky wrote:


[Dallman Ross had written:] "Since that does happen to any mail that
isn't to the one or the other (or both),"

It is the "or both" that I was referring to, although I had my logic
backwards. OK, now I see why it will work. So, if I 
understand what you are saying this list of negations could be 
extended and the action would only be triggered if one or more 
(or all) of the conditions actually existed?

Yes.

I wrote my earlier message in a hurry, though, and now, on rereading
it, I see that I slightly misstated a few things.  Let me clarify for
posterity.  :)

Here is some of what I wrote earlier:

Condition lines are ANDed.
That means that both "not ^TO_foo" and "not ^TO_bar" would have to be
in the message for this recipe to be triggered.  Since that 
does happen to any mail that isn't to the one or the other 
(or both), then the recipe would get triggered on that mail.  

I should have said, "That does happen, but only to mail that is
BOTH 'not ^TO_foo' AND 'not ^TO_bar'.  Mail that is to the one or
the other (or both) fails the recipe, and falls through to the
exception recipe found beneath it -- whereupon it gets routed to
/dev/null."

                         The recipe says, though, to
do exctly *nothing* (what's in the empty curly braces).

That was: if it's innocent mail -- neither ^TO_foo nor ^TO_bar --
the recipe is triggered.  Its action is, though: do nothing.
Then we skip the "else" recipe, because we did meet all the
conditions on this recipe (and did "nothing").


Then we have an ELSE recipe.  That only gets triggered if we *didn't*
succeed on the previous recipe.  In other words, if the message WAS
"^TO_foo" or "^TO_bar" (or both), we are here.  Since we don't like
foo or bar, we do what we intended: trash the mail.

This part of my explanation seems fine in retrospect except for one
point: "Succeed" is a tricky word.  The "E" flag only looks to see
if the recipe's action line was triggered, not if what was triggered
"succeeded."  I should have stuck with: "That only gets triggered if
we *didn't* trigger the previous recipe."

(There is also an "e" flag that will look to see if the action
"succeeded."
We're not bothering to use that here, though.  We don't need to check
to see if "do nothing" actually succeeded.  If it didn't succeed, well,
then, instead, we probably would have done, uh, nothing!)  :-)

-- 
Dallman Ross


"If you find a path with no obstacles, it probably does not lead to
anywhere."
        Thoughts of Rev. Sunnan Kubose, from _Zen in the Markets_ 

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