# Postfix + OpenLDAP it works, but it doesnt.

## guid0

Hi everybody.

I am having trouble getting Postfix to find something in LDAP.

When i issue 

```
postmap -v -q 'test24' ldap:ldaplocal
```

i get:

```
postmap: dict_ldap_open: Using LDAP source ldaplocal

postmap: cfg_get_str: ldaplocal: server_host = ldap://localhost

postmap: cfg_get_int: ldaplocal: server_port = 389

postmap: cfg_get_int: ldaplocal: version = 2

postmap: dict_ldap_open: ldaplocal server_host URL is ldap://localhost

postmap: cfg_get_str: ldaplocal: scope = sub

postmap: cfg_get_str: ldaplocal: search_base = ou=nido,o=schmidt

postmap: cfg_get_str: ldaplocal: domain = 

postmap: cfg_get_int: ldaplocal: timeout = 10

postmap: cfg_get_str: ldaplocal: query_filter = (&(uid=%s)(accountStatus=active))

postmap: cfg_get_str: ldaplocal: result_filter = %s

postmap: cfg_get_str: ldaplocal: result_attribute = uid

postmap: cfg_get_str: ldaplocal: special_result_attribute = 

postmap: cfg_get_bool: ldaplocal: bind = on

postmap: cfg_get_str: ldaplocal: bind_dn = 

postmap: cfg_get_str: ldaplocal: bind_pw = 

postmap: cfg_get_bool: ldaplocal: cache = off

postmap: cfg_get_int: ldaplocal: cache_expiry = -1

postmap: cfg_get_int: ldaplocal: cache_size = -1

postmap: cfg_get_int: ldaplocal: recursion_limit = 1000

postmap: cfg_get_int: ldaplocal: expansion_limit = 0

postmap: cfg_get_int: ldaplocal: size_limit = 0

postmap: cfg_get_int: ldaplocal: dereference = 0

postmap: cfg_get_bool: ldaplocal: chase_referrals = off

postmap: cfg_get_bool: ldaplocal: start_tls = off

postmap: cfg_get_bool: ldaplocal: tls_require_cert = off

postmap: cfg_get_str: ldaplocal: tls_ca_cert_file = 

postmap: cfg_get_str: ldaplocal: tls_ca_cert_dir = 

postmap: cfg_get_str: ldaplocal: tls_cert = 

postmap: cfg_get_str: ldaplocal: tls_key = 

postmap: cfg_get_str: ldaplocal: tls_random_file = 

postmap: cfg_get_str: ldaplocal: tls_cipher_suite = 

postmap: cfg_get_int: ldaplocal: debuglevel = 0

postmap: dict_open: ldap:ldaplocal

postmap: dict_ldap_lookup: In dict_ldap_lookup

postmap: dict_ldap_lookup: No existing connection for LDAP source ldaplocal, reopening

postmap: dict_ldap_connect: Connecting to server ldap://localhost

postmap: dict_ldap_connect: Actual Protocol version used is 2.

postmap: dict_ldap_connect: Binding to server ldap://localhost as dn 

postmap: dict_ldap_connect: Successful bind to server ldap://localhost as  

postmap: dict_ldap_connect: Cached connection handle for LDAP source ldaplocal

postmap: dict_ldap_lookup: Searching with filter (&(uid=test24)(accountStatus=active))

postmap: dict_ldap_get_values[1]: Search found 0 match(es)

postmap: dict_ldap_get_values[1]: Leaving dict_ldap_get_values

postmap: dict_ldap_lookup: Search returned nothing

postmap: dict_ldap_close: Closed connection handle for LDAP source ldaplocal
```

The problem is that it finds 0 match(es) when it should actually find 1 match.

I use the following relevant configuration in main.cf

```
alias_maps = ldap:ldapaliases

ldapaliases_server_host = 127.0.0.1

local_recipient_maps = ldap:ldaplocal

ldaplocal_server_host = ldap://localhost

ldaplocal_search_base = ou=nido,o=schmidt

ldaplocal_query_filter = (&(uid=%s)(accountStatus=active))

ldaplocal_result_attribute = uid
```

Also when i change the query_filter to something more simple it gives me the same thing.

Any hints no where to look and what to do?

Best regards,

guid0

----------

## Rider

Hi,

how does your ldap entry looks like (uid=test24)?

Are you able to retrieve a result via ldapsearch (anonymous binding)? If not, it's probably a ldap ACL issue...

HTH

Chris

----------

## guid0

Thanks for your reply, however i was able to find the entry with a simple ldap search.

Even with anonymous connects.

Unfortunately i cannot dig any deeper into this, since i just started from scratch again  :Confused:   :Confused: 

----------

