我安装并运行了Redmine 2.2.1,但我无法收到通知电子邮件。我一直收到以下错误:
An error occurred while sending mail (getaddrinfo: Name or service not known)
我无法弄清楚它是什么我错过了。我按照这些instructions来设置使用Gmail的电子邮件通知,但似乎无论我对配置.yml文件做了哪些更改,我仍然会遇到相同的错误。
这就是我的configuration.xml文件:
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
tls: true
enable_starttls_auto: true
address: "smtp.gmail.com"
port: 587
domain: "smtp.gmail.com"
authentication: :plain
user_name: "email@mydomain.com"
password: "mypassword"
其他所有内容都被注释掉了。
我尝试更改并删除tls
和enable_starttls_auto
选项,但对configuration.yml文件的更改不会影响错误消息。
我还检查了我在其他论坛上发现的常见错误,例如配置文件中的选项卡或生产:配置被定义两次等等。
我在Gmail帐户上启用了SMTP。
我也试过设置ActionMailer,但我不确定我应该用它做什么,或者我是否需要这样做。没有提到任何地方都需要它。我已安装并设置但不确定是否正在执行任何操作。
Redmine 2.2.1
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
Rails 3.2.11
gem version 1.8.24
Amazon AMI Linux
production.log:
Started GET "/redmine/admin/test_email" for 98.xxx.xx.xx at Wed Jan 16 12:28:23 -0800 2013
Processing by AdminController#test_email as HTML
Current user: oscarm (id=3)
Rendered mailer/test_email.text.erb within layouts/mailer (0.1ms)
Redirected to http://mydomain/redmine/settings /edit?tab=notifications
Completed 302 Found in 35ms (ActiveRecord: 0.7ms)
Started GET "/redmine/settings/edit?tab=notifications" for 98.xxx.xx.xx at Wed Jan 16 12:28:23 -0800 2013
Processing by SettingsController#edit as HTML
Parameters: {"tab"=>"notifications"}
Current user: oscarm (id=3)
Rendered settings/_general.html.erb (6.8ms)
Rendered settings/_display.html.erb (9.0ms)
Rendered settings/_authentication.html.erb (5.9ms)
Rendered settings/_projects.html.erb (5.9ms)
Rendered queries/_columns.html.erb (6.5ms)
Rendered settings/_issues.html.erb (12.6ms)
Rendered settings/_notifications.html.erb (6.4ms)
Rendered settings/_mail_handler.html.erb (1.9ms)
Rendered settings/_repositories.html.erb (10.3ms)
Rendered common/_tabs.html.erb (66.2ms)
Rendered settings/edit.html.erb within layouts/admin (67.0ms)
Rendered admin/_menu.html.erb (5.6ms)
Rendered layouts/base.html.erb (19.3ms)
Completed 200 OK in 222ms (Views: 91.3ms | ActiveRecord: 4.3ms)
答案 0 :(得分:6)
所以我弄清楚我的问题是什么......
我一直在对configuration.yml文件进行修改,并且每次重新加载页面时都希望redmine能够读取它,但事实并非如此。 Redmine只在启动时读取配置文件,所以每次我对配置文件进行更改时都必须重新启动redmine。
我尝试的其中一件事是在redmine / plugin中安装action_mailer_optional_tls插件但我最终发现这个插件仅适用于ruby 1.8.6并且我使用的是ruby 1.8.7,它具有此功能-在。从redmine / plugin中删除action_mailer_optional_tls目录并重新启动redmine后,我能够发送通知电子邮件: - )
所以这是我的最终配置,让redmine与gmail一起工作:
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "smtp.gmail.com"
port: 587
domain: "smtp.gmail.com"
authentication: :plain
user_name: "myemail@mydomain.com"
password: "mypassword"
enable_starttls_auto: true
希望这可以帮助那些有同样问题的人。