# Zoho 邮件身份验证在 Discourse 中无法正常工作

**URL:** https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327
**Category:** Self-hosting
**Created:** [2020年九月17日 08:56 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327 "2020-09-17T08:56:48Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![iackrishitech](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@iackrishitech](https://meta.discourse.org/u/iackrishitech)
#### Post date: [2020年九月17日 08:56 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327/1 "2020-09-17T08:56:48Z")

</div>

我已在 AWS Lightsail 的 Ubuntu 18.04 LTS 上安装了 Discourse。Zoho 邮件认证无法与 Discourse 配合使用，而 Mailgun 认证则运行正常。请协助解决此问题。

如何从服务器获取邮件生成及相关日志？

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [2020年九月17日 11:45 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327/2 "2020-09-17T11:45:02Z")

</div>

嘿 @iackrishitech，欢迎加入 Meta。

你能提供一下 app.yml 文件中的 SMTP 设置吗（请移除密码）？

---

<div class="post-metadata">

### Author: ![iackrishitech](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@iackrishitech](https://meta.discourse.org/u/iackrishitech)
#### Post date: [2020年九月18日 04:42 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327/3 "2020-09-18T04:42:08Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/3X/c/c/cc3967849739f6f5beaf8ddbfe98508208afbea4.png)

另外，我已尝试过启用和禁用 TLS 的情况。

**我们该如何获取此连接日志？**

谢谢，  
Kumar P

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [2020年九月18日 07:37 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327/4 "2020-09-18T07:37:11Z")

</div>

您的任何电子邮件账户是否启用了双重验证（2FA）？

如果是，您是否为 Discourse 创建了应用专用密码？

---

<div class="post-metadata">

### Author: ![Paari\_Vendhan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/paari_vendhan/32/194254_2.png) [@Paari\_Vendhan](https://meta.discourse.org/u/Paari_Vendhan)
#### Post date: [2020年九月18日 08:57 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327/5 "2020-09-18T08:57:16Z")

</div>

我是 @iackrishitech 的负责人，想在此补充一些信息。我们确认未启用 2FA，因为我们还有另一个类似的 Zoho SMTP 设置（另一个 Zoho 邮箱）用于另一台 Web 服务器，目前运行正常。

关于应用密码的问题，我将让 @iackrishitech 来回答，因为是他配置了这台服务器。

我发现管理面板中的邮件任务失败了。当我检查 Sidekiq 时，看到了以下信息：

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/4/b44815879637982379c9132bf5b4a3709745cd7b.png)

1. 这个“Wrapped EOFError”是否可能是导致我们失败的原因？如果是，为什么在 Mailgun 情况下能成功，而在 Zoho 中却不行？每次我尝试执行需要从 Discourse 向我的另一封邮箱发送邮件的操作时，这个问题都会一致地出现。

以下是我能够获取到的回溯信息（由于是新用户，无法附加文件）：

```plaintext
Message

Job exception: end of file reached

Backtrace

/usr/local/lib/ruby/2.6.0/net/protocol.rb:225:in `rbuf_fill'
/usr/local/lib/ruby/2.6.0/net/protocol.rb:191:in `readuntil'
/usr/local/lib/ruby/2.6.0/net/protocol.rb:201:in `readline'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:950:in `recv_response'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:935:in `block in getok'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:960:in `critical'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:933:in `getok'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:919:in `quit'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:612:in `do_finish'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:521:in `ensure in start'
/usr/local/lib/ruby/2.6.0/net/smtp.rb:521:in `start'
mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:109:in `start_smtp_session'
mail-2.7.1/lib/mail/network/delivery_methods/smtp.rb:100:in `deliver!'
mail-2.7.1/lib/mail/message.rb:2159:in `do_delivery'
mail-2.7.1/lib/mail/message.rb:260:in `block in deliver'
actionmailer-6.0.3.3/lib/action_mailer/base.rb:589:in `block in deliver_mail'
activesupport-6.0.3.3/lib/active_support/notifications.rb:180:in `block in instrument'
activesupport-6.0.3.3/lib/active_support/notifications/instrumenter.rb:24:in `instrument'
activesupport-6.0.3.3/lib/active_support/notifications.rb:180:in `instrument'
actionmailer-6.0.3.3/lib/action_mailer/base.rb:587:in `deliver_mail'
mail-2.7.1/lib/mail/message.rb:260:in `deliver'
actionmailer-6.0.3.3/lib/action_mailer/message_delivery.rb:115:in `block in deliver_now'
actionmailer-6.0.3.3/lib/action_mailer/rescuable.rb:17:in `handle_exceptions'
actionmailer-6.0.3.3/lib/action_mailer/message_delivery.rb:114:in `deliver_now'
/var/www/discourse/lib/email/sender.rb:226:in `send'
/var/www/discourse/app/jobs/regular/user_email.rb:61:in `execute'
/var/www/discourse/app/jobs/regular/critical_user_email.rb:15:in `execute'
/var/www/discourse/app/jobs/base.rb:232:in `block (2 levels) in perform'
rails_multisite-2.4.0/lib/rails_multisite/connection_management.rb:76:in `with_connection'
/var/www/discourse/app/jobs/base.rb:221:in `block in perform'
/var/www/discourse/app/jobs/base.rb:217:in `each'
/var/www/discourse/app/jobs/base.rb:217:in `perform'
sidekiq-6.1.2/lib/sidekiq/processor.rb:196:in `execute_job'
sidekiq-6.1.2/lib/sidekiq/processor.rb:164:in `block (2 levels) in process'
sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:138:in `block in invoke'
/var/www/discourse/lib/sidekiq/pausable.rb:138:in `call'
sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:140:in `block in invoke'
sidekiq-6.1.2/lib/sidekiq/middleware/chain.rb:143:in `invoke'
sidekiq-6.1.2/lib/sidekiq/processor.rb:163:in `block in process'
sidekiq-6.1.2/lib/sidekiq/processor.rb:136:in `block (6 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq/job_retry.rb:111:in `local'
sidekiq-6.1.2/lib/sidekiq/processor.rb:135:in `block (5 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq.rb:38:in `block in <module:Sidekiq>'
sidekiq-6.1.2/lib/sidekiq/processor.rb:131:in `block (4 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq/processor.rb:257:in `stats'
sidekiq-6.1.2/lib/sidekiq/processor.rb:126:in `block (3 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq/job_logger.rb:13:in `call'
sidekiq-6.1.2/lib/sidekiq/processor.rb:125:in `block (2 levels) in dispatch'
sidekiq-6.1.2/lib/sidekiq/job_retry.rb:78:in `global'
sidekiq-6.1.2/lib/sidekiq/processor.rb:124:in `block in dispatch'
sidekiq-6.1.2/lib/sidekiq/logger.rb:10:in `with'
sidekiq-6.1.2/lib/sidekiq/job_logger.rb:33:in `prepare'
sidekiq-6.1.2/lib/sidekiq/processor.rb:123:in `dispatch'
sidekiq-6.1.2/lib/sidekiq/processor.rb:162:in `process'
sidekiq-6.1.2/lib/sidekiq/processor.rb:78:in `process_one'
sidekiq-6.1.2/lib/sidekiq/processor.rb:68:in `run'
sidekiq-6.1.2/lib/sidekiq/util.rb:15:in `watchdog'
sidekiq-6.1.2/lib/sidekiq/util.rb:24:in `block in safe_thread'

```

这对我们来说是一个严重阻碍，恳请协助。（由于是新用户限制，无法添加更多截图，希望这些信息有所帮助）。

---

<div class="post-metadata">

### Author: ![iackrishitech](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@iackrishitech](https://meta.discourse.org/u/iackrishitech)
#### Post date: [2020年九月18日 09:38 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327/6 "2020-09-18T09:38:40Z")

</div>

感谢回复，Gavin。

此账户未启用双重验证（2FA）。不过，我已尝试为该账户创建应用专用密码，并将其配置在 app.yml 中，然后重新构建。但我们仍未收到邮件。

我们该如何查找确切的 SMTP 认证相关日志？

如何确认 Zoho 的邮件认证是否成功？

如果 Zoho 支持团队需要检查他们的日志，我们需要提供哪些信息（例如日志内容）？

谢谢，  
Kumar P

---

<div class="post-metadata">

### Author: ![iackrishitech](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@iackrishitech](https://meta.discourse.org/u/iackrishitech)
#### Post date: [2020年九月18日 10:13 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327/7 "2020-09-18T10:13:00Z")

</div>

你好，Gavin，

我做了以下更改：

1. 启用了 Zoho 应用密码，并将其配置在 Discourse 的 App.yml 文件中。
2. 将 TLS 设置为 true，端口设置为 587。
3. 在 App.yml 中启用了以下行，并指定了认证邮箱：

> - exec: rails r “SiteSetting.notification\_email=‘forum@iackrishitech.com’”

现在邮件功能运行正常。

非常感谢你提到 Zoho 的应用密码。

非常感谢你的详细说明，@Paari_Vendhan

谢谢，  
Kumar P

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2020年十月18日 10:13 UTC](https://meta.discourse.org/t/zoho-email-authentication-not-working-with-discourse/164327/8 "2020-10-18T10:13:02Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
