# DISCOURSE\_SMTP\_AUTHENTICATION没有文档？都不行

**URL:** https://meta.discourse.org/t/discourse-smtp-authentication-no-documentation-none-not-working/363411
**Category:** Self-hosting
**Tags:** email
**Created:** [2025年四月25日 08:03 UTC](https://meta.discourse.org/t/discourse-smtp-authentication-no-documentation-none-not-working/363411 "2025-04-25T08:03:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![inquiry](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@inquiry](https://meta.discourse.org/u/inquiry)
#### Post date: [2025年四月25日 08:03 UTC](https://meta.discourse.org/t/discourse-smtp-authentication-no-documentation-none-not-working/363411/1 "2025-04-25T08:03:33Z")

</div>

我在论坛上看到，可以将 `DISCOURSE_SMTP_AUTHENTICATION` 设置为 `none`，这样 smtp 就不会提供用户名和密码。

```plaintext
DISCOURSE_SMTP_AUTHENTICATION: none

```

但是当我将其设置为 none 并尝试 `discourse-doctor` 时，我收到：

```plaintext
======================================== ERROR ========================================
                                    UNEXPECTED ERROR

Invalid authentication method. Must be plain, login, or cram_md5.

====================================== SOLUTION =======================================
This is not a common error. No recommended solution exists!

Please report the exact error message above to https://meta.discourse.org/
(And a solution, if you find one!)

```

当我尝试登录时，我收到：

```plaintext
postfix-email-server-1 | 2025-04-25T05:48:22.788077+00:00 INFO postfix/smtpd[3330]: connect from unknown[172.17.0.1]
postfix-email-server-1 | 2025-04-25T05:48:22.794598+00:00 INFO postfix/smtpd[3330]: lost connection after AUTH from unknown[172.17.0.1]
postfix-email-server-1 | 2025-04-25T05:48:22.794735+00:00 INFO postfix/smtpd[3330]: disconnect from unknown[172.17.0.1] ehlo=2 starttls=1 auth=0/1 commands=3/4
postfix-email-server-1 | 2025-04-25T06:00:09.568494+00:00 INFO postfix/smtpd[3340]: connect from unknown[172.17.0.1]
postfix-email-server-1 | 2025-04-25T06:00:09.576873+00:00 INFO postfix/smtpd[3340]: lost connection after AUTH from unknown[172.17.0.1]
postfix-email-server-1 | 2025-04-25T06:00:09.576989+00:00 INFO postfix/smtpd[3340]: disconnect from unknown[172.17.0.1] ehlo=2 starttls=1 auth=0/1 commands=3/4
postfix-email-server-1 | 2025-04-25T06:06:44.547155+00:00 INFO postfix/smtpd[3330]: connect from unknown[172.17.0.1]
postfix-email-server-1 | 2025-04-25T06:06:44.561004+00:00 INFO postfix/smtpd[3330]: lost connection after AUTH from unknown[172.17.0.1]
postfix-email-server-1 | 2025-04-25T06:06:44.561158+00:00 INFO postfix/smtpd[3330]: disconnect from unknown[172.17.0.1] ehlo=2 starttls=1 auth=0/1 commands=3/4
postfix-email-server-1 | 2025-04-25T06:07:20.702285+00:00 INFO postfix/smtpd[3340]: connect from unknown[172.17.0.1]
postfix-email-server-1 | 2025-04-25T06:07:20.712755+00:00 INFO postfix/smtpd[3340]: lost connection after AUTH from unknown[172.17.0.1]
postfix-email-server-1 | 2025-04-25T06:07:20.712960+00:00 INFO postfix/smtpd[3340]: disconnect from unknown[172.17.0.1] ehlo=2 starttls=1 auth=0/1 commands=3/4
postfix-email-server-1 | 2025-04-25T06:07:57.695045+00:00 INFO rsyslogd: -- MARK --

```

销毁并重建也没有帮助。  
我在 Discourse 之外测试了我的邮件发送器，它可以正常工作。我使用的是 [bokysan/docker-postfix](https://github.com/bokysan/docker-postfix)，它不需要登录，我对它很满意。  
我知道另一个相关的帖子，但 `none` 选项在那里似乎是一个有效的选项：

> [@Can't use 'none' DISCOURSE\_SMTP\_AUTHENTICATION](https://meta.discourse.org/t/cant-use-none-discourse-smtp-authentication/55833):
>
> According to [https://github.com/discourse/discourse/wiki/Global-configuration-options](https://github.com/discourse/discourse/wiki/Global-configuration-options), I should be able to set DISCOURSE\_SMTP\_AUTHENTICATION: 'none' in the env: section of my app.yml configuration file in order to “completely disable authentication”. I’m trying to deploy Discourse inside an organization with a private email server which allows to send email from specific IPs internally but requires the applications to disable authentication when talking to it. When I set DISCOURSE\_SMTP\_AUTHENT…

---

<div class="post-metadata">

### Author: ![inquiry](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@inquiry](https://meta.discourse.org/u/inquiry)
#### Post date: [2025年四月25日 15:15 UTC](https://meta.discourse.org/t/discourse-smtp-authentication-no-documentation-none-not-working/363411/2 "2025-04-25T15:15:15Z")

</div>

我已经通过注释掉 `containers/app.yml` 中的以下行来修复它

```plaintext
    #DISCOURSE_SMTP_USER_NAME: user@example.com
    #DISCOURSE_SMTP_PASSWORD: pa$$word

```

---

<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: [2025年五月25日 15:16 UTC](https://meta.discourse.org/t/discourse-smtp-authentication-no-documentation-none-not-working/363411/3 "2025-05-25T15:16:04Z")

</div>

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