当我尝试使用 admin/test_email 测试电子邮件发送时,Redmine 出现错误 500

Error 500 in Redmine when I try to test email send using admin/test_email

我刚刚从 docker 中的原始映像安装了 redmine。我配置了 Office 365 SMTP,但没有收到电子邮件。当我尝试使用 admin/test_email 检查它是否有效时,我得到:

我的日志文件夹是空的:/

我的config/configuration.yml 是这样开始的:

# = Redmine configuration file
#
# Each environment has its own configuration options.  If you are only
# running in production, only the production block needs to be configured.
# Environment specific configuration options override the default ones.
#
# Note that this file needs to be a valid YAML file.
# DO NOT USE TABS! Use 2 spaces instead of tabs for indentation.

# default configuration options for all environments
default:
  # Outgoing emails configuration
  # See the examples below and the Rails guide for more configuration options:
  # http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration
  # ==== Simple SMTP server at localhost
  #
  #  email_delivery:
  #    delivery_method: :smtp
  #    smtp_settings:
  #      address: "localhost"
  #      port: 25
  #
  # ==== SMTP server at example.com using LOGIN authentication and checking HELO for foo.com
  #
  #  email_delivery:
  #    delivery_method: :smtp
  #    smtp_settings:
  #      address: "example.com"
  #      port: 25
  #      authentication: :login
  #      domain: 'foo.com'
  #      user_name: 'myaccount'
  #      password: 'password'
  #
  # ==== SMTP server at example.com using PLAIN authentication
  #
  #  email_delivery:
  #    delivery_method: :smtp
  #    smtp_settings:
  #      address: "example.com"
  #      port: 25
  #      authentication: :plain
  #      domain: 'example.com'
  #      user_name: 'myaccount'
  #      password: 'password'
  #
  # ==== SMTP server at using TLS (GMail)
  # This might require some additional configuration. See the guides at:
  # http://www.redmine.org/projects/redmine/wiki/EmailConfiguration
  #
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      ssl: true
      enable_starttls_auto: true
      address: "smtp.office365.com"
      port: 587
      domain: "smtp.office365.com"
      authentication: :login
      user_name: "xxxxx@yyyy.zzz"
      password: "xxxxx"

Office 365 使用 TLS(不需要 ssl 选项),domain 设置必须是您的域,因此:

  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      enable_starttls_auto: true
      address: "smtp.office365.com"
      port: 587
      domain: "yyyy.zzz"
      authentication: :login
      user_name: "xxxxx@yyyy.zzz"
      password: "xxxxx"