procmail
[Top] [All Lists]

Re: flaky recipe -- too bad it's not for pastries

2003-02-12 12:46:42
On 12 Feb, Jeff Orrok wrote:
| [...]
| 
| My problem is 12 times out of the last 82 firings of my autoresponder recipe, 
| I got an 'Error while writing to "x"' message.  [...]
| 
| [snip part of recipe]
| 
|   :0W
|   * !^FROM_DAEMON
|   * !^X-Loop: procmail(_at_)orrok(_dot_)com
|   | (formail -q- -r \
|       -XSubject: \
|       -XTo: ; \
|      echo "From: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
|      echo "Reply-To: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
|      echo "X-Loop: procmail(_at_)orrok(_dot_)com" ; \
|      echo ; echo "Hello, you sent a message with the above subject to 
$SENTTO" ; \
|      cat $HOME/autoreply.text ; \
|     ) 2>>ERROR${LASTMSG} | $SENDMAIL $SENDMAILFLAGS -t 2>>ERROR${LASTMSG}
|   
| [snip more of recipe and part of log]
| 
| >From lanceric(_at_)jump(_dot_)net Wed Feb 12 07:46:24 2003
|  Subject: The Cancer fighter is here - try calcium
|   Folder: nonwhitelist/msg.Ad0L                                            
9774
| 
| [snip more log]
| 
| procmail: Error while writing to " (formail -q- -r \
|       -XSubject: \
|       -XTo: ; \
|      echo "From: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
|      echo "Reply-To: \"Jeff Orrok\" <REDEEM${LASTMSG}.$SENTTO" ; \
|      echo "X-Loop: procmail(_at_)orrok(_dot_)com" ; \
|      echo ; echo "Hello, you sent a message with the above subject to 
$SENTTO" ; \
|      cat $HOME/autoreply.text ; \
|     ) 2>>ERROR${LASTMSG} | $SENDMAIL $SENDMAILFLAGS -t 2>>ERROR${LASTMSG}"
| [...]

I think you need an "h" flag and maybe an "i" flag on the recipe above.
By default, procmail feeds both the headers and the body of a message to
the pipe.  Your pipe doesn't need the body so it's inefficient to feed
it.  You've also discovered it can cause the recipe to fail, because the
pipe closes before procmail is finished writing to it, and procmail
thinks there's a problem.

So why some times and not others?  I had a similar question, though mine
was about an inability to generate the "while writing to" error. Since
the size of the message was 9774, it probably met one of the conditions
Philip described in his answer to me:

http://www.xray.mpe.mpg.de/mailing-lists/procmail/2002-11/msg00116.html

I think the "h" flag clears up the problem.  I'm easily confused on the
interaction of different combinations of flags, but I'd guess you'd
want to add the "i" flag if you want procmail to consider the message
delivered at that point regardless of errors.  Leave it off if you want
to continue to your e(lse) recipe to trap errors.

-- 
Email address in From: header is valid  * but only for a couple of days *
This is my reluctant response to spammers' unrelenting address harvesting



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