our mail server crashes without we knowing it.
recently, my friend tried to register to my akkoma, but he didn't get any email anyway. Checked on my end via smtpctl show queue, but got no queue.
once i check the log, the mail server crashed because of two thing: – it can't connect to our postgresql db as it hasn't started yet – it can't bind to the smtp port
so, then i decided to modify the systemd service unit to make it always restart on every 10 seconds when theres a failure:
[Unit]
Description=OpenSMTPD SMTP server
Documentation=man:smtpd(8)
After=network.target
[Service]
Type=forking
ExecStart=/usr/sbin/smtpd
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
hopefully this doesn't happen again.