mail: add mailbox count route

This commit is contained in:
Girish Ramakrishnan
2020-07-15 15:33:53 -07:00
parent d429015f83
commit bff4999d27
4 changed files with 108 additions and 71 deletions
+45 -33
View File
@@ -1,52 +1,53 @@
'use strict';
exports = module.exports = {
getStatus: getStatus,
checkConfiguration: checkConfiguration,
getStatus,
checkConfiguration,
getDomains: getDomains,
getDomains,
getDomain: getDomain,
clearDomains: clearDomains,
getDomain,
clearDomains,
onDomainAdded: onDomainAdded,
onDomainRemoved: onDomainRemoved,
onDomainAdded,
onDomainRemoved,
onMailFqdnChanged,
removePrivateFields: removePrivateFields,
removePrivateFields,
setDnsRecords: setDnsRecords,
onMailFqdnChanged: onMailFqdnChanged,
setDnsRecords,
validateName: validateName,
validateName,
setMailFromValidation: setMailFromValidation,
setCatchAllAddress: setCatchAllAddress,
setMailRelay: setMailRelay,
setMailEnabled: setMailEnabled,
setMailFromValidation,
setCatchAllAddress,
setMailRelay,
setMailEnabled,
startMail: restartMail,
restartMail: restartMail,
handleCertChanged: handleCertChanged,
getMailAuth: getMailAuth,
restartMail,
handleCertChanged,
getMailAuth,
sendTestMail: sendTestMail,
sendTestMail,
listMailboxes: listMailboxes,
removeMailboxes: removeMailboxes,
getMailbox: getMailbox,
addMailbox: addMailbox,
updateMailboxOwner: updateMailboxOwner,
removeMailbox: removeMailbox,
getMailboxCount,
listMailboxes,
removeMailboxes,
getMailbox,
addMailbox,
updateMailboxOwner,
removeMailbox,
getAliases: getAliases,
setAliases: setAliases,
getAliases,
setAliases,
getLists: getLists,
getList: getList,
addList: addList,
updateList: updateList,
removeList: removeList,
resolveList: resolveList,
getLists,
getList,
addList,
updateList,
removeList,
resolveList,
_readDkimPublicKeySync: readDkimPublicKeySync
};
@@ -1046,6 +1047,17 @@ function listMailboxes(domain, search, page, perPage, callback) {
});
}
function getMailboxCount(domain, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof callback, 'function');
mailboxdb.getMailboxCount(domain, function (error, result) {
if (error) return callback(error);
callback(null, result);
});
}
function removeMailboxes(domain, callback) {
assert.strictEqual(typeof domain, 'string');
assert.strictEqual(typeof callback, 'function');