Help setting up an email server with virtualmin

SYSTEM INFORMATION
OS type and version Debian Linux 12
Webmin version 2.101
Virtualmin version 7.8.2

Hi all, apologies if this is a dim question but for the past few days I have been trying to get this to work unsuccessfully.

I have a residential connection and are hoping to setup my own cloud here at home. I understand my biggest issue is my dynamic IP address but I have solved that by using cloudflare and updating my dns records whenever my ip changes so please dont comment saying its impossible because of my dynamic IP (ive heard plenty of those remarks before, theres always a way if your willing enough). I would like to setup a seperate email and website server for multiple domains but have ran into odd issues wheneve I tried in the past few days.

Take for example goodsite.com, currently the DNS records are:

A goodsite.com web-server-IP
A mail.goodsite.com email-server-IP
MX mail.goodsite.com

My first question is regarding the email server. Since my mail server running virtualmin is only to serve mail.goodsite.com do I setup a virtual server on it with the domain mail.goodsite.com or goodsite.com and use it just for mail? When I setup a virtual server with the domain mail.goodsite.com all subsequent users email addresses were user@mail.goodsite.com and not user@goodsite.com.

Second question.
I want to use lets encrypt for SSL. I have port forwarded port 80,443,25,993,587. In order to get SSL encryption to work properly on both IMAP and SMTPS do I need to request a certificate for the above mentioned virtual server only or do I need to create a second virtualhost whose domain will be the hostname of the actual server and request a ssl certificate for that virtualhost and then set its certificate to be the default for all services on the server (the blue button on the SSL certificate page “set as default services certificate”? I havent been able to get IMAP to work properly, outlook never manages to connect it the imap server over SSL.

Also as a note I have checked the config files generated by apache and every virtualhost has the same name (the internal IP address of the server on my internal network) 192.168.1.23:80 & 192.168.1.23:443 Is this normal? It seems a bit odd to me but then again Im no expert. In addition I am accessing virtualmin via the servers internal IP address, I dont wish to port forward port 10000 as I would like to restrict access to webmin/virtualmin to be on my internal network. Is this a mistake?

Any help would be much appreciated. I understand that this question may a bit dim and the answer obvious however as mentioned before I am no expert in this and instead wish to learn. I have checked all the forums however I havent found a explanation for my questions. Virtualmin is greatly underrated and so there are no videos or helpful articles on youtube on how to setup servers and thats why I turn to this forum in search of help.

Thank you for taking the time to read this post.

Mail will be almost impossible to send/receive to most places. Maybe ALL if your provider blocks it.

I’m not sure but Let’s Encrypt might fail if the IP address changes.

Use goodsite.com and use enable/disable for the services you want.

So your requested for a lets encrypt Certificate worked ok?

Cloudflare, as far as I know, has no support for proxying mail protocols. So, Cloudflare hasn’t solved anything related to setting up a mail server.

Your primary problem is probably that the vast majority of residential internet providers do not allow port 25 traffic, either incoming or outgoing…and without port 25, you don’t have a mail server.

The solution I generally recommend for outgoing mail is to use an SMTP service like Amazon SES, Mailgun, Sendgrid, Mailjet, etc. There are many such services, and some have free tiers that would allow running an individual mail server with low volume for free. Some also support relaying incoming mail (through the submission port instead of SMTP), as well, which would solve the problem of no port 25 for incoming mail.

What is the benefit for you of having one server for email and one for websites?

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