procmail
[Top] [All Lists]

Re: Problems matching attachment and autoreplying.

2002-02-15 12:54:17
Niklas Palmqvist <npalmqvist(_at_)shipco(_dot_)com> writes:
...
- Looking at the log, there is an error 'procmail: Error while writing to " 
(formail -rt ; \', what does this mean?
...
:0
| (formail -rt ; \
echo "Your e-mail was bounced!" \
) | sendmail -oi -t
}
...
procmail: Executing " (formail -rt ; \
echo "Your e-mail was bounced!" \
) | sendmail -oi -t"
procmail: [3586] Fri Feb 15 10:04:22 2002
procmail: Error while writing to " (formail -rt ; \
echo "Your e-mail was bounced!" \
) | sendmail -oi -t"

The problem is that you're feeding the entire message into "formail -r",
which only wants the header.  Procmail then gets a write error when
formail exits without having read the entire message.  Note that you'll
only see this message if the body is more than PIPEBUF (usually 8k)
bytes long, or if formail gets scheduled to run ASAP by the kernel.

The solution is to tell procmail to only feed the header into the pipe
to formail by putting the 'h' flag on the recipe.  You should also add
a check to make sure someone can't trick this recipe into responding
to itself:

        XLOOP = "npalmqvist(_at_)shipco(_dot_)com"

        :0 h
        * ! $ ^X-Loop: *$\XLOOP
        | ( formail -rt -A"X-Loop: $XLOOP" ; \
            echo "Your e-mail was bounced!" \
          ) | $SENDMAIL $SENDMAILFLAGS -t


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