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-management to create/inspect domain, mailbox, and mailbox key. |
| "Let my agent register itself" | Agent access: read /auth.md, optionally install skills with npx skills add Sendmux/skills, register at identity_endpoint with proof_of_work, immediately save the returned claim_token and agent credential bundle securely before token exchange, exchange the assertion, keep the assertion or pre-claim token until invite 202, verify /api/v1/mailbox/me, then invite the owner or ask for the owner email. |
| "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 with an smx_mbx_* key or scoped smx_agent_* token. |
| "Send independent outbound notifications" | sendmux-send-email with a send-capable smx_mbx_* key or owner-approved Sending-resource smx_agent_* token; batch when there is more than one message. |
| "Upload, download, or forward attachments" | sendmux-attachments for file_path, presigned upload URLs, CLI --attach, SDK 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. |
If the task crosses setup and runtime, split it:
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, use agent access instead:
https://app.sendmux.ai/auth.md./auth.md if the agent needs exact solver code.POST /agent-auth/agent/identity/challenge.proof_of_work as base64 UTF-8 JSON with { "challenge": <exact challenge>, "solution": { "counter": <integer>, "derivedKey": <hex> } }.proof_of_work at identity_endpoint, POST /agent-auth/agent/identity.claim_token and agent credential bundle in a secure store before token exchange, then exchange the returned identity_assertion at POST /agent-auth/oauth2/token.GET /api/v1/mailbox/me with the returned pre-claim smx_agent_* token.identity_assertion or pre-claim token available until the owner invite returns 202; claim_token cannot create the invite.POST /agent-auth/agent/identity/invite. If it is unknown, ask: What owner email should I invite for approval?claim_token with the claim grant for an app-resource or Sending-resource smx_agent_* token.claim_token or agent credentials.identity_assertion or pre-claim smx_agent_* token available until the owner invite returns 202. If both are lost before the invite succeeds, register a fresh identity and invite immediately.202; after 202, polling with claim_token is the wait-for-approval path. claim_token cannot create the owner invite.sendmux-attachments so local files move by path, presigned URL, CLI, or SDK helper. Mailbox upload modes cap each attachment at 7,500,000 bytes.mailbox_send_message, sending_send_email, or sending_send_email_batch.smx_root_* for provisioning/admin, send-capable smx_mbx_* keys or owner-approved Sending-resource smx_agent_* tokens for Sending, smx_mbx_* keys for normal Mailbox runtime, and smx_agent_* only for the scopes it was issued with.smx_agent_* tokens include mailbox.read and email.receive, not email.send.503 states while mailbox provisioning or owner approval is pending. Wait for Retry-After or retry_after. Registration 503 server_error means stop and report, not repeated retries.429 responses include retry timing; wait for Retry-After or retry_after before trying again.Use when the user wants a new mailbox for an agent, such as support intake, invoice triage, scheduling, approvals, or lead qualification.
Plan:
sendmux-management.sendmux-mcp-setup if the agent client can use MCP; otherwise use CLI or SDK.mailbox_get_me, CLI mailbox:me:get, or SDK mailboxGetMe.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.
Plan:
https://app.sendmux.ai/auth.md./auth.md if exact solver code is needed./agent-auth/agent/identity/challenge with the intended anonymous registration body.proof_of_work as base64 UTF-8 JSON with { "challenge": <exact challenge>, "solution": { "counter": <integer>, "derivedKey": <hex> } }.identity_endpoint, /agent-auth/agent/identity, with the same body plus proof_of_work.claim_token and agent credential bundle in a secure store before token exchange, then exchange identity_assertion at /agent-auth/oauth2/token./api/v1/mailbox/me with the pre-claim smx_agent_* token.identity_assertion or pre-claim token available until the owner invite returns 202; claim_token cannot create the invite./agent-auth/agent/identity/invite. If it is unknown, ask: What owner email should I invite for approval?claim_token at /agent-auth/oauth2/token with Sendmux's documented claim grant; request resource=https://smtp.sendmux.ai/api/v1 before Sending API calls.Do not say the pre-claim agent can send email. It cannot. After owner approval, a Sending-resource claim-grant smx_agent_* token can send from the assigned mailbox. Sendmux sends the owner invite email separately. Only one live pre-claim owner invite can be pending; retry the same request with the same idempotency key. On expected token-exchange 503 states, wait for Retry-After or retry_after. On registration 503 server_error, stop and report the failure. On 429, wait for Retry-After or retry_after.
The raw claim_token is shown once and is required after owner approval. Sendmux cannot recover it later. Immediately after registration, store the agent credential bundle: claim_token, registration_id, mailbox.email, claim_token_expires, identity_assertion, token_endpoint, the app resource URL, and the sending resource URL. Use a secure store such as 1Password, an OS keychain, or the agent platform's encrypted secret store. After token exchange, add the pre-claim token or keep identity_assertion available until invite 202. If no secure store is available, stop and ask the user where to store the bundle before sending the owner invite. If the claim token was lost, rerun registration and invite with a fresh agent identity. If the identity_assertion and pre-claim token were lost before the invite returned 202, rerun registration and invite immediately in the same flow.
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_batch_update_messages only after the user confirms labels, flags, or read-state changes.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.mailbox_send_message for mailbox-centred replies.Idempotency-Key for retryable sends.Use sendmux-send-email when the email is not a reply inside an active mailbox workflow.
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, answer in this order:
smx_root_* for admin, smx_mbx_* for normal runtime, smx_agent_* for scoped self-registered agent runtime, and owner-approved Sending-resource smx_agent_* for agent sending.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.