procmail
[Top] [All Lists]

Re: help. my rules just stopped working...

2004-12-06 11:18:33
On Mon, Dec 06, 2004 at 08:44:26AM -0800, Professional Software
Engineering wrote:

At 09:49 2004-12-06 -0600, Christopher L. Barnard did say:
but isn't "h" enabled by default?

h *AND* b, unless ONE or the other is specified.  In this case, just h, 
meaning to pipe ONLY the headers.  Think of a 100KB message body, with 
perhaps 3KB of headers.  Do you want to pipe 103KB to formail, or just 3KB 
?  The end result will be the same, but you'll have better performance.

Yes.  The point is not to pipe the body through needlessly.  The head
only is the default for conditions.  The full message (hb) is the
default for actions.

 And i would think that I should not have "i" since if there is an
error in the recipe I want to hear about it.

Er, and how do you figure you're going to be notified of the error?
Some notification delivered to you by procmail?

In other words, i isn't about error notification.  It's about
closing the pipe too soon (if it's not there).  Procmail feeds
to a filter pipe when you tell it to; but procmail has no way
of knowing what the filter program is, or what it does with the
piped input.  If you feed long messages (longer than the pipe's buffer)
through, the filter will fail without the i-flag, depending on
what the program on the other side of the pipe is.

Sean is right that formail doesn't have a problem and it's unnecessary
here.  (But using it wouldn't give you or your procmail process
more information.)

I had this early-closed-pipe issue come up last fall when I'd suggested
some hoary code to someone on the Virus Snaggers list.  He wrote back
that my suggestion -- which I had tested -- didn't work all the time,
but only sometimes.  I tested some more and found out it only worked
on medium-length-or-shorter messages, not longer ones, because the
pipe closed early on longer ones and the filter action undid itself.

Here is an excerpt from the message I wrote there correcting myself:


  > All right, here's the reason you get an error sometimes but not
  > always.  It also explains why my tests back when I wrote that
  > worked okay.  We are exceeding the buffer with long messages.
  > We need an "i" flag on the recipe!  That's all that's wrong.
  > Short messages got through okay.  Long ones barfed.  The
  > "i" (ignore pipe that was closed early) flag is the ticket!
  > 
  > So instead of
  > 
  >      :0 fw b
  >      | head; echo "----- message body abridged -----"
  > 
  > 
  > we want
  > 
  >      :0 fw i b
  >      | head; echo "----- message body abridged -----"


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

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