Use doveadm for CMD_API_POP?type=quota loads

Version 1.61.4

Bugfix
Finished

There are 2 types of loads for CMD_API_POP?type=quota 1) CMD_API_POP?type=quota&domain=domain.com This shows all Users. If your system has: pop_disk_usage_dovecot_quota=1 For each User in the output, the sub-array data will now have: usage = 142336 usage_bytes = 142336 quota = 10485760 sent = 5 limit = 10 Where, as doveadm does not return the disk space used (total block usage), but rather size of the files on disk, the usage will be lower than before. Also, the idea of using doveadmn is to greatly reduce load times, as it does not count the data in realtime, but does efficiently keep an up-to-date count of the Maildir. The result is that the usage and usage_bytes will now always show the same (size of total files on disk), where the 'usage' will be lower than it was before (total size of blocks usage.. actual 'disk usage'). 2) Per-User usage will remain backwards compatible, as the read of one single account is "typically" not an issue (I'm sure there might be exceptions), but the odds of a timeout would be far less, vs the read of the entire list of accounts. The per-Email call would usually be: CMD_API_POP?type=quota&domain=domain.com&user=fred unless you now include: &pop_disk_usage_dovecot_quota=1 NOTE: I've included &json=yes in the example below: The old way without pop_disk_usage_dovecot_quota=1 will still give all old output, as before, eg: { "imap": "270336", "imap_bytes": "154854", "inbox": "57344", "inbox_bytes": "25573", "quota": "10485760", "spam": "36864", "spam_bytes": "36864", "total": "327680", "total_bytes": "180427", "webmail": "0", "webmail_bytes": "0" } but when you add: pop_disk_usage_dovecot_quota=1 (requires pop_disk_usage_dovecot_quota=1 to be enabled in DA itself, which most current boxes probably already have) it should load much faster (most noticeable on very large Maildir accounts with many files), and that would show: { "imap": "142336", "imap_bytes": "142336", "inbox": "142336", "inbox_bytes": "142336", "quota": "10485760", "total": "142336", "total_bytes": "10628096", "webmail": "0", "webmail_bytes": "0" } where you'd lose out on the spam, spam_bytes, and so nothings breaks, and all of imap, imap_bytes, inbox, inbox_bytes will report the same value, as returned by doveadm (multiplied by 1024 to give us bytes). Previously, the "inbox" was only for the literal inbox folder, and "imap" was everything else. Now, they're both the sum of everything. ------------- T27472

Try DirectAdmin with a 30-day money back guarantee!