mail: allow underscore in mail address

This commit is contained in:
Girish Ramakrishnan
2022-01-04 14:02:58 -08:00
parent d8314d335a
commit 15d0dd93f4

View File

@@ -162,7 +162,7 @@ function validateName(name) {
if (name.length >= 200) return new BoxError(BoxError.BAD_FIELD, 'mailbox name too long');
// also need to consider valid LDAP characters here (e.g '+' is reserved)
if (/[^a-zA-Z0-9.-]/.test(name)) return new BoxError(BoxError.BAD_FIELD, 'mailbox name can only contain alphanumerals and dot');
if (/[^a-zA-Z0-9.-_]/.test(name)) return new BoxError(BoxError.BAD_FIELD, 'mailbox name can only contain alphanumerals, dot, hyphen or underscore');
return null;
}