主题: gitlab的邮件配置问题

张工,我的gitlab的smtp配置如下,我应该修改哪个smtp

gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'mx.abc.com'
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = 'gitlab@abc'
gitlab_rails['smtp_password'] = 'abcxccc'
gitlab_rails['smtp_domain'] = 'abc.om'
gitlab_rails['smtp_authentication'] = :plain
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/Acti … /Base.html




通过gitlab发送测试邮件返回下列错误说是:OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed

日志如下:


Notify#test_email: processed outbound mail in 206.3ms

Sent mail to 1021435278@qq.com (5567.4ms)
Date: Fri, 18 May 2018 23:40:12 +0800
From: GitLab <gitlab@code.aiguqin.com>
Reply-To: GitLab <noreply@code.aiguqin.com>
To: 1021435278@qq.com
Message-ID: <5afef3dce137b_535874932054063@Yueshan.mail>
Subject: Hello World
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><p>This is a test message</p></body></html>

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed
    from /opt/gitlab/embedded/lib/ruby/2.1.0/net/smtp.rb:586:in `connect'
    from /opt/gitlab/embedded/lib/ruby/2.1.0/net/smtp.rb:586:in `tlsconnect'
    from /opt/gitlab/embedded/lib/ruby/2.1.0/net/smtp.rb:563:in `do_start'
    from /opt/gitlab/embedded/lib/ruby/2.1.0/net/smtp.rb:520:in `start'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/mail-2.6.4/lib/mail/network/delivery_methods/smtp.rb:113:in `deliver!'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/mail-2.6.4/lib/mail/message.rb:2149:in `do_delivery'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/mail-2.6.4/lib/mail/message.rb:237:in `block in deliver'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:543:in `block in deliver_mail'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `block in instrument'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/activesupport-4.2.6/lib/active_support/notifications.rb:164:in `instrument'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/actionmailer-4.2.6/lib/action_mailer/base.rb:541:in `deliver_mail'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/mail-2.6.4/lib/mail/message.rb:237:in `deliver'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/actionmailer-4.2.6/lib/action_mailer/message_delivery.rb:85:in `deliver_now'
    from (irb):4
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/railties-4.2.6/lib/rails/commands/console.rb:110:in `start'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/railties-4.2.6/lib/rails/commands/console.rb:9:in `start'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:9:in `require'
    from bin/rails:9:in `<main>'irb(main):005:0>