mail: allow alternate mx

This commit is contained in:
Girish Ramakrishnan
2020-04-22 17:16:52 -07:00
parent 5d87352b28
commit 62fab7b09f
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -269,7 +269,7 @@ function checkMx(domain, mailFqdn, callback) {
if (error) return callback(error, mx);
if (mxRecords.length === 0) return callback(null, mx);
mx.status = mxRecords.length == 1 && mxRecords[0].exchange === mailFqdn;
mx.status = mxRecords.some(mx => mx.exchange === mailFqdn); // this lets use change priority and/or setup backup MX
mx.value = mxRecords.map(function (r) { return r.priority + ' ' + r.exchange + '.'; }).join(' ');
if (mx.status) return callback(null, mx); // MX record is "my."