Open source home e-mail server

Hello, as others have advised against running your own server, and all for good reasons, I am sure you have your reasons of why it is right for you. To give you a frame of reference, although I have not run any email servers on a PI, I have been running my own for decades, up until mid 2020 where I have shut them all down and moved to other services, such as protonmail and other mail only hosted solutions.

With that said, I would suggest you not try to roll your own setup, but use a project such as

https://mailinabox.email/  

What is it?
Mail-in-a-Box lets you become your own mail service provider in a few easy steps. It’s sort of like making your own gmail, but one you control from top to bottom.
Technically, Mail-in-a-Box turns a fresh cloud computer into a working mail server. But you don’t need to be a technology expert to set it up.`

Please take the time to read about the project lead and the concepts behind the project.
Joshua Tauberer (@JoshData) began this project in 2013 and is the primary maintainer.

To be sure, you may have problems with using your Home service IP as an email service endpoint, but maybe you have already taken that into consideration and can control/configure it properly.

If not, I would suggest you have a look at The Helm. I have not used the project, but, they take care of WHERE your data is stored and more importantly, Clean usable IPs.

https://www.thehelm.com/
Privacy matters,
own your data.

Protect your life online
Take back ownership of your most important data like your files, photos, emails, browsing activity and more. Helm’s suite of privacy-first services protect and secure your online life.

Good luck, I would be interested to hear what you end up doing.

Best, Paul