Postfix: How setting up hostname for every virtual server?

Here is my scenario: 1 server, 2 virtual servers with static dedicated IP’s (eth0, eth0:0).

I managed setting dedicated IP’s in Postfix for my virtual servers based on this documentation:

One more issue I have to solve. Postfix is using hostname record from the server for all sent emails, no matter what virtual server I am using for sending. I would like to set up my own hostnames for every virtual server. Now it is, I would like Postfix setting up hostnames to and for virtual servers.

Is this possible in Virtualmin?


Why do you need a separate hostnames?

If I send an email server hostname will be attach to it. I don’t want this approach, every domain which has its own IP should have its hostname too in email headers.


What benefit do you see with this idea?

You could setup “multiple postfix instances”, though this would likely be a bit overkill, and isn’t really supported by Virtualmin itself.

Let’s not questioning too much and provide solutions. I am not a newbie in Virtualmin.

I have a hostname like this There are many other virtual domains, but one of them is It is fine to see the hostname when sending emails from, but when sending emails from hostname is One solution is changing the hostname, the other one is setting up hostname for every domain in file. I managed a few solutions but I need to find which one is the best. You are welcomed to provide one.