mail: consistently use disk size to calculate usage

In the mail overivew page, we use disk size
In the per mailbox page, we use quota size
This commit is contained in:
Girish Ramakrishnan
2023-07-08 09:46:26 +05:30
parent 5fc0a5f9a2
commit 07457703b1
+3 -2
View File
@@ -438,8 +438,9 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
if (error) return console.error('Failed to fetch usage for domain', domain.domain, error);
domain.usage = 0;
// quotaValue can be missing for deleted mailboxes that are on disk but removed from dovecot/ldap itself
Object.keys(usage).forEach(function (m) { domain.usage += (usage[m].quotaValue || usage[m].diskSize); });
// we used to use quotaValue here but it's quite different wrt diskSize. so choose diskSize consistently
// also, quotaValue can be missing for deleted mailboxes that are on disk but removed from dovecot/ldap itself
Object.keys(usage).forEach(function (m) { domain.usage += usage[m].diskSize; });
});
});
});