procmail
[Top] [All Lists]

Re: Weird Error With Auto Reply Recipe

2001-11-16 08:57:36
Derek asked,

| I have a simple auto reply recipe that, as far as I can tell, is working
| as expected, but every once in awhile I'm getting the following error
| (sender addresses changed):

| procmail: Error while writing to " (formail -r \
|         -A"X-Loop: derek(_at_)battams(_dot_)ca" ; \
|         echo ""; echo "Your e-mail titled \"$SUBJ\" has been received!"; \
|         echo ""; \
|         cat $MSGFILE; ) \
|      | sendmail -oi -t"

The recipe is (no surprise),

|   :0
|      | (formail -r \
|         -A"X-Loop: derek(_at_)battams(_dot_)ca" ; \
|         echo ""; echo "Your e-mail titled \"$SUBJ\" has been received!"; \
|         echo ""; \
|         cat $MSGFILE; ) \
|      | sendmail -oi -t

You're feeding an entire message (no `h' flag) to formail -r without -k,
which reads only the head.  If the body is short and the buffer that
accepted the end of the message's head from procmail has room for the entire
body as well, procmail will believe that formail accepted the entire message
with no write error.  But if the body is too long -- or the head ends so
late in the buffer that there's not enough room for even a short body -- and
procmail needs to start another bufferful to finish giving the body to
formail, formail -r without -k won't read, so procmail reports a write
error.

You don't want to use -k here, because you don't want to send back the body.
That leaves two choices: adding the `i' flag to tell procmail to ignore
write errors, or adding the `h' flag to tell procmail to feed only the head
to the action.  Since you would like to know it if formail for some reason
should refuse to read in the head, I'd advise you to use the `h' flag: start
the recipe with  :0h  instead of just  :0  alone.


_______________________________________________
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>