redmine 郵件服務的配置
原文:https://www.oschina.net/question/84514_9374
1.將config/email.yml.example重命名為config/email.yml
REDMINE_ROOT$ mv config/email.yml.example config/email.yml
2.修改config/email.yml文件,修改信息如下:
production:
delivery_method: :smtp
smtp_settings:
address: mail.foo.bar
port: 25
domain: foo.bar
# authentication: :login
# user_name: xxx
# password: xxx
development:
delivery_method: :smtp
smtp_settings:
address: mail.foo.bar
port: 25
domain: foo.bar
# authentication: :login
# user_name: xxx
# password:xxx
注意用#注銷掉的那三行信息,那是郵件服務器身份驗證信息,但是如果你的用戶已經使用了域驗證,就不需要那三行信息。
注:這是針對Redmine 0.8.x版本以及以後版本適用的。對於之前的版本並不存在config/email.yml.example文件,這時郵件的配置是在config/environment.rb文件裏,找到“# SMTP server configuration”字樣,然後在下麵進行參數配置,配置的參數和新版本的一樣。
3.保存退出之後,重新啟動服務器。
然後訪問redmine,以管理員的身份登錄係統,點擊”管理”—->”配置”—->”郵件通知”,然後點擊右下角的”發送測試郵件”,就可以測試你的郵件服務配置是否成功了。
配置舉例:
production:
delivery_method: :smtp
smtp_settings:
address: smtp.bj.ossxp.com
port: 25
domain: bj.ossxp.com
#authentication: :login
#user_name: "redmine@example.net"
#password: "redmine"
注:如果你用Gmail郵箱發送郵件,那麼還需要額外下載一個插件
REDMINEROOT$ ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git
具體的配置如下:
production:
delivery_method: :smtp
smtp_settings:
tls: true
address: smtp.gmail.com
port: 587
domain: smtp.gmail.com
authentication: :plain
user_name: "your_email@gmail.com"
password: "your_password"
最後更新:2017-04-02 06:52:09