# Email for OpenClaw Agents

Give every OpenClaw agent its own inbox in two commands. `@openmail/openclaw` is a native channel plugin: mail from people wakes the agent, its reply goes out in the same thread, and the OpenMail CLI runs inside the gateway — no SMTP config, no separate process.

## How OpenMail works with OpenClaw

01

### Install the plugin

`@openmail/openclaw` is a native OpenClaw channel plugin, on ClawHub and npm.

```bash
openclaw plugins install clawhub:@openmail/openclaw
```

02

### Add the channel

Pass an API key from the console. With an account key, channels add creates the inbox, mints an inbox-scoped key for it, and stores only that. `--mailbox-name` picks the address.

```bash
openclaw channels add --channel openmail --api-key <key> --mailbox-name sales
openclaw gateway restart
```

03

### Check the channel

The gateway holds the connection. No bridge, no service file.

```bash
openclaw channels status
# - OpenMail: enabled, configured, running, connected
```

04

### Let the agent use email

Mail from a person wakes the agent as a conversation and its reply goes out in the same thread. For everything else, the plugin bundles the OpenMail CLI as `openclaw openmail` with the channel's credentials.

```bash
# Read a thread
openclaw openmail -- threads get --thread-id <id> --json

# Send with an attachment
openclaw openmail -- send --to hello@example.com --subject "Report" --body "See attached" --attach report.pdf
```

## What your OpenClaw agent can do with email

- Answer inbound mail from people in-thread, with the sender's full history
- Get told about verification codes, notifications, and newsletters without replying to them
- Run one account per inbox or one pod account covering every inbox the agent creates
- Read PDF, DOCX, XLSX, and image attachments as text, extracted server-side
- Handle OTP codes and verification links for autonomous account-creation flows

## What's included

**Native channel plugin**  
Runs inside the OpenClaw gateway like WhatsApp or Telegram. Install from ClawHub, add the channel, restart. No skill files or env vars to write.

**Three modes**  
- channel: mail wakes the agent and it replies.
- notify: the agent tells you on your usual chat.
- tool: nothing inbound; the agent uses email only when asked.

**Only people get a reply**  
OpenMail classifies inbound mail on the server. Notifications, marketing, and bounces are announced as information; spam is dropped.

**Narrow keys by default**  
`channels add` mints an inbox-scoped key and never stores your account key in `openclaw.json`. SecretRefs supported.

**Bundled CLI**  
`openclaw openmail -- <command>` runs the OpenMail CLI with the channel's credentials. The agent skill ships inside the plugin.

**Managed deliverability**  
SPF, DKIM, and DMARC configured automatically on provisioning. Primary inbox placement from day one.

## Frequently asked questions

### How do I give an OpenClaw agent an email address?

Two commands: `openclaw plugins install clawhub:@openmail/openclaw` then `openclaw channels add --channel openmail --api-key <key>`. Restart the gateway and the inbox is live. Full guide at [docs.openmail.sh/integrations/openclaw](https://docs.openmail.sh/integrations/openclaw).

### What does channels add do with my key?

An inbox-scoped key is stored as-is. An account or pod key is used once to pick or create the inbox and mint an inbox-scoped key; only that narrow key is written to `openclaw.json`. Pass `--pod` to make one account cover a whole pod instead.

### How does my OpenClaw agent receive inbound emails?

The gateway holds a WebSocket to OpenMail. In channel mode, mail from a person wakes the agent as a conversation and its reply goes out in-thread. Automated mail is announced as information. In notify mode the agent relays new mail to you on your usual chat. In tool mode nothing arrives on its own.

### Who can email the agent?

That is OpenMail's inbound and outbound policy, not the plugin. Set allow and block rules per account, pod, or inbox in the console under Allow/Block List, or with `openmail policy` on the CLI.

### I used openmail setup and the bridge. What changed?

`@openmail/cli 0.7.0` removed setup, openclaw, status, and doctor. Stop the old bridge service, install the plugin, and run channels add with the key from `~/.openclaw/openmail.env`. The upgrade steps are in the docs.

### Is there a free tier?

Yes. Three inboxes and 3,000 emails per month. No credit card required.
