cannot disable sendmail if not optional
This commit is contained in:
@@ -1484,7 +1484,9 @@ async function setMailbox(app, data, auditSource) {
|
||||
let error = checkAppState(app, exports.ISTATE_PENDING_RECREATE_CONTAINER);
|
||||
if (error) throw error;
|
||||
|
||||
if (!app.manifest.addons?.sendmail) throw new BoxError(BoxError.BAD_FIELD, 'App does not use mail addons');
|
||||
if (!app.manifest.addons?.sendmail) throw new BoxError(BoxError.BAD_FIELD, 'App does not use sendmail');
|
||||
const optional = 'optional' in app.manifest.addons.sendmail ? app.manifest.addons.sendmail.optional : false;
|
||||
if (!optional && !enable) throw new BoxError(BoxError.BAD_FIELD, 'App requires sendmail to be enabled');
|
||||
|
||||
await mail.getDomain(mailboxDomain); // check if domain exists
|
||||
|
||||
|
||||
Reference in New Issue
Block a user