Hosting your email server is not for the faint of heart. While the e-mail is one of the most ancient internet protocols, like DNS, it has been integrated with many pieces and bit over the decades to evolve it to an usable state today.
E-Mail has tons of issues, like spam, abuse and plain brute-force attacks on top of no default encryption and limited overall security. To address most of these issues over the years new protocols and standards emerged, like DKIM, DMARC and so on. The basic SMTP has been integrated with TLS/SSL to provide wire encryption, and the ancient POP3 is nowadays replaced by IMAP and even JMAP.
Hosting an email server is not a simple task. Historically it was a matter of setting up tools like Postfix, Dovecot, OpenDKIM, OpenDMARC, spamassassin, interface them properly and fine tune a bunch of settings using decade old syntax and overall pretty hard. Add that you also had to understand and setup various DNS entries and deal with stuff like blacklists…
Today there are a few all-in-one solutions that greatly help you with the process and make the overall task quite enjoyable, but still hard.
The one i choose is Stalwart Mail Server, because it's an all in one modern solution, probably the most promising new approach in town for email hosting.
Another option is mailcow which is a ready made containerized solution encompassing all the above tools. While it's indeed a great tool, i find it a bit too heavy for my needs.
Simply put do not self-host an email server on your home server. An email server must have a public IP address and tunnels like wireguard or any kind of port-forwarding will not work.
Let me stress that again: you must host your email on a server with a public IP - do not put it behind a port forward or a tunnel.
The reasons are quite a lot, and all critical:
Probably not, since there are lots of email providers out there that for a little money will let you use them to host email for your domain. But is it fun? Yes, so, let's go and do it.