IMAP icon

IMAP

Retrieve emails via IMAP

Overview

This node connects to an IMAP email server to retrieve multiple mailboxes and their details. It is useful for scenarios where you need to list and manage mailboxes from an email account, such as in email automation workflows or monitoring mailbox statuses. For example, it can be used to fetch mailbox names along with optional status fields like message count, recent count, unseen count, UID next, UID validity, and highest modseq to get detailed mailbox information.

Use Case Examples

  1. Fetch all mailboxes from an IMAP account to display in a dashboard.
  2. Retrieve mailbox status fields to monitor unread or recent messages for alerting workflows.

Properties

Name Meaning
Credential Type Selects which credentials to use for connecting to the IMAP server, either from this node or from an existing N8N IMAP Trigger node.
Include Status Fields Specifies which mailbox status fields to include in the response, such as message count, recent count, unseen count, UID next, UID validity, and highest modseq.

Output

JSON

  • mailboxes
    • ``
      * name - The name of each mailbox retrieved.
      * status
      * messageCount - Total number of messages in the mailbox, if requested.
      * recentCount - Number of recent messages in the mailbox, if requested.
      * unseenCount - Number of unseen (unread) messages in the mailbox, if requested.
      * uidNext - Next unique identifier for new messages, if requested.
      * uidValidity - UID validity value for the mailbox, if requested.
      * highestModseq - Highest modification sequence number, if requested.

Dependencies

  • IMAP server credentials (either node-specific or from N8N IMAP Trigger node)

Troubleshooting

  • Connection failures due to incorrect IMAP credentials or server settings. Verify credentials and server details.
  • Operation errors if the mailbox resource or operation is unknown or unsupported. Ensure correct resource and operation selection.
  • Timeouts or slow responses when including multiple status fields. Consider limiting the number of status fields requested.
  • Errors related to IMAP server responses or network issues. Check network connectivity and IMAP server health.

Discussion