gitlab smtp设置和注意事项 ||报错EOFError: end of file reached

配置路径选项:/etc/gitlab/gitlab.rb

可以根据自己实际安装目录进行寻找,或使用find name gitlab.rb 查找所在目录

修改的配置内容

 

QQ exmail

gitlab smtp设置和注意事项 ||报错EOFError: end of file reached
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.qq.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "XXXX@qq.com"
gitlab_rails['smtp_password'] = "ypyvpirefumrbjed"  # qq授权码
gitlab_rails['smtp_domain'] = "smtp.qq.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['gitlab_email_from'] = XXXX@qq.com    #和smtp_user_name一致
gitlab_rails['gitlab_email_enabled'] = true

yahoo

gitlab_rails['gitlab_email_from'] = 'user@yahoo.com'
gitlab_rails['gitlab_email_from'] = 'user@yahoo.com'

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mail.yahoo.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_user_name'] = "user@yahoo.com"
gitlab_rails['smtp_password'] = "password"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_openssl_verify_mode'] = 'peer'

Gmail

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.gmail.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "my.email@gmail.com"
gitlab_rails['smtp_password'] = "my-gmail-password"
gitlab_rails['smtp_domain'] = "smtp.gmail.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'peer' # Can be: 'none', 'peer', 'client_once', 'fail_if_no_peer_cert', see http://api.rubyonrails.org/classes/ActionMailer/Base.html
Don't forget to change my.email@gmail.com to your email address and my-gmail-password to your own password.

Mailgun

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.mailgun.org"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_authentication'] = "plain"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_user_name'] = "postmaster@mg.gitlab.com"
gitlab_rails['smtp_password'] = "8b6ffrmle180"
gitlab_rails['smtp_domain'] = "mg.gitlab.com"

注意:

只有当smtp_port 为465,启用SSL连接,的时候才会是true,如果端口为25则不需要。

另外['gitlab_email_from'] 和['smtp_user_name'] 必须是一样的否则会报错

 

重启配置项:

gitlab-ctl reconfigure

确认没有报错之后,打开调试台:

 gitlab-rails console
Notify.test_email('xxxxxx@qq.com', 'wangxu', 'test body').deliver_now

 

上一篇:gitlab上fork别人的代码,如何更新主分支最新代码


下一篇:GIT学习使用