gitlab 邮件配置(smtp)
2015-07-29 15:21:45
一:修改全局配置文件
$ git config --GLOBAL user.name "gengchong"
$ git config --GLOBAL user.email "gengchong@ddcehua.com"
二:
配置gitlab的发送邮件的SMTP服务
修改gitlab/config/environments/production.rb配置文件:
config.action_mailer.delivery_method= :smtp
更改smtp邮件配置文件gitlab/config/initializers/smtp_settings.rb:
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: "smtp.exmail.qq.com",
port: 25,
user_name: "gengchong@ddcehua.com",
password: "email password",
domain: "smtp.qq.com",
authentication: :login,
enable_starttls_auto: false,
openssl_verify_mode: 'none' # See ActionMailer documentation for other possible options
}
end
这里,端口使用的是25,不是腾讯企业邮箱官方说的465,请注意.
三:重启gitlab
service gitlab restart
四:测试配置