
docker-mailserver
Production-ready mail server stack in a Docker container with SMTP, IMAP/POP3, LDAP auth, anti-spam/AV, DKIM/DMARC, and optional OAuth2 support.

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.



























