Skip to content

Commit

Permalink
email validation support for hostnames with punnycode
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegPhenomenon committed Aug 22, 2023
1 parent e2d0e60 commit 9f4d4ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/interactions/actions/simple_mail_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ module SimpleMailValidator
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
Expand Down

0 comments on commit 9f4d4ec

Please sign in to comment.