diff --git a/src/main/java/org/ays/common/util/validation/EmailAddressValidator.java b/src/main/java/org/ays/common/util/validation/EmailAddressValidator.java index 234d1f9e..1f05d8fe 100644 --- a/src/main/java/org/ays/common/util/validation/EmailAddressValidator.java +++ b/src/main/java/org/ays/common/util/validation/EmailAddressValidator.java @@ -69,6 +69,10 @@ public boolean isValid(String email, ConstraintValidatorContext constraintValida return this.buildViolation(constraintValidatorContext, "email is not in a valid format"); } + if (email.length() < 6 || email.length() > 254) { + return this.buildViolation(constraintValidatorContext, "length must be between 6 and 254 characters"); + } + return true; }