diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index d6652492e..4f340a3f8 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -3,19 +3,6 @@ class ApplicationMailer < ActionMailer::Base default from: 'noreply@internet.ee' layout 'mailer' - def whitelist_blocked?(emails) - return false if Rails.env.production? || Rails.env.test? - - emails = [emails] unless emails.is_a?(Array) - emails = emails.flatten - emails.each do |email| - next if TEST_EMAILS.include?(email) - logger.info "EMAIL SENDING WAS BLOCKED BY WHITELIST: #{email}" - return true - end - false - end - # turn on delivery on specific (epp) request only, thus rake tasks does not deliver anything def delivery_off?(model, deliver_emails = false) return false if deliver_emails == true diff --git a/app/mailers/contact_mailer.rb b/app/mailers/contact_mailer.rb index 308bdd827..a036f8bef 100644 --- a/app/mailers/contact_mailer.rb +++ b/app/mailers/contact_mailer.rb @@ -13,7 +13,6 @@ class ContactMailer < ApplicationMailer return unless email || @contact return if delivery_off?(@contact, should_deliver) - return if whitelist_blocked?(email) begin mail(to: format(email), subject: "#{I18n.t(:contact_email_update_subject)} [#{@contact.code}]") diff --git a/app/mailers/domain_mailer.rb b/app/mailers/domain_mailer.rb index d92e79ac0..7b508df0c 100644 --- a/app/mailers/domain_mailer.rb +++ b/app/mailers/domain_mailer.rb @@ -17,7 +17,6 @@ class DomainMailer < ApplicationMailer return end - return if whitelist_blocked?(@domain.registrant.email) mail(to: format(@domain.registrant.email), subject: "#{I18n.t(:pending_delete_rejected_notification_subject, name: @domain.name)} [#{@domain.name}]") @@ -29,7 +28,6 @@ class DomainMailer < ApplicationMailer return if delivery_off?(@domain, should_deliver) # no delivery off control, driggered by cron, no epp request - return if whitelist_blocked?(@domain.registrant.email) mail(to: format(@domain.registrant.email), subject: "#{I18n.t(:pending_delete_expired_notification_subject, name: @domain.name)} [#{@domain.name}]") @@ -40,7 +38,6 @@ class DomainMailer < ApplicationMailer return unless @domain return if delivery_off?(@domain, should_deliver) - return if whitelist_blocked?(@domain.registrant.email) mail(to: format(@domain.registrant.email), subject: "#{I18n.t(:delete_confirmation_subject, name: @domain.name)} [#{@domain.name}]") diff --git a/app/mailers/invoice_mailer.rb b/app/mailers/invoice_mailer.rb index 74821c25a..13a0007bc 100644 --- a/app/mailers/invoice_mailer.rb +++ b/app/mailers/invoice_mailer.rb @@ -5,7 +5,6 @@ class InvoiceMailer < ApplicationMailer @invoice = Invoice.find_by(id: invoice_id) billing_email ||= @invoice.billing_email return unless @invoice - return if whitelist_blocked?(billing_email) kit = PDFKit.new(html) pdf = kit.to_pdf diff --git a/config/application-example.yml b/config/application-example.yml index d3737ca83..9cbcadbb6 100644 --- a/config/application-example.yml +++ b/config/application-example.yml @@ -22,13 +22,6 @@ 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 -# Staging env does not send any emails unless they are whitelisted -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 deleted file mode 100644 index eaaa12406..000000000 --- a/config/initializers/settings.rb +++ /dev/null @@ -1,14 +0,0 @@ -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'] ||= '' - ENV['whitelist_emails_for_staging'].to_s.split(',').map(&:strip) - end