diff --git a/src/routes/apps.js b/src/routes/apps.js index 1c3dee1b4..8161658a1 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -373,7 +373,7 @@ async function setMailbox(req, res, next) { if (req.body.enable) { if (req.body.mailboxName !== null && typeof req.body.mailboxName !== 'string') return next(new HttpError(400, 'mailboxName must be a string')); if (typeof req.body.mailboxDomain !== 'string') return next(new HttpError(400, 'mailboxDomain must be a string')); - if (typeof req.body.mailboxDisplayName !== 'string') return next(new HttpError(400, 'mailboxDisplayName must be a string')); + if ('mailboxDisplayName' in req.body && typeof req.body.mailboxDisplayName !== 'string') return next(new HttpError(400, 'mailboxDisplayName must be a string')); } const [error, result] = await safe(apps.setMailbox(req.app, req.body, AuditSource.fromRequest(req)));