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

Gitlab SMTP发送邮件报错:

1
Net::OpenTimeout: execution expired

查看Gitlab发送邮件日志:

1
# tail -f log/sidekiq.log

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

SMTP远程服务器端口测试:

1
2
3
4
5
6
7
8
9
10
# 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.
#
1
2
# sudo -u git -H vim config/initializers/smtp_settings.rb
# sudo -u git service gitlab restart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :