MCPSERV.CLUB
Mailcow

Mailcow

Self-Hosted

Self‑hosted email suite with Docker, secure and easy to manage

Active(100)
11.4kstars
2views
Updated 1 day ago
Mailcow screenshot

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

LayerTechnologyRole
Container RuntimeDocker + Compose (or Swarm)Orchestrates services, isolates dependencies.
Mail TransferPostfix (SMTP)Handles inbound/outbound routing, TLS termination.
Mail DeliveryDovecot (IMAP/POP3)Stores mailboxes, supports LDAP/SQL auth.
Spam & Content FilteringRspamd + RedisReal‑time scoring, caching of rules.
Web FrontendNginx + PHP 8.xServes admin UI, acts as reverse proxy.
DatabaseMariaDB 10.xStores configuration, user accounts, domain data.
CollaborationSOGo 5.xCalendar & address book services, SOAP/CalDAV.
AuxiliaryRedis, OpenSSL, CertbotCaching, 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: mailcowctl exposes commands like add-domain, del-user, and update-config that can be scripted in CI/CD pipelines.
  • SMTP Hooks: Postfix header_checks and smtpd_recipient_restrictions can 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

  1. 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.
  2. 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.
  3. Educational Institutions – Universities can provide students with personal mailboxes, calendar sharing, and groupware via SOGo, all managed through a single admin portal.
  4. Personal Projects – Hobbyists or developers needing a private mail server

Open SourceReady to get started?

Join the community and start self-hosting Mailcow today

Weekly Views

Loading...
Support Us
Most Popular

Infrastructure Supporter

$5/month

Keep our servers running and help us maintain the best directory for developers

Repository Health

Loading health data...

Information

Category
apis-services
License
GPL-3.0
Stars
11.4k
Technical Specs
Pricing
Open Source
Database
MySQL
Docker
Official
Min RAM
1GB
Min Storage
5GB
Supported OS
LinuxDocker
Author
mailcow
mailcow
Last Updated
1 day ago