From 8d9d0dab6364671c956b42e7f9a514fc20a2afb7 Mon Sep 17 00:00:00 2001 From: Clemens Solar Date: Tue, 9 Oct 2018 17:13:04 +0200 Subject: [PATCH] sort mx records by priority (lowest first) --- sendmail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendmail.js b/sendmail.js index efa50aa..7c766ee 100644 --- a/sendmail.js +++ b/sendmail.js @@ -77,7 +77,7 @@ module.exports = function (options) { return callback(err) } - data.sort(function (a, b) { return a.priority < b.priority }); + data.sort(function (a, b) { return a.priority > b.priority }); logger.debug('mx resolved: ', data); if (!data || data.length === 0) {