# 大量 SMTP 问题，无法通过不同服务器发送邮件

**URL:** <https://meta.discourse.org/t/lot-of-smpt-problems-cant-send-mails-via-different-servers/171209>\
**Category:** Self-hosting\
**Created:** [2020年十一月24日 20:25 UTC](https://meta.discourse.org/t/lot-of-smpt-problems-cant-send-mails-via-different-servers/171209 "2020-11-24T20:25:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fHainer](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@fHainer](https://meta.discourse.org/u/fHainer)\
**Post date:** [2020年十一月24日 20:25 UTC](https://meta.discourse.org/t/lot-of-smpt-problems-cant-send-mails-via-different-servers/171209/1 "2020-11-24T20:25:41Z")

</div>

你好，

我已在 Ubuntu 20.04 上按照官方方式搭建了一个新的 Discourse 实例，但无法配置邮件设置。这并非我第一次安装 Discourse，此前从未遇到过此类问题。

我最初使用的是德国提供商 [strato.de](http://strato.de) 的邮件服务器。从 Nextcloud 和 WordPress 连接并发送邮件均无问题。`discourse-doctor` 报告如下错误：`538 5.7.11 认证失败，请使用 SSL/TLS 加密连接`。我尝试设置 `DISCOURSE_SMTP_ENABLE_START_TLS: true`，并切换了端口 25、465 和 587（注：原文中的 476 应为 465）。

之后我尝试了另一台邮件服务器，问题依旧。

最后，我使用了一台在另一台 Discourse 实例中运行正常（该实例尚未更新至最新版本，这可能是关键点）的邮件服务器，并使用了完全相同的参数。遗憾的是，这里也无法建立连接。

通过 swake，我从同一系统成功访问了所有邮件服务器并能够发送邮件。

是当前版本存在 bug，还是我哪里操作有误？

感谢帮助！

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2020年十一月25日 00:04 UTC](https://meta.discourse.org/t/lot-of-smpt-problems-cant-send-mails-via-different-servers/171209/2 "2020-11-25T00:04:27Z")

</div>

> [@fHainer](#):
>
> 我尝试过设置 `DISCOURSE_SMTP_ENABLE_START_TLS: true`，并切换了端口 25、476 和 587。

在更改设置并再次尝试之前，你执行过 `./launcher rebuild app` 或 `./launcher destroy app; ./launcher start app` 吗？

---

<div class="post-metadata">

**Author:** ![fHainer](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@fHainer](https://meta.discourse.org/u/fHainer)\
**Post date:** [2020年十一月25日 11:15 UTC](https://meta.discourse.org/t/lot-of-smpt-problems-cant-send-mails-via-different-servers/171209/3 "2020-11-25T11:15:12Z")

</div>

我执行了 `./launcher rebuild app`，以为这是最安全的方法……

---

<div class="post-metadata">

**Author:** ![fHainer](https://avatars.discourse-cdn.com/v4/letter/f/7ba0ec/32.png) [@fHainer](https://meta.discourse.org/u/fHainer)\
**Post date:** [2020年十一月26日 10:09 UTC](https://meta.discourse.org/t/lot-of-smpt-problems-cant-send-mails-via-different-servers/171209/4 "2020-11-26T10:09:39Z")

</div>

有人知道如何在干净的系统上安装旧版本吗？
