If anyone is still using the d_gerst scripts to enable your bayes filtering, you might want to make some changes.
d_gerst created a security risk by placing the bayes token database files in the /etc/mail/spamassassin folder. The risk comes from anyone changing
permissions on this folder to correct errors in the /var/log/spamd/current log that prevented bayes from working. He should have just used the default
location..
And if you didnt change the permissions, then your bayes filtering isnt working anyway...
If you still want to use d_gerst's bayes_filter.sh script, you have to make changes in it to correct the paths. If interested, I'll post what you need
to do...
The following isnt a script. Sorry, but you have to enter the commands by hand. If you use Windows, and edit over SSL, don't use Wordpad as
your editor. Use Notepad, or Crimson Editor...
service spamd stop
# writes the bayes_journal file to the database
sa-learn --sync
# moves files
cd /etc/mail/spamassassin
mv bayes.mutex /var/spool/spamd/.spamassassin
mv bayes_seen /var/spool/spamd/.spamassassin
mv bayes_toks /var/spool/spamd/.spamassassin
# removes temp learning directories. These
# are automatically added back by the d_gerst
# script if you still use it.
rmdir spam
rmdir missedspam
rmdir ham
# change owner/group back to defaults
chown root.root /etc/mail/spamassassin
chown root.root /etc/mail/spamassassin/bayes_filter.sh
# If you want to delete the d_gerst scripts and put
# your server back to the way it was:
rm /etc/mail/spamassassin/bayes_filter.sh
rm /etc/cron.d/sa-bayes_learning
# restore templates
# These templates are used to build the spamassassin
# config file local.cf. If you dont use bayes filtering
# then they arent used.
cd /etc/e-smith/templates/etc/mail/spamassassin/local.cf
# restore 10paths
# Edit the file 10paths, and replace the existing text.
# These arent commands! Paste this text in:
bayes_path /var/spool/spamd/.spamassassin/bayes
bayes_file_mode 750
auto_whitelist_path /var/spool/spamd/.spamassassin/auto-whitelist
auto_whitelist_file_mode 750
# 10internal_networks
# The file 10internal_networks was deleted by the script
# install_sa-learn.sh
# If you want to continue using the d_gerst scripts, leave
# it deleted.
# To restore it, create a file named 10internal_networks and
# paste this in:
{ "internal_networks $LocalIP" }
# del 71BayesFilter
# install_sa-learn.sh added the file 71BayesFilter.
# It sets the bayes_path incorrectly. Delete it:
rm /etc/e-smith/templates/etc/mail/spamassassin/local.cf/71BayesFilter
expand-template /etc/mail/spamassassin/local.cf
# Your /etc/mail/spamassassin/local.cf file should now look similar to this:
#------------------------------------------------------------
# !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://wiki.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
dns_available yes
lock_method flock
ok_languages all
ok_locales all
bayes_path /var/spool/spamd/.spamassassin/bayes
bayes_file_mode 750
auto_whitelist_path /var/spool/spamd/.spamassassin/auto-whitelist
auto_whitelist_file_mode 750
report_safe 0
required_hits 6
rewrite_header Subject [SPAM]
skip_rbl_checks 0
clear_trusted_networks
trusted_networks 192.168.1.5 127.
use_auto_whitelist 0
use_bayes 1
# Start it all back up
signal-event email-update
svc -t /service/qpsmtpd
service spamd start
# check the tokens are still there
sa-learn --dump magic
# shows something like this:
0.000 0 3 0 non-token data: bayes db version
0.000 0 3625 0 non-token data: nspam
0.000 0 286 0 non-token data: nham
0.000 0 126486 0 non-token data: ntokens
0.000 0 1161470280 0 non-token data: oldest atime
0.000 0 1163950938 0 non-token data: newest atime
0.000 0 1163921405 0 non-token data: last journal sync atime
0.000 0 1163292565 0 non-token data: last expiry atime
0.000 0 0 0 non-token data: last expire atime delta
0.000 0 0 0 non-token data: last expire reduction count