procmail
[Top] [All Lists]

Re: Phantom lines in empty body

2004-06-21 06:03:56
Toen wij Gary Funck kietelden, kwam er dit uit:

STOP  = -9876543210
SPACE = " "
TAB   = "     "
NL    = "
"
WS    = "$SPACE$TAB$NL"

 :0B:
 * 1^0
 * $ $STOP^0 [^$WS]
 empty-body.mbox

The inclusion of $NL in that [^$WS] is odd, since matches are 
already limited (at EOL) without it. 



  SPC  = " "
  TAB  = "     "
  NL   = "
"
  OR   = "9876543210^0"
  NOR  = "-$OR"

  b    = "[$SPC$TAB]"     # blank (see 'man isblank')
  s    = "[$SPC$TAB$NL]"  # whitespace (see 'man isspace')
  S    = "[^$SPC$TAB]"    # nor-blank-nor-whitespace

  :0B:
  *$ $NOR $S
  *  1^0
  empty-body.mbox

or:

  :0B:  # efficient, because it bails out at the first non-space.
  *$ ! $S

  empty-body.mbox

or:

  :0B  # at least 1 line with at least 2 chars of which at least 1 non-space.

  *$ $OR $S.
  *$ $OR .$S

  { }
  :0E:
  empty-body.mbox

(untested)

-- 
Grtz, Ruud

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

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