Performing lookups with LDAP

Julian Kippels kippels at hhu.de
Thu Jul 19 18:23:33 CEST 2018


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



More information about the amavis-users mailing list