IMAP icon

IMAP

Retrieve emails via IMAP

Email → Get Many

AI-generated

Summary

Searches the selected IMAP mailbox and returns up to the configured limit of matching emails, with optional message parts such as headers, body text, HTML, attachment details, flags, size, and body structure.

Inputs

  • Credential Type (required) — Choose this node’s IMAP credentials or reuse credentials from an n8n IMAP Trigger node.
  • Mailbox (required) — Select a mailbox or enter its full path; defaults to INBOX.
  • Date Range — Optionally set Since and Before dates to constrain the search.
  • Flags — Filter by answered, deleted, draft, flagged, recent, seen, or custom flags. The configured flag values are passed into the IMAP search.
  • Search Filters — Filter by BCC, CC, sender, subject, body text, recipient, or comma-separated UIDs. Search criteria are combined with AND.
  • Limit — Maximum number of matching emails to fetch; defaults to 50.
  • Include Message Parts — Choose optional output fields: text or HTML content, attachment information, flags, size, body structure, and headers. Text, HTML, and attachment information are derived from the message body structure.
  • Include All Headers — When headers are included, return all headers by default; set false to specify a header allowlist.
  • Headers to Include — Comma-separated header names to fetch when Include All Headers is false.

Output shape

A list of items, one per matching email; each item contains the fetched email data in JSON.

Each result includes the email UID and envelope, plus the selected fields and mailboxPath. Text or HTML content is null when no corresponding body part is found; attachment information is an array. Returns no items when there are no matches. The limit is applied to the UID search results before fetching email data.

Links

Discussion