Mail Server Basics: Handling

At some point, I want to get rid of GSuite for email, and I am trying to learn the basics of email administration.

I have a VPS that I use for my webserver to host about a dozen sites.

I want to set up another VPS to serve as an email server. Since it will handle email for multiple domains, I THINK I want to use Virtualmin and just close the ports I don’t need, and maybe turn off some services to reduce overhead.

What I don’t understand is how to configure the server to handle email for my domain.

url.com is hosted on my webserver - w.x.y.z.

mail.url.com is my email server a.b.c.d.

I made an A record mail.url.com ==> a.b.c.d
and an MX record @ ==> mail.url.com

By default, it looks like Virtualmin wants to handle email as users@mail.url.com, when in fact I need it to handle mail for users@url.com.

I tried to RTFM, but I’m not even sure what to look for…

Can somebody point me in the right direction?

Incorrect. Virtualmin will, of course, handle mail for user@domain.tld by default.

Only if you twist its arm and threaten to harm its family could Virtualmin be persuaded to handle mail for user@mail.domain.tld

1 Like

Maybe I’m playing off a different sheet of music here…

I,hypothetically, have two separate VPSes (both have Virtualmin installed).

One of them is my Webserver and the other is my Email server.

My webserver hosts my website - myawesomewebsite.com

I need my email server to handle the email as users@myawesomewebsite.com.

This seems straightforward if Web and Email are both handled by the same VPS, but I’m lost as to how to accomplish this with them on two different VPS’s.

domain.tld points to IP address of web optimized Virtualmin
www.domain.tld points to IP address of web optimized Virtualmin
mail.domain.tld points to IP address of mail optimized Virtualmin

And this is the most important thing to wrap yoor head around: on mail optimised Virtualmin as well as on web optimised Virtualmin, create a virtual server for domain.tld (yes! Same domain name on both Virtualmins).

Then everything will work perfectly. When creating a virtual server on mail optimised Virtualmin, uncheck the boxes for web services and vice versa.

Oh, if you manually configure the DNS record of the web optimised Virtualmin to point to the MX of the mail optimised Virtualmin, you will attain nirvana forthwith.

1 Like

oguruma,

I can assist you in getting your mail server setup correctly. Drop me a line if you’d like to setup a session.

Best Regards,
Peter Knowles | TPN Solutions
pknowles@tpnsolutions.com

I’ve spun this up with an unused domain I own, just to play with it.

A record mail.url.com points to w.x.y.z (mail server).

url.com and www.url.com point to a.b.c.d (web server).

MX record checker indicates that MX record for @url.com points to mail.url.com.

I created a user test@url.com on the mail server, but Thunderbird cannot validate that user.

What am I likely doing wrong?

Is thunderbird configured to use the hostname of the mail optimized server as the incoming server and outgoing server of the domain?

You could also test if mail is working normally on the mail optimized Virtualmin server by using Virtualmin’s webmail instead of Thunderbird. That would simplify the testing.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.