/usr/share/doc/mailutils-doc/mailutils.html/mailbox-statement.html is in mailutils-doc 1:3.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Published by the Free Software Foundation,
51 Franklin Street, Fifth Floor
Boston, MA 02110-1301, USA
Copyright (C) 1999-2004, 2008-2012, 2014-2016 Free Software
Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with no
Invariant Sections, no Front-Cover, and no Back-Cover texts.
A copy of the license is included in the section entitled "GNU Free
Documentation License". -->
<!-- Created by GNU Texinfo 6.3, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Mailutils Manual: mailbox statement</title>
<meta name="description" content="GNU Mailutils Manual: mailbox statement">
<meta name="keywords" content="GNU Mailutils Manual: mailbox statement">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Function-Index.html#Function-Index" rel="index" title="Function Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="configuration.html#configuration" rel="up" title="configuration">
<link href="locking-statement.html#locking-statement" rel="next" title="locking statement">
<link href="debug-statement.html#debug-statement" rel="prev" title="debug statement">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="mailbox-statement"></a>
<div class="header">
<p>
Next: <a href="locking-statement.html#locking-statement" accesskey="n" rel="next">locking statement</a>, Previous: <a href="debug-statement.html#debug-statement" accesskey="p" rel="prev">debug statement</a>, Up: <a href="configuration.html#configuration" accesskey="u" rel="up">configuration</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-Index.html#Function-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="The-mailbox-Statement"></a>
<h4 class="subsection">3.2.7 The <code>mailbox</code> Statement</h4>
<a name="Mailbox-Statement"></a><a name="index-mailbox"></a>
<a name="Syntax-4"></a>
<h4 class="subheading">Syntax</h4>
<div class="example">
<pre class="example">mailbox {
# <span class="roman">Use specified <var>url</var> as a mailspool.</span>
mail-spool <var>url</var>;
# <span class="roman">Create mailbox <var>url</var> using <var>pattern</var>.</span>
mailbox-pattern <var>pattern</var>;
# <span class="roman">Default mailbox type.</span>
mailbox-type <var>type</var>;
# <span class="roman">Default user mail folder.</span>
folder <var>dir</var>;
}
</pre></div>
<a name="Description-2"></a>
<h4 class="subheading">Description</h4>
<p>The <code>mailbox</code> statement configures the location, name and type of
user mailboxes.
</p>
<p>The mailbox location can be specified using <code>mail-spool</code> or
<code>mail-pattern</code> statements.
</p>
<dl>
<dt><a name="index-mail_002dspool"></a>Configuration: <strong>mail-spool</strong> <em><var>path</var></em></dt>
<dd><p>The <code>mail-spool</code> statement specifies directory that holds user
mailboxes. Once this statement is given, the <code>libmailutils</code>
library will assume that the mailbox of user <var>login</var> is kept in
file <samp><var>path</var>/<var>login</var></samp>.
</p>
<p>Historically, <var>path</var> can contain mailbox type prefix, e.g.:
‘<samp>maildir:///var/spool/mail</samp>’, but such usage is discouraged in
favor of <code>mailbox-pattern</code> statement.
</p></dd></dl>
<dl>
<dt><a name="index-mailbox_002dpattern"></a>Configuration: <strong>mailbox-pattern</strong> <em><var>url</var></em></dt>
<dd><p>The <code>mailbox-pattern</code> statement is a preferred way of configuring
mailbox locations. It supersedes <code>mail-spool</code> statement.
</p>
<p>The <var>url</var> must be a valid mailbox URL (see <a href="Mailbox.html#Mailbox">Mailbox</a>), which
may contain references to the ‘<samp>user</samp>’ variable
(see <a href="Variables.html#Variables">Variables</a>). This variable will be expanded to the actual
user name.
</p>
<a name="local-URL-parameters"></a><a name="index-directory-indexing"></a>
<p>Optional URL parameters can be used to configure <em>indexed directory
structure</em>. Such structure is a special way of storing mailboxes,
which allows for faster access in case of very large number of users.
</p>
<p>By default, all user mailboxes are stored in a single directory and
are named after user login names. To find the mailbox for a given
user, the system scans the directory for the corresponding
file. This usually implies linear search, so the time needed to
locate a mailbox is directly proportional to the ordinal number of
the mailbox in the directory.
</p>
<p>GNU Mailutils supports three types of indexed directories:
‘<samp>direct</samp>’, ‘<samp>reverse</samp>’, and ‘<samp>hashed</samp>’.
</p>
<a name="index-direct-indexing"></a>
<a name="index-indexing_002c-direct"></a>
<p>In direct indexed directory structure, <var>path</var> contains 26 subdirectories
named with lower-case letters of Latin alphabet. The location of the
user mailbox is determined using the following algorithm:
</p>
<ol>
<li> Take the first letter of the user name.
</li><li> Map it to a lower-case letter using <em>index mapping</em>
table. The result gives the name of a sub-directory where the mailbox
is located.
</li><li> Descend into this directory.
</li></ol>
<p>For example, using this algorithm, the mailbox of the user
‘<samp>smith</samp>’ is stored in file <samp><var>path</var>/s/smith</samp>.
</p>
<p>If each of single-letter subdirectories contains the
indexed directory structure, we have second level of indexing. In
this case the file name of ‘<samp>smith</samp>’’s mailbox is
<samp><var>path</var>/s/m/smith</samp>.
</p>
<a name="index-reverse-indexing"></a>
<a name="index-indexing_002c-reverse"></a>
<p>The <em>reverse</em> indexed structure uses the same principles, but the
indexing letters are taken from the <em>end</em> of the user name,
instead of from the beginning. For example, in the 2nd level reverse
indexed structure, the ‘<samp>smith</samp>’’s mailbox is located in
<samp><var>path</var>/h/t/smith</samp>.
</p>
<a name="index-hashed-indexing"></a>
<a name="index-indexing_002c-hashed"></a>
<p>Finally, the <em>hashed</em> structure consists of 256 subdirectories
under <var>path</var>, named by 2-letter hex codes from ‘<samp>00</samp>’ to
‘<samp>FF</samp>’. Mailboxes are stored in these subdirectories. The name
of the subdirectory is computed by hashing first <var>level</var> letters
of the user name. The hashing algorithm is:
</p>
<ol>
<li> Take next letter from the user name
</li><li> Add its ASCII value to the hash sum.
</li><li> Continue (1-2) until <var>level</var> letters are processed, or all
letters from the file name are used, whichever occurs first.
</li><li> Convert the computed sum modulo 256 to a hex code.
</li></ol>
<p>Indexed directory structures are configured using the following
arguments:
</p>
<dl compact="compact">
<dd><a name="index-type"></a>
</dd>
<dt>type=<var>value</var></dt>
<dd><p>Specifies the type of indexing. Valid values are ‘<samp>index</samp>’, for direct
indexed structure, ‘<samp>rev-index</samp>’ for reverse indexing, and
‘<samp>hash</samp>’ for hashed structure.
</p>
<a name="index-param"></a>
</dd>
<dt>param=<var>number</var></dt>
<dd><p>Specifies indexing level.
</p>
<a name="index-user-1"></a>
</dd>
<dt>user=<var>string</var></dt>
<dd><p>Specifies indexing key. The only meaningful value, as of Mailutils
version 3.1.1 is ‘<samp>user=${user}</samp>’.
</p></dd>
</dl>
<p>Let’s assume the traditional mail layout, in which incoming
mails are stored in a UNIX mailbox named after the recipient user name
and located in <samp>/var/mail</samp> directory.
The <code>mailbox-pattern</code> for this case is:
</p>
<div class="example">
<pre class="example"> mailbox-pattern "/var/mail/${user}";
</pre></div>
<p>It is entirely equivalent to specifying ‘<samp>mail-spool "/var/mail"</samp>’.
</p>
<p>Now, if the layout is the same, but mailboxes are kept in
‘<samp>maildir</samp>’ format, then the corresponding statement is:
</p>
<div class="example">
<pre class="example"> mailbox-pattern "maildir:///var/mail/${user}";
</pre></div>
<p>Finally, if the mailboxes are stored in a directly-indexed directory with
two levels of indexing, the URL is:
</p>
<div class="example">
<pre class="example"> mailbox-pattern "maildir:///var/mail;type=index;param=2;user=${user}";
</pre></div>
</dd></dl>
<p>If neither <code>mailbox-pattern</code> nor <code>mail-spool</code> are given, the
mailbox names are determined using the following algorithm:
</p>
<ol>
<li> If environment variable <code>FOLDER</code> is set, use its value.
</li><li> Otherwise, if environment variable <code>MAIL</code> is set, use its
value.
</li><li> If neither of these is set, construct the mailbox name by
concatenating the built-in mail spool directory name, a directory
separator, and the user name.
<p>The built-in mail spool directory name is determined at compile
time, using the ‘<samp>_PATH_MAILDIR</samp>’ define from the include file
<samp>paths.h</samp>. If this value is not defined, <samp>/var/mail</samp> or
<samp>/usr/spool/mail</samp> is used.
</p></li></ol>
<dl>
<dt><a name="index-mailbox_002dtype"></a>Configuration: <strong>mailbox-type</strong> <em><var>type</var></em></dt>
<dd><a name="index-MU_005fDEFAULT_005fSCHEME"></a>
<p>Specifies the type of mailboxes. By default, ‘<samp>mbox</samp>’ (UNIX mailbox)
is assumed. This can be changed while configuring the package by
setting <code>MU_DEFAULT_SCHEME</code> configuration variable. The default
value can be verified by running <code>mailutils info scheme</code>.
</p></dd></dl>
<dl>
<dt><a name="index-folder"></a>Configuration: <strong>folder</strong> <em><var>dir</var></em></dt>
<dd><a name="index-plus-expansion"></a>
<p>Sets user mail folder directory. Its value is used when expanding
‘<samp>plus-notation</samp>’, i.e. such mailbox names as <samp>+inbox</samp>. The
‘<samp>+</samp>’ sign is replaced by <var>dir</var>, followed by a directory
separator (‘<samp>/</samp>’).
</p>
<p>The <var>dir</var> argument can contain mailbox type prefix, e.g
‘<samp>mh://Mail</samp>’.
</p>
<p>The default folder name is ‘<samp>Mail/</samp>’.
</p></dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="locking-statement.html#locking-statement" accesskey="n" rel="next">locking statement</a>, Previous: <a href="debug-statement.html#debug-statement" accesskey="p" rel="prev">debug statement</a>, Up: <a href="configuration.html#configuration" accesskey="u" rel="up">configuration</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Function-Index.html#Function-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|