微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📧

临时邮箱与OTP自动提取专家

Email OTP · v1.0.0
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
效率 安全 B 级 作者 etopro 公开目录收录
754 下载 0 安装 2.8k 收藏 4 浏览

简介

基于mail.tm免费API的临时邮箱生成与OTP验证码自动监控工具,无需API密钥,支持自定义域名与智能链接过滤。

原始描述

Create temporary email addresses and monitor for registration OTP codes or validation links

通过你的 Agent 添加

安装目录:email-otp/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/email-otp/
Codex CLI~/.codex/skills/email-otp/
DeepSeek Harness~/.agents/skills/email-otp/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

Email OTP Skill 是一款专注于临时邮箱服务与OTP(一次性密码)自动提取的实用工具。该技能通过调用 mail.tm 的免费REST API,为用户提供完整的临时邮箱生命周期管理能力,涵盖账户创建、邮箱监控、验证码提取三大核心场景。

用户可通过简洁的CLI命令快速创建临时邮箱地址,系统支持自定义域名选择和密码配置。创建完成后,用户即可将该邮箱用于各类服务的注册验证流程。监控模式支持最长5分钟(可配置)的轮询等待,自动识别邮件内容中的6-8位数字验证码,同时智能过滤退订链接、追踪像素等无关内容,提取有效的验证链接。

状态管理采用统一目录设计(~/.tempmail_otp/),所有敏感凭证以0600权限存储,确保JWT令牌和账户信息的安全性。跨会话持久化设计允许用户在任何工作目录下调用历史账户,无需重复创建。

显著优点

零成本快速启动:mail.tm API完全免费,无需注册或API密钥,降低了使用门槛。

智能内容识别:内置多格式OTP检测正则(6-8位数字、code/verification/otp前缀格式),覆盖主流服务商的验证码发送模式。

精细化过滤控制:支持按发件人、邮件主题进行过滤,避免垃圾邮件干扰;自定义正则参数满足特殊场景需求。

安全状态隔离:统一状态目录避免项目污染,权限控制符合CLI工具安全最佳实践。

自动化工作流:--once参数支持单次提取后立即退出,便于集成到自动化脚本或CI/CD流程。

潜在缺点与局限性

服务可用性依赖:完全依赖mail.tm第三方服务,若API发生变更或停用,技能将失效。临时邮箱本身存在不稳定性,部分平台会主动屏蔽临时域名。

OTP识别覆盖率:预设正则无法覆盖所有验证码格式(如字母数字混合、图形验证码),极端场景需手动提供--pattern参数。

隐私与合规风险:临时邮箱不适合接收敏感个人信息,部分服务条款明确禁止临时邮箱注册,存在账户封禁风险。

单账户并发限制:同一时间仅支持监控一个邮箱,多服务并行验证需手动管理多个状态目录。

适合的目标群体

  • 开发者与测试工程师:需要批量注册测试账户、自动化E2E验证流程
  • 隐私敏感用户:不愿使用个人邮箱进行短期服务试用
  • 自动化运维人员:构建无需人工干预的账号注册流水线
  • 安全研究人员:进行邮件钓鱼、验证码机制的安全测试

使用风险

性能风险:轮询机制对mail.tm服务器产生持续请求,高频使用可能触发速率限制;默认3秒轮询间隔在超时5分钟场景下产生100次API调用。

凭证泄露风险:虽然文件权限设置为0600,但JWT令牌以明文JSON存储,多用户系统需确保主目录隔离。

依赖项风险:技能依赖Python3运行环境及requests等库,跨平台兼容性需验证;mail.tm服务位于欧盟,网络延迟可能影响国内访问体验。

数据残留风险:last_otp和last_link文件覆盖写入,历史验证码无审计日志,调试困难场景需自行重定向输出。

技能正文


name: email-otp description: Create temporary email addresses and monitor for registration OTP codes or validation links version: 1.0.0 metadata: author: etopro

Email OTP Skill

A skill for creating temporary email addresses and automatically extracting OTP codes and validation links from incoming emails. Uses the free mail.tm API (no API key required).

When to Use This Skill

Invoke this skill when the user asks to:

  • Create a temporary email address
  • Get a disposable email for signup/verification
  • Check for OTP (one-time password) codes
  • Wait for email verification links
  • Monitor an inbox for authentication codes

Quick Start

# Create a new temporary email
python3 scripts/tempmail_otp.py create

# Monitor for OTP codes (5 minute timeout)
python3 scripts/tempmail_otp.py check

# List current account and messages
python3 scripts/tempmail_otp.py list

Commands

Create Account

python3 scripts/tempmail_otp.py create [OPTIONS]

Options:

  • -e, --email ADDRESS - Custom full email address
  • -d, --domain DOMAIN - Specific domain to use
  • -p, --password PASSWORD - Account password (auto-generated if not specified)
  • --json - Output as JSON

Example:

python3 scripts/tempmail_otp.py create --domain "marcilzo.com"

Check for OTP/Links

python3 scripts/tempmail_otp.py check [OPTIONS]

Options:

  • --timeout SECONDS - Max seconds to wait (default: 300)
  • --poll SECONDS - Poll interval in seconds (default: 3)
  • --sender EMAIL - Only accept emails from this sender
  • --subject TEXT - Only accept emails with this in subject
  • --pattern REGEX - Custom regex pattern for OTP extraction
  • --once - Exit after first OTP found
  • --json - Output messages as JSON

Examples:

# Wait up to 2 minutes for OTP
python3 scripts/tempmail_otp.py check --timeout 120

# Only accept emails from noreply@example.com
python3 scripts/tempmail_otp.py check --sender "noreply@example.com"

# Exit immediately after finding OTP
python3 scripts/tempmail_otp.py check --once

List Account and Messages

python3 scripts/tempmail_otp.py list

Shows the current account details and all messages in the inbox with extracted links.

List Available Domains

python3 scripts/tempmail_otp.py domains [--json]

Output Files

When an OTP or link is found, the script automatically saves them to the unified state directory:

  • ~/.tempmail_otp/last_otp - Contains the last extracted OTP code
  • ~/.tempmail_otp/last_link - Contains the first interesting validation link found
  • ~/.tempmail_otp/account.json - Account credentials (JWT token, email, password)

All state files are stored in ~/.tempmail_otp/ with restricted permissions (0600).

OTP Detection Patterns

The script automatically detects OTP codes using these patterns:

  • 6-8 digit numbers (most common)
  • 4 digit numbers
  • "code: XXXXXX" format
  • "verification: XXXXXX" format
  • "otp: XXXXXX" format

Link Extraction

The script extracts all HTTP/HTTPS links from email HTML, filtering out:

  • Unsubscribe links
  • Tracking links
  • Image files (.png, .jpg, .gif)

State Management

All state is stored in a unified directory: ~/.tempmail_otp/

  • account.json - Account credentials and JWT token (created by create command)
  • last_otp - Most recent OTP code extracted (created by check command)
  • last_link - First validation link extracted (created by check command)

Files have restricted permissions (0600) for security. The check and list commands automatically use stored credentials.

Design Rationale

The unified state directory follows best practices for CLI tools:

  1. No project pollution - No temporary files are created in your working directory
  2. Predictable location - All state is in one place, easy to find and clean up
  3. Cross-session persistence - Works from any directory on your system
  4. Permission safety - Sensitive credentials have proper file permissions

To reset all state: rm -rf ~/.tempmail_otp/

Typical Workflow

  1. Create account - Generate a new temporary email address
  2. Use email - Provide the email during service signup
  3. Monitor inbox - Run the check command to wait for OTP/link
  4. Extract code - OTP is automatically displayed and saved to ~/.tempmail_otp/last_otp
  5. Verify - Use the OTP or link to complete verification

Example Session

# Create a temp email
$ python3 scripts/tempmail_otp.py create
Email: a3b7c9d4@marcilzo.com
Password: f8e4d2a1-1234-5678-9abc-123456789abc
Domain: marcilzo.com

Account saved to /home/user/.tempmail_otp/account.json

# In another terminal, wait for OTP
$ python3 scripts/tempmail_otp.py check --once
Monitoring: a3b7c9d4@marcilzo.com
Timeout: 300s | Poll interval: 3s
--------------------------------------------------

📧 New email from: noreply@service.com
   Subject: Your verification code

✅ OTP FOUND: 842197
OTP saved to /home/user/.tempmail_otp/last_otp
--------------------------------------------------

Error Handling

  • If email address is already taken, the script automatically retries with a new username
  • Network errors are logged and the script continues polling
  • Invalid account state prompts to recreate the account

API

This skill uses the mail.tm REST API:

  • Base URL: https://api.mail.tm
  • Authentication: JWT Bearer token
  • No API key required

Notes

  • Temporary emails may expire after inactivity periods
  • Some services may block temporary email domains
  • The script automatically handles account creation and JWT token management
  • OTP patterns cover most common formats, but custom regex can be provided via --pattern

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

automationtestingapisecurityproductivity

同类 Skill