Dev.to
7/19/2026

Sending Gmail from behind China's Great Firewall — six attempts that failed
Short summary
A developer in Guangzhou spent over an hour trying six programmatic approaches to send Gmail behind China's Great Firewall, all failing due to DPI on SMTP SNI, Windows TLS bugs, and proxy routing issues. Python smtplib, curl, PySocks, raw sockets, and Node.js all failed at the TLS handshake stage. The solution was simply using Gmail's web interface, which works because HTTPS with TLS 1.3 and Encrypted Client Hello encrypts the SNI that GFW inspects on SMTP.
- •All six programmatic Gmail SMTP approaches failed due to GFW deep packet inspection on plaintext SNI
- •Windows-specific TLS bugs in Python 3.9, curl schannel, and PySocks compounded the problem
- •Gmail Web works because TLS 1.3 with ECH encrypts the SNI that GFW pattern-matches on SMTP
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



