3
votes

I have setup Gitlab CE on a local Ubuntu Server, and I'm trying to use Zoho to send email to users. But, mails are not sent. Even when testing with gitlab-rails console :

irb(main):003:0> Notify.test_email('[email protected]', 'Message Subject', 'Message Body').deliver_now

My SMTP config is as follow :

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'] = "[email protected]"
gitlab_rails['smtp_password'] = "mypassword"
gitlab_rails['smtp_domain'] = "smtp.zoho.com"

And Reply by email config :

gitlab_rails['incoming_email_enabled'] = true
gitlab_rails['incoming_email_address'] = "gitlab-incoming+{key}@domain.com"
gitlab_rails['incoming_email_email'] = "[email protected]"
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

Can somebody help me fix this ?

Update : This is the output of the test in gitlab_rails console

Notify#test_email: processed outbound mail in 414.5ms

Sent mail to [email protected] (65666.5ms) Date: Wed, 23 Nov 2016 12:47:12 +0100 From: GitLab Reply-To: GitLab

To: [email protected]

Message-ID: <583581c03dae3_a7303fac34cdb0fc64a7@administrateur-virtual-machine.mail>

Subject: Test

Mime-Version: 1.0

Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Testons

Net::ReadTimeout: Net::ReadTimeout from /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:inreaduntil' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/protocol.rb:146:in readline' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:946:inrecv_response' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:556:in block in do_start' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:956:incritical' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:556:in do_start' from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:521:instart' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/network/deli very_methods/smtp.rb:113:in deliver!' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2 149:indo_delivery' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2 37:in block in deliver' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_ mailer/base.rb:543:inblock in deliver_mail' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active _support/notifications.rb:164:in block 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:ininstrument' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active _support/notifications.rb:164:in instrument' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_ mailer/base.rb:541:indeliver_mail' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2 37:in deliver' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_ mailer/message_delivery.rb:85:indeliver_now' from (irb):1 from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds/console.rb:110:in start' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds/console.rb:9:instart' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds/commands_tasks.rb:68:in console' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds/commands_tasks.rb:39:inrun_command!' from /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/comma nds.rb:17:in <top (required)>' from bin/rails:9:inrequire' from bin/rails:9:in `'

1
no errors? nothing? what have you tried?pancho018
@pancho018 look at my update.Thanks.sk001
@sk001 I am facing exactly same problem. It started to fail since when I updated gitlab to 9.1.3. Could you find a solution for this?Farzan
@sk001 Do you find the solution? Did you fix it? ThanksAsier Gomez
@Farzan Do you fix your problem? If yes, how do you do it? Really thanksAsier Gomez

1 Answers

1
votes

I managed to solve it with the accepted answer here: ActionMailer "Net::ReadTimeout" when using Delayed Job with Rackspace "emailsrvr.com"

It could be that some of the suggested settings in the documentation (https://docs.gitlab.com/omnibus/settings/smtp.html) cause problems.

These settings work for me:

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'] = "[email protected]"
gitlab_rails['smtp_password'] = "XXX"

gitlab_rails['gitlab_email_from'] = "[email protected]"
gitlab_rails['gitlab_support_email'] = "[email protected]"
gitlab_rails['gitlab_email_reply_to'] = "[email protected]"