Let us assume that you are hosting mail servers for three domains domain1.com
, domain2.com
, domain3.com
in your VPS that has the IP address 1.2.3.4
.
POP3/IMAP/SMTP
DNS records are used by your customers to send/receive mails by configuring their mail clients. So set the followingA
records.mail.domain1.com A 1.2.3.4 mail.domain2.com A 1.2.3.4 mail.domain3.com A 1.2.3.4
To receive mails on the same server for all your domains, set the
MX
records for all the domains as follows.domain1.com MX mail.domain1.com domain2.com MX mail.domain2.com domain3.com MX mail.domain3.com
Your
system name
has nothing to do with the mail server setup.
Postfix setup:
since your postfix instance is gonna handle multiple domains, you can either set a whitelabelled myhostname
for your postfix server like somedomain.tld
or use one of mail.domain1.com
, mail.domain2.com
or mail.domain3.com
. If you are planning to use mail.domain1.com
as your mail server name(myhostname
value in postfix) and your server has 1.2.3.4
IP and you are gonna handle mail for domain1.com
, domain2.com
, domain3.com
, setting up all the following is always recommended.
A
record ofmail.domain1.com
pointing to1.2.3.4
- PTR record for
1.2.3.4
pointing tomail.domain1.com
SPF
record fordomain1.com
,domain2.com
,domain3.com
should include1.2.3.4
Hope that helps.