技术解析
因为国服网的关系gmail已经是惨目忍睹,投递一封邮件简直感觉日了狗了,如下收集整理了三个方案只要有个墙外Linux的VPS或者服务器就能轻松解决问题了。
比较推荐使用第一种的xinetd作为service自动运行,第二种rinetd需要将命令写入启动自动运行(平时用的多)
其实这只能算是一个跳板,配置好后修改本机的hosts将对应的域名指向跳板IP。
注:因为是端口转发实现的,和跳板之间没有ssl所以会有一定的风险,请注意!
yum install -y xinetd
cat>/etc/xinetd.d/gmail<<EOF
service imap
{
type = UNLISTED
port = 993
bind = 0.0.0.0
socket_type = stream
wait = no
user = nobody
redirect = imap.gmail.com 993
per_source = UNLIMITED
cps = 100 2
}
service smtp-465
{
type = UNLISTED
port = 465
bind = 0.0.0.0
socket_type = stream
wait = no
user = nobody
redirect = smtp.gmail.com 465
per_source = UNLIMITED
cps = 100 2
}
service smtp-587
{
type = UNLISTED
port = 587
bind = 0.0.0.0
socket_type = stream
wait = no
user = nobody
redirect = smtp.gmail.com 587
per_source = UNLIMITED
cps = 100 2
}
EOF
service xinetd restart
cat>>/etc/rinetd.conf<<EOF
0.0.0.0 993 imap.gmail.com 993
0.0.0.0 465 smtp.gmail.com 465
0.0.0.0 578 smtp.gmail.com 578
EOF
socat TCP-LISTEN:993,fork TCP:imap.gmail.com:993
socat TCP-LISTEN:465,fork TCP:smtp.gmail.com:465
socat TCP-LISTEN:578,fork TCP:smtp.gmail.com:578