Mailing List Archive

MySQL + User defined body checks
Greetings,

I've just deployed my first spamassassin site, and my users and I are pleased
with the results so far with one exception....

I wanted to do BODY CHECKS on a per user basis, using mysql to store the body
check data, but it doesn't seem to work correctly.

My local.cf file looks like this:

user_scores_dsn DBI:mysql:<spam_database>:localhost
user_scores_sql_username <spam_user_name>
user_scores_sql_password <secret_spam_pass>
user_scores_sql_table <spam_table>

# turn on user prefs
allow_user_rules 1

#test rule......
body CUST_BODY_CHECKS /should_never_be_seen/
describe CUST_BODY_CHECKS SQL-based body checks
score CUST_BODY_CHECKS -10

My MySQL entries look like this:

prefid username preference value
2 me score CUST_BODY_CHECKS 75
3 me body CUST_BODY_CHECKS /test/

When I do the following:
# echo -e "From: me\n\ntest test \n" | spamc -u me

I get:
From: rsa
X-Spam-Status: No, hits=1.6 required=5.0
tests=DATE_MISSING,MISSING_HEADERS

If I do:
# echo -e "From: me\n\nshould_never_be_seen\n" | spamc -u me

I get the expected results:
X-Spam-Status: Yes, hits=76.6 required=5.0
tests=CUST_BODY_CHECKS,DATE_MISSING,MISSING_HEADERS

So how can I implement my OWN custom body checks WITHOUT using ~/.spamassassin
files? None of my users have a local account, this is all done through
postfix/spamassassin/mysql/cyrus.

Thanks for any advice,

-=Ray