Gitlab SMTP测试失败

时间:2018-11-16 04:39:22

标签: ruby-on-rails smtp gitlab gitlab-omnibus gitlab-ce

我正在使用gitlab社区版(综合安装)。我尝试配置SMTP设置,但是在测试配置时出现错误。我相信我们的smtp地址没有用户名和密码。

 gitlab_rails['smtp_enable'] = true
 gitlab_rails['smtp_address'] = "xx.xxxx.com"
 gitlab_rails['smtp_port'] = 465
 gitlab_rails['smtp_enable_starttls_auto'] = true
 gitlab_rails['smtp_tls'] = false
 gitlab_rails['smtp_openssl_verify_mode'] = 'none'

请让我知道如何解决此错误。我不明白错误在哪里。

 GitLab:       11.3.1 (32cb452)
 GitLab Shell: 8.3.3
 postgresql:   9.6.8
-------------------------------------------------------------------------------------
Loading production environment (Rails 4.2.10)
irb(main):001:0> ActionMailer::Base.delivery_method
=> :smtp
irb(main):002:0> Notify.test_email('xx.xx@xxx.com', 'Hello World', 'This is test')


    Notify#test_email: processed outbound mail in 210.3ms

Sent mail to xx.xx@xx.com (30012.0ms)
Date: Thu, 15 Nov 2018 23:24:13 +0000
From: GitLab <gitlab@xx.com>
Reply-To: GitLab <gitlab@xx.com>
To: xx.xx@xxx.com
Message-ID: <5bee001d73945_d693fc0e59daf4021724@ip-10-xx-x-xx.mail>
Subject: Hello World
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit
Auto-Submitted: auto-generated
X-Auto-Response-Suppress: All

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

Net::OpenTimeout: execution expired
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:539:in `initialize'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:539:in `open'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:539:in `tcp_socket'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:549:in `block in do_start'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/timeout.rb:103:in `timeout'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:548:in `do_start'
        from /opt/gitlab/embedded/lib/ruby/2.4.0/net/smtp.rb:518:in `start'
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/network/deliion'
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/network/deli
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/message.rb:2
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/message.rb:2
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionmailer-4.2.10/lib/action_m
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_strument'
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_`instrument'
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/activesupport-4.2.10/lib/active_
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionmailer-4.2.10/lib/action_m
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/mail-2.7.0/lib/mail/message.rb:2
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/actionmailer-4.2.10/lib/action_m'
        from (irb):2
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from /opt/gitlab/embedded/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/comman
        from bin/rails:14:in `require'
        from bin/rails:14:in `<main>'
irb(main):003:0> exit

1 个答案:

答案 0 :(得分:1)

issue 22728的情况相同,但升级后似乎消失了。
就您而言,您已经是最新版本(几乎:请检查11.4是否有帮助)

Issue 23600指向阻止了外发smtp的云提供商。

还要检查"Mail not working" section,以确保以下各项的值:

  • SyncableEntity
  • refresh(:,completion:)