如何在Redmine中配置电子邮件通知?

时间:2013-08-22 18:46:29

标签: smtp gmail redmine

我已按照以下方式使用Bitnami和配置的电子邮件通知在离线模式下安装了Redmine,如Redmine: Email Configuration

中所述

我的环境:

Environment:
    Redmine version     2.3.2.stable
    Ruby version        1.9.3-p231 (2012-05-25) [i386-mingw32]
    Rails version       3.2.13
    Environment         production
    Database adapter    Mysql2
    Redmine plugins:    no plugin installed

configuration.yml的一部分:

# default configuration options for all environments
default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:    
      address: ...here smtp.domain or ip of smtp- server...
      port: 25
      domain: ...some domain...
      authentication: :login
      user_name: ...name@domain...
      password: "..."

在同一个域中运行邮件服务器。

我从Redmine UI请求了我的密码:

enter image description here

但是,消息不会出现。

我在production.log中的内容:

Started POST "/redmine/account/lost_password" for 127.0.0.1 at 2013-08-22 21:38:21 +0400
Processing by AccountController#lost_password as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"252n1tBNbFP/BzQ6spgzVTx/yKnltmhd9jHhzcgyTwU=", "mail"=>"...name@domain...", "commit"=>"Submit"}
  Current user: anonymous
  Rendered mailer/lost_password.text.erb within layouts/mailer (0.0ms)
  Rendered mailer/lost_password.html.erb within layouts/mailer (1.0ms)
Redirected to http://localhost/redmine/login
Completed 302 Found in 886ms (ActiveRecord: 68.0ms)
Started GET "/redmine/login" for 127.0.0.1 at 2013-08-22 21:38:22 +0400
Processing by AccountController#login as HTML
  Current user: anonymous
  Rendered account/login.html.erb within layouts/base (7.0ms)
Completed 200 OK in 20ms (Views: 16.0ms | ActiveRecord: 1.0ms)    

当我在Intranet外测试此配置时,我使用了gmail。 configuration.yml的一部分:

# default configuration options for all environments
default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:    
      address: smtp.gmail.com
      port: 587
      domain: gmail.com
      authentication: :login
      user_name: ...name@gmail.com
      password: "..."

当我在此配置中请求密码时,消息已经出现。

消息:

To change the password, click on the following link:
http://localhost:3000/account/lost_password?token=dd36a006157cfa8d208ba11822c9283f14ef5f65

User: alexey

You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://hostname/my/account

我现在在production.log中看到的内容:

Started POST "/redmine/account/lost_password" for 127.0.0.1 at 2013-08-22 22:09:40 +0400
Processing by AccountController#lost_password as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"252n1tBNbFP/BzQ6spgzVTx/yKnltmhd9jHhzcgyTwU=", "mail"=>"...name@domain...", "commit"=>"Submit"}
  Current user: anonymous
  Rendered mailer/lost_password.text.erb within layouts/mailer (3.0ms)
  Rendered mailer/lost_password.html.erb within layouts/mailer (1.0ms)
Redirected to http://localhost/redmine/login
Completed 302 Found in 2769ms (ActiveRecord: 73.0ms)
Started GET "/redmine/login" for 127.0.0.1 at 2013-08-22 22:09:43 +0400
Processing by AccountController#login as HTML
  Current user: anonymous
  Rendered account/login.html.erb within layouts/base (4.0ms)
Completed 200 OK in 10ms (Views: 8.0ms | ActiveRecord: 1.0ms)

所以,

  • 如果我使用gmail,则会发送和发送消息

  • 如果我使用其他邮件,则不会发送或发送邮件,但不会传递

我做错了什么?如何在Redmine中配置电子邮件通知?

我将非常感谢这些信息。谢谢大家。

1 个答案:

答案 0 :(得分:1)

请查看语法。

production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: ********.com 
      port: 25
      domain: ********.com
      enable_starttls_auto: false  
      authentication: :login
      user_name: "#############@***.com"
      password: "####"

关键字'production'也应该是特定于环境的。

我推荐了他们的官方配置页面。 https://www.redmine.org/projects/redmine/wiki/EmailConfiguration

相关问题