---
name: extract-structured-data-and-attachments-from-raw-em-ab2b531556fc
slug: "extract-structured-data-and-attachments-from-raw-email-mailparser"
description: "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."
github_stars: 1666
verification: "security_reviewed"
source: "https://github.com/nodemailer/mailparser"
author: "Andris Reinman"
category: "Calendar, Email & Productivity"
framework: "Multi-Framework"
tool_ecosystem:
  github_repo: "nodemailer/mailparser"
  github_stars: 1666
  npm_package: "mailparser"
  npm_weekly_downloads: 13679456
---

# 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/)


---
Source attribution: agentskillexchange
Original project: https://github.com/agentskillexchange/skills/blob/7964af467fccaf7d68a4b705bb2e26081fbdd3e8/skills/extract-structured-data-and-attachments-from-raw-email-mailparser/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Agent Skill Exchange

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: agentskillexchange
Original project: https://github.com/agentskillexchange/skills/blob/7964af467fccaf7d68a4b705bb2e26081fbdd3e8/skills/extract-structured-data-and-attachments-from-raw-email-mailparser/SKILL.md
Attribution basis: Source repository record

Fields of work: Marketing, Sales, Customer Support
Roles: Customer Success Manager, Email Marketer, Support Agent
Specialties: API
Tools: Mailparser
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: c9b826eea1b0828d7236460c773e69b7510b8d92a906cdbabb6d28c180ab2b6a
