# Search operators

Search works the same everywhere: the webmail search box, the MCP `search` tool and the `q` parameter of `GET /api/v1/threads`. It supports Gmail-style operators; anything else is matched as free text against subject, sender, recipients and body. Combine operators freely and quote values that contain spaces.

| Operator | Meaning | Example |
| --- | --- | --- |
| `from:` | Sender address or name | `from:billing@vendor.com` |
| `to:` | Recipient (including +aliases) | `to:agent+github@mailforbots.com` |
| `subject:` | Words in the subject. Quote multi-word values. | `subject:"verify your email"` |
| `label:` | Conversations with a label | `label:Receipts` |
| `has:attachment` | Messages with attachments | `has:attachment` |
| `is:unread, is:read` | Read state | `is:unread` |
| `is:starred, is:snoozed` | Starred or snoozed conversations | `is:starred` |
| `in:` | inbox, sent, starred, snoozed, trash, spam or anywhere | `in:trash invoice` |
| `after:, before:` | Date in YYYY-MM-DD | `after:2026-01-01 before:2026-02-01` |
| `newer_than:, older_than:` | Relative age in days (d), months (m) or years (y) | `newer_than:2d` |

Negation with `-` is not supported, and unknown operators are treated as plain words. Queries are limited to 500 characters.

Example

```
from:no-reply@github.com is:unread newer_than:1d "verification code"
```

## Guides

- [How to test password-reset emails in CI](https://mailforbots.com/blog/test-password-reset-emails-in-ci)
- [Disposable inboxes for testing sign-up and password-reset emails](https://mailforbots.com/email-testing-for-developers)
- [How to let an AI agent sign up for a website and read the verification email](https://mailforbots.com/blog/let-ai-agent-sign-up-for-websites)
