Skip to content

新增 mailly inbox wait:等新邮件并提取验证码或验证链接 - #6

Merged
fatwang2 merged 2 commits into
mainfrom
claude/project-thread-ul99i1
Oct 16, 2026
Merged

fatwang2 merged 2 commits into
mainfrom
claude/project-thread-ul99i1

Conversation

@fatwang2

Copy link
Copy Markdown
Member

Requested by fatwang2 · project thread

Before: an agent that signs up for a service with its Mailly inbox has to poll mailly inbox itself, open each message and dig the code or link out of the body.

After: mailly inbox wait --from github.com --extract code (shortcut mailly wait) blocks until matching mail arrives and prints just the code; --extract link prints the verification or magic sign-in link. --json gives {message_id, thread_id, from, to, subject, received_at, code|link}.

This is item 1 of FAT-1946, from the AgentMail / Botmail competitor research (Botmail ships the same thing as botmail wait).

How: polls the existing GET /inbox/messages with a since filter and reads matching messages via GET /inbox/messages/{id}/content; no new server endpoints. Filters --from (address, domain incl. subdomains, lookalikes rejected), --subject, --to, --address-id; --timeout (default 5m), --since (default now), --interval (default 3s). Exit codes: 0 found, 1 error, 2 timeout, 3 matching mail had no code or link. Transient 408/429/5xx/network errors back off and keep polling. Extraction is a pure src/extract.ts (codes near code/OTP/验证码, skips URLs, order/phone numbers, amounts, dates; links prefer verify/confirm/sign-in and skip unsubscribe, tracking, policy and social links); it never opens links. README, docs/commands.zh-CN.md, the public skill and its command reference are updated. 20 new tests; all 70 pass.

Known limits: default --since now misses mail delivered before the command starts (docs tell agents to pass --since 2m); quarantined mail isn't searched; letter-only codes and full-width digits aren't extracted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HjPcxjooCvPfcAniZ32im5


Generated by Claude Code

`mailly inbox wait` (shortcut `mailly wait`) polls the existing
GET /inbox/messages list with a since filter until a matching inbound
message arrives, then prints it, or with --extract only the one-time
code or the verification / magic sign-in link it contains.

- Filters: --from (address, domain incl. subdomains, or name part),
  --subject, --to, --address-id. The server narrows with fuzzy search;
  exact rules are applied client-side, so lookalike domains never match.
- --timeout (default 5m), --since (default now; durations, dates, ISO
  8601 or Unix seconds), --interval (default 3s, min 1s).
- Text mode prints just the value; --json prints {success, message_id,
  thread_id, from, to, subject, received_at, code|link}.
- Exit codes: 2 on timeout, 3 when matching mail had no code or link.
  Transient API errors (408/429/5xx/network) back off and keep polling.
- Extraction lives in a pure src/extract.ts module: codes prefer 4-8
  digit or uppercase alphanumeric tokens near code/OTP/验证码 and skip
  URLs, order/invoice/phone numbers, amounts and dates; links prefer
  verify/confirm/sign-in links and skip unsubscribe, tracking, policy
  and social links. Email content is only read, never acted on.
- Docs: README, docs/commands.zh-CN.md, the public skill and its
  command reference.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HjPcxjooCvPfcAniZ32im5
@fatwang2 fatwang2 self-assigned this Oct 15, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HjPcxjooCvPfcAniZ32im5
@fatwang2
fatwang2 marked this pull request as ready for review October 16, 2026 13:48
@fatwang2
fatwang2 merged commit d3ce4cf into main Oct 16, 2026
3 checks passed
@fatwang2 fatwang2 mentioned this pull request Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants