There's alot that goes into a mail server stack, but it's no more complicated than k8s or other stacks these days. My preferred setup is rspamd/postfix/dovecot/roundcube. The docs are good and the mailing lists are active & archived for easy searching
For a pre-packaged mailserver environment, take a look at mailcow or mailinabox
https://mailcow.email
https://mailinabox.email/
There's a variety of ansible/chef/puppet up on github that can also be used to setup the invididual component