Fixup spam configuration UI
This commit is contained in:
@@ -2132,6 +2132,44 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getSpamAcl = function (callback) {
|
||||
var config = {};
|
||||
|
||||
get('/api/v1/mailserver/spam_acl', config, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
callback(null, data);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.setSpamAcl = function (acl, callback) {
|
||||
post('/api/v1/mailserver/spam_acl', { whitelist: acl.whitelist, blacklist: acl.blacklist }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getSpamCustomConfig = function (callback) {
|
||||
var config = {};
|
||||
|
||||
get('/api/v1/mailserver/spam_custom_config', config, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
callback(null, data.config);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.setSpamCustomConfig = function (config, callback) {
|
||||
post('/api/v1/mailserver/spam_custom_config', { config: config }, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getMailConfigForDomain = function (domain, callback) {
|
||||
get('/api/v1/mail/' + domain, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
|
||||
Reference in New Issue
Block a user