NSFO - Not So Fuzzy OCR
08/02/2007 - Update. A Patch to libungif (giftext) has to be made as it will segfault on a few images. See http://users.own-hero.net/~decoder/fuzzyocr/giftext-segfault.patch
07/02/2007 - STDERR was giving false positives on a few images. Used in Production system for a while with no problems.
18/10/2006 - Updated Program to find more image spam and less false positives. Also doesn't use so much CPU in finding spam.
The name of this program is based on FuzzyOCR but it's not so good as it, BUT you don't need SpamAssassin for it to work.
It will only work with Exim 4.
This is a "image spam filter" which is based on fuzzyocr but not does not need Spam Assassin
It will reject image based spams hopefully with low False Positives. Coding is ugly, no error
checking, but works (pretty well).
Change if you like. No copyright at all.
Email (craig@orcon.net.nz)
You will need imagemagick, netpbm, giflib-bin and ocrad installed to make it work.
apt-get install imagemagick netpbm giflib-bin ocrad (Under Debian)
A patch is needed to giftext (as it segfaults with a few images)
See http://users.own-hero.net/~decoder/fuzzyocr/giftext-segfault.patch
insert into the mime_check and data_check sections in exim:
acl_check_mime:
warn condition = ${if !eq{$mime_filename}{}{1}{0}}
decode = default
warn condition = ${if !eq{$mime_filename}{}{1}{0}}
condition = ${if !match{$mime_content_type}{\N^message\/rfc822$\N}{1}{0}}
condition = ${if <{$message_size}{100K}{1}{0}}
set acl_m1 = ${run{/usr/bin/nsfo.pl $mime_decoded_filename $mime_content_type}{${extract{1}{ }{$value}}}{}}
acl_check_data:
deny condition = ${if !eq{$acl_m1}{}{1}{0}}
message = Image Spam Detected
log_message = Image Spam Detected
07/02/2007 - Version 0.10
18/10/2006 - Version 0.01
18/10.2006 - Version 0.00
Note: Rename File Names/Location in extracted archives to suit. If you are using m1 already in exim change to another mX value.