OpenClaw · inbound email
An email arrives. Your OpenClaw agent wakes up.
Install one skill, give the agent a free inbox, and route inbound mail into a dedicated Gateway hook with header-only authentication.
Prerequisite: a working OpenClaw agent with a model provider configured · no polling · custom domain later
The event path
Webhook triggering replaces an inbox polling loop.
Email arrives
A message lands in agent@domani.run.
Domani authenticates
Authorization plus X-Domani-Signature accompany the event.
Gateway maps
/hooks/domani-email turns the payload into an isolated agent task.
Agent acts
OpenClaw can deliver the final response to the configured channel.
Polling
Repeated reads, idle requests, and delay set by the polling interval.
Webhook
One push when mail is processed; reconcile the stored inbox only after receiver downtime.
1 · Gateway ingress
Map Domani's payload into an isolated agent run.
Merge this into `~/.openclaw/openclaw.json`; preserve stricter existing settings. Put two different long random values in the Gateway environment or `~/.openclaw/.env`: `OPENCLAW_GATEWAY_TOKEN` for control-plane auth and `OPENCLAW_HOOK_TOKEN` for this ingress. Agent hook runs are isolated by default. Restart after validating.
Dedicated token
Use a long random value and do not reuse OPENCLAW_GATEWAY_TOKEN. OpenClaw flags reuse as a critical security finding.
Trusted exposure
Keep the Gateway loopback-only and expose the hook through HTTPS via a tailnet or trusted reverse proxy. Configure trustedProxies to the exact proxy IPs when applicable.
Restricted agent
Treat email as untrusted input. Use a restricted tool policy and keep unsafe-content bypasses disabled.
2 · Domani mailbox
Pass the token by environment variable, then prove delivery.
Use the externally reachable HTTPS form of your mapped hook. The hidden prompt keeps the bearer value out of shell history and the CLI reads it without printing it.
Test first
Require a 2xx result before sending live mail.
Live second
Send one real email and confirm exactly one isolated task starts.
Reconcile after downtime
Live mailbox callbacks are attempted up to three times. Still read the stored inbox after longer Gateway downtime because webhook delivery is at-least-once and retry windows are bounded.
Troubleshooting
Four boundaries to check.
The Domani test proves that the Gateway accepted the HTTP event. It does not measure the downstream model's completion time.
Community integration using documented OpenClaw and Domani interfaces.