Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 当我尝试使用admin/test_电子邮件测试电子邮件发送时,Redmine中出现错误500_Ruby On Rails_Ruby_Redmine - Fatal编程技术网

Ruby on rails 当我尝试使用admin/test_电子邮件测试电子邮件发送时,Redmine中出现错误500

Ruby on rails 当我尝试使用admin/test_电子邮件测试电子邮件发送时,Redmine中出现错误500,ruby-on-rails,ruby,redmine,Ruby On Rails,Ruby,Redmine,我刚刚从docker中的原始图像安装了redmine。我已配置Office 365 SMTP,但未收到电子邮件。当我尝试使用admin/test_电子邮件检查它是否工作时,我收到: “我的日志”文件夹为空:/ 我的config/configuration.yml是这样启动的: # = Redmine configuration file # # Each environment has its own configuration options. If you are only # runn

我刚刚从docker中的原始图像安装了redmine。我已配置Office 365 SMTP,但未收到电子邮件。当我尝试使用admin/test_电子邮件检查它是否工作时,我收到:

“我的日志”文件夹为空:/

我的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"

没有日志,就不可能找到这里的错误。首先尝试获取日志,然后尝试重现您的问题。如果您的应用程序服务器无法写入日志,可能是因为运行Redmine应用程序的用户没有必要的权限写入
日志/production.log
文件。@Holger究竟是哪个用户?我尝试将所有权授予www-data-o-redmine,但没有成功。这取决于您的设置。通常,它是
www-data
,但也可能是不同的用户。您可以在
ps axuf
的输出上检查这一点。但是,请确保在任何情况下,相应的用户都可以写入文件(因此用户还需要能够使用所有父目录),同时设置
ssl
enable\u starttls\u auto
是没有意义的。在587端口上,您通常只希望启用\u starttls\u auto。我删除了ssl设置,检查了“redmine”是否是执行所有文件并拥有其所有权的用户,甚至将777设置为日志目录,但没有成功。文件夹中没有日志。我按照您所说的配置了文件,但没有成功。但我发现发生了什么:我不能把一个共享邮箱作为电子邮件发送者,它必须是一个有效的电子邮件地址。