procmail
[Top] [All Lists]

Re: Filter for message that have nothing but headers?

2004-10-19 05:11:22
Toen wij Jim Witte kietelden, kwam er dit uit:

   How would I write a filter for mail that had nothing but headers,
and no body text (from spambots that didn't get through Quality
Assurance..)?  Something like:

* Status:[ \n\t]*

but that would only match if that were the *last* thing in the
  message? And of course, it might not have a Status: header..

This has been talked about very often here. One approach is 
to count non-whitespace in the body and continue if there 
is more than some limit:

  :0  # at least 3 non-space characters in the body
  *         -3^0
  * 2147483647^0
  *          1^1  B ?? [^  ]
  {
    PM_score = $=
    :0
    * ! PM_score ?? ^^2147483647
    IN.empty-body
  }

There are one space and one tab inside [^  ].

Beware: a simple message that just contains "no" 
will be delivered to IN.empty-body by this recipe-set. 
Change the -3^0 to -2^0 for a less liberal approach. :)

(untested)

-- 
Grtz, Ruud

____________________________________________________________
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>