procmail
[Top] [All Lists]

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

2003-02-14 12:28:22
On 13 Feb, Jeff Orrok wrote:
| Yes, the h flag did the trick!  Over 24 hours with no errors.  Thank you to
| dman, Don, & David.
| 
| It seems like formail should not slam the door on its end of the pipe.  I am
| not under the impression that such behavior is common with many other programs
| or utilities, otherwise piping in unix would never be used!
| 

First I'll say I'm no expert in unix internals, pipes, signals,
programming, or much of anything. What follows could be all wrong.

Second, the "issue" is not formail closing the pipe, but procmail
testing for that close.  I would guess that formail's performance here
is completely in keeping with "the unix way".  What's different is
procmail catching the signal and treating it as a failure, and in this
case it's for VERY good cause.  IOW, it's not a bug but a feature.

I would guess normal unix behavior is to either ignore SIGPIPE, or
to quietly exit. You would only trap SIGPIPE if you care about an early
closed pipe. Otherwise, you'd simply trust that the other end of the
pipe knows what it's doing. If it doesn't want any more data, that's
its business. So why does procmail trap it?  Because you're telling
procmail your mail is being delivered to that pipe.  It errs on the
side of caution, and recovers the message, to protect you from losing
mail.

formail closes the pipe because all it needs is the headers. It can't do
anything with the body, so piping the body to it is a nonsensical waste.
Of course, procmail can't know the expected behavior of every program
you could pipe to, so you have to a) feed only that which is necessary
(i e. use the "h" flag in this case); and/or b) tell procmail not to
worry about an early closed pipe by giving it the "i" flag on the
recipe, if that's appropriate.  Othwerwise, it's doing exactly as
advertised and protecting your mail.

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