<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000">Thanks Mark,<br>
<br>
Mark Martinec wrote:
<blockquote cite="mid:201208301857.58248.Mark.Martinec+amavis@ijs.si"
type="cite">
<pre wrap="">Nick,
</pre>
<blockquote type="cite"><pre wrap="">is there a way to configure per-user Bayes tokens for SA?
</pre></blockquote>
<pre wrap=""><!---->
Since amavisd-new-2.7.0.
Note that this implies that for a multi-recipient message
SpamAssassin will need to be called more than once per message.
</pre>
<blockquote type="cite"><pre wrap="">In my bayes config I've removed the bayes_sql_override_username. Initial
training when mail is scanned by Amavis/SpamAssassin still seems to
store the tokens as the amavis-user rather than the recipient.
Re-training is done with a custom script that configures the user
(sa-learn -u). Is it possible to configure Amavis so it passes the
recipient to SpamAssassin so it can store per-user Bayes information?
</pre></blockquote>
<pre wrap=""><!---->
amavisd-new-2.7.0 release notes:
- per-recipient (or per- policy bank) SpamAssassin SQL database usernames
are supported (setting @sa_username_maps, a policy.sa_username SQL field).
This makes it possible to implement per-user or per-user-group or
per-domain Bayes databases when SpamAssassin is configured to keep
its Bayes database on an SQL server. It also makes it possible to load
per-recipient SpamAssassin preferences (configurations) from an SQL
database (as described in a previous section).
Switching between Bayes usernames is cheap compared to switching between
SpamAssassin configuration files. A multi-recipient message whose
recipients map to different usernames will be checked by SpamAssassin
multiple times, once for each unique username;
Example:
@sa_username_maps = (
{ '<a class="moz-txt-link-abbreviated" href="mailto:user1@example.com">user1@example.com</a>' => 'user1',
'<a class="moz-txt-link-abbreviated" href="mailto:user2@example.com">user2@example.com</a>' => 'user2',
'.example.com' => 'user_ex',
}
);
</pre>
</blockquote>
This is the information I've found so far. It's only not very usefull if
you would like to consult an SQL-DB. I've got all local users defined
in my DB so I'd just like to do a 1 on 1 translation:<br>
<a class="moz-txt-link-abbreviated" href="mailto:user1@domain.com">user1@domain.com</a> => <a class="moz-txt-link-abbreviated" href="mailto:user2@domain.com">user2@domain.com</a><br>
<a class="moz-txt-link-abbreviated" href="mailto:user2@domain.com">user2@domain.com</a> => <a class="moz-txt-link-abbreviated" href="mailto:user2@domain.com">user2@domain.com</a><br>
<a class="moz-txt-link-abbreviated" href="mailto:unknown-user@domain.com">unknown-user@domain.com</a> => NULL<br>
<a class="moz-txt-link-abbreviated" href="mailto:someone@external-domain.com">someone@external-domain.com</a> => NULL<br>
<br>
without having to define them all. Just a simple "select user from
mailbox" would suffice but I cannot find any documentation on how to do
that.<br>
<br>
N.<br>
</body></html>