【问题标题】:Ghost Docker SMTP setupGhost Docker SMTP 设置
【发布时间】:2020-11-15 13:36:00
【问题描述】:

我在我的 vps 中使用 ghost cms 的 official docker compose file 创建了一个 ghost 实例

我将其修改为使用 mailgun SMTP 帐户,如下所示

version: '3.1'
services:
  mariadb:
    image: 'docker.io/bitnami/mariadb:10.3-debian-10'
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_USER=bn_ghost
      - MARIADB_DATABASE=bitnami_ghost
    volumes:
      - 'mariadb_data:/bitnami'
  ghost:
    image: 'ghost:3-alpine'
    environment:
      MARIADB_HOST: mariadb
      MARIADB_PORT_NUMBER: 3306
      GHOST_DATABASE_USER: bn_ghost
      GHOST_DATABASE_NAME: bitnami_ghost
      GHOST_HOST: localhost
      mail__transport: SMTP
      mail__options__service: Mailgun
      mail__auth__user: ${MY_MAIL_USER}
      mail__auth__pass: ${MY_MAIL_PASS}
      mail__from: ${MY_FROM_ADDRESS}
    ports:
      - '80:2368'
    volumes:
      - 'ghost_data:/bitnami'
    depends_on:
      - mariadb
volumes:
  mariadb_data:
    driver: local
  ghost_data:
    driver: local

但是当我尝试邀请作者访问该网站时 它给了我以下错误

Failed to send 1 invitation: dulara@thinksmart.lk. Please check your email configuration, see https://ghost.org/docs/concepts/config/#mail for instructions

我确定我的 SMTP 凭据是正确的。

我登录了 ghost 容器 bash shell 并在那里检查了它的文件。 它的邮件部分是空的

我仍然找不到我的错误。我不确定变量名。但我是从官方文档中获取的。

【问题讨论】:

    标签: docker ghost-blog


    【解决方案1】:

    我的例子:

    url=https://www.exemple.com/
    # admin__url=XXX // Remove it (For my side, the redirection is failed)
    
    database__client=mysql
    database__connection__host=...
    database__connection__port=3306
    database__connection__database=ghost
    database__connection__user=ghost
    database__connection__password=XXX
    
    privacy__useRpcPing=false
    
    mail__transport=SMTP
    mail__options__host=smtp.exemple.com
    mail__options__port=587
    # mail__options__service=Exemple // Remove it
    mail__options__auth__user=sys@exemple.com
    mail__options__auth__pass=XXX
    # mail__options__secureConnection=true // Remove it
    mail__from=Exemple Corp. <sys@exemple.com>
    

    在您的情况下更改:
    mail__auth__user => mail__options__auth__user
    mail__auth__pass => mail__options__auth__pass
    并删除:mail__options__service (https://github.com/metabase/metabase/issues/4272#issuecomment-566928334)

    【讨论】:

    • 只是因为这花了我几个小时才找到:确实是mail__options__auth__pass 而不是mail__options__auth__password,尽管他们在数据库连接设置中使用“密码”。此外,似乎不会调整任何配置文件(ghost v4.6)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-21
    • 2019-04-23
    • 2019-05-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-19
    相关资源
    最近更新 更多