User Tools

Site Tools


old:classic:spamassassin_--_upgrade_from_private_installation

SpamAssassin -- Upgrade from Private Installation

Outdated page.

Updated information at: Classic Linux.

Also please see: https://discourse.rahul.net/.


This page is obsolete, but is kept available for reference.

If you were previously using a privately-installed version of spamassassin, you should follow the recommendations below. NOTE: If you have any privately-installed SpamAssassin programs in your execution PATH, you may encounter problems. Before proceeding, either remove these privately-installed SpamAssassin programs or make sure they are at the end of your execution PATH, not near the beginning, so the system-supplied SpamAssassin programs are always executed.

You probably already have a user_prefs file in your .spamassassin directory. Manually combine your personal settings in this file with the global defaults contained in the file:

/usr/share/spamassassin/user_prefs.template

Your previous SpamAssassin installation may already have collected some Bayesian tokens. If so, they will be in your .spamassassin directory in files whose names match “bayes*”, such as:

bayes_journal
bayes_seen
bayes_toks

You can import these into the new SpamAssassin's central database.

First, use sa-learn at least once with the –spam or –ham option (as described in the Bayesian Filtering section on the page spamassassin_to_identify_spam), so that the central database is correctly initialized for you. Otherwise the steps below may fail.

Then cd into your .spamassassin directory and use the following commands:

% sa-learn --siteconfigpath=/ --backup > data.txt
% sa-learn --restore data.txt

The first sa-learn command above will export your current Bayesian data into a file called “data.txt”. Any error message of the form “bayes: bayes db version 2 is not able to be used, aborting! …” can be safely ignored.

The second sa-learn command will import data from “data.txt” into the central database.

Both sa-learn commands above can take a while, depending on the size of your existing Bayesian data.

After the –restore step above, you can check the size of the imported data with:

% sa-learn --dump magic

Look at the “nham'”' and “nspam” values to get a count of non-spam and spam tokens respectively in the database. After the import has been done, you can delete the “bayes*” files in your .spamassassin'' directory thus:

% rm bayes*
old/classic/spamassassin_--_upgrade_from_private_installation.txt · Last modified: 2021/01/30 04:56 by admin