There are plenty of really well written articles out there for a simple google search. If you’re looking for a good one in particular, there’s blog.obtusenet.com which details how to build a secure email server with OpenBSD. However, your problem won’t be with being able to receive mail but send it such that it won’t go to others’ junk email folders. Even if you take every precaution like DKIM, SPF, and DMARC, all it takes is some asshole using a server with an IP address on the same subnet and some email providers will just send everything being sent from the subnet to spam. It’s just not worth it anymore to be your own email provider. This a point of contention with me because internet services are supposed to be decentralized and there is entirely too much power given to the two largest email providing entities, Microsoft and Google. But that’s a different discussion altogether.
There are plenty of really well written articles out there for a simple google search. If you’re looking for a good one in particular, there’s blog.obtusenet.com which details how to build a secure email server with OpenBSD. However, your problem won’t be with being able to receive mail but send it such that it won’t go to others’ junk email folders. Even if you take every precaution like DKIM, SPF, and DMARC, all it takes is some asshole using a server with an IP address on the same subnet and some email providers will just send everything being sent from the subnet to spam. It’s just not worth it anymore to be your own email provider. This a point of contention with me because internet services are supposed to be decentralized and there is entirely too much power given to the two largest email providing entities, Microsoft and Google. But that’s a different discussion altogether.