我在本地Ubuntu服务器上设置了Gitlab CE,我试图使用Zoho向用户发送电子邮件。但是,邮件不会被发送。即使使用gitlab-rails console
进行测试:
irb(main):003:0> Notify.test_email('destination_email@address.com', 'Message Subject', 'Message Body').deliver_now
我的SMTP配置如下:
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.zoho.com"
gitlab_rails['smtp_port'] = 587 # I've also changed to 465, but in vain
gitlab_rails['smtp_authentication'] = "plain"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_user_name'] = "gitlab@mydomain.com"
gitlab_rails['smtp_password'] = "mypassword"
gitlab_rails['smtp_domain'] = "smtp.zoho.com"
通过电子邮件配置回复:
gitlab_rails['incoming_email_enabled'] = true
gitlab_rails['incoming_email_address'] = "gitlab-incoming+{key}@domain.com"
gitlab_rails['incoming_email_email'] = "gitlab@domain.com"
gitlab_rails['incoming_email_password'] = "Password"
gitlab_rails['incoming_email_host'] = "imap.zoho.com"
gitlab_rails['incoming_email_port'] = 993
gitlab_rails['incoming_email_ssl'] = true
gitlab_rails['incoming_email_mailbox_name'] = "inbox"
gitlab_rails['incoming_email_idle_timeout'] = 60
有人可以帮我解决这个问题吗?
更新:这是gitlab_rails console
通知#test_email:处理414.5ms的出站邮件
已发送邮件至user@domain.com(65666.5ms) 日期:2016年11月23日星期三12:47:12 +0100 来自:GitLab 回复:GitLab
收件人:user@domain.com
消息ID:< 583581c03dae3_a7303fac34cdb0fc64a7@administrateur-virtual-machine.mail>
主题:测试
Mime-Version:1.0
Content-Type:text / html; 字符集= UTF-8 内容传输编码:7位
Testons
Net :: ReadTimeout:Net :: ReadTimeout 来自/opt/gitlab/embedded/lib/ruby/2.3.0/net/protocol.rb:158:in
rbuf_fill' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/protocol.rb:136:in
readuntil' 来自/opt/gitlab/embedded/lib/ruby/2.3.0/net/protocol.rb:146:inreadline' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:946:in
recv_response' 来自/opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:556:inblock in do_start' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:956:in
关键' 来自/opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:556:indo_start' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:521:in
开始' 来自/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/network/deli very_methods / smtp.rb:113:在deliver!' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2 149:in
do_delivery&#39 ; 来自/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2 37:在{_ 1}}块中的deliver_mail' 来自/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active _support / notifications.rb:164:inblock in deliver' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_ mailer/base.rb:543:in
instrument' 来自/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active _support / notifications.rb:164:inblock in instrument' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active _support/notifications/instrumenter.rb:20:in
deliver_mail' 来自/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2 37:在instrument' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_ mailer/base.rb:541:in
deliver_now' 来自(irb):1 来自/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds / console.rb:110:在deliver' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_ mailer/message_delivery.rb:85:in
开始' 来自/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds / commands_tasks.rb:68:instart' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds/console.rb:9:in
run_command!&#39 ; 来自/opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds.rb:17:inconsole' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds/commands_tasks.rb:39:in
要求' 来自bin / rails:9:在`'
答案 0 :(得分:0)
我设法通过以下可接受的答案解决了这个问题:ActionMailer "Net::ReadTimeout" when using Delayed Job with Rackspace "emailsrvr.com"
文档(https://docs.gitlab.com/omnibus/settings/smtp.html)中的某些建议设置可能会引起问题。
这些设置对我有用:
gitlab_rails['smtp_address'] = "secure.emailsrvr.com"
gitlab_rails['smtp_port'] = 465
gitlab_rails['smtp_domain'] = "domain.com"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_user_name'] = "no-reply@domain.com"
gitlab_rails['smtp_password'] = "XXX"
gitlab_rails['gitlab_email_from'] = "no-reply@domain.com"
gitlab_rails['gitlab_support_email'] = "support@domain.com"
gitlab_rails['gitlab_email_reply_to'] = "support@domain.com"