gitlab邮箱配置
官方文档:https://docs.gitlab.com/omnibus/settings/smtp.html#smtp-settings
在/etc/gitlab/gitlab.rb
中配置以下
#这里使用qq邮箱,使用官网中qq邮箱的配置
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "xxxx@xx.com" #自己的邮箱
gitlab_rails['smtp_password'] = "password" #邮箱授权码
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = 'xxxx@xx.com' #自己的邮箱
gitlab_rails['smtp_domain'] = "qq.com"
重载配置,重启gitlab
[root@gitlab ~]# gitlab-ctl reconfigure
[root@gitlab ~]# gitlab-ctl restart
测试邮箱
gitlab-rails console
#测试邮件发送
Notify.test_email('destination_email@address.com', 'Message Subject', 'Message Body').deliver_now