Hello Craig,
I recently ran into this problem myself. The solution, after being a
dolt and not running a backup first, was the following sequence
followed by line definitions:
/etc/init.d/mailserver stop
sa-learn --backup > /etc/mail/spamassassin/database.bak
sa-learn --dump magic
sa-learn --no-sync --ham --progress --mbox /export/home/brian/Ham
sa-learn --sync
sa-learn --no-sync --spam --progress --mbox /export/home/brian/Spam
sa-learn --sync
sa-learn --dump magic
spamassassin -D --lint
/etc/init.d/mailserver start
1) Shutdown Sendmail/ClamAV/MIMEDefang/Spamassassin.
2) Backup the database.
3) View current statistics which will also display the current bayes
database version.
4) Do a ham learn.
5) This one was key! Even after everything was parsed and the
command line came back, the database was still not in a happy place.
Doing the --sync brings it to that happy place.
6) Do a spam learn.
7) See #5.
8) View current statistics and note nham and nspam increases.
9) Run through the rules to make sure everything is still cool and no
errors occur.
10) Start Sendmail/ClamAV/MIMEDefang/Spamassassin.
Notes:
- Doing a --sync on the sa-learn learning process didn't work. I'm
not sure why the system doesn't learn the file and then just resync
the database when it's done. Maybe Theo has an idea.
- Shutting down the MTA isn't ideal but it prevents lock file
conflicts which don't seem to work too well under Solaris 8. Mail
queues in the ether for about 30 minutes while all of this is going
on. I've even thought about automating the process which would help
keep the Ham and Spam files at a reasonable size and shorten that to
about 5 minutes.
-BE
Hi again SA experts,
Note the error message in the 2nd-last line of the following transcript:
animalhead:~/sj $ sa-learn --no-rebuild --spam --mbox savejunk
The --no-rebuild option has been deprecated. Please use --no-sync instead.
Learned tokens from 3025 message(s) (3047 message(s) examined)
animalhead:~/sj $ sa-learn --no-sync --spam thruJunk
bayes: bayes db version 0 is not able to be used, aborting! at
/usr/local/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/BayesStore/DBM.pm
line 196.
Learned tokens from 170 message(s) (170 message(s) examined)
There are 171 messages in directory thruJunk. The largest is 495K,
the next largest is 137K.
$ sa-learn -V yields "spamassassin v 3.2.1"
What should I do about this?
I still have another directory with ham to go. It includes lots of
large files. Should I delete those over a certain size?
Thanks,
Craig MacKenna