IMAP Advanced icon

IMAP Advanced

Generic IMAP operations with threading and attachments

Thread → Get by Message

AI-generated

Summary

Retrieve thread messages referenced by a given message UID or Message-ID, including reference headers and normalized metadata sorted by date.

Inputs

  • mailbox — Mailbox to query (default: INBOX). Shown when resource is 'thread' or 'message'.
  • identifierType — Which identifier to use for the base message. 'uid' uses the UID parameter; 'messageId' uses the Message-ID parameter. Shown when resource is 'message' or 'thread' and operation is 'get', 'getByMessage', or 'getFull'.
  • uid (required) — Message UID. Required when identifierType is 'uid'. Defaults to 0 but will throw if not supplied or found.
  • messageId (required) — Message-ID header value. Required when identifierType is 'messageId'. Defaults to empty string.
  • threadStrategy — How to resolve thread members. 'strictReferences' follows Message-ID references only. 'referencesThenSubject' falls back to subject search when references are sparse. Shown when resource is 'thread' and operation is 'getByMessage' or 'getFull'.
  • subjectFallback — When true, includes a subject-based search fallback if thread strategy is 'referencesThenSubject' and references count is 1 or fewer. Shown when resource is 'thread' and operation is 'getByMessage' or 'getFull'.

Output shape

An array containing a single JSON object with the following fields:

messageUid: number — the UID of the base message identifier used as the thread anchor. references: array of strings — Message-ID references parsed from the base message's headers (References, In-Reply-To, Message-ID). messages: array of objects, each with uid (number), subject (string), date (ISO 8601 string), flags (array of string), matchedBy ('messageId' if found via reference, 'subject' if found via fallback), sorted by date ascending.

Examples

Example 1: Get thread by UID

mailbox: 'INBOX', identifierType: 'uid', uid: 123, threadStrategy: 'referencesThenSubject', subjectFallback: true

Links

Discussion