Actions12
Message → Get
AI-generatedSummary
Fetch a message from a mailbox by UID or Message-ID, with configurable attachment handling.
Inputs
- mailbox — Mailbox to retrieve the message from. Defaults to INBOX.
- identifierType — Method to identify the message. Options: uid (requires uid parameter), messageId (requires messageId parameter).
- uid (required) — Message UID. Required when identifierType is uid.
- messageId (required) — Message-ID header value. Required when identifierType is messageId.
- attachmentsMode — Controls attachment handling. Options: none (no attachments returned), metadataOnly (attachment metadata only), binary (attachment data prepared as binary property keys).
- binaryPrefix — Prefix used for binary attachment keys when attachmentsMode is binary. Defaults to 'attachment_'.
- maxAttachmentSizeMb — Maximum attachment size in megabytes. Applied when attachmentsMode is binary or metadataOnly. Defaults to 25.
- allowedMimeTypes — Comma-separated list of allowed MIME types. Filters attachments by content type when extracting.
- filenameRegex — Regular expression to match filenames when extracting attachments.
Output shape
An object with a 'json' property containing the full message data. When attachmentsMode is binary and attachments are extracted, an additional 'binary' property holds prepared binary data keyed by prefix. When attachmentsMode is none or metadataOnly, only 'json' is returned.
The 'json' object always includes: uid, seq, messageId, subject, date (ISO 8601), normalized from/to/cc addresses, flags, headers, thread references and in-reply-to, body (text and html), and an attachments array with metadata (filename, contentType, size, optional binaryProperty key). Attachments are filtered by maxAttachmentSizeMb, allowedMimeTypes, and filenameRegex.
Examples
Example 1: Retrieve a single message by UID with binary attachments.
Set identifierType to 'uid', provide the uid value, set attachmentsMode to 'binary'. The node returns { json: {...}, binary: { 'attachment_0':
Example 2: Retrieve a message by Message-ID with metadata only.
Set identifierType to 'messageId', provide the messageId value, set attachmentsMode to 'metadataOnly'. The node returns { json: {...} } without a binary property.
