Files
jcoffey-dev 0885753efe
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 14m6s
Keep an account's disk quota within its tenant's (inbuxa-admin#257)
A tenant administrator could give an account any disk quota, even ten
times the tenant's own. Writes still stopped at the tenant's limit, but
the account's mail was refused as over quota while the webmail showed
most of its 50 GB free.

- x:Account/set (JMAP and SCIM) refuses an account disk quota above its
  tenant's maxDiskQuota with invalidProperties on quotas, naming both
  sizes, whoever writes it. Checked when the quota is set or changed or
  the account changes tenant: an account already over a lowered tenant
  limit keeps it until someone edits it, like the count limits (MT-18).
  No quota stays allowed (the account shares the tenant's space).
  Accounts a directory creates at sign-in and restored accounts aren't
  checked, so neither is refused for a setting nobody can edit first.
- JMAP Quota/get and IMAP GETQUOTA report the limit the account will
  really meet: its own quota or its tenant's remaining space, whichever
  comes first, as DAV already did. One helper, effective_disk_quota,
  serves all three. An account with no quota of its own in a limited
  tenant now gets a Quota object too.

Tests: the tenant suite covers refusals for the tenant and server
administrators, an update over the limit, an unrelated edit to an
account over a lowered limit, and Quota/get for a member without a
quota.
2026-11-19 18:39:32 -07:00
..