procmail
[Top] [All Lists]

Re: "if this then that" logic doesn't seem to work

2001-04-02 08:30:29
Don Hammond wrote:
<excerpted>
At any rate, one way you might do this is something like:

:0
* ^From(_dot_)123247N(_at_)knotes(_dot_)kodak(_dot_)com
* ^Subject:.*test
{
        :0 Bc
        *xxff
        ! bird(_at_)cyber(_dot_)kodak(_dot_)com
        :0 A:
        in-testing
}

Your second (non)recipe in the block has been eliminated and the "c"
flag moved up to the first recipe.  An "A" flag has been added to the
second recipe to say execute this recipe if the condition matched on the
previous recipe (without an "a" or "A" flag at the same nested block
level).  Since there is no condition on this recipe, the action is done
if the previous recipe matched.  The trailing colon ":" tells procmail
to use a lock file while writing to the file in-testing.

I am fairly new to using procmail.  I am curious: Is the
following recipe functionally equivalent?  Is there any reason to
not simplify it in this manner?  (I am thinking that Don
Hammond's solution is less resource intensive, since it only
egreps the body if the previous conditions match.  Am I correct?)

:0
* ^From(_dot_)123247N(_at_)knotes(_dot_)kodak(_dot_)com
* ^Subject:.*test
* B ?? xxff
! bird(_at_)cyber(_dot_)kodak(_dot_)com

     :0 A:
     in-testing


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