Score:0

VPS server configuration

cf flag

I have one VPS server and 4 domains under that, having 1 IP address as of now, also I have 4 CloudFlare accounts for 4 domains hosted for easier DNS management

My question is:

Q1. Is it possible to configure server such that same IP resolves to multiple domains but sending email resolved to different domain name Example: when user with email ID abc@domain1.com sends mail to someone it should be shown as send by and signed by domain1.com, this will be same for other domains

abc@domain1.com -> send and signed by domain1.com abc@domain2.com -> send and signed by domain2.com abc@domain3.com -> send and signed by domain3.com abc@domain4.com -> send and signed by domain4.com

Though I have configured postfix settings in the main.cf file located in /etc/postfix/main.cf, but here I just managed to change the hostname for once and for all domains. I mean it is an error because whenever mail is send through different domain it is still shown as send with domain1.com abc@domain1.com -> send and signed by domain1.com abc@domain2.com -> send and signed by domain1.com (Note: it is signed by different domain) abc@domain3.com -> send and signed by domain1.com (Note: it is signed by different domain) abc@domain4.com -> send and signed by domain1.com (Note: it is signed by different domain) Here last 3 mail send resolves to domain1.com, which clearly is an error.

Q2. Do I have to buy new IP address for each domain I want to host at this VPS for correct resolution, does this solves Hostname problem? Is this a possible solution How can I manage to get different Hostname for different IP. Do this have any relation to rDNS?

Q3. Is there a way to dynamically assign the hostname based on IP address/sending domain

Can someone guide me how to resolve this issue. Someone please help me.

I have edited the main.cf file located in /etc/postfix/main.cf using SSH

added the lines

myhostname = domain1.com smtpd_banner = $myhostname ESMTP $mail_name

I have managed to successfully resolve all the DNS issues like DKIM signature, SPF record etc., but there are other 3 domains also there, but all the hostname resolves to domain1.com even though email sent using other domains.

in flag
Most VPSes will not let you use them to set up an email server. Too many people have abused email over the past 30 years. You will need to confirm with your provider whether they permit outgoing email traffic from their data centres, otherwise everything you do to configure message signing will be for nothing.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.