For anyone with multiple domains, multiple senders, sending email programmatically, or simply with the knowledge and patience to do so - I recommend setting up your own mail server.
For your own mail server, I recommend setting up a box with Alpine Linux, postfix, dovecot, and opendkim to sign outgoing email, with no webmail. I also recommend running your own DNS server with bind9. Test your mail configuration with mail-tester.com.
I do not endorse any fast-and-easy docker-based solutions.
@sir Can you elaborate on why you don’t recommend the docker-based solutions for self-hosting? (I assuming including mailu, mail-in-a-box, &c.)
@emacsomancer I don't care to, no
@sir I would add here that a big challenge is getting an IP with a clean bill of health from whichever hosting provider this server ends up on.
And that it may also mean not being able to reliably send email to megacorps for at least a year (or in case of outlook.com forever because they're that obnoxious) no matter how perfect your setup is with all the bells and whistles.
Whether that is a dealbreaker or an advantage is very subjective :)
@cmsirbu it's not especially difficult to get your IP cleared of wrongdoing
Maybe not difficult, but tedious. Microsoft for example is known to block whole /24 subnets for spam. If anyone on your network subnet is using the IP for spam, its pretty easy to get caught on the backwash and you need to deal with a lot of unsupportive staff to get of their blacklist. These kind of unwritten rules by the big three made me stop hosting my own mail in the end.
@sir A few more tips: You generally do not need a database server to manage multiple logins with virtual users. Disregard any tutorials that tell you otherwise. Postfix can authenticate via Dovecot and that can easily use a simple text file with user/auth/mailbox mappings.
Sieve scripts are extremely useful.
Instead of opendkim, you can also use amavis, which additionally takes care of validation and spam handling. Not difficult to set up.
(OT) And speaking of running your own DNS: It may be a good idea to run iodined so you have a way to bypass overzealous firewalls and captive portals/surveillance mechanisms of “free” public wifi networks.
@sir rspamd is also a great addition, implements the opendkim and spamassassin stuff and greylisting in one tool.
@sir agree rolling your own is the best way if you can. Personally I use OpenBSD because OpenSMTPD config is a dream to write (+ dovecot, DKIMproxy, no webmail)
How 'bout @Yunohost ? sets up mail and XMPP server, infinite domains (provides suggested DNS), and you can choose from several optional webmail apps to self-host. Is not a docker.
Worst issues: currently debian 9. When installed as OS on arm, *I* have been unable to use imap clients (there may be workarounds, but not discovered as yet.)
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!