mail:read
Fetches one message and returns its parsed headers and bodies, through whichever connection answers the mail:read capability.
Options
| Name | Type | Description |
|---|---|---|
connection | string | The connection id to read mail with; empty resolves the only connection answering mail:read |
mailbox | string | The mailbox the message lives in (default INBOX) |
uid | string | The message uid to read, as returned by mail:list |
Outputs
| Name | Type | Description |
|---|---|---|
uid | string | The message uid |
from | string | The sender header |
to | string | The recipients header |
cc | string | The carbon-copy header |
subject | string | The decoded subject header |
date | string | The date header |
message_id | string | The message-id header |
text | string | The text/plain body |
html | string | The text/html body |
Examples
name: Read the newest unread message
actions:
- name: inbox
component: mail:list
vars:
search: UNSEEN
limit: 1
- name: message
component: mail:read
vars:
uid: "{{ inbox.messages | first | key:'uid' }}"
outputs:
subject: "{{ message.subject }}"
body: "{{ message.text }}"Summarize
Feeds a fetched message into a model. mail:read returns the parsed text body, so the inference step consumes it like any other pipeline value with no scraping or format juggling in between.
name: Summarize an invoice email
actions:
- name: inbox
component: mail:list
vars:
search: FROM "billing@" SUBJECT "invoice"
limit: 1
- name: invoice
component: mail:read
vars:
uid: "{{ inbox.messages | first | key:'uid' }}"
- name: summary
component: llm:generate
vars:
provider: openai
model: gpt-5
prompt: |
Summarize this invoice email in one sentence, including the amount due:
{{ invoice.text }}
outputs:
summary: "{{ summary.content }}"