On 2014-01-10 04:22, Axb wrote:
Please show us the query you're using and the userpref content.

On 01/10/2014 11:19 AM, Mark Chaney wrote:
The sql entry isnt the problem because if I change the query to use
example.com versus _DOMAIN_, it works fine. I followed the guide from
http://wiki.apache.org/spamassassin/UsingSQL.

On 2014-01-10 03:52, Axb wrote:
What does the SQL entry look like?

As I already mentioned, the query doesnt matter because _DOMAIN_ isnt be filled. Doesnt matter what the query is if _DOMAIN_ isnt being populated.

user_scores_sql_custom_query SELECT 'required_hits' as preference, spam_score as value FROM domains WHERE domain = _DOMAIN_ ORDER BY domain ASC

If i change it to:

user_scores_sql_custom_query SELECT 'required_hits' as preference, spam_score as value FROM domains WHERE domain = 'example.com' ORDER BY domain ASC

It works perfectly (obviously just for that domain).

As mentioned, when I have _DOMAIN_ in it, the debug output shows:

Jan 10 03:20:04.795 [28346] dbg: config: Conf::SQL: executing SQL: SELECT 'required_hits' as preference, spam_score as value FROM domains WHERE domain = NULL ORDER BY domain ASC

Thus obviously _DOMAIN_ isnt working for some reason. The wiki does mention something about modifying SA subfunctions and some qmail stuff, but I havent done anything like that and dont really want to modify any core code. So maybe thats the issue? There isnt anything default in SA that provides the _DOMAIN_ value for the sql query?



I assume you used Dallas' setup under

"Global, Per-Domain, and Per-User Preferences via SQL"

On 01/10/2014 10:47 AM, Mark Chaney wrote:
So my I dont think I am getting this to work. I have _DOMAIN_ in my
query, but it doesnt appear to get assigned a value as the spamassasin
debug is showing a value of NULL when it performs the query. Any
suggestions? I am not really finding much information on how this value
gets populated. If I do something like:

echo -e "From: user\nTo:user\Subject: Test\n\n" | spamc -u 'example.com'

I get:

Jan 10 03:20:04.791 [28346] info: spamd: handle_user unable to find
user: 'example.com'
Jan 10 03:20:04.795 [28346] dbg: config: Conf::SQL: executing SQL:
SELECT 'required_hits' as preference, spam_score as value FROM domains
WHERE domain = NULL ORDER BY domain ASC
Jan 10 03:20:04.796 [28346] dbg: config: retrieving prefs for
example.com from SQL server
Jan 10 03:20:04.796 [28346] dbg: info: user has changed

It says it getting the preferences for the example.com, but I am not
sure how thats correct when the query has it set as NULL. Suggestions?


On 2014-01-06 08:48, Mark Chaney wrote:
LOL, my bad. I had googled for spamassassin preferences per domain,
but didnt use that exact text. I knew user preferences were available
via mysql, but I didnt see that exact doc. Thanks!

On 2014-01-06 08:35, Axb wrote:
On 01/06/2014 03:32 PM, Mark Chaney wrote:
Is it possible to set spamassassin preferences per domain instead of
per
user? If so, how can I go about doing this? If this could be pulled
from
a mysql table, even better.

Thanks,
Mark

http://lmgtfy.com/?q=spamassassin+mysql+preferences

Reply via email to