日记男孩的博客

Digital Ocean 的VPS服务器是无法开放用来发送邮件 SMTP 25端口的

之前买了台 DigitalOcean  的服务器,用了几天速度性能各方面还是可以的,文章可以这里去看:

国外VPS服务器 DigitalOcean 注册购买教程 使用赚送的100美元白嫖2个月

这2天在DO上面搭建了一个 宝塔 邮局,可以正常收信,但是却无法发信。目前大部分的VPS都是关闭SMTP端口 无法发邮件的。

试了在 宝塔 面板里打开25端口, 也试了在  DigitalOcean  后台打开25端口。都是无法收信。

于是发送了个Ticket给客服,可以在这个地方找到客服,当然是写工单的方式了,老外貌似不流行在线客服:

 

让他给我开放25端口:

Hi, can you Please help me open port 25 service Thank you

 

得到的答复是没有办法 给我们开放SMTP端口,主要是担心用户滥发邮件,如图:

 

当然 客服也给出了解决方案,有兴趣的可以看看吧,给出 原文 :

Hello there,

Thank you for contacting DigitalOcean.

Our apologies for any inconvenience caused here. Stopping spam is a constant fight and due to this, your account has restrictions specifically on port 25.

However, you are able to use mail services using ports 587, 993, 995 and 465. You will need to open these ports in your firewall. Here is our guide to common iptables commands:

https://www.digitalocean.com/community/tutorials/iptables-essentials-common-firewall-rules-and-commands#service-mail

We realize this is inconvenient for sending mail from your Droplet. As a solution, you can consider using a third party service such as SendGrid or similar to processes mail there instead of your Droplet. We apologize for the frustration but we're not able to lift this port restriction at this time.

In terms of a workaround, here are a few alternatives:

1. Utilize port 587 for SMTP relay via another mail provider, for example, G Suite/Gmail, Mailgun, etc. We have a guide on doing so using Postfix here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-mail-relay-with-postfix-and-mailgun-on-ubuntu-16-04

2. Configure your app or service to send mail directly using either an SMTP client connection (typically using port 587), or API call via another mail provider such as Sendgrid, Mailgun, Mandrill, etc.

Please note that with this restriction in place on port 25, mail servers hosted here will be unable to directly relay email to other mail servers, as communication between mail servers typically takes place on port 25.

We think the API is the best solution, as it is honestly more scalable and what we would use if we wanted to "future proof" the project.

Please let us know in case of any further questions. We're always here to help.

Regards,

Nazim Abbas
Developer Experience Specialist
DigitalOcean

 

英文看的头大的 就用翻译过的给你看下了:

你们好。

谢谢您与DigitalOcean联系。

我们对这里造成的任何不便表示歉意。阻止垃圾邮件是一场持久战,由于这个原因,您的账户特别对端口25有限制。

然而,您可以使用587、993、995和465端口的邮件服务。你将需要在你的防火墙中打开这些端口。下面是我们对常见的iptables命令的指南。

https://www.digitalocean.com/community/tutorials/iptables-essentials-common-firewall-rules-and-commands#service-mail

我们意识到这对于从您的Droplet发送邮件是不方便的。作为一个解决方案,你可以考虑使用第三方服务,如SendGrid或类似的服务,在那里处理邮件,而不是你的Droplet。我们为您的挫折感到抱歉,但我们目前无法解除这一端口限制。

就解决方法而言,这里有几个替代方案。

1. 通过另一个邮件供应商,例如G Suite/Gmail、Mailgun等,利用端口587进行SMTP中继。我们在这里有一个关于使用Postfix的指南。

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-mail-relay-with-postfix-and-mailgun-on-ubuntu-16-04

2. 2. 配置你的应用程序或服务,直接使用SMTP客户端连接(通常使用端口587),或通过另一个邮件提供商(如Sendgrid、Mailgun、Mandrill等)的API调用发送邮件。

请注意,由于对端口25的限制,托管在这里的邮件服务器将无法直接转发邮件到其他邮件服务器,因为邮件服务器之间的通信通常在端口25进行。

我们认为API是最好的解决方案,因为说实话,它的可扩展性更强,如果我们想 "未来证明 "这个项目,我们会使用它。

如果有任何进一步的问题,请让我们知道。我们一直在这里提供帮助。

请注意。

纳齐姆-阿巴斯
开发者体验专家
数字海洋公司

ref:_00Df218t5m._5004P1s1RqW:ref

通过www.DeepL.com/Translator(免费版)翻译

 

至于为什么不开放SMTP端口,可以看看他们的回答:

https://docs.digitalocean.com/support/why-is-smtp-blocked/

Why is SMTP blocked?
SMTP port 25 is blocked on all Droplets for some new accounts to prevent spam and other abuses of our platform. To send mail on these accounts, use a dedicated email deliverability platform (such as Sendgrid and Mailgun), which are better at handling deliverability factors like IP reputation.

Even on accounts where SMTP is available, we recommend against running your own mail server in favor of using a dedicated email deliverability platform.

 

其实说白了 就是担心别人用他们的VPS来群发垃圾邮件了, 也是可以理解的。

 

可以在SSH上输入下面这条命令 看看你VPS的25端口有没有打开:

netstat -anltup | grep :25

 

你我的VPS没有打开25端口的,是这样的:

 

打开了25端口的,是这样的:

 

虽然不能在VPS上搭建的邮局去发邮件,但我们还是可以通过很多第三方的网站来搭建企业邮局来发信的。比如ZOHO等。

 

 

转载请注明:日记男孩的博客 » Digital Ocean 的VPS服务器是无法开放用来发送邮件 SMTP 25端口的

赞赏

微信赞赏支付宝赞赏

退出移动版