Postfix SMTP relay broken, MX host not found.

Yesterday, all outgoing emails started to accumulate in the Postfix queue with this error:

Jun 29 13:35:02 intranet postfix/smtp[15330]: 88AE28C839: to=, relay=none, delay=8921, delays=8897/4/20/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=myprovider.isp.hosting type=MX: Host not found, try again)

First thing I did, nslookup and dig tests, yep the host can be found, although there is no MX record. Could it be that Postfix absolutely requires the MX record?

As it turns out: no. What actually happened is that I changed DNS settings for this server. I went into /etc/resolv.conf and updated the settings, as a new DNS server was installed and replaced and agin one.

What I didn’t know is that Postfix keeps a cached copy of this resolv.conf in a mini-chroot jail located in /var/spool/postfix/etc/resolv.conf

That file had the old DNS server settings! I changed it for the correct servers, and issued

postfix reload
postqueue -p

Voilà!

Tags: , , , , , , ,

4 Responses to “Postfix SMTP relay broken, MX host not found.”

  1. Thanks a lot, Laurent! Your post helped me solve the exact same issue.

    After that I found this on the Postfix FAQ:

    When Postfix components run within a chroot, their view of your file system is limited to subdirectories below the directory specified in queue_directory (default: /var/spool/postfix). Some system resources must be copied into the chrooted directory, and Postfix checks that the system versions are in sync with those in your chroot.

  2. current says:

    current…

    [...]Postfix SMTP relay broken, MX host not found. | Laurent's blog[...]…

  3. Ramiro says:

    Thank you very much!! I would never think of that! :)

    Cheers!

  4. Marvelous, what a website it is! This webpage gives helpful facts to us, keep
    it up.

Leave a Reply