{"id":1363,"date":"2023-03-19T10:21:37","date_gmt":"2023-03-19T02:21:37","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1363"},"modified":"2023-04-28T21:18:16","modified_gmt":"2023-04-28T13:18:16","slug":"gitlab-smtp-sends-email-error-with-net-opentimeout-execution-expired","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/19\/gitlab-smtp-sends-email-error-with-net-opentimeout-execution-expired\/","title":{"rendered":"Gitlab SMTP\u53d1\u9001\u90ae\u4ef6\u62a5\u9519 Net OpenTimeout execution expired"},"content":{"rendered":"<p>Gitlab SMTP\u53d1\u9001\u90ae\u4ef6\u62a5\u9519\uff1a<\/p>\n<pre><code>Net::OpenTimeout: execution expired<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>\u67e5\u770bGitlab\u53d1\u9001\u90ae\u4ef6\u65e5\u5fd7\uff1a<\/p>\n<pre><code class=\"language-shell\"># tail -f log\/sidekiq.log<\/code><\/pre>\n<p>\u539f\u56e0\uff1a\u963f\u91cc\u4e91\u670d\u52a1\u5668\u9ed8\u8ba4\u662f\u5c4f\u853d25\u7aef\u53e3\uff0c\u91c7\u7528SSL 465\u7aef\u53e3\u53d1\u9001\u5373\u53ef<\/p>\n<p>SMTP\u8fdc\u7a0b\u670d\u52a1\u5668\u7aef\u53e3\u6d4b\u8bd5\uff1a<\/p>\n<pre><code class=\"language-shell\"># telnet smtp.exmail.qq.com 25  \/\/\u4e0d\u901a\nTrying 163.177.72.143...\n^C\n# telnet smtp.exmail.qq.com 465  \/\/\u901a\nTrying 163.177.72.143...\nConnected to smtp.exmail.qq.com.\nEscape character is &#039;^]&#039;.\n^C\nConnection closed by foreign host.\n#<\/code><\/pre>\n<pre><code class=\"language-shell\"># sudo -u git -H vim config\/initializers\/smtp_settings.rb\n# sudo -u git service gitlab restart<\/code><\/pre>\n<pre><code class=\"language-ruby\">if Rails.env.production?\n  Rails.application.config.action_mailer.delivery_method = :smtp\n\n  ActionMailer::Base.delivery_method = :smtp\n  ActionMailer::Base.smtp_settings = {\n    address: &quot;smtp.exmail.qq.com&quot;,\n    port: 465,\n    ssl: true,\n    user_name: &quot;example@example.com&quot;,\n    password: &quot;123456&quot;,\n    domain: &quot;mail.example.com&quot;,\n    authentication: :login,\n    enable_starttls_auto: true,\n    openssl_verify_mode: &#039;none&#039;\n    # openssl_verify_mode: &#039;peer&#039; # See ActionMailer documentation for other possible options\n  }\nend<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Gitlab SMTP\u53d1\u9001\u90ae\u4ef6\u62a5\u9519\uff1a Net::OpenTimeout: execution expired  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[230],"tags":[],"class_list":["post-1363","post","type-post","status-publish","format-standard","hentry","category-gitlab"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1363"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1363\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}