Innovators in Mail server, Webmail and appliance solutions

 

December 6, 2007

 Upgrading SpamAssassin

When you want to upgrade SpamAssassin 2.63 for @Mail to 3.0, keep in mind that the two versions have different SQL querying schemas. Also, you may need to take out some lines in the local.cf file, as many options have been deprecated.

To upgrade your SpamAssassin installation, just run through the following steps:

1.) Download and untar the newest version of SpamAssassin from: http://spamassassin.apache.org/

% wget "http://domain.com/Mail-SpamAssassin-3.x.x.tar.gz"
% tar xvfz Mail-SpamAssassin-3.x.x.tar.gz

2.) Stop the @Mail service:

% /etc/init.d/atmailserver restart

3.) Build the binary with the options specified below:

% cd Mail-SpamAssassin-3.x.x;
% perl Makefile.PL INSTALLDIRS=vendor PREFIX=/usr/local/atmail/spamassassin/ CONFDIR=/usr/local/atmail/spamassassin/etc/ DATADIR=/usr/local/atmail/spamassassin/etc/;
% make;
% make install

;

4.) Alter your /usr/local/atmail/spamassassin/etc/sqlsettings.cf file to contain the following:

user_scores_dsn               DBI:mysql:atmaildb:
user_scores_sql_username      dbuser
user_scores_sql_custom_query SELECT preference, value FROM SpamSettings WHERE username = _USERNAME_ OR username = '@GLOBAL' ORDER BY username DESC
user_scores_sql_password mypass

- Where [atmaildb] is your @Mail database;
- [dbuser] is your @Mail database user;
- [mypass] is your MySQL password;

5.) Alter your /usr/local/atmail/spamassassin/etc/local.cf file to contain the following:

# Default settings, hardcoded
skip_rbl_checks 1
rewrite_header subject * Identified Spam:# Settings that can be changed via the Webadmin
required_hits 5
report_safe 1# Bayesian Filtering Settings
use_bayes 1
bayes_auto_learn_threshold_spam 10.0
bayes_auto_learn_threshold_nonspam 1.0
bayes_min_ham_num 200

6.) Save all changes, then sync and lint SpamAssassin:

% /usr/local/atmail/spamassassin/bin/sa-learn -D --sync
% /usr/local/atmail/spamassassin/bin/spamassassin --lint -D

7.) Restart @Mail:

% /etc/init.d/atmailserver restart

This should then have your SpamAssassin 3.0 installation ready.


Filed under: Anti-Spam — info @ 3:36 pm

2 Comments »

  1. Errors in point 6, should be:

    /usr/local/atmail/spamassassin/bin/sa-learn -D –-sync
    /usr/local/atmail/spamassassin/bin/spamassassin –-lint -D

    Comment by Glen Morris — January 8, 2008 @ 9:25 am
  2. I don’t think this was ever intended for upgrading to 3.2.x. Avoid upgrading above 3.1.8 with the stock @Mail build options and rulesets. 3.1.9 is known to crash on heavy traffic with multiple children.

    For using 3.2.x, it really is best to put it on it’s own system, or to build it outside of @Mail. It’s also best to start with fresh rulesets. 3.2.x is very strict about rule syntax.

    Comment by Joey — February 13, 2008 @ 6:27 am

RSS feed for comments on this post. TrackBack URI

Leave a comment