procmail
[Top] [All Lists]

Re: Phantom lines in empty body

2004-06-20 18:33:49
At 02:27 AM 6.21.2004 +0200, Dallman Ross wrote:
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

What's wrong with just this simple recipe? Haven't had any get past it.

## Blank Body Messages          
:0 B:
* ! ...
$BLANK

Best regards,
Jack L. Stone,
Administrator

Sage American
http://www.sage-american.com
jacks(_at_)sage-american(_dot_)com

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