Status of LDAP or SQL-based storage of SpamAssassin preferences?

Can you speak to the level of support Virtualmin (and Usermin) has for storing SpamAssassin's preferences inside either MySQL or LDAP?

I know the Webmin SpamAssassin module can configure LDAP or MySQL storage of preferences, but if that's enabled, will Virtualmin and Usermin automatically start using the new preference stores as well? Will user changes to SA options done through the Usermin interface be recorded in SQL/LDAP? And will the procmail-based virtual-server delivery chain reference the new config storage?

There are two major benefits I can see to having this function:

1) The performance benefit of spamc/spamd can realized while still retaining per-domain and per-user configurations.

2) Other web interfaces for managing SA rules can be used, useful if webmail systems like Horde or Squirrelmail have been deployed.

If this isn't currently possible, is it anywhere in the development roadmap?

Status: 
Closed (fixed)

Comments

Usermin supports SQL and LDAP backends for user preferences, which can be enabled at Webmin -> Usermin Configuration -> Usermin Module Configuration -> SpamAssassin Mail Filter -> LDAP and SQL server options.

These will work fine with the normal Virtualmin delivery chain, even if spamd is being used. And users can update their settings via Usermin (or other clients that can talk to the DB).

Webmin's SpamAssassin module also has an option to store global preferences in SQL or LDAP, at Servers -> SpamAssassin Mail Filter -> SQL and LDAP Databases. However, this will prevent use of per-domain spamassassin settings by Virtualmin domain owners.

Let me know how this goes for you..

wonderful, i set it up that way and it works, e.g. settings in usermin are now written to sql. but spamassassin seems not to care at all... for example i set the required score to 4, but i still get 5 in the header of emails (the default). i guess there is something else i have to configure somewhere? greets sebastian

Is spamassassin configured to read settings from MySQL though?

ewww errrr... well this is what i did: changed the config in the usermin spamassassin module, and in the webmin server->spamassassin module, both to use the same sql database. i didnt finy any other place to change things... what did i miss?

Ok, that should work then ..

Are you running spamd there? If so, you should check its log file to see if any SQL-related errors get logged that might indicate why it cannot connect to the DB.

yes, i am running spamd. i switched to spamd when trying to get the thing working, although im a bit confused as of what functionality i lose when using spamd instead of the normal client. anyway, i had a look at the logs, and there is no sign of malfunction there. the spamd just works normally, no sign of interaction with sql though... i'm starting to feel a little dumb :(

Would it be possible for you to attach the SpamAssassin config file in which you defined the database settings to this bug report? Ideally with any login information X'd out..

yes sir! /etc/spamassassin/local.cf

# This is the right place to customize your installation of SpamAssassin.
#
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
# Only a small subset of options are listed below
#
###########################################################################
 
#   Add *****SPAM***** to the Subject header of spam e-mails
#
# rewrite_header Subject *****SPAM*****
 
 
#   Save spam messages as a message/rfc822 MIME attachment instead of
#   modifying the original message (0: off, 2: use text/plain instead)
#
# report_safe 1
 
 
#   Set which networks or hosts are considered 'trusted' by your mail
#   server (i.e. not spammers)
#
# trusted_networks 212.17.35.
trusted_networks 85.214.134.34 85.214.132.34
 
 
#   Set file-locking method (flock is not safe over NFS, but is faster)
#
# lock_method flock
 
 
#   Set the threshold at which a message is considered spam (default: 5.0)
#
# required_score 5.0
 
 
#   Use Bayesian classifier (default: 1)
#
# use_bayes 1
 
 
#   Bayesian classifier auto-learning (default: 1)
#
# bayes_auto_learn 1
 
 
#   Set headers which may provide inappropriate cues to the Bayesian
#   classifier
#
# bayes_ignore_header X-Bogosity
# bayes_ignore_header X-Spam-Flag
# bayes_ignore_header X-Spam-Status
 
#pyzor_add_header 1
user_scores_dsn DBI:mysql:spamassassin:localhost
user_scores_sql_username spamassassin
user_scores_sql_password XXXXXXXXXXXX

That looks OK to me.

Is your spamd process running with the -q and -x flags?

These can be set in the /etc/sysconfig/spamassassin file, and applied with /etc/init.d/spamassassin restart

nice! actually, in my case it was /etc/default/spamassassin and i guess you meant the -Q flag, not the -q flag. it appears to work now, although awl table is still empty, but time will tell... i assume that spamd will revert to using /etc/spamassassin/local.cf defaults if a pref is not found in sql.

last question: will the spamtrap@ and hamtrap@ addresses still do with the sql setup?

The spamtrap and hamtrap addresses won't work anymore, as they depend on updating the users baysian database which spamd doesn't have access to ..

ok, i enabled sql for bayes and awl, so i suppose it will work now. finally have a full configurable webmail with roundcube and spamassassin plugin, sieve filters plugin and password changing plugin :) thanks for your help, it was a key to make a big smile appear on my face. good night from germany sebastian

Automatically closed -- issue fixed for 2 weeks with no activity.