C
C
ChikiHh2022-04-05 14:25:41
Mail server
ChikiHh, 2022-04-05 14:25:41

How to set up a mail gateway on a VPS and still store mail on your hardware?

Greetings to everyone, I have a server (so far, home, HomeLab, so to speak) and a purchased domain in the .ru zone, I want to configure the mail server so that the mail itself is stored on the home server, but at the same time, the home ip-shnik did not shine anywhere (I plan to deploy mailcow dockerized ), and the gateway for incoming and outgoing mail was on a rented VPS (I plan to use Proxmox Mail Gateway). Do I understand correctly that in order to organize such a scheme, I need to set up a VPN (for example, OpenVPN between the VPS and the home server), make a relay to the home mail server, configure DNS records (MX, PTR, DKIM, SPF) so that they all point to ip gateway (VPS) and set up a proxy for the web mail muzzle from the VPS to the home server? Is this the best option or do I need to do something differently? Another moment, is it true that with such a scheme, if, for example, the home mail server goes down for some reason or the internet is turned off, will PMG hold all the letters that were sent and they will come in any case when the main mail server becomes available? To begin with, I want to try out this scheme in HomeLab, then do something similar for a small organization. I will be glad to advice.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2022-04-06
@CityCat4

The scheme is basically working, but for completeness, you need to send it directly through the VPS, otherwise the email header will still contain the full path. That is, read mail from one server, and send it through another.

M
Mnemonic0, 2022-04-06
@Mnemonic0

And you can not configure vpn. You open NAT houses to your server, melt the relay from / to it on the VPS. On the home router, configure ACL on the 25th port only from the VPS IP-shnik. If you need a little security, fasten tls and you will be happy.
In fact, the home IP will only be visible to the mail relay VPS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question