I didn't plan on this, but it turns out that releasing my new book on running your own email server was SUPER TIMELY. #sysadmin

https://mwl.io/nonfiction/tools#ryoms

Sysadmin Tools – Michael W Lucas

@mwl Running port 25 behind a residential IP is an instant block. I have everything running like clockwork behind a mid-sized hosting provider, but I'm always looking to improve things.
@colin @mwl I run my own on a vps but I wonder if it would be too shitty to run it at home and keep the VPs as a proxy with socat services?
@a @mwl I was thinking the same thing, via Wireguard or whatever, but your idea might be better.
@colin @mwl Nonono I think witeguard is great, I just wonder if there are better solutions that a simple and lightweight socat on top of wireguard (I’m sure there must be I just don’t know the )

@colin @a @mwl My experience using RBLs was that I needed to run DNS lookups on the same IP as the mail server which is annoying with socks.

If you have IPv6 at home, you can get a dual stack VPS and use proxy arp to relocate its ipv4 address to the other end of a SIT tunnel (ipv4 over ipv6) terminating on your actual server.

I used to have a web server set up this way.

@a @mwl @colin I've been looking at this solution. My email VPS (running for longer than I can recall) is still priced much higher than most.

So I'm thinking about just doing a 1:1 NAT on a (cheaper) VPS and letting my home machine handle all the real work.

In my case, it's to ensure all my _data_ stays on my machines, yet accessible from anywhere on the net. (My corp. blocks my webmail, but not Google or Kolab... I want to be a full peer, dammit!)

@a @mwl @colin This is exactly what you want to do. And setup DANE for your domain, and outgoing DANE enforcement, so malicious party on the VPS side can't MITM you.
@dalias @mwl @colin I assume you have full control of the VPS . At least I di
@a @mwl @colin If the VPS isn't on your premises or locked in fail-closed tamper resistant enclosure at your colo, you don't have full control over it. Law enforcement can mandate hosting provider backdoor it, and there are plenty of cross-guest attacks in virtual hosting environments.
@dalias @mwl @colin true, but idk how DANE could alleviate those problems either.
@a @mwl @colin You don't run the mail server on the VPS, just proxy thru its IP. The TLS is terminated on your premises, so as always, if certificate is validated correctly (this is what you need DANE for; otherwise TLS on mail is opportunistic), MITM is impossible even if the attacker fully controls the VPS.
@dalias @mwl @colin I doubt the impossible words can be used here. I guess people with more evil imagination than me can think of ways to do so. Just a data point https://notes.valdikss.org.ru/jabber.ru-mitm/
Encrypted traffic interception on Hetzner and Linode targeting the largest Russian XMPP (Jabber) messaging service —

@a @mwl @colin That's exactly what I'm talking about. And with webpki, controlling the public IP lets attacker get forged certs unless you're using DNSSEC and CAA to forbid all but specific authorized cert issuance. But with DANE, control of the IP gets them nothing because the key is pinned.
@dalias @mwl @colin ...assuming you have full control of the DNS server I guess
@a @mwl @colin The DNS server doesn't have to be trusted either. Just the DS delegation records from the parent zone. If they're tampered with, that provides a paper trail of wrongdoing (compromised registrar).
@dalias @mwl @colin I guess I'll have to trust you on this one :-P I'm not an expert on security, but uttering words like "impossible" sound like a red flag to me. "Very hard"? sure though.

@a @mwl @colin Cryptographically impossible (assuming the cipher isn't broken which isn't a realistic threat).

Where compromises like the one you cited happen are by compromising one party in the cryptographic chain, not by breaking the crypto. With DANE the only parties who can potentially be compromised are your registrar, the TLD authority, and the DNS root.

@dalias @mwl @colin yeah of course, but it doesn't really matter, except for pedantic purposes.
@dalias @a @mwl I’m also “cheating” and using DANE to match the intermediate CA’s, not the public key of my cert. I should really fix that.
@colin @a @mwl Yep, it's much stronger matching your specific key. As well as resistant to downtime from intermediate cert switchover shenanigans.
@a @mwl @colin That's one of the awesome things about DNSSEC: it lets you host your authoritative DNS on cheap low trust infrastructure, only caring about availability not integrity.

@a @mwl @dalias Dang, I do use Linode.

On the bright side, yes, I have a Let’s Encrypt CA and DNSSEC/DANE, MTA-STS, CAA, and all the acronyms. I also edited the Postfix config files to require TLS for outbound connections to some servers that I know will never not support it, like Google, Microsoft, and a few others.

@colin @mwl @dalias I'm personally not super concerned about all that because: (a) sending emails means that someone will received and you still need to rely on their infra not to be breached (good luck with that) and (b) I use email mostly to receive messages and as an ID for a bunch of accounts mostly. If I want to share something more personal I would use other mechanism
@a @mwl @dalias And for me, (c) IMAP is great at syncing my inbox and a few older things I might need, but anything worth saving, I store offline in my Thunderbird local folders.
@a @mwl @colin I'm most concerned about email interception as a vector for account compromise through credential reset workflows. Otherwise indeed the value to attacker/risk to user is usually fairly low.
@a @mwl @colin This is a big part of why I made mxclient and hope it (or another implementation of same concept) eventually becomes the standard for credential reset workflows, login via email workflows, etc.
@a @mwl @colin that's exactly how I run things, extremely cheapo vps as an exit node basically, vpn all the traffic to my home server (had to do some port forwarding etc, but works well).
@Nux @mwl @colin do you have connectivity issues from home? tbh that is my biggest concern.
@a @mwl @colin Never noticed anything and you'll laugh, but my uplink at home is 5G.. so significantly higher latency than your usual broadband. However http and smtp are very forgiving of that.
Of course, you can only sustain so much upload, but if all you're hosting is some blogs and emails, then it's no problem at all. Even 5-10 Mbps is OK for me.
In fact I've just measured now on pingdom and my crappy 5G hosted static site beats the heck out of our $dayjob corporate wordpress one!
@Nux @mwl @colin I guess I could give it a try, but with an extra machine, not my current ones
@a @mwl @colin Ionos sells small VPSes for $2/m, that's what I use (in UK).
@Nux @mwl @colin thanks but I don’t want to risk changing my IP address
@Nux @mwl @colin well, it took me a couple of hours but it is working again. This is why I pay my subscription to the Fediverse®
@a @mwl @Nux Congratulations on defederating your email from the Google-Microsoft-Yahoo dominion!
@colin @mwl @Nux hahaha, thanks but I defederated years ago, I just moved my mail service to a machine at home instead of a VPS :-P