Remove IP matching from e-mail domain blocks (#18190)
Clear out e-mail domain blocks created from automatically resolved DNS records
This commit is contained in:
parent
7b0fe4aef9
commit
f6d35ed57d
9 changed files with 43 additions and 114 deletions
|
@ -15,7 +15,7 @@ class EmailMxValidator < ActiveModel::Validator
|
|||
|
||||
if resolved_ips.empty?
|
||||
user.errors.add(:email, :unreachable)
|
||||
elsif on_blacklist?(resolved_domains, resolved_ips, user.sign_up_ip)
|
||||
elsif on_blacklist?(resolved_domains, user.sign_up_ip)
|
||||
user.errors.add(:email, :blocked)
|
||||
end
|
||||
end
|
||||
|
@ -57,7 +57,7 @@ class EmailMxValidator < ActiveModel::Validator
|
|||
[ips, records]
|
||||
end
|
||||
|
||||
def on_blacklist?(domains, resolved_ips, attempt_ip)
|
||||
EmailDomainBlock.block?(domains, ips: resolved_ips, attempt_ip: attempt_ip)
|
||||
def on_blacklist?(domains, attempt_ip)
|
||||
EmailDomainBlock.block?(domains, attempt_ip: attempt_ip)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue