Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I set up LDAP access with postfix.

ldapsearch -D "cn=postfix,ou=users,ou=system,[domain]" -w postfix -b "ou=users,ou=people,[domain]" -s sub "(&(objectclass=inetOrgPerson)(mail=[mailaddr]))"

delivers the correct entry. The LDAP config file looks like

root@server2:/etc/postfix/ldap# cat 
server_host = localhost
search_base = ou=users,ou=people,[domain]
scope = sub
bind = yes
bind_dn = cn=postfix,ou=users,ou=system,[domain]
bind_pw = postfix
query_filter = (&(objectclass=inetOrgPerson)(mail=%s))
result_attribute = uid
debug_level = 2

The bind_dn and bind_pw should be the same as I used above with ldapsearch. Nevertheless, calling postmap doesn't work:

root@server2:/etc/postfix/ldap# postmap -q [mailaddr] ldap:/etc/postfix/ldap/
postmap: warning: dict_ldap_lookup: /etc/postfix/ldap/ Search base 'ou=users,ou=people,[domain]' not found: 32: No such object

If I change LDAP configuration, so that anonymous users have complete access to LDAP

olcAccess: {-1}to * by * read

then it works:

root@server2:/etc/postfix/ldap# postmap -q [mailaddr] ldap:/etc/postfix/ldap/ 

But when I restrict this access to the postfix user:

olcAccess: {-1}to * by dn="cn=postfix,ou=users,ou=system,[domain]" read by * break

it doesn't work but produces the error printed above (although ldapsearch works, only postmap doesn't).

Why doesn't it work when binding with a postfix DN? I think I set up the LDAP ACL for the postfix user correctly, as the ldapsearch command should prove. What can be the reason for this behaviour?

share|improve this question
up vote 0 down vote accepted

Solved it - the LDAP version was missing. needs an additional entry

version = 3

because the LDAP server doesn't allow LDAPv2.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.