Discussion:
Example of LDAP or mysql site-wide black/white listing ?
David Dodd
2018-03-26 02:01:41 UTC
Permalink
I am trying to implement either LDAP or mysql based site-wide black/white lists.

My current configuration is using a site-wide soft white/black list in
configured in amavisd.conf using

read_hash("/var/amavis/sender_scores_sitewide"),

My understanding from reading the README.sql-mysql & README.ldap is that ...

LDAP gives me hard per-recipient black/white lists.

mysql will give me either soft or hard, per-recipient black/white lists.

I am correct or am I missing something ?

If someone has a a working LDAP based site-wide soft black/white list, can you
point at how to do this ?

If someone has a working mysql site-wide soft black/white list, can you point
me at how to achieve this ?

Thanks in advance,

-- David Dodd
Martin Johannes Dauser
2018-03-27 09:59:14 UTC
Permalink
Hi,

I myself haven't used LDAP in conjunction with amavis, but fast reading
the documentation I'd say you may get a __userbased__ hard
black/whitelist with LDAP using attributes 'amavisBlacklistSender' and
'amavisWhitelistSender'.

Point is, those attributes can only save the sender's addresses,
nothing more. So soft black/whitelisting with it's spamassassin score
modifier can't be defined. I guess LDAP is quite limited regarding
saving a value pair to an attribute, especially if multiple pairs
should be possible.

I think, there is no way to define a __site-wide__ whitelist with LDAP
as those entries are always within a user's LDAP entry. But you may
combine a lookup to a site-wide static file with a user based LDAP
lookup. 'The SQL and LDAP are somewhat specific and are always
consulted first.'[1] So, as soon as LDAP is enabled it should be
considered:

$enable_ldap  = 1;
$ldap_lookups_no_at_means_domain = 0(=default) or 1

$default_ldap = {
hostname      => [ 'localhost', 'ldap2.example.com' ],
timeout       => 5,
tls           => 0,
base          => 'ou=People,dc=example,dc=com',
query_filter  => '(&(objectClass=amavisAccount)(mail=%m))',
};

read_hash(\%whitelist_sender, '/etc/amavis/whitelist');
@whitelist_sender_maps = (\%whitelist_sender);

[1] https://www.ijs.si/software/amavisd/README.ldap

Best regards
Martin Johannes Dauser
Post by David Dodd
LDAP gives me hard per-recipient black/white lists.
I am correct or am I missing something ?
If someone has a a working LDAP based site-wide soft black/white list, can you
point at how to do this ?
Thanks in advance,
-- David Dodd
Loading...