gitlab 邮箱无法发送

发布于 2022-09-06 01:43:42 字数 3999 浏览 18 评论 0

测试错误信息如下:

irb(main):002:0> Notify.test_email('joezhow777@gmail.com', '测试', '邮件测试').deliver_now

Notify#test_email: processed outbound mail in 1.9ms

Sent mail to joezhow777@gmail.com (30005.7ms)
Date: Fri, 20 Oct 2017 10:27:01 -0400
From: HLT_172LocalGitLab <joezhow777@163.com>
Reply-To: HLT_172LocalGitLab <joezhow777@163.com>
To: joezhow777@gmail.com
Message-ID: <59ea07b56932b_56ea3f8d962db12c3198b@m172.mail>
Subject: =?UTF-8?Q?=E6=B5=8B=E8=AF=95?=
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable
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-html40/loose.dtd">
<html><body><p>=E9=82=AE=E4=BB=B6=E6=B5=8B=E8=AF=95</p></body></html>

Net::OpenTimeout: execution expired
    from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `initialize'
    from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `open'
    from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `tcp_socket'
    from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:552:in `block in do_start'
    from /opt/gitlab/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
    from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:551:in `do_start'
    from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:521:in `start'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.5/lib/mail/network/delivery_methods/smtp.rb:113:in `deliver!'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.5/lib/mail/message.rb:2149:in `do_delivery'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.5/lib/mail/message.rb:237:in `block in deliver'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:543:in `block in deliver_mail'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `block in instrument'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in `instrument'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:541:in `deliver_mail'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.5/lib/mail/message.rb:237:in `deliver'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/message_delivery.rb:85:in `deliver_now'
    from (irb):2
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:110:in `start'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:9:in `start'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68:in `console'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
    from /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in `<top (required)>'
    from bin/rails:9:in `require'
    from bin/rails:9:in `<main>'

从反馈里看:

From: HLT_172LocalGitLab <joezhow777@163.com>
Reply-To: HLT_172LocalGitLab <joezhow777@163.com>

邮箱应该是设置成功了的,但是小白不明白为什么邮件还是发不出去呢?

补充配置文件:

clipboard.png

clipboard.png

-----10月21日更新

这可能是服务器在校园网内的原因,我在UCLoud上搭建服务器用这个配置没有问题,能成功发送邮件,在校园网的服务器里会出错,有经验的小伙伴可以指点下如何排查问题吗。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

素罗衫 2022-09-13 01:43:42

gmail邮箱被墙了啊

手长情犹 2022-09-13 01:43:42

已知阿里云和腾讯云的服务器,默认屏蔽25端口。题主可以考虑使用SSL发信。

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文