Postfix error: Host or domain name not found

clemtoy

I am using Raspbian and the Postfix (version 2.9.6) service seems to be automatically run when I boot, but if I want to send a mail, the email stays in the queue:

$ mailq
26CB72201F    443 Sat Sep 19 19:44:17   [email protected]
(Host or domain name not found. Name service error for name=smtp.gmail.com type=A: Host not found, try again)
                                        [email protected]

If I restart the service (sudo service postfix restart) then emails work until the next boot.

Why? What is the difference?

During the Postfix installation I chose the configuration “Internet with smarthost” but then I followed a tutorial for …Internet Site” to finish the configuration so this might be the problem(?) I just want to send emails.

UPDATE: The problem might be that that Postfix is run before the Wi-Fi is connected.

clemtoy

The problem is that Postfix checks /etc/resolv.conf before the WiFi is connected. Therefore, /var/spool/etc/postfix/resolv.conf stays empty after the boot and mails cannot be sent.

To solve the problem, I disabled postfix service:

sudo update-rc.d postfix disable

…and I wrote this script to wait the end of the Wi-Fi connection before to start Postfix (saved in /usr/local/bin/postfix_wifi.sh):

#!/usr/bin/sh

host="smtp.gmail.com"
port=587

until nc $host $port -w 5
do
    sleep 10
done

sudo service postfix start
exit 0

…and I added this line to /etc/rc.local so that the script is run at boot:

/usr/local/bin/postfix_wifi.sh &

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Postfix: Name service error for name=domain.com type=MX: Host not found, try again

From Dev

Postfix domain not found

From Dev

postfix MX host not found

From Dev

Host name and domain name purpose

From Dev

Nginx returns 404 not found error when using domain name

From Dev

Samba domain controller provisioning error: Domain must not be equal to short host name

From Dev

Host domain name pointer in linux

From Dev

How to connect a domain name to a host?

From Dev

Difference between host name and domain name

From Dev

if no host name present error

From Dev

Is it necessary to have domain name for installing postfix in ubuntu virtual server?

From Dev

Why do I have to change the linux host name for postfix?

From Dev

How to deny access to the host by domain name?

From Dev

Apache virtual host without domain name

From Dev

How to host a Laravel 4 project on a domain name?

From Dev

How to deny access to the host by domain name?

From Dev

get host name from domain REGEX javascript

From Dev

Assigning domain name to host on Route 53 in AWS

From Dev

Point host to Docker container with static domain name

From Dev

Apache server - domain name return "404 Not Found"

From Dev

Extract host name/domain name from URL string

From Dev

How to set domain name (or host name) on Wildfly-8.2.1.Final

From Dev

The host network interface with the given name could not be found

From Dev

The host network interface with the given name could not be found

From Dev

Authentication failed. Please check your username/password. [Server response: DNS Error: Domain name not found code(0) ]

From Dev

Authentication failed. Please check your username/password. [Server response: DNS Error: Domain name not found code(0) ]

From Dev

Get Base Domain Name from Host / URL in Rails

From Dev

Get domain name without port using HTTP_HOST

From Dev

.htaccess to strip subdomain from a dynamic domain/host name

Related Related

  1. 1

    Postfix: Name service error for name=domain.com type=MX: Host not found, try again

  2. 2

    Postfix domain not found

  3. 3

    postfix MX host not found

  4. 4

    Host name and domain name purpose

  5. 5

    Nginx returns 404 not found error when using domain name

  6. 6

    Samba domain controller provisioning error: Domain must not be equal to short host name

  7. 7

    Host domain name pointer in linux

  8. 8

    How to connect a domain name to a host?

  9. 9

    Difference between host name and domain name

  10. 10

    if no host name present error

  11. 11

    Is it necessary to have domain name for installing postfix in ubuntu virtual server?

  12. 12

    Why do I have to change the linux host name for postfix?

  13. 13

    How to deny access to the host by domain name?

  14. 14

    Apache virtual host without domain name

  15. 15

    How to host a Laravel 4 project on a domain name?

  16. 16

    How to deny access to the host by domain name?

  17. 17

    get host name from domain REGEX javascript

  18. 18

    Assigning domain name to host on Route 53 in AWS

  19. 19

    Point host to Docker container with static domain name

  20. 20

    Apache server - domain name return "404 Not Found"

  21. 21

    Extract host name/domain name from URL string

  22. 22

    How to set domain name (or host name) on Wildfly-8.2.1.Final

  23. 23

    The host network interface with the given name could not be found

  24. 24

    The host network interface with the given name could not be found

  25. 25

    Authentication failed. Please check your username/password. [Server response: DNS Error: Domain name not found code(0) ]

  26. 26

    Authentication failed. Please check your username/password. [Server response: DNS Error: Domain name not found code(0) ]

  27. 27

    Get Base Domain Name from Host / URL in Rails

  28. 28

    Get domain name without port using HTTP_HOST

  29. 29

    .htaccess to strip subdomain from a dynamic domain/host name

HotTag

Archive