侧边栏壁纸
博主头像
★街角晚灯★博主等级

博观而约取 厚积而薄发

  • 累计撰写 446 篇文章
  • 累计创建 182 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

GitLab开启发送邮件功能

WinJay
2019-03-08 / 0 评论 / 0 点赞 / 134 阅读 / 3965 字 / 正在检测是否收录...
温馨提示:
文章发布较早,内容可能过时,阅读注意甄别。。。。

title: GitLab开启发送邮件功能 date: '2019-03-08T16:50:18+08:00'

[root@WinJay ~] # vim /etc/gitlab/gitlab.rb

![](http://winjay.cn/wp-content/uploads/image-52.png)
进入后将红框中的注释重新复制一份,取消掉注释,然后填入正确的邮箱信息。
![](http://winjay.cn/wp-content/uploads/image-58.png)
配置完成后运行:

[root@WinJay ~]# gitlab-ctl reconfigure

加载完成后输入:gitlab-rails console 进行命令行邮件发信测试

Notify.test_email(‘zhangwj@nerc.edu.cn’, ‘GitLab Email Test’, ‘This is a Test Email.Thank you!’).deliver_now

![](http://winjay.cn/wp-content/uploads/image-53.png)
![](http://winjay.cn/wp-content/uploads/image-48-1024x549.png)
重新修改配置文件 加入下面的参数。

每一条都不能填错,最重要的是最后一条。。。

![此图像的alt属性为空;文件名为image-57.png](http://winjay.cn/wp-content/uploads/image-57.png)
之后重新加载配置文件
![](http://winjay.cn/wp-content/uploads/image-55.png)
再次运行邮件测试可见可以正常发信了。
![](http://winjay.cn/wp-content/uploads/image-56-1024x277.png)
**================================**

这是官方文档给出的示例,参考一下即可。。。。

User git_user_email 那条参数这里面也没写。

There are example configurations at the end of this page.

gitlab_rails[‘smtp_enable’] = true gitlab_rails[‘smtp_address’] = “smtp.server” gitlab_rails[‘smtp_port’] = 465 gitlab_rails[‘smtp_user_name’] = “smtp user” gitlab_rails[‘smtp_password’] = “smtp password”
gitlab_rails[‘smtp_domain’] = “example.com” gitlab_rails[‘smtp_authentication’] = “login” gitlab_rails[‘smtp_enable_starttls_auto’] = true gitlab_rails[‘smtp_openssl_verify_mode’] = ‘peer’

# If your SMTP server does not like the default ‘From: gitlab@localhost’ you # can change the ‘From’ with this setting.

gitlab_rails[gitlab_email_from] = ‘gitlab@example.com’ gitlab_rails[gitlab_email_reply_to] = ‘noreply@example.com’

0

评论区