Mail Server_AntiSpam OCR plugin

Build on Old mail System(Qmail+Vpopmail++Qmailscanner+Clamav+SpamAssassin)


1. download the requirement 
  a. netpbm (yum install netpbm-progs)
  rpm -ivh netpbm-netpbm-9.24-10.i386.rpm
      rpm -ivh netpbm-progs-9.24-10.i386.rpm

  b. ImageMagick (yum install ImageMagick)
      rpm -ivh ImageMagick-5.4.7-10.i386.rpm

  c. libungif and libungif-progs (yum install libungif-progs) 
      rpm -ivh libungif-4.1.0-15.i386.rpm(cancel)
      rpm -ivh libungif-progs-4.1.0-15.i386.rpm
  d. perl Digest::MD5, String::Approx
      perl -MCPAN -e shell
      install Digest::MD5
      install String::Approx

  e. ExifTool (yum install perl-Image-ExifTool)

2. Follow this procedure on patching and installing libungif and gocr
(http://www200.pair.com/mecham/spam/image_spam.html)

a. libungif

wget http://internap.dl.sourceforge.net/sourceforge/libungif/libungif-4.1.4.tar.gz
tar xzvf libungif-4.1.4.tar.gz
cd libungif-4.1.4/util
wget http://users.own-hero.net/~decoder/fuzzyocr/giftext-segfault.patch
patch giftext.c < giftext-segfault.patch
cd ..
./configure --prefix=/usr && make && make install


b. GOCR
Download, extract, patch, compile and install gocr:

cd /usr/local/src
wget http://www-e.uni-magdeburg.de/jschulen/ocr/gocr-0.40.tar.gz
tar xzvf gocr-0.40.tar.gz
cd gocr-0.40/src
wget http://antispam.imp.ch/patches/patch-gocr-segfault
patch pgm2asc.c < patch-gocr-segfault
cd ..
./configure --prefix=/usr && make && make install


c. install FuzzyOcr

cd /usr/local/src/
wget http://users.own-hero.net/~decoder/fuzzyocr/fuzzyocr-2.3b.tar.gz
tar xzvf fuzzyocr-2.3b.tar.gz
cd FuzzyOcr-2.3b



*** We will use a new patch Robert LeBlanc created for this particular version of FuzzyOcr.

wget http://www200.pair.com/mecham/spam/fuzzyocr-23b-hashdb-poison.patch
patch FuzzyOcr.pm < fuzzyocr-23b-hashdb-poison.patch


*** Then place the files:

QUOTE:

cp FuzzyOcr.pm /etc/mail/spamassassin/
cp FuzzyOcr.cf /etc/mail/spamassassin/
cp FuzzyOcr.words.sample /etc/mail/spamassassin/FuzzyOcr.words


d. edit FuzzyOcr.cf and TEST IT.. follow the procedure on the website

http://www200.pair.com/mecham/spam/image_spam.html

e. install Imageinfo plugins for false positive

** look for Plugin of Spamassassin ***

QUOTE:

cd /usr/lib/perl5/site_perl//Mail/SpamAssassin/Plugin (mine)
wget http://www.rulesemporium.com/plugins/ImageInfo.pm
cd /etc/mail/spamassassin
wget http://www.rulesemporium.com/plugins/imageinfo.cf



edit v310.pre
*** and insert (at the bottom):

loadplugin Mail::SpamAssassin::Plugin::ImageInfo



*** Edit imageinfo.cf and lower any scores that are 3.0 or more to half their value. This is to help prevent false positives:

vi imageinfo.cf

4. check spamassassin by "spamassassin --lint"

分享到