summaryrefslogtreecommitdiffstats
path: root/maildir/maildirquota.sgml
blob: bd73e25bb7f5e96927303f2dfb8684b0ea58d808 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<!-- Copyright 1998 - 2008 Double Precision, Inc.  See COPYING for -->
<!-- distribution information. -->
<refentry id="maildirquota">
  <info><author><firstname>Sam</firstname><surname>Varshavchik</surname><contrib>Author</contrib></author><productname>Courier Mail Server</productname></info>

  <refmeta>
    <refentrytitle>maildirquota</refentrytitle>
    <manvolnum>7</manvolnum>
    <refmiscinfo class="manual">Double Precision, Inc.</refmiscinfo>
  </refmeta>

  <refnamediv>
    <refname>maildirquota</refname>
    <refpurpose>voluntary Maildir quotas</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
  <cmdsynopsis sepchar=" ">
     <command moreinfo="none">maildirmake</command>
     <arg choice="req" rep="norepeat">-q</arg>
     <arg choice="req" rep="norepeat">10000000S</arg>
     <arg choice="req" rep="norepeat">./Maildir</arg>
  </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1 id="maildirquota_description">
    <title>DESCRIPTION</title>

    <para>
<command moreinfo="none">maildrop</command> has a manual quota enforcement
implementation that does use the quota facilities of the host
operating system (filesystem-based quotas).
This is an option that is set at configuration time, and
may be disabled.</para>

    <para>Using filesystem quotas sometimes leads to problems. After a hard
quota is hit, most commands issued by mail clients fail, including some
commands that poorly-written mail
software may not expect to fail, and therefore be unable
to gracefully handle the unexpected failure.</para>

    <para>
With manual quotas, the only operations that fail are the ones that most
mail clients expect to fail, when the mailbox is full.
However,
filesystem-based quotas cannot be used in some situations, such as virtual
mailboxes. If this experimental feature is enabled, approximate quota
enforcement can be implemented by <command moreinfo="none">maildrop</command>
or <command moreinfo="none">deliverquota</command> to whatever extent it's
possible to do so.  Quotas are enabled by the <option>-q</option>
option to <command moreinfo="none">maildirmake</command>.
Both <command moreinfo="none">maildrop</command> and
<command moreinfo="none">deliverquota</command> will observe any
<command moreinfo="none">maildirmake</command>-requested quota.</para>

    <refsect2 id="maildirquota_limitations">
      <title>LIMITATIONS</title>
 
      <para>This quota mechanism will only work as long as
<command moreinfo="none">maildrop</command> (or <command moreinfo="none">deliverquota</command>) are the only
applications that deliver messages to the maildir, or as long as other
applications implement the same quota enforcement mechanism. The quota
enforcement mechanism is described separately in the
<filename moreinfo="none">README.maildirquota.html</filename> file in the source code
distribution.</para>

      <para>Quota enforcement will still work, to some extent,
if there are other
applications that deliver or modify messages in the maildir.  However, quota
enforcement may not kick in immediately when the maildir goes over quota, in
fact the maildir can go over quota by a noticeable amount.  But eventually,
as long as
<command moreinfo="none">maildrop</command>
or <command moreinfo="none">deliverquota</command>
are responsible for delivering the majority of
messages, quota
enforcement will kick in. Also, other sources of messages may also result in
noticeable performance degradation, because quote recalculation will become
noticeably more expensive.</para>

      <para>
Also keep in mind that this quota mechanism is generally useless if
mail recipients have direct access to their maildirs.</para>

      <para>
Finally even under the best conditions this quota enforcement does have a
small chance of a race condition where a maildir will go over quota by some
amount. maildirs are designed for speed, and this quota implementation was
designed to have as little additional overhead as possible,
compared to regular maildirs. To enforce an exact quota you would have to use
some kind of a locking facility, which will impose a drastic performance
degradation on the overall maildir performance.  A decision has been made to
avoid locking, with the only negative side effect being a possibility of going
over quota in very low probability situations.</para>

      <para>
A way to minimize the risk of going over quota is to set reasonable quotas,
in relation to maximum message sizes supported by your mail server. If you set
your maildir quota to five gigabytes, for example, it makes very little sense
to configure your mail server to accept messages up to three gigabytes in
size.
Your maildir quota should be chosen so that it makes sense when compared to
the maximum message size allowed by your mail server.</para>
    </refsect2>

    <refsect2 id="maildirquota_folders">
      <title>FOLDERS</title>

      <para>
This quota implementation is compatible with a popular extension to maildir
which defines individual mail folders within a single maildir. However, in
order to create a compatible folder, you MUST use
the <command moreinfo="none">maildirmake</command>
command that comes with <command moreinfo="none">maildrop</command>, and
you MUST use the <option>-f</option>
option to <command moreinfo="none">maildirmake</command>, giving the name of the folder.
Do not use
<command moreinfo="none">maildirmake</command> and specify the directory name of the maildir
folder.
Quota enforcement will not work if you do that.</para>
    </refsect2>

  </refsect1>

  <refsect1 id="maildirquota_see_also">
    <title>SEE ALSO</title>

    <para>
<ulink url="maildrop.html"><citerefentry><refentrytitle>maildrop</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink>,
<ulink url="maildirmake.html"><citerefentry><refentrytitle>maildirmake</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink>,
<ulink url="maildropfilter.html"><citerefentry><refentrytitle>maildropfilter</refentrytitle><manvolnum>5</manvolnum></citerefentry></ulink>,
<ulink url="deliverquota.html"><citerefentry><refentrytitle>deliverquota</refentrytitle><manvolnum>8</manvolnum></citerefentry></ulink>.
</para>
  </refsect1>

</refentry>