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.
Find a file
2025-12-21 23:52:10 +00:00
examples Bug FIX 2025-12-21 23:52:10 +00:00
.gitignore Initial commit: Hybrid Mail Server 2025-12-21 22:51:04 +00:00
ARCHITECTURE.md Initial commit: Hybrid Mail Server 2025-12-21 22:51:04 +00:00
CONFIGURATION.md Initial commit: Hybrid Mail Server 2025-12-21 22:51:04 +00:00
INSTALL.md Initial commit: Hybrid Mail Server 2025-12-21 22:51:04 +00:00
LICENSE Initial commit: Hybrid Mail Server 2025-12-21 22:51:04 +00:00
README.md Initial commit: Hybrid Mail Server 2025-12-21 22:51:04 +00:00

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

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