crm114 on Zimbra 8.7
zimbra@venus:~$ zmcontrol -v
Release 8.7.1.GA.1670.UBUNTU14.64 UBUNTU14_64 FOSS edition.
# be root:
$# sudo -i
$# cd /opt/zimbra/data/amavisd
$# apt-get install crm114
(This will install several unnecessary programs, but is better from compile it! Just accept it...)
$# mkdir .crm114
$# cd .crm114
$# cp /usr/share/crm114/* .
$# touch {rewrites.mfp,priolist.mfp,blacklist.mfp,whitelist.mfp}
$# chown -R zimbra.zimbra ../.crm114
# Testing:
$# crm '-{ output /Hello, world! This is CRM114 version :*:_crm_version: .\n/}'
$# Enter
$# CTRL-d
# Output:
Hello, world! This is CRM114 version 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) .
# Edit mailfilter.cf
$# $EDITOR mailfilter.cf:
# Change lines to look like this:
:spw: /PassW0rd/
:log_to_allmail.txt: /no/
# be zimbra user:
$# su - zimbra
$# cd /opt/zimbra/data/amavisd/.crm114
$# cssutil -b -r spam.css
$# cssutil -b -r nonspam.css
# back to root user:
$# ctl-d
# ##Plugin for spamassassin:
$# cd /opt/zimbra/common/lib/perl5/Mail/SpamAssassin/Plugin
$# wget https://github.com/mschuett/crm114.pm/blob/master/crm114.pm
$# chmod 444 crm114.pm
# Add this lines to /opt/zimbra/conf/salocal.cf.in:
loadplugin Mail::SpamAssassin::Plugin::CRM114 crm114.pm
full CRM114_CHECK eval:check_crm()
priority CRM114_CHECK 899
crm114_command /usr/bin/crm -u /opt/zimbra/data/amavisd/.crm114 mailreaver.crm
add_header all CRM114-Status _CRM114STATUS_ ( _CRM114SCORE_ )
# Just after the lines:
@spam_scanners = (
['SpamAssassin', 'Amavis::SpamControl::SpamAssassin' ],
# Add:
['CRM114', 'Amavis::SpamControl::ExtProg', 'crm',
[ qw(-u /opt/zimbra/data/amavisd/.crm114 mailreaver.crm
--dontstore --report_only --stats_only
--good_threshold=8 --spam_threshold=-8) ],
learn_ham => [ qw(-u /opt/zimbra/data/amavisd/.crm114 mailreaver.crm --good) ],
learn_spam => [ qw(-u /opt/zimbra/data/amavisd/.crm114 mailreaver.crm --spam) ],
mail_body_size_limit => 65000, score_factor => -0.20,
lock_file => '/opt/zimbra/data/amavisd/.crm114/crm114.lock',
lock_type => 'shared', learner_lock_type => 'exclusive',
],
# Be zimbra user again:
$# cd /opt/zimbra/data/amavisd/.crm114
$# mv nonspam.css nonspam.css.orig
$# mv spam.css spam.css.orig
# Get PSI's datas pre built for spam and ham:
$# wget http://w3.psi.com.br/~julio/postfix/nonspam.PSI.css
$# wget http://w3.psi.com.br/~julio/postfix/spam.PSI.css
# Do a merge from files downloaded and files local:
$# cssmerge spam.css spam.PSI.css -s 2097154
$# cssmerge nonspam.css nonspam.PSI.css -s 2097154
$# chown zimbra.zimbra *.css
# List of my .crm114 directory:
zimbra@venus:~/data/amavisd/.crm114$ ls -lh
total 73M
-rw-r--r-- 1 zimbra zimbra 0 Apr 14 12:20 blacklist.mfp
-rwxr-xr-x 1 zimbra zimbra 1.7K Apr 14 12:19 classifymail.crm
-rw-r--r-- 1 zimbra zimbra 18K Apr 14 12:24 mailfilter.cf
-rw-r--r-- 1 root root 18K Apr 14 12:19 mailfilter.cf~
-rwxr-xr-x 1 zimbra zimbra 44K Apr 14 12:19 mailfilter.crm
-rw-r--r-- 1 zimbra zimbra 15K Apr 14 12:19 maillib.crm
-rwxr-xr-x 1 zimbra zimbra 23K Apr 14 12:19 mailreaver.crm
-rwxr-xr-x 1 zimbra zimbra 38K Apr 14 12:19 mailtrainer.crm
-rw-r----- 1 zimbra zimbra 25M Apr 14 12:33 nonspam.css
-rw-r----- 1 zimbra zimbra 13M Apr 14 12:26 nonspam.css.orig
-rw-r--r-- 1 zimbra zimbra 0 Apr 14 12:20 priolist.mfp
-rw-r--r-- 1 zimbra zimbra 0 Apr 14 12:20 rewrites.mfp
-rwxr-xr-x 1 zimbra zimbra 1.7K Apr 14 12:19 rewriteutil.crm
-rwxr-xr-x 1 zimbra zimbra 6.8K Apr 14 12:19 shuffle.crm
-rw-r----- 1 zimbra zimbra 25M Apr 14 12:33 spam.css
-rw-r----- 1 zimbra zimbra 13M Apr 14 12:26 spam.css.orig
-rw-r--r-- 1 zimbra zimbra 0 Apr 14 12:20 whitelist.mfp
$# ctrl-d
$# /etc/init.d/zimbra restart
Be Happy whithout SPAM!!!
#### Sugestions, critics, improviment, please mail me, julio at psi.com.br
#### I will do updates from spam.css and nonspam.css via /etc/cron.weekly/