Virtualmin edge case bug breaks Postfix

Steps to reproduce:

My hostname is mx1.lewisjenkins.uk

1) Add a virtual server called mx1.lewisjenkins.uk with 'Apache Website' and 'Mail for Domain' enabled.

2) Edit the virtual server, remove 'Mail for Domain'.

THIS HAPPENS (from Webmin log) :

Changed file /etc/postfix/main.cf
35c35
< mydestination = mx1.lewisjenkins.uk, localhost.lewisjenkins.uk, , localhost
---
> mydestination = localhost.lewisjenkins.uk, localhost

3) Delete Virtual Server 'mx1.lewisjenkins.uk'

POSTFIX IS NOW BROKEN, REFUSING TO ACCEPT MAIL.

It took me a few minutes to figure out what had happened. Manually adding mx1.lewisjenkins.uk back onto mydestination and restarting Postfix fixed it, but it was a scary few minutes.

Status: 
Closed (fixed)

Comments

Thanks, I'll fix this in the next release of Virtualmin.

That said, having a domain name with email enabled that is the same as your hostname isn't generally a good idea.

Actually, I haven't for this server, I was just experimenting with some Mail Client Autoconfiguration settings and needed to temporarily enable mail on a domain. I did say it was an edge case!

For what it's worth, I'd rather Virtualmin didn't remove the hostname from mydestination under any circumstances. Yes, Postfix generates those warning messages in maillog about not listing the domain in BOTH mydestination and virtual_alias_domains but they are harmless enough.

Automatically closed -- issue fixed for 2 weeks with no activity.