# Extract structured data and attachments from raw email with MailParser

> Use MailParser when an agent receives raw RFC822 or MIME email and needs a normalized result with headers, text, HTML, addresses, and attachments. This is for email ingestion and handoff workflows, not for acting as a mailbox client or delivery platform.

- Skill: `agentskillexchange/extract-structured-data-and-attachments-from-raw-email-with-` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/extract-structured-data-and-attachments-from-raw-email-with-`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/extract-structured-data-and-attachments-from-raw-email-with-/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Web & Frontend
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/extract-structured-data-and-attachments-from-raw-email-with-

---


# Extract structured data and attachments from raw email with MailParser

Use MailParser when an agent receives raw RFC822 or MIME email and needs a normalized result with headers, text, HTML, addresses, and attachments. This is for email ingestion and handoff workflows, not for acting as a mailbox client or delivery platform.

## Prerequisites

Node.js

## Installation

Use the upstream install or setup path that matches your environment:
- $ npm install mailparser

Requirements and caveats from upstream:
- Advanced email parser for Node.js. Everything is handled as a stream which should make it able to parse even very large messages (100MB+) with relatively low overhead.
- const mailparser = require('mailparser');

Basic usage or getting-started notes:
- This module is in maintenance mode. It will continue to receive security updates and critical bug fixes, but no new features or feature changes will be added. For new projects, please consider using [PostalMime](https...
- First install the module from npm:
- next import the mailparser object into your script:

- Source: https://github.com/nodemailer/mailparser
- Extracted from upstream docs: https://raw.githubusercontent.com/nodemailer/mailparser/HEAD/README.md

## Documentation

- https://github.com/nodemailer/mailparser#readme

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/extract-structured-data-and-attachments-from-raw-email-mailparser/)

