Use an isolated mailbox
A fresh mailbox keeps prior messages out of the search space and prevents a test from consuming another workflow's code.
Wait for the right message, extract the likely code, and return the value the workflow needs without granting broad access to a human inbox.
mails0 can wait for inbound messages and extract likely 4-8 character verification codes from email subjects and bodies through the CLI, HTTP API, Python SDK, or MCP server. The current parser covers common English, Chinese, Japanese, and Korean code patterns and includes guards against date-like false positives.
Verification automation is more than reading the latest email
A fresh mailbox keeps prior messages out of the search space and prevents a test from consuming another workflow's code.
The caller should fail clearly when the message does not arrive. Infinite polling hides delivery and routing problems.
Keyword and delimiter patterns narrow the candidate code, while date rejection reduces common false positives.
A reliable agent must bind the correct mailbox, wait within a deadline, identify the intended message, and return a value without confusing a date, order number, or stale code for the verification token.
A fresh mailbox keeps prior messages out of the search space and prevents a test from consuming another workflow's code.
The caller should fail clearly when the message does not arrive. Infinite polling hides delivery and routing problems.
Keyword and delimiter patterns narrow the candidate code, while date rejection reduces common false positives.
Bootstrap a temporary address for the test or load a mailbox-scoped key for a persistent agent.
Use the mailbox address in the account creation, login, password reset, or confirmation flow.
Call mails code or the equivalent SDK or MCP method with the intended recipient and an explicit timeout.
Submit the value, assert the verified state, and delete or expire the mailbox when the workflow is disposable.
mails code --to [email protected] --timeout 60Delivery can be delayed, the sending application can use a different recipient, or the message can contain several numeric strings. The correct behavior is a visible timeout or an auditable match, not a guessed value.
Retries also need idempotency. A browser test may request two codes, making the first one stale. Query by recipient, direction, timing, and sender context when the upstream product makes those fields available.
| Runtime | Recommended surface | Typical assertion |
|---|---|---|
| Shell or coding agent | mails code | Command exits with the expected code before timeout. |
| MCP-compatible assistant | wait_for_code tool | Tool returns a code from the scoped mailbox. |
| Python test suite | Python SDK | Await a code and compare it with the UI state. |
| Browser automation | CLI or HTTP beside Playwright | Fill the code, then assert verified navigation or UI. |
| Custom service | HTTP API and webhook | Record message identity and process the code in application logic. |
Product behavior is verified against the mails0 source and documentation. External comparisons link to official vendor documentation checked on 2026-08-15.
Yes. Code extraction checks message subject and body content for common verification patterns and can be used through CLI, API, Python, or MCP.
Yes. The parser supports common 4-8 character numeric and alphanumeric verification values when they appear in recognized code contexts.
Usually no. Isolate inboxes by test boundary or clean messages deliberately so a stale code cannot satisfy a later test.
The operation should stop at a bounded timeout and expose the failure. Do not silently guess a code or continue the browser flow.
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.