To load balance the sendmail or other email servers, you may want to export the spamassassin database from your
existing email server and import to the new email server, so that the new email server will have the bayes database
for all the ham and spam right away.
This document does not discuss how to install Spamassassin software or database. We assume the Spamassassin software
is working already on your new sendmail server. We only discuss how to export and import the bayes database for
the Spamassassin.
First, you will need to find two emails with full headers. One is good email andn one is spam mail. Save the good
email in /tmp/ham1, and save the spam email in /tmp/spam1.
Then su to each user and run the following commands for each user:
$ sa-learn --ham /tmp/ham1
$ sa-learn --spam /tmp/spam1
These two commands will create .spamassassin directory for each user and initial bayes_seen and bayes_toks files.
After finishing the above two commands for each user, you can then login into the existing server as each user and from each
user′s .spamassassin directory run this command:
$ sa-learn --siteconfigpath=/ --backup > /tmp/username-bayes.txt
This will export the spam and ham tokens into this text file. Please note for each user, the time for exporting
the tokens is different, depending on the number of ham and spam he had received before. Repeat this for
each user on the system with different /tmp/username-bayes.txt file.
Transfer those files to the new email server. From each user′s login, execute this command once:
$ sa-learn --restore /tmp/username-bayes.txt
Please wait till each user finished import then su - to next user and repeat the above command.
Now you have your new email server loaded all the token for ham and spam from your existing server. You can add
that email server to load balancing now.