Add support for IPv6 only MXes in Email validation (#10009)
* Add support for IPv6 only MXes * Fixed email validator tests
This commit is contained in:
parent
241661e009
commit
4f0322dcae
2 changed files with 39 additions and 0 deletions
|
@ -24,6 +24,7 @@ class EmailMxValidator < ActiveModel::Validator
|
|||
|
||||
([domain] + hostnames).uniq.each do |hostname|
|
||||
ips.concat(dns.getresources(hostname, Resolv::DNS::Resource::IN::A).to_a.map { |e| e.address.to_s })
|
||||
ips.concat(dns.getresources(hostname, Resolv::DNS::Resource::IN::AAAA).to_a.map { |e| e.address.to_s })
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue