diff options
author | ThibG <thib@sitedethib.com> | 2020-08-12 12:40:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 12:40:25 +0200 |
commit | 8d217d7231be46af552c63aff9e53d0ed5dca0f6 (patch) | |
tree | cc45f0433545e57aafee21f5aa463ff5919a6bae /app/controllers/admin/email_domain_blocks_controller.rb | |
parent | 7dc4c742650ac69ec9a4459b656e172283511e4c (diff) |
Improve email address validation (#14565)
* Increase DNS timeout from 1 second to 5 seconds for MX check 1 seconds is rather short when using a recursive DNS resolver which hasn't got a cached result already available. Use 5 seconds instead, which is the timeout value we use for outgoing HTTP queries. * Add more precise error messages for invalid e-mail addresses
Diffstat (limited to 'app/controllers/admin/email_domain_blocks_controller.rb')
-rw-r--r-- | app/controllers/admin/email_domain_blocks_controller.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/admin/email_domain_blocks_controller.rb b/app/controllers/admin/email_domain_blocks_controller.rb index c25919726..f7bdfb0c5 100644 --- a/app/controllers/admin/email_domain_blocks_controller.rb +++ b/app/controllers/admin/email_domain_blocks_controller.rb @@ -27,7 +27,7 @@ module Admin ips = [] Resolv::DNS.open do |dns| - dns.timeouts = 1 + dns.timeouts = 5 hostnames = dns.getresources(@email_domain_block.domain, Resolv::DNS::Resource::IN::MX).to_a.map { |e| e.exchange.to_s } |