mail: restart apps using email addon

move this logic from frontend to backend
This commit is contained in:
Girish Ramakrishnan
2025-03-10 21:14:55 +01:00
parent 72635c8711
commit 8a51582d8a
3 changed files with 18 additions and 3 deletions

View File

@@ -75,6 +75,7 @@ const assert = require('assert'),
nodemailer = require('nodemailer'),
notifications = require('./notifications.js'),
path = require('path'),
platform = require('./platforms.js'),
safe = require('safetydance'),
services = require('./services.js'),
shell = require('./shell.js')('mail'),
@@ -856,9 +857,10 @@ async function setMailEnabled(domain, enabled, auditSource) {
assert.strictEqual(typeof enabled, 'boolean');
assert.strictEqual(typeof auditSource, 'object');
await updateDomain(domain, { enabled: enabled });
await updateDomain(domain, { enabled });
safe(mailServer.restart(), { debug });
await mailServer.restart();
await platform.onMailServerIncomingDomainsChanged();
await eventlog.add(enabled ? eventlog.ACTION_MAIL_ENABLED : eventlog.ACTION_MAIL_DISABLED, auditSource, { domain });
}