Debian Codegraph @

doc/html/imap/concepts/overview_and_concepts.html

raw
1 <!DOCTYPE html>
2 <html class="writer-html5" lang="en" data-content_root="../../">
3 <head>
4 <meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
5
6 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7 <title>Concepts &mdash; Cyrus IMAP 3.12.3 documentation</title>
8 <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
9 <link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=86f27845" />
10 <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=eafc0fe6" />
11 <link rel="stylesheet" href="../../_static/cyrus.css" type="text/css" />
12
13
14
15 <script src="../../_static/jquery.js?v=8dae8fb0"></script>
16 <script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
17 <script src="../../_static/documentation_options.js?v=2c828074"></script>
18 <script src="../../_static/doctools.js?v=888ff710"></script>
19 <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
20 <script src="../../_static/js/theme.js"></script>
21 <link rel="index" title="Index" href="../../genindex.html" />
22 <link rel="search" title="Search" href="../../search.html" />
23 <link rel="next" title="Setup" href="../../setup.html" />
24 <link rel="prev" title="Cyrus IMAP Murder (Server Aggregation)" href="features/server-aggregation.html" />
25 </head>
26
27 <body class="wy-body-for-nav">
28 <div class="wy-grid-for-nav">
29 <nav data-toggle="wy-nav-shift" class="wy-nav-side">
30 <div class="wy-side-scroll">
31 <div class="wy-side-nav-search" >
32
33
34
35 <a href="../../index.html" class="icon icon-home">
36 Cyrus IMAP
37 </a>
38 <div class="version">
39 3.12.3
40 </div>
41 <div role="search">
42 <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
43 <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
44 <input type="hidden" name="check_keywords" value="yes" />
45 <input type="hidden" name="area" value="default" />
46 </form>
47 </div>
48 </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
49 <p class="caption" role="heading"><span class="caption-text">Cyrus IMAP</span></p>
50 <ul class="current">
51 <li class="toctree-l1"><a class="reference internal" href="../../download.html">Download</a></li>
52 <li class="toctree-l1"><a class="reference internal" href="../../quickstart.html">Quickstart Guide</a></li>
53 <li class="toctree-l1 current"><a class="reference internal" href="../../overview.html">Overview</a><ul class="current">
54 <li class="toctree-l2"><a class="reference internal" href="features.html">Features</a></li>
55 <li class="toctree-l2 current"><a class="current reference internal" href="#">Concepts</a><ul>
56 <li class="toctree-l3"><a class="reference internal" href="#access-control-lists">Access Control Lists</a><ul>
57 <li class="toctree-l4"><a class="reference internal" href="#working-with-acls">Working with ACLs</a></li>
58 <li class="toctree-l4"><a class="reference internal" href="#sample-acl">Sample ACL</a></li>
59 <li class="toctree-l4"><a class="reference internal" href="#access-rights">Access Rights</a></li>
60 <li class="toctree-l4"><a class="reference internal" href="#access-control-defaults">Access Control Defaults</a></li>
61 <li class="toctree-l4"><a class="reference internal" href="#access-control-identifier-aci">Access Control Identifier (ACI)</a></li>
62 <li class="toctree-l4"><a class="reference internal" href="#negative-rights">Negative Rights</a></li>
63 <li class="toctree-l4"><a class="reference internal" href="#calculating-a-users-rights">Calculating a Users' Rights</a></li>
64 </ul>
65 </li>
66 <li class="toctree-l3"><a class="reference internal" href="#login-authentication">Login Authentication</a><ul>
67 <li class="toctree-l4"><a class="reference internal" href="#anonymous-login">Anonymous Login</a></li>
68 <li class="toctree-l4"><a class="reference internal" href="#plaintext-authentication">Plaintext Authentication</a></li>
69 <li class="toctree-l4"><a class="reference internal" href="#kerberos-logins">Kerberos Logins</a></li>
70 <li class="toctree-l4"><a class="reference internal" href="#shared-secrets-logins">Shared Secrets Logins</a></li>
71 </ul>
72 </li>
73 <li class="toctree-l3"><a class="reference internal" href="#quotas">Quotas</a><ul>
74 <li class="toctree-l4"><a class="reference internal" href="#working-with-quotas">Working with Quotas</a></li>
75 <li class="toctree-l4"><a class="reference internal" href="#monitor-and-repair">Monitor and Repair</a></li>
76 <li class="toctree-l4"><a class="reference internal" href="#supported-quota-types">Supported Quota Types</a></li>
77 <li class="toctree-l4"><a class="reference internal" href="#quota-roots">Quota Roots</a></li>
78 <li class="toctree-l4"><a class="reference internal" href="#controlling-quota-behavior">Controlling Quota Behavior</a></li>
79 <li class="toctree-l4"><a class="reference internal" href="#mail-delivery-behavior">Mail Delivery Behavior</a></li>
80 <li class="toctree-l4"><a class="reference internal" href="#quota-warnings-upon-select-when-user-has-d-rights">Quota Warnings Upon Select When User Has <code class="docutils literal notranslate"><span class="pre">d</span></code> Rights</a></li>
81 <li class="toctree-l4"><a class="reference internal" href="#quotas-and-partitions">Quotas and Partitions</a></li>
82 </ul>
83 </li>
84 <li class="toctree-l3"><a class="reference internal" href="#new-mail-notification">New Mail Notification</a></li>
85 <li class="toctree-l3"><a class="reference internal" href="#partitions">Partitions</a><ul>
86 <li class="toctree-l4"><a class="reference internal" href="#specifying-partitions-with-create">Specifying Partitions with &quot;create&quot;</a></li>
87 <li class="toctree-l4"><a class="reference internal" href="#changing-partitions-with-rename">Changing Partitions with &quot;rename&quot;</a></li>
88 </ul>
89 </li>
90 <li class="toctree-l3"><a class="reference internal" href="#news">News</a></li>
91 <li class="toctree-l3"><a class="reference internal" href="#pop3-server">POP3 Server</a></li>
92 <li class="toctree-l3"><a class="reference internal" href="#the-syslog-facility">The syslog facility</a></li>
93 <li class="toctree-l3"><a class="reference internal" href="#mail-directory-recovery">Mail Directory Recovery</a><ul>
94 <li class="toctree-l4"><a class="reference internal" href="#reconstructing-mailbox-directories">Reconstructing Mailbox Directories</a></li>
95 <li class="toctree-l4"><a class="reference internal" href="#reconstructing-the-mailboxes-file">Reconstructing the Mailboxes File</a></li>
96 <li class="toctree-l4"><a class="reference internal" href="#reconstructing-quota-roots">Reconstructing Quota Roots</a></li>
97 <li class="toctree-l4"><a class="reference internal" href="#removing-quota-roots">Removing Quota Roots</a></li>
98 <li class="toctree-l4"><a class="reference internal" href="#subscriptions">Subscriptions</a></li>
99 </ul>
100 </li>
101 <li class="toctree-l3"><a class="reference internal" href="#configuration-directory">Configuration Directory</a><ul>
102 <li class="toctree-l4"><a class="reference internal" href="#log-directory">Log Directory</a></li>
103 <li class="toctree-l4"><a class="reference internal" href="#proc-directory">Proc Directory</a></li>
104 </ul>
105 </li>
106 <li class="toctree-l3"><a class="reference internal" href="#message-delivery">Message Delivery</a><ul>
107 <li class="toctree-l4"><a class="reference internal" href="#local-mail-transfer-protocol-lmtp">Local Mail Transfer Protocol (lmtp)</a></li>
108 <li class="toctree-l4"><a class="reference internal" href="#single-instance-store">Single Instance Store</a></li>
109 <li class="toctree-l4"><a class="reference internal" href="#duplicate-delivery-suppression">Duplicate Delivery Suppression</a></li>
110 </ul>
111 </li>
112 <li class="toctree-l3"><a class="reference internal" href="#sieve-a-mail-filtering-language">Sieve, a Mail Filtering Language</a></li>
113 <li class="toctree-l3"><a class="reference internal" href="#cyrus-murder-the-imap-aggregator">Cyrus Murder, the IMAP Aggregator</a></li>
114 </ul>
115 </li>
116 </ul>
117 </li>
118 <li class="toctree-l1"><a class="reference internal" href="../../setup.html">Setup</a></li>
119 <li class="toctree-l1"><a class="reference internal" href="../../operations.html">Operations</a></li>
120 <li class="toctree-l1"><a class="reference internal" href="../../developers.html">Developers</a></li>
121 <li class="toctree-l1"><a class="reference internal" href="../../support.html">Support/Community</a></li>
122 </ul>
123 <p class="caption" role="heading"><span class="caption-text">Cyrus SASL</span></p>
124 <ul>
125 <li class="toctree-l1"><a class="reference external" href="http://www.cyrusimap.org/sasl">Cyrus SASL</a></li>
126 </ul>
127
128 </div>
129 </div>
130 </nav>
131
132 <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
133 <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
134 <a href="../../index.html">Cyrus IMAP</a>
135 </nav>
136
137 <div class="wy-nav-content">
138 <div class="rst-content">
139 <div role="navigation" aria-label="Page navigation">
140 <ul class="wy-breadcrumbs">
141 <li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
142 <li class="breadcrumb-item"><a href="../../overview.html">Overview</a></li>
143 <li class="breadcrumb-item active">Concepts</li>
144 <li class="wy-breadcrumbs-aside">
145 <a href="https://github.com/cyrusimap/cyrus-imapd/blob/master/docsrc/imap/concepts/overview_and_concepts.rst" class="fa fa-github"> Edit on GitHub</a>
146 </li>
147 </ul>
148 <hr/>
149 </div>
150 <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
151 <div itemprop="articleBody">
152
153 <section id="concepts">
154 <h1>Concepts<a class="headerlink" href="#concepts" title="Link to this heading"></a></h1>
155 <p>This section gives an overview of several aspects of the Cyrus IMAP
156 server, as they relate to deployment. In an effort to reduce
157 duplication of information, we will often direct you to documentation
158 in other areas. Please do follow such referrals.</p>
159 <section id="access-control-lists">
160 <h2>Access Control Lists<a class="headerlink" href="#access-control-lists" title="Link to this heading"></a></h2>
161 <p>Access to each mailbox is controlled by access control
162 lists. Access Control Lists (ACLs) provide a powerful mechanism for
163 specifying the users, or groups of users, who have permission to access
164 the mailboxes, and the degree of that access.</p>
165 <p>An ACL is a list of zero or more entries. Each entry contains a
166 mailbox, an Access Control Identifier (ACI) and a set of rights. The
167 ACI specifies the user or group of users for which the entry
168 applies. The set of rights is one or more letters or digits, each
169 letter or digit conferring a particular privilege.</p>
170 <section id="working-with-acls">
171 <h3>Working with ACLs<a class="headerlink" href="#working-with-acls" title="Link to this heading"></a></h3>
172 <p>ACLs are manipulated via these subcommands within the
173 <a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#std-cyrusman-cyradm-8">cyradm(8)</a> program:</p>
174 <blockquote>
175 <div><ul class="simple">
176 <li><p><a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#imap-reference-manpages-systemcommands-cyradm-setaclmailbox"><span class="std std-ref">setaclmailbox</span></a></p></li>
177 <li><p><a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#imap-reference-manpages-systemcommands-cyradm-listaclmailbox"><span class="std std-ref">listaclmailbox</span></a></p></li>
178 <li><p><a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#imap-reference-manpages-systemcommands-cyradm-deleteaclmailbox"><span class="std std-ref">deleteaclmailbox</span></a></p></li>
179 </ul>
180 </div></blockquote>
181 </section>
182 <section id="sample-acl">
183 <h3>Sample ACL<a class="headerlink" href="#sample-acl" title="Link to this heading"></a></h3>
184 <p>A typical ACL is expressed like this:</p>
185 <pre class="literal-block"><strong>setaclmailbox</strong> <em>mailbox</em> <em>id</em> <em>rights</em> [<em>id</em> <em>rights</em> ...]</pre>
186 <p>where <em>mailbox</em> is the name of the mailbox to which the ACL is applied,
187 <em>id</em> is the ACI for the user or group for which the ACL applies, and
188 <em>rights</em> is a concatenated list of Access Rights from the list below.</p>
189 <p>A real world example may look like this:</p>
190 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">setaclmailbox</span> <span class="n">user</span><span class="o">/</span><span class="n">bovik</span><span class="o">/</span><span class="n">public</span> <span class="n">bovik</span> <span class="nb">all</span> <span class="n">group</span><span class="p">:</span><span class="n">users</span> <span class="n">lrsp</span> <span class="n">anyone</span> <span class="n">lrs</span>
191 </pre></div>
192 </div>
193 <p>Here are samples illustrated via output from the <code class="docutils literal notranslate"><span class="pre">listaclmailbox</span></code>
194 command in <a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#std-cyrusman-cyradm-8">cyradm(8)</a>:</p>
195 <pre class="literal-block">localhost&gt; <strong>listaclmailbox tech/%</strong>
196 tech/Commits:
197 group:tech lrswipkxtea
198 anyone lrs
199 tech/abuse:
200 group:tech lrswipkxtecda
201 anyone lrsp
202 tech/security:
203 anyone lrsp
204 group:tech lrswipkxtecda
205 tech/support:
206 group:tech lrswipkxtecda
207 anyone lrsp
208
209 localhost&gt; <strong>listaclmailbox user/bovik/%</strong>
210 user/bovik/Drafts:
211 bovik lrswipkxtecda
212 user/bovik/Sent:
213 bovik lrswipkxtecda
214 user/bovik/Sent Items:
215 bovik lrswipkxtecda
216 user/bovik/Spam:
217 anyone p
218 bovik lrswipkxtecda
219 user/bovik/Trash:
220 bovik lrswipkxtecda</pre>
221 </section>
222 <section id="access-rights">
223 <h3>Access Rights<a class="headerlink" href="#access-rights" title="Link to this heading"></a></h3>
224 <p>The following lists Access Rights that can be used in an Access Control
225 List entry.</p>
226 <dl class="simple">
227 <dt>l</dt><dd><p>The user may see that the mailbox exists (<strong>lookup</strong>).</p>
228 </dd>
229 <dt>r</dt><dd><p>The user may read the mailbox (<strong>read</strong>).</p>
230 </dd>
231 <dt>s</dt><dd><p>Keep per-user seen state (i.e. modify the &quot;Seen&quot; flag)
232 (<strong>setseen</strong>).</p>
233 </dd>
234 <dt>w</dt><dd><p>The user may modify flags and keywords other than &quot;Seen&quot; and
235 &quot;Deleted&quot;. (<strong>write</strong>)</p>
236 </dd>
237 <dt>i</dt><dd><p>The user may insert (append) new messages into the mailbox
238 (<strong>insert</strong>).</p>
239 </dd>
240 <dt>p</dt><dd><p>The user may send email to the submission address for the mailbox
241 (<strong>post</strong>).</p>
242 </dd>
243 <dt>c</dt><dd><p>[<strong>deprecated</strong>: see <code class="docutils literal notranslate"><span class="pre">k</span></code> right, below.]</p>
244 </dd>
245 <dt>k</dt><dd><p>The user may create new mailboxes in this mailbox, delete the
246 current mailbox, or rename the mailbox (<strong>create</strong>).</p>
247 </dd>
248 <dt>x</dt><dd><p>The user may delete the mailbox itself. (<strong>deletembox</strong>)</p>
249 </dd>
250 <dt>t</dt><dd><p>The user may store the &quot;Deleted&quot; flag. In other words, delete
251 messages.</p>
252 </dd>
253 <dt>e</dt><dd><p>The user may Expunge messages which have the &quot;Deleted&quot; flag already
254 set (<strong>expunge</strong>).</p>
255 </dd>
256 <dt>d</dt><dd><p>This &quot;legacy&quot; right is treated by the software as a macro for <code class="docutils literal notranslate"><span class="pre">te</span></code>
257 (<strong>deletemsg</strong> &amp;&amp; <strong>expunge</strong>).</p>
258 </dd>
259 <dt>n</dt><dd><p>The user may store annotations for a message (<strong>annotatemsg</strong>)</p>
260 </dd>
261 <dt>a</dt><dd><p>The user may change the <em>Access Control Information</em> (ACI) on the
262 mailbox (<strong>administer</strong>).</p>
263 </dd>
264 </dl>
265 <p>For a complete reference to Access Rights, please see
266 <a class="reference internal" href="../reference/admin/access-control/rights-reference.html#imap-admin-access-control-lists-rights-reference"><span class="std std-ref">Access Control Lists Rights Reference</span></a></p>
267 <p>Rights are combined through concatenation. Please see
268 <a class="reference internal" href="../reference/admin/access-control/combining-rights.html#imap-admin-access-control-combining-rights"><span class="std std-ref">Combining Access Rights</span></a></p>
269 </section>
270 <section id="access-control-defaults">
271 <h3>Access Control Defaults<a class="headerlink" href="#access-control-defaults" title="Link to this heading"></a></h3>
272 <section id="administrators">
273 <h4>Administrators<a class="headerlink" href="#administrators" title="Link to this heading"></a></h4>
274 <p>Regardless of the ACL on a mailbox, users who are listed in the
275 <code class="docutils literal notranslate"><span class="pre">admins</span></code> configuration option in <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a> implicitly
276 have the <code class="docutils literal notranslate"><span class="pre">l</span></code> and <code class="docutils literal notranslate"><span class="pre">a</span></code> rights on all mailboxes.</p>
277 <p>Administrators can also see across domains which normal users cannot.</p>
278 <div class="admonition warning">
279 <p class="admonition-title">Warning</p>
280 <p>An admin user should not be a normal email account.</p>
281 </div>
282 </section>
283 <section id="mailbox-owners">
284 <h4>Mailbox owners<a class="headerlink" href="#mailbox-owners" title="Link to this heading"></a></h4>
285 <p>The user who owns a mailbox folder has additional rights which are set
286 regardless of any additional ACLs. These are:</p>
287 <ul class="simple">
288 <li><p><strong>l</strong> - <a class="reference internal" href="../reference/admin/access-control/rights-reference.html#imap-admin-access-control-right-l"><span class="std std-ref">lookup</span></a></p></li>
289 <li><p><strong>k</strong> - <a class="reference internal" href="../reference/admin/access-control/rights-reference.html#imap-admin-access-control-right-k"><span class="std std-ref">create subfolders</span></a></p></li>
290 <li><p><strong>x</strong> - <a class="reference internal" href="../reference/admin/access-control/rights-reference.html#imap-admin-access-control-right-x"><span class="std std-ref">delete this folder</span></a></p></li>
291 <li><p><strong>a</strong> - <a class="reference internal" href="../reference/admin/access-control/rights-reference.html#imap-admin-access-control-right-a"><span class="std std-ref">administer</span></a></p></li>
292 </ul>
293 <p>These are set in <code class="docutils literal notranslate"><span class="pre">implicit_owner_rights</span></code> of <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a>.</p>
294 </section>
295 <section id="default">
296 <h4>Default<a class="headerlink" href="#default" title="Link to this heading"></a></h4>
297 <p>For all other mailboxes not owned by a user, any user accessing these
298 mailboxes have the following default privileges:</p>
299 <ul class="simple">
300 <li><p><strong>l</strong> - <a class="reference internal" href="../reference/admin/access-control/rights-reference.html#imap-admin-access-control-right-l"><span class="std std-ref">lookup</span></a></p></li>
301 <li><p><strong>r</strong> - <a class="reference internal" href="../reference/admin/access-control/rights-reference.html#imap-admin-access-control-right-r"><span class="std std-ref">read contents</span></a></p></li>
302 <li><p><strong>s</strong> - <a class="reference internal" href="../reference/admin/access-control/rights-reference.html#imap-admin-access-control-right-s"><span class="std std-ref">seen</span></a></p></li>
303 </ul>
304 <p>These are set in <code class="docutils literal notranslate"><span class="pre">defaultacl</span></code> of <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a>.</p>
305 </section>
306 <section id="initial-acls-for-newly-created-mailboxes">
307 <h4>Initial ACLs for Newly Created Mailboxes<a class="headerlink" href="#initial-acls-for-newly-created-mailboxes" title="Link to this heading"></a></h4>
308 <p>When a mailbox is created, its ACL starts off with a copy of the ACL of its closest parent mailbox. When a user is created, the ACL on the user's <code class="docutils literal notranslate"><span class="pre">INBOX</span></code> starts off with a single entry granting all rights to the user. When a non-user mailbox is created and does not have a parent, its ACL is initialized to the value of the <code class="docutils literal notranslate"><span class="pre">defaultacl</span></code> option in <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a>.</p>
309 </section>
310 <section id="other-implicit-rights">
311 <h4>Other Implicit Rights<a class="headerlink" href="#other-implicit-rights" title="Link to this heading"></a></h4>
312 <p>Note that some rights are available implicitly, for example 'anonymous'
313 always has 'p' on user INBOXes, and users always have <code class="docutils literal notranslate"><span class="pre">la</span></code> rights on
314 mailboxes within their INBOX hierarchy.</p>
315 </section>
316 </section>
317 <section id="access-control-identifier-aci">
318 <h3>Access Control Identifier (ACI)<a class="headerlink" href="#access-control-identifier-aci" title="Link to this heading"></a></h3>
319 <p>The Access Control Identifier (ACI) part of an ACL entry specifies the
320 user or group for which the entry applies. Group identifiers are
321 distinguished by the prefix &quot;group:&quot;. For example, &quot;group:accounting&quot;.</p>
322 <p>There are two special identifiers, &quot;anonymous&quot;, and &quot;anyone&quot;. The meaning of
323 other identifiers usually depends on the
324 <a class="reference internal" href="../reference/admin/access-control/identifiers.html#imap-admin-access-control-authorization-mechanisms"><span class="std std-ref">authorization mechanism</span></a>
325 being used.</p>
326 <section id="anonymous-and-anyone">
327 <h4><code class="docutils literal notranslate"><span class="pre">anonymous</span></code> and <code class="docutils literal notranslate"><span class="pre">anyone</span></code><a class="headerlink" href="#anonymous-and-anyone" title="Link to this heading"></a></h4>
328 <p>With any authorization mechanism, two special identifiers are defined.
329 The identifier <code class="docutils literal notranslate"><span class="pre">anonymous</span></code> refers to the anonymous, or unauthenticated
330 user. The identifier <code class="docutils literal notranslate"><span class="pre">anyone</span></code> refers to all users, including the
331 anonymous user.</p>
332 <p>Both <code class="docutils literal notranslate"><span class="pre">anonymous</span></code> and <code class="docutils literal notranslate"><span class="pre">anyone</span></code> may commonly be used with the <strong>post</strong>
333 right <code class="docutils literal notranslate"><span class="pre">p</span></code> to allow message insertion to mailboxes.</p>
334 </section>
335 </section>
336 <section id="negative-rights">
337 <h3>Negative Rights<a class="headerlink" href="#negative-rights" title="Link to this heading"></a></h3>
338 <p>Any of the above defined identifiers may be prefixed with a <code class="docutils literal notranslate"><span class="pre">-</span></code>
339 character. The associated rights are then removed from that identifier.
340 These are referred to as <em>negative rights</em>.</p>
341 </section>
342 <section id="calculating-a-users-rights">
343 <h3>Calculating a Users' Rights<a class="headerlink" href="#calculating-a-users-rights" title="Link to this heading"></a></h3>
344 <p>To calculate the set of rights granted to a user, the server first
345 calculates the union of all of the rights granted to the user and to
346 all groups the user is a member of. The server then calculates and
347 removes the union of all the negative rights granted to the user and to
348 all groups the user is a member of.</p>
349 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">anyone</span> <span class="n">lrsp</span>
350 <span class="n">fred</span> <span class="n">lwi</span>
351 <span class="o">-</span><span class="n">anonymous</span> <span class="n">s</span>
352 </pre></div>
353 </div>
354 <p>The user <code class="docutils literal notranslate"><span class="pre">fred</span></code> will be granted the rights <code class="docutils literal notranslate"><span class="pre">lrswip</span></code> and the
355 anonymous user will be granted the rights <code class="docutils literal notranslate"><span class="pre">lrp</span></code>.</p>
356 </section>
357 </section>
358 <section id="login-authentication">
359 <span id="imap-concepts-login-authentication"></span><h2>Login Authentication<a class="headerlink" href="#login-authentication" title="Link to this heading"></a></h2>
360 <p>This section discusses different types of authentication (ways of logging in) that can be used with Cyrus IMAP.</p>
361 <p>The Cyrus IMAP server uses the Cyrus SASL library for authentication. This section describes how to configure SASL with use with Cyrus imapd. Please consult the <a class="reference external" href="https://www.cyrusimap.org/sasl/index.html#sasl-index" title="(in Cyrus SASL v2.1.28)"><span class="xref std std-ref">Cyrus SASL System Administrator's Guide</span></a> for more detailed, up-to-date information.</p>
362 <section id="anonymous-login">
363 <h3>Anonymous Login<a class="headerlink" href="#anonymous-login" title="Link to this heading"></a></h3>
364 <p>Regardless of the SASL mechanism used by an individual connection, the
365 server may support anonymous login. If the <code class="docutils literal notranslate"><span class="pre">allowanonymouslogin</span></code>
366 option in <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a> is turned on, then the server will
367 permit plaintext password logins using the user <code class="docutils literal notranslate"><span class="pre">anonymous</span></code> and any
368 password.</p>
369 <p>Additionally, the server will enable any SASL mechanisms that allow anonymous logins.</p>
370 </section>
371 <section id="plaintext-authentication">
372 <h3>Plaintext Authentication<a class="headerlink" href="#plaintext-authentication" title="Link to this heading"></a></h3>
373 <p>The SASL library has several ways of verifying plaintext passwords. Plaintext passwords are passed either by the IMAP <code class="docutils literal notranslate"><span class="pre">LOGIN</span></code> command or by the SASL <code class="docutils literal notranslate"><span class="pre">PLAIN</span></code> mechanism (under a TLS layer).</p>
374 <ul class="simple">
375 <li><p>PAM</p></li>
376 <li><p>GSSAPI: Plaintext passwords are verified by obtaining a ticket for the server's Kerberos identity, to protect against Kerberos server spoofing attacks.</p></li>
377 <li><p><code class="docutils literal notranslate"><span class="pre">/etc/passwd</span></code></p></li>
378 <li><p><code class="docutils literal notranslate"><span class="pre">/etc/shadow</span></code>: <code class="docutils literal notranslate"><span class="pre">sasl_auto_transition</span></code> automatically creates secrets for shared secret authentication when given a password.</p></li>
379 </ul>
380 <p>The method of plaintext password verification is always through the SASL library, even in the case of the internal LOGIN command. This is to allow the SASL library to be the only source of authentication information. You'll want to look at the <code class="docutils literal notranslate"><span class="pre">sasl_pwcheck_method</span></code> option in the SASL documentation to understand how to configure a plaintext password verifier for your system.</p>
381 <p>To disallow the use of plaintext passwords for authentication, you can set <code class="docutils literal notranslate"><span class="pre">allowplaintext:</span> <span class="pre">no</span></code> in imapd.conf. This will still allow PLAIN under TLS, but IMAP LOGIN commands will now fail.</p>
382 </section>
383 <section id="kerberos-logins">
384 <h3>Kerberos Logins<a class="headerlink" href="#kerberos-logins" title="Link to this heading"></a></h3>
385 <p>The Kerberos SASL mechanism supports the <code class="docutils literal notranslate"><span class="pre">GSSAPI</span></code> authentication mechanism. The mechanism requires that a <code class="docutils literal notranslate"><span class="pre">keytab</span></code> file exist in the location given in the <code class="docutils literal notranslate"><span class="pre">sasl_keytab</span></code> configuration option. The <code class="docutils literal notranslate"><span class="pre">keytab</span></code> file must be readable by the Cyrus server and must contain a <code class="docutils literal notranslate"><span class="pre">$service/$host&#64;$realm</span></code> service key. <code class="docutils literal notranslate"><span class="pre">$host</span></code> is the first component of the server's host name, the FQDN or IP address (whatever the client uses). <code class="docutils literal notranslate"><span class="pre">$realm</span></code> is the server's Kerberos realm. <code class="docutils literal notranslate"><span class="pre">$service</span></code> is name of the service: <code class="docutils literal notranslate"><span class="pre">imap</span></code>, <code class="docutils literal notranslate"><span class="pre">HTTP</span></code>, <code class="docutils literal notranslate"><span class="pre">sieve</span></code>.</p>
386 <p>The server will permit logins by identities in the local realm and identities in the realms listed in the <code class="docutils literal notranslate"><span class="pre">loginrealms</span></code> option in <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a>.</p>
387 <p>If the <code class="docutils literal notranslate"><span class="pre">loginuseacl</span></code> configuration option is turned on, than any Kerberos identity that is granted the <code class="docutils literal notranslate"><span class="pre">a</span></code> right on the user's <code class="docutils literal notranslate"><span class="pre">INBOX</span></code> is permitted to log in as that user.</p>
388 </section>
389 <section id="shared-secrets-logins">
390 <h3>Shared Secrets Logins<a class="headerlink" href="#shared-secrets-logins" title="Link to this heading"></a></h3>
391 <p>The SCRAM mechanisms require the user and the server to share a secret (generally a password) that can be used for comparison without actually passing the password in the clear across the network. For these mechanisms, you will need to supply a source of passwords, such as the sasldb (which is described more fully in the <a class="reference external" href="https://www.cyrusimap.org/sasl/index.html#sasl-index" title="(in Cyrus SASL v2.1.28)"><span class="xref std std-ref">Cyrus SASL distribution</span></a>).</p>
392 </section>
393 </section>
394 <section id="quotas">
395 <h2>Quotas<a class="headerlink" href="#quotas" title="Link to this heading"></a></h2>
396 <p>Quotas allow server administrators to limit resources used by hierarchies of mailboxes on the server.</p>
397 <section id="working-with-quotas">
398 <h3>Working with Quotas<a class="headerlink" href="#working-with-quotas" title="Link to this heading"></a></h3>
399 <p>Quotas are manipulated via these subcommands within the
400 <a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#std-cyrusman-cyradm-8">cyradm(8)</a> program:</p>
401 <blockquote>
402 <div><ul class="simple">
403 <li><p><a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#imap-reference-manpages-systemcommands-cyradm-setquota"><span class="std std-ref">setquota</span></a></p></li>
404 <li><p><a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#imap-reference-manpages-systemcommands-cyradm-listquota"><span class="std std-ref">listquota</span></a></p></li>
405 <li><p><a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#imap-reference-manpages-systemcommands-cyradm-listquotaroot"><span class="std std-ref">listquotaroot</span></a></p></li>
406 </ul>
407 </div></blockquote>
408 </section>
409 <section id="monitor-and-repair">
410 <h3>Monitor and Repair<a class="headerlink" href="#monitor-and-repair" title="Link to this heading"></a></h3>
411 <p>Quotas may be monitored and repaired via the <a class="reference internal" href="../reference/manpages/systemcommands/quota.html#std-cyrusman-quota-8">quota(8)</a>
412 command:</p>
413 <blockquote>
414 <div><ul class="simple">
415 <li><p><a class="reference internal" href="../reference/manpages/systemcommands/quota.html#imap-reference-manpages-systemcommands-quota"><span class="std std-ref">quota</span></a></p></li>
416 </ul>
417 </div></blockquote>
418 </section>
419 <section id="supported-quota-types">
420 <h3>Supported Quota Types<a class="headerlink" href="#supported-quota-types" title="Link to this heading"></a></h3>
421 <p>The Cyrus IMAP server supports quotas on Storage (KB), Messages (#),
422 Folders (#) and Annotation Storage (KB). These types each have their
423 own identifier:</p>
424 <blockquote>
425 <div><ul class="simple">
426 <li><p>STORAGE</p></li>
427 <li><p>MESSAGE</p></li>
428 <li><p>X-NUM-FOLDERS</p></li>
429 <li><p>X-ANNOTATION-STORAGE</p></li>
430 </ul>
431 </div></blockquote>
432 <section id="storage-quotas">
433 <h4>Storage Quotas<a class="headerlink" href="#storage-quotas" title="Link to this heading"></a></h4>
434 <p>Storage quotas are defined as the number of kilobytes (KB) of the
435 relevant <span class="target" id="index-0"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc822.html"><strong>RFC 822</strong></a> messages located within a quota root. Each copy of
436 a message is counted independently, even when the server can conserve
437 disk space use by making hard links to message files. The additional
438 disk space overhead used by mailbox index and cache files is not
439 charged against a quota. On servers with <code class="docutils literal notranslate"><span class="pre">delete_mode:</span> <span class="pre">delayed</span></code>
440 and/or <code class="docutils literal notranslate"><span class="pre">expunge_mode:delayed</span></code> space used by deleted mailboxes or
441 expunged messages are not charged against quota.</p>
442 </section>
443 <section id="numeric-quotas">
444 <h4>Numeric Quotas<a class="headerlink" href="#numeric-quotas" title="Link to this heading"></a></h4>
445 <p>Numeric Quotas are quite simply a limit on the number of a particular
446 class of object. Cyrus IMAP currently supports quotas on the number of
447 messages and/or folders below a given quota root.</p>
448 </section>
449 </section>
450 <section id="quota-roots">
451 <h3>Quota Roots<a class="headerlink" href="#quota-roots" title="Link to this heading"></a></h3>
452 <p>Quotas are applied to quota roots, which can be at any level of the mailbox hierarchy. Quota roots need not also be mailboxes.</p>
453 <p>Quotas on a quota root apply to the sum of the usage of any mailbox at that level and any sub-mailboxes of that level that are not underneath a quota root on a sub-hierarchy. This means that each mailbox is limited by at most one quota root.</p>
454 <p>For example, if the mailboxes</p>
455 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">user</span><span class="o">/</span><span class="n">bovik</span>
456 <span class="n">user</span><span class="o">/</span><span class="n">bovik</span><span class="o">/</span><span class="nb">list</span><span class="o">/</span><span class="n">imap</span>
457 <span class="n">user</span><span class="o">/</span><span class="n">bovik</span><span class="o">/</span><span class="nb">list</span><span class="o">/</span><span class="n">info</span><span class="o">-</span><span class="n">cyrus</span>
458 <span class="n">user</span><span class="o">/</span><span class="n">bovik</span><span class="o">/</span><span class="n">saved</span>
459 <span class="n">user</span><span class="o">/</span><span class="n">bovik</span><span class="o">/</span><span class="n">todo</span>
460 </pre></div>
461 </div>
462 <p>exist and the quota roots</p>
463 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">user</span><span class="o">/</span><span class="n">bovik</span>
464 <span class="n">user</span><span class="o">/</span><span class="n">bovik</span><span class="o">/</span><span class="nb">list</span>
465 <span class="n">user</span><span class="o">/</span><span class="n">bovik</span><span class="o">/</span><span class="n">saved</span>
466 </pre></div>
467 </div>
468 <p>exist, then the quota root <code class="docutils literal notranslate"><span class="pre">user/bovik</span></code> applies to the mailboxes <code class="docutils literal notranslate"><span class="pre">user/bovik</span></code> and <code class="docutils literal notranslate"><span class="pre">user/bovik/todo</span></code>; the quota root <code class="docutils literal notranslate"><span class="pre">user/bovik/list</span></code> applies to the mailboxes <code class="docutils literal notranslate"><span class="pre">user/bovik/list/imap</span></code> and <code class="docutils literal notranslate"><span class="pre">user/bovik/list/info-cyrus</span></code>; and the quota root <code class="docutils literal notranslate"><span class="pre">user/bovik/saved</span></code> applies to the mailbox <code class="docutils literal notranslate"><span class="pre">user/bovik/saved</span></code>.</p>
469 <p>Quota roots are created automatically when they are mentioned in the
470 <a class="reference internal" href="../reference/manpages/systemcommands/cyradm.html#imap-reference-manpages-systemcommands-cyradm-setquota"><span class="std std-ref">setquota</span></a> command. Quota
471 roots may not be deleted through the protocol, see Removing Quota Roots
472 for instructions on how to delete them.</p>
473 </section>
474 <section id="controlling-quota-behavior">
475 <h3>Controlling Quota Behavior<a class="headerlink" href="#controlling-quota-behavior" title="Link to this heading"></a></h3>
476 <p>How restrictive quotas will be may be tailored to the needs of different
477 sites, via the use of several settings in <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a>.</p>
478 <p>Please consult the <a class="reference internal" href="../reference/admin/quotas.html#imap-admin-quotas-config"><span class="std std-ref">Controlling Quota Behavior</span></a> section of the Cyrus
479 IMAP Administrator Guide for complete details.</p>
480 </section>
481 <section id="mail-delivery-behavior">
482 <h3>Mail Delivery Behavior<a class="headerlink" href="#mail-delivery-behavior" title="Link to this heading"></a></h3>
483 <section id="mailboxes-near-quota">
484 <h4>Mailboxes Near Quota<a class="headerlink" href="#mailboxes-near-quota" title="Link to this heading"></a></h4>
485 <p>Normally, in order for a message to be <em>appended</em> into a mailbox, the
486 quota root for the mailbox must have enough unused storage that
487 appending the message will not cause the quota to go over limit.</p>
488 <p>Mail delivery (posting) is a special case. In order for a message to be
489 delivered to a mailbox, the quota root for the mailbox merely need not
490 already be over the limit <em>in the default configuration</em>.</p>
491 <p>As long as usage is not over the limit, new messages may be delivered
492 regardless of size, unless <code class="docutils literal notranslate"><span class="pre">lmtp_strict_quota:</span> <span class="pre">on</span></code> is set in
493 <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a>. In that case, delivery of messages will be
494 rejected would such delivery exceed quota.</p>
495 <p>If a delivery puts the mailbox's usage over the quota, the server will
496 issue an alert notifying the user that usage is close to or over the
497 limit, permitting them to correct it. If delivery were not permitted in
498 this case, the user would have no practical way of knowing that there
499 was mail that could not be delivered.</p>
500 <div class="admonition note">
501 <p class="admonition-title">Note</p>
502 <p>While the Cyrus IMAP server may from time to time issue alerts,
503 there is great variability in how IMAP clients handle these.
504 Further, such alerts are only visible to users <em>while they are
505 connected</em>.</p>
506 <p>Therefore, many sites find it preferable to install cron jobs which
507 use the <a class="reference internal" href="../reference/manpages/systemcommands/quota.html#std-cyrusman-quota-8">quota(8)</a> command to produce periodic reports of
508 users at or near quota, so administrators may nag them or so that
509 warnings may be issued to users via some other mechanism.</p>
510 </div>
511 </section>
512 <section id="mailboxes-over-quota">
513 <h4>Mailboxes Over Quota<a class="headerlink" href="#mailboxes-over-quota" title="Link to this heading"></a></h4>
514 <p>If the usage is over the limit, mail delivery will fail with a temporary
515 error (LMTP error 452), unless <code class="docutils literal notranslate"><span class="pre">lmtp_over_quota_perm_failure:</span> <span class="pre">on</span></code>
516 is set in <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a> in which case a permanent error
517 (LMTP error 552) will be returned.</p>
518 <p>A temporary error will <em>typically</em> cause the delivery system to requeue
519 the message and re-attempt delivery for a few days (permitting the user
520 time to notice and correct the problem) before returning the mail to
521 the sender.</p>
522 <div class="admonition note">
523 <p class="admonition-title">Note</p>
524 <p>Such requeuing behaviour is controlled by the MTA (i.e. Sendmail,
525 EXIM or Postfix) and as such is outside the purview of this
526 document.</p>
527 </div>
528 </section>
529 </section>
530 <section id="quota-warnings-upon-select-when-user-has-d-rights">
531 <h3>Quota Warnings Upon Select When User Has <code class="docutils literal notranslate"><span class="pre">d</span></code> Rights<a class="headerlink" href="#quota-warnings-upon-select-when-user-has-d-rights" title="Link to this heading"></a></h3>
532 <p>When a user selects a mailbox whose quota root has usage that is close to or
533 over the limit and the user has <code class="docutils literal notranslate"><span class="pre">d</span></code> rights on the mailbox, the server will
534 issue an alert notifying the user that usage is close to or over the limit.
535 The threshold of usage at which the server will issue quota warnings is set
536 by the <code class="docutils literal notranslate"><span class="pre">quotawarnpercent</span></code> configuration option.</p>
537 <p>The server only issues warnings when the user has <code class="docutils literal notranslate"><span class="pre">d</span></code> rights because only
538 users with <code class="docutils literal notranslate"><span class="pre">d</span></code> rights are capable of correcting the problem.</p>
539 </section>
540 <section id="quotas-and-partitions">
541 <h3>Quotas and Partitions<a class="headerlink" href="#quotas-and-partitions" title="Link to this heading"></a></h3>
542 <p>Quota roots are independent of partitions. A single quota root can apply to mailboxes in different partitions.</p>
543 </section>
544 </section>
545 <section id="new-mail-notification">
546 <h2>New Mail Notification<a class="headerlink" href="#new-mail-notification" title="Link to this heading"></a></h2>
547 <p>The Cyrus IMAP server comes with a notification daemon which supports
548 multiple mechanisms for notifying users of new mail. Notifications can
549 be configured to be sent upon normal delivery (<code class="docutils literal notranslate"><span class="pre">MAIL</span></code> class) and/or
550 sent as requested by a Sieve script (<code class="docutils literal notranslate"><span class="pre">SIEVE</span></code> class).</p>
551 <p>By default, both types of notifications are disabled. Notifications are
552 enabled by using one or both of the following configuration options:</p>
553 <ul class="simple">
554 <li><p>the <code class="docutils literal notranslate"><span class="pre">mailnotifier</span></code> option selects the <a class="reference internal" href="../reference/manpages/systemcommands/notifyd.html#std-cyrusman-notifyd-8">notifyd(8)</a> method
555 to use for <code class="docutils literal notranslate"><span class="pre">MAIL</span></code> class notifications</p></li>
556 <li><p>the <code class="docutils literal notranslate"><span class="pre">sievenotifier</span></code> option selects the <a class="reference internal" href="../reference/manpages/systemcommands/notifyd.html#std-cyrusman-notifyd-8">notifyd(8)</a>
557 method to use for <code class="docutils literal notranslate"><span class="pre">SIEVE</span></code> class notifications (when no method is
558 specified by the Sieve action)</p></li>
559 </ul>
560 </section>
561 <section id="partitions">
562 <h2>Partitions<a class="headerlink" href="#partitions" title="Link to this heading"></a></h2>
563 <p>Partitions allow administrators to store different mailboxes in different parts of the Unix filesystem. This is intended to be used to allow hierarchies of mailboxes to be spread across multiple disks.</p>
564 <section id="specifying-partitions-with-create">
565 <h3>Specifying Partitions with &quot;create&quot;<a class="headerlink" href="#specifying-partitions-with-create" title="Link to this heading"></a></h3>
566 <p>When an administrator creates a new mailbox, the name of the partition for the mailbox may be specified using an optional second argument to the &quot;create&quot; command. Non-administrators are not permitted to specify the partition of a mailbox. If the partition is not specified, then the mailbox inherits the partition of its most immediate parent mailbox. If the mailbox has no parent, it gets the partition specified in the &quot;defaultpartition&quot; configuration option.</p>
567 <p>The optional second argument to the &quot;create&quot; command can usually be given only when using a specialized Cyrus-aware administrative client such as <code class="docutils literal notranslate"><span class="pre">cyradm</span></code>.</p>
568 </section>
569 <section id="changing-partitions-with-rename">
570 <h3>Changing Partitions with &quot;rename&quot;<a class="headerlink" href="#changing-partitions-with-rename" title="Link to this heading"></a></h3>
571 <p>An administrator may change the partition of a mailbox by using the
572 rename command with an optional third argument. When a third argument
573 to rename is given, the first and second arguments can be the
574 same; this changes the partition of a mailbox without changing its
575 name. If a third argument to rename is not given and the first
576 argument is not <code class="docutils literal notranslate"><span class="pre">INBOX</span></code>, the partition of a mailbox does not change.
577 If a third argument to rename is not given and the first argument is
578 <code class="docutils literal notranslate"><span class="pre">INBOX</span></code>, the newly created mailbox gets the same partition it would
579 get from the <code class="docutils literal notranslate"><span class="pre">create</span></code> command.</p>
580 </section>
581 </section>
582 <section id="news">
583 <h2>News<a class="headerlink" href="#news" title="Link to this heading"></a></h2>
584 <p>Cyrus has the ability to export Usenet via IMAP and/or export shared
585 IMAP mailboxes via an NNTP server which is included with Cyrus.</p>
586 </section>
587 <section id="pop3-server">
588 <h2>POP3 Server<a class="headerlink" href="#pop3-server" title="Link to this heading"></a></h2>
589 <p>The Cyrus IMAP server software comes with a compatibility POP3 server.
590 Due to limitations in the POP3 protocol, the server can only access a
591 user's <code class="docutils literal notranslate"><span class="pre">INBOX</span></code> and only one instance of a POP3 server may exist for any
592 one user at any time. While a POP3 server has a user's <code class="docutils literal notranslate"><span class="pre">INBOX</span></code> open,
593 expunge operations from any concurrent IMAP session will fail.</p>
594 <p>When Kerberos login authentication is being used, the POP3 server
595 uses the server identity
596 <code class="docutils literal notranslate"><span class="pre">pop.host&#64;realm</span></code> instead of
597 <code class="docutils literal notranslate"><span class="pre">imap.host&#64;realm</span></code>, where
598 <code class="docutils literal notranslate"><span class="pre">host</span></code> is the first component of the server's host
599 name and <code class="docutils literal notranslate"><span class="pre">realm</span></code> is the server's Kerberos realm.</p>
600 </section>
601 <section id="the-syslog-facility">
602 <h2>The syslog facility<a class="headerlink" href="#the-syslog-facility" title="Link to this heading"></a></h2>
603 <p>The Cyrus IMAP server software sends log messages to the <code class="docutils literal notranslate"><span class="pre">local6</span></code>
604 syslog facility. The severity levels used are:</p>
605 <ul class="simple">
606 <li><p><strong>CRIT</strong> - Critical errors which probably require prompt administrator action</p></li>
607 <li><p><strong>ERR</strong> - I/O errors, including failure to update quota usage. The syslog message includes the specific file and Unix error.</p></li>
608 <li><p><strong>WARNING</strong> - Protection mechanism failures, client inactivity timeouts</p></li>
609 <li><p><strong>NOTICE</strong> - Authentications, both successful and unsuccessful</p></li>
610 <li><p><strong>INFO</strong> - Mailbox openings, duplicate delivery suppression</p></li>
611 </ul>
612 </section>
613 <section id="mail-directory-recovery">
614 <h2>Mail Directory Recovery<a class="headerlink" href="#mail-directory-recovery" title="Link to this heading"></a></h2>
615 <p>This section describes the various databases used by the Cyrus IMAP
616 server software and what can be done to recover from various
617 inconsistencies in these databases.</p>
618 <section id="reconstructing-mailbox-directories">
619 <h3>Reconstructing Mailbox Directories<a class="headerlink" href="#reconstructing-mailbox-directories" title="Link to this heading"></a></h3>
620 <p>The largest database is the mailbox directories. Each
621 mailbox directory contains the following files:</p>
622 <dl>
623 <dt>message files</dt><dd><p>There is one file per message, containing the message in <span class="target" id="index-1"></span><a class="rfc reference external" href="https://datatracker.ietf.org/doc/html/rfc822.html"><strong>RFC 822</strong></a> format. Lines in the message are separated by CRLF, not just LF. The file name of each message is the message's UID followed by a dot (.).</p>
624 <p>In netnews newsgroups, the message files instead follow the format and naming conventions imposed by the netnews software.</p>
625 </dd>
626 <dt><code class="docutils literal notranslate"><span class="pre">cyrus.header</span></code></dt><dd><p>This file contains a magic number and variable-length information about the mailbox itself.</p>
627 </dd>
628 <dt><code class="docutils literal notranslate"><span class="pre">cyrus.index</span></code></dt><dd><p>This file contains fixed-length information about the mailbox itself and each message in the mailbox.</p>
629 </dd>
630 <dt><code class="docutils literal notranslate"><span class="pre">cyrus.cache</span></code></dt><dd><p>This file contains variable-length information about each message in the mailbox.</p>
631 </dd>
632 <dt><code class="docutils literal notranslate"><span class="pre">cyrus.seen</span></code></dt><dd><p>This file contains variable-length state information about each reader of the mailbox who has <code class="docutils literal notranslate"><span class="pre">s</span></code> permissions.</p>
633 </dd>
634 </dl>
635 <p>The <code class="docutils literal notranslate"><span class="pre">reconstruct</span></code> program can be used to recover from
636 corruption in mailbox directories. If <code class="docutils literal notranslate"><span class="pre">reconstruct</span></code> can find
637 existing header and index files, it attempts to preserve any data in
638 them that is not derivable from the message files themselves. The
639 state <code class="docutils literal notranslate"><span class="pre">reconstruct</span></code> attempts to preserve includes the flag
640 names, flag state, and internal date. <code class="docutils literal notranslate"><span class="pre">Reconstruct</span></code>
641 derives all other information from the message files.</p>
642 <p>An administrator may recover from a damaged disk by restoring message
643 files from a backup and then running reconstruct to regenerate what it
644 can of the other files.</p>
645 <p>The <code class="docutils literal notranslate"><span class="pre">reconstruct</span></code> program does not adjust the quota usage
646 recorded in any quota root files. After running reconstruct, it is
647 advisable to run <code class="docutils literal notranslate"><span class="pre">quota</span> <span class="pre">-f</span></code> (described below) in order to fix
648 the quota root files.</p>
649 </section>
650 <section id="reconstructing-the-mailboxes-file">
651 <h3>Reconstructing the Mailboxes File<a class="headerlink" href="#reconstructing-the-mailboxes-file" title="Link to this heading"></a></h3>
652 <div class="admonition note">
653 <p class="admonition-title">Note</p>
654 <p>CURRENTLY UNAVAILABLE</p>
655 </div>
656 <p>The mailboxes file in the configuration directory is the most critical
657 file in the entire Cyrus IMAP system. It contains a sorted list of
658 each mailbox on the server, along with the mailboxes quota root and
659 ACL.</p>
660 <p>To reconstruct a corrupted mailboxes file, run the <code class="docutils literal notranslate"><span class="pre">reconstruct</span>
661 <span class="pre">-m</span></code> command. The <code class="docutils literal notranslate"><span class="pre">reconstruct</span></code> program, when invoked
662 with the <code class="docutils literal notranslate"><span class="pre">-m</span></code> switch, scavenges and corrects whatever data it
663 can find in the existing mailboxes file. It then scans all partitions
664 listed in the imapd.conf file for additional mailbox directories to
665 put in the mailboxes file.</p>
666 <p>The <code class="docutils literal notranslate"><span class="pre">cyrus.header</span></code> file in each mailbox directory stores a
667 redundant copy of the mailbox ACL, to be used as a backup when
668 rebuilding the mailboxes file.</p>
669 </section>
670 <section id="reconstructing-quota-roots">
671 <h3>Reconstructing Quota Roots<a class="headerlink" href="#reconstructing-quota-roots" title="Link to this heading"></a></h3>
672 <div class="admonition note">
673 <p class="admonition-title">Note</p>
674 <p>The following instructions are valid where <code class="docutils literal notranslate"><span class="pre">quota_db:</span> <span class="pre">quotalegacy</span></code>
675 is set in <a class="reference internal" href="../reference/manpages/configs/imapd.conf.html#std-cyrusman-imapd.conf-5">imapd.conf(5)</a>. If your site uses a different
676 quota DB type, then these steps do not apply.</p>
677 </div>
678 <p>The subdirectory <code class="docutils literal notranslate"><span class="pre">quota</span></code> of the configuration directory (specified in
679 the <code class="docutils literal notranslate"><span class="pre">configdirectory</span></code> configuration option) contains one file per
680 quota root, with the file name being the name of the quota root. These
681 files store the quota usage and limits of each of the quota roots.</p>
682 <p>The <code class="docutils literal notranslate"><span class="pre">quota</span></code> program, when invoked with the <code class="docutils literal notranslate"><span class="pre">-f</span></code>
683 switch, recalculates the quota root of each mailbox and the quota
684 usage of each quota root.</p>
685 </section>
686 <section id="removing-quota-roots">
687 <h3>Removing Quota Roots<a class="headerlink" href="#removing-quota-roots" title="Link to this heading"></a></h3>
688 <p>To remove a quota root, remove the quota root's file. Then run
689 <code class="docutils literal notranslate"><span class="pre">quota</span> <span class="pre">-f</span></code> to make the quota files consistent again.</p>
690 </section>
691 <section id="subscriptions">
692 <h3>Subscriptions<a class="headerlink" href="#subscriptions" title="Link to this heading"></a></h3>
693 <p>The subdirectory <code class="docutils literal notranslate"><span class="pre">user</span></code> of the configuration directory contains user
694 subscriptions. There is one file per user, with a filename of the
695 userid followed by <code class="docutils literal notranslate"><span class="pre">.sub</span></code>. Each file contains a sorted list of
696 subscribed mailboxes.</p>
697 <p>There is no program to recover from damaged subscription files. A
698 site may recover from lost subscription files by restoring from backups.</p>
699 </section>
700 </section>
701 <section id="configuration-directory">
702 <h2>Configuration Directory<a class="headerlink" href="#configuration-directory" title="Link to this heading"></a></h2>
703 <p>Many objects in the configuration directory are discussed in
704 the Database Recovery section. This section documents two
705 other directories that reside in the configuration directory.</p>
706 <section id="log-directory">
707 <h3>Log Directory<a class="headerlink" href="#log-directory" title="Link to this heading"></a></h3>
708 <p>The subdirectory <code class="docutils literal notranslate"><span class="pre">log</span></code> under the configuration directory permits
709 administrators to keep protocol telemetry logs on a per-user basis.</p>
710 <p>If a subdirectory of <code class="docutils literal notranslate"><span class="pre">log</span></code> exists with the same name as a user, the
711 IMAP and POP3 servers will keep a telemetry log of protocol sessions
712 authenticating as that user. The telemetry log is stored in the
713 subdirectory with a filename of the server process-id and starts with
714 the first command following authentication.</p>
715 </section>
716 <section id="proc-directory">
717 <h3>Proc Directory<a class="headerlink" href="#proc-directory" title="Link to this heading"></a></h3>
718 <p>The subdirectory <code class="docutils literal notranslate"><span class="pre">proc</span></code> under the configuration directory
719 contains one file per active server process. The file name is the ASCII
720 representation of the process id and the file contains the following
721 tab-separated fields:</p>
722 <ul class="simple">
723 <li><p>hostname of the client</p></li>
724 <li><p>login name of the user, if logged in</p></li>
725 <li><p>selected mailbox, if a mailbox is selected</p></li>
726 </ul>
727 <p>The file may contain arbitrary characters after the first newline
728 character.</p>
729 <p>The <code class="docutils literal notranslate"><span class="pre">proc</span></code> subdirectory is normally be cleaned out on
730 server reboot.</p>
731 </section>
732 </section>
733 <section id="message-delivery">
734 <h2>Message Delivery<a class="headerlink" href="#message-delivery" title="Link to this heading"></a></h2>
735 <p>Mail transport agents such as Sendmail, Postfix, or Exim communicate
736 with the Cyrus server via LMTP (the Local Mail Transport Protocol)
737 implemented by the LMTP daemon. This can be done either directly by the
738 MTA (prefered, for performance reasons) or via the <code class="docutils literal notranslate"><span class="pre">deliver</span></code> LMTP
739 client.</p>
740 <section id="local-mail-transfer-protocol-lmtp">
741 <h3>Local Mail Transfer Protocol (lmtp)<a class="headerlink" href="#local-mail-transfer-protocol-lmtp" title="Link to this heading"></a></h3>
742 <p>LMTP, the Local Mail Transfer Protocol, is a variant of SMTP design for
743 transferring mail to the final message store. LMTP allows MTAs to deliver
744 &quot;local&quot; mail over a network. This is an easy optimization so that the
745 IMAP server doesn't need to maintain a queue of messages or run an
746 MTA.</p>
747 <p>The Cyrus server implements LMTP via the <code class="docutils literal notranslate"><span class="pre">lmtpd</span></code> daemon. LMTP
748 can either be used over a network via TCP or local via a UNIX domain
749 socket. There are security differences between these two alternatives; read
750 more below.</p>
751 <p>For final delivery via LMTP over a TCP socket, it is necessary to use
752 LMTP AUTH. This is accomplished using SASL to authenticate the delivering
753 user. If your mail server is performing delivery via LMTP AUTH (that is,
754 using a SASL mechanism), you will want their authentication id to be an
755 LMTP admins (either via the <code class="docutils literal notranslate"><span class="pre">admins</span></code> imapd.conf option or via the
756 <code class="docutils literal notranslate"><span class="pre">&lt;service&gt;_admins</span></code> option, typically <code class="docutils literal notranslate"><span class="pre">lmtp_admins</span></code>).</p>
757 <p>Alternatively you may deliver via LMTP to a unix domain socket, and the
758 connection will be preauthenticated as an administrative user (and access
759 control is accomplished by controlling access to the socket).</p>
760 <p>Note that if a user has a sieve script, the sieve script runs authorized
761 as <em>that</em> user, and the rights of the posting user are ignored for the purposes
762 of determining the outcome of the sieve script.</p>
763 </section>
764 <section id="single-instance-store">
765 <h3>Single Instance Store<a class="headerlink" href="#single-instance-store" title="Link to this heading"></a></h3>
766 <p>If a delivery attempt mentions several recipients (only possible if
767 the MTA is speaking LMTP to <code class="docutils literal notranslate"><span class="pre">lmtpd</span></code>), the server attempts to
768 store as few copies of a message as possible. It will store one copy
769 of the message per partition, and create hard links for all other
770 recipients of the message.</p>
771 <p>Single instance store can be turned off by using the
772 &quot;singleinstancestore&quot; flag in the configuration file.</p>
773 </section>
774 <section id="duplicate-delivery-suppression">
775 <h3>Duplicate Delivery Suppression<a class="headerlink" href="#duplicate-delivery-suppression" title="Link to this heading"></a></h3>
776 <p>A message is considered a duplicate if two copies of a message with
777 the same message-id and the same envelope recipient are received.
778 Cyrus uses the duplicate delivery database to hold this information,
779 and it looks approximately 3 days back in the default install.</p>
780 <p>Duplicate delivery suppression can be turned off by using the
781 &quot;duplicatesuppression&quot; flag in the configuration file.</p>
782 </section>
783 </section>
784 <section id="sieve-a-mail-filtering-language">
785 <h2>Sieve, a Mail Filtering Language<a class="headerlink" href="#sieve-a-mail-filtering-language" title="Link to this heading"></a></h2>
786 <p>Sieve is a mail filtering language that can filter mail into an appropriate
787 IMAP mailbox as it is delivered via lmtp.</p>
788 </section>
789 <section id="cyrus-murder-the-imap-aggregator">
790 <h2>Cyrus Murder, the IMAP Aggregator<a class="headerlink" href="#cyrus-murder-the-imap-aggregator" title="Link to this heading"></a></h2>
791 <p>Cyrus now supports the distribution of mailboxes across a number of IMAP
792 servers to allow for horizontal scalability.</p>
793 </section>
794 </section>
795
796
797 </div>
798 </div>
799 <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
800 <a href="features/server-aggregation.html" class="btn btn-neutral float-left" title="Cyrus IMAP Murder (Server Aggregation)" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
801 <a href="../../setup.html" class="btn btn-neutral float-right" title="Setup" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
802 </div>
803
804 <hr/>
805
806 <div role="contentinfo">
807 <p>&#169; Copyright 1993–2026, The Cyrus Team.</p>
808 </div>
809
810 Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
811 <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
812 provided by <a href="https://readthedocs.org">Read the Docs</a>.
813
814
815 </footer>
816 </div>
817 </div>
818 </section>
819 </div>
820 <script>
821 jQuery(function () {
822 SphinxRtdTheme.Navigation.enable(true);
823 });
824 </script>
825
826
827
828
829 </body>
830 </html>