On Tue, Aug 24, 2010 at 10:32:12AM -0400, Zhou, Yan wrote: > Hi there, > > I am using Postfix 2.4.3. As my first step to integrate with Postfix, I > wish to look up LDAP for local user. > > I did not recompile Postfix because I thought it comes with LDAP > support. My ldap log does show that Postfix is trying to look up, so I > think it is fine there. > > main.cf reads like this: > local_recipient_maps = ldap:ldaplocal > ldaplocal_server_host = ldap://hub-dev-app01.dev.medplus.com:389/ > ldaplocal_search_base = ou=Person,dc=hubdirect,dc=Prod,dc=medplus, > dc=com > ldaplocal_query_filter = (mail=%s) > ldaplocal_result_attribute = mgrpDeliverTo > > I am testing by sending an email to > "ldapu...@hubdirect.prod.medplus.com", but it says: Recipient address > rejected: User unknown in local recipient table > > My LDAP logs says, I do not quite understand if the log says anything > unusual.
Look in Postfix logs, not LDAP server logs. Test LDAP tables with "postmap -q" first. > How would I go trouble shoot this? > > When I run this command: postmap -q 'ldapuser' ldap:ldaplocal, it > does not return anything, neither success nor failure. That does not > sound right. Wrong query, supply the full email address. When the query finds nothing, there is no output, but the exit status is non-zero. $ postmap -q <query> <table-spec> $ echo $? > One thing I did notice is that my LDAP server does not support > objectClass like "people" or "virtualaccount" as I see in some > tutorials. I do not know whether that matters. Not a problem, so long as it has the data required to return the expected results for your queries. -- Viktor.