Correct mailbox
Use a dedicated or explicitly bound recipient so unrelated messages are outside the result set.
Match the correct message first, then parse the code with context and a bounded timeout.
Bind a dedicated inbox, record when the OTP request was triggered, wait for a new inbound message to that recipient, validate expected sender context, and parse a code near verification keywords or delimiters. Reject stale messages, dates, and ambiguous candidates. With mails0, use mails code, the HTTP endpoint, Python SDK, or MCP wait_for_code tool.
Select the message before selecting the code
Use a dedicated or explicitly bound recipient so unrelated messages are outside the result set.
Ignore messages before the OTP request and stop at a deadline.
Use sender, subject, direction, and verification language before parsing candidate strings.
Use a dedicated or explicitly bound recipient so unrelated messages are outside the result set.
Ignore messages before the OTP request and stop at a deadline.
Use sender, subject, direction, and verification language before parsing candidate strings.
Record recipient and start time immediately before the application call.
Poll or subscribe under the scoped mailbox with a bounded timeout.
Prefer candidates near code keywords and explicit delimiters; reject date-like numeric strings.
Use the code, assert success, and separately test expiry and replay behavior.
mails code --to [email protected] --timeout 60Verification messages often contain dates, account numbers, order numbers, support phone numbers, and footer text. A robust parser uses context and retains the selected message identity for debugging.
If several plausible candidates remain, return an explicit ambiguity error or narrow the query rather than guessing. The application can then request a new code or escalate.
| Environment | Interface | Result handling |
|---|---|---|
| Shell or coding agent | mails code | Use exit status and stdout only in the scoped task. |
| MCP assistant | wait_for_code | Return structured tool result without key exposure. |
| Python test | SDK method | Await typed result and assert application state. |
| Backend service | HTTP plus event handling | Persist message ID and processing state idempotently. |
Product behavior is verified against the mails0 source and documentation. External comparisons link to official vendor documentation checked on 2026-08-15.
Yes. Some services use alphanumeric codes. Configure or choose a parser that supports the formats your applications send.
Require verification context, reject common year and date patterns, and test the parser against real product templates.
Narrow by sender, time, subject, or message identity. If ambiguity remains, fail explicitly instead of guessing.
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.