smtp email configurations not working after reconfigure, how to setup properly to avoid this issue!
Using:
- debian 7.9
- gitlab 7.8.4-omnibus-1 (result for dpkg-query -W gitlab)
Problem: There's some configuration that I have to make directly into /var/opt/gitlab/gitlab-rails/etc/smtp_settings.rb
to my smtp work properly.
Every time that I update gitlab I need to comment out the authentication: :"",
section of smtp_settings.rb and also need to to insert the perform_deliveries and raise_delivery_errors to the same file.
Question: Is there a way o avoid this manual edit of the smtp_settings.rb exposing this configuration on gitlab.rb. And how to avoid that the "authentication:" settings appear under smtp_settings. Thanks!
/etc/gitlab/gitlab.rb :
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "smtp.dri.XXX.br"
gitlab_rails['smtp_enable_starttls_auto'] = false
gitlab_rails['smtp_tls'] = false
gitlab_rails['smtp_openssl_verify_mode'] = 'none'
/var/opt/gitlab/gitlab-rails/etc/smtp_settings.rb BEFORE reconfiure:
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
Gitlab::Application.config.action_mailer.perform_deliveries = true
Gitlab::Application.config.action_mailer.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
# authentication: :"", # se for o caso de autenticacao por usuario ou senha especifique aqui
address: "smtp.dri.cefetmg.br",
enable_starttls_auto: false,
}
end
/var/opt/gitlab/gitlab-rails/etc/smtp_settings.rb after reconfiure:
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
authentication: :"",
address: "smtp.dri.cefetmg.br",
enable_starttls_auto: false,
tls: false,
openssl_verify_mode: "none",
ca_file: "/opt/gitlab/embedded/ssl/certs/cacert.pem",
}
end