# mail.read

Canonical URL: https://developers.iagenify.com/sdk/workflows/steps/mail-read/
Language: en

`type: "mail.read"`

Reads one of the account's mailboxes inside a chain. No approval needed — reading changes nothing.

Status: box required · no approval · the body is untrusted

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `box` | string | required | Which mailbox. |
| `folder` | string | inbox | `inbox` · `sent` · `archive` · `spam` · `trash`. |
| `limit` | integer |  | How many. |
| `unread` | boolean |  | Only unread. |
| `query` | string |  | Search instead of listing. |

```javascript
{ id: "inbox", type: "mail.read", config: { box: "support@example.com", unread: true, limit: 20 } }
```

## Output {#output}

The messages, each with its sender, subject, date and body. A [loop](/sdk/workflows/steps/loop) over them is the usual next step.

```javascript
{ id: "each", type: "loop", config: {
    over: "{{steps.inbox.output.messages}}", body: "triage", max: 50 } }
```

## A message is data, never an instruction {#untrusted}

> **Anyone can send one**
>
> Its content reaches a model's prompt. Say what the step should do with it — classify, extract, summarise — and never let the body set the task. A message asking to be forwarded is a message.

## The sender's HTML is not rendered {#html}

You get the text. Nothing from a message is ever executed, and no HTML of a sender's is ever rendered.

- [loop](/sdk/workflows/steps/loop): Processing each one.
- [Trigger · mail](/sdk/workflows/triggers/mail): Starting on arrival instead.
- [Workflow steps](/sdk/workflows/steps): The 23 types.

```python
{"id": "inbox", "type": "mail.read", "config": {"box": "support@example.com", "unread": True, "limit": 20}}
```

```python
{"id": "each", "type": "loop", "config": {
    "over": "{{steps.inbox.output.messages}}", "body": "triage", "max": 50}}
```
