# Email Verification

> Email Verification Automation

- Skill: `lucadominguez/email-verification` (Agent Skill)
- Install (CLI): `npx skillmds@latest add lucadominguez/email-verification`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lucadominguez/email-verification/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: lucadominguez (https://skillmd.com/u/lucadominguez)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/lucadominguez/email-verification

---

# Email Verification Automation

Use when a signup/account creation flow requires email verification and you need to automate the confirmation step.

## mail.tm (Disposable Email — REST API)

Free disposable email with a REST API — much simpler than IMAP for testing:

```python
# Create account
curl -X POST "https://api.mail.tm/accounts" \
  -H "Content-Type: application/json" \
  -d '{"address": "test@wshu.net", "password": "Pass123!"}'

# Get auth token
curl -X POST "https://api.mail.tm/token" \
  -H "Content-Type: application/json" \
  -d '{"address": "test@wshu.net", "password": "Pass123!"}'

# Poll inbox, extract verification links
curl -s "https://api.mail.tm/messages" \
  -H "Authorization: Bearer $TOKEN"
```

The Python adapter is at `/mnt/c/Users/Lenovo/Desktop/skool-automation/skool_automation/mail_tm.py`. Key pattern: poll every 5s, extract any link containing `verify`, `confirm`, `activate`, `token`, or `magic`. mail.tm domains rotate — always check `https://api.mail.tm/domains` first for the current valid domain.

## IMAP Polling (Gmail / Custom Domains)

For persistent email addresses (Gmail with App Password, custom domains with catch-all):

```python
import imaplib, email, re

mail = imaplib.IMAP4_SSL("imap.gmail.com")
mail.login(email_addr, app_password)
mail.select("inbox")
_, messages = mail.search(None, "ALL")

for msg_id in messages[0].split()[::-1][:10]:  # Last 10 messages
    _, msg_data = mail.fetch(msg_id, "(RFC822)")
    msg = email.message_from_bytes(msg_data[0][1])
    body = get_email_body(msg)
    codes = re.findall(r'\b(\d{6})\b', body)  # 6-digit codes
    if codes:
        return codes[0]
```

## Email Verification Code Polling

After submitting a signup, detect what verification the platform uses:

```python
content = page.content().lower()

# CODE-based verification (Skool, many modern platforms)
if "verification code" in content or "we sent you a code" in content:
    code = poll_email_for_code(email, password, imap_server)
    # Extract 6-digit (or 4-digit) code from email

# LINK-based verification (older platforms)
elif "verify your email" in content:
    link = poll_email_for_link(email, password, imap_server)
    page.goto(link)
```

## Pitfalls

- **Email verification**: Most platforms send verification emails. Use IMAP to auto-extract links. For Gmail, generate an App Password (not your regular password). For custom domains with catch-all, use one IMAP account that receives all mail.
- **Rate limiting**: Don't create accounts or communities back-to-back. Add 10-30 second cooldowns with jitter between operations.
