procmail
[Top] [All Lists]

Re: [Q] procmail lock timing?

1997-12-22 11:20:51
Dave Begley has this code,

[while a regional lockfile is in effect]

|   :0hw
|   | fgrep -i -s "${MSGSENDER} ${THISWEEK}" ${ACKFILE}

and gets this error message in a verbose logfile:

|   procmail: Error while writing to " fgrep -i -s "${MSGSENDER} ${THISWEEK}" 
${ACKFILE}"

This sounds like a job for the `i' flag.  The action line of that recipe does
not read stdin; fgrep takes its input from $ACKFILE without using any text
from the message.  (Also, the braces aren't needed, and I think the line
looks less cluttered without them; and a comment that you really do want to
lose the message if fgrep reports success is a good idea, because on first
glance it looks like a mistake.)

    :0hwi # drop message on success
    | fgrep -i -s "$MSGSENDER $THISWEEK" $ACKFILE

The reason some messages do not engender the write error has nothing to do
with lock timing; rather, sometimes the head (the `h' flag already limited
writing to just the head) is small enough to fit into one buffer and
sometimes it isn't; it's only when procmail tries to write a second buffer
that it notices whether the first one was accepted.

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