Of course, this is not 100% reliable, as it's not too difficult for spammers to adapt and improve their scripts. Of course, vast majority of spammers are either not sophisticated enough, or do not care enough to do so, so if you don't mind your incoming mail to be slightly delayed, it's kind of a low-hanging fruit, as it cuts off a huge amount of low-effort spammers.
blackhole IN A 240.0.0.1
@ MX 10 blackhole.example.com
@ MX 20 mail.example.comDoing it this way doesn't even delay mail much most of the time; many legitimate MTAs connect immediately to the priority-20 MX after failing to connect to the priority-10 one.
So a easy way to get started is to receive everything directly and use a commercial (often with low-volume free tier service) relay for outbound until you get comfortable enough to remove the training wheels. (Or never remove them, that's a legit choice as well.)
> filtering out the spam (and only the spam) from your inbound email is harder.
I don't find that at all. Filtering spam is the easiest part. All I do is if SPF doesn't match, goes to spam folder. Beyond that, apply a bayesian filter.
I get no false positives and the spam that gets through to my inbox can be counted on one hand per quarter. Basically none.
That's yet another benefit of self hosting, since my bayesian filter is trained on my personal email specifically, it tends to become very good. Unlike generic gmail filters for example, where there'll always be some mail that ends up in spam no matter how many hundreds of times you mark it not-spam.
I have Bayesian filtering behind DMARC checks and a few other DNS and RBL checks. Still not perfect -- for all folk talk of the difficulties getting mail accepted by the big providers, a surprising number of companies still don't have matching forward and reverse DNS records :P.
One principle I follow is that I don't drop anything. Every message will either be rejected or delivered, with a narrow band of SpamAssassin scores that delivers to a spam folder.
I think it's also fair to say that personal mail for a small domain is much easier than even a small amount of transactional email and don't even try sending newsletters beyond your friend group.
I have run mail off three different IPs over the ~20 years I've been hosting, switching IP address didn't affect me all that much.
Another thing to note is that receiving mail is really easy. Sending it is hard, filtering out the spam (and only the spam) from your inbound email is harder.