using DNS lookup in chroot postfix

I'm trying to set up a postfix set up on my client machines. All machines should use a central ldap directory for common postfix (e.g. aliases, etc). But since postfix runs in chroot postfix is unable to resolve the hostname of the ldap server.

Postfix mail.log lines:

Apr 30 13:37:22 host postfix/cleanup[30160]: dict_ldap_debug: ldap_connect_to_host: TCP ldapmaster.domain.com:389
Apr 30 13:37:22 host postfix/cleanup[30160]: dict_ldap_debug: ldap_connect_to_host: getaddrinfo failed: Name or service not known
Apr 30 13:37:22 host postfix/cleanup[30160]: dict_ldap_debug: ldap_err2string
Apr 30 13:37:22 host postfix/cleanup[30160]: warning: dict_ldap_lookup: Search error -1: Can't contact LDAP server
Apr 30 13:37:22 host postfix/cleanup[30160]: warning: AF28B226A2: sender_canonical_maps map lookup problem for 

When I do the ldapsearch manually it works fine. I also tried to enter the chroot environment of postfix (/var/spool/postfix) and when I try to ping ldapmaster.domain.com I get an unknown host-error.

The issue has been reported to Ubuntu Launchpad as DNS hostname lookups fail in chroot after natty upgrade.

Any ideas how to allow postfix to resolve the DNS names?

2

2 Answers

I've found that libnss libraries seem are loaded after chroot. So they are needed in the chroot jail. Link them there:

cp -vl /lib/i386-linux-gnu/libnss_* /var/spool/postfix/lib/i386-linux-gnu/

Don't understand why postfix shouldn't be able to resolve DNS names, but just add the DNS of your LDAP-provider to the /etc/hosts. So you are independet of any DNS lookups and don't get stuck if the DNS server should fail:

1.2.3.4 thehostname
3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like