mx-connect
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -46,3 +46,18 @@ 'use strict'; | ||
// filter out hosts | ||
mxHosts = mxHosts.filter(mx => !delivery.ignoreMXHosts.includes(mx.host)); | ||
if (!mxHosts.length) { | ||
if (mxHostsSeen.size) { | ||
// we did have some hosts listed but these were filtered out | ||
let err; | ||
if (delivery.mxLastError) { | ||
err = delivery.mxLastError; | ||
} else { | ||
err = new Error('Could not connect to MX of ' + delivery.domain); | ||
err.response = '450 ' + err.message; | ||
err.category = 'connect'; | ||
} | ||
return reject(err); | ||
} | ||
let err = new Error('Could not find any MX servers for ' + delivery.domain); | ||
@@ -49,0 +64,0 @@ err.response = '550 ' + err.message; |
@@ -54,3 +54,6 @@ 'use strict'; | ||
connectHook: options.connectHook | ||
connectHook: options.connectHook, | ||
ignoreMXHosts: options.ignoreMXHosts || [], | ||
mxLastError: options.mxLastError || false | ||
}; | ||
@@ -57,0 +60,0 @@ |
{ | ||
"name": "mx-connect", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Establish TCP connection to a MX server", | ||
@@ -5,0 +5,0 @@ "main": "lib/mx-connect.js", |
54278
931