GitLab 使用163邮箱发送邮件

一、配置SMTP,使GitLab通过163邮箱给用户发送邮件

vim  /etc/gitlab/gitlab.rb

具体配置信息:

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.163.com"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = "[email protected]"
gitlab_rails['smtp_password'] = "xxpassword"
gitlab_rails['smtp_domain'] = "163.com"
gitlab_rails['smtp_authentication'] = :login
gitlab_rails['smtp_enable_starttls_auto'] = true

gitlab_rails['gitlab_email_from'] = "[email protected]"
user["git_user_email"] = "[email protected]"


 
  

二、重启配置:

sudo gitlab-ctl reconfigure


三、实时查看所有执行日志

gitlab-ctl tail



四、可能遇到的问题:

1、Connection refused - connect(2) for \"smtp.163.com\" port 456

端口一开始填写为:456,这是不对的。163邮箱的端口是25.

2、User has no permission

登陆163邮箱,开启SMTP服务。

3、535 Error: authentication failed

用户名或密码不正确,注意这里的

gitlab_rails['smtp_password'] = "xxpassword"
是163邮箱的“客户端授权密码 ”

4、553 Mail from must equal authorized user

网易服务器smtp机器要求身份验证帐号和发信帐号必须一致

##修改gitlab配置
gitlab_rails['gitlab_email_from'] = "[email protected]"
user["git_user_email"] = "[email protected]"


你可能感兴趣的:(Linux,Git)