procmail
[Top] [All Lists]

Re: Executing programs in a procmail script

2001-12-10 03:31:04
    :0 Wic
    * ? test ! -d $MONTHFOLDER
    | mkdir $MONTHFOLDER

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

Generally the mail is passed to the program, yes.  That happend in both
the external programs in the example - the 'mkdir' and the 'test'.  If
you want to reduce the amount of data passed to the external program in
an action you could use the 'h' flag on the colon line so that only the
header is passed out, not the body.

If you really want to cut down on the data piped to the program you
could do something like this:

 DUMMY=
 :0c
 * DUMMY ?? ? mkdir $MYDIR
 { }

The variable DUMMY is made empty, then the contents of DUMMY (nothing)
is passed out to the external program.

Hope that helps,
Martin
-- 
Martin McCarthy                 /</                  PGP key available
    `Procmail Companion'        \>\  http://www.ancient-scotland.co.uk
     Addison Wesley             /</    http://www.ehabitat.demon.co.uk
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail