大致主要是两个原因,一个是默认端口号被限制了,一个是smtp邮箱有问题,直接上操作
vim /etc/gitlab/gitlab.rb
修改如下配置:
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.sina.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "*****@sina.com"
gitlab_rails['smtp_password'] = "*****"
gitlab_rails['smtp_domain'] = "sina.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = "****@sina.com"
user['git_user_email'] = "*****@sina.com"
gitlab-ctl reconfigure
gitlab-ctl restartgitlab-rails console
Notify.test_email('***@******.com','email title','email content desc').deliver_now
邮件已收到:
登录GitLab服务后,创建新用户时,新用户也会收到注册邮箱了