DNS problems, email notifications not being sent

I had a working Open Media Vault system with notifications going out and then it stopped. OMV runs on Debian. In the log I started seeing:

Notifications error

The actual error was:

postfix/error[1443]: 1D96741676: to=<joe.blogs@domain.com>, relay=none, delay=175894, delays=175853/41/0/0.24, dsn=4.4.3, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=send.xtra.co.nz type=MX: Host not found, try again)

I opened an ssh session to the OMV host as root and tried to ping the mail server but this didn’t work, returning:

ping: unknown host send.xtra.co.nz

So I went back to the OMV web UI and looked into the network setting and saw the DNS server was set to my old router:

DNS Settings OMV

I changed the DNS settings to point to Google, “8.8.8.8” and waited for the “Appy” button  but it still still ping didn’t resolve. At this point I looked at “/etc/resolv.conf” and found that OMV did not seem to update resolv.conf, apparently this is a known issue with OMV so I updated “/etc/resolv.conf” to point to Google, “8.8.8.8”. At this point ping now resolved.

I tried another test email notification and it again failed with the same error.

Then I did some Googling and found I also needed to look at:

/var/spool/postfix/etc/resolv.conf

This is apparently a resolve file used by Postfix, bearing in mind the OMV uses Postfix to send emails. So I edited this resolv.conf and bingo my mail started to work.

Normally I would not edit the file at this level because it can upset the balance between OMV and the filesystem, but apparently it is a know issue and anyway I am setting things to match the UI.

I did not try a restart as I have some full-time systems using OMV and a restart would be a pain.