procmail
[Top] [All Lists]

Re: procmail problems on sunos after OS patches installed

1996-05-29 15:14:53
Larry Glaze <glaze(_at_)rclsgi(_dot_)eng(_dot_)ohio-state(_dot_)edu> writes:
...
it the name of the temp file as one of its arguments.  I keep getting
the 'Error while writing to...' message, which didn't occur until after
the patches were installed.  Has anyone else seen this?  I looked in the FAQ
...
Here is the recipe which used to work (may not be the best way, but it worked
when I needed it to):
:0:
* !^FROM_DAEMON
* !^X-Loop: user(_at_)domain(_dot_)com
* !^Subject:.*Re:
{
   DATE=`date +'%H%M%S'`
   FILE=tmpsend.$DATE
   FROM=`formail -rx To:`
   :0
   |`formail -ds >>/usr/tmp/$FILE`;/usr/local/home/user/script.pl $FROM $FILE
}

Everything works right up to the 'formail -ds' command, which is the part
that keeps on failing.  

What the heck are those backquotes doing there?  Take them out and try
it again.  Since formail doesn't print anything, the shell then tries
to execute the command "", which is impossible.

Note, since you're writing to a file you should have a local lock (what
it two messages arrive within the same second?  And don't say it can't
happen).  Note that the local lock on the outer recipe is *USELESS*.
Procmail should be logging a warning about it.

Even better, fix "script.pl" to accept the split messages on stdin, in
which case you could say:

        |formail -ds | /usr/local/home/user/script.pl $FROM

as the action.  Consider using the "<>" idiom in perl (or maybe you
already are, in which case you can just do this right now).  Don't
forget to remove the DATE and FILE lines if you do.

Philip Guenther

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