gitlab qq企业邮箱配置

张映 发表于 2018-12-11

分类目录: 服务器相关

标签:, ,

邮箱配置基本上都不差多,分为有证书和无证书二种。qq企业邮箱是有证书的。

1,gitlab 邮箱配置

# 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'] = "zhangying@xxxx.com"
gitlab_rails['smtp_password'] = "xxxxxxx"
gitlab_rails['smtp_domain'] = "www.xxxx.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true

gitlab_rails['gitlab_email_from'] = 'zhangying@xxx.com'
user['git_user_email'] = "zhangying@xxx.com"

这里要注意:牵扯到邮箱设置的地方,用同一个邮箱。改完重启就好。

2,测试邮箱是否配置成功

# gitlab-rails console
-------------------------------------------------------------------------------------
 GitLab: 11.5.1 (c90ae59)
 GitLab Shell: 8.4.1
 postgresql: 9.6.8
-------------------------------------------------------------------------------------
Both Deployment and its :status machine have defined a different default for "status". Use only one or the other for defining defaults to avoid unexpected behaviors.
Loading production environment (Rails 4.2.10)
2.4.0 :001 > Notify.test_email('zhangying@test.com', '邮件标题', '邮件正文').deliver_now //发邮件测试

Notify#test_email: processed outbound mail in 299.8ms

。。。。。。。。。。。。。。省略。。。。。。。。。。。。。。。。。。

测试没报错,并且能收到邮件,就没问题了。



转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/server/1997.html