IMAP icon

IMAP

Retrieve emails via IMAP

Overview

This node operation sets flags on specified emails within a selected mailbox using the IMAP protocol. It allows users to mark emails as answered, deleted, draft, flagged, or seen, as well as set or remove custom IMAP flags. This is useful for email management automation, such as marking emails as read or flagged based on workflow conditions.

Use Case Examples

  1. Mark an email as seen after processing it in a workflow.
  2. Flag important emails automatically for follow-up.
  3. Remove the deleted flag from emails to restore them.

Properties

Name Meaning
Credential Type Selects which IMAP credentials to use for connecting to the email server.
Mailbox The mailbox folder path where the email resides, e.g., INBOX.
Email UID The unique identifier(s) of the email(s) to set flags on. Can be a comma-separated list.
Flags Collection of flags to set or remove on the email(s), including standard IMAP flags (Answered, Deleted, Draft, Flagged, Seen) and custom flags to add or remove.

Output

JSON

  • json - The result of the flag setting operation, typically including status or confirmation data.

Dependencies

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

Troubleshooting

  • Connection failures due to incorrect IMAP credentials or network issues. Verify credentials and network access.
  • Errors when specifying invalid mailbox paths or email UIDs. Ensure mailbox exists and UIDs are correct.
  • Operation failures if the IMAP server does not support certain flags or custom flags. Check server capabilities and flag syntax.
  • Node may throw errors if the IMAP connection is lost during operation. Retrying or checking server stability may help.

Discussion