blob: 3197720a32b7f817f0d0fb62bf74b828aba723d9 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Mailboxes :: Apache James</title>
<meta name="generator" content="Antora 2.3.4">
<link rel="stylesheet" href="../../../../_/css/site.css">
</head>
<body class="article">
<header class="header">
<nav class="navbar">
<div class="navbar-brand">
<a class="navbar-item" href="https://james.apache.org"><img src="/_/img/james.svg" alt="james logo"> Apache James</a>
<button class="navbar-burger" data-target="topbar-nav">
<span></span>
<span></span>
<span></span>
</button>
</div>
<div id="topbar-nav" class="navbar-menu">
<div class="navbar-end">
<a class="navbar-item" href="#">Home</a>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Products</a>
<div class="navbar-dropdown">
<div class="navbar-item"><strong>James server</strong></div>
<a class="navbar-item" href="https://github.com/apache/james-project">Repository</a>
<a class="navbar-item" href="https://issues.apache.org/jira/projects/JAMES/issues">Issue Tracker</a>
<hr class="navbar-divider">
<a class="navbar-item" href="https://james.apache.org/mime4j/index.html">Mime4J</a>
<a class="navbar-item" href="https://james.apache.org/jsieve/index.html">jSieve</a>
<a class="navbar-item" href="https://james.apache.org/jspf/index.html">jSPF</a>
<a class="navbar-item" href="https://james.apache.org/jdkim/index.html">jDKIM</a>
<a class="navbar-item" href="https://james.apache.org/hupa/index.html">HUPA</a>
</div>
</div>
<div class="navbar-item has-dropdown is-hoverable">
<a class="navbar-link" href="#">Community</a>
<div class="navbar-dropdown">
<!-- Not ideal but dropping the version in the href requires tweaking james-projet docs module first -->
<a class="navbar-item" href="/james-project/3.6.0/community/mailing-lists.html">Mailing lists</a>
<a class="navbar-item" href="https://gitter.im/apache/james-project"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" class="logo-gitter-sign" data-v-44ebcb1a=""><rect x="15" y="5" width="2" height="10"></rect> <rect x="10" y="5" width="2" height="20"></rect> <rect x="5" y="5" width="2" height="20"></rect> <rect width="2" height="15"></rect></svg> Gitter</a>
<a class="navbar-item" href="https://twitter.com/ApacheJames">
<span class="icon">
<svg aria-hidden="true" data-icon="twitter" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path fill="#57aaee" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path>
</svg>
</span> Twitter
</a>
<a class="navbar-item" href="#"> <svg class="octicon octicon-mark-github v-align-middle" viewBox="0 0 16 16" version="1.1" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg> Github</a>
</div>
</div>
<!-- <div class="navbar-item">
<span class="control">
<a class="button is-primary" href="#">Download</a>
</span>
</div> -->
</div>
</div>
</nav>
</header>
<div class="body">
<div class="nav-container" data-component="james-project" data-version="3.8.1">
<aside class="nav">
<div class="panels">
<div class="nav-panel-menu is-active" data-panel="menu">
<nav class="nav-menu">
<button class="nav-menu-toggle" aria-label="Toggle expand/collapse all" style="display: none"></button>
<h3 class="title"><a href="../../index.html">Apache James Server</a></h3>
<ul class="nav-list">
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../index.html">Concepts</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../user/index.html">User Model</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../mail/index.html">Emails</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../messages/index.html">Messages</a>
<ul class="nav-list">
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../messages/imf.html">IMF</a>
</li>
<li class="nav-item" data-depth="4">
<a class="nav-link" href="../messages/mime.html">MIME</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../protocols/index.html">Protocols</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../protocols/smtp.html">SMTP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../protocols/pop.html">POP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../protocols/imap.html">IMAP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../protocols/jmap.html">JMAP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../protocols/esmtp.html">ESMTP</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../protocols/lmtp.html">LMTP</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="index.html">Storage</a>
<ul class="nav-list">
<li class="nav-item is-current-page" data-depth="3">
<a class="nav-link" href="mailbox.html">Mailboxes</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="users.html">Users</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../processing/index.html">Processing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../configuration.html">Configuration</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../glossary.html">Glossary</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../servers/index.html">Servers</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../servers/demo.html">Demo</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../servers/5-minute-demo.html">Short Demo</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../servers/15-minute-demo.html">Long Demo</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../servers/basic/index.html">Basic</a>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../servers/basic/context.html">Context</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../servers/basic/objectives.html">Objectives</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../servers/basic/concepts.html">Concepts</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../servers/basic/architecture.html">Architecture</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../servers/basic/conf/index.html">Configuration</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="../../servers/basic/help.html">Help</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../servers/extendable.html">Extendable</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../servers/test.html">Test</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<a class="nav-link" href="../../customization/index.html">Customization</a>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../development/index.html">Developer Guide</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../development/logging.html">Logging in Apache James</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="nav-item" data-depth="0">
<ul class="nav-list">
<li class="nav-item" data-depth="1">
<button class="nav-item-toggle"></button>
<a class="nav-link" href="../../community/index.html">Community</a>
<ul class="nav-list">
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/mailing-lists.html">Mailing lists</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/contributing.html">Contributing</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/guidelines.html">Guidelines</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/download.html">Download releases</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/website.html">Building and publishing the website</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/release.html">Creating an official Apache James release</a>
</li>
<li class="nav-item" data-depth="2">
<a class="nav-link" href="../../community/support.html">Professional support</a>
</li>
<li class="nav-item" data-depth="2">
<button class="nav-item-toggle"></button>
<span class="nav-text">Apache Software Foundation</span>
<ul class="nav-list">
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/">ASF</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/foundation/getinvolved.html">Get involved</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/foundation/faq.html">FAQ</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/licenses/">Licenses</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/security/">Security</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/foundation/sponsorship.html">Sponsorship</a>
</li>
<li class="nav-item" data-depth="3">
<a class="nav-link" href="https://www.apache.org/foundation/thanks.html">Thanks</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="nav-panel-explore" data-panel="explore">
<div class="context">
<span class="title">Apache James Server</span>
<span class="version">3.8.1 SNAPSHOT</span>
</div>
<ul class="components">
<li class="component is-current">
<div class="title"><a href="../../index.html">Apache James Server</a></div>
<ul class="versions">
<li class="version is-current is-latest">
<a href="../../index.html">3.8.1 SNAPSHOT</a>
</li>
</ul>
</li>
<li class="component">
<div class="title"><a href="../../../../james-site/latest/index.html">Apache James Site</a></div>
<ul class="versions">
<li class="version is-latest">
<a href="../../../../james-site/latest/index.html">latest</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</aside>
</div>
<main class="article">
<div class="toolbar" role="navigation">
<button class="nav-toggle"></button>
<a href="../../../../james-site/latest/homepage.html" class="home-link"></a>
<nav class="breadcrumbs" aria-label="breadcrumbs">
<ul>
<li><a href="../../index.html">Apache James Server</a></li>
<li><a href="../index.html">Concepts</a></li>
<li><a href="index.html">Storage</a></li>
<li><a href="mailbox.html">Mailboxes</a></li>
</ul>
</nav>
<div class="edit-this-page"><a href="https://github.com/apache/james-project/blob/master/docs/modules/concepts/pages/storage/mailbox.adoc">Edit this Page</a></div>
</div>
<div class="content">
<aside class="toc sidebar" data-title="Contents" data-levels="2">
<div class="toc-menu"></div>
</aside>
<article class="doc">
<h1 class="page">Mailboxes</h1>
<div class="sect1">
<h2 id="_overview"><a class="anchor" href="#_overview"></a>Overview</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To (over)use the analogy once again of a postal system, we think of a mailbox
as a place where a letter is placed to await pickup by its recipient. Although
current methods have evolved considerably, the original idea used for the development
of email was exactly that. The concept <a href="#_rfc196">has been around officially</a> since
at least 1971. The image of a mailbox is so prevalent that, although current
systems have evolved to do so much more than just hold messages for processing,
the industry continues to apply the concept.</p>
</div>
<div class="paragraph">
<p>The more general term is "Email Storage". It is necessary to store email for
many reasons:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>As a mailbox system &mdash; part of a queue to await processing</p>
</li>
<li>
<p>As a persistence mechanism &mdash; a place where you can go back and predictably
locate a message that you may want to refer to again in the future</p>
</li>
<li>
<p>As an archive &mdash; a place where you may want to store "deleted" emails so that
you can potentially retrieve them if you wish to change your mind later</p>
</li>
<li>
<p>As a temporary step in a process &mdash; perhaps you have a "todo" folder where
you temporarily store an email that you intend to process soon</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>There are numerous ways to store emails, just as there are numerous reasons for
storing them:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A <a href="#_specifications">standardized</a> "mailbox" format</p>
</li>
<li>
<p>A relational database</p>
</li>
<li>
<p>A custom file-based mechanism</p>
</li>
<li>
<p>Etc.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>This section briefly describes how email storage is a core concept in an
email system.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_specifications"><a class="anchor" href="#_specifications"></a>Specifications</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="_electronic_mail_box"><a class="anchor" href="#_electronic_mail_box"></a>Electronic Mail Box</h3>
<div class="sect3">
<h4 id="_rfc196"><a class="anchor" href="#_rfc196"></a>RFC196</h4>
<div class="paragraph">
<p>The concept of an "electronic mail box" was
<a href="https://tools.ietf.org/html/rfc196">initially specified</a> way back in 1971.
It is amusing to read the retro concepts in the initial description of this
document:</p>
</div>
<div class="literalblock">
<div class="content">
<pre>The purpose of this protocol is to provide at each site a
standard mechanism to receive sequential files for immediate or
deferred printing or other uses. The files for deferred printing
would probably be stored on intermediate disk files [...].
It is also assumed that there would be a program at the sending
site [...]. This program could probably be accessed as a subcommand
of the Telnet program.</pre>
</div>
</div>
<div class="paragraph">
<p>This specification was obsoleted by <a href="#_rfc221">RFC221</a>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_rfc221"><a class="anchor" href="#_rfc221"></a>RFC221</h4>
<div class="paragraph">
<p><a href="https://tools.ietf.org/html/rfc221">RFC221</a> ("A Mail Box Protocol, Version-2") was
published in 1971. It added the possibility of using FTP in addition to the
"Data Transfer Protocol" used in <a href="#_rfc196">RFC196</a>. This version was obsoleted by
<a href="#_rfc278">RFC278</a>.</p>
</div>
</div>
<div class="sect3">
<h4 id="_rfc278"><a class="anchor" href="#_rfc278"></a>RFC278</h4>
<div class="paragraph">
<p><a href="https://tools.ietf.org/html/rfc278">RFC278</a> ("Revision of the Mail Box Protocol")
was published in 1971. It provided a number of updates to <a href="#_rfc221">RFC221</a>.</p>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_maildir"><a class="anchor" href="#_maildir"></a>Maildir</h3>
<div class="paragraph">
<p><a href="https://en.wikipedia.org/wiki/Maildir">Maildir</a> is a file-based storage format invented
by <a href="https://en.wikipedia.org/wiki/Daniel_J._Bernstein">Dan Bernstein</a>.
A major design objective was apparently to delegate file locking to the operating system.</p>
</div>
</div>
<div class="sect2">
<h3 id="_mbox"><a class="anchor" href="#_mbox"></a>Mbox</h3>
<div class="paragraph">
<p>The <a href="https://en.wikipedia.org/wiki/Mbox">mbox</a> email storage format was formally defined
by <a href="https://tools.ietf.org/html/rfc4155">RFC4155</a>. It is a formalization of a <em>de facto</em>
format used by UNIX-like operating systems.</p>
</div>
</div>
<div class="sect2">
<h3 id="_mix"><a class="anchor" href="#_mix"></a>MIX</h3>
<div class="paragraph">
<p>The <a href="https://en.wikipedia.org/wiki/MIX_(email)">MIX</a> email storage format was developed by
<a href="https://en.wikipedia.org/wiki/Mark_Crispin">Mark Crispin</a>, the original author of the
<a href="../protocols/imap.html" class="page">IMAP specification</a>. Its
<a href="https://www.mail-archive.com/imap-uw@u.washington.edu/msg00540.html">design goals</a> were:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>greater robustness against corruption caused by hardware or
software failures. Many failures are "self-healing".</p>
</li>
<li>
<p>far fewer risky random-access I/O operations; a single false
pointer calculation in other formats will corrupt the mailbox.</p>
</li>
<li>
<p>greater ease to repair damaged mailboxes.</p>
</li>
<li>
<p>(much) greater performance.</p>
</li>
<li>
<p>extensibility for new IMAP capabilities such as annotations,
conditional store, or more aggressing caching.</p>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="_rfc5322"><a class="anchor" href="#_rfc5322"></a>RFC5322</h3>
<div class="paragraph">
<p><a href="https://tools.ietf.org/html/rfc5322">RFC5322</a> weighs in on how to describe a "mailbox":</p>
</div>
<div class="literalblock">
<div class="content">
<pre>A mailbox receives mail. It is a 'conceptual entity' that does not necessarily
pertain to file storage. It further exemplifies that some sites may choose to
print mail on a printer and deliver the output to the addressee's desk, much
like a traditional fax transmission.</pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_indexing"><a class="anchor" href="#_indexing"></a>Indexing</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Once a system grows over time it will likely contain many messages
stored in its <a href="#">Mailboxes</a>.
Searching for the right email becomes increasingly difficult. At some point
it becomes useful to use an <a href="https://en.wikipedia.org/wiki/Search_engine_indexing">indexing</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_related_concepts"><a class="anchor" href="#_related_concepts"></a>Related Concepts</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Email Storage is related to&#8230;&#8203;</p>
</div>
<div class="ulist">
<ul>
<li>
<p><strong><a href="../protocols/pop.html" class="page">POP</a></strong>, as the POP protocol mandates interaction
with a user&#8217;s "mailbox"</p>
</li>
<li>
<p><strong><a href="../protocols/imap.html" class="page">IMAP</a></strong>, as the IMAP protocol is all about storing
messages on an IMAP Server</p>
</li>
<li>
<p><strong><a href="../glossary.html#email_client" class="page">Email clients</a></strong>, as the client will store mail locally, usually in the form
of a "mailbox"</p>
</li>
<li>
<p><strong><a href="../protocols/smtp.html" class="page">SMTP</a></strong> as the protocol is related to transmitting
messages from one mailbox to another</p>
</li>
</ul>
</div>
</div>
</div>
</article>
</div>
</main>
</div>
<footer class="footer">
<p>This page was built using the Antora default UI.</p>
<p>The source code for this UI is licensed under the terms of the MPL-2.0 license.</p>
</footer>
<script id="site-script" src="../../../../_/js/site.js" data-ui-root-path="../../../../_"></script>
<script async src="../../../../_/js/vendor/highlight.js"></script>
</body>
</html>