Host mail server for other domain

Hi everyone. I installed HestiaCP for mail server on Hetzner with my domain and everything is working great. No problem at all.

I would like to host mail for other domain too and i’m not sure how to do it.
For example, right now i’m setting up a website for a friend and i want to provide him an email address ([email protected]) but i can’t figure out how to configure Cloudflare to use my HestiaCP mail server.

I added A records (mail and webmail) pointing to the ip of my Hetzner vps. The part i can’t figure out is the mx record. On my own domain, it points to mydomain.com that is pointing to the Hetzner ip address. But for his domain name, it’s pointing to another ip address where the website is hosted.

Can you help me please? Thanks in advance
PS Sorry if it’s not clear, english is not my native language…

Hi @mvez73,

For hisdomain.com you should add a MX record pointing to mail.hisdomain.com and the A record for webmail.hisdomain.com and mail.hisdomain.com should point to the ip of your Hestia server (seems you already did it).

Remember, you should not proxy mail.hisdomain.com in Cloudflare

1 Like

Thanks for your answer. mx record pointing to mail.hisdomain.com is working.
But mail and webmail are not pointing to his domain but to the ip of my mail server. Since both his website and my mail server are not host at the same place.

You need to change the DNS records in Cloudflarefrom mail.hisdomain.com to your server ip.

Thank you very much for your help. Incoming emails are working and even outgoing on port 25 is working now. I asked to Hetzner to unblock port 25 and i successfully set up everything on Cloudflare.

1 Like