procmail
[Top] [All Lists]

Re: Phantom lines in empty body

2004-06-20 17:32:25
On Sun, Jun 20, 2004 at 06:01:29PM -0500, David W. Tamkin wrote:
   * B ! ?? [^$WS]|$

That condition will never match, Dallman.  Even an empty body, even if 
it's malformed and doesn't end with a real newline, will match because 
of the putative newlines.

Erp.  I had tested it.  But I left the $ expansor off, is why I
was fooled.  All right, this, then.  (I probably shouldn't be
posting now, as it's past my bedtime and I'm very tired.)


  :0
  * B ??  1^1 > 1
  { BSIZE = $= }

  :0 E
  { LOG = "$NL Body was null! $NL"  HOST }

  THRESHOLD = 20  # or whatever you want that's small
  :0
  * $ $THRESHOLD^0     
  * $    -$BSIZE^0
  { # we're here because the body is pretty damn small
    # so let's do some more testing

    :0
    * $ B ?? [^$WS]
    { }
    :0 E
    { LOG = "$NL Body was very small and had no non-white chars $NL" }

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail