app: clear mailbox fields when sendmail is removed with an update

This commit is contained in:
Girish Ramakrishnan
2021-10-03 23:38:12 -07:00
parent a3fc5f226a
commit 1743368069

View File

@@ -1759,9 +1759,9 @@ async function updateApp(app, data, auditSource) {
updateConfig.memoryLimit = updateConfig.manifest.memoryLimit;
}
if (!app.manifest.addons?.sendmail) { // clear if the update removed addon
if (!manifest.addons?.sendmail) { // clear if the update removed addon
values.mailboxName = values.mailboxDomain = null;
} else if (!app.mailboxName || app.mailboxName.endsWith('.app')) { // allocate since restore added the addon
} else if (!app.mailboxName || app.mailboxName.endsWith('.app')) { // allocate since update added the addon
values.mailboxName = mailboxNameForLocation(app.location, manifest);
values.mailboxDomain = app.domain;
}