What does HackerNews think of docker-mailserver?

Production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container.

Language: Shell

#14 in Docker
I set up docker-mailserver[0] Monday in ~6 hours, most of which were me trying to be fancy using podman instead of docker and dealing with SELinux. But then again I did choose it over mail-in-a-box for just that level of customization. Obviously I can't tell how reliable it will be in the long run yet, but since it's using the classic Postfix/Dovecot stack I expect it'll be pretty stable

[0] https://github.com/docker-mailserver/docker-mailserver

I self-host e-mail. It's not always easy, but it's doable. It got easier over time with tools like docker-mailserver [1] and Mail-in-a-Box [2].

[1] https://github.com/docker-mailserver/docker-mailserver

[2] https://mailinabox.email/

Here's the GitHub link, not just the blog post (although it mentions it): https://github.com/docker-mailserver/docker-mailserver

And the container image: https://hub.docker.com/r/mailserver/docker-mailserver

I'm also using this solution very efficiently myself! So far I haven't had many issues with receiving or sending e-mails and what's especially nice is that I can easily set up as many accounts as I need, for example, one for Zabbix, one for Drone CI, one for OpenProject etc.

Even a cheap VPS is enough to run this setup (though you might need to selectively disable certain components) and the administration could be web based, but frankly the scripts that are present are simple enough and there's nothing unusual about, say, connecting Thunderbird to it.

For those afraid of misconfiguring/running their own server, you can use a ready to use docker with everything in it and with nice security defaults (no relay, for instance): https://github.com/docker-mailserver/docker-mailserver
> But what's the joy or reward of running your own mail server?

Not having to deal with rate limits or weirdness in regards to delivering mail from software in an automated manner, which would be there with any of the other "big" hosts.

For example, currently i have the following hooked up to a self-hosted e-mail server:

  - Nextcloud/ownCloud
  - Mattermost/Rocket.Chat
  - Drone CI/GitLab
  - OpenProject
  - PeerTube
  - SonarQube
  - Zabbix
Or any number of other pieces of software that could send lots of other e-mails.

If i use my own self-hosted mail server, then there are no odd spam filters or whatever to deal with (unless i introduce my own) - i send as many messages as i need and i receive all of them as well, plus all of the data stays wherever i want it to. This is also relevant for older software that might have problems with the more secure methods of delivering mails.

Oh and there's not a lot to think about, pricing wise, either.

Lastly, running a basic mail server is exceedingly simple with https://github.com/docker-mailserver/docker-mailserver No need to manually configure mail delivery agents or whatever. In my eyes, a mail server with everything it needs should be a single executable/container, with toggleable bits of functionality, rather than some overcomplicated amalgamation of mixed and matched pieces that would need lots of your time to maintain.

It's I guess tangentially related, but in terms of de-googling, I've been using docker mailserver https://github.com/docker-mailserver/docker-mailserver for a few years now and it is great. Combined with bluemail, thunderbird clients, backblaze for backup, and solar panels, it runs in my house and is basically free. For resiliency I do pay for a backup MX, which is about $5/year per domain. It took a few hours to set up, supports many users (family and friends) and maybe 1h every 3 months to update and check all is good.
One thing to consider is the possibility of using multiple separate e-mail accounts from different providers.

Currently i have about 10 different e-mail accounts:

  - one for development related things and communities
  - one for newsletters, various online platforms and so on
  - one for throwaway purposes, lower importance things like video game accounts
  - one for university related things (it stayed after graduation)
  - a few separate accounts (and corresponding Google account) for various phones or other devices, as necessary
  - some standby accounts if i ever need them, some from different providers to check mail denylisting
  - a personal address that's mostly for contacts through my website or my self-hosted automation messages
There are some others, as well as each platform for automation has a separate account as well (e.g. GitLab, Zabbix, Nextcloud, ...), though most of those are on the same self-hosted mail server. Of course, deciding how to structure everything is one's own choice, in my case it's just historical cruft and loosely defined boundaries of how much i care about any particular item.

That said, mail servers that are easy to set up are a godsend (for example: https://github.com/docker-mailserver/docker-mailserver), as long as you also have one of the larger walled garden alternatives for public communications, should there ever be delivery problems.

It's not like Google deciding to ban all of my accounts at once (though fingerprinting, or based on IP because i don't care to set up some sort of an advanced proxy to access all of them from different VPNs) wouldn't be problematic, but this way at least the impact would be minimized.

Plus, with software like Thunderbird and something like KeePass for strong randomly generated passwords, managing everything is really low effort. Of course, this also lends itself nicely to avoiding social logins and creating a separate e-mail based account wherever applicable, for a bit more control, rather than keeping all of your eggs in the same basket.

As for those who will inevitably say that this is too hard or complicated to be practical: i invite you to try setting up your own mail server with the help of the provided link on a 5$/month VPS, things have really improved in the last few years! Of course, creating new Google accounts (or for other platforms) might be a bit more cumbersome with modern verification steps etc., but it's not like it's impossible either.

Sometimes i wish we could do the same for personal identities, e.g. a list of aliases that could be issued through some government org. for particular purposes and revoked as necessary. For example, i wouldn't want a leak of some shopping site result in my personal data being compromised in regards to my online banking or my physical address, in any capacity whatsoever.

I have set up the same thing for myself and have been using it for several years now, so i’ll join in.

Aws ses has this offer where for a few thousand emails per month, email sending is free.

The steps are this:

1- Signup for aws ses, once you do that they’ll put you in a sandbox environment

2- After that they’ll ask you a few questions on why you need it, just tell them its because you’re a growing startup who expects to send thousands of emails per month, (make sure to say this, they don’t crosscheck later, if you dont say something along the lines of this, they usually reject your application to avoid having to serve small customers who might not scale their business later. )

3- After you’re approved, they provide you with a mail relay api key, just take that api key and attach it to your postfix or other smtpd installation

I use docker-mailserver[0] which packages everything I need for my mailserver into a small container and was good to go, it consumes minimal resources too.

For me, i just had to add the ses relay api key to the config file of my docker-mailserver install and it was all setup.

However you can do the same with any provider that gives you an option to act as your email relay, I remember both aws ses and sendgrid provide this service, but I’m sure there are more niche businesses providing this too.

[0](https://github.com/docker-mailserver/docker-mailserver)

Oh yes you can, without much technical difficulties, easier than you would in the 90s actually [1][2]. Does it work as you would expect? Probably not because gmail and other ones are blocking/ghosting you (I suspect this to be the issue right?). Nobody is forcing people towards gmail though. I am one that is scared of being locked out by giants like Google and I switched everything (website logins + mail) to something else (my domain email, managed by protonmail). The transition was seamless and I control my mail with my domain right now. I can migrate at will any time I want.

Mailservers not running from your house is not really all that bad...for the rest of us. Imagine all the spammy software that your friends and relatives install on their computer being able to spin one and blast campaigns.

[1] https://github.com/docker-mailserver/docker-mailserver [2] https://mailu.io/1.8/

I switched to my hosted email, it is not so difficult to manage, and I feel very free.

Also I have created accounts for my children, my wife with very little costs. The magic? This very well supported project:

https://github.com/docker-mailserver/docker-mailserver

Genuine question: why not just have your own e-mail server with a bit of automation thrown in, something simple like https://github.com/docker-mailserver/docker-mailserver

I can understand something like SendGrid or PostMark for the more complex use cases or larger platforms, but surely for a one man SaaS, the simple self-hosted option wouldn't be out of the question either? Interacting with a mail server shouldn't be too hard either, say, with Python or any other general purpose programming language.

Provided, that the IP addresses aren't blacklisted and that a simple VPN is sufficient. Do we live in a world of walled gardens, where the smaller mail servers would just have their mail be discarded, or something?

Please dont scare people ,

It took me 10 minutes to host an email server and all my emails get delivered just fine.

If you’re worried about deliverability. Just use a relay server to manage deliverability issues , dkim setup for you , like aws ses

Atleast that way youre receiving emails still stay hosted and private on your personal server , and outgoing emails get delivered by ses.

Ses is pretty cheap too, heck its literally free for 2000 emails or so per month, so no extra cost for personal email servers.

https://github.com/docker-mailserver/docker-mailserver

Something like this , lets you setup a decent mailserver under 10 mins with next to no maintenance needed.

(Only had to log back in once , to update the docker image itself)

There are some really interesting choices for F/OSS email servers these days. There are SMTP+IMAP:

- maddy[0] (I use this)

- chasquid[1]

- docker-mailserver[2]

And combinations:

- haraka[3]/ZoneMTA[4] (SMTP) + wilduck[5] (IMAP)

Modoboa brings something new in that it bundles together the frontend but I'm very happy with Thunderbird (and there are other frontends like Sogo) -- the competition is stiff and modoboa really could use a front-and center image of what the app looks like on the main page.

[EDIT] I forgot two!

- iredmail (https://www.iredmail.org/download.html)

- Apache James (https://james.apache.org/)

[0]: https://maddy.email/

[1]: https://github.com/albertito/chasquid

[2]: https://github.com/docker-mailserver/docker-mailserver

[3]: https://haraka.github.io

[4]: https://github.com/zone-eu/zone-mta

[5]: https://wildduck.email/

Here's my own slightly out of touch that simultaneously holds true for me and doesn't for a very large part of the populace:

1) XFCE is the pinnacle of desktop environments: https://xfce.org/

It's extremely stable, looks good, works fast and is customizable. It works equally well on old underpowered devices, modern ones, as well as servers (should you ever need that sort of thing for whatever reason). It also has plenty of widgets without any of the modern bloat.

2) LibreOffice is great open source office software: https://www.libreoffice.org/

It started out as a fork of OpenOffice and has since become the mainstay under GNU/Linux distributions. It does word processing. It does spreadsheets. You can make drawings and visualizations in it. It does presentations. There's even a simple database offering in there, a la MS Access.

It also supports MS Office formats for the most part and can convert them to open ones with very few issues! The performance is also better than any web based offering. Plus, it's cross platform!

3) Thunderbird is perhaps the best mail client, regardless of platform: https://www.thunderbird.net/en-US/

It's stable, reliable and has its origins in Mozilla. It does everything i'd expect a mail client to do and i've had no problems with it to date. Plus, it's cross platform!

As for mail servers, i think that mail servers are a horrible mess for the most part, regardless of which platform you need them on. I think that your best bet in that regard is just using a Docker container that packages all of the components that you'd need: https://github.com/docker-mailserver/docker-mailserver

4) This is absolutely true, but then again, you can say the same about any piece of unpopular hardware.

Linux on mobile phones is a mess. Then again, even FreeBSD on certain pieces of desktop hardware oftentimes fails to work as well. Many years have passed, but this can still be problematic, given that perhaps we treat drivers wrong as an industry.

My cheap Chinese netbook (i'm not too well off financially) had the mouse not work on Fedora and some other distros. Sometimes the audio wouldn't work. Now, sometimes the mouse gets stuck in a state where it acts as a scroll wheel. In Windows, function keys worked as they should (after pressing the Fn key you could access them), but in Linux distros it was flipped and i found myself having to press Fn to use the F1-F12 keys, with no option in BIOS to flip this. The fingerprint scanner just doesn't work and isn't even detected. The Wi-Fi drivers didn't work and i had to compile them from some random GitHub repository that i found online. The distro didn't have GCC and the netbook doesn't have an ethernet port so i had to suffer through doing an air gapped install, which was problematic because of the dependencies. I got it working for the most part, but it was a pain.

Things really should be better. But that can probably only be achieved by either open drivers and open standards for most of the hardware out there, or by killing off about 75% of the hardware vendors out there, which in practice simply means that you only have to buy hardware that works well (e.g. Thinkpads).

5) The choices that i find myself making are rather easy - either i use open source software, or i do less.

However i agree for the most part with the observations about Linux not being an awfully popular platform for porting applications. I do think that this has three main causes: packaging being somewhat difficult to get started with (as well as needing to support a variety of distros), the GUI frameworks across Windows/Linux/Mac being a total mess and there being no "good" options out there, and then there also really not being a large commercial effort to make the struggle of porting something over worthwhile.

Interestingly, the GUI framework situation isn't such a large issue if you go with something like Lazarus, JavaFX or even Swing for your software, but those can be ugly, so people don't. Still, i'd argue that either of those have the potential to be better choices than Electron apps.

If you’re open to using Docker

Try out this [0] , it’s pretty easy to self host , comes with decent defaults and makes it quite easy to setup a bunch of tools from spam checking to anti virus , dkim , dmarc , etc and gives you some handy parameters you can change in its default config file after that you can further customise the tools it uses directly (although I’ve only had to do that once or twice while setting up some custom settings) Takes 5 mins to setup a decent instance

[0] https://github.com/docker-mailserver/docker-mailserver

Personally i use a mail server that's preconfigured and lives inside of a Docker container with all of the dependencies that it needs: https://hub.docker.com/r/mailserver/docker-mailserver ( GitHub: https://github.com/docker-mailserver/docker-mailserver ). With it, adding a new e-mail account is as simple as running a script with some parameters and it interoperates nicely with most clients such as Thunderbird or even the one built into Nextcloud (for a lightweight hosted solution without a separate app to manage).

It is pretty awesome to see new projects that try to improve the user experience for the system admins, for example, the Caddy web server and now the Maddy mail server. I'm not sure whether i'd have been able to set up a mail server the "old fashioned way", seemingly in line with the concerns of the other people here who have tried that more extensively. Somehow, while e-mail is super widespread and works decently for getting text information from place A to place B, it also feels a tad overcomplicated (the different components for sending/receiving mail, SMTP, IMAP, POP3, the sad need for anti virus scanning, SPF, DKIM, DMARC, the similarly sad need for anti spam protection).

That said, the containerized solution above has also worked nicely for me - i'll still probably use GMail/other hosted solutions for personal e-mail stuff and communication, but right now i've already switched over to using my own mail server for all of the automated e-mails that i need, such as from SonarQube and Zabbix, as well as GitLab.

I have been running my own mail server since the 1980s, using Debian/exim4 for the last eight years. With the weird patches for greylisting, etc., I never wanted to update it. In the last week, I jumped to docker-mailserver[0]. O.M.G. That is too easy! Yes, there is picking one's way through the options at first, but those go in a tiny config file and survive updates. The heavy lifting is all in one container. I just use it as a mail gateway, into a local machine that has port 25 filtered, but I played a bit with the imap functions, too. You do have to have a box somewhere that can run containers, which for me is a KVM VPS.

Gmail instantly was happy with my inbound emails. I got on a backscatter blacklist because I didn't immediately drop invalid email addresses at the gateway, but that will time out shortly. And just as I had settled in with the new server, I got to test the update function. This week the entire docker-mailserver project moved to a new repo name on Github, with a new release. A couple of the config files changed names, but nothing much in contents. A docker pull for the new image name, and my mail server was running the fresh release. Happy, happy, happy.

[0] https://github.com/docker-mailserver/docker-mailserver