User Tools

Site Tools


linux:mail:bayes

spamassassin -> bayes

/etc/mail/spamassassin/local.cf

[...]
# Enable the Bayes system
#
use_bayes           1
 
# Enable Bayes auto-learning
#
bayes_auto_learn    1  
 
bayes_store_module  Mail::SpamAssassin::BayesStore::MySQL
bayes_sql_dsn       DBI:mysql:bayes:localhost
bayes_sql_username  bayes
bayes_sql_password  secure_password
bayes_sql_override_username bayes
[...]

mysql -uroot -p

MariaDB [(NONE)]> CREATE DATABASE bayes;
MariaDB [(NONE)]> CREATE USER 'bayes'@'localhost' IDENTIFIED BY 'secure_password';
MariaDB [(NONE)]> GRANT ALL ON bayes.* TO 'bayes'@'localhost';
># locate bayes_mysql
/usr/share/doc/spamassassin-3.4.2-r2/bayes_mysql.sql.bz2
># cp /usr/share/doc/spamassassin-3.4.2-r2/bayes_mysql.sql.bz2 /tmp/
># cd /tmp/
># bzip2 -d bayes_mysql.sql.bz2 
<# mysql -ubayes -p bayes  < ./bayes_mysql.sql

Check if everything works

spamassassin --lint -D

Fix possible db problemes (bayes: unable to initialize database for bayes user, aborting! )

sa-learn --sync
linux/mail/bayes.txt · Last modified: 2019/07/05 16:24 by karloff