diff --git a/src/cloudron.js b/src/cloudron.js index 598050d61..bd16f700a 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -543,7 +543,7 @@ function addDnsRecords(ip, callback) { var webadminRecord = { subdomain: config.adminLocation(), type: 'A', values: [ ip ] }; // t=s limits the domainkey to this domain and not it's subdomains - var dkimRecord = { subdomain: constants.DKIM_SELECTOR + '._domainkey', type: 'TXT', values: [ '"v=DKIM1; t=s; p=' + dkimKey + '"' ] }; + var dkimRecord = { subdomain: config.dkimSelector() + '._domainkey', type: 'TXT', values: [ '"v=DKIM1; t=s; p=' + dkimKey + '"' ] }; var records = [ ]; if (config.isCustomDomain()) { diff --git a/src/config.js b/src/config.js index 34c8043ab..e4fbd74d7 100644 --- a/src/config.js +++ b/src/config.js @@ -17,6 +17,7 @@ exports = module.exports = { apiServerOrigin: apiServerOrigin, webServerOrigin: webServerOrigin, fqdn: fqdn, + zoneName: zoneName, setFqdn: setFqdn, token: token, version: version, @@ -33,9 +34,9 @@ exports = module.exports = { mailLocation: mailLocation, mailFqdn: mailFqdn, appFqdn: appFqdn, - zoneName: zoneName, setZoneName: setZoneName, hasIPv6: hasIPv6, + dkimSelector: dkimSelector, isDemo: isDemo, @@ -248,3 +249,9 @@ function hasIPv6() { const IPV6_PROC_FILE = '/proc/net/if_inet6'; return fs.existsSync(IPV6_PROC_FILE); } + +function dkimSelector() { + var loc = adminLocation(); + return loc === 'my' ? 'cloudron' : `cloudron-${loc.replace(/\./g, '')}`; +} + diff --git a/src/constants.js b/src/constants.js index 78ca66e81..793aba4a8 100644 --- a/src/constants.js +++ b/src/constants.js @@ -33,8 +33,6 @@ exports = module.exports = { DEMO_USERNAME: 'cloudron', - DKIM_SELECTOR: 'cloudron', - AUTOUPDATE_PATTERN_NEVER: 'never' }; diff --git a/src/email.js b/src/email.js index 547a9a327..c109715f2 100644 --- a/src/email.js +++ b/src/email.js @@ -132,7 +132,7 @@ function verifyRelay(relay, callback) { function checkDkim(callback) { var dkim = { - domain: constants.DKIM_SELECTOR + '._domainkey.' + config.fqdn(), + domain: config.dkimSelector() + '._domainkey.' + config.fqdn(), type: 'TXT', expected: null, value: null, diff --git a/src/infra_version.js b/src/infra_version.js index 123e931ac..2e9f9bb33 100644 --- a/src/infra_version.js +++ b/src/infra_version.js @@ -18,7 +18,7 @@ exports = module.exports = { 'postgresql': { repo: 'cloudron/postgresql', tag: 'cloudron/postgresql:0.17.0' }, 'mongodb': { repo: 'cloudron/mongodb', tag: 'cloudron/mongodb:0.13.0' }, 'redis': { repo: 'cloudron/redis', tag: 'cloudron/redis:0.11.0' }, - 'mail': { repo: 'cloudron/mail', tag: 'cloudron/mail:0.38.1' }, + 'mail': { repo: 'cloudron/mail', tag: 'cloudron/mail:0.39.0' }, 'graphite': { repo: 'cloudron/graphite', tag: 'cloudron/graphite:0.12.0' } } }; diff --git a/src/platform.js b/src/platform.js index 30de65d82..f435da2ec 100644 --- a/src/platform.js +++ b/src/platform.js @@ -254,7 +254,7 @@ function createMailConfig(callback) { var mailFromValidation = result[settings.MAIL_FROM_VALIDATION_KEY]; if (!safe.fs.writeFileSync(paths.ADDON_CONFIG_DIR + '/mail/mail.ini', - `mail_domain=${fqdn}\nmail_server_name=${mailFqdn}\nalerts_from=${alertsFrom}\nalerts_to=${alertsTo}\ncatch_all=${catchAll}\nmail_from_validation=${mailFromValidation}\n`, 'utf8')) { + `mail_domain=${fqdn}\nmail_server_name=${mailFqdn}\nalerts_from=${alertsFrom}\nalerts_to=${alertsTo}\ncatch_all=${catchAll}\nmail_from_validation=${mailFromValidation}\ndkim_selector=${config.dkimSelector()}`, 'utf8')) { return callback(new Error('Could not create mail var file:' + safe.error.message)); }