• don't use an IP range classified as "consumer" (known dynamic IP DSL/cable ranges)
• set up SPF
• set up DKIM
• don't send actual spam
…it generally gets through. Mox is so far the easiest solution for SPF/DKIM I've seen, but if you don't mind spending a weekend tinkering, it should be solveable with any email stack.
> In some cases, websites weren't even allowing email registration with a self-hosted email.
I never ran into that issue. Not much you can do there, other than writing the owner angry emails via gmail.
People mostly expect email to be fully reliable. It’s not, but that doesn’t stop people treating it like that. As a result, even if you only fail to deliver 1 in 1000 emails, that could have significant consequences. Gmail et. al have a high enough deliverability rate that most people can get away with treating it as reliable.
I’m not saying people shouldn’t self host, but I think they need to be very aware of how it will change their trust of email.
IMO, what needs to happen is for people to see the 1 in 1000 as a problem with Gmail et al. rather than a problem with someone hosting their own STMP server.
Generally speaking, people I know who self-host their email do not have problems. However, inevitably there is the 1 in 1000. IMO, unreached recipients using Gmail et al. are likely to see the problem as with the self-hosted sender, not their own third party email provider.
One idea is to have a backup for emergencies. That is, a Gmail user could have an alternative, self-hosted means of receiving email on port 587 or 2525. By default, this mail drop accepts mail from no one. When there's a 1 in 1000 problem, the recipient could add the sender to a list of acceptable senders, either temporaily or permanently. The sender can then use the alternative instead of Gmail.
• Gmail marked an email as spam, but still delivered it. Easily cleared up, no hard feelings on either side.
• Someone else self-hosts some abysmally maintained Exchange 2003 setup that just about barely works with GMail and Office365, after the MSP irresponsible for it gets enough verbal beatings. Impossible to get to work.
And with the amount of genuine spam being sent FROM GMAIL to my backup gmail address, it's unthinkable to actually check through the spam folder with any regularity.
How can you tell if the IP you use is or has been in one of those ranges?
You should know because it is currently blocked - found by using mxtoolbox.com for example.
Or, suspect it will be because the ip to your residence is not a designated static ip. (In practice it may be ipv6 and never changes but applying a PTR to the ip requires assistance from the ISP and it would likely be outside of the contract.)
I've seen that once or twice, but it was because my self-hosted is on a .one domain. There are (not surprisingly) a few organisations out there that validate against the old set of top-level domains (.com, .net, etc, and the country codes). They just won't accept any of the new top-levels as real!!
The easiest way to solve this if you aren't as lucky as I am, is unfortunately not a free solution: send via a 3rd party relay such as companies like mxroute offer – you still control your entire mail server, your store all the mail, etc, but someone else deals with final delivery of outgoing mail (a good provider will multiple outgoing feeds themselves and deal with resending in response to some types of rejection, as well as making sure all their outgoing routes are reputation clean). For small volumes this is actually quite cheap, potentially far less expensive than your admin time dealing with delivery failures yourself.
Other common issues are not having SPF records set properly, or not implementing DKIM signing. Both of these are now essential and have been for some time, whether you send directly or via a 3rd party MTA, so if you didn't verify those that could be your issue.
Also, some mail receivers don't trust brand-new domains (the newest domain my main mail server regularly sends for was registered in 2010) so if you tested the mail server with a throwaway domain that could be a significant part of the problem. If you want to use a throwaway domain for testing, at very least wait until after the 5-day “domain tasting” grace period. Also pick a throwaway domain name that is relatively long and otherwise unlikely to have been used before (and unlikely to have ever been used as a from address in junk messages).
And make sure all the DNS config is set correctly. Mox helps you with that.
I've done a few mox quickstarts at fresh VM's, and mail was accepted by gmail just fine.
On google I found that one can get a IPv4 /30 subnet for about 11 USD a year.
But for IPv4, true BYOIP isn't really possible for less than a /24 block, which is overkill for just selfhosting personal email.
It also usually involves needing to set up a company to own/lease the block if you haven't already got one.