procmail
[Top] [All Lists]

Re: new-mail flag files

2010-09-30 20:18:27
At 13:49 2010-09-30, Enrico Weigelt wrote:
> :0
> * some condition
> * ? touch /path/to/file
> ACTION

"* ? ..." means that <...> will be executed ?

'man procmail' and 'man procmailex' would be appropriate commands to run about now.

Alternatley, you could invoke touch inside a braced action:

:0
* some condition
{
        DUMMY=`touch /path/to/file`

        :0
        DELIVERY_ACTION
}

You can use the ? condition syntax to grep the touched file, or you could echo something into a file, whatever.

I'm unclear on the specifics of what you're trying to accomplish, but let's say that the external process that cares about the touched file only needs to be run once in a while, but not on each message reception, if that process deletes the touchfile when complete, your procmail recipe could TEST to see if the file exists - if it does, there's nothing extra to trigger, and if not, touch the file and trigger some notification or whatever.


My basic point with using the ? condition is that you don't need to incur the overhead of a copy (which, depending on the message size, could be significant).

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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