Featured image of post DigitalOcean无法使用SMTP问题的解决

DigitalOcean无法使用SMTP问题的解决

DigitalOcean还算好用,不过这几天我才发现它默认是关闭了SMTP端口的,需要自行开工单解封。(提供商此举是为了避免垃圾邮件)

DigitalOcean是我现在正在使用的VPS提供商,SFO机房速度还是不错的,不过最近几天换了IP之后发现Wordpress的SMTP插件一直提示timed out

WordPress的SMTP插件实际都是使用的 PHPMailer ,在Github寻找排查了很久也没有发现问题,一般来讲排查方式一是ping,例如ping -c 10 smtp.gmail.com

直接在服务器SSH上ping十次Gmail的SMTP服务器,发现VPS能解析也能ping上,完全没有问题,后来直接把iptables的进、出、转发全部开放,依旧是改不了timed out的错误

于是我就只能使用Telnet测试连通性:telnet smtp.gmail.com 587

如果是正常情况下,返回如下:

1
2
3
4
Trying 173.194.67.109...
Connected to gmail-smtp-msa.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP ex2sm16805587wjd.30 - gsmtp

但是在DigitalOcean上却依旧timed out,就算是重装系统,更换IP,在纯洁无改动的系统下依旧没有任何改观,看来不是VPS上既有程序或者防火墙的问题。

无奈只能提交ticket。

没想到这个问题居然就是DigitalOcean本身导致的,开ticket后,客服告诉我为了防止spammer默认屏蔽了SMTP等E-Mail相关的服务,必须联系他们才能开通。

Hey there, Thanks for writing! To curb a recent increase in abuse and SPAM, we have an initial SMTP block on new accounts created in certain contexts. To remove that block we’d like to do some manual account verification. Please let us know the following: – Your Name – Location – Phone Number – The reason you are requesting the removal of the SMTP block Also, please provide as many of the following as you can to help us verify your identity: – Your public Twitter handle – Your blog – Your company or personal website – Your public Facebook profile

要申请取消封锁还需要提供一些信息帮助验证,回复后等了整整一天后才得到回复,告之自己的账户的邮件服务已经被解锁。不得不说DO的ticket回复速度还是非常慢的…可能是中间换了部门所致(回复的是Trust & Safety Team)

客服回复如下:

Thanks for the info and for your patience!

I’ve enabled mail-related traffic on your account.

As a reminder, we take SPAM very seriously as we comply fully with the CAN-SPAM Act. If you’re not familiar, this says that you may not send bulk email unless you maintain a double-authorized list of subscribed members including IP addresses and relevant contact information. Also, you must follow guidelines for including removal links with all sent emails according to the CAN-SPAM Act.

看来spammer是在太多默认禁止SMTP了,不过总算是解决了

虽然严格把控是好事情,但是这类还是提前说说最好啊,折腾了好大一圈结果发现是运营商自己的问题,自己却瞎折腾了好久才知道。

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus