procmail
[Top] [All Lists]

RE: dynamci filters

2008-08-15 19:28:29
George Crum [mailto:vfstaboy(_at_)yahoo(_dot_)com] Saturday, August 16, 2008 
2:14 AM:

This is actually what I have in .procmailrc with the names 
changed to protect the innocent. :)

:0 
* ^Subject:.*PROBLEM alert - server123 is CRITICAL
{
        # If file exists then forward to nopager
        :0 
        * ? test -e $tempfile
        ! nopager(_at_)domain(_dot_)dom

        # If file does not exist then create file and forward 
to pager 
        :0
        | touch $tempfile
        :0
        ! pager(_at_)domain(_dot_)dom
}

Now I understand your complaint.  You're saying after the touch
there is no mail to the pager.

That is as designed.  The touch recipe is a delivering recipe.
The message is "delivered."  (It goes to the bit-bucket.  But
procmail has no way of knowing what's on the other side of the
pipe.)

If you want something to happen after a delivery, then you
need the c-flag on the first delivering recipe.

Next time, please post current code, current logs, and edit
out extraneous material while keeping in material we need
*in the message we are looking at* to answer the question.

I don't save old procmail list messages.  I don't have time to
go look them up in the archives for each current thread I
decide to try to answer.  So the art of presentation is,
short, succinct, but with what we need to help in that message.

Also, please don't cc. me on list messages.  Very long-term
list members will remember when I had a different preference.
Well, that was five and ten years ago.  Things change. :-)

# Received Recovery, remove tmp file and forward to pager
:0 
* ^Subject:.*RECOVERY alert - server123 is OK
{
        :0
        | rm -f $tempfile
        :0
        ! pager(_at_)domain(_dot_)dom
}

Same thing is going on here.  Put a c-flag on your first nested
recipe so the pager recipe has something there to trigger it.

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>