summaryrefslogtreecommitdiffstats
path: root/doc/wiki/Quota.Maildir.txt
blob: d6ccc85c7f0d5cccfb593496ba47f256fc56cd21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Maildir++ quota
===============

Maildir++ is the most commonly used quota backend with Maildir format. Note
that *Maildir++ quota works only with Maildir format*. With other mailbox
formats you should use <count quota> [Quota.Count.txt]. Dovecot implements the
standard Maildir++ specification
[http://www.courier-mta.org/imap/README.maildirquota.html], so it's compatible
with Courier [http://www.courier-mta.org/], maildrop
[http://www.courier-mta.org/maildrop/], Exim [http://www.exim.org], etc.

There are two ways to configure Maildir++ quota limits:

 1. Configure the limits in Dovecot. You most likely want to do this. See
    <quota main page> [Quota.txt] for how to do this configuration.
 2. Make Dovecot get the limits from existing 'maildirsize' files.

Only Maildir++-specific settings are described below. See <Quota.txt> for more
generic configuration.

Maildir++ quota relies on 'maildirsize' file having correct information, so if
your users can modify the file in some way (e.g. shell access), you're relying
on the goodwill of your users for the quota to work.

You can't rely on Dovecot noticing external changes to Maildir and updating
maildirsize accordingly. This happens eventually when quota is being
recalculated, but it may take a while. Quota recalculation also currently
doesn't trigger quota warning executions.

Maildirsize file
----------------

The 'maildirsize' file in the Maildir root directory contains both the quota
limit information and the current quota status. It contains a header in format:

---%<-------------------------------------------------------------------------
<storage limit in bytes>S,<messages limit>C
---%<-------------------------------------------------------------------------

If you don't configure any quota limits in Dovecot ('quota=maildir' with no
other settings), Dovecot takes the limits from the header. If the file does not
exist, quota isn't enforced.

If you configure quota limits in Dovecot, Dovecot makes sure that this header
is kept up to date. If the file does not exist, it's simply rebuilt.

Once the 'maildirsize' reaches 5120 bytes, the quota is recalculated and the
file is recreated. This makes sure that if quota happens to be broken (e.g.
externally deleted files) it won't stay that way forever.

(This file was created from the wiki on 2019-06-19 12:42)