> ## Documentation Index
> Fetch the complete documentation index at: https://docs.riggery.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# IMAP fetch

> Read the latest mailbox messages.

Browse mailbox messages as markdown for the Agent or Graph. Prefer Secrets via `{{secret:Name}}`. Credentials never go to the model.

This does not watch the inbox. **IMAP poll** does. See [IMAP poll](/graph/triggers/imap-poll).

<h2 id="input">
  Input
</h2>

Inspector **Settings**. Empty-field rules for the Graph: [Previous nodes](/graph/previous-nodes). **Insert value** is on **Host**, **User**, and **Password**.

On an Agent Tool, **Folder** and **Limit** can be **Agent decides** or **Fixed**.

| Field         | Required | Empty               | Notes                                                   |
| ------------- | -------- | ------------------- | ------------------------------------------------------- |
| **Host**      | Yes      | Inherit Connections | Placeholder example `imap.gmail.com`.                   |
| **Port**      | Yes      | Default: `993`      | Inherit Connections when **Host** is empty.             |
| **TLS / SSL** | No       | Default: on         | Inherit Connections when **Host** is empty.             |
| **User**      | Yes      | Inherit Connections |                                                         |
| **Password**  | Yes      | Inherit Connections | Secret placeholder. Never a real password on the Graph. |
| **Folder**    | No       | Inherit Connections | New nodes use `INBOX`.                                  |
| **Limit**     | No       | Default: `5`        | Max emails this call returns.                           |

<h2 id="output">
  Output
</h2>

On the next node, **Previous nodes** lists **`IMAP fetch`: Result** (`{{IMAP fetch.text}}` while the name is unique). This is not the IMAP poll trigger: Subject, From, UID are not rows here.

| Output | In menu | Type          | Next node gets                                                                                                                                     |
| ------ | ------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Result | Yes     | Markdown text | Page header (folder, counts, More) plus one section per email. Empty mailbox: `No messages found.` Search miss: `No messages matched this search.` |
