Overseas Email Delivery Acceleration Architecture — Smart Delivery Network in Practice
Introduction: Challenges of Overseas Email Delivery
In globalized business scenarios, email delivery faces numerous challenges. Overseas email delivery must not only overcome network latency issues but also navigate complex geopolitical network environments. Traditional direct overseas delivery methods often encounter connection timeouts, firewall blocking, and high delivery latency. At the same time, interoperability between domestic email systems and overseas networks also presents technical challenges.
To address these issues, we designed and implemented a Smart Delivery Network (SDN) architecture that effectively improves the efficiency and reliability of overseas email delivery through multi-level proxying, intelligent routing, and load balancing mechanisms.
Problem Analysis: Pain Points of Direct Overseas Delivery
1. Network Connectivity Issues
- GFW interception mechanisms: Overseas email servers are frequently subject to network restrictions, causing unstable connections
- Poor link quality: Direct overseas network paths are long, with high latency and high packet loss rates
- Single point of failure risk: Dependency on a single overseas exit means any issue affects all deliveries
2. Performance Bottlenecks
- Concurrent connection limits: A single overseas email server has limited concurrent connections
- Unstable delivery latency: Spam processing affects the delivery efficiency of normal emails
- Resource contention: Normal emails and spam share delivery resources
3. High Management Complexity
- Difficult multi-domain management: Each domain requires independent delivery configuration maintenance
- Tedious configuration updates: Manual configuration is error-prone and costly to maintain
- Difficult monitoring and troubleshooting: Lack of a unified monitoring and management platform
Overall Architecture Design
Overseas MX Node Distribution
We built a global MX node distribution system covering major overseas regions:
| |
Acceleration Channel Design
The architecture includes multi-layer acceleration channels to ensure efficient and reliable email delivery:
flowchart TD
classDef primary fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef network fill:#fff3e0,stroke:#ff9800,stroke-width:2px
classDef storage fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
A@{ shape: rounded, label: "Domestic Email Server" } --> B@{ shape: hex, label: "Domestic North Node" }
A --> C@{ shape: hex, label: "Domestic South Node" }
A --> D@{ shape: hex, label: "Third-party VPS Node" }
B --> E@{ shape: hex, label: "Core Switching Layer" }
C --> E
D --> E
E --> F@{ shape: hex, label: "North America MX Proxy" }
E --> G@{ shape: hex, label: "Europe MX Proxy" }
E --> H@{ shape: hex, label: "Asia-Pacific MX Proxy" }
F --> I@{ shape: rounded, label: "Overseas Email Server" }
G --> I
H --> I
class A,I primary
class B,C,D,E,F,G,H networkRSDN proxy clusters are deployed in major domestic data centers to enable intelligent traffic distribution and load balancing:
flowchart TD
classDef primary fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef network fill:#fff3e0,stroke:#ff9800,stroke-width:2px
classDef storage fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
classDef process fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
subgraph "Domestic RSDN Proxy Cluster"
A@{ shape: hex, label: "Hangzhou Xiaoshan Node" } --> B@{ shape: hex, label: "Smart Delivery Network (SDN)" }
B --> C@{ shape: hex, label: "Guangzhou Info Port Node" }
C --> B
B --> D@{ shape: hex, label: "Alibaba Cloud Node" }
D --> B
end
subgraph "Overseas MX Cluster"
B --> E@{ shape: hex, label: "North America MX Node" }
B --> F@{ shape: hex, label: "Europe MX Node" }
B --> G@{ shape: hex, label: "Asia-Pacific MX Node" }
end
subgraph "Email Delivery Targets"
E --> H@{ shape: rounded, label: "Enterprise Email System A" }
F --> H
G --> H
B --> I@{ shape: rounded, label: "Enterprise Email System B" }
end
class H,I primary
class A,B,C,D,E,F,G networkSDN Smart Delivery Network
Rule Management (SDNSVR)
SDNSVR is the core rule management system of the smart delivery network, responsible for managing and distributing delivery rules:
flowchart TD
classDef primary fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef network fill:#fff3e0,stroke:#ff9800,stroke-width:2px
classDef process fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
classDef storage fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
subgraph "SDN Rule Management"
A@{ shape: doc, label: "SDN Rule Configuration" } --> B@{ shape: rounded, label: "SDNRule Server" }
B --> C@{ shape: diam, label: "Rule Matching" }
C -->|SDNLocation| D@{ shape: rounded, label: "Region Matching" }
C -->|SDNNodeName| E@{ shape: rounded, label: "Node Name Matching" }
C -->|Domain| F@{ shape: rounded, label: "Domain Wildcard Matching" }
end
subgraph "Rule Distribution"
D --> G@{ shape: doc, label: "Generate Policy File tsdndispatch.so" }
E --> G
F --> G
G --> H@{ shape: rounded, label: "Delivery Agent Fetch Rules" }
end
subgraph "Delivery Execution"
H --> I@{ shape: diam, label: "Match Delivery Policy" }
I -->|Overseas Channel| J@{ shape: rounded, label: "SDN Proxy Overseas Delivery" }
I -->|Domestic Channel| K@{ shape: rounded, label: "Local Delivery" }
I -->|Spam Channel| L@{ shape: rounded, label: "Spam Channel" }
end
class B,H,K primary
class J network
class A,C,D,E,F,G,I,L processChannel Selection Strategy
The smart delivery network employs a four-tier channel mechanism, classifying deliveries based on anti-spam engine results:
- Normal email channel: Emails marked as normal by the anti-spam engine are delivered quickly through a dedicated channel with low latency
- Spam channel: Emails marked as spam by the anti-spam engine are queued for delivery through the spam channel with unstable latency
- Bounce channel: Non-bounce emails marked as spam by the anti-spam engine are automatically bounced after a 300-second timeout
- Discard channel: Bounce emails marked as spam by the anti-spam engine are automatically discarded after a 300-second timeout and 2 retries
Load Balancing Mechanism
Multiple levels of load balancing are implemented to ensure system stability:
flowchart TD
classDef primary fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef network fill:#fff3e0,stroke:#ff9800,stroke-width:2px
classDef process fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
classDef storage fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
subgraph "Business Layer"
A@{ shape: rounded, label: "Ops Management Platform" } --> B@{ shape: process, label: "Fetch Domain List" }
C@{ shape: rounded, label: "SDNSVR Rule Server" } --> D@{ shape: process, label: "Intelligent Scheduling" }
E@{ shape: rounded, label: "SaaS Platform MTA" } --> F@{ shape: process, label: "Anti-spam Engine" }
G@{ shape: rounded, label: "On-premise MTA" } --> F
end
subgraph "Acceleration Layer"
H@{ shape: hex, label: "Proxy Load Balancing" } --> I@{ shape: hex, label: "SDN Channel 01" }
H --> J@{ shape: hex, label: "SDN Channel 02" }
K@{ shape: hex, label: "TCP Load Balancing" } --> I
K --> J
end
subgraph "Service Layer"
L@{ shape: rounded, label: "MX Proxy" } --> M@{ shape: process, label: "MTA Delivery" }
M --> F
F -->|Result Feedback| M
F -->|Channel Selection| I
F -->|Channel Selection| J
end
B --> H
D --> K
I --> E
J --> G
class A,C,E,G,L primary
class H,I,J,K network
class B,D,F,M processMX Proxy Layer Design and Implementation
MXPROXY Architecture
MXPROXY is the core component of overseas email delivery, responsible for coordinating the operation of each subsystem:
flowchart TD
classDef primary fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef network fill:#fff3e0,stroke:#ff9800,stroke-width:2px
classDef process fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
classDef storage fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
subgraph "Service Layer"
MXProxy@{ shape: rounded, label: "MX Proxy" } --> MTA@{ shape: process, label: "MTA Delivery Service" }
MTA -->|Transmit Anti-spam Info| DA@{ shape: process, label: "Anti-spam Engine" }
end
subgraph "Acceleration Layer"
ProxyLB@{ shape: hex, label: "Proxy Load Balancing" } --> RSDN01@{ shape: hex, label: "Smart Delivery Network Channel 01" }
ProxyLB --> RSDN02@{ shape: hex, label: "Smart Delivery Network Channel 02" }
TCPLB@{ shape: hex, label: "TCP Load Balancing" } --> RSDN01
TCPLB --> RSDN02
end
subgraph "Business Layer"
CmOps@{ shape: rounded, label: "Ops Management Platform" } --> getDomain@{ shape: process, label: "Fetch Domain List" }
SDNSVR@{ shape: rounded, label: "Rule Server" } -->|Get SDN Info| TCPLB
OperatingMTA@{ shape: rounded, label: "SaaS Platform MTA" }
NonOperatingMTA@{ shape: rounded, label: "On-premise MTA" }
end
MXProxy -->|Pull Domain List| ProxyLB
ProxyLB -->|Pull Domain List| getDomain
RSDN01 -->|Select MTA by Anti-spam Tag| OperatingMTA
RSDN02 -->|Select MTA by Anti-spam Tag| NonOperatingMTA
MTA -->|Send Email Info| DA
DA -->|Get Anti-spam Tag| MTA
DA -->|Select SDN Channel| RSDN01
DA -->|Select SDN Channel| RSDN02
class MXProxy,CmOps,SDNSVR,OperatingMTA,NonOperatingMTA primary
class ProxyLB,RSDN01,RSDN02,TCPLB network
class MTA,DA,getDomain processConfiguration Management
MXPROXY configuration uses a modular design that supports multiple configuration methods:
| |
Transport Route Update Mechanism
PULL Configuration Mechanism
For email systems with multiple domains and high update frequency, a PULL configuration mechanism is used:
flowchart TD
classDef primary fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef network fill:#fff3e0,stroke:#ff9800,stroke-width:2px
classDef process fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
classDef storage fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
classDef alert fill:#ffcdd2,stroke:#c62828,stroke-width:2px
A@{ shape: process, label: "Scan Domain Config" } --> B@{ shape: process, label: "Fetch Remote Domain List" }
B --> C@{ shape: process, label: "MD5 Checksum" }
C --> D@{ shape: diam, label: "Content Changed?" }
D -->|Yes| E@{ shape: process, label: "Generate LUA Parse Script" }
E --> F@{ shape: process, label: "Parse Domain Config" }
F --> G@{ shape: doc, label: "Generate transport File" }
G --> H@{ shape: process, label: "Reload Configuration" }
D -->|No| I@{ shape: rounded, label: "Keep Current Config" }
H --> J@{ shape: process, label: "Delivery Service Update" }
class I primary
class A,B,C,E,F,G,H,J process
class D alertAuto-Update Script Features:
- Intelligent MD5 verification: Determines whether configuration has changed via MD5 values
- LUA-accelerated parsing: Uses LUA scripts to accelerate configuration file parsing
- Auto-reload mechanism: Automatically reloads services after configuration changes
- Error recovery mechanism: Supports configuration rollback and error recovery
PUSH Configuration Mechanism
For email systems with a single domain and low update frequency, a PUSH configuration mechanism is used.
Core Configuration File Example:
| |
Email Delivery Flow
The entire email delivery process uses an intelligent routing strategy:
flowchart TD
classDef primary fill:#e3f2fd,stroke:#1976d2,stroke-width:2px
classDef network fill:#fff3e0,stroke:#ff9800,stroke-width:2px
classDef process fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px
classDef storage fill:#e8f5e9,stroke:#4caf50,stroke-width:2px
classDef alert fill:#ffcdd2,stroke:#c62828,stroke-width:2px
A@{ shape: rounded, label: "Business System Sends Email" } --> B@{ shape: process, label: "Delivery Agent Delivers" }
B --> C@{ shape: diam, label: "Anti-spam Check" }
C -->|Normal Email| D@{ shape: diam, label: "SDN Rule Matching" }
C -->|Spam| E@{ shape: process, label: "Spam Processing" }
D -->|Overseas Email| F@{ shape: diam, label: "Target IP Region Check" }
D -->|Domestic Email| G@{ shape: rounded, label: "Local Delivery" }
F -->|Target IP != China| H@{ shape: hex, label: "SDN Overseas Channel Round-robin Delivery" }
F -->|Target IP = China| G
H --> I@{ shape: hex, label: "SDN Proxy 1" }
H --> J@{ shape: hex, label: "SDN Proxy 2" }
H --> K@{ shape: hex, label: "SDN Proxy N" }
I --> L@{ shape: rounded, label: "Delivery Complete" }
J --> L
K --> L
G --> L
class A,G,L primary
class H,I,J,K network
class B,E process
class C,F alertSummary and Experience
Technical Achievements
- Breaking through GFW interception: Effectively bypassed network restrictions through the smart delivery network’s multi-channel round-robin mechanism
- Improved delivery efficiency: Significantly increased email delivery speed through load balancing and intelligent routing
- Ensured email quality: Ensured normal emails are not affected by spam through the four-tier channel mechanism
- Reduced ops costs: Lowered operational complexity through automated configuration management and a unified monitoring platform
Key Technical Points
- Intelligent DNS resolution: Intelligently selects the optimal delivery path based on recipient domain
- Multi-level load balancing: Implements dual load balancing at both TCP and application layers
- Rule engine: Flexible SDN rule management supporting region, node, domain, and other matching conditions
- Automated operations: Automatic update and reload mechanisms for configuration files
Practical Application Results
Through this smart delivery network architecture, we achieved:
- Reduced delivery latency: Overseas email delivery latency reduced from an average of 30 seconds to under 5 seconds
- Improved delivery success rate: Increased from 85% to over 98%
- Enhanced system stability: MTBF (Mean Time Between Failures) increased from 72 hours to 720 hours
- Improved ops efficiency: Configuration update time reduced from hours to minutes
Future Optimization Directions
- Machine learning optimization: Introduce ML algorithms to predict optimal delivery paths based on historical data
- Intelligent fault diagnosis: AI-based fault prediction and automatic repair mechanisms
- Edge computing: Deploy more intelligent processing capabilities at edge nodes to reduce central node pressure
- Security hardening: Enhance anti-spam engine capabilities to improve email security
This smart delivery network architecture provides a complete solution for globalized email delivery, solving many pain points of traditional email delivery through technological innovation and providing reliable technical support for enterprise globalization.