Gitlab SMTP发送邮件报错 Net OpenTimeout execution expired

Gitlab SMTP发送邮件报错:

Net::OpenTimeout: execution expired

查看Gitlab发送邮件日志:

# tail -f log/sidekiq.log

原因:阿里云服务器默认是屏蔽25端口,采用SSL 465端口发送即可

SMTP远程服务器端口测试:

# telnet smtp.exmail.qq.com 25  //不通
Trying 163.177.72.143...
^C
# telnet smtp.exmail.qq.com 465  //通
Trying 163.177.72.143...
Connected to smtp.exmail.qq.com.
Escape character is '^]'.
^C
Connection closed by foreign host.
#
# sudo -u git -H vim config/initializers/smtp_settings.rb
# sudo -u git service gitlab restart
if Rails.env.production?
  Rails.application.config.action_mailer.delivery_method = :smtp

  ActionMailer::Base.delivery_method = :smtp
  ActionMailer::Base.smtp_settings = {
    address: "smtp.exmail.qq.com",
    port: 465,
    ssl: true,
    user_name: "example@example.com",
    password: "123456",
    domain: "mail.example.com",
    authentication: :login,
    enable_starttls_auto: true,
    openssl_verify_mode: 'none'
    # openssl_verify_mode: 'peer' # See ActionMailer documentation for other possible options
  }
end

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/19/gitlab-smtp-sends-email-error-with-net-opentimeout-execution-expired/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
Gitlab SMTP发送邮件报错 Net OpenTimeout execution expired
Gitlab SMTP发送邮件报错: Net::OpenTimeout: execution expired 查看Gitlab发送邮件日志: # tail -f log/sidekiq.log 原因:阿里云服务器默认是屏蔽25端口……
<<上一篇
下一篇>>
文章目录
关闭
目 录