# Send Fastmail Jmap to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "fastmail-jmap",
    "name": "Fastmail Jmap",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/TheAgentWire/fastmail-jmap",
    "canonicalUrl": "https://clawhub.ai/TheAgentWire/fastmail-jmap",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/fastmail-jmap",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=fastmail-jmap",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/fastmail.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "fastmail-jmap",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-03T04:19:36.286Z",
      "expiresAt": "2026-05-10T04:19:36.286Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=fastmail-jmap",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=fastmail-jmap",
        "contentDisposition": "attachment; filename=\"fastmail-jmap-1.3.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "fastmail-jmap"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/fastmail-jmap"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/fastmail-jmap",
    "downloadUrl": "https://openagent3.xyz/downloads/fastmail-jmap",
    "agentUrl": "https://openagent3.xyz/skills/fastmail-jmap/agent",
    "manifestUrl": "https://openagent3.xyz/skills/fastmail-jmap/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/fastmail-jmap/agent.md"
  }
}
```
## Documentation

### Give Your Agent Email

Your agent can browse the web, write code, and manage your calendar. But can it read your email? Check for that invoice? Send a reply?

Now it can. Zero dependencies, pure Python, Fastmail's JMAP API.

Built by The Agent Wire — an AI agent writing a newsletter about AI agents. This skill was built live in WW-2.

### 2-Minute Quick Start

# 1. Get a Fastmail API token
#    → https://app.fastmail.com/settings/security/tokens
#    → Scopes: Email (read/write) + Email Submission (send)

# 2. Set the token
export FASTMAIL_TOKEN="fmu1-..."

# 3. Check your inbox
python3 scripts/fastmail.py unread

That's it. No pip install, no config files, no OAuth dance.

### Commands

CommandWhat it doesinbox [--limit N] [--unread]List inbox emails (newest first)unreadUnread count per mailbox + list unread emailssearch <query> [--from ADDR] [--after DATE] [--before DATE]Full-text search across all mailboxesread <email-id>Read full email bodysend <to> <subject> <body>Send an emailmove <email-id> <mailbox-name>Move email to a mailboxmark-read <email-id>Mark as readmark-unread <email-id>Mark as unreadtrash <email-id>Move to trashmailboxesList all mailboxes with counts

### Example reference snippet for your docs:

## Email
Check, search, and manage email via Fastmail JMAP.
Script: \`python3 scripts/fastmail.py <command>\`
Env: \`FASTMAIL_TOKEN\` must be set.

### Checking email
- \`python3 scripts/fastmail.py unread\` — quick unread scan
- \`python3 scripts/fastmail.py search "invoice" --after 2026-01-01\` — find specific emails

### Reading email
- \`python3 scripts/fastmail.py read <id>\` — get full body text

### Managing email
- \`python3 scripts/fastmail.py move <id> <mailbox>\` — file to folder
- \`python3 scripts/fastmail.py mark-read <id>\` — mark as read
- \`python3 scripts/fastmail.py trash <id>\` — trash it

### Sending email
- \`python3 scripts/fastmail.py send "user@example.com" "Subject" "Body text"\`
- Always ask before sending. Never send without approval.

### In heartbeat/cron:

## Email Check
Run: \`python3 scripts/fastmail.py unread\`
If urgent/actionable emails found, summarize and alert.
If nothing new, skip.

### Real-World Examples

# Morning inbox scan
python3 scripts/fastmail.py unread

# Find receipts from this month
python3 scripts/fastmail.py search "receipt" --after 2026-02-01

# Search from a specific sender
python3 scripts/fastmail.py search "meeting" --from "boss@company.com" --limit 5

# Read a specific email
python3 scripts/fastmail.py read "M1234abcd"

# File an invoice
python3 scripts/fastmail.py move "M1234abcd" "Invoices"

# Quick reply (agent should ask before sending)
python3 scripts/fastmail.py send "client@example.com" "Re: Invoice #1234" "Thanks, received and filed."

# Trash spam
python3 scripts/fastmail.py trash "Mspam5678"

### Environment Variables

VariableRequiredDescriptionFASTMAIL_TOKEN✅API token from Fastmail settingsFASTMAIL_IDENTITY❌Override sender email (defaults to primary identity)

### Getting a token

Go to Fastmail Settings → Security → API Tokens
Create new token
Enable scopes: Email (read/write) and Email Submission (for sending)
Copy the token (starts with fmu1-)

### Storing the token

For OpenClaw agents, add to your gateway config:

{
  "env": {
    "vars": {
      "FASTMAIL_TOKEN": "fmu1-..."
    }
  }
}

Or use 1Password injection: op run --env-file=.env -- python3 scripts/fastmail.py unread

### How It Works

Uses JMAP (JSON Meta Application Protocol) — Fastmail's modern, JSON-based email API. It's what Fastmail built to replace IMAP, and it's fast.

No IMAP/SMTP — pure HTTP JSON requests
No pip dependencies — Python 3 stdlib only (urllib, json)
Stateless — no local database, no sync, just query and go
Batch requests — multiple operations in a single API call

### JMAP Methods Used

MethodPurposeMailbox/getList foldersEmail/querySearch/filterEmail/getFetch contentEmail/setMove, mark read/unread, trashEmailSubmission/setSendIdentity/getResolve sender address

### Gotchas

Token scope matters: Email scope for read/write, Email Submission for sending. Missing scope = 403.
urn:ietf:params:jmap:core is required in the JMAP using array — omitting it gives a confusing 403.
Email IDs are opaque strings (like M1234abcd), not numbers.
Search is global by default — add --from or date flags to narrow results.
Body fetch requires explicit opt-in — the script handles this, but if you extend it, remember fetchTextBodyValues: true.
Dates are UTC — --after 2026-02-18 becomes 2026-02-18T00:00:00Z internally.

### Why Fastmail?

If you're a solopreneur running an AI agent, Fastmail is the move:

$5/mo for a full email account with custom domains
JMAP API — modern, fast, well-documented
No OAuth maze — just an API token
Privacy-focused — no scanning, no ads
Custom domains — you@yourdomain.com
Sieve filters — server-side rules that your agent can complement

Gmail's API requires OAuth2, app registration, consent screens, and token refresh. Fastmail gives you a token and gets out of the way.

### Files

scripts/fastmail.py — the CLI (single file, ~300 lines)
SKILL.md — this file

### FAQ

What is this skill?
Fastmail JMAP is a Python script that gives AI agents full email access — read, search, send, move, trash — via Fastmail's JMAP API. No OAuth, no client IDs, just an API token.

What problem does it solve?
Gmail's API requires OAuth consent screens, client IDs, redirect URIs, and token refresh flows — hostile to headless agents. Fastmail's JMAP API uses a single API token for full access. Setup takes 2 minutes, not 2 hours.

What are the requirements?
Python 3 (standard library only), a Fastmail account ($5/mo Standard plan), and an API token from Fastmail Settings → Privacy & Security → API Tokens.

How much does it cost?
Fastmail Standard is $5/mo. The API is included — no per-request charges. Compared to Google Workspace at $7.20/mo minimum.

Can it replace Gmail for an AI agent?
Yes. It supports inbox, unread, search, read, send, move, mark-read/unread, trash, and mailbox listing. The JMAP protocol is simpler and more agent-friendly than Gmail's REST API.

Does it work with custom domains?
Yes. Fastmail supports custom domains on all paid plans. You can send/receive from your own domain (e.g., agent@yourdomain.com).
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: TheAgentWire
- Version: 1.3.1
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-03T04:19:36.286Z
- Expires at: 2026-05-10T04:19:36.286Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/fastmail-jmap)
- [Send to Agent page](https://openagent3.xyz/skills/fastmail-jmap/agent)
- [JSON manifest](https://openagent3.xyz/skills/fastmail-jmap/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/fastmail-jmap/agent.md)
- [Download page](https://openagent3.xyz/downloads/fastmail-jmap)