Teodor Milkov
2015-Feb-06 15:25 UTC
doveadm quota get doesn't recalculate quota (Maildir backend)
Hello, I've noticed that "doveadm quota get" doesn't recalculate quota if maildirsize file is missing for some reason. It just says quota is unknown, usage is 0. In contrast, vpopmail does regenerate maildirsize if it is missing. Reading the Maildir++ specification there is this part: ...If maildirsize does not exist, or if its size is at least 5120 bytes, recalculate it using the procedure defined above, and use the recalculated numbers... One seemingly legitimate reason for maildirsize to be missing is when vpopmail mailbox is set to NOQUOTA (i.e. no limits). My workaround to this is to use a fallback quota: quota_rule = ?:messages=10000000 That is, if there's no backend limit detected (missing maildirsize) then fallback to 10 mln message count quota. In this case doveadm quota get _does_ recalculate usage and even creates maildirsize file. So, my questions are: 1. Isn't it still better to calculate and show usage even if maildirsize is missing? Because calling quota recalc and then quota get is racy - someone else may change configuration or usage etc. between our two calls (forks). 2. If there's good reason against implicit recalculation, then maybe quota get output should be more specific that neither quota nor usage are known? Instead of usage=0 show -1 or "-" or "n/a" or "unkown"?