We are using a custom python milter in our ZCS installation and one of the things it does is query ldap to see if an account is set up in Zimbra.

We did not know much about ldap when we first set this up and it appears our bind is incorrect because we noticed that if zimbraHideInGal was set to true on an account, the ldap query returned false, even if the account was set up.

Below are the parameters we're currently using. Can anyone with ldap experience advise on the correct parameters?

l = ldap.initialize('ldap://ldap1.ourdomain.com:389')
result = l.simple_bind('uid=zmpostfix, cn=appaccts, cn=zimbra', '*********')
result = l.search('', ldap.SCOPE_SUBTREE, '(mail=%s)' % sender, None)