diff --git a/src/mail.js b/src/mail.js index e9ab3ab21..79a83730d 100644 --- a/src/mail.js +++ b/src/mail.js @@ -578,7 +578,7 @@ async function checkConfiguration() { const allDomains = await listDomains(); for (const domainObject of allDomains) { - const result = await util.promisify(getStatus)(domainObject.domain); + const result = await getStatus(domainObject.domain); let message = []; @@ -933,13 +933,11 @@ async function setDnsRecords(domain) { await upsertDnsRecords(domain, settings.mailFqdn()); } -function getLocation(callback) { - assert.strictEqual(typeof callback, 'function'); - +async function getLocation() { const domain = settings.mailDomain(), fqdn = settings.mailFqdn(); const subdomain = fqdn.substr(0, fqdn.length - domain.length - 1); - callback(null, { domain, subdomain }); + return { domain, subdomain }; } async function changeLocation(auditSource, progressCallback) { @@ -960,7 +958,7 @@ async function changeLocation(auditSource, progressCallback) { progressCallback({ percent: progress, message: `Updating DNS of ${domainObject.domain}` }); progress += Math.round(70/allDomains.length); - const [error] = await safe(util.promisify(upsertDnsRecords)(domainObject.domain, fqdn)); // ignore any errors. we anyway report dns errors in status tab + const [error] = await safe(upsertDnsRecords(domainObject.domain, fqdn)); // ignore any errors. we anyway report dns errors in status tab progressCallback({ percent: progress, message: `Updated DNS of ${domainObject.domain}: ${error ? error.message : 'success'}` }); }