remove asserts when sendmail disabled
This commit is contained in:
@@ -1478,10 +1478,7 @@ async function setMailbox(app, data, auditSource) {
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
|
||||
const { enable, mailboxDomain } = data;
|
||||
let mailboxName = data.mailboxName;
|
||||
assert.strictEqual(typeof enable, 'boolean');
|
||||
assert(mailboxName === null || typeof mailboxName === 'string');
|
||||
assert.strictEqual(typeof mailboxDomain, 'string');
|
||||
|
||||
const appId = app.id;
|
||||
let error = checkAppState(app, exports.ISTATE_PENDING_RECREATE_CONTAINER);
|
||||
@@ -1491,6 +1488,7 @@ async function setMailbox(app, data, auditSource) {
|
||||
|
||||
await mail.getDomain(mailboxDomain); // check if domain exists
|
||||
|
||||
let mailboxName = data.mailboxName;
|
||||
if (mailboxName) {
|
||||
error = mail.validateName(mailboxName);
|
||||
if (error) throw new BoxError(BoxError.BAD_FIELD, error.message, { field: 'mailboxName' });
|
||||
|
||||
Reference in New Issue
Block a user