Hello all,
I am interested in two new features that got added to amavisd-new in version 2.7.0
Taken from the Release Notes (2.7.0)
- per-recipient (or per- policy bank) SpamAssassin configuration files or
SQL configuration sets are supported (@sa_userconf_maps), and per-recipient
SQL Bayes database usernames (@sa_username_maps);
However, I don’t see are any examples of how this configuration is enabled, or more specifically what syntax the configuration options are looking for. I gather that they are “maps” but I really don’t understand how maps are configured. Presently I have the @lookup_sql_dsn configured to check the database which Postfixadmin is adding users to. I’d like to have my users store per-user bayes information and per-user spamassasin information inside this database also.
Did these options merely get added and will become documented/utilized at a later point? Or is all the information already there, and I’m just not seeing it?
Update: I did find these two config options in the amavisd.conf-default.bz2 doc file
# @sa_userconf_maps = ();
# @sa_username_maps = ();
Alas, they are empty and I am not sure what to enter there to “tell” amavisd-new to look up in the SQL database.
I appreciate any replies.
Matt
Thank you very much for your reply. I understand a little bit better now. However, in example one below you listed a single domain name using the method ‘sql’. What if I have dozens of domains, with them being added/removed somewhat regularly by Postfix Admin (I can perceive adding at least 1-2 domains per month) to this system. Isn’t there a way to tell amavisd-new that all domains in the lookup_sql_dsn? The table is actually called ‘domain’ inside the ‘postfixadmin’ db.
For @sa_username_maps – I do not understand the syntax of that at all. Could you explain it in just a little more detail so I actually understand what’s being done, as opposed to just copying your example. Many thanks.
Thank you for the link to the patch, that will be helpful. And yes I have followed the SpamAssassin SQL README and have my db schema as-per those documents. A table called ‘userpref’ with one line per SA preference. I have even tested this using spamc and validated that the SQL configuration is good.
I am just a little lost as to the @sa_username_maps syntax (looks like regex to me), and I will read through the patch to try and determine what amavisd-new is looking for. In the meantime, if someone can help me understand how one might use all the domains in the postfixadmin table instead of one domain per line of @sa_userconf_maps, that would be helpful.
Matt
Sent: Thursday, September 01, 2011 11:21 AM
To: Matt Goodman
Subject: Re: sa_userconf_maps and sa_username_maps syntax question
Hello Matt,
For sql user_prefs ( per user config )::
I had to add
1. @sa_userconf_maps = (
{
'.domain-t1.ro' => 'sql:',
}
);
@sa_username_maps = new_RE (
[ qr'^([^@]+@.*)'i => '${1}' ]
);
2. this patch
http://lists.amavis.org/pipermail/amavis-users/attachments/20110812/756a66cf/attachment.obj
You have to read about SPAMMASSASSIN SQL userprf to know howto setup database and userpref table.
On Fri, Sep 2, 2011 at 1:51 AM, Matt Goodman <ma...@dgisoda.com> wrote:
> Thank you very much for your reply. I understand a little bit better now.
> However, in example one below you listed a single domain name using the
> method ‘sql’. What if I have dozens of domains, with them being
> added/removed somewhat regularly by Postfix Admin (I can perceive adding at
> least 1-2 domains per month) to this system. Isn’t there a way to tell
> amavisd-new that all domains in the lookup_sql_dsn? The table is actually
> called ‘domain’ inside the ‘postfixadmin’ db.
If all domains are using sql, you can have:
@sa_userconf_maps = (
{
'.*' => 'sql:',
}
);
> For @sa_username_maps – I do not understand the syntax of that at all. Could
> you explain it in just a little more detail so I actually understand what’s
> being done, as opposed to just copying your example. Many thanks.
In this case, since it is a single domain, i have personal userprefs
set just for uset, without domain, i mean, if email is us...@foo.com
prefs on SQL is set just for user, so, this map says exactly it, for
us...@foo.com, look just for user at SQL database.
@sa_username_maps = new_RE (
[ qr'^([^@]+@.*)'i => '${1}' ]
);
> Thank you for the link to the patch, that will be helpful. And yes I have
> followed the SpamAssassin SQL README and have my db schema as-per those
> documents. A table called ‘userpref’ with one line per SA preference. I have
> even tested this using spamc and validated that the SQL configuration is
> good.
What that patch does is making amavis respect personal required_score
setting instead of use a global value for everyone, and the version sent
to this thread has a small issue if you use it with spamassassin < 3.0.
> I am just a little lost as to the @sa_username_maps syntax (looks like regex
> to me), and I will read through the patch to try and determine what
> amavisd-new is looking for. In the meantime, if someone can help me
> understand how one might use all the domains in the postfixadmin table
> instead of one domain per line of @sa_userconf_maps, that would be helpful.
--
Renato Botelho
@sa_userconf_maps matches SA user preferences by domain
@sa_username_maps matches SA Bayes database by email address
As I understand it - in your regex example, amavisd-new will simply match
the recipient email address to the corresponding record in the bayes
database, correct? If this is not correct, any insight would be appreciated.
Again, I am not looking for a shortcut - only to understand the way the
subroutines were intended for use.
Ultimately I am trying to have a flexible virtual user email system with
per-user spamassassin preferences and per-user Bayesian filters, allowing
people to "train" their own Bayes tokens by "learning" messages which they
mark as Spam and "learning" those which are ham, while storing all that
information into a SQL database. The assumption here is that the Bayesian
classification will be more accurate to the individual user, rather than a
one-size-fits all for Bayes seen/tokens.
However, amavisd-new is my chosen mail filter system, simply because of how
flexible it is, and so far the help I have received here indicates that I
have made the right choice. I will share any findings that I learn back to
the community. Thank you again.
Matt
-----Original Message-----
From: Renato Botelho [mailto:rbg...@gmail.com]
Sent: Friday, September 02, 2011 12:07 AM
To: Matt Goodman
Cc: amavis...@amavis.org
Subject: Re: sa_userconf_maps and sa_username_maps syntax question