Norman Zhang wrote:
May I ask what's the difference between /var/lib/amavisd/.spamassassin/user_prefs and /etc/mail/spamassassin/local.cf?
In general user_prefs is *intended* for per-user configuration, so that individual users can over-ride the site-wide defaults.
local.cf (actually any .cf file in /etc/mail/spamassassin) is intended for site-wide customizations, and gets used for all users. It is intended to over-ride the default settings SA shipped with.
In your case, amavis always runs as one user, so the user_prefs is only useful to dictate different behavior between when amavis calls SA, and when you call SA manually on the command line for testing.
It's a little troubling that you have a bayes_path in local.cf, but your bayes_file_mode statement is in user_prefs. You really should move that. If you have bayes_path in local.cf, you should have bayes_file_mode 777 in there, and no mode setting in user_prefs.
(if you make it a site-wide bayes_Path setting, all users must be able to read, write, and create sub-dirs, or you're going to have problems when someone other than the amavis user executes sa-learn)