Mail storage and relay

Your question

I’ve managed Microsoft Exchange servers in the past but I’m not an email expert by any means. With that said.

I currently have my email setup on mxroute and my DNS records through cloudflare. I want to build a Docker based Stalwart server in my local network and use it for mail storage and collaboration. I want my Stalwart server to move any stored emails from MXroute to local mailboxes in Stalwart and relay outbound emails through Stalwart (user outbound) via MXroute.

Is this possible? If so will just googling “Stalwart setup” get me where I need to be?

info: I’m tossing around the idea of building some compact server infrastructure, mostly via Docker, for small businesses with Nextcloud, mikopbx, stalwart, etc…

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

Yes, mostly. Outbound is straightforward: create a relay route pointing at MXroute’s SMTP host with your MXroute credentials, then set the outbound strategy to send everything non-local through it. The docs have this as a recipe (“Send all outgoing mail through a smart host”): Strategies | Stalwart and Routing | Stalwart.

Inbound is where you need to decide. Stalwart doesn’t pull mail from another provider on a schedule the way fetchmail does, so if mail keeps arriving at MXroute, it stays there. For Stalwart to receive new mail, it has to become the MX, which means port 25 reachable from the internet on your LAN box (many residential connections block it, see System Requirements | Stalwart). The existing mail is a separate job: Vandelay can copy it from MXroute over IMAP and then load it into Stalwart, and you can rerun it to pick up new messages before you switch MX (IMAP | Stalwart).

I’d skip googling and start from Docker | Stalwart, then the migration overview at Overview | Stalwart.

Thank you for the reply.

I’m behind a Starlink dish and cannot forward IPV4 ports from the public IP so forwarding port 25 cannot be done. Starlink does a form of nat for their customers.