Disposable Email
Create and read temporary Mail.tm inboxes for testing email flows.
Use bundled scripts
-
python3 scripts/create_inbox.py
- Returns JSON with
address,
password,
token,
accountId,
domain.
- INLINECODE6
- INLINECODE7
- - Wait for OTP from incoming mail:
-
python3 scripts/read_inbox.py --token <TOKEN> --wait-otp --timeout 120 --interval 3
- Default OTP regex:
\\b(\\d{4,8})\\b
- Override regex with
--otp-regex.
- - End-to-end (create inbox + wait for first message/OTP):
-
python3 scripts/e2e_otp.py --timeout 120 --interval 3
- First line emits
inbox_created JSON (address/password/token).
- Then emits one of:
otp_found,
message_received_no_otp, or
timeout.
- Add
--save ./otp-result.json to persist the latest emitted result to disk.
Workflow
- 1. Run
create_inbox.py and share the generated email address. - Trigger email delivery to that address.
- Poll with
read_inbox.py (--latest or --wait-otp). - Return sender, subject, createdAt, and message text/OTP.
Notes
- - Free temp domains can be blocked by some production services.
- Keep token private; treat it like mailbox access credentials.
- Prefer stable paid inbox providers for CI if reliability is critical.
一次性邮箱
创建和读取临时的Mail.tm收件箱,用于测试邮件流程。
使用内置脚本
- python3 scripts/create_inbox.py
- 返回包含address、password、token、accountId、domain的JSON数据。
- python3 scripts/read_inbox.py --token
--list
- python3 scripts/read_inbox.py --token --latest
- python3 scripts/read_inbox.py --token --wait-otp --timeout 120 --interval 3
- 默认OTP正则表达式:\\b(\\d{4,8})\\b
- 使用--otp-regex覆盖正则表达式。
- - 端到端(创建收件箱 + 等待第一条消息/OTP):
- python3 scripts/e2e_otp.py --timeout 120 --interval 3
- 第一行输出inbox_created JSON(包含address/password/token)。
- 随后输出以下之一:otpfound、messagereceivednootp或timeout。
- 添加--save ./otp-result.json将最新输出结果持久化到磁盘。
工作流程
- 1. 运行createinbox.py并分享生成的邮箱地址。
- 触发邮件发送到该地址。
- 使用readinbox.py轮询(--latest或--wait-otp)。
- 返回发件人、主题、创建时间以及邮件正文/OTP。
注意事项
- - 免费临时域名可能被某些生产服务屏蔽。
- 请保密令牌;将其视为邮箱访问凭证。
- 如果可靠性至关重要,建议在CI中使用稳定的付费收件箱提供商。