Email relay server for virtualmin server

OS type and version REQUIRED
Webmin version REQUIRED
Virtualmin version REQUIRED
Related packages SUGGESTED

Hello good people,
We have a bit of a strange problem that we were hoping someone here could help us with.

We provide basic website and email hosting for micro businesses. We have a Virtualmin server which hosts about 30 clients, each with their own domain.
The server is self hosted and behind a firewall, which does NAT and port forwarding.
We make use of DDNS with a dynamic IP address for the public IP, which works perfectly for us except that we dont have a reverse-IP lookup.
Unfortunately this means many legitimate emails end up being marked as spam.

To resolve this issue, we thought of using our dedicated email server, which is hosted at an international ISP, as an smtp relay for sending emails from the virtualmin server.

How would we set up the Virtualmin server to relay to the main server?
What would need to be set up on the main email server to accept and relay these emails?
Would this solve the reverse-ip lookup problem?

In case anyone thinks we are gonna be spamming etc…
Our clients are mostly very small businesses or community interest groups, who cannot afford big monthly costs.
Our virualmin server is hosted in Africa, where internet bandwidth is extremely expensive, which is why we are using self hosting with DDNS. (The same bandwidth with a fixed IP is 10x more expensive, as is ISP hosting).
Very congested international bandwidth means hosting websites in Europe or USA is a no go, as the performance is horrible for local users.
Email (together with Whatsapp) is still the most commly used way to keep subscribers up to date with local events
Some mailing lists can get quite big (one already has 50k subscribers) so using the free smtp relays isnt really an option for them.

The relayhost Postfix option is what you’re after. You may need to also configure authentication, or you may be able to just allow specific domains from a specific IP on the remote server. That’s something that will be specific to your deployment.

Probably mynetworks if the other server is also running Postfix. Again, very specific to your deployment. You may also opt to use authentication or some other sender restrictions.

Assuming your relaying server has a functional PTR and that PTR record resolves back to the same IP. You’ll also want to include that relay server in your SPF record. DKIM signing happens on the origin server, so that probably doesn’t need anything extra.

Thanks so much for this response,
Will get the setup started with a test main and relay server.
The relay server already has PTR records, but I didn’t think of amending the SPF to include the relay server.
I will post an update once we have tested…all things going well :slight_smile:
Hopefully it will help someone else who has the same challenges.

One solution could be to set up the Virtualmin server to relay to the dedicated email server, hosted at an international ISP, for sending emails. This would require configuring the Virtualmin server to use the dedicated email server as an SMTP relay and setting up the necessary settings on the email server to accept and relay these emails. This could potentially solve the reverse-IP lookup problem and prevent legitimate emails from being marked as spam.