make mailbox domain nullable

for apps that do not use sendmail/recvmail addon, these are now null.
otherwise, there is no way to edit the mailbox in the UI

part of #669
This commit is contained in:
Girish Ramakrishnan
2020-03-30 22:18:39 -07:00
parent 7cb0c31c59
commit e30ea9f143
4 changed files with 59 additions and 9 deletions

View File

@@ -524,7 +524,14 @@ function teardownAddons(app, addons, callback) {
debugApp(app, 'Tearing down addon %s with options %j', addon, addons[addon]);
KNOWN_ADDONS[addon].teardown(app, addons[addon], iteratorCallback);
}, callback);
}, function (error) {
if (error) return callback(error);
if (app.manifest.addons.sendmail || app.manifest.addons.recvmail) return callback();
// clear mailbox name if neither are used
appdb.update(app.id, { mailboxName: null, mailboxDomain: null }, callback);
});
}
function backupAddons(app, addons, callback) {