From 408ea0a2f8bb9258a6e4628cbcfe5a88e87e0236 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Mon, 28 Sep 2015 20:39:59 -0700 Subject: [PATCH] print the correct record --- cloudron.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudron.js b/cloudron.js index 571d832..fb642f8 100644 --- a/cloudron.js +++ b/cloudron.js @@ -261,7 +261,7 @@ Cloudron.prototype.checkSPF = function (callback) { if (error) return callback(error); if (records.length !== 1 || records[0].length !== 1) return callback(new Error('Got ' + JSON.stringify(records) + ' TXT records. Expecting 1 length 2d array')); - if (records[0][0].search(new RegExp('^v=spf1 ip4:' + that._box.ip + ' ~all$')) !== 0) return callback(new Error('Bad SPF record. ' + records[0])); + if (records[0][0].search(new RegExp('^v=spf1 ip4:' + that._box.ip + ' ~all$')) !== 0) return callback(new Error('Bad SPF record. ' + records[0][0])); callback(); }); @@ -272,7 +272,7 @@ Cloudron.prototype.checkDKIM = function (callback) { if (error) return callback(error); if (records.length !== 1 || records[0].length !== 1) return callback(new Error('Got ' + JSON.stringify(records) + ' TXT records. Expecting 1 length 2d array')); - if (records[0][0].search(/^"v=DKIM1; t=s; p=.*"$/) !== 0) return callback(new Error('Bad DKIM record. ' + records[0])); + if (records[0][0].search(/^"v=DKIM1; t=s; p=.*"$/) !== 0) return callback(new Error('Bad DKIM record. ' + records[0][0])); callback(); }); @@ -283,7 +283,7 @@ Cloudron.prototype.checkDMARC = function (callback) { if (error) return callback(error); if (records.length !== 1 || records[0].length !== 1) return callback(new Error('Got ' + JSON.stringify(records) + ' TXT records. Expecting 1 length 2d array')); - if (records[0][0].search(/^"v=DMARC1; p=none; pct=100; rua=mailto:.*; ruf=.*"$/) !== 0) return callback(new Error('Bad DMARC record. ' + records[0])); + if (records[0][0].search(/^"v=DMARC1; p=none; pct=100; rua=mailto:.*; ruf=.*"$/) !== 0) return callback(new Error('Bad DMARC record. ' + records[0][0])); callback(); });