eslint: add no-shadow
This commit is contained in:
+10
-10
@@ -520,8 +520,8 @@ async function checkRbl(type, mailDomain) {
|
||||
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.length === 0) continue; // not listed
|
||||
const [rblError, records] = await safe(dig.resolve(`${flippedIp}.${rblServer.dns}`, 'A', DNS_OPTIONS));
|
||||
if (rblError || records.length === 0) continue; // not listed
|
||||
|
||||
debug(`checkRbl (${domain}) flippedIp: ${flippedIp} is in the blocklist of ${rblServer.dns}: ${JSON.stringify(records)}`);
|
||||
|
||||
@@ -753,8 +753,8 @@ async function setMailRelay(domain, relay, options) {
|
||||
}
|
||||
|
||||
if (!options.skipVerify) {
|
||||
const result = await checkSmtpRelay(relay);
|
||||
if (result.status === 'failed') throw new BoxError(BoxError.BAD_FIELD, result.message);
|
||||
const relayResult = await checkSmtpRelay(relay);
|
||||
if (relayResult.status === 'failed') throw new BoxError(BoxError.BAD_FIELD, relayResult.message);
|
||||
}
|
||||
|
||||
await updateDomain(domain, { relay });
|
||||
@@ -993,16 +993,16 @@ async function setAliases(name, domain, aliases, auditSource) {
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
|
||||
for (let i = 0; i < aliases.length; i++) {
|
||||
const name = aliases[i].name.toLowerCase();
|
||||
const domain = aliases[i].domain.toLowerCase();
|
||||
const aliasName = aliases[i].name.toLowerCase();
|
||||
const aliasDomain = aliases[i].domain.toLowerCase();
|
||||
|
||||
const error = validateAlias(name);
|
||||
const error = validateAlias(aliasName);
|
||||
if (error) throw error;
|
||||
|
||||
const mailDomain = await getDomain(domain);
|
||||
if (!mailDomain) throw new BoxError(BoxError.NOT_FOUND, `mail domain ${domain} not found`);
|
||||
const mailDomain = await getDomain(aliasDomain);
|
||||
if (!mailDomain) throw new BoxError(BoxError.NOT_FOUND, `mail domain ${aliasDomain} not found`);
|
||||
|
||||
aliases[i] = { name, domain };
|
||||
aliases[i] = { name: aliasName, domain: aliasDomain };
|
||||
}
|
||||
|
||||
const results = await database.query('SELECT ' + MAILBOX_FIELDS + ' FROM mailboxes WHERE name = ? AND domain = ?', [ name, domain ]);
|
||||
|
||||
Reference in New Issue
Block a user