Impossible to send email with SMTP server without auth
Summary
Gitlab-ce 8.12.0
cannot send email with this config in /etc/gitlab/gitlab.rb
gitlab_rails['gitlab_email_from'] = 'gitlab@mydomain.com'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "172.16.xxx.xxx"
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_domain'] = "mydomain.com"
gitlab_rails['smtp_authentication'] = false
So the SMTP server on 172.16.xxx.xxx
(internal network) without any verification. It reachable from the server (check done with simple telnet connection).
Steps to reproduce
- Put this configuration
- Restart gitlab
- Go to login page
- Try the Forgot password
Expected behavior
Receiving an email
Actual behavior
- No error message in interface
- The SMTP server didn't saw any gitlab action
- No mail received
Relevant logs and/or screenshots
In sidekiq.log
2016-09-28_13:04:09.48644 2016-09-28T13:04:09.485Z 14456 TID-q0554 ActionMailer::DeliveryJob JID-ad86faf4f36c8d0536ef0709 INFO: start
2016-09-28_13:04:39.51043 2016-09-28T13:04:39.510Z 14456 TID-q0554 ActionMailer::DeliveryJob JID-ad86faf4f36c8d0536ef0709 INFO: fail: 30.024 sec
2016-09-28_13:04:39.51044 2016-09-28T13:04:39.510Z 14456 TID-q0554 WARN: {"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"ActionMailer::DeliveryJob","queue":"mailers","args":[{"job_class":"ActionMailer::DeliveryJob","job_id":"c4d9a7fb-c1e4-45b0-996d-e7096e6613e5","queue_name":"mailers","arguments":["DeviseMailer","reset_password_instructions","deliver_now",{"_aj_globalid":"gid://gitlab/User/6"},"BW5h5mEyPGVXoNyVtN3T",{"_aj_symbol_keys":[]}],"locale":"en"}],"retry":true,"jid":"ad86faf4f36c8d0536ef0709","created_at":1475066140.118401,"enqueued_at":1475067849.4853225,"error_message":"execution expired","error_class":"Net::OpenTimeout","failed_at":1475066170.5527065,"retry_count":6,"retried_at":1475067879.5097382}
2016-09-28_13:04:39.51045 2016-09-28T13:04:39.510Z 14456 TID-q0554 WARN: Net::OpenTimeout: execution expired
2016-09-28_13:04:39.51045 2016-09-28T13:04:39.510Z 14456 TID-q0554 WARN: /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `initialize'
2016-09-28_13:04:39.51045 /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `open'
2016-09-28_13:04:39.51045 /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:542:in `tcp_socket'
2016-09-28_13:04:39.51046 /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:552:in `block in do_start'
2016-09-28_13:04:39.51046 /opt/gitlab/embedded/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
2016-09-28_13:04:39.51046 /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:551:in `do_start'
2016-09-28_13:04:39.51046 /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:521:in `start'
2016-09-28_13:04:39.51047 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/network/delivery_methods/smtp.rb:113:in `deliver!'
2016-09-28_13:04:39.51047 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2149:in `do_delivery'
2016-09-28_13:04:39.51047 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:237:in `block in deliver'
2016-09-28_13:04:39.51047 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_mailer/base.rb:543:in `block in deliver_mail'
2016-09-28_13:04:39.51047 /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'
2016-09-28_13:04:39.51048 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2016-09-28_13:04:39.51048 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/notifications.rb:164:in `instrument'
2016-09-28_13:04:39.51048 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_mailer/base.rb:541:in `deliver_mail'
2016-09-28_13:04:39.51049 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:237:in `deliver'
2016-09-28_13:04:39.51049 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_mailer/message_delivery.rb:85:in `deliver_now'
2016-09-28_13:04:39.51050 /opt/gitlab/embedded/service/gem/ruby/2.3.0/gems/actionmailer-4.2.7.1/lib/action_mailer/delivery_job.rb:10:in `perform'
In Background job view, I have +100 raw like
- Queue:
mailers
- Task:
DeviseMailer#reset_password_instructions
- Args:
{"_aj_globalid"=>"gid://gitlab/User/24"}, "9Qbi6qZbdPCq1kgzP5S9", {"_aj_symbol_keys"=>[]}
- Error:
Net::OpenTimeout: execution expired
Output of checks
Results of GitLab application Check
gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...
GitLab Shell version >= 3.6.0 ? ... OK (3.6.0)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
2/1 ... ok
2/3 ... ok
2/4 ... ok
2/5 ... ok
2/6 ... ok
2/10 ... ok
20/11 ... ok
2/13 ... ok
14/14 ... ok
2/15 ... ok
14/16 ... ok
2/17 ... repository is empty
20/18 ... ok
20/19 ... ok
20/20 ... ok
20/21 ... ok
20/22 ... ok
20/23 ... ok
20/24 ... ok
20/25 ... repository is empty
20/27 ... ok
14/28 ... ok
20/29 ... ok
14/30 ... ok
20/32 ... ok
22/36 ... ok
20/37 ... ok
23/41 ... ok
20/43 ... ok
14/44 ... ok
25/45 ... ok
23/47 ... ok
25/48 ... ok
25/49 ... ok
25/51 ... ok
25/52 ... ok
14/53 ... ok
25/54 ... ok
10/55 ... repository is empty
29/56 ... ok
29/57 ... ok
29/58 ... ok
14/59 ... ok
15/60 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
2/1 ... yes
2/3 ... yes
2/4 ... yes
2/5 ... yes
2/6 ... yes
2/10 ... yes
20/11 ... yes
2/13 ... yes
14/14 ... yes
2/15 ... yes
14/16 ... yes
2/17 ... yes
20/18 ... yes
20/19 ... yes
20/20 ... yes
20/21 ... yes
20/22 ... yes
20/23 ... yes
20/24 ... yes
20/25 ... yes
20/27 ... yes
14/28 ... yes
20/29 ... yes
14/30 ... yes
20/32 ... yes
22/36 ... yes
20/37 ... yes
23/41 ... yes
20/43 ... yes
14/44 ... yes
25/45 ... yes
23/47 ... yes
25/48 ... yes
25/49 ... yes
25/51 ... yes
25/52 ... yes
14/53 ... yes
25/54 ... yes
10/55 ... yes
29/56 ... yes
29/57 ... yes
29/58 ... yes
14/59 ... yes
15/60 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.1)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.7.4)
Active users: 21
Checking GitLab ... Finished
Results of GitLab environment info
gitlab-rake gitlab:env:info
System information
System: Debian 8.6
Current User: git
Using RVM: no
Ruby Version: 2.3.1p112
Gem Version: 2.6.6
Bundler Version:1.13.1
Rake Version: 10.5.0
Sidekiq Version:4.1.4
GitLab information
Version: 8.12.0
Revision: 0864ff9
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://gitlab.xxxxxxx.com
HTTP Clone URL: https://gitlab.xxxxxxx.com/some-group/some-project.git
SSH Clone URL: git@gitlab.xxxxxx.com:some-group/some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 3.6.0
Repository storage paths:
- default: /home/gitRepository/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git