procmail
[Top] [All Lists]

Re: how to match against first N lines/bytes of body?

1997-11-13 12:50:48
Adam Grove writes on 13 November 1997 at 13:18:29
When I have recipes search for patterns in the body of a message,
I'd like to limit how many lines (or bytes, it doesn't really
matter much) into the message the search is performed.
[...]
The other problem, though, is that my spam filtering recipe often
gets false positives on long mail, because if genuine mail is *long
[...]
have the right statistical properties. I'm convinced that simply 
filtering just on the first 50 or so lines would be much better.

If that's the case, you could simply limit your spam filtering to
those messages that are less than N lines
   N=50
   :B
   * $${N}^0
   * -1^1 ^.+$
   { ... process message of < N lines ... }
but you said either N lines or N bytes so make that simply
   N=5000
   :B
   * $ < ${N}
   { ... process message of about < N bytes ... }

   Dan
------------------- message is author's opinion only ------------------
J. Daniel Smith <DanS(_at_)bristol(_dot_)nl>         http://www.bristol.nl/~DanS
Bristol Technology B.V.                   +31 33 450 50 50, ...51 (FAX)
Amersfoort, The Netherlands               {info,jobs}(_at_)bristol(_dot_)com