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: https://www.virtualmin.com/documentation/email/dependent.

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 server.mydomain.com, I would like Postfix setting up hostnames to server.mydomain1.com and server.mydomain2.com for virtual servers.

Is this possible in Virtualmin?

Hi,

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.

Hi,

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.

http://www.postfix.org/MULTI_INSTANCE_README.html

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

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