diff --git a/src/mail.js b/src/mail.js index aec8156c4..a0e29ed62 100644 --- a/src/mail.js +++ b/src/mail.js @@ -185,7 +185,9 @@ function validateDisplayName(name) { if (name.length < 1) return new BoxError(BoxError.BAD_FIELD, 'mailbox display name must be atleast 1 char'); if (name.length >= 100) return new BoxError(BoxError.BAD_FIELD, 'mailbox display name too long'); - if (/["<>@]/.test(name)) return new BoxError(BoxError.BAD_FIELD, 'mailbox display name is not valid'); + // 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'); return null; }