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
@colin @mwl surely the issue is trying to use a dynamic IP? I have a fixed IP allocated by my ISP for my on-premises mail server but I suspect most other fixed IP users are Small Office so I get a pass.
@colin @mwl I'm not sure what you mean by instant block, but you can proxy port 25 thru a $3 VPS if needed, and not even lose any cryptographic integrity as long as you're using DANE.

@mwl The best thing about RYOMS is that it allows you to own the means of production.

I have need for privacy and autonomy that's likely edging towards pathological. RMOMS satisfies that need for at least my most frequent use case.

Now I just need my own Fedi instance, and maybe a caching web proxy with automation to keep my favorite sites updated. (Plus some junk sites to widen the bell curve for data brokers.)

@mwl I don't know many others who run their own to ask this. Can you get away with IPv6 only for outgoing SMTP now? Like a Pi with @beasts ...
Is there a tool I can feed my current IPv4 outgoing log too that will tell me if each domain has IPv6 MX ?

@mwl
It's very appropriate that the cover looks like the Linux mascot fighting a war in hell

(Yes yes I know but still)

@dymaxion @mwl To me, they look strongly like the aliens in Galaxy Quest.
@mwl this cover 😭
Run Your Own Mail Server or All Quiet on the SMTP Front
@mwl
Don't see it mentioned on the book blurb and i gotta ask after seeing your other books: Is the book setup/instructions based on Linux or a BSD? Or is it OS agnostic?

@jherazob @mwl Largely software agnostic, and essentially OS agnostic (you could do this on any OSS stack without needing to seriously considering buying a different book).

It uses Postfix, Dovecot, rspamd and a few others, but the author takes painstaking care to explain WHAT needs to be done, then gives examples in HOW to do this in the given software, but also isn't afraid to say things like "You'll need to spend some time familiarizing yourself with rspamd to be successful -- here's how I do that. Go do that so you can do X, Y, or Z as appropriate for your situation."

You should have limited difficulty replicating this in comparable software, though it will be more straightforward of course if you make the same choices.

@jherazob reference platforms are Debian and FreeBSD, that's why Tux is on the cover. 
@mwl
Excellent! Bought 👍
@mwl the marketing genius in your head somehow knew to plan a decade ahead with all those other tech books that are needed to set up and maintain a server and network... 
@mwl irrefutable proof that Seat of Your Pants'ing things CAN work out for the best.
@mwl
If you planned all these events to promote your book, you went a bit too far imo.
@mwl I have longed for the days when people would wake up, smell the coffee, and realize that "the cloud" may not be the best idea, especially for your email, and especially with Microsoft - who has never, ever, practiced sensible security practices, ever.
@mwl

Been running my own mail server since late 1995 (so, coming up on three decades, now). Up until about 5 years ago, it was fairly straight-forward. Then started getting blocked by 900lb gorillas like Google and Microsoft because my MTA wasn't trustworthy (nevermind that I adopted SPF, DKIM, DMARC and other anti-spam measures while they were still beta or advisory-only features). Now I'm stuck having to relay everything through freaking SES (or equivalent) if I don't want bounce DSNs every time I or one of my family members tries to send messages to someone whose mailbox is hosted through O365 or gSuite.
@mwl Pardon, but why should I put 15€/$ on your desk, when all informations for an one MX is free available on a WIKI?
@Dj4n90 you go right ahead and do that. Have fun.
@mwl I've been running my own MX for 20 years and in my office. 😎
@mwl ... and yes I have a lot of fun ...
@mwl TIL BIMI="Brand Indicators for Message Identification" and my mail server is from 2018