smtp_settings.rb.in 1.21 KB
Newer Older
1 2 3 4 5
{{ 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.2.3+ce.0-0-g8eda093)
6

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

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

  ActionMailer::Base.smtp_settings = {
14 15 16 17 18 19 20 21 22 23
    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') }},
    openssl_verify_mode:    '{{ cfg("smtp_openssl_verify_mode") }}'
    # ca_path:
    # ca_file:
24 25
  }
end
26 27 28 29
{% else %}
# SMTP disabled in instance configuration (see `smtp_enable` parameter).
# Mail sending, if enabled (see `email_enabled`), will be done via sendmail.
{% endif %}