Two Virtualmin Installations One Email Server

I have a quick question regarding running more than one Virtualmin pro installation on two different physical machines behind one router and static I.P.

If I am running Virtualmin on two separate machines but want to be able to send email from both installations, how would I go about routing the emails of one server through the other (due to only one WAN connection through router ports)
Operating system: Linux
OS version: Ubuntu 20.04 LTS


Welcome to the Virtualmin community!

The problem will not be “sending”, as you could send from any number of machines behind your router, the problem will actually be “receiving” email to the delegated server that managed that domain and email addresses.

It might be best to setup one server as an “email server”, and the other as a “web server”. This way you could route all traffic destined for port 25, 110, 143 (email ports) to the “email server” using port forwarding… Then setup traffic destined for 80, 443 (http/https) to the “web server” server.

*** web server would also host databases, and possibly dns records ***

I’ve done lots of advanced cluster designs for customers over the years, and actually even more recently for fellow Virtualmin community members.

If you’d like to contract me to assist you, i can provide the assistance for an affordable “Virtualmin Exclusive” rate. Drop me a line if you want to discuss further.

Best Regards,
Peter Knowles | TPN Solutions

Professional, Affordable Technical Support – Request Assistance at

Well, Virtualmin supports routing the emails of one server through the other.

Terms used:
Downstream server: the Virtualmin server which depends on the other server to deliver mail
Upstream server: the Virtualmin server through which mail will be delivered to the rest of the net (aka mail gateway / mail relay / smtp relay host / smarthost)

On the downstream server, specify the IP address of the upstream server at Webmin → Servers → Postfix Mail Server → SMTP Authentication And Encryption: Send outgoing mail via host

That’s all there is to it. All mail for external users will now be sent out via the upstream server.

Note that you will also have to configure the upstream server to accept mail for relaying from the downstream server - the default is to reject mail. To configure the upstream server to accept mail for relay from the downstream server, specify the IP address of the downstream server in Webmin → Servers → Postfix Mail Server → SMTP Server Options: Restrict mail relaying (or is it Webmin → Servers → Postfix Mail Server → Genral options: local networks, please test both)

Finally, you will have to edit the SPF and DKIM records of the domains which will send email via the upstream server (basically all domains / virtual servers hosted on the downstream server) so that the rest of the net knows that the upstream server is authorized to send email for the downstream server.

It is not as difficult as it looks in text; and SPF + DKIM can be automated.

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