Hi. I did test a similar configuration a while ago and had the same problem. If you take a look at this thread on the mailing list:
http://spamassassin.1065346.n5.nabble.com/Bayes-vars-records-on-MySQL-not-created-automatically-td104615.html you'll see it was a problem of running 'sa-learn --sync' as the user who is running the test. Best regards, Matteo On 20.08.2014 16:07, Michael wrote:
Hi, I'm using Spamassassin in a virtual user environment. To store preferences like settings, Bayes and AWL for each user I'm trying to set up a MySQL storage. I created the MySQL tables according the instructions from the files awl_mysql.sql, bayes_mysql.sql, README.awl, README.bayes, README and userpref_mysql that came with my Spamassassin 3.4 installation on Ubuntu 14.04. The connection to the database seem to be working. For me the debug output looks like if Spamassassin would expect to be already some data in the tables. Where shall I get this data from? Do I have to manually create entries for each user? What am I missing? When calling "spamc -u t...@michi.su < testmail.txt" I'm getting the following debug output (shortened): Aug 20 08:14:46.563 [16682] dbg: config: Conf::SQL: executing SQL: select preference, value from userpref where username = 't...@michi.su' or username = '@GLOBAL' order by username asc Aug 20 08:14:46.563 [16682] dbg: config: retrieving prefs for t...@michi.su from SQL server Aug 20 08:14:46.564 [16682] dbg: info: user has changed Aug 20 08:14:46.564 [16682] dbg: bayes: learner_new self=Mail::SpamAssassin::Plugin::Bayes=HASH(0x30fdce0), bayes_store_module=Mail::SpamAssassin::BayesStore::MySQL Aug 20 08:14:46.564 [16682] dbg: bayes: using username: t...@michi.su Aug 20 08:14:46.564 [16682] dbg: bayes: learner_new: got store=Mail::SpamAssassin::BayesStore::MySQL=HASH(0x3d1a768) Aug 20 08:14:46.565 [16682] dbg: bayes: database connection established Aug 20 08:14:46.566 [16682] dbg: bayes: found bayes db version 3 Aug 20 08:14:46.566 [16682] dbg: bayes: unable to initialize database for t...@michi.su user, aborting! The MySQL relevant options that I added are: user_scores_dsn DBI:mysql:spamassassin:localhost user_scores_sql_username spamassassin user_scores_sql_password pass bayes_store_module Mail::SpamAssassin::BayesStore::MySQL bayes_sql_dsn DBI:mysql:spamassassin:localhost bayes_sql_username spamassassin bayes_sql_password pass auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList user_awl_dsn DBI:mysql:spamassassin:localhost user_awl_sql_username spamassassin user_awl_sql_password pass