diff --git a/README.md b/README.md index 448863c..eba8d45 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ In order of precedence: | `login`, `logout`, `whoami` | Sign in with the browser or an API key, and check the current account | | `balance`, `logs` | Usage balance and consumption logs | | `send`, `status` | Send email; multi-recipient sends and campaigns are queued and return a task ID | -| `inbox` | Inbox addresses, threads, message content, replies, attachments, and inbox webhooks | +| `inbox` | Inbox addresses, threads, message content, waiting for verification codes and links, replies, attachments, and inbox webhooks | | `outbox`, `delivery-events`, `webhooks` | Per-recipient sent messages, delivery events, and signed delivery webhooks | | `drafts`, `agents` | Drafts for human review, hosted agent profiles and skills, agent runs, and approving or discarding agent drafts | | `templates`, `workflows`, `events` | Versioned templates and lifecycle workflows triggered by events | @@ -82,9 +82,42 @@ In order of precedence: The full command reference (Chinese) is in [docs/commands.zh-CN.md](docs/commands.zh-CN.md). +## Wait for a verification code + +`mailly inbox wait` (shortcut: `mailly wait`) polls the inbox until a matching message arrives, then prints it, or with `--extract` only the one-time code or verification link inside it: + +```bash +# Prints just the code, e.g. 482913 +mailly inbox wait --from github.com --extract code --timeout 5m + +# Prints the verification or magic sign-in link; unsubscribe, tracking and policy links are skipped +mailly inbox wait --from noreply@example.com --subject "Confirm" --extract link + +# Also accept mail that arrived in the last 10 minutes +mailly inbox wait --from github.com --extract code --since 10m --json +# {"success":true,"message_id":"...","thread_id":"...","from":"noreply@github.com","to":"agent@mailly.site", +# "subject":"Your GitHub launch code","received_at":"2026-10-15T09:30:12.000Z","code":"482913"} +``` + +| Option | Meaning | +|---|---| +| `--from ` | Sender address, domain (subdomains included) or part of the sender name | +| `--subject ` | Subject contains this text (case-insensitive) | +| `--to
`, `--address-id ` | Only mail to this inbox address | +| `--extract code\|link` | Print only the code (4–8 digits, or uppercase letters and digits; separators removed) or the link | +| `--timeout ` | Give up after `30s`, `5m` (default), `1h`, ... | +| `--since