IMAP icon

IMAP

Retrieve emails via IMAP

Overview

This node connects to an IMAP email server and performs operations on emails within specified mailboxes. Specifically, the Copy Email operation allows users to copy one or multiple emails from a source mailbox to a destination mailbox on the same IMAP server.

Common scenarios where this node is useful include:

  • Organizing emails by copying important messages into dedicated folders.
  • Automating email management workflows, such as archiving or categorizing emails.
  • Backing up specific emails by duplicating them into another mailbox.

For example, you could use this node to copy all flagged emails from the Inbox to a "Flagged" folder automatically.

Properties

Name Meaning
Credential Type Choose which credentials to use for connecting to the IMAP server:
- Use credentials defined in this node.
- Use existing credentials from an N8N IMAP Trigger node.
Source Mailbox Select the mailbox from which to copy emails. You can either pick from a list of available mailboxes or specify the full path manually. This is required.
Email UID Specify the UID(s) of the email(s) to copy. You can provide a single UID or a comma-separated list to copy multiple emails at once.
Destination Mailbox Select the mailbox to which the emails will be copied. Like the source mailbox, you can choose from a list or enter the full path manually. This is required.

Output

The node outputs JSON data representing the result of the copy operation. Typically, this includes information about the copied emails, such as their UIDs or confirmation of successful copying.

If the node supports binary data output (not explicitly shown here), it would represent raw email content or attachments, but this operation primarily deals with metadata and mailbox management rather than transferring raw binary data.

Dependencies

  • Requires access to an IMAP email server.
  • Needs valid IMAP credentials, either provided directly in the node or inherited from an existing IMAP Trigger node.
  • The node uses environment variables for logging level configuration (N8N_LOG_LEVEL).
  • No additional external services are required beyond the IMAP server.

Troubleshooting

  • Connection failures: Errors during connection usually indicate incorrect credentials, wrong server address, or network issues. Verify your IMAP credentials and server accessibility.
  • Invalid mailbox paths: If the source or destination mailbox does not exist or is misspelled, the operation will fail. Use the mailbox list mode to avoid typos.
  • Invalid or missing UIDs: Ensure that the email UIDs provided exist in the source mailbox. Using invalid UIDs will cause errors.
  • Permission issues: Some IMAP servers restrict copying between certain mailboxes. Check server permissions if copying fails.
  • Error messages: The node throws detailed error messages including response text from the IMAP server when available. Review these messages to identify issues.
  • Logging: Set N8N_LOG_LEVEL to debug for more verbose logs to help diagnose problems.

Links and References

Discussion