I have been selfhosting my email stack on a cheap VPS (~ $10) for many years now, probably since 2009 or so. I used to set up everything manually, but that was quite painful and there were some rough edges.
Nowadays, I just use mailcow (https://github.com/mailcow/mailcow-dockerized) for the setup part and have a much more polished experience. Email deliverability is not a problem. Generally, you just have to make sure to correctly setup DKIM/SPF (and DMARC) and check if your IP is on some blacklist. You can get it removed easily. (Edit: Also required is forward-confirmed reverse DNS, see below).
There was one provider that denied incoming mails from me, even though I got the IP removed from every blacklist I could find. I wrote a short mail to the admin contact and got told I had to host a web page with contact information on the same IP. Since being whitelisted there, everything works like a charm, couldn't be happier.
> I wrote a short mail to the admin contact and got told I had to host a web page with contact information on the same IP.
Interesting. Was that just to prove to that particular provider that you, the emailer, own the domain? Or is it some more widely used (beyond that provider) practice?
Afaik, it is specific to this provider. I'm not entirely sure why exactly tbh, probably to require some kind of associated identity (the policy is likely targeted to larger providers). It was a manual process and I never had to do anything similar for a different one.
They require that
a) the sending IP address has a PTR record
b) from a domain that you own
c) that resolves to the same IP address.
They furthermore recommend
d) that your host name should clearly mark it as a mail server and
e) to make sure the domain leads to a web page that contains provider details and contact information.
When I hosted my own mail I did all of that except (e). I had trouble, as seems to be typical, with deliverability to Microsoft-hosted addresses. I wonder if (e) would have helped (doubt it).
Nowadays, I just use mailcow (https://github.com/mailcow/mailcow-dockerized) for the setup part and have a much more polished experience. Email deliverability is not a problem. Generally, you just have to make sure to correctly setup DKIM/SPF (and DMARC) and check if your IP is on some blacklist. You can get it removed easily. (Edit: Also required is forward-confirmed reverse DNS, see below).
There was one provider that denied incoming mails from me, even though I got the IP removed from every blacklist I could find. I wrote a short mail to the admin contact and got told I had to host a web page with contact information on the same IP. Since being whitelisted there, everything works like a charm, couldn't be happier.