procmail
[Top] [All Lists]

Re: Executing programs in a procmail script

2001-12-10 03:27:01
Paul Chvostek <paul(_at_)it(_dot_)ca> writes:
On Mon, Dec 10, 2001 at 08:55:02AM -0000, John Conover wrote:

In man procmailex, the following recipe is used to create a directory
named $MONTHFOLDER:

    :0 Wic
    * ? test ! -d $MONTHFOLDER
    | mkdir $MONTHFOLDER

Is the message piped to mkdir?

Is there a better way of executing a program without having the
message piped to it?

Lots of ways.  You can do things in backquotes, you can assign variables
whose contents are the stdout of a command line, etc.

Those are _other_ ways, but they are not _better_ ways.  In particular,
if you're not using the output of the command, making it the action of a
recipe with the 'c' and 'i' flags is more efficient than using a variable
capture recipe or a variable assignment with backquotes.  Those both
require procmail to create an extra process and pipe that a simple
        :0 ic
        * conditions
        | command here

doesn't.  (The extra process is needed to avoid deadlock when filtering
the message through the command.)


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