On this page
Essential Email Header Fields
Emit mandatory RFC 5322 header fields (From, Date, Message-ID), structured recipient fields, and machine-readable metadata while preventing header duplication.
What it is
Header fields are structured key-value metadata pairs defined in RFC 5322 §3.6 that govern how email clients parse sender identity, recipient lists, delivery timestamps, threading relationships, and automated actions.
From: "Billing Department" <[email protected]>
To: "Customer" <[email protected]>
Reply-To: [email protected]
Subject: Your Invoice #INV-2026-088
Date: Tue, 25 Aug 2026 14:30:00 +0000
Message-ID: <[email protected]>
Auto-Submitted: auto-generated
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="boundary-9923"
Why it matters
- RFC Mandates: RFC 5322 explicitly requires the presence of
From:andDate:. Most modern MTAs also mandate a globally uniqueMessage-ID:. Messages missing these fields are rejected by SpamAssassin, Google, and Microsoft as high-probability spam. - DMARC & Identity Alignment: The
From:header is the single visible address that DMARC evaluates against SPF and DKIM signatures. If multipleFrom:headers exist or the format is malformed, DMARC evaluation fails immediately. - Conversation Threading: Mail clients (Apple Mail, Gmail, Outlook) rely on
Message-ID,In-Reply-To, andReferencesto group related messages into coherent conversation threads. - Infinite Loop Prevention: Automated transactional emails without
Auto-Submitted: auto-generatedcan trigger catastrophic auto-reply loops when interacting with out-of-office autoreponders or ticketing systems.
How to implement
1. Include all mandatory RFC 5322 headers on every outbound message:
From:The author identity. Must be a valid mailbox specification:
(If multiple authors exist inFrom: "Jane Doe" <[email protected]>From:, a singleSender:header is mandatory to identify the actual submitting agent).Date:The origination timestamp formatted strictly according to RFC 5322 §3.3:Date: Tue, 25 Aug 2026 14:30:00 +0000Message-ID:A globally unique identifier enclosed in angle brackets, anchored to a domain you control:Message-ID: <[email protected]>
2. Configure routing and automated handling headers:
Reply-To:Direct user replies to a monitored support address rather than ano-replysender:Reply-To: [email protected]Auto-Submitted:For transactional notifications, password resets, and receipts, setAuto-Submitted: auto-generated(RFC 3834). This suppresses automated vacation responders and out-of-office bounce loops.List-Unsubscribe&List-Unsubscribe-Post: For newsletters, marketing broadcasts, and recurring digests:List-Unsubscribe: <https://example.com/unsub?token=abc>, <mailto:[email protected]?subject=unsub> List-Unsubscribe-Post: List-Unsubscribe=One-Click
3. Implement threading headers for transactional chains:
When replying to an existing notification or continuing a support ticket chain, populate In-Reply-To with the parent Message-ID, and append to References:
In-Reply-To: <[email protected]>
References: <[email protected]> <[email protected]>
Common mistakes
- Duplicate Headers: Emitting multiple instances of single-instance headers (
Date,From,Subject,Message-ID). RFC 5322 forbids duplicate occurrences; mailbox providers reject or quarantine messages containing duplicateFromorDatefields. - Invalid Date Syntax: Using ISO-8601 timestamps (
2026-08-25T14:30:00Z) instead of the required RFC 2822 date specification (Tue, 25 Aug 2026 14:30:00 +0000). - Predictable or Domain-Less Message-IDs: Emitting Message-IDs like
<1234>or omitting the@domain.comFQDN suffix. - Using Unmonitored
noreply@without Reply-To: Frustrates recipients and increases spam complaints when users try to reply with genuine queries or cancellation requests.
Verification
1. Inspect raw headers with swaks or message analyzer:
swaks --to [email protected] --from [email protected] --server mail.example.com --dump-mail
2. Verify header validation rules:
- Confirm
From,Date, andMessage-IDare present exactly once. - Confirm
Dateparses successfully with standard RFC 2822 date parsers. - Confirm
Message-IDcontains a domain component (<...@{your-domain}>).