# DigitalOcean + Siteground 通过 465 端口发送邮件无效（2525 端口可用）

**URL:** <https://meta.discourse.org/t/digitalocean-siteground-email-via-port-465-won-t-work-2525-will-work/125067>\
**Category:** Self-hosting\
**Created:** [2019 年8 月 6 日 23:38 UTC](https://meta.discourse.org/t/digitalocean-siteground-email-via-port-465-won-t-work-2525-will-work/125067 "2019-08-06T23:38:38Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![PackElend](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/packelend/32/95294_2.png) [@PackElend](https://meta.discourse.org/u/PackElend)\
发布日期： [2019 年8 月 6 日 23:38 UTC](https://meta.discourse.org/t/digitalocean-siteground-email-via-port-465-won-t-work-2525-will-work/125067/1 "2019-08-06T23:38:38Z")

</div>

你好，  
我在 Digital Ocean 上启动了一个 Discourse Droplet，本质上就是 Discourse 的 Docker 镜像。  
一切运行正常，直到我到达注册步骤：

> 我们已向 **`admin.discourse@ourdomain.coop`** 发送了一封激活邮件

但邮件从未收到。

```plaintext
tail -f /var/discourse/shared/standalone/log/rails/production.log
Sent mail to admin.discourse@ourdomain.coop (61113.9ms)
Job exception: Net::ReadTimeout

```

于是我尝试通过 telnet 发送邮件，结果成功了，但前提是必须使用 `AUTH PLAIN`，正如 [Using Telnet with an SMTP Server – That's Geeky](https://www.thatsgeeky.com/2011/01/using-telnet-with-an-smtp-server/) 中所述。  
随后我发现了一个如 [https://stackoverflow.com/questions/42272644/why-do-i-get-done-after-auth-login-command](https://stackoverflow.com/questions/42272644/why-do-i-get-done-after-auth-login-command) 中描述的 bug。

首先，我切换到端口 2525，并成功收到了邮件 _[Discourse] Confirm your new account_。于是我用 [https://www.base64encode.net/](https://www.base64encode.net/) 验证了新密码并重新构建了应用，但再次出现 `Job exception: Net::ReadTimeout`。  
之后我又改回端口 2525，这次没有收到邮件，但日志显示：

```plaintext
tail -f /var/discourse/shared/standalone/log/rails/production.log
Sent mail to admin.discourse@ourdomain.coop (61113.9ms)

```

这次没有 `Job exception: Net::ReadTimeout` 错误。

我现在完全懵了。

 ![grafik](https://global.discourse-cdn.com/meta/original/3X/8/6/86c362b7cdd3d06ff788c984d0bdc7f0664ce765.png)

```plaintext
DISCOURSE_SMTP_ADDRESS: itm13.siteground.biz
DISCOURSE_SMTP_PORT: 465
DISCOURSE_SMTP_USER_NAME: admin.discourse@ourdomain.coop
DISCOURSE_SMTP_PASSWORD: MyPassword

```

```plaintext
DISCOURSE_SMTP_ADDRESS: mail.ourdomain.coop 
DISCOURSE_SMTP_PORT: 2525
DISCOURSE_SMTP_USER_NAME: admin.discourse@ourdomain.coop
DISCOURSE_SMTP_PASSWORD: MyPassword

```

注意：没有使用括号、引号等特殊字符！

---

_[View the full topic](https://meta.discourse.org/t/digitalocean-siteground-email-via-port-465-won-t-work-2525-will-work/125067)._
