Bounded polling
A Playwright or CI test can wait for one message with a deadline. The test owns the lifecycle and can fail synchronously.
Notify a service when mail arrives, stream bounded events to an active client, and keep retries and signature verification outside the model loop.
mails0 supports webhook routes and server-sent events so applications can react to inbound mail and delivery changes without constant polling. Webhook integrations should verify HMAC signatures, handle duplicate delivery idempotently, respond quickly, and fetch full message data only after authenticating and matching the intended mailbox.
Choose polling, streaming, or webhooks by ownership
A Playwright or CI test can wait for one message with a deadline. The test owns the lifecycle and can fail synchronously.
A connected client can observe mailbox activity without rebuilding a webhook receiver, while still keeping a one-way authenticated stream.
A backend receives events even when no agent session is open, then verifies, deduplicates, stores state, and schedules downstream work.
The right event surface depends on whether the caller is a short-lived test, an interactive agent, or a durable backend service.
A Playwright or CI test can wait for one message with a deadline. The test owns the lifecycle and can fail synchronously.
A connected client can observe mailbox activity without rebuilding a webhook receiver, while still keeping a one-way authenticated stream.
A backend receives events even when no agent session is open, then verifies, deduplicates, stores state, and schedules downstream work.
Use the raw request body and configured signing secret to verify the HMAC signature before trusting any event fields.
Persist an event or message identifier so a retry cannot execute the same external action twice.
Return success after durable acceptance, then move slow extraction, model calls, or browser work to a queue.
Fetch message content only with the intended mailbox credential and pass the minimum required data downstream.
An inbound email can be attacker-controlled input. Treat sender names, links, attachments, and instructions as untrusted data even when the webhook signature proves that mails0 delivered the event.
The event handler should decide which workflow is eligible, while the agent operates under its own tool and approval policy. A signed webhook proves transport authenticity; it does not prove that the message content is safe or that the requested action is authorized.
| Workflow | Recommended mechanism | Why |
|---|---|---|
| One verification email in a test | Bounded wait or polling | Simple synchronous assertion and a clear timeout. |
| Agent UI showing live inbox state | Server-sent events | Low-overhead one-way updates while the client is connected. |
| Always-on processing service | Signed webhook | Works without an active user session and supports queue handoff. |
| High-cost downstream model call | Webhook plus durable queue | Separates transport retry from expensive processing retry. |
| Irreversible external action | Event plus explicit approval gate | Inbound content cannot authorize the action by itself. |
Product behavior is verified against the mails0 source and documentation. External comparisons link to official vendor documentation checked on 2026-08-15.
Yes. Webhook routes support HMAC signature verification. Consumers should verify against the raw request body before parsing or acting on an event.
Retries are normal when delivery acknowledgement is delayed or fails. Consumers should use an event or message identifier to make processing idempotent.
Use SSE for an authenticated client that remains connected and needs one-way mailbox updates. Use webhooks for durable backend processing that must run without an active client.
No. The signature proves the event came through the configured transport. Email content remains untrusted input and must pass workflow authorization and content controls.
Start with a receive-only temporary mailbox. Move to a permanent identity or self-hosted deployment only after the workflow reaches a real email value event.