From ef9048edb018f531352206304a976f3e6a34369c Mon Sep 17 00:00:00 2001 From: Priit Tark Date: Tue, 11 Aug 2015 15:05:05 +0300 Subject: [PATCH] Possible to define whitelist emails --- CHANGELOG.md | 4 ++++ config/application-example.yml | 3 +++ config/initializers/settings.rb | 33 +++++++++++++-------------------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77da3eb1d..d77d6b6a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +11.08.2015 + +* Possible to add whitelist_emails_for_staging list at application.yml + 21.07.2015 * Possible to define custom trusted proxies at application.yml diff --git a/config/application-example.yml b/config/application-example.yml index a3a4d2cc0..f8cb0f26e 100644 --- a/config/application-example.yml +++ b/config/application-example.yml @@ -22,6 +22,9 @@ smtp_enable_starttls_auto: 'true' # 'false' # If your mail server requires authentication, please change. smtp_authentication: 'plain' # 'plain', 'login', 'cram_md5' registrant_url: 'https:/registrant.example.com' # for valid email body registrant links +whitelist_emails_for_staging: > + test@example.org, old@example.org, + new@example.org, old@example.com, new@example.com # # ADMIN server diff --git a/config/initializers/settings.rb b/config/initializers/settings.rb index 5dd1507c4..3433f9f4f 100644 --- a/config/initializers/settings.rb +++ b/config/initializers/settings.rb @@ -1,20 +1,13 @@ -TEST_EMAILS = %w( - timo.vohmar@internet.ee - timo.vohmar@eestiinternet.ee - rene.vahtel@internet.ee - martin.mettig@internet.ee - hannes.klausen@internet.ee - georg.kahest@internet.ee - norman.aeg@internet.ee - martti.oigus@internet.ee - jana.jarve@internet.ee - martin@gitlab.eu - priit@gitlab.eu - info@gitlab.eu - test@example.com - test@example.org - old@example.org - new@example.org - old@example.com - new@example.com -) +TEST_EMAILS = + if Rails.env.test? + %w( + test@example.com + test@example.org + old@example.org + new@example.org + old@example.com + new@example.com + ) + else + ENV['whitelist_emails_for_staging'].split(',').map(&:strip) + end