Display dns notification only when using cloudron for relay

part of #188
This commit is contained in:
Girish Ramakrishnan
2017-06-28 18:26:44 -05:00
parent 229ca7f86b
commit 5794aaee0a

View File

@@ -140,16 +140,23 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
if (result.provider === 'caas') return;
// Check if all email DNS records are set up properly only for non external DNS API
Client.getEmailStatus(function (error, result) {
Client.getMailRelay(function (error, result) {
if (error) return console.error(error);
if (!result.dns.spf.status || !result.dns.dkim.status || !result.dns.ptr.status || !result.outboundPort25.status) {
var actionScope = $scope.$new(true);
actionScope.action = '/#/email';
// the email status checks are currently only useful when using Cloudron itself for relaying
if (result.provider !== 'cloudron-smtp') return;
Client.notify('DNS Configuration', 'Please setup all required DNS records to guarantee correct mail delivery', false, 'info', actionScope);
}
// Check if all email DNS records are set up properly only for non external DNS API
Client.getEmailStatus(function (error, result) {
if (error) return console.error(error);
if (!result.dns.spf.status || !result.dns.dkim.status || !result.dns.ptr.status || !result.outboundPort25.status) {
var actionScope = $scope.$new(true);
actionScope.action = '/#/email';
Client.notify('DNS Configuration', 'Please setup all required DNS records to guarantee correct mail delivery', false, 'info', actionScope);
}
});
});
});
}