procmail
[Top] [All Lists]

Re: unprocessed message leaking through filter perl script

1999-01-30 00:59:00
At 23:37 -0600 29 Jan 1999, "A. Lester Buck III" <buck(_at_)Compact(_dot_)COM> 
wrote:
I subscribe to about ten "daily tip" mailing lists.  I send the tip
message through a perl script to extract the tip from the fluff
and append the tip to a file.  This works just fine.  Randomly,
one or two complete tip messages each day are also delivered
directly to my mailbox.  This I don't understand.  I guess it must
be some locking problem, but adding :'s didn't have any effect.

      if (/^-------------------------/) {
          exit;

I suspect that this is the problem; your script is exiting without
reading the entire message.  Sometimes procmail will be able to write
the rest of the message to the pipe buffer, so it will work fine.  But
if the trailing text is too large, procmail will fill the buffer and
receive a write error; when this happens it considers the delivery to
have failed and continues trying to deliver the message.

To avoid this add the 'i' and 'w' flags to the procmail recipe.  The 'i'
flag tells it to ignore write errors, and the 'w' flag tells it to use
the programs exitcode to determine if delivery was successful.

With these flags, the first line of the recipe would be:

:0wi:

-- 
Aaron Schrab     aaron(_at_)schrab(_dot_)com      http://www.execpc.com/~aarons/
 Though I'll admit readability suffers slightly...   --Larry Wall

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