Overview
Discover what makes Mailcow powerful
Mailcow is a **docker‑based mail server stack** that bundles a full range of SMTP, IMAP/POP3, webmail, and administrative services into a single, cohesive deployment. From a developer’s standpoint it is essentially an opinionated orchestration of proven open‑source components—Postfix, Dovecot, Rspamd, Nginx, MariaDB, Redis, and SOGo—managed through a lightweight PHP/JavaScript web UI. The stack exposes both RESTful endpoints and CLI tools that allow fine‑grained programmatic control over domains, users, aliases, and quarantine policies.
Policy‑driven mail flow
Webmail & Collaboration
Security hardening
High availability
Overview
Mailcow is a docker‑based mail server stack that bundles a full range of SMTP, IMAP/POP3, webmail, and administrative services into a single, cohesive deployment. From a developer’s standpoint it is essentially an opinionated orchestration of proven open‑source components—Postfix, Dovecot, Rspamd, Nginx, MariaDB, Redis, and SOGo—managed through a lightweight PHP/JavaScript web UI. The stack exposes both RESTful endpoints and CLI tools that allow fine‑grained programmatic control over domains, users, aliases, and quarantine policies.
Key Features
- Policy‑driven mail flow: Rspamd 3.x with advanced spam/virus detection, rate limiting, and custom rule sets that can be tweaked via JSON or Lua scripts.
- Webmail & Collaboration: Integrated SOGo 5.x provides calendar, address book, and groupware capabilities behind the same domain.
- Security hardening: Built‑in support for MTA‑STS, DMARC/ DKIM/SPF, TLS‑only connections, and automatic Let's Encrypt certificates.
- High availability: Docker Compose or Swarm can spin up replicated services; MariaDB Galera and Redis Sentinel are optional for clustered setups.
Technical Stack
| Layer | Technology | Role |
|---|---|---|
| Container Runtime | Docker + Compose (or Swarm) | Orchestrates services, isolates dependencies. |
| Mail Transfer | Postfix (SMTP) | Handles inbound/outbound routing, TLS termination. |
| Mail Delivery | Dovecot (IMAP/POP3) | Stores mailboxes, supports LDAP/SQL auth. |
| Spam & Content Filtering | Rspamd + Redis | Real‑time scoring, caching of rules. |
| Web Frontend | Nginx + PHP 8.x | Serves admin UI, acts as reverse proxy. |
| Database | MariaDB 10.x | Stores configuration, user accounts, domain data. |
| Collaboration | SOGo 5.x | Calendar & address book services, SOAP/CalDAV. |
| Auxiliary | Redis, OpenSSL, Certbot | Caching, key management, SSL cert automation. |
The codebase is largely shell scripts and PHP; the Docker images are built from Alpine or Debian variants, keeping footprint small while maintaining compatibility with most Linux distributions.
Core Capabilities & APIs
- REST API:
/api/v1/endpoints allow creation/deletion of domains, users, aliases, and retrieval of quarantine statistics. Authentication is handled via session cookies or API keys. - Webhooks: Rspamd can emit JSON payloads on message events (spam, virus) to external services.
- CLI Tools:
mailcowctlexposes commands likeadd-domain,del-user, andupdate-configthat can be scripted in CI/CD pipelines. - SMTP Hooks: Postfix
header_checksandsmtpd_recipient_restrictionscan be extended to call external scripts for custom validation.
Deployment & Infrastructure
Mailcow is self‑hosted by design, encouraging developers to run it on bare metal or VMs with at least 2 GB RAM and a dual‑core CPU for small workloads. The Docker Compose file is the primary deployment artifact; however, it can be converted to Kubernetes manifests or run in a Docker Swarm cluster for horizontal scaling. For production, a reverse proxy (e.g., Traefik) can be added to expose multiple subdomains and handle TLS termination, while MariaDB Galera or Percona XtraDB Cluster can provide database replication.
Integration & Extensibility
- Plugins: The web UI supports PHP plugins that can hook into the admin workflow, allowing developers to add custom forms or integrate with third‑party services.
- Custom Rspamd Rules: Lua scripts and JSON rule files can be dropped into
/etc/rspamd/local.d/to alter scoring logic. - LDAP/Active Directory: Dovecot can be configured to authenticate against external directories, enabling single sign‑on for existing corporate environments.
- SOGo Customization: The SOGo configuration is XML‑based; developers can tweak calendar sharing policies or integrate with LDAP.
Developer Experience
Mailcow’s documentation is comprehensive, with clear sections for installation, configuration, and troubleshooting. The community forum and Telegram channels provide rapid support, while the GitHub repository includes issue templates and a welcoming code‑of‑conduct. Because it is GPLv3, developers can freely fork or modify the stack for internal use without licensing constraints. The containerized nature means that unit tests and integration tests can be run locally with docker compose up --build, making continuous delivery pipelines straightforward.
Use Cases
- Enterprise Private Mail – Companies wanting full control over email infrastructure can deploy Mailcow behind their firewall, integrate with LDAP for authentication, and enforce strict spam policies.
- SaaS Providers – Start‑ups offering email as a service can spin up isolated Mailcow instances per customer using Docker Swarm, leveraging the REST API for automated provisioning.
- Educational Institutions – Universities can provide students with personal mailboxes, calendar sharing, and groupware via SOGo, all managed through a single admin portal.
- Personal Projects – Hobbyists or developers needing a private mail server
Open SourceReady to get started?
Join the community and start self-hosting Mailcow today
Related Apps in apis-services
Mastodon
Decentralized, real‑time social networking
Discourse
Open‑source community forum platform with real‑time chat and AI
Rocket.Chat
Secure, open‑source team communication platform
Novu
Unified notification platform for multi‑channel delivery
Mattermost
Secure, self‑hosted team collaboration with chat, voice, and AI
Jitsi Meet
Free, encrypted video conferencing for everyone
Weekly Views
Repository Health
Information
Explore More Apps
Neko
Virtual browser in a container, WebRTC‑powered
Odoo
All-in-one open source business suite
TeslaMate
Self-hosted Tesla data logger and analytics
pacebin
Minimalist self-hosted paste and file hosting service
wger
Free, self-hosted workout and nutrition manager
Meelo
Self-hosted music server for collectors with flexible browsing and playback
