diff --git a/internal/api/mail.go b/internal/api/mail.go index 86c31f56a..30f358ad2 100644 --- a/internal/api/mail.go +++ b/internal/api/mail.go @@ -550,6 +550,9 @@ func validateEmail(email string) (string, error) { if email == "" { return "", badRequestError(ErrorCodeValidationFailed, "An email address is required") } + if len(email) > 255 { + return "", badRequestError(ErrorCodeValidationFailed, "An email address is too long") + } if err := checkmail.ValidateFormat(email); err != nil { return "", badRequestError(ErrorCodeValidationFailed, "Unable to validate email address: "+err.Error()) }