IMAP Advanced Trigger icon

IMAP Advanced Trigger

Trigger for new emails with IMAP IDLE/poll modes

IMAP Advanced Trigger

AI-generated

Summary

IMAP Advanced Trigger monitors an IMAP mailbox for new messages and emits them as workflow items, supporting IDLE or polling modes, optional flag updates, moving messages, and configurable output of email data and attachments.

Inputs

  • mailbox — Mailbox to watch (e.g., INBOX). Default: INBOX.
  • mode — Detection mode: auto (IDLE if supported), IDLE, or Polling. Default: auto.
  • pollInterval — Poll interval in seconds when mode is polling. Default: 60.
  • outputFormat — Amount of email data returned: headersSnippet (subject + first 500 chars of text), full (headers + body), or raw (MIME). Default: headersSnippet.
  • attachmentsMode — How to handle attachments: none, metadataOnly, or binary. Default: none.
  • binaryPrefix — Prefix for binary attachment property names when attachmentsMode is binary. Default: attachment_.
  • markSeen — If true, newly seen messages are marked with the IMAP 'Seen' flag. Default: false.
  • addFlagsCsv — Comma‑separated list of IMAP flags to add to each processed message (e.g., '$Important,Flagged'). Default: empty.
  • moveToMailbox — If set, moves each processed message to this mailbox after handling. Default: empty (no move).
  • maxAttachmentSizeMb — Maximum attachment size in megabytes when attachmentsMode is metadataOnly or binary. Larger attachments are skipped. Default: 25.
  • allowedMimeTypes — Comma‑separated list of MIME types allowed for attachments (e.g., 'image/pdf,application/pdf'). Empty means all types are allowed. Default: empty.
  • filenameRegex — Regular expression that attachment filenames must match to be processed. Empty disables filtering. Default: empty.

Output shape

Each emitted item contains a json field with email metadata (uid, seq, messageId, subject, date, from/to/cc arrays, flags, headers, thread info, body, attachments metadata) and optionally a binary field holding binary attachment data when attachmentsMode is 'binary'. The exact body content depends on outputFormat (headersSnippet, full, or raw).

If outputFormat is 'headersSnippet', the body contains a snippet property with the first 500 characters of the text part. If 'full', the body contains text and html. If 'raw', the body is empty and the raw MIME is available via includeRaw in the enrich step (not exposed directly). Attachments are included as metadata objects with filename, contentType, size, and optionally a binaryProperty linking to binary data.

Examples

Example 1: Simple inbox watch with snippet output

Mode: auto (uses IDLE if server supports it), Output Format: headersSnippet, Attachments: none

Example 2: Polling every 2 minutes, move processed mail to Archive, mark as seen, add Flagged flag

Mode: poll, Poll Interval: 120, Move To Mailbox: Archive, Mark as Seen: true, Add Flags CSV: Flagged

Example 3: Fetch full email with binary attachments limited to PDFs under 10 MB

Mode: auto, Output Format: full, Attachments Mode: binary, Max Attachment Size (MB): 10, Allowed MIME Types: application/pdf

Links

Discussion