The Mail System project is a Dockerized solution for running a secure, self-hosted email server with centralized user authentication. Built for teams needing full control over email and identity in one stack.
Mail System
About The Email System
This project combines a full containerized mail server setup with custom integrated OpenLDAP to create a unified environment for email and user management. Mail accounts could be managed through custom TypeScript utility library - built specifically for LDAP and IMAP tasks like mailbox syncing, quota checks, and message manipulation.

Core Features
Secure, flexible, and extensible email infrastructure
The Mail System is designed with security, scalability, and observability in mind. It provides a complete email solution that can be deployed as a single stack.

All-in-One Stack
Combines Postfix, Dovecot, Rspamd, and ClamAV out of the box, with DKIM, SPF, and DMARC support for secure delivery.

LDAP & IMAP Utils
Custom-built TypeScript utilities for managing LDAP users, aliases, IMAP syncs, flags, quotas, and sending emails. Full CLI and Node.js API support included.

Modular Architecture
Services like docker-mailserver, OpenLDAP, phpLDAPadmin, and monitoring tools can be deployed separately or as a stack.

Monitoring & Deployment
Integrated with Grafana and Prometheus for metrics and alerts. Easily deploy via Docker Compose with built-in SSL and DNS record generation tools (MX, DKIM, SPF).
Services
Fully-integrated, containerized email components
The stack bundles all core services required for a secure, production-ready mail system - MTA/MDA, spam & AV, domain authentication, centralized identity, observability, and deployment helpers.

Postfix
Primary MTA for sending/receiving mail with TLS, SASL, and virtual domains/mailboxes.

Dovecot
IMAP/POP3 server providing authentication, mailbox indexing, and quota enforcement.

Rspamd
High-performance spam filtering with rules, reputation, and policy integration.

ClamAV
Antivirus scanning for inbound and outbound messages to block known threats.

OpenDKIM
DKIM key management and signing to authenticate your domain's outbound mail.

OpenDMARC
DMARC policy checking and reporting to strengthen delivery and prevent spoofing.

OpenLDAP
Central directory for users, groups, and aliases with secure authentication.

phpLDAPadmin
Web UI to manage LDAP entries: users, domains, aliases, and schema objects.

Prometheus
Metrics collection via exporters for mail traffic, queues, spam scores, and system health.

Grafana
Dashboards and alerts for end‑to‑end visibility across the mail and directory services.

DNS & SSL Tools
Assistants for MX, SPF, DKIM, and DMARC records plus automated TLS certificates (Let's Encrypt).

Docker Compose Orchestration
Pre-configured docker-compose.yml file for easy deployment and management of all components. Supports single or multi-host setups with persistent storage.
Utility Library Capabilities
Developed to simplify email and directory operations
Our utility handles common and advanced tasks like syncing mailboxes, managing flags, sending emails, and retrieving quotas.

LDAP Actions
Easily create users, aliases, or search for entries with built-in logic for domain-wide group syncing and user authentication.

IMAP Operations
Perform message flagging, mailbox synchronization, drafts, search, delete, quota checks, and real-time monitoring using our streamlined Node.js APIs.

SMTP Integration
Send emails using nodemailer with support for multiple recipients, BCC, attachments, and customizable transport configuration.

Mailbox Sync
Easily sync inboxes between two IMAP servers with adjustable batch sizes and delay controls to handle large migrations or backups.
Key Features & Benefits
Reliable and scalable by design
The Mail System is built to provide a secure, extensible, and easy-to-manage email solution for teams of all sizes. It combines the best open-source components with custom tooling to deliver a complete package that’s production-ready, highly customizable, and easy to deploy.

Secure Delivery
Out-of-the-box support for modern email security standards like TLS, DKIM, SPF, and DMARC ensures trusted and encrypted communication.

DNS Assistant
Auto-generate DNS records (MX, DKIM, SPF, DMARC) to streamline domain setup and reduce configuration errors.

Rapid Deployment
Deploy in minutes using Docker Compose. Minimal configuration required.

LDAP Integration
Centralized authentication via OpenLDAP makes user management scalable across multiple mail domains and services.

Monitoring Ready
Native Prometheus exporters and Grafana dashboards give insight into mail flow, spam activity, storage usage, and system health.

Backup Friendly
Maildir-based storage and modular service volumes make it easy to integrate backups with tools like Borg, Restic, or rsync.