RFC 5322 - Internet Message Format
Published: October 2008
Status: Internet Standard (STD 68)
Author: P. Resnick (Ed.) (Qualcomm Incorporated)
Obsoletes: RFC 2822
Updates: RFC 4021
Abstract
This document specifies the Internet Message Format (IMF), a syntax for text messages that are sent between computer users, within the framework of "electronic mail" messages. This specification is a revision of Request For Comments (RFC) 2822, which itself superseded Request For Comments (RFC) 822, "Standard for the Format of ARPA Internet Text Messages", updating it to reflect current practice and incorporating incremental changes that were specified in other RFCs.
Status of This Memo
This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.
Table of Contents
- 1. Introduction
- 1.1 Scope
- 1.2 Notational Conventions
- 1.2.1 Requirements Notation
- 1.2.2 Syntactic Notation
- 1.2.3 Structure of This Document
- 2. Lexical Analysis of Messages
- 2.1 General Description
- 2.1.1 Line Length Limits
- 2.2 Header Fields
- 2.2.1 Unstructured Header Field Bodies
- 2.2.2 Structured Header Field Bodies
- 2.2.3 Long Header Fields
- 2.3 Body
- 2.1 General Description
- 3. Syntax
- 3.1 Introduction
- 3.2 Lexical Tokens
- 3.2.1 Quoted characters
- 3.2.2 Folding White Space and Comments
- 3.2.3 Atom
- 3.2.4 Quoted Strings
- 3.2.5 Miscellaneous Tokens
- 3.3 Date and Time Specification
- 3.4 Address Specification
- 3.4.1 Addr-Spec Specification
- 3.5 Overall Message Syntax
- 3.6 Field Definitions
- 3.6.1 The Origination Date Field
- 3.6.2 Originator Fields
- 3.6.3 Destination Address Fields
- 3.6.4 Identification Fields
- 3.6.5 Informational Fields
- 3.6.6 Resent Fields
- 3.6.7 Trace Fields
- 3.6.8 Optional Fields
- 4. Obsolete Syntax
- 4.1 Miscellaneous Obsolete Tokens
- 4.2 Obsolete Folding White Space
- 4.3 Obsolete Date and Time
- 4.4 Obsolete Addressing
- 4.5 Obsolete Header Fields
- 4.5.1 Obsolete Origination Date Field
- 4.5.2 Obsolete Originator Fields
- 4.5.3 Obsolete Destination Address Fields
- 4.5.4 Obsolete Identification Fields
- 4.5.5 Obsolete Informational Fields
- 4.5.6 Obsolete Resent Fields
- 4.5.7 Obsolete Trace Fields
- 4.5.8 Obsolete optional fields
- 5. Security Considerations
- 6. IANA Considerations
- 7. References
- 7.1 Normative References
- 7.2 Informative References
Appendices
- Appendix A. Example Messages
- A.1 Addressing Examples
- A.2 Reply Messages
- A.3 Resent Messages
- A.4 Messages with Trace Fields
- A.5 White Space, Comments, and Other Oddities
- A.6 Obsoleted Forms
- Appendix B. Differences from Earlier Specifications
- Appendix C. Acknowledgements
Key Concepts
Internet Message Format (IMF)
RFC 5322 defines the standard format for email messages, including:
- Message Structure: Header Fields + Blank Line + Body
- Header Fields: From, To, Subject, Date, Message-ID, etc.
- Address Format: Syntax rules for mailbox and group addresses
- Date-Time: Standard date-time representation
- Encoding Rules: US-ASCII character set and folding rules
Key Fields
| Field | Description | Required |
|---|---|---|
| Date | Message creation date-time | MUST |
| From | Message author mailbox | MUST |
| Sender | Actual sender (when multiple authors) | Conditional |
| To | Primary recipients | Optional but recommended |
| Cc | Carbon copy recipients | Optional |
| Bcc | Blind carbon copy recipients | Optional |
| Subject | Message subject | SHOULD |
| Message-ID | Unique message identifier | SHOULD |
| In-Reply-To | Message ID being replied to | Recommended in replies |
| References | List of referenced message IDs | Recommended in replies |
Relationship with MIME
RFC 5322 defines the basic message format, while MIME RFCs extend it:
- RFC 5322: Plain text message format (this RFC)
- RFC 2045-2049: MIME multimedia extensions
- Support for non-text content (images, video, attachments)
- Character encoding (UTF-8, etc.)
- Multipart messages
Basic Examples
Simple Message:
From: John Doe ``<[email protected]>``
To: Mary Smith ``<[email protected]>``
Subject: Saying Hello
Date: Fri, 21 Nov 1997 09:55:06 -0600
Message-ID: ``<[email protected]>``
This is a message just to say hello.
So, "Hello".
Multiple Recipients:
From: "Joe Q. Public" ``<[email protected]>``
To: Mary Smith ``<[email protected]>``, [email protected]
Cc: ``<[email protected]>``
Date: Tue, 1 Jul 2003 10:52:37 +0200
Message-ID: ``<[email protected]>``
Hi everyone.
Related Resources
- Official Text: RFC 5322
- Official Page: RFC 5322 DataTracker
- Errata: RFC Editor Errata
- Related RFCs:
- RFC 5321 - SMTP (Transport Protocol)
- RFC 2045-2049 - MIME (Multimedia Extensions)
- RFC 5234 - ABNF (Syntax Notation)
Importance
RFC 5322 is a fundamental standard for email systems, critical for:
- Email Client Development: Correctly parsing and generating messages
- Email Server Configuration: Validating message format
- Anti-Spam Systems: Analyzing message headers
- Email Archiving Systems: Storing and retrieving messages
- Compliance Auditing: Ensuring standards compliance
This specification defines the format used by billions of emails globally and is one of the core standards of Internet communication.