gitlab添加邮箱设置

修改配置文件

[[email protected] opt]# grep -rn "^[^#]" /etc/gitlab/gitlab.rb 

13:external_url 'http://192.168.0.8:81'

57:gitlab_rails['gitlab_email_from'] = '[email protected]'

58:gitlab_rails['smtp_enable'] = true

59:gitlab_rails['smtp_address'] = "smtp.qq.com"

60:gitlab_rails['smtp_port'] = 465

61:gitlab_rails['smtp_user_name'] = "[email protected]"

62:gitlab_rails['smtp_password'] = "cknzlfrvhwmbbagf"

63:gitlab_rails['smtp_domain'] = "smtp.qq.com"

64:gitlab_rails['smtp_authentication'] = "login"

65:gitlab_rails['smtp_enable_starttls_auto'] = true

66:gitlab_rails['smtp_tls'] = true

 

三、加载配置文件并重启gitlab

[[email protected] opt]#  gitlab-ctl reconfigure

[[email protected] opt]#  gitlab-ctl restart

 

四、验证

[[email protected] opt]#  gitlab-rails console 

irb(main):001:0> 

Notify.test_email('[email protected]', 'GitLab email', 'Hellow world').deliver_now

Notify#test_email: processed outbound mail in 363.2ms

Sent mail to [email protected] (1902.1ms)

Date: Wed, 13 Feb 2019 10:21:31 +0800

From: GitLab <[email protected]>

Reply-To: GitLab <[email protected]>

To: [email protected]

 

 

Notify.test_email("[email protected]","title","gitlab").deliver_now

gitlab添加邮箱设置

 

最后去邮箱中查看结果即可,以上操作皆验证测试成功。