Visual RFC.
ALL RFCs / RFC 5322
Read the RFC ↗
RFC 5322 / EMAIL MESSAGE FORMAT

Folding long fields

02

One logical header field can span physical lines at permitted folding white space.

RFC 5322 · § 2.2.3EXAMPLE
3 / 3
03
Unfold on receipt.

Remove the folding CRLF before interpreting the logical field.

Folding long fieldsOne logical header field can span physical lines at permitted folding white space.Physical lines, one logical fieldLOGICAL FIELDSubject: Planning the next releasefoldSubject: Planningthe next releaseCRLFleading WSPunfoldSubject: Planning the next release78 recommended · 998 maximum · excludes CRLF

Key idea: Unfold before interpreting a field.

Terms

Look up a term in the glossary ↗

Rules & examples
  • Lines must not exceed 998 characters; 78 is the recommended limit, excluding CRLF.
  • Unfolding removes CRLF immediately followed by white space.

A display wrap is not necessarily a legal wire-format fold. Reject header injection.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

The envelope and the letter do different jobs.

Mail transport moves a message between servers. The message format describes its contents. Authentication adds checks; it does not make every message safe.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

All chapters in RFC 5322

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗