Virtualmin as email server only

Hello,
I’m hosting multiple static sites on google firebase.
I want to add them all to Virtualmin ( about 50 of them) and create email addresses for them.
So right now my A record is pointing to google servers.
And I have no clue how to point just email without pointing the entire website to Virtualmin and create email addresses for all of my users.

Thank’s in advance.

Ubuntu
20.04

Read up on MX records. You’ll need an A record for the mail server (usually mail.domainname.tld) and an MX record pointing to it. That will cover the receiving side of things.

Configuring it for your clients to retrieve mail will be a little trickier as Virtualmin won’t be able to get your TLS certificates for you, since it isn’t managing web or DNS. You’ll have to do that manually.

Thanks for your quick response, Joe.
So I was doing this before I posted on this forum.
The main problem is I can only create mails like this

user@MAIL.example.com

instead of

user@example.com

Any idea how to resolve this?
Also is it any chance to install mail in this sub-domain?
So my users will have access to Roundcube on:
mail example com
instead of mail example com 20000
As a new user, I can only post two links in one post.

Make a domain called example.com instead of mail.example.com.

I did as Joe’s suggested, unfortunately, that didn’t solve my problem at all.
I’m getting Error 502.


that’s my current configuration.

Actually I’m getting either 502 error or it’s redirecting me to Virtalmin ,Under construction" site.
When I’m trying to disable Nginx server in Virtualmin config I’m getting this error.

Failed to modify server : An SSL website cannot be enabled unless a regular website is

Anyone have a problem like this before?

I think you should create a A record only on your Virtualmin server and forget the Google website. Then you can create a CNAME for www that will point the real ggole name of your webserver

example.com. IN A 34.12...
mail.example.com. IN A 34.12...

example.com. IN MX 5 mail.example.com.

www.example.com. IN CNAME yourstaticsite.google.realhostname.

If you want example.com to serve the same site, you could make a website redirect to www in Virtualmin. In that case you need to have a webserver for this domain in your Virtualmin server but it will only manage the redirection.

Another solution is to keep all DNS info on the Google side and add there information about your new mailserver

example.com. IN MX 5 my.virtualmin.host.

This should allow you to manage mail in your virtualmin server.