1

---------

-

# This is the right place to customize your installation of SpamAssassin. # # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be # tweaked. # ########################################################################### # # rewrite_subject 0 # report_safe 1 # trusted_networks 212.17.35.  #skip_rbl_checks 1 required_hits 5 use_bayes 1 bayes_file_mode 0700 #bayes_path /etc/mail/spamassassin/.spamassassin/bayes #bayes_auto_learn_threshold_spam 8.0 #ok_languages all ok_locales all add_header spam Flag _YESNOCAPS_ required_score 5.5 report_safe 1 #report_contact spam-catcher@cadiaholding.com use_dcc 1 dcc_timeout 8 dcc_home /var/spamd/ dcc_path /usr/local/bin/dccproc add_header all DCC _DCCB_: _DCCR_ use_razor2 1 razor_config /etc/razor/razor-agent.conf razor_timeout 8 use_pyzor 1 pyzor_path /usr/bin/pyzor add_header all Pyzor _PYZOR_ clear_report_template use_bayes 1 bayes_path /var/spamd/.spamassassin/bayes bayes_auto_learn 1 bayes_auto_learn_threshold_nonspam 0.1 bayes_auto_learn_threshold_spam 8.0 use_auto_whitelist 1 rewrite_subject 1 subject_tag [SPAM found in message] dns_available yes report _SUMMARY_  ##header SPF_CHECK_FAIL Received-SPF =~ /^fail/ ##describe SPF_CHECK_FAIL SPF reports sender host as NOT permitted ##score SPF_CHECK_FAIL 0.75  ##header SPF_CHECK_PASS Received-SPF =~ /^pass/ ##describe SPF_CHECK_PASS SPF reports sender host as permitted sender ##score SPF_CHECK_PASS -2.5

                                           ------------------------------------------------

Add DCC (Distributed Checksum Clearing Houses), Pyzor and Razon checks in Spamassassin on Debian Lenny / Howto improve spamassassin anti spam protection on Debian GNU / Linux

In accordence to a recent qmail install, here is few things to install in order to improve the native spamassassin anti-spam mail server protection capabilities.

1. Install Pyzor and Razor

debian-server# apt-get install pyzor razor

2. Edit /etc/mail/spamassassin/local.cf and put the following lines in it:

use_razor2 1

razor_config /etc/razor/razor-agent.conf

razor_timeout 8

use_pyzor 1

pyzor_path /usr/bin/pyzor

add_header all Pyzor _PYZOR_

clear_report_template

3. Edit /etc/mail/spamassassin/v310.pre and make sure the following lines are included and uncommented:

loadplugin Mail::SpamAssassin::Plugin::DCC

loadplugin Mail::SpamAssassin::Plugin::Pyzor

loadplugin Mail::SpamAssassin::Plugin::Razor2

loadplugin Mail::SpamAssassin::Plugin::SpamCop

4. Now we modify /etc/mail/spamassassin/local.cf once more to enable Bayesian Filtering, so include in the conf the following:

use_bayes 1

bayes_file_mode 0700

bayes_path /var/spamd/.spamassassin/bayes

bayes_auto_learn 1

bayes_auto_learn_threshold_nonspam 0.1

bayes_auto_learn_threshold_spam 8.0

use_auto_whitelist 1

In my case I use /var/spamd/.spamassassin directory for bayesian filter files, anyways you might desire to have it in a different lacation, however if you desire to use the same directory as me, make the appropriate directories and files as shown below:

debian-server# mkdir -p /var/spamd/.spamassassin/

debian-server# touch /var/spamd/.spamassassin/bayes_{seen,toks} /var/spamd/.spamassassin/bayes

debian-server# chown -R amavis:amavis /var/spamd/

Note that in the above example whenever I’m using user vpopmail:vchkpw I did that because my spamassassin is running under the vpopmail:vchkpw user and group, in case if you’re using a different uid and gid please change the commands in accordance with ‘em.

5. Next we need to download and install the required DCC (Distributed Checksum Clearing Houses) binaries, Regrettably no debian package is available so we will compile it and install it from source:

debian-server# wget http://www.rhyolite.com/dcc/source/dcc.tar.Z

debian-server# tar -zxvf dcc.tar.Z

debian-server# cd dcc-1.3.120/

debian-server# ./configure && make && make install

debian-server# cdcc info > /var/dcc/map.txt

debian-server# chmod 0600 /var/dcc/map.txt

debian-server# rm /var/dcc/map

debian-server# cdcc "new map; load /var/dcc/map.txt"

debian-server# cdcc "delete 127.0.0.1"

6. Again we have to edit /etc/mail/spamassassin/local.cf and include in it:

use_dcc 1

dcc_timeout 8

dcc_home /var/spamd/

dcc_path /usr/local/bin/dccproc

add_header all DCC _DCCB_: _DCCR_

7. Last I include few configuration options I find handy, this is not required to have pyzor, razond and DCC properly configured, so it’s completely up to you to decide if you want that or not:

rewrite_subject 1

subject_tag [SPAM found in message]

dns_available yes

ok_locales all

add_header spam Flag _YESNOCAPS_

report_safe 1

                          -----------------------------------

Also few other necessery things until razor and pyzor start working, would probably be:

root@mail:~# su – spamd -s /bin/sh

spamd@mail:~$ pyzor discover

downloading servers from http://pyzor.sourceforge.net/cgi-bin/inform-servers-0-3-x

spamd@mail:~$

spamd@mail:~$ razor-admin –create

spamd@mail:~$ razor-admin –register

Register successful. Identity stored in /var/lib/spamassassin/.razor/identity-ru1p_uPumn

----------------

---