GitLib配置163邮件服务器

GitLib配置163邮件服务器

Posted by Jae on February 24, 2019

修改配置文件

在```/etc/gitlib/gitlib.rb```文件中配置如下:

### Email Settings
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "xxx@163.com"
gitlab_rails['smtp_password'] = "xxx"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
user["git_user_email"] = 'xxx@163.com'
gitlab_rails['gitlab_email_from'] = 'xxx@163.com'

GitLib重新加载配置

sudo gitlab-ctl reconfigure

测试发送邮件

sudo gitlab-rails console
Notify.test_email('xxx@qq.com', 'Message Subject', 'Message Body').deliver_now

如果163邮箱配置正确就能收到测试邮件.