Postfix has stopped sending mails on CentOS or RHEL: status=deferred, Host or domain name not found

Created:

2016-11-16 13:25:58 UTC

Modified:

2017-04-24 11:35:46 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Postfix has stopped sending mails on CentOS or RHEL: status=deferred, Host or domain name not found

Applicable to:

  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Symptoms

Postfix cannot send emails anymore. All mails are staying in queue. The following entries can be found in /var/log/maillog :

Aug  7 17:13:08 root142123 postfix/smtp[25846]: D615A60A1CE: to=<parallelsmailtesting@gmail.com>, relay=none, delay=0.15, delays=0.15/0/0/0, dsn=4.4.3, status=deferred (Host or domain name not found. Name service error for name=gmail.com type=MX: Host not found, try again)

Cause

The mail server cannot not resolve destination IP of the mail server, where the message should be sent. SELinux is blocking access to /etc/resolv.conf .

    # grep resolv.conf /var/log/audit/audit.log | less
type=AVC msg=audit(1375899192.013:10985): avc: denied { read } for pid=2769 comm="tcp-env" name="resolv.conf" dev=sda1 ino=1892366 scontext=unconfined_u:system_r:sendmail_t:s0-s0:c0.c1023 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file


# ll -Z /etc/resolv.conf
-rw-r--r--. root root system_u:object_r:httpd_sys_content_t:s0 /etc/resolv.conf

Resolution

Update the selinux-policy package or restore the default context:

    # restorecon /etc/resolv.conf

# ll -Z /etc/resolv.conf
-rw-r--r--. root root system_u:object_r:net_conf_t:s0 /etc/resolv.conf

See RedHat Bugzilla NetworkManager writing out resolv.conf with wrong context

Additional information

Mail queue contains deferred emails: Host or domain name not found

Have more questions? Submit a request
Please sign in to leave a comment.