gitlab设置邮箱信息
Posted lina-2159
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gitlab设置邮箱信息相关的知识,希望对你有一定的参考价值。
一、配置qq邮箱
1、编辑gitlab配置文件
vim /etc/gitlab/gitlab.rb
gitlab_rails[‘gitlab_email_enabled‘] = true gitlab_rails[‘gitlab_email_from‘] = ‘2546523862@qq.com‘ #发件人邮箱 gitlab_rails[‘gitlab_email_display_name‘] = ‘lina-gitlab‘ #发件人名称 gitlab_rails[‘smtp_enable‘] = true gitlab_rails[‘smtp_address‘] = "smtp.qq.com" #邮箱服务器 gitlab_rails[‘smtp_port‘] = 465 gitlab_rails[‘smtp_user_name‘] = "2546523862@qq.com" #发件人邮箱地址 gitlab_rails[‘smtp_password‘] = "nkunufnvhxpvebii" #qq邮箱的授权码 gitlab_rails[‘smtp_domain‘] = "qq.com" gitlab_rails[‘smtp_authentication‘] = "login" gitlab_rails[‘smtp_enable_starttls_auto‘] = true gitlab_rails[‘smtp_tls‘] = true
2、重新加载配置文件
gitlab-ctl reconfigure
3、测试邮箱
gitlab-rails console
Notify.test_email("xxx@qq.com","title","gitlab").deliver_now #模拟发邮件
二、配置企业邮箱
同上,稍微有点区别配置文件
gitlab_rails[‘gitlab_email_enabled‘] = true gitlab_rails[‘gitlab_email_from‘] = ‘xxx@bonc.com.cn‘ gitlab_rails[‘gitlab_email_display_name‘] = ‘Gitlab-System‘ gitlab_rails[‘smtp_enable‘] = true gitlab_rails[‘smtp_address‘] = "mail.bonc.com.cn" #服务器地址 gitlab_rails[‘smtp_port‘] = 465 gitlab_rails[‘smtp_user_name‘] = "xxx@bonc.com.cn" gitlab_rails[‘smtp_password‘] = "xxxxxx" #发件人邮箱密码 gitlab_rails[‘smtp_domain‘] = "bonc.com.cn" gitlab_rails[‘smtp_authentication‘] = "login" gitlab_rails[‘smtp_enable_starttls_auto‘] = true gitlab_rails[‘smtp_tls‘] = true user[‘git_user_email‘] = "bxsybkf@bonc.com.cn" #发件人邮箱
以上是关于gitlab设置邮箱信息的主要内容,如果未能解决你的问题,请参考以下文章