Performing lookups with LDAP

Marco falon at ruparpiemonte.it
Mon Sep 3 09:02:52 CEST 2018


Il 19/07/2018 18:23, Julian Kippels ha scritto:
> Hi,
> 
> I am trying to perform lookups of sa_username_maps using LDAP. My
> config looks like this:
> 
> --
> $enable_ldap = 1;
> 
> $default_ldap = {
>          hostname => 'ldaphost',
>          base => 'o=example',
>          scope => 'sub',
>          query_filter => '(|(mail=%m)(mailAlternateAddress=%m))',
> };
> 
> @sa_username_maps = (
>          q_ldap_s('mailMessageStore'),
> );
> --
> 
> I have to match all available mailaliasses to get the real username
> from the mailMessageStore-Attribute. The LDAP-Connection works in
> principle. I can see the search performed in my LDAP-Logs. The search
> filter is correct and works using ldapsearch on the command line,
> however, there are two things that have me scratching my head. First of
> all, in the lookup requests all attributes from the LDAP object, not
> only mailMessageStore. Second, even with all attributes I still get no
> match.
> I see the following line in my amavis log:
> 
> amavis[25729]: (25729-01) lookup [sa_username] => undef,
> "testing at test.redacted.tld" does not match
> 
> What am I doing wrong here?
> 
> Thanks in advance,
> Julian

Hello, I tried something similar time ago.
Examining the amavisd code it seems that only the LDAP Amavis official 
schema attributes are retrieved. This is no good, in my opinion, it 
limits the benefit of sa_username_maps option.

Bye
Marco


More information about the amavis-users mailing list