procmail
[Top] [All Lists]

Re: Folder test/create problem

2002-07-07 14:53:31
Adam Bailey <adamb(_at_)lull(_dot_)org> writes:
I've got a recipe set up to file incoming messages from a certain
criteria into a directory and chmod it so that people can view the
messages on the web. Everything worked fine until I decided to copy
the man example about diverting the messages into a named directory.

...except that you left off a critical part of the example.


What follows is the relevant part of the recipe. The rest works
fine, so I won't complicate things.

   SFAAPP = $HOME/web/gms/sfa/apps/`date +%y%m`
   
   :0 a
   {
       :0 ic
       * ? test ! -d $SFAAPP
       | mkdir $SFAAPP;chmod 755 $SFAAPP


The example in the procmailex(5) manpage includes the 'W' flag on
the recipe.  This is what tells procmail to wait until the action has
finished before proceeding.  Because it doesn't need to wait for the
action to complete, procamil goes on to the next recipe as soon as it
finishes stuffing the message down the pipe to the action.  While the
shell is still starting up, procmail is going ahead and delivering to to
the indicated path, treating it as a file because it doesn't exist...
I would bet that you would _not_ see this problem if the first message
of the month was larger than PIPE_BUF (usually 8K) bytes long, as then
procmail would block waiting for the action to read some of the message
or exit.

So, put back that 'W' flag that you left off give it another try.


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

<Prev in Thread] Current Thread [Next in Thread>