SMTP issue : state=error: wrong version number
Summary
I can't configure gitlab to send email through OVH pro mail 2. I've put the same configuration than other services which are working, and also played with the gitlab settings, but I can't manage to make it work. The issue I encounter when trying to send a mail with Notify.test_email('destination_email@address.com', 'Message Subject', 'Message Body').deliver_now
from the doc states the following :
<email things /// >
Traceback (most recent call last):
1: from (irb):1
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: wrong version number)
After some digging on google and other issues here, I've came accross this to test:
$ /opt/gitlab/embedded/bin/openssl s_client -starttls smtp -connect pro2.mail.ovh.net:587
$ /opt/gitlab/embedded/bin/openssl s_client -starttls smtp -connect pro2.mail.ovh.net:587 16:10 1 CONNECTED(00000003) depth=2 C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority verify return:1 depth=1 C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA verify return:1 depth=0 OU = Domain Control Validated, OU = PositiveSSL, CN = pro2.mail.ovh.net verify return:1 --- Certificate chain 0 s:OU = Domain Control Validated, OU = PositiveSSL, CN = pro2.mail.ovh.net i:C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA 1 s:C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA i:C = US, ST = New Jersey, L = Jersey City, O = The USERTRUST Network, CN = USERTrust RSA Certification Authority --- Server certificate -----BEGIN CERTIFICATE----- /// -----END CERTIFICATE----- subject=OU = Domain Control Validated, OU = PositiveSSL, CN = pro2.mail.ovh.netissuer=C = GB, ST = Greater Manchester, L = Salford, O = Sectigo Limited, CN = Sectigo RSA Domain Validation Secure Server CA
No client certificate CA names sent Peer signing digest: SHA256 Peer signature type: RSA Server Temp Key: ECDH, P-256, 256 bits
SSL handshake has read 4422 bytes and written 478 bytes Verification: OK
New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256 Server public key is 4096 bit Secure Renegotiation IS supported No ALPN negotiated SSL-Session: Protocol : TLSv1.2 Cipher : ECDHE-RSA-AES128-GCM-SHA256 Session-ID: C43F0000D1768A44AB560B6659DC0D28DC9BC56BCA255A20093D776A965A9C0C Session-ID-ctx: Master-Key: 676AEBEEBD8AD8F4DD18B267237804CA1CCCF35F343983FC477B0B9A9DF6E9696C174C5FEF836468D08C6F0CF4B59736 PSK identity: None PSK identity hint: None SRP username: None Start Time: 1584976335 Timeout : 7200 (sec) Verify return code: 0 (ok) Extended master secret: yes
So apparently the embedded openssl can connect to the server.
However, the following gitlab configuration cannot (reloaded with gitlab-ctl reconfigure
):
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'pro2.mail.ovh.net'
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = 'email'
gitlab_rails['smtp_password'] = 'password'
gitlab_rails['smtp_domain'] = 'pro2.mail.ovh.net'
gitlab_rails['smtp_authentication'] = 'login' # Tried with 'plain', same error
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['smtp_tls'] = true
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
What is the current bug behavior?
Traceback (most recent call last):
1: from (irb):1
OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=error: wrong version number)
as described above
What is the expected correct behavior?
To be able to send mail
Details of package version
Provide the package version installation details
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-==============-============-============-=========================================================== ii gitlab-ce 12.9.0-ce.0 amd64 GitLab Community Edition (including NGINX, Postgres, Redis) un gitlab-ee (no description available)
Environment details
- Operating System: Debian 10
Linux gitlab-1 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64 GNU/Linux
- Installation Target, remove incorrect values:
- VM: libvirt/KVM
- Installation Type, remove incorrect values:
- New Installation
- Is there any other software running on the machine: netdata
- Is this a single or multiple node installation? single node
Configuration details
see above