New to the forums, and fairly new to Mail-in-a-box. My Mail-in-a-box is setup and running well. I’ve done some upgrades successfully, and have been using Roundcube and a couple of local mail clients. All works very well.
One of my requirements for running a self-hosted server, is to allow family with their own accounts to manage their own blocklist_from and safelist_from settings in Spamassassin/Spampd. If this is already available out of the box, please forgive me, but I didn’t see it.
I thought setting up sauserpref as a plugin with Roundcube would be the most elegant way to do this. To that end, I have the plugin installed and functioning in Roundcube without any errors. I have installed DBD:MySQL and setup a config file in /etc/spamassassin/sauserpref.cf:
user_scores_dsn DBI:mysql:spamassassin:localhost
user_scores_sql_password password
user_scores_sql_username username
user_scores_sql_custom_query SELECT preference, value FROM _TABLE_ WHERE username = _USERNAME_ OR username = '$GLOBAL' OR username = CONCAT('%',_DOMAIN_) ORDER BY username ASC
I tried sauserpref.cf both with and without:
loadplugin Mail::SpamAssassin::SQLBasedAddrList
spamassassin -D --lint shows this file is being read in, no errors. Restarting both spampd and spamassassin with systemctl restart spampd spamassassin
works without any errors.
If I add blacklist_from myemail@domain.com
, as a global settings to the /etc/spamassassin/sauserpref.cf file, emails from that address are successfully blocked. If I attempt to use SQL, after adding myemail@domain.com to the roundcube->sauserpref settings, nothing happens.
In debugging, I have enabled mysql general_log, and tail -f the log file, and can see that spampd/spamassassin doesn’t touch mysql. This would lead me to believe that I am missing something.
Add --sql-config to /etc/defaults/spampd ADDOPTS, results in the error Unknown option: sql-config
.
I am aware that all of these settings will be overwritten the next time I upgrade the system or reinitial it. My plan is to write a script to reconfig after each mailinabox update.
The short of it is: Has anyone been successful in getting this to work? Is there another way to let users manager their own spamassassin settings?
Thank you.