I have just setup a linux server and seem to have issues sending emails during system startup!
I always get:
sendmail: cannot locate host smtpauths.bluewin.ch: Temporary failure in name resolution
sendmail: could not send mail (account default from /root/.msmtprc)
Once the system is up I can successfully send emails with out any issues.
The service file looks fine I think:
[Unit]
Description=Run script at startup after all systemd services are loaded.
Wants = network-online.target
After = network.target network-online.target
[Service]
ExecStart=/sbin/mdadm --monitor --scan --test --oneshot /dev/md[[:digit:]]*
[Install]
WantedBy=multi-user.target
Initialy thought I've got a problem with the DNS so I added 2 additional names servers 8.8.8.8 and 8.8.4.4
What ever I try I just can't figure out what the problem could be.
Any hint would be appreciated!
Thanks and all have a nice weekend!