【问题标题】:Gitlab setup not sending emailGitlab设置不发送电子邮件
【发布时间】:2016-09-21 09:50:31
【问题描述】:

我正在尝试在 Windows azure 中设置 GitLab。我关注了这个博客Setup GitLab in azure,它很有魅力。但是我无法通过 GitLab 配置 smtp 邮件发送。

  • 我已遵循此设置SMTP Setup。尝试了 Gmail 和 Zoho,同时使用了 465 和 587 端口

我收到以下错误

2016-09-21_09:44:28.55626 2016-09-21T09:44:28.556Z 13562 TID-vskyw WARN: {"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"ActionMailer::DeliveryJob","queue":"mailers","args":[{"job_class":"ActionMailer::DeliveryJob","job_id":"6a954ac7-19d6-4b27-b28c-c511f25e6896","queue_name":"mailers","arguments":["DeviseMailer","confirmation_instructions","deliver_now",{"_aj_globalid":"gid://gitlab/User/1"},"tgShkQTx5e1sALoxkkGi",{"to":"<my email here>","_aj_symbol_keys":["to"]}],"locale":"en"}],"retry":true,"jid":"cbd7dc87ce4202265d1a6be7","created_at":1474450319.7324607,"enqueued_at":1474451065.2083879,"error_message":"end of file reached","error_class":"EOFError","failed_at":1474450320.9358478,"retry_count":5,"retried_at":1474451068.5555682}

2016-09-21_09:44:28.55639 2016-09-21T09:44:28.556Z 13562 TID-vskyw WARN: EOFError: end of file reached

  • 我尝试了 SSL 和 TLS 的各种组合,但还没有成功!

我正在使用 GitLab 8.11.7

任何帮助将不胜感激。

更新:

我尝试使用 GMail smtp,在允许使用此 URL 访问应用程序后它工作正常。此问题可能是由于某些 Zoho 的 smtp 政策造成的

【问题讨论】:

    标签: email azure smtp gitlab


    【解决方案1】:

    您应该使用新的 smtp 配置

    如果您从源安装并使用 SMTP 传递邮件,则需要将以下行添加到 config/initializers/smtp_settings.rb:

    ActionMailer::Base.delivery_method = :smtp

    https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/8.10-to-8.11.md#smtp-configuration所见

    smtp_settings.rb 的配置示例是:

    if Rails.env.production?
      Rails.application.config.action_mailer.delivery_method = :smtp
      ActionMailer::Base.delivery_method = :smtp
      ActionMailer::Base.smtp_settings = {
        address: "email.server.com",
        port: 465,
        user_name: "smtp",
        password: "123456",
        domain: "gitlab.company.com",
        authentication: :login,
        enable_starttls_auto: true,
        openssl_verify_mode: 'peer' # See ActionMailer documentation for other possible options
      }
    end
    

    您可以在https://gitlab.com/gitlab-org/gitlab-ce/blob/8-12-stable/config/initializers/smtp_settings.rb.sample#L13查看配置 SMTP 的示例文件文档?

    您可以在此处查看更多配置选项http://api.rubyonrails.org/classes/ActionMailer/Base.html#class-ActionMailer::Base-label-Configuration+options

    【讨论】:

      猜你喜欢
      • 2017-04-07
      • 2013-11-23
      • 2012-05-28
      • 1970-01-01
      • 1970-01-01
      • 2018-05-09
      • 2011-07-28
      • 1970-01-01
      • 2011-09-16
      相关资源
      最近更新 更多