email validation support for hostnames with punnycode

This commit is contained in:
Oleg Hasjanov 2023-08-22 15:29:18 +03:00
parent e2d0e60528
commit 9f4d4ecb8a

View file

@ -3,6 +3,10 @@ module Actions
extend self
def run(email:, level:)
local_part, domain = email.split('@')
decoded_domain = Addressable::IDNA.to_unicode(domain)
email = "#{local_part}@#{decoded_domain}"
result = truemail_validate(email: email, level: level)
result = validate_for_a_and_aaaa_records(email) if !result && level == :mx
result