IMAP icon

IMAP

Retrieve emails via IMAP

Email → Download as EML

AI-generated

Overview

This node operation downloads an email as an EML file from a specified mailbox using IMAP credentials. It is useful for scenarios where you need to retrieve the raw email data for archival, processing, or forwarding purposes. For example, you can use it to download specific emails by their UID from an inbox or any other mailbox folder.

Use Case Examples

  1. Download an email from the INBOX mailbox by specifying its UID and save it as a binary EML file for further processing.
  2. Retrieve an email from a custom mailbox path and output the email content as JSON text instead of binary data.

Properties

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

Output

Binary

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

JSON

  • json - Contains the email data as JSON if 'Output to Binary Data' is false.
    binary - Contains the binary EML file data under the specified binary property name if 'Output to Binary Data' is true.

Dependencies

  • IMAP credentials (either from this node or from an existing N8N IMAP Trigger node)

Troubleshooting

  • Connection failures due to incorrect IMAP credentials or network issues. Verify credentials and network connectivity.
  • Errors related to invalid mailbox paths or email UIDs. Ensure the mailbox exists and the UID is correct.
  • Operation failures may throw errors with messages from the IMAP server; check logs for detailed error information.
  • If the node outputs no data, verify that the specified email UID exists in the mailbox.

Discussion