An .eml file is one message in the Internet Message Format,
RFC 5322, usually with
MIME structure in the body. This page covers the
header and follows RFC 5322, with
RFC 5321 for the trace fields,
RFC 6532 and RFC 2047, all read
2026-11-12.
Lines and folding
- Lines end with CR LF. A line must be at most 998 characters and should be at most 78, not counting the CR LF.
- The header is a list of fields,
Name: value. Names are printable US-ASCII (33 to 126) without a colon. The names the RFC defines are ABNF strings, which match in either case. - A field can be folded: a CR LF may be put before any space or tab in the value, and the line that follows starts with that white space. Unfolding removes the CR LF.
- An empty line ends the header; everything after it is the body. Header text is US-ASCII; RFC 6532 allows UTF-8 in messages sent with the SMTPUTF8 extension.
Fields
| Field | Times | Meaning |
|---|---|---|
Date | 1, required | When the message was written; see dates. |
From | 1, required | The author or authors (a list of mailboxes). |
Sender | 0 or 1 | The one mailbox that sent it, required when From lists several. |
Reply-To | 0 or 1 | Where replies should go. |
To, Cc | 0 or 1 each | Primary and copied recipients. |
Bcc | 0 or 1 | Blind copies. The RFC gives three uses: the line is removed for every recipient; or kept only in a separate copy for the blind recipients; or sent empty to show that blind copies went to someone. Which is used depends on the program. |
Message-ID | 0 or 1 (should) | A unique ID: <left@right>. |
In-Reply-To | 0 or 1 (should, in some replies) | Message IDs of the message or messages replied to. |
References | 0 or 1 (should, in some replies) | Message IDs of the thread. |
Subject | 0 or 1 | Text. |
Comments | any | Text. |
Keywords | any | Comma-separated phrases. |
Resent-Date, Resent-From, Resent-Sender, Resent-To, Resent-Cc, Resent-Bcc, Resent-Message-ID | blocks | Added when a message is re-sent; each re-send adds a block at the top. Resent-Date is required in a block with other resent fields, and Resent-Sender when Resent-From has several addresses. |
Return-Path | trace, 0 or 1 | Inserted by the SMTP server that makes final delivery (RFC 5321): the envelope sender from the MAIL command, <address> or <>. |
Received | trace, 1 or more per block | Each SMTP server prepends one, so the newest is first. RFC 5321 gives the form FROM … BY …, then optional VIA, WITH, ID and FOR parts, then ; and a date. |
| Other fields | any | Any other name is allowed if it is not one of the names above; the value is unstructured text. MIME-Version and the Content- fields of MIME are such fields, defined in RFC 2045. |
Dates
[day-of-week ","] day month year hour ":" minute [":" second] zone,
such as Thu, 12 Nov 2026 21:30:00 +0000. Day names are Mon
to Sun, months Jan to Dec, the zone is
+hhmm or -hhmm. -0000 means the local zone is
unknown. Readers also accept obsolete forms: two-digit years and zone names such as
GMT, EST and PDT.
Addresses
- A mailbox is
local-part@domain, optionally with a display name:Alice Example <alice@example.com>. A display name with special characters is put in double quotes. - A group is
name: mailbox, mailbox;, possibly empty (undisclosed-recipients:;). - Text in parentheses is a comment and may appear between most tokens.
Encoded words
RFC 2047 lets unstructured text
(such as Subject) and display names carry other characters:
=?charset?encoding?text?=, at most 75 characters. Encoding
B is base64; Q is like quoted-printable, with
_ for a space. Adjacent encoded words separated only by white space are
joined without the space. Example:
Subject: =?UTF-8?B?Q2Fmw6k=?= is “Café”.
Obsolete syntax
RFC 5322 section 4: forms that a sender must not generate but a receiver must accept and parse, while still coping robustly with messages that fit neither grammar.
- Characters: NUL and the US-ASCII controls other than CR, LF, SP and HTAB (1–8, 11, 12, 14–31, 127;
obs-NO-WS-CTL) may appear in header bodies, and bare CR and bare LF may appear in messages (obs-body,obs-unstruct,obs-qp). Bare CR and LF are used both as mistaken line ends and as real control characters. - Folding:
obs-FWS = 1*WSP *(CRLF 1*WSP), so a folded line may consist only of white space, and white space and comments may sit between any tokens of a structured field. - Phrases:
obs-phraseallows a period inside a display name (initials such asJ. Smith), which was never allowed before but is common. - Date: two- and three-digit years: 00–49 add 2000, 50–99 and any three-digit year add 1900. Zones:
UTandGMTare +0000;EST−0500,EDT−0400,CST−0600,CDT−0500,MST−0700,MDT−0600,PST−0800,PDT−0700. The one-letter military zones were defined wrongly in RFC 822, so they should be read as −0000 unless something outside the message says otherwise; any other alphabetic zone is likewise −0000. - Addresses: a route before the addr-spec inside angle brackets (
<@a.example,@b.example:user@c.example>), which should be ignored; CFWS between the dot-separated parts of a local part and domain; a quoted string in the local part; empty members in address lists (a@x,,b@y); control characters and quoted pairs in domain literals. - Fields: any field may occur several times and in any order, and any amount of white space is allowed before the colon.
Authentication and trace fields
From RFC 6376 (DKIM), RFC 8617 (ARC), RFC 8601 (Authentication-Results), RFC 7208 section 9.1
(Received-SPF) and RFC 2369 (list fields), read 2026-11-13. Their values are not free text:
DKIM-Signature and the ARC fields are tag-lists, tag=value pairs separated by
semicolons, with white space allowed around the separators.
DKIM-Signature
Should be treated like a trace field: not reordered, prepended to the message. Unknown tags must be ignored by verifiers but still be included in the signature calculation.
| Tag | Required | Value |
|---|---|---|
v | yes | version, 1 |
a | yes | algorithm, rsa-sha256 (signers should use it) or rsa-sha1 (verifiers must support both); form key-hash, extensible |
b | yes | signature, base64; white space ignored (a signer may fold it anywhere) |
bh | yes | hash of the canonicalised body, cut to l, base64 |
c | no | header/body canonicalisation, each simple or relaxed; default simple/simple; one name alone is the header and the body is simple |
d | yes | the signing domain (SDID), also used to find the key; internationalised names as A-labels |
h | yes | colon-separated names of the signed header fields, in the order they were hashed, not empty, never the signature field itself. A name may be listed that does not exist (it then counts as nothing, so a later insertion is detected), and may be listed several times for several occurrences |
i | no | agent or user identifier, an address whose local part may be omitted and whose domain is the d domain or a subdomain; dkim-quoted-printable; default @ plus d |
l | no | number of canonicalised body octets hashed, at most 76 digits; default whole body |
q | no | colon-separated key query methods, type[/options]; default and only defined value dns/txt |
s | yes | selector, which divides the namespace under d |
t | recommended | creation time, decimal seconds since 1970-01-01 UTC, up to 12 digits (longer may be treated as infinite) |
x | recommended | expiry, same format, an absolute time; greater than t if both are present |
z | no | copied header fields for diagnosis: name:value items separated by |, dkim-quoted-printable (so | and all white space inside a field are encoded). Not the fields that h names |
Canonicalisation. Header, simple: unchanged. Header, relaxed: lower-case the field name; unfold
(keep the final CRLF); turn every run of white space into one space; delete white space at the end of the value and around the colon.
Body, simple: ignore empty lines at the end, add a CRLF if the body is empty or lacks one (an empty body becomes one CRLF).
Body, relaxed: ignore white space at the end of lines, reduce runs of white space in a line to one space, then ignore empty lines
at the end (an empty body stays empty). Empty-body hashes: simple SHA-1 uoq1oCgLlTqpdDX/iUbLy7J1Wic=, SHA-256
frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY=; relaxed SHA-1 2jmj7l5rSw0yVb/vlWAYkK/YBwk=, SHA-256
47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=.
What is hashed. Step 1: the canonicalised body cut to l gives the bh value. Step 2: hash, in order, the
header fields named in h (canonicalised, each ending in one CRLF), then the DKIM-Signature field itself with the value of
b (and its surrounding white space) removed, canonicalised and without a final CRLF. The hash is taken after any base64 or
quoted-printable transfer encoding and before SMTP dot-stuffing. The signature is RSA PKCS#1 v1.5 over that hash, never truncated;
the public exponent should be 65537. MIME parts get no special treatment.
Key record (a tag-list in a DNS TXT record at selector._domainkey.domain; the only binding defined):
| Tag | Value |
|---|---|
v | DKIM1, recommended; if present it must be the first tag, and a record with another value is discarded |
h | acceptable hash algorithms, colon-separated (sha1, sha256); default all |
k | key type, default rsa: a base64 ASN.1 DER RSAPublicKey in p |
n | notes for humans |
p | public key, base64; required; empty means the key is revoked |
s | service types, colon-separated, default *; email or * are defined |
t | flags, colon-separated: y (testing: do not treat failures differently from unsigned mail), s (the i domain must equal d, no subdomain) |
ARC (Authenticated Received Chain)
Three fields added together by each handler form an ARC set; they share an instance number from 1 (increased by one for each set added, at most 50). A valid set has exactly one of each field per instance and algorithm. The ordered sets are the chain.
| Field | Value |
|---|---|
ARC-Authentication-Results | instance ; authres-payload: an Authentication-Results payload (below) preceded by the instance number; one per set, holding all the results of the handler's domain |
ARC-Message-Signature | instance ; tag-list: a DKIM-Signature tag-list with no v tag (ignored if present) and with the instance in place of i. It should cover the message as the handler passes it on, include any existing DKIM-Signature fields, and must not cover Authentication-Results or any ARC field |
ARC-Seal | instance ; tag-list with only the tags i (the instance), a, b, d, s, t and cv; no body hash, relaxed header canonicalisation only, and an h tag makes the chain fail. It signs the ARC set field values in increasing instance order, from instance 1 up to the set being added, and within a set ARC-Authentication-Results, then ARC-Message-Signature, then ARC-Seal |
cv is the chain validation status: none (no chain arrived), fail or pass. In international messages the d and
s tags may hold U-labels and non-ASCII characters need not be quoted-printable.
Authentication-Results
Grammar of RFC 8601: Authentication-Results: authserv-id [version, default 1] then either ; none or one or more
; method = result [reason = value] [ptype.property = value ...]. The authserv-id names the authentication service of the domain that did the checks.
A method is a registered keyword optionally followed by /version. ptype says where the evaluated property came from:
header (a header field or a tag inside one, for example header.d), smtp (a parameter of an SMTP command, for example
smtp.mailfrom), body (none registered yet), policy (a local policy overrode the result, as in
dkim=policy policy.dkim-rules=unsigned-subject). Results using an unknown ptype must not be used for handling decisions.
DKIM results: none, pass, fail, policy, neutral, temperror, permerror; SPF
results are those of RFC 7208, below.
Received-SPF
A trace field prepended above the Received field of the SMTP receiver and above other Received-SPF fields:
Received-SPF: result [comment] [key=value ; ...]. Results: pass, fail, softfail, neutral,
none, temperror, permerror. Keys: client-ip, envelope-from, helo,
problem (error details), receiver (host name of the verifier), identity (mailfrom, helo or another name),
mechanism (the matching mechanism, or default), and other keys a verifier defines. Values are dot-atoms or quoted strings. A
verifier should give at least client-ip, helo and, if checked, envelope-from.
List fields
RFC 2369: List-Help, List-Unsubscribe, List-Subscribe, List-Post, List-Owner and
List-Archive, each at most once and only generated by mailing lists. The value is one or more angle-bracketed URLs
(<mailto:list@host.com?subject=help>), separated by commas, in order of preference, optionally with a
comment in parentheses; a client uses the first one it supports. A field whose content does not start with < is ignored,
and so is anything after an item that is not a URL. List-Post may instead be the word NO. A sublist replaces its parent's
help, subscribe, unsubscribe and owner fields with its own and keeps the parent's List-Archive unless it has its own.