SMTP settings not being deployed


#1

I have the SMTP settings defined in gitlab.rb but it looks like they’re not taking effect and gitlab is defaulting to using postfix on localhost instead.

Likewise I can manually add the /var/opt/gitlab/gitlab-rails/smtp_settings.rb and link it to /opt/gitlab/embedded/service/gitlab-rails/config/initializers/smtp_settings.rb and restart gitlab which will use those settings and appear to work but it will get deleted on the next re-configuration.

gitlab-ctl reconfigure | grep smtp
  • templatesymlink[Create a smtp_settings.rb and create a symlink to Rails root] action delete
    • file[/var/opt/gitlab/gitlab-rails/etc/smtp_settings.rb] action delete (up to date)
    • link[/opt/gitlab/embedded/service/gitlab-rails/config/initializers/smtp_settings.rb] action delete (up to date)

Running 11.6.3 (Just upgraded from 11.6.1 to see if that fixed the problem) on Ubuntu 16.04


#2

Got it

For reference it looks like someone had put the SMTP block early in the gitlab.rb file and put

gitlab_rails[‘gitlab_smtp_enable’] = true

where it should be

gitlab_rails['smtp_enable'] = true

Also I removed this configuration block and found the configuration block father down in the file that starts

GitLab email server settings

So I put the configuration there and it’s happy now.