GitLab 19.0.2 smtp_authentication regression
GitLab outgoing email stopped working when we upgraded from 19.0.1 to 19.0.2.
Since 2018 our gitlab.rb was configured as such:
```
...
gitlab_rails['smtp_authentication'] = false
...
```
With the same configuration file, attempting to send an email through console failed as follows:
```
$ sudo gitlab-rails console
--------------------------------------------------------------------------------
Ruby: ruby 3.3.11 (2026-03-26 revision 1f2d15125a) [x86_64-linux]
GitLab: 19.0.2-ee (86c99d562e4) EE
GitLab Shell: 14.51.0
PostgreSQL: 17.8
------------------------------------------------------------[ booted in 30.35s ]
Loading production environment (Rails 7.2.3.1)
gitlab(prod)> Notify.test_email('whatever@gmail.com', 'Hello World', 'This is a test message').deliver_now
net-smtp (0.5.1) lib/net/smtp.rb:883:in `check_auth_args': wrong authentication type false (ArgumentError)
raise ArgumentError, "wrong authentication type #{type}"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
from net-smtp (0.5.1) lib/net/smtp.rb:669:in `do_start'
from net-smtp (0.5.1) lib/net/smtp.rb:642:in `start'
from config/initializers/mail_starttls_patch.rb:53:in `start_smtp_session'
from mail (2.9.0) lib/mail/network/delivery_methods/smtp.rb:108:in `deliver!'
from mail (2.9.0) lib/mail/message.rb:2148:in `do_delivery'
from mail (2.9.0) lib/mail/message.rb:253:in `block in deliver'
from actionmailer (7.2.3.1) lib/action_mailer/base.rb:595:in `block in deliver_mail'
from activesupport (7.2.3.1) lib/active_support/notifications.rb:212:in `instrument'
from actionmailer (7.2.3.1) lib/action_mailer/base.rb:593:in `deliver_mail'
from mail (2.9.0) lib/mail/message.rb:253:in `deliver'
from actionmailer (7.2.3.1) lib/action_mailer/message_delivery.rb:126:in `block (2 levels) in deliver_now'
from activesupport (7.2.3.1) lib/active_support/callbacks.rb:101:in `run_callbacks'
from actionmailer (7.2.3.1) lib/action_mailer/message_delivery.rb:125:in `block in deliver_now'
from actionmailer (7.2.3.1) lib/action_mailer/rescuable.rb:21:in `handle_exceptions'
from actionmailer (7.2.3.1) lib/action_mailer/message_delivery.rb:124:in `deliver_now'
from (gitlab):3:in `<main>'
... 17 levels...
```
Removing `gitlab_rails['smtp_authentication'] = false` from gitlab.rb, reconfiguring gitlab, and attempting to send the email again, works.
```
$ sudo sed -i '/smtp_authentication/d' /etc/gitlab/gitlab.rb
$ sudo gitlab-ctl reconfigure
$ sudo gitlab-rails console
--------------------------------------------------------------------------------
Ruby: ruby 3.3.11 (2026-03-26 revision 1f2d15125a) [x86_64-linux]
GitLab: 19.0.2-ee (86c99d562e4) EE
GitLab Shell: 14.51.0
PostgreSQL: 17.8
------------------------------------------------------------[ booted in 34.59s ]
Loading production environment (Rails 7.2.3.1)
gitlab(prod)> Notify.test_email('whatever@gmail.com', 'Message Subject', 'Message Body').deliver_now
=> #<Mail::Message:1637460, Multipart: false, Headers: <Date: Wed, 17 Jun 2026 13:35:59 +0000>, <Subject: Message Subject>, <MIME-Version: 1.0>, <Content-Type: text/html; charset=UTF-8>, <Content-Transfer-Encoding: 7bit>, <Auto-Submitted: auto-generated>, <X-Auto-Response-Suppress: All>>
gitlab(prod)>
```
(part of the <Mail::> output redacted for privacy).
We noticed that GitLab 19.0.2 bumped the net-smtp library:
```
$ git diff v19.0.1-ee..v19.0.2-ee
...
- net-smtp (0.3.3)
+ net-smtp (0.5.1)
...
```
Possibly the issue was introduced in https://github.com/ruby/net-smtp/pull/73/changes, though I'm not familiar enough with Ruby to tell for certain.
issue