From 7d76c3233486a6e0ae29e6f94c35d09c86ce8005 Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 19 Dec 2016 16:22:37 +0100 Subject: [PATCH] Only show mail dns record warnings if email is enabled --- webadmin/src/js/main.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/webadmin/src/js/main.js b/webadmin/src/js/main.js index c5c1fa82c..649051102 100644 --- a/webadmin/src/js/main.js +++ b/webadmin/src/js/main.js @@ -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); + } + }); }); }