# 无法获取验证邮件

**URL:** https://meta.discourse.org/t/unable-to-get-the-verification-email/131794
**Category:** Self-hosting
**Created:** [2019年十月24日 13:25 UTC](https://meta.discourse.org/t/unable-to-get-the-verification-email/131794 "2019-10-24T13:25:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Yankxcool](https://avatars.discourse-cdn.com/v4/letter/y/da6949/32.png) [@Yankxcool](https://meta.discourse.org/u/Yankxcool)
#### Post date: [2019年十月24日 13:25 UTC](https://meta.discourse.org/t/unable-to-get-the-verification-email/131794/1 "2019-10-24T13:25:09Z")

</div>

大家好，三个小时过去了，我不知道还能测试什么。  
我重新安装了很多次，但一切都不正常。

我用外部网站检查了我的 SMTP 配置 [[SMTP Test Tool](https://www.gmass.co/smtp-test)]，显示工作正常。

我的域名提供商要求使用 465 SSL。  
目前，所有来自外部网站（以及使用该工具）的邮件都能正确接收。

我已经为我的 Discourse 设置配置了 SSL。  
网站运行正常，页面可以打开并自动跳转到 https://，但在填写第一步信息时，确认邮件从未到达。

我的 app.yml 配置：

```
## 编辑时请*非常*小心！
## YAML 文件对空白或对齐中的错误超级敏感！
## 必要时请访问 http://www.yamllint.com/ 验证此文件

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## 如果您想添加 Lets Encrypt (https)，请取消注释这两行
  - "templates/web.ssl.template.yml"
  - "templates/web.letsencrypt.ssl.template.yml"

## 此容器应暴露哪些 TCP/IP 端口？
## 如果您希望 Discourse 与另一个 Web 服务器（如 Apache 或 nginx）共享端口，
## 请参阅 https://meta.discourse.org/t/17247 了解详情
expose:
  - "80:80" # http
  - "443:443" # https

params:
  db_default_text_search_config: "pg_catalog.english"

  ## 将 db_shared_buffers 设置为总内存的最大 25%。
  ## 将基于检测到的 RAM 由 bootstrap 自动设置，或者您可以覆盖
  db_shared_buffers: "128MB"

  ## 可以改善排序性能，但会增加每个连接的内存使用量
  #db_work_mem: "40MB"

  ## 此容器应使用哪个 Git 版本？（默认：tests-passed）
  #version: tests-passed

env:
  LANG: en_US.UTF-8
  # DISCOURSE_DEFAULT_LOCALE: en

  ## 支持多少并发 Web 请求？取决于内存和 CPU 核心数。
  ## 将基于检测到的 CPU 由 bootstrap 自动设置，或者您可以覆盖
  UNICORN_WORKERS: 2

  ## TODO: 此 Discourse 实例将响应的域名
  ## 必填。Discourse 无法仅使用 IP 地址运行。
  DISCOURSE_HOSTNAME: *HIDDEN*.com
 ## 如果您希望容器以与上述相同的主机名（-h 选项）启动，请取消注释
  ## （默认 "$hostname-$config"）
  #DOCKER_USE_HOSTNAME: true

  ## TODO: 初始注册时将设为管理员和开发者的逗号分隔电子邮件列表
  ## 示例：'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: 'info@*HIDDEN*.com'

  ## TODO: 用于验证新账户和发送通知的 SMTP 邮件服务器
  # 需要 SMTP 地址、用户名和密码
  # 警告：SMTP 密码中的字符 '#' 可能导致问题！
  DISCOURSE_SMTP_ADDRESS: smtp.buzondecorreo.com
  DISCOURSE_SMTP_PORT: 465
  DISCOURSE_SMTP_USER_NAME: info@*HIDDEN*.com
  DISCOURSE_SMTP_PASSWORD: "*HIDDEN*"
  DISCOURSE_SMTP_ENABLE_START_TLS: true
  # （可选，默认为 true）

  ## 如果您添加了 Lets Encrypt 模板，请取消注释以下行以获取免费 SSL 证书
  LETSENCRYPT_ACCOUNT_EMAIL: info@*HIDDEN*.com

  ## 此 Discourse 实例的 http 或 https CDN 地址（配置为拉取）
  ## 请参阅 https://meta.discourse.org/t/14857 了解详情
  #DISCOURSE_CDN_URL: https://discourse-cdn.example.com

## Docker 容器是无状态的；所有数据都存储在 /shared 中
volumes:
  - volume:
      host: /var/discourse/shared/standalone
      guest: /shared
  - volume:
      host: /var/discourse/shared/standalone/log/var-log
      guest: /var/log

## 插件放在这里
## 请参阅 https://meta.discourse.org/t/19157 了解详情
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git

## 构建后运行的任何自定义命令
run:
  - exec: echo "开始自定义命令"
  ## 如果您想为首次注册设置“发件人”电子邮件地址，请取消注释并更改：
  ## 收到首次注册邮件后，重新注释该行。它只需运行一次。
  #- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"

```

production.log 的一部分

```
 Started POST "/finish-installation/register" for 93.176.189.249 at 2019-10-24 13:02:12 +0000
 Processing by FinishInstallationController#register as HTML
   Parameters: {"utf8"=>"✓", "authenticity_token"=>"JDM8SDZMVZwNxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxuVRChib7+aXhsrYN5gmszmPNF00QpzRduSzYY0g==", "email"=>"info@*HIDDEN*.com", "username"=>"Administradora", "password"=>"[FILTERED]", "commit"=>"Register"}
 Redirected to https://*HIDDEN*.com/finish-installation/confirm-email
 Completed 302 Found in 36ms (ActiveRecord: 0.0ms | Allocations: 2434)
   Rendering layouts/email_template.html.erb
   Rendered layouts/email_template.html.erb (Duration: 0.6ms | Allocations: 139)
 Started GET "/finish-installation/confirm-email" for 93.176.189.249 at 2019-10-24 13:02:12 +0000
 Processing by FinishInstallationController#confirm_email as HTML
   Rendering finish_installation/confirm_email.html.erb within layouts/finish_installation
   Rendered finish_installation/confirm_email.html.erb within layouts/finish_installation (Duration: 1.6ms | Allocations: 357)
   Rendered layouts/_head.html.erb (Duration: 6.5ms | Allocations: 228)
 Completed 200 OK in 14ms (Views: 9.8ms | ActiveRecord: 0.0ms | Allocations: 1277)
 Delivered mail a492e5f7-2935-4776-b453-1593fadc5e6e@*HIDDEN*.com (60080.7ms)
 Job exception: end of file reached

```

---

<div class="post-metadata">

### Author: ![justin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/justin/32/157614_2.png) [@justin](https://meta.discourse.org/u/justin)
#### Post date: [2019年十月24日 16:56 UTC](https://meta.discourse.org/t/unable-to-get-the-verification-email/131794/2 "2019-10-24T16:56:35Z")

</div>

看起来您正尝试使用用户网页邮件服务来替代像 Mailgun 这样的应用邮件服务。请问您不使用 Mailgun 或同类服务商有什么原因吗？

---

<div class="post-metadata">

### Author: ![Yankxcool](https://avatars.discourse-cdn.com/v4/letter/y/da6949/32.png) [@Yankxcool](https://meta.discourse.org/u/Yankxcool)
#### Post date: [2019年十月24日 16:58 UTC](https://meta.discourse.org/t/unable-to-get-the-verification-email/131794/3 "2019-10-24T16:58:39Z")

</div>

@justin 我对 Mailgun 不太放心。我现在已经用 Sendinblue 配置了邮件，但不确定这是否是个好选择，因为它限制每小时只能发送 40 封邮件。
