procmail
[Top] [All Lists]

Re: dynamci filters

2008-08-14 18:40:15
On Thu, Aug 14, 2008 at 04:00:13PM -0700, George Crum wrote:
I have not tested this yet.  Does anyone see any problems that we
would have with this?


# pager on 1st notification and set to not pager until the tmp file is removed
:0 
* ^Subject:.*PROBLEM alert - server123 is CRITICAL
{
        # If file exists then forward to nopager
        :0 
    * ? test -f /tmp/file
    ! nopager(_at_)domain(_dot_)com

    # If file does not exist then create file and forward to pager
    :0 iE
    {
        * ? test ! -f /tmp/file
        | touch /tmp/file
        :0
        ! pager(_at_)domain(_dot_)com
    }
}

I don't think the i-flag does any good on a nested recipe.
You'll probably see an error in your log from that.  It
won't cause anything to do anything untoward, though.

Algorithmically, you don't need to run the same test each
time.  If the first nested recipe failed, then the test is negative and
you can run the second recipe without a condition line.

Even the E-flag is superfluous, as is the second (inner) nested-brace
set, because if the first nested recipe evaluated true, the action
will have been performed and procmail will have exited already.

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