mail: configure acl

This commit is contained in:
Girish Ramakrishnan
2021-10-13 14:22:37 -07:00
parent fb77bb0b37
commit ea746b7741
4 changed files with 111 additions and 2 deletions

View File

@@ -273,6 +273,55 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
}
},
$scope.acl = {
busy: false,
error: {},
dnsblZones: '',
dnsblZonesCount: 0,
refresh: function () {
Client.getDnsblConfig(function (error, result) {
if (error) return console.error('Failed to get email acl', error);
$scope.acl.dnsblZones = result.zones.join('\n');
$scope.acl.dnsblZonesCount = result.zones.length;
});
},
show: function() {
$scope.acl.busy = false;
$scope.acl.error = {};
$scope.aclChangeForm.$setUntouched();
$scope.aclChangeForm.$setPristine();
$('#aclChangeModal').modal('show');
},
submit: function () {
$scope.acl.busy = true;
$scope.acl.error = {};
var zones = $scope.acl.dnsblZones.split('\n').filter(function (l) { return l !== ''; });
Client.setDnsblConfig(zones, function (error) {
if (error) {
$scope.acl.busy = false;
$scope.acl.error.dnsblZones = error.message;
$scope.aclChangeForm.dnsblZones.$setPristine();
return;
}
$scope.acl.busy = false;
$scope.acl.refresh();
$('#aclChangeModal').modal('hide');
});
}
},
$scope.testEmail = {
busy: false,
error: {},
@@ -364,6 +413,7 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
$scope.maxEmailSize.refresh();
$scope.spamConfig.refresh();
$scope.solrConfig.refresh();
$scope.acl.refresh();
refreshDomainStatuses();
});