mail: restart apps using email addon
move this logic from frontend to backend
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user