Never.... never try to run your own email server.
It's one of those things that is VERY complicated to set up properly in the first place and then needs constant maintenance.
It's one of those things that is VERY complicated to set up properly in the first place and then needs constant maintenance.
However, if you MUST, I would consider Mailcow, which is a Docker-based mail server. It's all the usual suspects and a nice web interface all wrapped up by docker-compose. But you'll still regret it 
Check that your ISP (or wherever you want to host it) won't block you before you even start.