Featured image of post Gitlab极狐配置zoho自定义域名邮箱

Gitlab极狐配置zoho自定义域名邮箱

前言

本着自建的才是最香的原则(瞎折腾+GitHub 开始封锁受美国制裁公司的俄罗斯开发者账户),于是自建了GitLab极狐(GitLab极狐是GitLab的中国发行版),同时想要更改默认的邮箱,主要是头像对应不上+默认邮箱看着不舒服(笑),但是更改邮箱必须通过邮箱验证,于是便有了这篇文章。

zoho邮箱

相比于腾讯云、阿里云等企业邮箱还得绑定手机号balabala的,zoho就没有这些限制,方便很多,且免费版对我来说已经够用了,就选择了zoho邮箱。

Zoho Mail免费邮箱

使用自定义的域名,根据Zoho 进行邮箱托管 - 设置过程一步一步设置就完事了,很简单的。

注意:

zoho每个地区的服务并不通用,比如https://www.zoho.com.cnhttps://www.zoho.com就不通用,邮箱服务器的地址也不一样,同上,前者为smtp.zoho.com.cn,后者为smtp.zoho.com

image-20220421013017062

配置GitLab极狐

  1. 编辑配置gitlab配置文件:
1
vim /etc/gitlab/gitlab.rb

内容如下,每一项都必须配置:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.zoho.com.cn"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_authentication'] = "plain"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "mypassword"
gitlab_rails['smtp_domain'] = "smtp.zoho.com.cn"
gitlab_rails['gitlab_email_from'] = '[email protected]'
gitlab_rails['gitlab_email_reply_to'] = '[email protected]'
  1. 使配置生效:
1
gitlab-ctl reconfigure
  1. 发送测试邮件,检测是否生效:
1
2
3
gitlab-rails console
ActionMailer::Base.smtp_settings
Notify.test_email('[email protected]', 'Hello World', 'This is a test message').deliver_now
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计