diff --git a/dashboard/src/components/MailDomainStatus.vue b/dashboard/src/components/MailDomainStatus.vue index f31bb6b13..ae528b67d 100644 --- a/dashboard/src/components/MailDomainStatus.vue +++ b/dashboard/src/components/MailDomainStatus.vue @@ -131,7 +131,6 @@ onMounted(async () => {
-
{{ domainStatus[type].message }}
{{ server.name }} diff --git a/src/mail.js b/src/mail.js index 1e8838f7e..f5b2cc153 100644 --- a/src/mail.js +++ b/src/mail.js @@ -501,6 +501,7 @@ const RBL_LIST = [ } ]; +// https://tools.ietf.org/html/rfc5782 async function checkRbl(type, mailDomain) { assert.strictEqual(typeof type, 'string'); assert.strictEqual(typeof mailDomain, 'object'); @@ -516,22 +517,21 @@ async function checkRbl(type, mailDomain) { const flippedIp = type === 'ipv4' ? ip.split('.').reverse().join('.') : reverseIPv6(ip); - // https://tools.ietf.org/html/rfc5782 const blockedServers = []; for (const rblServer of RBL_LIST) { if (type === 'ipv6' && rblServer[type] !== true) continue; // all support ipv4 const [error, records] = await safe(dig.resolve(`${flippedIp}.${rblServer.dns}`, 'A', DNS_OPTIONS)); - if (error || !records) continue; // not listed + if (error || records.length === 0) continue; // not listed - debug(`checkRbl: ${domain} flippedIp: ${flippedIp} is in the blocklist of ${rblServer.dns}`); + debug(`checkRbl (${domain}) flippedIp: ${flippedIp} is in the blocklist of ${rblServer.dns}: ${JSON.stringify(records)}`); const result = Object.assign({}, rblServer); const [error2, txtRecords] = await safe(dig.resolve(`${flippedIp}.${rblServer.dns}`, 'TXT', DNS_OPTIONS)); result.txtRecords = error2 || !txtRecords ? 'No TXT record' : txtRecords.map(x => x.join('')); - debug(`checkRbl: ${domain} error: ${error2?.message || null} txtRecords: ${JSON.stringify(txtRecords)}`); + debug(`checkRbl (${domain}) error: ${error2?.message || null} txtRecords: ${JSON.stringify(txtRecords)}`); blockedServers.push(result); } @@ -540,7 +540,7 @@ async function checkRbl(type, mailDomain) { status: blockedServers.length === 0 ? 'passed' : 'failed', ip, servers: blockedServers, - message: `Check using "host ${flippedIp} 127.0.0.150"` + message: '' }; }