How to use @sa_userconf_maps for white-/blacklisting in Amavis 2.7.0

SB kfswido at
Sat Oct 8 11:36:25 CEST 2011


I'd like to use the new sa_userconf_maps feature in Amavis 2.7.0 (Ubuntu
x64), but unfortunately I'm not able to figure out the correct
configuration from what I can find online.

My setting is as follows:

I have a MYSQL database called 'spamassassin_db' on my server with a
single table 'userpref' in it, containing white- and blacklist entries.
These are filled by some other application, so I don't want to change
anything here (e.g., to amavis SQL rules which seem to be even less well
documented) if possible.

I have configured the SQL database in my /etc/spamassassin/ as

user_scores_dsn                 DBI:mysql:spamassassin_db:localhost
user_scores_sql_username        (...)
user_scores_sql_password        (...)
user_scores_sql_custom_query    SELECT preference, value FROM userpref
WHERE username = _USERNAME_ OR username = '$GLOBAL' OR username =

What I would like amavisd to do is to have spamassassin respect the
whitelist_auth/blacklist_from rules in this database table globally,
i.e. regardless of the recipient's email address.
However, I don't seem to know the appropriate commands, and where to put

If I just put

@sa_userconf_maps = (
          '.*' => 'sql:',
     ); does amavis know which SQL database is referred to? Or that it
should use ""? I have also tried something like

@sa_userconf_maps = (

without success.

It's not surprising to me that I haven't got it to work so far, given
that I simply can't find any clear instructions anywhere on the Web.

Any help would be very much appreciated! :)


More information about the amavis-users mailing list