IMAP Advanced icon

IMAP Advanced

Generic IMAP operations with threading and attachments

Message → Get

AI-generated

Summary

Fetches a single email message from the specified mailbox using either its UID or Message-ID, optionally returning attachment metadata or binary data.

Inputs

  • mailbox — Mailbox to fetch the message from. Defaults to INBOX if not set.
  • identifierType — How to identify the message: by UID or by Message-ID header. Defaults to UID.
  • uid (required) — The UID of the message to fetch. Used when identifierType is UID.
  • messageId (required) — The Message-ID header value of the message to fetch. Used when identifierType is Message-ID.
  • attachmentsMode — How to handle attachments: None (no attachment info), Metadata Only (attachment metadata), or Binary (attachment metadata plus binary data). Defaults to Metadata Only.
  • binaryPrefix — Prefix for binary attachment property names (e.g., attachment_0). Only applies when attachmentsMode is Binary. Defaults to 'attachment_'.
  • maxAttachmentSizeMb — Maximum attachment size in megabytes; larger attachments are skipped. Applies when attachmentsMode is Metadata Only or Binary. Defaults to 25.
  • allowedMimeTypes — Comma‑separated list of allowed MIME types (e.g., 'image/pdf,application/pdf'). Attachments with other types are skipped. Applies when attachmentsMode is Metadata Only or Binary. Defaults to empty (no restriction).
  • filenameRegex — Regular expression that attachment filenames must match to be included. Applies when attachmentsMode is Metadata Only or Binary. Defaults to empty (no filter).

Output shape

object

The returned object contains the message metadata. If attachmentsMode is Binary, a second 'binary' property is present containing the attachment binary data keyed by the binary property names (e.g., attachment_0). All fields are present even when empty or null as appropriate for the email fetched.

Examples

Example 1: Fetch a message by UID with attachment metadata only.

Set mailbox to 'INBOX', identifierType to UID, uid to 12345, attachmentsMode to Metadata Only.

Example 2: Fetch a message by Message-ID and receive binary attachments under properties prefixed with 'att_'.

Set mailbox to 'INBOX', identifierType to Message-ID, messageId to 'abc@example.com', attachmentsMode to Binary, binaryPrefix to 'att_'.

Links

Discussion