What is Inbound Email Parsing?
Also called Email Parsing, Inbound Email Webhook.
Inbound email parsing is the process of turning a received email into structured data an application can use. It separates headers, the new message body from quoted history, signatures, inline images, and attachments, then usually delivers the result to an application as a webhook payload or an API object. It is the entry step for any system that acts on email.
A message arrives as MIME, a nested structure that can carry plain text, HTML, inline images, and files in one envelope. Parsing walks that structure, decodes each part according to its declared character set and transfer encoding, and normalizes the result. Headers such as Message-ID, In-Reply-To, and References establish where the message belongs in an existing thread.
Separating new content from everything else is the awkward part. Clients quote previous messages in incompatible ways, some with a leading marker, some with an HTML block, some with a localized line naming the date and sender. Signatures, legal footers, and mobile taglines all look like content. Most systems combine per client heuristics with pattern rules and accept that some trimming will be wrong.
Parsed email is untrusted. Attachments can be malicious, HTML can carry tracking pixels and hidden text, and display names are easily spoofed to resemble a colleague. Sender authentication results should be read rather than assumed, size limits enforced, and any instruction found in the body treated as data to consider, never as a command to execute.
Design decisions here shape everything downstream. Whether the parser keeps the raw source, how it handles messages with no plain text part, and what it does with an attachment it cannot read all determine whether a later investigation is possible. Storing the original alongside the parsed result costs little and repeatedly saves debugging time.
Key points
- Turns MIME structure into headers, body, attachments, and metadata
- Thread headers place the message in an existing conversation
- Trimming quoted history and signatures is heuristic and imperfect
- Attachments and hidden HTML make parsed mail untrusted input
- Keeping the raw source makes later investigation possible
In practice
An expense tool gives each company a dedicated address. An employee forwards a hotel receipt with the note 'Berlin trip, client billable.' The parser extracts the sender, strips the forwarded header block and the phone signature, pulls out the PDF, and hands the application a record with a short note plus a file. The total and date come from the document itself, not from the email body.