procmail
[Top] [All Lists]

Re: formail error 74 ??

2004-10-22 09:54:40
On Fri, 22 Oct 2004 18:28:48 +0200, Dallman Ross <dman(_at_)nomotek(_dot_)com> 
wrote:
On Fri, Oct 22, 2004 at 03:07:38PM +0200, Per Jessen wrote:
formail <mailbox -s formail -cf -X 'X-Spam-Status' ; echo $?

It seems to do I what I asked, except it returns 74.

Your syntax is causing the problem.  The "<mailbox" goes at the end.

No, that's not it.  Redirections can appear anywhere; check out the
formal syntax for shell commands in the POSIX specifications.  One can
even write

  <mailbox formail -s formail -cf -X 'X-Spam-Status'

The real problem is that the "inner" formail does not read the body of
the message that is being passed to it by the "outer" one.  This
causes the outer formail to get a write error in any case where the
entire message is too large to fit into the I/O buffer between the
processes (that is, where the inner formail exits before the outer has
finished writing).

Try
    formail <mailbox -s formail -kcf -X 'X-Spam-Status' ; echo $?
and you'll see that the error goes away (but you won't get the result you want).

Dallman is correct about needing only one formail, but he's got the -s
in the wrong place; it has to come last.

    formail -cf -X "X-Spam-Status" -s < mailbox ; echo $?

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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