procmail
[Top] [All Lists]

Re: Question about filtering by criteria in the body

2006-10-18 02:40:38
On Wed, Oct 18, 2006 at 01:53:14AM -0400, Steve Lake wrote:

I'm looking at temporarily implementing a solution that I hope
will do what I need for the time being.  I'm looking at doing
a rule that will grab the criteria '<img alt="" ' in the body
(all the image spam seems to use a blank alt with the image tag
in exactly the same way from what I can tell)

:0
* B ?? \<img src=\"\"
mail/images

         Would that little rule work?  Thanks in advance.

1) All you have to do to test a body-egrep rule is to try
it on your command line with grep.  For me, going to my
spam folder and typing

   % grep -w 'img src=\"\"' *

produces no hits.

Similarly, in my good-mail folder, no hits.

If I get rid of the quoted double-quotation marks after the
equals sign and try

   % grep -w 'img src=' *

I also get no hits in my spam folder, but I get 6 hits in my
last-100-good-mail folder.  (That folder is actually a
backup of the last 100 non-whitelisted, non-spam-tagged
email; it's mostly business mail, but none of it is spam.)

Are you sure that expression -- with or without the empty quotes --
works on lots of your spam?


2) You need a lockfile, assuming your destination folder is
a Berkeley-style mailfile and not a directory.


3) You do not need to body-grep all email looking for html-type
tags.  If you decide the condition is worthwhile, limit it to
email that could possibly contain the html tags.  You will save
oodles of cycles on your server that way.

  :0:
  * ^Content-Type:.*(multi|html)
  * B ?? ()\<img src=
  destination


In summation, (a) I wouldn't do this; it's rife with false pozzes.
(b) If you decide you still want to do it, use a smart condition such
as the first one above to limit its impact.

Dallman

____________________________________________________________
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