# 错误 — 535 认证失败

**URL:** https://meta.discourse.org/t/error-535-auth-failure/273959
**Category:** Self-hosting
**Tags:** email
**Created:** [2023年八月4日 12:51 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959 "2023-08-04T12:51:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![slajar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slajar/32/319253_2.png) [@slajar](https://meta.discourse.org/u/slajar)
#### Post date: [2023年八月4日 12:51 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/1 "2023-08-04T12:51:29Z")

</div>

基本上，我遇到了与此处描述的相同问题：[https://meta.discourse.org/t/job-exception-535-authentication-failed/172537](https://meta.discourse.org/t/job-exception-535-authentication-failed/172537)

出于某种原因，我们的电子邮件外发不再工作，现在我收到错误 535。我重新检查了电子邮件帐户。我可以登录并使用 Apple Mail。我也用 Apple Mail 测试了 SMTP 邮件发送。但是 Discourse 给了我这个错误消息“ERROR – 535 auth failure”。我不确定如何进行。SMTP 是否仍然受支持？

我到目前为止的测试：

1. 我尝试了不同的邮件帐户
2. 我使用其他邮件软件测试了邮件帐户
3. 我已更新到最新的 Discourse 版本。（3.2.0.beta1-dev）

任何帮助都将不胜感激。

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [2023年八月4日 13:56 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/2 "2023-08-04T13:56:08Z")

</div>

也许可以看看这里？

> [@Troubleshoot email on a new Discourse install](https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326):
>
> You just installed Discourse via [the install guide](https://github.com/discourse/discourse/blob/master/docs/INSTALL.md), but email doesn’t seem to work. Unfortunately this means you can’t log in as an admin to finalize the install. cry Let’s troubleshootize! Try the doctor woman_health_workerIf you run ./discourse-doctor it will check several ways that your mail configuration might be broken, and offer advice. Try that first. Did you enter email settings correctly? The simplest way is to run ./discourse-setup again. Did you enter everything correctly? B…

---

<div class="post-metadata">

### Author: ![slajar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slajar/32/319253_2.png) [@slajar](https://meta.discourse.org/u/slajar)
#### Post date: [2023年八月25日 06:18 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/4 "2023-08-25T06:18:59Z")

</div>

是的，我试过了。但错误仍然存在。

还有什么我们可以尝试的吗？任何帮助都将不胜感激。

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2023年八月29日 12:14 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/6 "2023-08-29T12:14:40Z")

</div>

您是否有更详细的错误副本？

通过搜索，您可以尝试在您的 app.yml 中检查并重新输入您的凭据。

---

<div class="post-metadata">

### Author: ![slajar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slajar/32/319253_2.png) [@slajar](https://meta.discourse.org/u/slajar)
#### Post date: [2023年九月5日 11:15 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/7 "2023-09-05T11:15:34Z")

</div>

抱歉，我不知道如何在此处检索更多详细信息。在这种情况下，是否有启用更多调试信息的选项？命令行没有上下文。错误出现在用户界面中。

---

<div class="post-metadata">

### Author: ![slajar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/slajar/32/319253_2.png) [@slajar](https://meta.discourse.org/u/slajar)
#### Post date: [2023年九月11日 07:58 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/8 "2023-09-11T07:58:37Z")

</div>

有没有类似详细的调试输出？

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [2023年九月11日 17:23 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/10 "2023-09-11T17:23:58Z")

</div>

还有什么信息会有帮助？远程服务器提示您身份验证失败。我们能说的就这么多了。

您是否为此邮件帐户启用了 2FA 或 MFA？这可能会阻止 SMTP AUTH 工作。

如果不是，您能否手动尝试 SMTP 以查看身份验证是否有效？

您需要先构建身份验证字符串（`username␀username␀password` 的 base64 编码字符串）

我建议使用 Python：

```plaintext
○ → ipython3

In [1]: import base64

In [2]: import getpass

In [3]: u, p = 'michael', getpass.getpass()
Password: (在此处粘贴或输入密码)

In [4]: base64.b64encode(f'{u}\\x00{u}\\x00{p}'.encode()).decode()
Out[4]: 'bWlxxxxxxxxxxxxxxxxxxxxxxxxxxx'

```

（如果您这样做，请将 `michael` 更改为您实际的 SMTP 用户名）

🚨 **请勿分享此字符串，它是您的明文密码**

然后手动进行 SMTP，例如：

```plaintext
○ → openssl s_client -starttls smtp -connect mail.my.domain:587
CONNECTED(00000003)
…
---
250 SMTPUTF8
AUTH PLAIN bWljaGFlbABtaWNoYWVsAHBhc3N3b3Jk ← 密码“password”
535 5.7.8 Error: authentication failed: authentication failure
AUTH PLAIN bWlxxxxxxxxxxxxxxxxxxxxxxxxxxx ← 真实密码
235 2.7.0 Authentication successful
RSET
250 2.0.0 Ok
QUIT
221 2.0.0 Bye
closed

```

如果那_不起作用_，凭据可能确实有问题。如果它_确实有效_……我们将进一步研究。

---

<div class="post-metadata">

### Author: ![tikidave](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tikidave/32/379269_2.png) [@tikidave](https://meta.discourse.org/u/tikidave)
#### Post date: [2024年十月22日 13:56 UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/11 "2024-10-22T13:56:17Z")

</div>

在我的例子中，它不喜欢我的密码，我需要将其重置为字母数字（无特殊字符）。
