There are a number of discussions on the web about self (or more accurately not self) hosting your own mail server. The main reason is that the configuration issues are considerable.
The task has got more difficult over recent years due ostensibly to increasing spam and phishing attacks and the responses of the major email providers in countering these activities. The fact that their actions makes it more difficult to host your own mail server, and hence more likely to use on of their services, is merely “co-incidental”. Even if one resolves all the issues it can be difficult or near impossible to have one’s mail accepted by the major providers.
Docker containers reduce the administrative burden considerably although the challenges of correctly setting up DNS records and getting your outgoing mail accepted remain. Mailcow is a suite of containers designed to address these first two issues and is reasonably straight forward to instantiate. Mailcow also makes it easy to send your mail through one of several commercial relay providers like mailgun and sendgrid. Using these services will occur a charge if the volume of mail exceeds the upper limits of their free accounts but will almost certainly get your mail through to your recipients even if there are DNS errors.
Docker Mail Server (DMS) is an alternative. It is CLI only but requires half the RAM of mailcow. This may be an issue in cloud environments and consideration should be given to creating a swap file for the VM. Configuration is a little more difficult but it can be progressively fine tuned with web tools like mail-tester.
Light weight docker mail server alternatives may be useful in certain configurations but these have not been explored to date.