about summary refs log tree commit diff
path: root/app/validators
diff options
context:
space:
mode:
authorabcang <abcang1015@gmail.com>2018-07-26 11:49:28 +0900
committerEugen Rochko <eugen@zeonfederated.com>2018-07-26 04:49:28 +0200
commit9ad334f65c4391e04928c070714b43efc14b9658 (patch)
tree36840db45c427987ef5a341a08e3f475a80e1f1f /app/validators
parentba6a592b3957b490ec5d28a34aa6e988f530cc88 (diff)
Call address instead of exchange (#8076)
Diffstat (limited to 'app/validators')
-rw-r--r--app/validators/email_mx_validator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/email_mx_validator.rb b/app/validators/email_mx_validator.rb
index e9e6b56e8..8d1e58b38 100644
--- a/app/validators/email_mx_validator.rb
+++ b/app/validators/email_mx_validator.rb
@@ -16,7 +16,7 @@ class EmailMxValidator < ActiveModel::Validator
     return true if domain.nil?
 
     records = Resolv::DNS.new.getresources(domain, Resolv::DNS::Resource::IN::MX).to_a.map { |e| e.exchange.to_s }
-    records = Resolv::DNS.new.getresources(domain, Resolv::DNS::Resource::IN::A).to_a.map { |e| e.exchange.to_s } if records.empty?
+    records = Resolv::DNS.new.getresources(domain, Resolv::DNS::Resource::IN::A).to_a.map { |e| e.address.to_s } if records.empty?
 
     records.empty? || on_blacklist?(records)
   end