Mailcow vs Docker Mailserver

Below is a comparison of two very popular email servers for self hosting your own email, mailcow and docker-mailserver. Both are actively developed and I have used both but in the end I switched to docker-mailserver. That may not be the best choice for everyone and both projects are very good email servers. I am not going to claim one is better that the other for every situation but instead document why docker-mailserver was a better fit for my use case. In the end you can’t go wrong with either one.
Current Environment
First of all, here is my current environment. I run my mail server on a Proxmox virtual machine in a home lab environment. I also have very few outgoing emails so I use a MailGun free account to alleviate some of the challenges of sending email from a home IP address which could change at any time. I use a homegrown dynamic DNS solution to assign a domain to my mail server so I can receive emails. All email ports are routed through HAProxy running on an OPNsense router. Because on occasion we do suffer from power outages where a hurricane can mean no power for a couple of weeks, I also run a remote backup email server which will store and forward emails when I am back online. That backup server initially ran postfix only, not mailcow or docker-mailserver.
Motivation to Replace Mailcow
I started by using mailcow for well over a year and found it to be very stable. It has an easy to use web interface for most common functions like creating and maintaining email accounts, was updated usually monthly and worked very nicely. But after a year I had a couple of motivations to look for alternatives.
First of all, mailcow has significantly larger resource requirements when it comes to RAM. A minimum of 5GB was needed to run mailcow even with a number of extra services disabled. To host this on a remote VPS would be rather expensive in comparison to docker-mailserver which can run in 2GB or even as little as 1GB with some swap space. This is because mailcow runs every service in a separate container and there are lots of them, for postfix, dovecot, spam detection, web email, somewhere around 20 or so containers! Docker-mailserver has one!!
I also recently have been experimenting with Oracle Cloud free tier for remote hosting and they give you a very generous server using an ARM processor that I thought might make a nice free backup email server or even run the whole thing in a failover during a power outage. But, unfortunately mailcow does not run on arm64.
Pros and Cons of Mailcow
PROS
- stable and reliable with regular updates
- nice web user interface for common email related tasks
- has a built-in SoGo web-based email client which also provides CalDav and CardDav support for calendar and contact storage
- is preconfigured to work with Haproxy by setting up ports that support proxy IP pass thru. For example, port 25 is setup for local email access from other servers in the lab and port 10025 is setup for Haproxy to pass the real IP of the external client so that fail2ban works appropriately
CONS
- rather resource heavy when it comes to the RAM required so that drives up the VPS hosting cost
- no support for Proxmox LXC from the official project; requires a full VM which increases resource requirements
- no ARM support from the official project
- the web interface while useful during initial setup was rarely needed later; so to have it running all the time was wasteful in my environment
- the web interface also was kind of awkward in the way it was organized. When you logged in you saw the maintenance screen of the current admin login and not some useful status page to let you know ‘all is well’; overall it would benefit from a usability expert
- SoGo, while a capable web email client ,was not my preferred email client; as a personal preference I liked RoundCube and so I setup a separate RoundCube client to access mailcow
- since SoGo was providing calendar and contacts support in mailcow I could not shutdown SoGo completely
- to run pflogsumm you need to install another instance of postfix on the host OS; setup is more complicated and not fully documented; let alone the additional system resources required
Pros and Cons of docker-mailserver
PROS
- stable and reliable with regular updates
- lightweight and cheaper to host remotely in a VPS; my main motivation
- can run in docker on a Proxmox LXC; further reducing system RAM and CPU requirements
- can run on a free ARM processor hosted on Oracle’s free tier because of arm64 support
- I was able to get ManageSieve working which never seemed to work for me on mailcow
- I can run in SMTP only mode and run the same project for my backup email server which forwards to the primary; no need to run dovecot and I still use all the same spam detection rules of the primary server
- it is easy to tweak the settings to meet your needs though it does perhaps require you to dig a bit into the configuration internals than mailcow does
- the provided setup command is easy to use for account maintenance but of course not as pretty as a web interface; though this keeps it lightweight which is more important to me
- logs are easier to find and keep an eye oncomes with pflogsumm and logwatch preconfigured to send you a nice daily email on how healthy your email server is or isn’t
CONS
- requires a separate calendar and contacts server to be installed. I am presently using Radicale which is also very lightweight and easy to setup; this is almost a Pro for me since I prefer this configuration to the much larger SoGo implementation
- still requires a separate webmail client; but since I already run RoundCube it was easy to point it to the new server; freedom of choice is nice instead of being forced to run SoGo
- because the email ports have Haproxy enabled on them it is more cumbersome to access the mail server for sending email from other servers in the lab. I have to route them through opnsense but it does work. Having a separate series of 10,000 port numbers like mailcow sets up would be a more convenient approach
Conclusions
The bottom line is that both are very good email servers and simple enough to setup and run. There are a lot of people that try and discourage the running of your own email server. I suppose it is a little bit more work to monitor the daily emails for any issues but it is also very nice to have complete control over your email server and to protect your data on local servers. For me, I wouldn’t go any other way. These projects make it easy to make sure you aren’t becoming an involuntary spammer by someone abusing your server. The default configuration is very secure and sain for most situations.
In summary, if I was running a mail server for a small company and needed to offload some of the administration and support tasks to others then mailcow is a nice solution. But for smaller setups where resources and cost are the primary driver then you can easily get the same functionality with docker-mailserver.