Accelerate Zoho Mail with Nginx Port Forwarding
Zoho Mail is a foreign email service provider offering both free and paid plans. Recently, they launched the "MAIL LITE" package, starting at just $1/month, which supports unlimited email aliases (paid plans only), making it an excellent choice for individual website owners. However, since Zoho Mail's servers are located in the US, the latency in China can reach 300ms, which is quite slow.

In a previous article, Using Nginx for TCP/UDP Port Forwarding, we shared how to use Nginx for port forwarding to improve poor direct connection speeds. Here, we will use Nginx port forwarding to accelerate Zoho Mail sending and receiving.
Port Forwarding Use Cases
When direct connection to a service is slow or suffers from severe packet loss, an additional server can be used as a relay to improve performance. Xiaoz has drawn a simple flowchart below (created using ProcessOn).

Preparation
- Prepare a server with stable latency to both the client and the Zoho Mail server. Here, Xiaoz uses a BandwagonHost GIA CN2 VPS.
- Install Nginx and ensure the
streammodule is enabled. Refer to: Using Nginx for TCP/UDP Port Forwarding.
Add Configuration File
Add the following configuration to nginx.conf:
stream {
# Forward BandwagonHost VPS port 465 to smtp.zoho.com
server {
listen 465;
proxy_connect_timeout 5s;
proxy_timeout 20s;
proxy_pass smtp.zoho.com:465;
}
# Forward BandwagonHost VPS port 993 to imap.zoho.com
server {
listen 993;
proxy_connect_timeout 5s;
proxy_timeout 20s;
proxy_pass imap.zoho.com:993;
}
}
After modification, test the configuration with nginx -t. Once confirmed, reload Nginx to apply changes (nginx -s reload). Additionally, ensure that ports 465 and 993 are allowed through the firewall.
smtp.zoho.com: The SMTP address for Zoho Mail.imap.zoho.com: The IMAP address for Zoho Mail.
Finally, when configuring your email client, simply enter the BandwagonHost IP address instead of the Zoho Mail connection address, effectively acting as a relay.
Summary
Port forwarding has broad applications, suitable for scenarios with poor network conditions or traffic filtering. The method described above can also be applied to forward other email services or accelerate other business operations; the underlying principle remains the same: using an additional server for traffic relay.
Additionally, Nginx provides a dedicated mail module for email proxying. However, Xiaoz has not yet studied its implementation principles. Experts are invited to explain which method yields better results.