IMAP Enhanced icon

IMAP Enhanced

Enhanced IMAP node with custom labels, limit parameters, and structured email fields

Email → Get Many

AI-generated

Summary

Fetch emails from an IMAP mailbox filtered by mailbox, date range, flags, custom labels, and search criteria, with results combined via AND logic across filters.

Inputs

  • authentication (required) — IMAP credential source. 'imapThisNode' uses this node's credentials; 'coreImapAccount' uses existing N8N IMAP Trigger credentials.
  • mailboxes — Mailbox to search. Defaults to ['ALL']. Supports selection of ALL, INBOX, or expression for custom IDs.
  • emailDateRange — Filter emails by 'since' and/or 'before' dateTime values.
  • emailFlags — IMAP flags to filter by. 'seen'=true returns read emails; false returns unseen. Other flags filter correspondingly. Multiple flags combined with AND.
  • customLabels — Search by custom label name and value. Added filters combined with AND.
  • emailSearchFilters — Text-based search filters (from, to, subject, text, bcc, cc, uid). Case-insensitive, combined with AND (must match all).
  • includeParts — Message parts to include in output. Options: textContent, htmlContent, markdownContent, attachmentsInfo, flags, size, bodyStructure, headers.
  • includeAllHeaders — When false, only headers listed in headersToInclude are included (requires includeParts to include headers). Default true.
  • headersToInclude — Comma-separated list of header names. Shown when includeAllHeaders is false and includeParts includes headers.
  • limit — Maximum number of emails to return. Minimum value is 1. Default 50.

Output shape

Array of email objects. Field composition depends on includeParts selection. If includeParts is empty, default email fields are returned.

IMAP connection is established per execution, the search is performed, and the connection is closed after retrieval. Results are aggregated across input data items if multiple are provided.

Examples

Example 1: Fetch up to 20 recent unseen emails from INBOX with label 'Important'

Set limit to 20, mailboxes to INBOX, emailFlags seen to false, customLabels labelName to 'Important'.

Discussion