| Internet-Draft | CESAF | November 2026 |
| Conjeevaram Balasubramanian | Expires 27 May 2027 | [Page] |
Email is kept in many incompatible forms: mbox files in several variants, Maildir directories, proprietary personal-folder files and ad hoc exports. Most of them lose or alter information, and each can be read only by some tools. This document specifies CESAF, the Canonical Email Storage and Archive Format: a file-based format in which mail from any source is kept in one store, each message exactly as it was obtained, together with the metadata a reader needs to present it (its source, folders and flags, decoded header fields, MIME structure, character sets and internationalized addresses). Any client that implements this document can read a store written by any other.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 27 May 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
A person's or an organization's mail history is rarely in one place. Older mail sits in personal-folder files written by one desktop client, other mail in the local folders of another client, more in mbox exports from a provider, and the rest on an IMAP server. Each of these forms can be opened only by some tools, and each loses something:¶
mbox [RFC4155] exists in several incompatible variants that differ in how lines beginning with "From " are escaped, and the oldest variant cannot be reversed exactly.¶
Maildir [MAILDIR] keeps one message per file but has no place for folder metadata beyond file names.¶
Personal-folder files such as [MS-PST] do not keep the message as it was received; they keep parsed properties.¶
Many tools re-encode header fields, regenerate MIME boundaries, convert character sets or line endings, or convert internationalized domain names when they store a message, which breaks signatures and destroys evidence of what was actually received.¶
This document specifies CESAF, the Canonical Email Storage and Archive Format. A CESAF store is a directory tree of ordinary files. It holds mail from any number of sources. Each message is kept as the octets obtained from its source, never modified; everything derived from it, and everything known about where it came from, is recorded beside it in a JSON record. Folders, flags and keywords are kept in small index files. A reader that implements this document can list a store's sources and folders, page through them by date and open each message; any program that can display a message in Internet Message Format [RFC5322] can open an individual message file.¶
Keep every message exactly as obtained, including malformed and internationalized messages.¶
Keep mail from many sources in one store, with each message's source and folder path.¶
Record what a reader needs to present a message without re-parsing it, and keep that record regenerable from the message.¶
Allow a store to be read and written by independent implementations, on every common file system.¶
Allow lossless export back to common formats.¶
This document does not change mail transport, the Internet Message Format or MIME. It does not define an access or synchronization protocol; JMAP [RFC8620] [RFC8621] and IMAP [RFC9051] remain the protocols for that. It does not define encryption or tamper evidence for stores; those may be specified as additions (see Section 11). It does not require any implementation to repair or normalize messages.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document uses the following terms:¶
A directory tree that conforms to this document.¶
One archive or account imported into a store, such as a personal-folder file, a client's local folders, an mbox file or an IMAP account.¶
A folder of a source, holding references to messages.¶
A file that holds one message in Internet Message Format.¶
A message object whose octets are those obtained from the source.¶
A message object generated from a source that does not hold the message's original octets.¶
A JSON document that describes one message object.¶
The part of a message record that cannot be recomputed from the message object.¶
The part of a message record that is computed from the message object and can be regenerated.¶
The date, fixed when a message is first stored, that determines where its files are placed.¶
The identifier of a message object, computed from its octets.¶
The filing month and message id of a message, which together give the location of its files.¶
An implementation that reads stores.¶
An implementation that creates or changes stores.¶
A document that extends this format, identified in a store's manifest.¶
Times in JSON documents are date-time values of [RFC3339] in UTC. JSON documents in this specification are I-JSON [RFC7493] texts [RFC8259]. Their structure is given in CDDL [RFC8610]. ABNF follows [RFC5234].¶
A store separates what never changes from what does:¶
Message objects and their provenance never change once written.¶
Mailboxes, flags and keywords change as the user works with the mail.¶
Analysis may be regenerated by a newer implementation at any time.¶
<store>/
cesaf.json store manifest
sources/<source-id>.json one per source
mailboxes/<mailbox-id>/
folder.json name, parent, source, special use
members-<yyyy>.json members filed in year <yyyy>
messages/<yyyy>/<mm>/<fan>/
<id>.eml message object
<id>.json message record
<id>.source/ optional source material
index/ids-<fan>.txt message id index
A writer importing a message obtains its octets from the source (or reconstructs them; see Section 5.2), computes its message id, checks the id index, determines its filing date, writes the message object and its record, and adds a member entry to the mailbox it came from.¶
The root of a store MUST contain a file named "cesaf.json". Its presence identifies the directory as a CESAF store.¶
store-manifest = {
"cesaf": 1, ; version of this document
"store-id": tstr, ; a UUID {{RFC9562}}, lowercase
"created": tstr, ; date-time, UTC
"algorithms": [+ tstr], ; message id algorithms in use
? "additions": [* addition],
? "policy": { ? "invalid-input": input-policy },
* tstr => any ; extension members
}
addition = { "id": tstr, "critical": bool, * tstr => any }
input-policy = "keep" / "quarantine" / "reject"
A reader MUST ignore members it does not recognize. The value of "policy.invalid-input" defaults to "keep".¶
The message id of a message object is the string "sha256-" followed by the SHA-256 digest of the object's octets, encoded in lowercase base32 without padding ([RFC4648], Section 6, using the lowercase alphabet). A message id is therefore 59 characters long and contains only the characters a-z, 2-7 and "-". Lowercase letters are used so that ids remain distinct on file systems that ignore case.¶
Further algorithms MAY be registered (see Section 15). A store lists the algorithms in use in its manifest; a writer MUST NOT store objects under an algorithm the manifest does not list.¶
Many file systems limit, or slow down badly with, the number of entries in one directory; FAT32, still common on removable media, allows about 65,000. Message files are therefore spread first by filing month and then by the first two characters of the digest part of the message id (the "fan"):¶
messages/<yyyy>/<mm>/<fan>/<id>.eml messages/<yyyy>/<mm>/<fan>/<id>.json¶
where "yyyy" and "mm" are the year and month of the filing date (Section 4.4). Each month holds at most 1,024 fan directories.¶
A message object MUST be stored in a file named after its message id with the extension ".eml", so that any viewer of Internet Message Format can open it. Its record MUST be stored beside it with the extension ".json".¶
The filing date of a message is determined once, when the message is first written to the store, and MUST NOT change afterwards. A writer MUST take it from the first of the following that is present and valid:¶
"received": the date-time of the topmost "Received" header field of the message object, that is, the time the last receiving system accepted the message;¶
"delivery": the delivery time the source records for the message (for example the IMAP INTERNALDATE, the delivery time stored in a personal-folder file, the date on an mbox separator line, or the modification time of a Maildir file);¶
"date": the "Date" header field of the message object;¶
"import": the time of import.¶
A date-time is valid for this purpose if it can be parsed and is not more than one day later than the time of import. The filing date is expressed in UTC. The writer MUST record the filing date and the rule that produced it in the message's provenance (Section 6.1).¶
Rules 1 and 3 depend only on the message's octets, so independent writers importing the same message usually choose the same filing date.¶
A message is referenced from mailboxes by its message key, which is its filing month and message id, for example:¶
2015-03/sha256-mzxw6ytboi...¶
A reader derives the paths of a message's files from its key alone.¶
Because rules 2 and 4 of Section 4.4 depend on the source, the same message could be filed under different months by different imports. To keep one copy of each message, a store has an id index:¶
index/ids-<fan>.txt¶
Each line of an index file holds a message id, one space and the message key, terminated by LF. Before writing a message object, a writer MUST look up its id in the index; if the id is present, the writer MUST NOT write a second copy and MUST reference the existing key instead. The index can be rebuilt by scanning "messages/"; a reader MUST NOT treat the index as authoritative where it disagrees with the files present.¶
Every file and directory name in a store is generated by the writer from ids, UUIDs, digits and fixed names; no name is ever taken from message content or from a folder name. Names MUST consist only of the characters a-z, 0-9, "-", "." and "_", and MUST NOT be longer than 80 characters. These rules keep a store usable on every common file system and allow the store directory to be used unchanged as the payload of a BagIt bag [RFC8493].¶
A reader MUST ignore files and directories it does not recognize.¶
An original message object holds the octets of the message as obtained from its source. For a message obtained from a file, these are the file's octets after removing any container framing (see Section 9); for a message obtained over IMAP, they are the octets of BODY[]; for a message delivered by a local delivery agent, they are the octets as handed over, including any trace header fields added on delivery.¶
A writer MUST NOT modify the octets of a message object. In particular, it MUST NOT re-fold or re-encode header fields, regenerate MIME boundaries, convert character sets, transfer encodings or line endings, or convert domain names between U-labels and A-labels. Messages that are malformed are stored as they are, unless the store's policy says otherwise (Section 4.1).¶
These rules preserve the evidence of what was received and keep signatures over the message, such as DKIM signatures, verifiable.¶
Some sources do not hold the octets of the messages they contain. Personal-folder files [MS-PST], for example, hold message properties, bodies and attachments separately. A writer importing from such a source MUST store a reconstructed message object: a message in Internet Message Format generated from the source's data, so that every reader can present it.¶
A writer generating a reconstructed message:¶
SHOULD use the original header fields when the source has kept them (for personal-folder files, the transport message headers property);¶
MUST generate MIME boundaries as described in Section 8.1;¶
MUST use CRLF line endings;¶
MUST mark the record's "kind" as "reconstructed" and record the method and the implementation that performed it (Section 6.1).¶
A writer SHOULD also keep the source's own data for the message in the "<id>.source/" directory beside the message object, so that the reconstruction can be repeated or improved. The content of that directory is source-specific and is described for each source format in Section 9.¶
A reconstructed message object is never byte-identical to the message as originally received, because those octets no longer exist. Readers SHOULD indicate to users that a message is reconstructed.¶
Each message object has a record, a JSON document stored beside it. A record has two parts: provenance, which cannot be recomputed and MUST NOT change once written, and analysis, which is computed from the message object and MAY be replaced by a writer that recomputes it.¶
message-record = {
"id": tstr, ; message id
"kind": "original" / "reconstructed",
"size": uint, ; octets in the message object
"provenance": provenance,
? "analysis": analysis,
}
provenance = {
"filed": tstr, ; filing date, date-time in UTC
"filed-by": filing-rule,
"obtained": [+ obtained], ; one entry per import that found it
? "reconstruction": { "method": tstr, "tool": tstr },
? "verification": [* verification],
}
filing-rule = "received" / "delivery" / "date" / "import"
obtained = {
"source": tstr, ; source id
"at": tstr, ; time of import
"tool": tstr, ; implementation name and version
"location": { * tstr => any }, ; per source format
}
verification = {
"method": tstr, ; for example "dkim"
"result": tstr,
"at": tstr,
? "key-record": tstr, ; the DNS record used, as text
}
analysis = {
"analyser": tstr,
"unicode": tstr, ; Unicode version used
"framing": framing,
"headers": [* header],
? "addresses": [* address],
? "mime": mime-part,
? "findings": [* tstr],
}
framing = {
"eol": eol-discipline,
"eight-bit": bool,
"nul": bool,
"longest-line": uint,
}
eol-discipline = "crlf" / "lf" / "cr" / "mixed"
header = {
"name": tstr,
"range": [uint, uint], ; first octet and length
? "decoded": tstr, ; RFC 2047 and RFC 2231 decoded, NFC
? "error": tstr,
}
address = {
"field": tstr,
"original": tstr,
? "display-name": tstr,
"local-part": tstr,
"domain-u-label": tstr,
"domain-a-label": tstr,
"smtputf8": bool,
? "confusable": bool,
}
mime-part = {
"path": tstr, ; "1", "1.2", ...
"range": [uint, uint],
"type": tstr,
? "parameters": { * tstr => tstr },
? "boundary": { "declared": tstr, "found": bool },
? "transfer-encoding": tstr,
? "charset": { ? "declared": tstr, ? "observed": tstr },
? "parts": [* mime-part],
? "findings": [* tstr],
}
"filed" and "filed-by" record the filing date and the rule of Section 4.4 that produced it. "obtained" lists every import in which the message was found; a writer that finds an existing message during a later import MUST append an entry rather than replace one. The "location" member identifies the message in its source; its members for each source format are given in Section 9.¶
A writer that verifies signatures in a message MAY record the result in "verification". Because the keys used to verify DKIM signatures change over time, a writer that records a DKIM result SHOULD also record the DNS key record it used.¶
Analysis records facts computed from the message object: its line-ending discipline, the position and decoded value of each header field, the internationalized forms of each address, and the MIME structure with the declared and observed character set of each part. The rules for computing these values are given in Section 8. Byte ranges are offsets into the message object.¶
A writer MAY recompute and replace analysis at any time, and MUST then update "analyser" and "unicode". A reader MUST NOT rely on analysis being present, and MUST be able to present a message from the message object alone.¶
An addition that hashes or signs a record is expected to apply the JSON Canonicalization Scheme [RFC8785] first, so that independent implementations hash the same octets.¶
Each source has a file "sources/<source-id>.json", where the source id is a lowercase UUID [RFC9562].¶
source = {
"id": tstr,
"format": tstr, ; from the source format registry
"name": tstr, ; for display, chosen by the user
? "location": tstr, ; for example the original file name
"imported": [+ { "at": tstr, "tool": tstr, "count": uint }],
}
Each mailbox is a directory "mailboxes/<mailbox-id>/", where the mailbox id is a lowercase UUID. Its "folder.json" describes it:¶
folder = {
"id": tstr,
"name": tstr, ; UTF-8, NFC
? "name-raw": tstr, ; as found, if different
? "parent": tstr, ; mailbox id
"source": tstr, ; source id
? "special-use": tstr, ; special-use attribute
}
The "special-use" member holds a special-use attribute of [RFC6154], such as "\Sent" or "\Trash", when the source identifies the folder as one. Folder names never appear in paths (Section 4.7), so a name can contain any character.¶
The members of a mailbox are listed in one file per filing year, "members-<yyyy>.json", so that large mailboxes stay manageable and can be browsed by date.¶
members = {
"year": uint,
"members": [* member], ; sorted by filing date
}
member = {
"key": tstr, ; message key
? "flags": [* tstr], ; IMAP system flags
? "keywords": [* tstr],
"added": tstr,
}
Flag names are those of IMAP [RFC9051]. Keywords hold tags and labels. The same message MAY be a member of several mailboxes, with different flags in each; this is how labels from sources that allow a message in several folders are represented.¶
A member with the "\Deleted" flag remains in the store. Readers SHOULD hide such members by default, as mail clients do. A writer MAY purge them; a purge removes the member entries and, when no mailbox refers to a message any longer, MAY remove its files and its id index line.¶
A writer that changes a members file MUST write the new content to a temporary file in the same directory and then rename it over the old file, so that a reader never sees a partial file.¶
Internet mail was designed for 7-bit ASCII. Non-ASCII text, domain names and addresses are carried by several mechanisms, and real messages often use them incorrectly. An archive format must keep what was received while still letting readers present it. This section gives the rules; Section 8.6 summarizes them.¶
The boundary parameter of a multipart body is defined in [RFC2046]:¶
boundary = 0*69bchars bcharsnospace
bchars = bcharsnospace / " "
bcharsnospace = DIGIT / ALPHA / "'" / "(" / ")" /
"+" / "_" / "," / "-" / "." /
"/" / ":" / "=" / "?"
A delimiter line is "--" followed by the boundary; the closing delimiter adds a further "--". The CRLF that precedes a delimiter belongs to the delimiter, so a body part can end without a line break. Receivers tolerate trailing white space after a delimiter.¶
Real messages contain boundaries that also occur inside a part, the same boundary reused at two nesting levels, missing closing delimiters, incorrectly quoted parameters, and delimiter lines with LF instead of CRLF. A writer MUST store such messages unchanged. Its analysis SHOULD record, for each multipart, the boundary as declared, whether it was found, and any of these defects as findings.¶
A writer that generates a message (a reconstructed message, or an export that must rewrite one) MUST generate each boundary from at least 128 bits of randomness, MUST use a different boundary at each nesting level, and MUST apply the rule that the preceding CRLF belongs to the delimiter.¶
Domain names in addresses may appear as A-labels (the ASCII form beginning "xn--" [RFC3492]) or as U-labels (Unicode) [RFC5890].¶
A writer MUST NOT convert domain names between the two forms in a message object. For each address, analysis records both forms: "domain-a-label" and "domain-u-label", computed according to IDNA2008 [RFC5891]. A domain that is not valid under IDNA2008 is recorded as found, with a finding. The mapping of [UTS46] MAY be applied when looking up or displaying a name entered by a user, but MUST NOT be used to compute the values stored in analysis.¶
With the SMTPUTF8 extension [RFC6531] and internationalized header fields [RFC6532], the local part and the domain of an address may be UTF-8 [RFC6530]. For each address, analysis records the original form exactly as it appears in the header field, the decoded display name, the local part, both domain forms, and whether the address requires SMTPUTF8 ("smtputf8"). An address whose local part contains non-ASCII characters requires it; one whose only non-ASCII characters are in the domain does not, because the domain can be expressed as A-labels.¶
Different characters can look identical. A writer SHOULD mark an address as "confusable" when its display name or its U-label domain mixes scripts or contains characters identified as confusable by [UTS39].¶
The address form recorded in analysis is identified by one of:¶
address-form = "original" / "u-label" / "a-label"
A body part declares its character set in the "charset" parameter and may use a transfer encoding [RFC2045]; header fields may contain encoded words [RFC2047] [RFC2231] or, with [RFC6532], raw UTF-8.¶
For each text part, analysis records the declared character set and, where it differs, the observed one. A writer MUST NOT infer the character set of a body from its header fields. Common defects to record as findings include: a declared character set that does not match the octets (UTF-8 octets declared as ISO-8859-1 or windows-1252); text encoded twice; a missing or wrong charset parameter; raw 8-bit header fields without SMTPUTF8; overlong UTF-8 sequences and unpaired surrogates; 8-bit data without a transfer encoding; and lines folded inside a multi-octet character.¶
UTF-16 and UTF-32 are rare in mail and need a byte order mark or an explicit label, and in practice base64. A writer MUST store such parts unchanged and SHOULD record a finding; readers MAY offer conversion to UTF-8 for display.¶
Decoded values in analysis (header values, display names, folder names) are UTF-8 in Normalization Form C [UAX15]. Folder names obtained from sources in other encodings, such as the modified UTF-7 of IMAP mailbox names or a legacy code page, are converted to UTF-8 NFC for the "name" member of "folder.json", and the original is kept in "name-raw".¶
Invalid sequences are kept in the message object. A writer MUST NOT reject or quarantine a message for invalid encoding unless the store's policy requires it (Section 4.1).¶
Messages in Internet Message Format use CRLF, but files written by many tools use LF, and some mix the two. A writer MUST keep line endings as obtained and MUST record the discipline observed:¶
eol-discipline = "crlf" / "lf" / "cr" / "mixed"
Line endings are converted only when a message is exported to a destination that requires CRLF (for example, submission over SMTP); such an export produces a copy and never changes the stored object.¶
| Issue | Storage rule | Analysis |
|---|---|---|
| MIME boundaries | Keep exactly as obtained | Record the declared boundary and defects; generate new boundaries only for new messages, from 128 bits of randomness |
| IDNA (Punycode) domains | Keep the form used | Record both U-label and A-label (IDNA2008) |
| SMTPUTF8 addresses | Keep the form used | Record whether SMTPUTF8 is required; mark confusables |
| UTF-8 bodies and header fields | Keep the octets | Record declared and observed character sets; decode to NFC |
| UTF-16 / UTF-32 | Keep the octets | Record a finding; convert only for display |
| Line endings | Keep the octets | Record the discipline; convert only in exports that require CRLF |
The filing rule and the message key (Section 4.4, Section 4.5) have the following syntax:¶
filing-rule = "received" / "delivery" / "date" / "import" message-key = filing-month "/" message-id filing-month = 4DIGIT "-" 2DIGIT message-id = "sha256-" 52b32char b32char = %x61-7A / %x32-37
An import creates a source (Section 7.1), creates a mailbox for each of the source's folders, and stores each message as described in Section 5. This section gives the rules for each source format and the members of "location" (Section 6.1) that identify a message in it. Source format names are registered in Section 15.¶
A file holding one message in Internet Message Format ("eml") is stored as an original with the file's octets. Location: "file", the file's name.¶
An mbox file [RFC4155] holds messages separated by lines beginning with "From ". Four variants are common:¶
mboxo: lines in a message beginning with "From " are escaped as ">From "; existing ">From " lines are not escaped further, so the escaping cannot be undone with certainty.¶
mboxrd: every line matching ">*From " gains one ">", so the escaping can be undone exactly.¶
mboxcl and mboxcl2: a Content-Length header field gives the length of each message; mboxcl escapes as mboxo does, mboxcl2 does not escape.¶
A writer MUST remove the separator line and MUST record it in location ("separator"). It MUST undo the escaping only when the variant is known and the escaping is reversible (mboxrd, and mboxcl2, which has none). Otherwise it MUST store the message with the escaping in place and record "quoting": "retained", so that no message is changed on a guess. Location: "file", "offset" (of the separator line), "variant", "separator", and "quoting" when retained.¶
The local folders of Thunderbird and related clients store each folder as an mbox file, with subfolders in a directory named after the folder with the suffix ".sbd". Index files with the suffix ".msf" are caches and MUST be ignored: everything needed is in the mbox files.¶
These clients add header fields to stored messages: "X-Mozilla-Status" and "X-Mozilla-Status2" (hexadecimal flag words) and "X-Mozilla-Keys" (tags). They are part of the stored octets and MUST be kept. A writer SHOULD decode them into the member entry: the read, replied, flagged and deleted bits to "\Seen", "\Answered", "\Flagged" and "\Deleted", and the tags to keywords.¶
These clients mark deleted messages without removing them until the folder is compacted. A writer MUST import such messages with the "\Deleted" flag; it MUST NOT drop them, so that nothing in the source is lost. Location: as for mbox, plus "folder-path", the path of the folder within the profile.¶
Each Maildir [MAILDIR] message file is stored as an original. The flag letters in the file name ("S", "R", "F", "T", "D") map to "\Seen", "\Answered", "\Flagged", "\Deleted" and "\Draft". Folders follow the naming convention of the Maildir in use. Location: "file" (the name, including the info part).¶
Personal-folder files [MS-PST] hold a tree of folders whose messages are sets of properties rather than octets. A writer MUST store each message as a reconstructed message (Section 5.2):¶
When the transport message headers property is present, the writer SHOULD use those header fields, unchanged, as the header of the reconstructed message, adjusting only the MIME header fields needed for the reconstructed body.¶
Otherwise it MUST generate header fields from the sender, recipient, subject, date and message-id properties.¶
It MUST include the plain-text and HTML bodies present, as a multipart/alternative, and every attachment, each with its file name and media type. Embedded messages become message/rfc822 parts.¶
The writer SHOULD store in "<id>.source/" a file "properties.json" holding the message's properties, and the attachments as extracted, so that a later implementation can reconstruct the message again. Folder names are converted as described in Section 8.4. Location: "file", "folder-path" and "entry-id" (hexadecimal).¶
Because a reconstructed message's id is computed from its octets, a later reconstruction by a different implementation will usually produce a different id. A writer re-importing a personal-folder file SHOULD match messages by "entry-id" before creating new ones (see Appendix A).¶
A writer importing over IMAP [RFC9051] stores BODY[] as an original and the message's flags and keywords in the member entry. Location: "server", "mailbox", "uidvalidity", "uid", "internaldate" and, where available, "modseq".¶
A writer exporting a store or a mailbox MUST support export of each message object unchanged as a ".eml" file. It SHOULD support export to mbox (as mboxrd, or as the original variant with the original separator lines when exporting messages imported from mbox), to Maildir with flags in file names, and to a plain directory tree named after folder names for users without a CESAF reader. An export MUST NOT change the store.¶
This document defines two conformance classes.¶
An implementation that opens a store, lists its sources and mailboxes, pages through members by year, presents messages with their flags, and exports. A reader MUST implement Section 4, Section 5, Section 7 and Section 9.7, and MUST NOT change a store.¶
A reader that also imports messages, changes flags and keywords, and moves messages between mailboxes. A writer MUST implement every requirement of this document that applies to the source formats it supports, and MUST state which source formats those are.¶
Each requirement of this document is covered by at least one test vector (Appendix B). An implementation SHOULD publish the results of running the test vectors.¶
This document can be extended by additions: documents that define further files, members or rules. Each addition has an identifier registered with IANA (Section 15). A store that uses an addition lists it in the "additions" member of its manifest, with a "critical" flag.¶
A reader that does not implement an addition listed as critical MUST NOT write to the store, and SHOULD tell the user that some content may not be presented correctly. A reader MAY ignore an addition that is not critical. An addition MUST NOT change the meaning of the files and members defined by this document.¶
Additions under consideration include a packaging of stores as BagIt bags [RFC8493] for transfer and fixity, and storage protections such as encryption and tamper evidence. None is specified by this document.¶
Note to the RFC Editor: please remove this section before publication.¶
This section records the status of known implementations of the format defined by this document at the time of posting, as described in [RFC7942]. The description of implementations in this section is intended to assist the IETF in its decision processes in progressing drafts to RFCs. Please note that the listing of any individual implementation here does not imply endorsement by the IETF. Furthermore, no effort has been spent to verify the information presented here that was supplied by IETF contributors.¶
At the time of writing, no implementation exists. A reference implementation, a library and command-line tool that import personal-folder files, Thunderbird local folders, mbox, Maildir and single messages into a store, is being developed together with the test vectors of Appendix B.¶
Messages are created by their senders, who may be hostile. An implementation MUST treat every message object, source file and record as untrusted input: parsers of MIME structure, encoded words, character sets and personal-folder files are frequent sources of memory-safety and resource-exhaustion defects, and SHOULD be written in memory-safe languages or isolated, and tested with malformed input. Byte ranges and lengths in records MUST be checked against the size of the message object before use.¶
No file or directory name in a store is taken from message content or from folder names (Section 4.7), which prevents path traversal through crafted names. A reader MUST NOT follow symbolic links found inside a store.¶
Opening a message from a store carries the same risks as opening it in any mail client: active content, remote images and executable attachments. Readers SHOULD apply the protections they apply to mail in general.¶
This document provides neither confidentiality nor tamper evidence: a store is as protected as the file system it is on. Anyone who can write to the store can change flags, mailboxes and analysis, and can replace message objects; a change to a message object is detectable by recomputing its message id, but a coordinated change to the object, its record and the indexes is not. Users who need protection SHOULD keep stores on encrypted storage with appropriate access control until an addition (Section 11) defines more.¶
Displaying confusable addresses (Section 8.3) as if they were the addresses they imitate can mislead users; readers SHOULD use the "confusable" mark to warn them.¶
Keeping messages unchanged preserves their signatures; it also preserves any malicious content, which is a deliberate property of an archive.¶
A store holds personal data about its owner and about everyone who corresponded with them; the considerations of [RFC6973] apply to any system that hosts one. The format adds little to what the messages themselves reveal, with these exceptions:¶
File names reveal the month in which each message was filed and the digest of its content. A party who obtains a store's file listing, but not its content, learns how much mail was filed in each month and can test whether a known message is present by computing its digest.¶
Provenance records where each message came from, when it was imported and by which tool.¶
Deleting a message completely requires removing its member entries, its message object and record, its "<id>.source/" directory if present, and its id index line; a purge (Section 7.3) does this. Copies of the store, such as backups, are not affected by a purge.¶
Implementations SHOULD NOT copy message content or addresses into logs or diagnostics.¶
This document asks IANA to create a "CESAF" registry group with the following registries. All use the Specification Required policy ([RFC8126] Section 4.6).¶
Each entry has an identifier (lowercase letters, digits and "-"), a description and a reference. The registry is initially empty.¶
Each entry has a name, as it appears before the "-" in a message id, a description of how the digest is computed and encoded, and a reference. Initial entry:¶
| Name | Description | Reference |
|---|---|---|
| sha256 | SHA-256 of the message object, lowercase base32 without padding | Section 4.2 |
Each entry has a name, a description and a reference giving its import rules and "location" members. Initial entries:¶
| Name | Description | Reference |
|---|---|---|
| eml | One message per file | Section 9.1 |
| mbox | mbox in any variant | Section 9.2 |
| thunderbird | Thunderbird local folders | Section 9.3 |
| maildir | Maildir | Section 9.4 |
| pst | Personal-folder file | Section 9.5 |
| imap | IMAP account | Section 9.6 |
IANA is asked to register the media type "application/cesaf+json" for store manifests ("cesaf.json"), with the following template:¶
application¶
cesaf+json¶
N/A¶
N/A¶
binary; as for application/json¶
See Section 13.¶
N/A¶
This document¶
Email archiving and email client software.¶
N/A¶
File extension: none (the file is always named "cesaf.json")¶
The author of this document.¶
COMMON¶
None¶
See the Author's Address section of this document.¶
IETF¶
This appendix lists questions the author would like the community's view on. It will be removed before publication.¶
Q-1: Is SHA-256 alone sufficient for message ids, or should the format require a second algorithm from the start? (see Section 4.2)¶
Q-2: Which heuristics should be specified for detecting mbox variants, and how should their limits be stated? (see Section 9.2)¶
Q-3: Is membership of one message in several mailboxes sufficient to represent labels from all common sources? (see Section 7.3)¶
Q-4: Should a store as a whole have a media type or a packaged form, in addition to the manifest's media type? (see Section 15)¶
Q-5: Which related work should be cited and compared in more depth, for example EAXS, PREMIS and OCFL? (see Section 1.3)¶
Q-6: Is an Operational Considerations section needed, for example on very large stores and network file systems? (see Section 4)¶
Q-7: Copies of the same message with different octets from different sources are kept separately. Should the format record that two copies are likely the same message, and should a user be able to merge them? (see Section 4.6)¶
Q-8: Should the id of a reconstructed message be derived from its source entry rather than from its octets, so that a later reconstruction keeps the same id? (see Section 5.2)¶
Q-9: Should the format define rules for several writers using one store at the same time, such as lock files, or require a single writer? (see Section 7.3)¶
Q-10: Filing months are in UTC, so a message received late in the evening in a time zone east or west of UTC may be filed under the neighbouring month. Is this acceptable? (see Section 4.4)¶
Q-11: Should the id index be a plain text file per fan, as now, or part of the manifest, and must writers keep it current? (see Section 4.6)¶
Test vectors will be published with the reference implementation. Each is a source archive or message together with the store an implementation is expected to produce, and the requirements it covers. The planned catalogue:¶
| Id | Covers |
|---|---|
| tv-layout-01 | manifest, ids, fan-out, filing dates by each rule |
| tv-dedup-01 | the same message from two sources stored once |
| tv-mime-01 | boundary inside a part, reused boundary, missing close delimiter |
| tv-idna-01 | U-label and A-label domains, invalid IDNA2008 labels |
| tv-eai-01 | UTF-8 local parts, SMTPUTF8 detection, confusables |
| tv-charset-01 | mislabelled charsets, double encoding, UTF-16 bodies |
| tv-eol-01 | LF-only, CR-only and mixed line endings |
| tv-mbox-01 | each mbox variant, including mboxo retained quoting |
| tv-thunderbird-01 | folder tree, status headers, deleted messages kept |
| tv-maildir-01 | flags in file names |
| tv-pst-01 | reconstruction with and without transport headers, attachments, embedded messages |
| tv-export-01 | round trip of originals to .eml, mbox and Maildir |
The rules for MIME boundaries, internationalized addresses and character sets build on long discussion in the email community about what archives lose and why.¶