2014-09-22 21:47:49 -05:00
|
|
|
# Force Dovecot to recalculate mailbox quota
|
|
|
|
|
2015-03-12 20:13:05 -06:00
|
|
|
## Dovecot-2.x
|
|
|
|
|
|
|
|
Dovecot provides command line tool `doveadm` to recalcuate mailbox quota.
|
|
|
|
Sample usage:
|
|
|
|
|
2015-05-10 08:03:53 -05:00
|
|
|
* Recalculate one mailbox:
|
2015-03-12 20:13:05 -06:00
|
|
|
```
|
2015-05-10 08:03:53 -05:00
|
|
|
# doveadm quota recalc -u user@domain.ltd
|
2015-03-12 20:13:05 -06:00
|
|
|
```
|
|
|
|
|
2015-05-10 08:03:53 -05:00
|
|
|
* Recalculate ALL mail accounts:
|
2015-03-12 20:13:05 -06:00
|
|
|
```
|
2015-05-10 08:03:53 -05:00
|
|
|
# doveadm quota recalc -A
|
2015-03-12 20:13:05 -06:00
|
|
|
```
|
|
|
|
|
2015-05-10 08:03:53 -05:00
|
|
|
Reference: [Doveadm-Quota](http://wiki2.dovecot.org/Tools/Doveadm/Quota)
|
2015-03-12 20:13:05 -06:00
|
|
|
|
|
|
|
## Dovecot-1.x and Dovecot-2.x
|
|
|
|
|
2014-09-22 21:47:49 -05:00
|
|
|
iRedMail enables dict quota since iRedMail-0.7.0, dict quota is recalculated
|
2015-03-12 20:13:05 -06:00
|
|
|
only if the quota goes below zero.
|
2014-09-22 21:47:49 -05:00
|
|
|
|
|
|
|
* For MySQL and PostgreSQL backend:
|
|
|
|
|
|
|
|
```
|
|
|
|
mysql> USE vmail;
|
|
|
|
mysql> DELETE FROM used_quota WHERE username='user@domain.ltd';
|
|
|
|
```
|
|
|
|
|
|
|
|
* For OpenLDAP backend:
|
|
|
|
|
|
|
|
```
|
|
|
|
mysql> USE iredadmin;
|
|
|
|
mysql> DELETE FROM used_quota WHERE username='user@domain.ltd';
|
|
|
|
```
|
|
|
|
|
|
|
|
Re-login via POP3/IMAP (or webmail) will trigger Dovecot to recalculate mailbox
|
|
|
|
quota.
|
|
|
|
|
|
|
|
__TIP__: it's safe to delete records in SQL table `used_quota` if mail user
|
|
|
|
was deleted in table `vmail.mailbox` or LDAP. iRedAdmin-Pro will handle this
|
|
|
|
for you automatically.
|