{"id":8486,"date":"2015-10-07T04:36:11","date_gmt":"2015-10-07T03:36:11","guid":{"rendered":"https:\/\/wp.okra.host\/article\/email-filesystem-layout\/"},"modified":"2021-03-07T14:25:18","modified_gmt":"2021-03-07T13:25:18","slug":"email-filesystem-layout","status":"publish","type":"ht_kb","link":"https:\/\/kb.okra.host\/de\/article\/email-filesystem-layout\/","title":{"rendered":"Email filesystem layout"},"content":{"rendered":"<h2 id=\"overview\" >\u00dcbersicht<\/h2>\n<p style=\"text-align: left\">This article covers the raw storage structure\u00a0of email on your account. All email is stored in a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Maildir\">Maildir<\/a> format, which stores email in separate files in a directory named <code>Mail<\/code> within a user&#8217;s <a href=\"https:\/\/kb.okra.host\/de\/platform\/home-directory-location\/\">home directory<\/a>.<\/p>\n<h2 id=\"sample-structure\" >Sample structure<\/h2>\n<p><em>Directories in bold:<\/em><\/p>\n<pre>.\r\n\u251c\u2500\u2500 <strong>cur<\/strong>\r\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 1440231926.M975332P7880V05000DAI00000000000001D1_0.sol.apnscp.com,S=1254:2,\r\n\u251c\u2500\u2500 dovecot-acl-list\r\n\u251c\u2500\u2500 dovecot.index\r\n\u251c\u2500\u2500 dovecot.index.cache\r\n\u251c\u2500\u2500 dovecot.index.log\r\n\u251c\u2500\u2500 dovecot-keywords\r\n\u251c\u2500\u2500 dovecot.mailbox.log\r\n\u251c\u2500\u2500 dovecot-uidlist\r\n\u251c\u2500\u2500 dovecot-uidvalidity\r\n\u251c\u2500\u2500 dovecot-uidvalidity.4cb493c8\r\n\u251c\u2500\u2500 <strong>new<\/strong>\r\n\u251c\u2500\u2500 <strong>old\r\n<\/strong>|--<strong> .Spam\r\n<\/strong>| |-- <strong>cur<\/strong>\r\n| |-- dovecot.index\r\n| |-- dovecot.index.log\r\n| |-- dovecot-keywords\r\n| |-- dovecot-uidlist\r\n| |-- <strong>new<\/strong>\r\n| `-- <strong>tmp<\/strong>\r\n\u251c\u2500\u2500 subscriptions\r\n\u2514\u2500\u2500 <strong>tmp\r\n<\/strong><\/pre>\n<h3 id=\"component-breakdown\" >Component breakdown<\/h3>\n<ul>\n<li><strong>Mail storage directories<\/strong>: <code>new<\/code>, <code>cur<\/code>, und <code>tmp<\/code><code><br \/>\ntmp<\/code> serves as a scratch directory for messages as they are written to disk. New messages are delivered to <code>new<\/code>, and once downloaded by a mail client, moved to <code>cur<\/code>.<\/li>\n<li><strong>Additional IMAP folders<\/strong>: <code>.Spam<\/code><br \/>\nAny directory, prefix with a dot\u00a0(&#8220;.&#8221;) is a separate IMAP folder. Each IMAP folder has its own set of mail storage directories (<code>new,<\/code> <code>cur<\/code>, <code>tmp<\/code>). IMAP folders may be virtually\u00a0nested by separating each level with another dot. For example, take the following mailbox layout:<\/p>\n<pre>INBOX\r\n\u00a0 |-- Billing\r\n\u00a0 | \u00a0 \u00a0 \u00a0|-- Bills\r\n\u00a0 | \u00a0 \u00a0 \u00a0| \u00a0 \u00a0 `-- Paid\r\n\u00a0 | \u00a0 \u00a0 \u00a0`-- Orders\r\n\u00a0 `-- Personal<\/pre>\n<p>This is represented, on the server as a collection of directories in <code>Mail\/<\/code> like this:<\/p>\n<pre>.\r\n|-- .Billing\r\n|-- .Billing.Bills\r\n|-- .Billing.Bills.Paid\r\n|-- .Billing.Orders\r\n`-- .Personal<\/pre>\n<\/li>\n<li><strong>Dovecot data<\/strong>: <code>dovecot*<\/code> files:<br \/>\nThese are used internally by the IMAP\/POP3\u00a0server (<a href=\"http:\/\/www.dovecot.org\">Dovecot<\/a>) to keep track of email. Of importance are cache files, ending in <code>.cache<\/code>, which may become corrupted if you exceed your storage usage, resulting in an <a href=\"https:\/\/kb.okra.host\/de\/e-mail\/empty-mailbox\/\">empty mailbox<\/a>.<\/li>\n<li><strong>IMAP subscriptions<\/strong>: <code>subscriptions<\/code><br \/>\nSubscriptions are all folders that appear once you login to an IMAP server. When a folder is subscribed to by an IMAP client, the folder name is written on a separate line. These are not used by POP3.<\/li>\n<li><strong>Email<\/strong>: all files under <code>cur\/<\/code> oder <code>new\/<\/code><br \/>\nLastly, each file under these directories represents a single email. Each file consists of metadata embedded in its name.<\/p>\n<pre><span style=\"color: #800000\">1440231926<\/span>.<span style=\"color: #008000\">M975332P7880V05000DAI00000000000001D1_0<\/span>.<span style=\"color: #3366ff\">sol.apnscp.com<\/span>,<span style=\"color: #ff00ff\">S=1254<\/span>:2,<span style=\"color: #333333\">S<\/span>\r\n  ^- <span style=\"color: #800000\">delivery in unixtime<\/span>  ^                       ^                     |       ^\r\n                           `- <span style=\"color: #008000\">internal id<\/span>          |                     |       |\r\n                                                   `- <span style=\"color: #3366ff\">receiving hostname<\/span> |       |\r\n                                                                         `- <span style=\"color: #ff00ff\">size<\/span> |\r\n                                                                                 `- <span style=\"color: #333333\">flags<\/span><\/pre>\n<p>An email may be named anything; the filename provided above is a convention of our <a href=\"https:\/\/kb.okra.host\/de\/platform\/determining-platform-version\/\">hosting platform<\/a>. An email\u00a0may be named anything; these files will be reconciled to Dovecot&#8217;s cache and treated as email \u00a0<em>if present in <code>cur\/<\/code><\/em>. In fact, during <a href=\"https:\/\/kb.okra.host\/de\/platform\/migrating-another-server\/\">server migrations<\/a>, these email files are copied verbatim from the old server, which given the example above, will always have a completely different hostname in the filename. Still, these emails are accessible within any email client and display like any other email.<\/p>\n<p>Of interest, unixtime delivery is the date a message was delivered, so all files are presented chronologically. Flags, if specified, include specific IMAP commands, such as whether a message was relocated to trash (&#8220;T&#8221; flag), starred (&#8220;F&#8221; flag), or viewed (&#8220;S&#8221; flag). The latter two are used for our approach to <a href=\"https:\/\/kb.okra.host\/de\/e-mail\/achieving-inbox-zero\/\">Inbox Zero<\/a>, which by the bye, is used religiously for support tickets.<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"migrating-email\" >Migrating Email<\/h3>\n<p>As touched upon above in the <span style=\"text-decoration: underline\">email\u00a0component breakdown<\/span>, filenames are inconsequential and only provide a means to optimize\u00a0IMAP access. Therefore, when migrating email from a previous hosting provider, email may be named anything, provided it is located within the\u00a0<code>cur\/<\/code>\u00a0directory of the respective\u00a0IMAP folder.<\/p>\n<h2 id=\"see-also\" >Siehe auch<\/h2>\n<ul>\n<li>KB: <a href=\"https:\/\/kb.okra.host\/de\/e-mail\/pop3-vs-imap-e-mail-protocols\/\">POP3 vs IMAP\u00a0Protocols<\/a><\/li>\n<li>Dovecot wiki: <a href=\"http:\/\/wiki2.dovecot.org\/MailboxFormat\/Maildir\">Mailbox Format &gt; Maildir<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Overview This article covers the raw storage structure\u00a0of email on your account. All email is stored in a Maildir format, which stores email in separate files in a directory named Mail within a user&#8217;s home directory. Sample structure Directories in bold: . \u251c\u2500\u2500 cur \u2502\u00a0\u00a0 \u2514\u2500\u2500 1440231926.M975332P7880V05000DAI00000000000001D1_0.sol.apnscp.com,S=1254:2, \u251c\u2500\u2500 dovecot-acl-list \u251c\u2500\u2500&#8230;<\/p>","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[58],"ht-kb-tag":[],"class_list":["post-8486","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-e-mail"],"_links":{"self":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/comments?post=8486"}],"version-history":[{"count":1,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8486\/revisions"}],"predecessor-version":[{"id":8487,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8486\/revisions\/8487"}],"wp:attachment":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media?parent=8486"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8486"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}