Thank you for your suggestions. When I find some time I will try some of the alternatives. https://www.iredmail.org/ is definitely in my list.

I also agree that a simple solution (postfix, dovecot and maybe a webmail interface) might be easier than bloated solutions that try to offer everything. As you say, the key here is: "depending on your needs". What might be good for a big company, maybe is not what I need (as a single person), or what a small organization needs.

However, building a mail server manually is not a simple task, even if you find some instructions or tutorials on the internet. Tutorials tend to get old and outdated, and they almost never cover exactly what you need. Using some scripts or recipes might be better, for example bash scripts, or ansible, or Docker, etc.

I built a mail server myself a few years ago. My goal was to make it as minimal as possible, just for sending emails/notifications from trusted applications. I wrote some scripts to make its build repeatable, and the corresponding instructions are here: https://docker-scripts.gitlab.io/simple-smtp-server.html
It has just postfix, no dovecot or webmail interface, because it has no local accounts, and it does not store any emails.
Building such a server was not easy at all, trying to make it safe and secure, so that it cannot be abused by spammers, etc. I still don't understand properly all the postfix settings and configurations that I have used. If I did not script it, I am not sure whether I would be able to do it again.

This SMTP server is very minimal and cannot be used as a personal mail server, so I tried to extend it later so that it has some virtual accounts, with LDAP authentication. So, if you add some username/password on a LDAP directory with a certain schema, the postfix will go and check there for authenticating users. This authentication is needed when a user tries to send email from this SMTP server. When emails arrive for a certain account, they are forwarded to another email address of the user. For example if you send email to info@fs.al it will be forwarded to dashohoxha@gmail.com . Again no emails are stored locally, so no need for dovecot, webmail, virus-checking, spam-checking, etc. In the example above, emails end up in Gmail inbox, so the check for virus and spam is done by Gmail.
This blog describes this setup: https://dashohoxha.fs.al/smtp-server-with-ldap-authentication/

But if you need to have a mail server that stores emails, with POP3, IMAP, webmail etc. the mail server above is not enough. I am listing here some of the possible solutions that I have identified. I may try some of them in the future and see which of them is simpler/better.

- https://mailinabox.email/guide.html
- https://github.com/modoboa/modoboa
- https://github.com/sovereign/sovereign
- https://poste.io/doc/
- https://github.com/Mailu/Mailu/
- https://github.com/docker-mailserver/docker-mailserver
- https://github.com/mailcow/mailcow-dockerized
- https://github.com/progmaticltd/homebox

Maybe there are some other possible solutions that I have missed.

Dashamir