Only show mail dns record warnings if email is enabled

This commit is contained in:
Johannes Zellner
2016-12-19 16:22:37 +01:00
parent 2fa4f4c66a
commit 7d76c32334

View File

@@ -118,16 +118,21 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
}
});
// Check if all DNS records are set up properly
Client.getExpectedDnsRecords(function (error, result) {
// Check if all email DNS records are set up properly
Client.getMailConfig(function (error, mailConfig) {
if (error) return console.error(error);
if (!mailConfig.enabled) return;
if (!result.spf.status || !result.dkim.status) {
var actionScope = $scope.$new(true);
actionScope.action = '/#/settings';
Client.getExpectedDnsRecords(function (error, result) {
if (error) return console.error(error);
Client.notify('DNS Configuration', 'Please setup all required DNS records to guarantee correct mail delivery', true, 'info', actionScope);
}
if (!result.spf.status || !result.dkim.status) {
var actionScope = $scope.$new(true);
actionScope.action = '/#/settings';
Client.notify('DNS Configuration', 'Please setup all required DNS records to guarantee correct mail delivery', true, 'info', actionScope);
}
});
});
}