Quota implementation relies on [dovecot quota](https://wiki.dovecot.org/Quota/Configuration) which requires dovecot to be enabled. Consequently, quota directives are disabled when `SMTP_ONLY=1` or when `ENABLE_LDAP=1` or when explicitly disabled with `ENABLE_QUOTAS=0`.
A warning message will be sent to the user when his mailbox is reaching quota limit. Have a look at [90-quota.cf](https://github.com/tomav/docker-mailserver/tree/master/target/dovecot/90-quota.conf) for further details.
### Commands
_exec in the container_
-`setquota <user@domain.tld> [<quota>]`: define the quota of a mailbox (quota format e.g. 302M (B (byte), k (kilobyte), M (megabyte), G (gigabyte) or T (terabyte)))
-`delquota <user@domain.tld>`: delete the quota of a mailbox
-`doveadm quota get -u <user@domain>`: display the quota and the statistics of a mailbox
### `dovecot-quotas.cf`
This file is a key-value database where quotas are stored.
_dovecot-quotas.cf_
```
user@domain.tld:50M
john@other-domain.tld:1G
```
### Notes
- *imap-quota* is enabled and allow clients to query their mailbox usage.
- When the mailbox is deleted, the quota directive is deleted as well.
- LDAP ? Dovecot quotas supports LDAP **but it's not implemented** (_PR are welcome!_).