
docker-mailserver
Containerized mail server stack for SMTP and IMAP with anti-spam
18.8k stars 2k forks last commit first released MIT
Actively maintained
Last commit 31 Aug 2026.

docker-mailserver (DMS) is a production-ready, containerized email server appliance that bundles common mail components into a single Docker image. It is designed to be “full stack but simple”, emphasizing file-based configuration (no SQL database) to keep setups easy to version, deploy, and upgrade.
Key Features
- SMTP server with Postfix
- IMAP and POP3 server with Dovecot
- Optional LDAP-backed authentication (including SASL)
- Anti-spam stack integration (including Rspamd and SpamAssassin options)
- Antivirus scanning with ClamAV
- Email authentication protections with DKIM and DMARC support
- Abuse and brute-force mitigation via Fail2ban and Postscreen
- TLS certificate support including Let’s Encrypt, as well as manual/self-signed certificates
- Included maintenance and administration helper script (setup.sh)
Use Cases
- Self-hosting mail for a personal domain or homelab with a Docker-based workflow
- Running small-to-medium organization mail services with common anti-spam and security components
- Providing a reproducible, version-controlled mailserver configuration for teams and environments
Limitations and Considerations
- Mail hosting requires careful DNS and deliverability configuration (SPF, DKIM, DMARC, rDNS) and ongoing monitoring to avoid delivery issues
- Advanced customization may require inspecting the running container or using startup patch scripting for overrides
docker-mailserver is a practical option when you want a complete mail stack in a single container while retaining transparent, file-based configuration. It aims to reduce operational complexity without hiding the underlying building blocks that power a standard email system.
Categories:
Tags:
Tech Stack:
Similar to docker-mailserver

mailcow: dockerized
Docker-based email server suite with a web admin interface
Mailcow is a dockerized mail server suite providing SMTP/IMAP, webmail, anti-spam/anti-virus, and domain/mailbox administration via a unified web UI.
iRedMail
Open-source full-featured mail server stack for Linux/BSD
Automated open-source mail server installer bundling Postfix, Dovecot, webmail, anti-spam/antivirus and LDAP/SQL backends for mainstream Linux/BSD.

Mailu
Docker-based mail server with webmail and admin interface
Mailu is a full-featured mail server distributed as Docker images, providing SMTP/IMAP/POP3, webmail, administration UI, and built-in security and anti-spam features.

emailwiz
Bash-based installer that deploys a secure Debian/Ubuntu mail server stack.
A Bash script that auto-implements a full mail server (Postfix, Dovecot, DKIM, SpamAssassin) with TLS and PAM-based logins on Debian/Ubuntu.
Maddy Mail Server
Composable all-in-one SMTP/IMAP mail server with security features
Go-based, modular mail server implementing SMTP/LMTP/IMAP with built-in DKIM/SPF/DMARC, storage backends (SQLite/Postgres/S3), Prometheus metrics and Docker support.

Simple NixOS Mailserver
NixOS module for running a complete email server stack
Simple NixOS Mailserver provides NixOS modules to deploy a full email server with SMTP/IMAP, spam filtering, DKIM/DMARC/SPF, and TLS automation.


