From ae8a3715977352565141784da8c7b0311472734a Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sun, 27 Mar 2016 23:05:29 -0700 Subject: [PATCH] add adminFqdn in the spf record For custom domains, we do not set the A record for the naked domain (because the user might be using it for his own). This means that a:domain.com will not work. The solution is to simply use the admin domain. --- src/cloudron.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cloudron.js b/src/cloudron.js index 8cbc86471..6c73f1509 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -372,16 +372,16 @@ function txtRecordsWithSpf(callback) { for (i = 0; i < txtRecords.length; i++) { if (txtRecords[i].indexOf('"v=spf1 ') !== 0) continue; // not SPF - validSpf = txtRecords[i].indexOf(' a:' + config.fqdn() + ' ') !== -1; + validSpf = txtRecords[i].indexOf(' a:' + config.adminFqdn() + ' ') !== -1; break; } if (validSpf) return callback(null, null); if (i == txtRecords.length) { - txtRecords[i] = '"v=spf1 a:' + config.fqdn() + ' ~all"'; + txtRecords[i] = '"v=spf1 a:' + config.adminFqdn() + ' ~all"'; } else { - txtRecords[i] = '"v=spf1 a:' + config.fqdn() + ' ' + txtRecords[i].slice('"v=spf1 '.length); + txtRecords[i] = '"v=spf1 a:' + config.adminFqdn() + ' ' + txtRecords[i].slice('"v=spf1 '.length); } return callback(null, txtRecords);