发送邮件时遇到问题

您好。

在邮件服务器切换后,我尝试发送邮件,之前一切正常,但现在我无法发送邮件。问题是,连接是100%正常的,正如您所见。但由于某些原因,它无法发送邮件。

用于邮件测试的电子邮件地址?(输入“n”跳过)[community@brohosting.eu]:
正在发送邮件至 community@brohosting.eu. . .
正在使用 smtppro.zoho.eu:587,用户名:info@brohosting.eu 和登录认证测试发送至 community@brohosting.eu。
SMTP 服务器连接成功。
正在发送至 community@brohosting.eu. . .
发送邮件失败。
已到达文件末尾

有什么建议吗?

检查您的 VPS 托管服务提供商是否已解锁 SMTP 端口(尽管连接似乎已确认)……同时检查您的电子邮件服务日志以获取请求的证据。

1 个赞

它像以前一样在我的树莓派上运行。但是的,连接很好。我会与 Zoho 确认。

我以前见过“文件结尾”的消息,但不记得解决方法是什么了。你可以在这里搜索一下,也许能找到。

其实这不应该有什么解决方案。如果连接成功了,我为什么要修改任何东西?

另外,是的,我找到了几个类似的主题,还有一个你回复过的帖子,但我不会回退到已弃用的 465 端口。显然,问题出在 Discourse 或其邮件发送库上。

您介意分享您已编辑的 app.yml 文件吗?我认为您的 SMTP 部分缺少了什么,或者配置有误。

1 个赞

如果连接成功,它将如何配置错误?

## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed


templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#  - "templates/web.ssl.template.yml"
#  - "templates/web.letsencrypt.ssl.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
  - "8080:8080"   # http
  - "15432:5432" # PostgreSQL
#  - "8443:8443" # https

params:
  db_default_text_search_config: "pg_catalog.english"

  ## Set db_shared_buffers to a max of 25% of the total memory.
  ## will be set automatically by bootstrap based on detected RAM, or you can override
  #db_shared_buffers: "256MB"

  ## can improve sorting performance, but adds memory usage per-connection
  #db_work_mem: "40MB"

  ## Which Git revision should this container use? (default: tests-passed)
  #version: tests-passed

env:
  LC_ALL: en_US.UTF-8
  LANG: en_US.UTF-8
  LANGUAGE: en_US.UTF-8
  EMBER_CLI_PROD_ASSETS: 1
  # DISCOURSE_DEFAULT_LOCALE: en

  ## How many concurrent web requests are supported? Depends on memory and CPU cores.
  ## will be set automatically by bootstrap based on detected CPUs, or you can override
  #UNICORN_WORKERS: 3

  ## TODO: The domain name this Discourse instance will respond to
  ## Required. Discourse will not work with a bare IP number.
  DISCOURSE_HOSTNAME: community.brohosting.eu

  ## Uncomment if you want the container to be started with the same
  ## hostname (-h option) as specified above (default "$hostname-$config")
  #DOCKER_USE_HOSTNAME: true

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example 'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: 'community@brohosting.eu'

  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  # SMTP ADDRESS, username, and password are required
  # WARNING the char '#' in SMTP password can cause problems!
  DISCOURSE_SMTP_ADDRESS: smtppro.zoho.eu
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: info@brohosting.eu
  DISCOURSE_SMTP_PASSWORD: "XXXXXXXXXXXX"
  DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)
  DISCOURSE_SMTP_DOMAIN: brohosting.eu
  DISCOURSE_SMTP_AUTHENTICATION: login
  DISCOURSE_NOTIFICATION_EMAIL: community@brohosting.eu

  ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#  LETSENCRYPT_ACCOUNT_EMAIL: info@brohosting.eu

  ## The http or https CDN address for this Discourse instance (configured to pull)
  ## see https://meta.discourse.org/t/14857 for details
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

  ## The maxmind geolocation IP address key for IP address lookup
  ## see https://meta.discourse.org/t/-/137387/23 for details
  #DISCOURSE_MAXMIND_LICENSE_KEY: 1234567890123456
## The Docker container is stateless; all data is stored in /shared
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-chat.git
          - git clone https://github.com/discourse/discourse-reactions.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-voting.git
          - git clone https://github.com/discourse/discourse-chat-integration.git


## Any custom commands to run after building
run:
  - exec: echo "Beginning of custom commands"
  ## If you want to set the 'From' email address for your first registration, uncomment and change:
  ## After getting the first signup email, re-comment the line. It only needs to run once.
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
  - exec: echo "End of custom commands"

info@brohosting.eu 是否具有将电子邮件作为 community@brohosting.eu 发送的正确配置?

这需要在您的 SMTP 提供商端进行验证。

4 个赞

我会尝试一些东西,然后告诉你们。

谢谢 Bhanu,我没有足够重视这一点,我讨厌 Zoho 的设置,因为它们隐藏了这些选项太多。

1 个赞

好消息是,你没有像你建议的那样花 5 天时间调试 smtp 库!

(我最近花了十几个小时,分好几天来调试那个无法下拉的下拉菜单的代码。我仔细检查了插入下拉菜单的咖啡。我检查了为下拉菜单生成数据的咖啡。我将其与其他下拉菜单的工作方式进行了比较。然后,我发现我插入的一行小小的 CSS 代码导致下拉菜单没有空间可以下拉。)

很高兴你搞定了!

3 个赞

我的意思是,它至少可以检查并输出一个更好的错误,因为这真的很令人困惑。

这就是为什么标准安装程序包含一个推荐邮件提供商列表。如果您想偏离这些建议,那么您也必须接受它带来的额外技术复杂性。并非所有邮件服务器的行为都相同,这不是 Discourse 需要解决的问题。

以上内容的总结是您错误配置了 Zoho。Discourse 无法查看那里的配置,并假定您提供的信息是正确的。如果您重新运行了 ./discourse-setup,它会再次询问您发送地址,而您会因为这次错误配置而输入错误。

我们可以将用户从许多问题中解救出来,但很少能将他们从自己手中解救出来。下次,我建议您专注于更可能出现问题的方面,并在坚持认为问题出在为数千万用户服务的代码中之前,仔细检查外部系统的详细信息。这很可能会更快地帮您找到答案。

你说得对,但你也可以在电子邮件故障排除指南中提到这一点,即使在配置 Discourse 之前,这本身就是一个非常容易理解的步骤。

无论如何,我都感谢上面各位的帮助。

那太好了。

但是,尚不清楚“已到达文件末尾”是否总是意味着“您未能为使用的发件地址配置邮件服务”或您为修复问题所做的任何其他操作。

事实证明,在 Discourse 成功连接到邮件服务器后,有很多事情会出错。如果您想要一个更好的错误消息,请让 Zoho 提供一个,而不是仅仅关闭连接。

1 个赞

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