IMAP icon

IMAP

Retrieve emails via IMAP

Overview

This node connects to an IMAP email server to download a specific email as an EML file. It supports selecting the mailbox and specifying the email by its UID. The downloaded email can be output either as binary data (for file handling) or as JSON text. This node is useful for workflows that require retrieving and processing raw email data, such as archiving emails, analyzing email content, or forwarding emails in their original format.

Use Case Examples

  1. Download an email from the INBOX mailbox by specifying its UID and save it as a binary EML file for archival purposes.
  2. Retrieve an email from a custom mailbox path and output it as JSON text for further processing or integration with other systems.

Properties

Name Meaning
Credential Type Selects which IMAP credentials to use for connecting to the email server, either credentials from this node or from an existing N8N IMAP Trigger node.
Mailbox Specifies the mailbox path from which to download the email. Can be selected from a list or entered as a full path.
Email UID The unique identifier of the email to download from the specified mailbox.
Output to Binary Data Determines whether the downloaded email is output as binary data (true) or as JSON text (false).
Put Output File in Field The name of the binary property field where the downloaded email file will be stored if outputting as binary data.

Output

Binary

Contains the raw EML file data of the downloaded email when 'Output to Binary Data' is true.

JSON

  • json - Contains the email data as JSON text if 'Output to Binary Data' is false.

Dependencies

  • Requires IMAP credentials to connect to the email server, which can be provided either directly in the node or via an existing IMAP Trigger node's credentials.

Troubleshooting

  • Connection failures due to incorrect IMAP credentials or server settings. Verify credentials and server details.
  • Errors related to invalid mailbox paths or email UIDs. Ensure the mailbox exists and the UID corresponds to an existing email.
  • Operation failures may throw errors caught and logged by the node; enabling debug logging can help diagnose issues.

Discussion