This commit is contained in:
Girish Ramakrishnan
2022-11-06 11:57:45 +01:00
parent d0b7097706
commit 9dac5e3406

View File

@@ -187,7 +187,7 @@ function validateDisplayName(name) {
if (name.length >= 100) return new BoxError(BoxError.BAD_FIELD, 'mailbox display name too long');
// technically only ":" is disallowed it seems (https://www.rfc-editor.org/rfc/rfc5322#section-2.2)
// in https://www.rfc-editor.org/rfc/rfc2822.html, display-name is a "phrase"
if (/["<>)(,;\\@]:/.test(name)) return new BoxError(BoxError.BAD_FIELD, 'mailbox display name is not valid');
if (/["<>)(,;\\@:]/.test(name)) return new BoxError(BoxError.BAD_FIELD, 'mailbox display name is not valid');
return null;
}