I have an issue with a Postfix instance in a Docker container. I'm using supervisord
to make sure the services run in the background. However, if I build the image, start it up for the first time and try to send a mail, Postfix complains that it can't resolve the MX record for the given address (status=deferred (Host or domain name not found. Name service error for name=domain.tld type=MX: Host not found, try again)
).
Now I installed dig
to find out if its an DNS issue, but I can resolve the MX straight:
$ dig mx domain.tld +short
90 aspmx2.googlemail.com.
90 aspmx3.googlemail.com.
10 aspmx.l.google.com.
50 alt1.aspmx.l.google.com.
50 alt2.aspmx.l.google.com.
Then I proceeded to restart the Postfix with service postfix restart
and was pretty startled that the MX issue is gone. I reproduced the issue more than three times and its always the same. I have to issue service postfix restart
to make Postfix work fully functional.
Can someone explain me why or even better: how to fix this?
Thanks in advance!