summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorMarin Jankovski <maxlazio@gmail.com>2014-10-27 13:02:12 +0100
committerMarin Jankovski <maxlazio@gmail.com>2014-10-27 13:02:12 +0100
commitd504ca8a0c696b31eaf383f97f47e08afac23084 (patch)
treec247f3b9ba838a59df074cd57b25f1f9881e4101 /config
parent2f6856f713eb310ec977c195054fede4373a2e59 (diff)
downloadgitlab-ce-d504ca8a0c696b31eaf383f97f47e08afac23084.tar.gz
Add settings to disable email sending from GitLab.
Diffstat (limited to 'config')
-rw-r--r--config/gitlab.yml.example2
-rw-r--r--config/initializers/1_settings.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 2ca6abac576..bb0ffae0b70 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -39,6 +39,8 @@ production: &base
# time_zone: 'UTC'
## Email settings
+ # Uncomment and set to false if you need to disable email sending from GitLab (default: true)
+ # email_enabled: true
# Email address used in the "From" field in mails sent by GitLab
email_from: example@example.com
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 4670791ddb0..27bb83784ba 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -95,6 +95,7 @@ Settings.gitlab['https'] = false if Settings.gitlab['https'].nil?
Settings.gitlab['port'] ||= Settings.gitlab.https ? 443 : 80
Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
+Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].nil?
Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'