CentOS7下gitlab邮件服务设置

1.配置文件位置

vim /etc/gitlab/gitlab.rb

以腾讯企业邮箱为例其它邮箱大同小异

gitlab_rails['smtp_enable'] = true 
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com" 
gitlab_rails['smtp_port'] = 465 
gitlab_rails['smtp_user_name'] = "邮箱地址" 
gitlab_rails['smtp_password'] = "password" 
gitlab_rails['smtp_authentication'] = "login" 
gitlab_rails['smtp_enable_starttls_auto'] = true 
gitlab_rails['smtp_tls'] = true 
gitlab_rails['smtp_domain'] = "exmail.qq.com" 
gitlab_rails['gitlab_email_from'] = '邮箱地址' 

2.更新配置

    gitlab-ctl reconfigure

3.重启服务

gitlab-ctl restart

4.非必需步骤进入控制台

测试邮件服务是否正常

gitlab-rails console 
等到出现 “>”再执行下面命令
Notify.test_email("[email protected]","title","gitlab").deliver_now

你可能感兴趣的:(centos,gitlab)