smtp_settings.rb.in 1.26 KB
{{ autogenerated }}
# see:
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/smtp_settings.rb.sample
# https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-cookbooks/gitlab/templates/default/smtp_settings.rb.erb
# (last updated for omnibus-gitlab 8.8.9+ce.0-g25376053)

{% from 'macrolib.cfg.in' import cfg, cfg_bool  with context %}

{% if cfg_bool('smtp_enable') %}
if Rails.env.production?
  Gitlab::Application.config.action_mailer.delivery_method = :smtp

  ActionMailer::Base.delivery_method = :smtp
  ActionMailer::Base.smtp_settings = {
    address:                "{{ cfg('smtp_address') }}",
    port:                   {{ cfg('smtp_port') }},
    user_name:              "{{ cfg('smtp_user_name') }}",
    password:               "{{ cfg('smtp_password') }}",
    domain:                 "{{ cfg('smtp_domain') }}",
    authentication:         :{{ cfg('smtp_authentication') }},
    enable_starttls_auto:   {{ cfg('smtp_enable_starttls_auto') }},
    # ssl:
    openssl_verify_mode:    '{{ cfg("smtp_openssl_verify_mode") }}'
    # ca_path:
    # ca_file:
  }
end
{% else %}
# SMTP disabled in instance configuration (see `smtp_enable` parameter).
# Mail sending, if enabled (see `email_enabled`), will be done via sendmail.
{% endif %}