Turn an Internet email header block into structured fields while retaining repeated transfer records.
Parsing stops at the first empty line, normalises case-insensitive field names to lowercase, and unfolds each whitespace-prefixed continuation into its preceding value. Repeated names become ordered arrays, after which selected address, identity, route, and authentication fields are copied into a summary without validating their contents.
From: Jane Doe <[email protected]> To: [email protected] Subject: Invoice #4021 attached Date: Mon, 13 Jan 2025 14:22:00 +0000 Message-ID: <[email protected]> Received: from smtp.example.com (10.0.0.1) by mx.example.com; Mon, 13 Jan 2025 14:22:01 +0000 Received: from client.example.com (192.168.1.5) by smtp.example.com; Mon, 13 Jan 2025 14:21:59 +0000
Received hops: 2 HEADERS From: Jane Doe <[email protected]> To: [email protected] Subject: Invoice #4021 attached Date: Mon, 13 Jan 2025 14:22:00 +0000 Message ID: <[email protected]> Received: from smtp.example.com (10.0.0.1) by mx.example.com; Mon, 13 Jan 2025 14:22:01 +0000, from client.example.com (192.168.1.5) by smtp.example.com; Mon, 13 Jan 2025 14:21:59 +0000 SUMMARY From: Jane Doe <[email protected]> To: [email protected] Subject: Invoice #4021 attached Date: Mon, 13 Jan 2025 14:22:00 +0000 Message ID: <[email protected]>
Delivery support follows Received fields across SMTP relays, deliverability investigations inspect SPF and DKIM reports, and incident responders extract Message-ID and address metadata while retaining raw evidence.