I'm trying to get SA to read user rules from MySQL. I've exhausted all testing and have not found a way. I have spamd starting with the following parameters:

  --username=spamd --groupname=spamd --min-children=2 --max-children=8
  --min-spare=4 --max-spare=6 --max-conn-per-child=120 --timeout-tcp=15
  --timeout-child=120 --sql-config --nouser-config

I have the following in local.cf that would pertain to userprefs:

  user_scores_dsn                 DBI:mysql:postfix:localhost:3306
  user_scores_sql_username        sqlusr
  user_scores_sql_password        sqlpwd
  user_scores_sql_custom_query    SELECT preference, value FROM _TABLE_
    WHERE username = _USERNAME_ OR username = '@GLOBAL' OR
    username = concat('@', _DOMAIN_) ORDER BY username ASC

  allow_user_rules 1

The user_scores_sql_custom_query is wrapped for readablility. In the local.cf it appears all on one line.

The test rule I set up is the one in the wiki:

  header L_TO_ME ToCc =~ /[EMAIL PROTECTED]/
  describe L_TO_ME Email addressed to me
  score L_TO_ME 0.010

I've tried:

  1) placing the entire line into the 'preference' column

  2) placing the entire line into the 'value' column

  2) placing everything before the first space into the 'preference'
     column and everything after the first space into the 'value' column.

  3) placing everything before the second space into the 'preference'
     column and everything after the second space into the 'value' column.

It appears SA does not read user rules from anything other than a file stored within ~/.spamassassin/user_prefs. Is this the case?

Reply via email to