Benny,

> whitelist/blacklist is static in amavisd.conf, so i just need to have
> the policy sql conf working 

amavisd.conf-sample tells how to disable SQL-based w/b list:

# The default value is:
#   $sql_select_white_black_list = 'SELECT wb ...
...
# undef disables SQL white/blacklisting

$sql_select_white_black_list = undef;


> CREATE TABLE `policy`  ...
> i am lost in this one, since i don't know how to realy make this
> sql table work from amavisd :(

Please study the example in README.sql. The CREATE TABLE and
INSERT commands can be cut/pasted directly into sql command utility
for experimentation.

The default SELECT clause shows how the two tables (users and policy)
are joined to fetch a row from a policy pertaining to a user:

(from amavisd.conf-sample):
   $sql_select_policy =
   'SELECT *,users.id FROM users,policy'.
   ' WHERE (users.policy_id=policy.id) AND (users.email IN (%k))'.
   ' ORDER BY users.priority DESC';

(actually a newer default uses a slightly different syntax,
with the same effect):
$sql_select_policy =
  'SELECT *,users.id FROM users'.
  'LEFT JOIN policy ON users.policy_id=policy.id'.
  'WHERE users.email IN (%k) ORDER BY users.priority DESC';

In both cases a JOIN on two tables is done,
based on relation users.policy_id=policy.id.

There are two approaches to making policies: either prepare a few
pre-defined records in table policy (like the example suggests)
and let each recipient or a subdomain choose one of these.

A different approach would make an individual record in table policy
for each recipient in table users. This makes possible for each user
to independently tweak its own settings (instead of choosing one
of the pre-configured settings).

A combination of both approaches is possible as well: let the initial
setting for each user point to one of the predefined policies, and if
this turns out not to be adequate, make a new entry in table policy 
specifically for that individual when need arises.

  Mark


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to