测试发送邮件:
gitlab-rails console
Notify.test_email('test666@example.com', 'Message Subject', 'Message Body').deliver_now
报错误如下:
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol
gitlab版本为社区版:
gitlab-ce-11.6.8-ce.0.el6.x86_64.rpm
目录:/home/gitlab/gitlab-data
配置邮箱的主要参数:
user['git_user_email'] = "test@.example.com"
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtps.example.com"
gitlab_rails['smtp_port'] = 465 # 有人说要把端口改成 25,不要轻信谣言!!!
gitlab_rails['smtp_user_name'] = "test@.example.com"
gitlab_rails['smtp_password'] = "你的密码"
gitlab_rails['smtp_domain'] = "example.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
# 启用以下配置
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
再重新生成配置一下
gitlab-ctl reconfigure