procmail
[Top] [All Lists]

RE: Trouble with procmail.

2007-09-27 14:42:58
Bart Schaefer wrote Tuesday, September 25, 2007 4:19 AM:

On 9/24/07, Dallman Ross <dman(_at_)nomotek(_dot_)com> wrote:

k3rn wrote Monday, September 24, 2007 5:58 PM:

On Monday 24 September 2007 17:12:43 Dallman Ross wrote:
Apply the i-flag to your recipe.

Thank you so much !

Can you explain me why there was an error ?


I'm no hardware guy so may not be the best person to
explain this, but I'll try.

Er, hardware? ;-)

Proving once again that wine and procmail don't mix! :-)

My understanding of why is that while procmail, being the
brute-simple tool that it is, will gleefully follow your
directive and shunt your message to a pipe, it nevertheless
has no way of knowing what program or thing you have placed
to the right of that pipe.

So far, so good ...

IOW, procmail's job ends when it sends the thing on to the
pipe (unless you've told it to wait for the exit status).
How can procmail know how long to hold the pipe open if
there's no feedback from the other side of the pipe?

Here you've gone astray.

I'm sure I've explained this previously on the list, but I
can't seem to find that message, so:

I thought you or somebody had too, and looked around a bit
for the answer because I knew it would be better than mine.
But I couldn't find it so decided (based on the skewed
decision-making process of the aforesaid wine) to go ahead
and chance an explanation based on my imperfect understanding
of How It Works.  In any case I'm glad you came back and
added the right corrective credibility to the answer.
I'll keep this answer of yours around in a private archive
of mine.

When unix (or linux, or any related OS) creates a pipe, the OS
allocates a chunk of memory to act as an I/O buffer between the
ends of the pipe.  This gives the process on the "writing end"
of the pipe some space into which to send data even if there's
nothing reading on the other end yet.  When the buffer fills
up, the OS blocks the writer (usually). Then when a reader
comes along, it takes (some, maybe all, of) the data out of the
OS buffer and the OS unblocks the writer so it can send some
more.

Wow.  Uh, yeah.  I thought I said that.  Didn't I say that?  :-)

The recipe's i-flag says to procmail, "Dude: just hold
that baby open, will you?"  So then your program has
time to operate.

The i-flag means "ignore any errors, including SIGPIPE, that
happen when writing to this pipe."

Which, I believe, is engineering-speak for "Dude: just hold that
baby open, will you?"  :-)  No, not really, but -- thanks, Bart.

Question: so can we use the i-flag instead of w or W if we
don't want to see any logs about erros but still want to
code around them in procmail?

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