Tom Allison wrote:


To set up SQL for Bayes look at:

/usr/share/doc/spamassassin/sql or
http://wiki.apache.org/spamassassin/BetterDocumentation/SqlReadmeBayes

To set site-wide bayes with sql, either:

1. Always call spamc or spamassassin with the same user
2. set 'bayes_sql_override_username' in local.cf (from perldoc Mail::SpamAssassin::Conf)
3. perhaps a different way that's not obvious to me

Also, per-user configuration files are a separate issue from Bayes. You could set up per-user Bayes with sql and still have site-wide configuration.




How will spamassassin know what user I want to pull the data from?
Do I have to provide this on the spamc command line?


Spamassassin user is determined by:

spamc: if spamd is started by root, then spamc runs as whatever user calls spamc. If spamassassin is integrated in your MTA, then it might be your MTA user or your MTA might be set up to use the user for delivery. Both spamd and spamc allow for setting a specific '-u'. This is explained in the manual pages for spamd and spamc.

site-wide: you can set site-wide options in local.cf, so that no matter what user calls spamc, the same bayes database is used. 'perldoc Mail::SpamAssassin::Conf' gives information about this, as well there are good site-wide docs in the spamassassin wiki.

sql: If you are using sql for bayes, then I don't think the site-wide configuration in local.cf will work. Instead you can specify the username to use for bayes sql in local.cf.

So, if you went to use bayes sql database as a specific user, there are 4 ways, as described as above:

1. set '-u' for spamd
2. set '-u' for spamc
3. have your MTA always call spamc with the same user

(the previous three will have no effect when using 'spamassassin' or 'sa-learn' commands, so you would need to again specify the user when using those commands)

4. set 'bayes_sql_override_username' in local.cf
(this will work for spamc, spamassassin, and sa-learn, but only for bayes. AWL and user prefs are not affected by this.

--
Chris

Reply via email to