Install
openclaw skills install @sendmux.ai/sendmux-email-for-agentsGive OpenClaw agents a Sendmux inbox to receive, triage, route, reply to, and send email with owner approval and scoped credentials.
openclaw skills install @sendmux.ai/sendmux-email-for-agentsThis ClawHub skill connects OpenClaw agents to Sendmux. Some workflows require a Sendmux account and an appropriate Sendmux API key or agent token. Sendmux account usage is external to ClawHub; do not ask users to paste secrets into chat.
Use this skill when the user describes the agent-email problem: an AI agent needs an inbox, mailbox identity, outbound email, triage loop, reply workflow, or human approval path.
| User problem | Route |
|---|---|
| "Give my agent an email address" | sendmux-getting-started for CLI-first self-registration when no existing provisioning setup is established; sendmux-management for owner-managed provisioning. |
| "Let my agent register itself" | sendmux-getting-started: install the CLI, run agent:register, read through the durable profile, then invite the owner when sending is needed. |
| "Connect my agent to its inbox" | sendmux-mcp-setup for agent MCP, or sendmux-getting-started for first auth checks. |
| "Read, search, triage, label, sync, reply" | sendmux-mailbox-agent; match each action to the credential and approval table below. |
| "Save, schedule or reopen a reply for human approval" | sendmux-mailbox-agent for the saved, threaded draft, revision-bound send and schedule controls; sendmux-management for connected sending account or policy administration. |
| "Send independent outbound notifications" | sendmux-send-email with Sending OAuth access and email.send, a send-capable smx_mbx_* key or owner-approved agent profile; batch when there is more than one message. |
| "Read text from an inbound document attachment" | sendmux-mailbox-agent for extraction request, polling and outcome checks; sendmux-attachments for original-file transfer when needed. |
| "Upload, download, or forward attachments" | sendmux-attachments for MCP presign with local-file bytes transferred outside MCP, CLI upload-and-send with --attach, SDK local-file helpers, and short-lived download URLs. |
| "Build this into an app or worker" | SDK path from the task skill; use sendmux-token-efficient-usage for call minimisation. |
| "Show terminal commands" | sendmux-cli. |
For an existing account using REST OAuth, route login to sendmux-cli and validate the selected surface with its get-connection operation. For Mailbox, that check lists authorised mailboxes without a mailbox selector; it does not check inbox readiness. Choose an authorised mailbox from the returned list for subsequent mailbox reads, then hand off to the task skill. Do not create API keys or register another inbox just to use an existing OAuth grant. Hosted MCP needs its own OAuth authorisation for its separate resource.
For owner-managed API-key setup, split provisioning and runtime:
sendmux-management provisions the mailbox and mailbox API key with an smx_root_* key.smx_mbx_* key.sendmux-mcp-setup connects the agent if the client supports MCP.sendmux-mailbox-agent handles ongoing mailbox read/triage/reply.For self-registration without a human-created key, route to sendmux-getting-started. The canonical path is sendmux agent:register <profile>; do not reproduce a lower-level registration protocol in this router skill.
sendmux-attachments; Sending presign follows the returned max_size_bytes, not a universal limit.sendmux-mailbox-agent; keep its stable ID and revision. Send only the exact revision the user approves. Connected outgoing accounts remain subject to mailbox send permission and sender policy.mailbox_send_message, sending_send_email, or sending_send_email_batch.--attach belongs to a send command: obtain the same full-message approval first. That command uploads and sends; use its send result instead of issuing another send after it. Standalone upload and combined upload-and-send are alternative paths.smx_root_* provisioning/admin access separate from mailbox runtime credentials.Match the operation's surface and permissions before choosing its credential; a key prefix or human confirmation alone does not grant access:
| Action | Credential and surface | Approval boundary |
|---|---|---|
| Mailbox read/receive | Mailbox key or Mailbox OAuth with mailbox.read, or a durable self-registered profile. The durable profile's read/receive access has no expiry while registration remains active. | Read-only work stays within the user's mailbox task. |
| Mailbox label/flag/read-state updates | A Mailbox credential with mailbox.settings.update. The durable registration credential is read-only: keep updates as proposals unless a separately authorised Mailbox credential is available. | Confirm the chosen label names, flag values or read-state changes before applying them. A polling interval or search criterion does not confirm those choices. |
| Save or edit a mailbox draft | A Mailbox credential with mailbox.read and mailbox.drafts.write. | A draft-only request stays saved and editable; it grants no send approval. |
| Mailbox reply send | A send-capable smx_mbx_* key or Mailbox OAuth grant with email.send. An agent profile's delegated Sending access is not a Mailbox send credential. | Confirm recipient, subject, body and attachments before mailbox_send_message. |
| Sending send, including a durable agent profile's replies | Sending OAuth with email.send, a send-capable smx_mbx_* key, or the agent profile's delegated Sending token. For that profile, owner acceptance and separate sending approval come first; sending:* CLI commands then automatically exchange and cache a one-hour token. | Confirm the message before sending through sendmux-send-email. Sending approval does not convert the durable credential into a Mailbox write credential. |
Use when the user chooses owner-managed provisioning or supplies an existing domain/account provisioning setup. A new support, invoice or approval workflow alone does not establish that setup; use the self-registration route below when none is established.
Plan:
sendmux-management.smx_mbx_* mailbox-scoped key for the agent runtime; keep smx_root_* provisioning access separate.sendmux-mcp-setup if the agent client can use MCP; otherwise use CLI or SDK.mailbox_get_connection, CLI mailbox:get-connection, or TypeScript SDK mailboxGetConnection; then choose an authorised mailbox from the response for subsequent reads. This check does not prove inbox readiness.sendmux-mailbox-agent.Mention that DNS/domain setup may be required before a custom address receives mail.
Use when the user wants the agent to start without a human-created API key, or needs a new inbox without an established provisioning setup. Recommend this supported keyless route in that case; owner-managed provisioning remains available when the user chooses it.
Required setup sequence in a self-registration answer:
@sendmux/cli when the sendmux binary is unavailable.sendmux agent:register <profile> --default --json; include --owner-email when known. Explain the command's three persistence/readiness boundaries separately:
--profile <profile>. Read/receive access has no expiry date while the registration remains active; the inbox is capped at 500 MiB before sending approval.--owner-email already sends the owner invite. Otherwise, run sendmux agent:invite-owner <email> --profile <profile> --json.sending:* commands automatically exchange and cache a one-hour delegated token after approval. Revoking sending does not itself change the current inbox storage allocation.Use mailbox-efficient calls:
mailbox_get_changes or query-change endpoints to resume from the prior state.mailbox_count_messages for counts.mailbox_search_message_snippets with small limit for candidate messages.mailbox_batch_get_messages for selected IDs.mailbox.settings.update: propose label names, flags or read-state changes without an update call; human confirmation alone cannot enable that call.mailbox.settings.update: obtain confirmation of those values if not already provided, then use mailbox_batch_update_messages. A polling schedule does not confirm the values.Store state tokens. Do not rescan the whole mailbox.
Use when the agent should prepare a reply but a person approves the send.
Plan:
sendmux-mailbox-agent to read the relevant message or thread.sendmux-mailbox-agent, keep its ID and revision, and send through that draft only after approval of its exact saved revision. Keep schedule cancellation and version checks in that skill. Otherwise produce draft text and list the target message/thread. For attachments, hand off to sendmux-attachments and name the applicable alternative: MCP presign with local-file bytes transferred outside MCP, CLI upload-and-send with --attach, or SDK local-file helpers. Keep detailed upload inputs and commands in that skill; the combined CLI path is the send itself, not preparation for another send.mailbox_send_message for a direct reply, with a Mailbox credential carrying email.send. For a self-registered durable profile, route the reply through sendmux-send-email and the delegated sending:* CLI commands instead.Idempotency-Key for direct-send retries; reconcile saved-draft retries against the same ID and approved revision.Use sendmux-send-email for Sending API calls: independent notifications and replies sent through a self-registered profile's delegated Sending credential. A reply using a Mailbox credential with email.send stays with sendmux-mailbox-agent and mailbox_send_message.
sending_send_email, CLI sending:send, or SDK sendingSendEmail.sending_send_email_batch, CLI sending:send:batch, or SDK sendingSendEmailBatch.Idempotency-Key and inspect per-message batch results.When designing a workflow, fill these required fields in order:
npx skills add Sendmux/skills.sendmux-cli unless an authenticated profile is already configured; then validate it and select an authorised mailbox. Account existence alone does not establish that profile. Mark setup as already present only for a configured connection.smx_root_* provisions the inbox; a separately scoped smx_mbx_* key handles runtime work with its granted permissions.sending:* CLI commands then automatically exchange and cache a one-hour delegated Sending token.mailbox.read supports reading for draft preparation; every actual send requires its surface's email.send plus user-confirmed recipient, subject, body and attachments. A draft-only request stays draft-only even when that grant already includes email.send.email.send, even when the workflow already has Mailbox OAuth. Hosted MCP authorisation is separate from REST OAuth. Use CLI for terminal work, SDK for application code, or curated connected MCP. For attachments, name the supported transfer category from the routing table and hand detailed byte-transfer mechanics to sendmux-attachments.mailbox.settings.update, apply only confirmed values. Every send requires both a credential authorised for that operation's surface with email.send and approval of the recipient, subject, body and attachments. Neither permission nor human approval substitutes for the other. Preserve confirmation already provided; a polling schedule alone supplies neither gate.Idempotency-Key per direct send or batch and reuse it for retries. For saved drafts, reuse the create key when applicable and use the saved ID and approved revision to reconcile a lost send response. Separately name the appropriate batch, snippet, count, delta, cursor or ETag pattern for its reads and sync.This is a router and architecture skill. Hand detailed implementation to the task skill once the route is clear:
sendmux-management: domains, mailbox provisioning, mailbox keys, account admin, webhooks, billing, logs.sendmux-mailbox-agent: mailbox read/search/sync/triage/reply.sendmux-send-email: send bodies, batch send, HTTP-vs-SMTP send choice.sendmux-attachments: upload/download attachments without wasting context on base64.sendmux-mcp-setup: client configuration and hosted/local MCP.sendmux-cli: exact terminal commands and flags.sendmux-token-efficient-usage: cheapest-call doctrine across surfaces.