I’ve been using Virtualmin on and off for a few years, and recently started to do some more serious hosting. All has been going well until this week when I purchased an additional IP address from my service provider.
I added this IP as an alias to the underlying Ubuntu 18.04 Server (VPS), and then added two new virtual servers which use the newly added IP address instead of the original shared IP. So far so good. HTTP, HTTPS, etc., all working fine.
I then patched the server and rebooted, to find that Postfix didn’t come up, and I couldn’t start it manually. The syslog shows:
May 15 13:51:52 host postfix/master: fatal: bind 0.0.0.0 port 25: Address already in use May 15 13:51:53 host postfix/master: fatal: daemon initialization failure May 15 13:51:54 host postfix/postfix-script: fatal: mail system startup failed
I checked the output of netstat, which showed me nothing listening on port 25. A little searching of the internet pointed me to multiple definitions of lines such as these in /etc/postfix/master.cf:
smtp inet n - y - - <further config redacted....>
Indeed I checked this file and found that I had entries like this for smtp, smtps, submission, etc.:
smtp inet n - y - - xx.xx.xx.xx:smtp inet n - y - -
*where “xx.xx.xx.xx” is my newly added IP alias. I commented out all lines beginning with this IP address, and sure enough Postfix now starts, and is listening on 0.0.0.0 so should be receiving mail for all IP’s.
So the problem is fixed (for now), but it all feels kinda hacky - I fixed it in the shell using vi, which raises the question for me - did I do something wrong in Virtualmin with regards to adding the new IP alias which broke the config? Is there a way I can fix Postfix’s configuration without needing to manually edit the config generated by Virtualmin in the shell? This would be a far better solution, but as everything else seems to be working, I can’t figure out where I went wrong.
Any advice appreciated!