Comparing version 0.1.0-alpha.23 to 0.1.0-alpha.24
@@ -7,2 +7,4 @@ 'use strict'; | ||
const nameservers = [].concat(config.nameservers || []); | ||
const os = require('os'); | ||
const localAddresses = returnLocalAddresses(os.networkInterfaces()); | ||
@@ -24,2 +26,4 @@ // set the nameservers to use for resolving | ||
module.exports.isLocal = address => localAddresses.has(address); | ||
/** | ||
@@ -155,1 +159,18 @@ * Resolves IP address for a domin name | ||
}; | ||
function returnLocalAddresses(interfaces) { | ||
let addresses = new Set(); | ||
Object.keys(interfaces || {}).forEach(key => { | ||
let iface = interfaces[key]; | ||
if (!iface) { | ||
return; | ||
} | ||
[].concat(iface || []).forEach(addr => { | ||
if (addr && addr.address) { | ||
addresses.add(addr.address); | ||
} | ||
}); | ||
}); | ||
return addresses; | ||
} |
@@ -247,2 +247,3 @@ 'use strict'; | ||
} | ||
ipList.filter(ip => !iptools.isLocal(ip)); | ||
if (!ipList.length) { | ||
@@ -249,0 +250,0 @@ log.silly('Sender/' + this.zone.name + '/' + process.pid, 'Could not resolve A/AAAA for %s', exchange.exchange); |
{ | ||
"name": "zone-mta", | ||
"private": false, | ||
"version": "0.1.0-alpha.23", | ||
"version": "0.1.0-alpha.24", | ||
"description": "Tiny outbound MTA", | ||
@@ -6,0 +6,0 @@ "main": "app.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
303626
5977