about summary refs log tree commit diff
path: root/app/validators/blacklisted_email_validator.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-08-12 12:40:25 +0200
committerGitHub <noreply@github.com>2020-08-12 12:40:25 +0200
commit8d217d7231be46af552c63aff9e53d0ed5dca0f6 (patch)
treecc45f0433545e57aafee21f5aa463ff5919a6bae /app/validators/blacklisted_email_validator.rb
parent7dc4c742650ac69ec9a4459b656e172283511e4c (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/validators/blacklisted_email_validator.rb')
-rw-r--r--app/validators/blacklisted_email_validator.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/validators/blacklisted_email_validator.rb b/app/validators/blacklisted_email_validator.rb
index 0d01a1c47..16e3abf12 100644
--- a/app/validators/blacklisted_email_validator.rb
+++ b/app/validators/blacklisted_email_validator.rb
@@ -6,7 +6,7 @@ class BlacklistedEmailValidator < ActiveModel::Validator
 
     @email = user.email
 
-    user.errors.add(:email, I18n.t('users.invalid_email')) if blocked_email?
+    user.errors.add(:email, I18n.t('users.blocked_email_provider')) if blocked_email?
   end
 
   private