使用 Exchange 作为 SMTP 无法工作

你好,
我是新用户。在全新安装后,我试图获取确认邮件,但卡住了。
我知道我们的 SMTP 服务器是 Exchange 服务器。
按照建议,我已将 DISCOURSE_SMTP_AUTHENTICATION 参数从 plain 改为 login
我遵循了此处描述的流程:https://meta.discourse.org/t/troubleshooting-email-on-a-new-discourse-install/16326/2
我也尝试了此处提到的潜在解决方案:
https://meta.discourse.org/t/smtp-exchange-server-problem/27826,以及此处:
https://meta.discourse.org/t/smtp-connection-problem-docker-installation/41981
但我仍然遇到 discourse-doctor 错误:
意外错误
504 5.7.4 无法识别的认证类型

任何帮助都将不胜感激。
谢谢

1 个赞

好吧,
我需要进一步操作,因此我尝试了一个变通方案:在我的主机上安装 Postfix,以便从 Discourse 中继邮件。但由于我对 Docker 缺乏经验,遇到了问题。
我的配置如下:

  • 主机网络:
    docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:78:b6:18:3c brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 scope global docker0
    Discourse 网络:
    “Gateway”: “172.18.0.1”,
    “IPAddress”: “172.18.0.3”,
    “IPPrefixLen”: 16,

  • Postfix:
    mynetworks = 172.16.0.0/12, 127.0.0.0/8

  • container/app.yml:
    DISCOURSE_SMTP_AUTHENTICATION: none
    DISCOURSE_SMTP_ADDRESS: 172.17.0.1
    DISCOURSE_SMTP_PORT: 25

discourse-doctor 输出:
=== 错误 ===
连接被拒绝
连接被拒绝 - 无法连接到 “172.17.0.1” 的 25 端口
问题出在哪里?

1 个赞

请在您的 app.yml 文件中尝试以下配置:

DISCOURSE_SMTP_AUTHENTICATION: login
DISCOURSE_SMTP_ADDRESS: smtp.example.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: "yourusername"
DISCOURSE_SMTP_PASSWORD:  "yourpassword"
DISCOURSE_SMTP_ENABLE_START_TLS: true
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none

并在文件末尾添加:

- exec: rails r "SiteSetting.notification_email='yourusername@example.com'"

请注意,DISCOURSE_SMTP_USER_NAME 与 SiteSetting.notification_email 中邮箱地址的用户名部分必须一致。

例如,如果您使用 noreply@example.com,有时可能无法正常工作,因为服务器上启用了某些安全检查,确保用户名与用户邮箱地址相匹配。

希望这对您有所帮助。

3 个赞

谢谢 Mik,
这解决了我的问题。

1 个赞

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