Check dns records for generic dns providers

This commit is contained in:
Dennis Schwerdel
2016-12-09 09:19:23 +01:00
committed by Johannes Zellner
parent e58068688c
commit 1065b56380
8 changed files with 121 additions and 5 deletions

View File

@@ -442,6 +442,13 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
}).error(defaultErrorHandler(callback));
};
Client.prototype.getExpectedDnsRecords = function (callback) {
get('/api/v1/settings/expected_dns_records').success(function(data, status) {
if (status !== 200) return callback(new ClientError(status, data));
callback(null, data);
}).error(defaultErrorHandler(callback));
};
Client.prototype.setAppstoreConfig = function (config, callback) {
var data = config;

View File

@@ -117,6 +117,18 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
Client.notify('Backup Configuration', 'Please setup an external backup storage to avoid data loss', true, 'info', actionScope);
}
});
// Check if all DNS records are set up properly
Client.getExpectedDnsRecords(function (error, result) {
if (error) return console.error(error);
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);
}
});
}
Client.getStatus(function (error, status) {