Changing Hostname/Domain Name Does Not Update Postfix

It is my understanding that if you change the domain name for a virtual host with mail, Virtualmin will automatically update "/etc/mailname" as well as $myhostname within "/etc/postfix/main.cf". This does not occur.

If I also update my hostname through Webmin-->Networking-->Network Configuration-->Hostname and DNS Client, and change the hostname to match my domain name, then I see my change updated in "/etc/mailname". However, the "myorigin" line within "/etc/postfix/main.cf" is commented out by default so I am not sure what effect this has.

Status: 
Closed (fixed)

Comments

Which page in Virtualmin did you update the hostname on? /etc/mailname normally only contains the system's hostname, so it's only changed if you update the primary hostname at Webmin -> Networking -> Network Configuration.

I just saw this reply ;)

Yes I am changing the setting Webmin -> Networking -> Network Configuration

My setup is a little more complicated. I edit the template and configuration files programatically. Then I use Ansible to install Virtualmin and replace the config files I have modified.

At the point when I install Virtualmin, the hostname is set to "example.com". I then use this installation as a "snapshot" that I use on digitalocean.com to create a new VPS droplet. This newly created droplet has it's hostname adjusted to something real on creation.

If I look at the setting for Hostname located here: Webmin -> Networking -> Network Configuration-->Hostname and DNS Client It will say the correct and real hostname. But if I look at "Internet hostname of this mail system" under: Webmin-->Servers-->Postfix Mail Server-->General Options It still reports the old hostname "example.com"

I realize this is a pretty unique scenario. Perhaps the way I am going about it is fundamentally wrong. I will continue to investigate.

OK, that looks like something Virtualmin should update but currently isn't. I'll fix that..

Status: Fixed ยป Closed (fixed)

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