blacklisted -> blocked
This commit is contained in:
16
src/mail.js
16
src/mail.js
@@ -499,12 +499,12 @@ async function checkRblStatus(domain) {
|
||||
const flippedIp = ip.split('.').reverse().join('.');
|
||||
|
||||
// https://tools.ietf.org/html/rfc5782
|
||||
const blacklistedServers = [];
|
||||
const blockedServers = [];
|
||||
for (const rblServer of RBL_LIST) {
|
||||
const [error, records] = await safe(dig.resolve(flippedIp + '.' + rblServer.dns, 'A', DNS_OPTIONS));
|
||||
if (error || !records) continue; // not listed
|
||||
|
||||
debug(`checkRblStatus: ${domain} (flippedIp: ${flippedIp}) is in the blacklist of ${JSON.stringify(rblServer)}`);
|
||||
debug(`checkRblStatus: ${domain} (flippedIp: ${flippedIp}) is in the blocklist of ${JSON.stringify(rblServer)}`);
|
||||
|
||||
const result = Object.assign({}, rblServer);
|
||||
|
||||
@@ -513,12 +513,12 @@ async function checkRblStatus(domain) {
|
||||
|
||||
debug(`checkRblStatus: ${domain} (error: ${error2?.message || null}) (txtRecords: ${JSON.stringify(txtRecords)})`);
|
||||
|
||||
blacklistedServers.push(result);
|
||||
blockedServers.push(result);
|
||||
}
|
||||
|
||||
debug(`checkRblStatus: ${domain} (ip: ${ip}) blacklistedServers: ${JSON.stringify(blacklistedServers)})`);
|
||||
debug(`checkRblStatus: ${domain} (ip: ${ip}) blockedServers: ${JSON.stringify(blockedServers)})`);
|
||||
|
||||
return { status: blacklistedServers.length === 0, ip, servers: blacklistedServers };
|
||||
return { status: blockedServers.length === 0, ip, servers: blockedServers };
|
||||
}
|
||||
|
||||
async function getStatus(domain) {
|
||||
@@ -574,14 +574,14 @@ async function getStatus(domain) {
|
||||
}
|
||||
|
||||
async function checkConfiguration() {
|
||||
let messages = {};
|
||||
const messages = {};
|
||||
|
||||
const allDomains = await listDomains();
|
||||
|
||||
for (const domainObject of allDomains) {
|
||||
const result = await getStatus(domainObject.domain);
|
||||
|
||||
let message = [];
|
||||
const message = [];
|
||||
|
||||
Object.keys(result.dns).forEach((type) => {
|
||||
const record = result.dns[type];
|
||||
@@ -590,7 +590,7 @@ async function checkConfiguration() {
|
||||
if (result.relay && result.relay.status === false) message.push(`Relay error: ${result.relay.value}`);
|
||||
if (result.rbl && result.rbl.status === false) { // rbl field contents is optional
|
||||
const servers = result.rbl.servers.map((bs) => `[${bs.name}](${bs.site})`); // in markdown
|
||||
message.push(`This server's IP \`${result.rbl.ip}\` is blacklisted in the following servers - ${servers.join(', ')}`);
|
||||
message.push(`This server's IP \`${result.rbl.ip}\` is blocked in the following servers - ${servers.join(', ')}`);
|
||||
}
|
||||
|
||||
if (message.length) messages[domainObject.domain] = message;
|
||||
|
||||
Reference in New Issue
Block a user