sendmail: restrict few characters in the display name

This commit is contained in:
Girish Ramakrishnan
2022-06-01 08:13:19 -07:00
parent 85af0d96d2
commit 2dea7f8fe9
2 changed files with 3 additions and 1 deletions

View File

@@ -173,7 +173,8 @@ function validateDisplayName(name) {
assert.strictEqual(typeof name, 'string');
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 name too long');
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');
return null;
}