Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

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

Here are the lines from the postfix mail.log:

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 root@domain.com

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

The issue has reported here to the Ubuntu Launchpad.

share|improve this question
    
Does the chroot environment include a copy of your /etc/resolv.conf? –  Egil Apr 30 '11 at 11:55
    
Yes. This is done by the init script. –  Andreas Roth May 1 '11 at 6:12
add comment

2 Answers

up vote 2 down vote accepted

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/
share|improve this answer
add comment

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
share|improve this answer
    
that's one way to solve this. Thanks so far. But i would like to know why postfix is unable to revolve the name via DNS. –  Andreas Roth Apr 29 '11 at 18:05
    
How you got to know that it's a DNS issue? You might post some logs? –  binfalse Apr 29 '11 at 18:12
    
Since DNS queries are resolved via ports 53/tcp and 53/udp a Wireshark capture of an attempt should help you. You should be able to see what DNS queries Postfix sends to whom, what the response is, and tons and tons of other packets. –  waltinator Dec 2 '11 at 20:39
add comment

Your Answer

 
discard

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.