更改配置文件/home/git/gitlab/config/initializers下面的
mv smtp_settings.rb.sample smtp_settings.rb
更改如下:
# To enable smtp email delivery for your GitLab instance do the following:
# 1. Rename this file to smtp_settings.rb
# 2. Edit settings inside this file
# 3. Restart GitLab instance
#
# For full list of options and their values see http://api.rubyonrails.org/classes/ActionMailer/Base.html
#
# If you change this file in a Merge Request, please also create a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: "smtp.126.com",
port: 25,
user_name: "apabi",
password: "123456",
domain: "126.com",
authentication: :login,
enable_starttls_auto: true,
openssl_verify_mode: 'peer' # See ActionMailer documentation for other possible options
}
end
修改gitlab主配置文件:
/home/git/gitlab
vim config/gitlab.yml
email_from: apabi@iyunv.com
email_display_name: Gitlab
email_reply_to: apabi@iyunv.com
修改后重启服务生效:
service gitlab restart