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
This commit is contained in:
		@@ -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 }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user