procmail
[Top] [All Lists]

Re: How to match on empty body?

1996-10-15 15:04:11
Rick Troxel asked,

| Is there a recipe for detecting messages in which the body is empty?

The best answer I've seen posted so far was from Michael Ghens, but I'd
like to tweak it a little:

  :0Bb
  * ! [!-~]
  /dev/null

If there is a stray space or tab, it would still be counted as non-empty
if the condition is just "! .".  Also, there is no need to lock /dev/null,
and the `b' flag -- after all, the body will be shorter than the head in
such cases -- will tell procmail to lose the head the very easy way and to
lose only the body the almost-as-easy way.

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