Actions12
- Mailbox Actions
- Email Actions
Overview
This node connects to an IMAP email server to download a specific email message as an EML file. It supports authenticating either with credentials provided directly in the node or by reusing credentials from an existing IMAP trigger node within n8n.
Typical use cases include:
- Archiving emails by downloading them in EML format for backup or offline access.
- Processing specific emails by UID for further automation workflows.
- Integrating email content into other systems by exporting raw email data.
For example, you might use this node to download an invoice email from your mailbox and then pass the EML file to another node that extracts attachments or parses the email content.
Properties
| Name | Meaning |
|---|---|
| Credential Type | Choose between using credentials defined in this node or reusing credentials from an existing IMAP trigger node. Options: "IMAP", "N8N IMAP Trigger Node". |
| Mailbox | Select the mailbox folder to look for the email (e.g., INBOX). Can be selected from a list or specified by full path. |
| Email UID | The unique identifier of the email message to download within the selected mailbox. |
| Output to Binary Data | Whether to output the downloaded email as binary data (true) or as JSON text (false). |
| Put Output File in Field | The name of the binary property field where the EML file will be stored if outputting as binary data (default is "data"). |
Output
The node outputs the downloaded email in one of two formats:
Binary Data (default): The entire email is output as a binary file in EML format under the specified binary property name (e.g.,
data). This allows downstream nodes to handle the raw email file directly, such as saving it to disk or sending it elsewhere.JSON Text: If binary output is disabled, the email content is output as JSON text. This may be useful for debugging or processing the email content as plain text.
The output structure includes standard n8n item fields plus the binary data field containing the EML file when enabled.
Dependencies
- Requires valid IMAP credentials to connect to the email server. These can be provided directly in the node or reused from an existing IMAP trigger node.
- The node uses an internal IMAP client library to communicate with the mail server.
- No additional external services are required beyond the IMAP server itself.
- Environment variable
N8N_LOG_LEVELcan influence logging verbosity (e.g., enabling debug logs).
Troubleshooting
- Connection failed errors: Usually caused by incorrect credentials, wrong server settings, or network issues. Verify the IMAP server address, port, authentication details, and network connectivity.
- Email not found: Ensure the correct mailbox and email UID are specified. UIDs are unique per mailbox and must be accurate.
- Permission denied or authentication errors: Check that the credentials have sufficient permissions to access the mailbox and read emails.
- Empty or no data returned: The specified email UID might not exist or the operation parameters could be incorrect.
- Unexpected errors: The node logs detailed error messages. Enable debug logging via
N8N_LOG_LEVEL=debugenvironment variable to get more insights.
If errors occur, review the error messages carefully and verify all input parameters and credentials.
Links and References
- IMAP Protocol Overview
- EML File Format
- n8n Documentation on Credentials
- n8n Community Forum for user discussions and troubleshooting tips