Mail server configuration, for outgoing mails

Dedicated box, Centos 7-64. php 5.4 and 5.6.5, webmin/virtualmin in their last releases.

I host a few domains, let’s say domain1 on IP1 (that is the “main server IP”) and domain2 on IP2
Currently all outgoing mails show the sender as “mail.domain1” and IP1 in their headers, and for the remote mail server of receipients.

How can I do so that outgoing mails from domain2 shows “mail.domain2” and IP2?

Dono if it is useful bu domain1 runs php 5.4 and domain2 runs php 5.6.5!

Thanks for your help!

It would appear the setting is global, i.e it can be changed to domain 2 but wen domain 3 comes along - it will say from domain 2.

Would like to hear otherwise.


Well but as I understand, ALL domains will use then mail.domain2! This isn’t what I expected…

Is there a way to setup a second mail server and use this one on domain2, so?

Google might be your best friend “postfix multiple instances” or maybe as the following post, - probably aint for the faint hearted.