procmail
[Top] [All Lists]

Re: FW: "Error while writing to" even though it works

2002-11-08 22:29:02
"Anderson, Matt" <AndeM9(_at_)ncs(_dot_)com> writes:
I've got a rather simple procmail recipe file who's sole purpose it to save
the incoming message to a specific folder and then pass it to a shell
script. 99% of this time my logs look great, but every so often I'll
received the following error:
...
**********************************************
From informix(_at_)redison1(_dot_)ic(_dot_)ncs(_dot_)com  Fri Nov  8 00:03:27 
2002
Subject: Informix Full Backups
 Folder: /home/procmail/Mail/MailProcessor.sh /home/procmail/Mail/inco
2043
stty: tcgetattr: Not a typewriter
procmail: Error while writing to "/home/procmail/Mail/MailProcessor.sh"
**********************************************

I can live with the stty error, it's no big deal... The last line kinda
bothers me though.

The error from stty is caused by invoking stty from the wrong shell
rcfile.  If you use csh/tcsh, then commands that require a terminal
should only be invoked from the .login file.  If you use sh/bash, then
they should be invoked from the .profile file.


The really weird part, however, is that according to the logs that my
MailProcessor.sh script puts out, it DID receive the message, and DID
process it properly, exiting with code 0.

The problem is that MailProcessor.sh isn't reading in the entire message
before it exits.  If it only cares about the header, then you should put
the 'h' flag on the recipe.  If it needs to see some, but not always all,
of the message body, then you should put the 'i' flag on the recipe.

Note that when the error you show occurs, procmail does *not* stop
processing the message with that recipe, but rather continues on with
the remaining recipes in the rcfile.  In this case, that'll probably
result in a duplicate copy of the message in your inbox.


Philip Guenther

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