Run MX and DMARC checks only if mail is enabled

This commit is contained in:
Girish Ramakrishnan
2019-02-06 15:23:41 -08:00
parent d05bf9396d
commit 2105b2ecdb
3 changed files with 9 additions and 5 deletions

View File

@@ -473,10 +473,13 @@ function getStatus(domain, callback) {
getDomain(domain, function (error, result) {
if (error) return callback(error);
var checks = [
recordResult('dns.mx', checkMx.bind(null, domain, mailFqdn)),
recordResult('dns.dmarc', checkDmarc.bind(null, domain))
];
let checks = [];
if (result.enabled) {
checks.push(
recordResult('dns.mx', checkMx.bind(null, domain, mailFqdn)),
recordResult('dns.dmarc', checkDmarc.bind(null, domain))
);
}
if (result.relay.provider === 'cloudron-smtp') {
// these tests currently only make sense when using Cloudron's SMTP server at this point