I’ve been chasing around trying to configure a fresh Gitlab install to send e-mail out via Office365. Currently it is failing with an ‘unknown protocol’ error - does anyone have a known good e-mail config for Office365?
The relevant parts of my gitlab.rb
file are:
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = '[outbound_user_name@mydomain.com]'
gitlab_rails['gitlab_email_display_name'] = 'Gitlab Robot'
gitlab_rails['gitlab_email_reply_to'] = '[noreply@mydomain.com]'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.office365.com"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "[outbound_user_name@mydomain.com]"
gitlab_rails['smtp_password'] = "[password]"
gitlab_rails['smtp_domain'] = "[mydomain.com]"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
gitlab_rails['smtp_ca_path'] = "/etc/ssl/certs"
gitlab_rails['smtp_ca_file'] = "/etc/ssl/certs/ca-certificates.crt"
As far as I can tell, this is the correct configuration based on this Microsoft Technet article. I have, of course, replaced values within square brackets with their correct counterparts!
After reconfiguring and restarting Gitlab, I’m still not able to send mail from Gitlab. The relevant message from /var/log/gitlab/sidekiq/current
seems to be:
TID-8zx5o WARN: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol
TID-8zx5o WARN: /opt/gitlab/embedded/lib/ruby/2.1.0/net/smtp.rb:586:in `connect'
/opt/gitlab/embedded/lib/ruby/2.1.0/net/smtp.rb:586:in `tlsconnect'
I’ve tried many variants on the configuration options, but nothing seems to work for me. I’ve tried initialising a direct TLS connection to smtp.office365.com:587
from the command line using openssl
and that seemed to be successful. I can’t help feel that the ‘SSLv2/v3’ error is a clue - I had expected the connection to be made using TLS - surely SSLv2/v3 is a different (incorrect) connection method?
Version information for the install is as follows:
System information
System: Debian 8.3
Current User: git
Using RVM: no
Ruby Version: 2.1.8p440
Gem Version: 2.5.1
Bundler Version:1.10.6
Rake Version: 10.5.0
Sidekiq Version:4.0.1
GitLab information
Version: 8.4.2
Revision: 8d07b81
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: [hidden]
HTTP Clone URL: [hidden]
SSH Clone URL: [hidden]
Using LDAP: yes
Using Omniauth: no
GitLab Shell
Version: 2.6.10
The local MTA is exim4, configured for direct client connection to SMTP.
Any help would be very gratefully appreciated.