Why Self-Host Email?
When I joined Prachyam Studios as the primary technical hire, they were paying for Google Workspace across multiple domains. The costs were climbing fast — 12 domains, growing team, and the per-user-per-domain pricing model was bleeding money.
I proposed Mailcow: a Docker-based mail server with a full admin UI, anti-spam (Rspamd), antivirus (ClamAV), and DKIM/DMARC/SPF baked in. The savings were immediate and significant — lakhs annually.
The Architecture
The setup runs on a dedicated server with:
- Mailcow handling SMTP, IMAP, and the admin panel
- Rspamd for spam filtering with custom rules per domain
- ClamAV for attachment scanning
- Nginx reverse proxy with Let's Encrypt SSL
- Automated backups to a separate storage node via rsync
Handling 12 Domains
Each domain gets its own set of DNS records — MX, SPF, DKIM, and DMARC. I automated the DNS provisioning with a script that generates the correct records for each new domain:
The Numbers
After 2+ years of running this setup:
- 18M+ emails processed (sent + received)
- 12 domains managed from a single admin panel
- 99.9% uptime — only downtime was planned maintenance
- Zero successful spam/phishing incidents that made it to inboxes
- Significant cost savings versus Google Workspace
Lessons Learned
Email deliverability is an art. Getting IP reputation right took weeks. I had to:
- Set up proper reverse DNS (PTR records)
- Warm up the IP gradually — start with low volume
- Monitor blacklists daily using external monitoring
- Keep the Rspamd score thresholds tuned
Backups are non-negotiable. I run daily incremental backups with a 30-day retention. Lost email is lost business.
Monitoring matters. I set up alerts for queue length, disk space, and certificate expiry. Most issues were caught before they became problems.
Would I Do It Again?
Absolutely. The control, cost savings, and learning were worth every hour. If you're comfortable with Docker and DNS, Mailcow is a solid choice for self-hosted email. Just respect the complexity — email is one of the oldest protocols on the internet, and it shows.