Mail server on a separate VM

Hi,

I have a primary VM (VPS) with Virtualmin and would like to move the “mail server” to another VM.
Is it possible to manage these two VMs from one Virtualmin UI? When I create a new webhosting in virtualmin, does virtualmin create “mail stuff” on a VM with a mail server?
Or what are the options for my situation?

Thanks.

I am not quite sure of your reasoning here. Your VM has Virtualmin on it?
Consider this as capable of receiving/sending email for a domain (using PostFix)
And running a webserver (Apache or nginx) to provide a website
These are independent of each other. based on the same DNS

Of course you could set up another VM based on a different IP (say at a different location) then change the DNS to point your mx record at that IP but I cannot quite see why. the 1st VM is perfectly capable of managing both (or even just mail) (or just the webserver without mail)

I think it is also perfectly possible to set it up with an external mail provider (but have not found the need to do that)

There are a variety of ways to outsource some mail functions. But, in the general case, the simplest is to host mail on the Virtualmin server itself (possibly outsourcing sending to a relay, whether one you control or a service like Mailgun, Amazon SES, or whatever).

The complexity in completely moving it to another server comes from the user management. Virtualmin users (both domain owners and mailbox users) are system users. If you wan those users to be distributed, you have to setup some sort of directory system. Virtualmin supports LDAP for that (and with some extra work most other options supported by PAM), but it’s a lot of extra work for questionable value.

What’s the actual problem you’re trying to solve by moving mail off to another server? If it’s the performance impact of AV scanning, you can put that on a forwarding relay that does all your spam/AV scanning before delivery to the Virtualmin server (Cloudmin Services supports this in a pretty simple/automatic way, but it can be done without any Cloudmin Pro version).

The reason is only to separate the mail server from other services.
For example. If I need (for any reason) to restart the server (where virtualmin is), I want the mail server to still be available.

For now, I’m just analyzing and finding information about what will be possible with Virtualmin.

Still possible in one Virtualmin box (remember they are independent) you can stop the mailserver by stopping Postfix you stop the website by stopping (Apache or nginx)

Your only problem is when you reboot the box (in that case you may well need 2 boxes VM)

the mail server will likely need a reboot at the same time ( assuming the same os & version ), I have a small server which just runs bind & a pptp server and to be fair that’s well overdue for a reboot.

you will have to keep a very close eye on package updates. it is not obvious but some trigger a reboot request. there have been some overnight that have done that.

The reboot request only ever means the kernel has been updated.

Everything else can be updated with just a service restart (and usually happens automatically on update). Don’t avoid updates just because some might request a reboot. On server VMs, rather than desktop machines that might have akmod/dkms modules that have to rebuild on updates, you can plan to reboot whenever is convenient, unless it’s a security update.

Virtualmin reboots quite quickly. The slowest part is Fail2ban saving all the banned IPs so it can restore them after the reboot. If I have a lot of IPs blocked (check status) I then stop Fail2ban first, then reboot.

This would depend on your OS and if you are running on SSD etc.

I just rebooted my production server due to RHEL glibc updates which required a reboot.

After stopping fail2ban, the reboot took about 20 seconds.

these days 20 seconds could be alot of potential customers lost → if a website I was visiting took 20 seconds to load I’d be already buying at a competitor’s site.

Has any of your customers complain about a 20 second outage, come on. Every hosting say 99% uptime, why, reboots and network outages.
Getting a bit off topic.

So how do you get around OS kernel related updates that require a reboot, or can you reboot in just a couple of seconds?

I’m doing the same one VM have my website and other VM have my mail server setup cause first VM has blocked port 25 so i can send email from that server

But make sure you point your mail server correclty and add all required records, if you have two IP address you can add both the IP in spf record like

v=spf1 a mx a:domain.in ip4:10.157.330.76 ip4:90.152.65.927 ?all

and you can also add multiple DKIM but i suggest to add mail server VM DKIM

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