Production-ready hybrid email server with intelligent SMTP routing. Combines local Dovecot IMAP with custom Go proxy for AWS SES/Gmail routing. Features: rate limiting, security alerts, auto-SSL, multi-domain support. Complete docs included.
| examples | ||
| .gitignore | ||
| ARCHITECTURE.md | ||
| CONFIGURATION.md | ||
| INSTALL.md | ||
| LICENSE | ||
| README.md | ||
Hybrid Mail Server
A production-ready hybrid email infrastructure combining local IMAP services with intelligent SMTP routing through AWS SES and Gmail.
Author: Oleksandr Kutsenko
Developed with: Anthropic Claude Sonnet 4.5 assistance
Features
✅ Dual SMTP/IMAP Support
- IMAP: Ports 993 (SSL) and 143 (STARTTLS)
- SMTP: Ports 465 (SSL with auto-detect) and 587 (STARTTLS)
✅ Intelligent Email Routing
- Domain-based routing (e.g., @yourdomain.com → AWS SES)
- Fallback routing (other domains → Gmail SMTP)
- Automatic sender domain detection
✅ Security Features
- Rate limiting per username (2 failed → 10min ban, 3+ failed → 1hr ban)
- Automated security alerts via email
- TLS 1.2+ enforcement
- Let's Encrypt SSL certificates
✅ Production Ready
- Systemd service management
- Log rotation (30-day retention)
- Automated certificate renewal
- HAProxy load balancing
Architecture
┌─────────────┐
│ Clients │ (Mail.app, Thunderbird, iPhone, etc.)
└──────┬──────┘
│ SSL/TLS
┌──────▼──────────┐
│ VyOS Router │ HAProxy passthrough
│ 176.x.x.x:993 │ ports 143,465,587,993
│ 176.x.x.x:587 │
└──────┬──────────┘
│
┌──────▼──────────┐
│ LXC Container │
│ 10.10.10.212 │
│ │
│ ┌───────────┐ │
│ │ Dovecot │ │ IMAP server (local mailboxes)
│ │ IMAP │ │
│ └───────────┘ │
│ │
│ ┌───────────┐ │
│ │ Go SMTP │ │ Custom SMTP proxy with routing
│ │ Proxy │ │
│ └─────┬─────┘ │
└────────┼────────┘
│
┌────┴────┐
│ │
┌───▼───┐ ┌──▼─────┐
│AWS SES│ │ Gmail │
│ SMTP │ │ SMTP │
└───────┘ └────────┘
Quick Start
See INSTALL.md for detailed installation instructions.
Documentation
- Installation Guide - Complete setup instructions
- Configuration Reference - Detailed configuration options
- Architecture Overview - System design and components
- Troubleshooting - Common issues and solutions
- AWS SES Setup - AWS SES configuration
- Gmail SMTP Setup - Gmail app password setup
- DNS Records - SPF/DKIM/DMARC configuration
Requirements
- VyOS Router (1.4+) with HAProxy support
- LXC Container (Ubuntu 24.04 recommended)
- Go 1.21+ (for SMTP proxy)
- Domain name with DNS control
- AWS SES account (for primary domain sending)
- Gmail account with app password (for fallback routing)
License
MIT License - see LICENSE file for details.
Copyright (c) 2025 Oleksandr Kutsenko
Developed with Anthropic Claude Sonnet 4.5 assistance