MailParser icon

MailParser

Parse raw email data into structured format

Overview

The MailParser node processes raw email data and converts it into a structured format. It is useful when you have emails in raw form (e.g., MIME format) and want to extract meaningful information such as subject, sender, recipients, date, message IDs, body content, and attachments for further automation or analysis.

Common scenarios include:

  • Parsing incoming emails stored as raw data to extract key details.
  • Automating workflows that depend on email content, like ticket creation or notification systems.
  • Extracting attachments from emails for processing or storage.

For example, if you receive raw email data from an API or webhook, this node can parse it and output structured JSON with all relevant email fields ready for downstream nodes.

Properties

Name Meaning
Email Field Name of the field that contains the raw email data.

Output

The node outputs an array of items where each item’s json property contains the parsed email fields:

  • subject: The email subject line.
  • from: Sender information.
  • to: Primary recipients.
  • cc: Carbon copy recipients.
  • bcc: Blind carbon copy recipients.
  • date: Date the email was sent.
  • messageId: Unique message identifier.
  • inReplyTo: Message ID this email is replying to.
  • references: Related message IDs.
  • html: HTML version of the email body.
  • text: Plain text version of the email body.
  • textAsHtml: Text content converted to HTML.
  • attachments: Array of attachment objects extracted from the email.

If the email contains attachments, they are included in the attachments array with their metadata and content.

Dependencies

  • Requires the mailparser library to parse raw email data.
  • No special external API keys or credentials are needed.
  • The node expects raw email data to be provided in a specified input field.

Troubleshooting

  • Error: No email data found in field "X"
    This occurs if the specified email field does not exist or is empty in the input data. Ensure the correct field name is set in the "Email Field" property and that the input data contains raw email content there.

  • Parsing errors due to malformed email data
    If the raw email data is corrupted or incomplete, parsing may fail. Verify the integrity of the raw email content before passing it to the node.

  • Handling failures
    If the node is configured to continue on failure, failed items will include an error property describing the issue. Otherwise, the node execution will stop on the first error.

Links and References

Discussion