Repository navigation
新增 mailly inbox wait:等新邮件并提取验证码或验证链接 - #6
Merged
Merged
Conversation
`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
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HjPcxjooCvPfcAniZ32im5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by fatwang2 · project thread
Before: an agent that signs up for a service with its Mailly inbox has to poll
mailly inboxitself, open each message and dig the code or link out of the body.After:
mailly inbox wait --from github.com --extract code(shortcutmailly wait) blocks until matching mail arrives and prints just the code;--extract linkprints the verification or magic sign-in link.--jsongives{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/messageswith asincefilter and reads matching messages viaGET /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 puresrc/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 nowmisses 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