From 5bbaa3bdf068423f86c5d70ea38b4b9135af2542 Mon Sep 17 00:00:00 2001 From: evazion Date: Tue, 21 Apr 2020 00:35:05 -0500 Subject: [PATCH] Fix #4418: Can't migrate mail addresses when email_domain_verification_list is nil. Don't perform email domain verification if email_domain_verification_list is nil or empty. --- app/logical/email_validator.rb | 3 ++- config/danbooru_default_config.rb | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/logical/email_validator.rb b/app/logical/email_validator.rb index 313248be6..35fd5c46a 100644 --- a/app/logical/email_validator.rb +++ b/app/logical/email_validator.rb @@ -81,8 +81,9 @@ module EmailValidator end def nondisposable?(address) + return true if Danbooru.config.email_domain_verification_list.blank? domain = Mail::Address.new(address).domain - domain.in?(Danbooru.config.email_domain_verification_list) + domain.in?(Danbooru.config.email_domain_verification_list.to_a) end def undeliverable?(to_address, from_address: Danbooru.config.contact_email, timeout: 3) diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index 50ea2a6d4..eef9a20dc 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -519,11 +519,17 @@ module Danbooru nil end - # A list of email domains that are used for account verification purposes. - # If a user signs up from a proxy they will need to verify their account - # using an email address from one of the domains on this list. + # The whitelist of email domains allowed for account verification purposes. + # If a user signs up from a proxy, they must verify their account using an + # email address from one of the domains on this list before they can do + # anything on the site. This is meant to prevent users from using + # disposable emails to create sockpuppet accounts. + # + # If this list is empty or nil, then there are no restrictions on which + # email domains can be used to verify accounts. def email_domain_verification_list # ["gmail.com", "outlook.com", "yahoo.com"] + [] end # API key for Google Maps. Used for embedding maps on IP address lookup pages.