Return expected dns records also if we hit NXDOMAIN

This commit is contained in:
Johannes Zellner
2017-01-10 15:51:53 +01:00
parent 99505fc287
commit 35404a2832

View File

@@ -158,6 +158,7 @@ function getEmailDnsRecords(callback) {
// check if DKIM is already setup
dns.resolveTxt(records.dkim.subdomain + '.' + config.fqdn(), function (error, txtRecords) {
if (error && error.code === 'ENOTFOUND') return callback(null, records); // not setup
if (error) return callback(error);
// ensure this is an array resolveTxt() returns undefined if no records are found
@@ -171,6 +172,7 @@ function getEmailDnsRecords(callback) {
// check if SPF is already setup
dns.resolveTxt(config.fqdn(), function (error, txtRecords) {
if (error && error.code === 'ENOTFOUND') return callback(null, records); // not setup
if (error) return callback(error);
// ensure this is an array resolveTxt() returns undefined if no records are found