我不知道SMTP服务出了什么问题

我使用 mailgun.com 的服务发送邮件,但按照教程设置的 SMTP 不起作用。我甚至无法完成管理员注册

日志 shared/standalone/log/rails/production.log

Started GET "/finish-installation/register" for 54.151.175.32 at 2023-01-11 18:37:43 +0000
Processing by FinishInstallationController#register as HTML
  Rendered finish_installation/register.html.erb within layouts/finish_installation (Duration: 8.2ms | Allocations: 750)
  Rendered layout layouts/finish_installation.html.erb (Duration: 33.4ms | Allocations: 3008)
Completed 200 OK in 54ms (Views: 36.7ms | ActiveRecord: 0.0ms | Allocations: 4064)
Started POST "/finish-installation/register" for 54.151.175.32 at 2023-01-11 18:37:45 +0000
Processing by FinishInstallationController#register as HTML
  Parameters: {"authenticity_token"=>"rxWiZY9rnT7TRGYXw*****************************iBAFuOoz7pQA", "email"=>"*************************@gmail.com", "username"=>"youyou", "password"=>"[FILTERED]", "commit"=>"Register"}
start
Redirected to https://bbs.doublekm.xyz/finish-installation/confirm-email
Completed 302 Found in 47ms (ActiveRecord: 0.0ms | Allocations: 2579)
  Rendered layouts/email_template.html.erb (Duration: 1.1ms | Allocations: 35)
Started GET "/finish-installation/confirm-email" for 54.151.175.32 at 2023-01-11 18:37:45 +0000
Processing by FinishInstallationController#confirm_email as HTML
  Rendered finish_installation/confirm_email.html.erb within layouts/finish_installation (Duration: 2.5ms | Allocations: 380)
  Rendered layout layouts/finish_installation.html.erb (Duration: 21.1ms | Allocations: 2643)
Completed 200 OK in 26ms (Views: 22.8ms | ActiveRecord: 0.0ms | Allocations: 3240)
Job exception: Net::SMTPUnknownError

fail

SMTP settings

  DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: postmaster@sandboxba2******************d8f.mailgun.org
  DISCOURSE_SMTP_PASSWORD: "4223*********************************************5f57"
  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)
  DISCOURSE_SMTP_DOMAIN: sandboxba22************************8d8f.mailgun.org
  DISCOURSE_NOTIFICATION_EMAIL: no-reply@sandboxba22***************d8f.mailgun.org
  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
  LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
[root@GreenCloud discourse]# telnet smtp.mailgun.org 587
Trying 34.83.33.178...
Connected to smtp.mailgun.org.
Escape character is '^]'.
220 Mailgun Influx ready
quit
221 See you later. Yours truly, Mailgun
Connection closed by foreign host.

您需要检查安全选项,因为它不是很精确,您需要将其关闭(同时不影响您的安全性)。

您为什么要为 Mailgun 使用沙盒账户?您应该使用与您的社区域名对应的 postmaster 账户。

您在添加和授权与您的社区对应的域名时遇到问题了吗?

您的社区配置为从哪个电子邮件地址发送电子邮件?

您需要禁用沙盒模式,我认为该模式只能发送到单个地址。没有理由不正确配置 Mailgun。

请参阅疑难解答新 Discourse 安装中的电子邮件

我使用 Mailu 构建了一个 SMTP 服务,可以收发邮件

但这次仍然是错误的

而且我也无法通过 Foxmail 登录

SMTP 设置

Discourse 设置

哦,我通过打开 SSL 解决了这个问题


这是否意味着我应该为 Discourse 打开 SSL 设置?

所以你放弃了 mailgun,决定使用一个没人听说过的东西?

它说它不允许你从 norepy@bbs.doublekm.xzy 发送。将通知电子邮件更改为 Makima@bbs.doublekm.xyz,看看是否有效。