Email Verifier
Verify whether email addresses are deliverable by connecting to the recipient's mail server and checking if it accepts the address — without actually sending any mail.
How It Works
- 1. MX Lookup — Resolves the domain's mail exchange server
- SMTP Handshake — Connects to the MX server on port 25
- RCPT TO Check — Asks the server if it would accept mail for the address
- Catch-All Detection — Tests a random address to detect catch-all domains
Dependencies
CODEBLOCK0
Usage
Single or multiple emails
CODEBLOCK1
From stdin
CODEBLOCK2
From CSV (e.g., a lead list)
CODEBLOCK3
Options
- -
--helo DOMAIN — HELO domain for SMTP greeting (default: verify.local) - INLINECODE1 — Connection timeout (default: 10)
Output
JSON array to stdout. Each result contains:
CODEBLOCK4
Deliverability values
| Value | Meaning |
|---|
| INLINECODE2 | Server accepted the recipient |
| INLINECODE3 |
Server rejected the recipient (invalid) |
|
catch-all | Server accepts all addresses — cannot confirm inbox exists |
|
unknown | Could not determine (timeout, block, greylisting) |
Rate Limiting
The script includes built-in rate limiting to protect your IP reputation:
CODEBLOCK5
Options
- -
--delay SECONDS — Pause between each check (default: 1.0) - INLINECODE7 — Max checks to one domain before pausing (default: 20)
- INLINECODE8 — How long to pause after hitting the per-domain limit (default: 30)
Why rate limiting matters
SMTP verification connects directly to mail servers. Without rate limiting:
- - Your IP gets blacklisted — Mail servers (especially Gmail, Microsoft) flag IPs that make many rapid RCPT TO requests. Once flagged, your IP may be blocked for hours or permanently.
- Port 25 gets blocked — ISPs monitor outbound port 25 traffic. Unusual volume can trigger automatic blocks.
- Greylisting increases — Servers that see rapid-fire checks start returning temporary failures, making your results less accurate.
- It looks like spam reconnaissance — Because that's exactly what spammers do. Legitimate use requires responsible pacing.
Guidelines for agents
| Scenario | Recommended settings |
|---|
| Quick spot check (1-5 emails) | Defaults are fine |
| Small lead list (10-50 emails) |
--delay 2 --max-per-domain 15 |
| Larger batch (50-200 emails) |
--delay 3 --max-per-domain 10 --burst-pause 60 |
| Bulk verification (200+) | Use a dedicated service (ZeroBounce, NeverBounce) instead |
Rule of thumb: Stay under 50 unique domain checks per day from a residential IP. For repeated checks to the same domain (pattern guessing), stay under 15 per session.
Limitations
- - Catch-all domains accept all addresses; a "yes" doesn't guarantee a real inbox
- Some servers block SMTP verification (disconnect or timeout) — result will be "unknown"
- Greylisting temporarily rejects first attempts by design
- Rate limiting — don't bulk-verify hundreds from one IP; use a dedicated service for large lists
- Port 25 blocked — some ISPs/networks block outbound port 25; won't work from those environments
- Residential IPs may get flagged if used heavily — for bulk verification, prefer services like ZeroBounce or NeverBounce
电子邮件验证器
通过连接收件人的邮件服务器并检查其是否接受该地址来验证电子邮件地址是否可投递——无需实际发送任何邮件。
工作原理
- 1. MX 查询 — 解析域名的邮件交换服务器
- SMTP 握手 — 通过端口 25 连接到 MX 服务器
- RCPT TO 检查 — 询问服务器是否接受该地址的邮件
- 全能邮箱检测 — 测试随机地址以检测全能域名
依赖项
bash
pip3 install dnspython
使用方法
单个或多个电子邮件
bash
python3 scripts/verify_email.py user@example.com another@domain.com
从标准输入读取
bash
echo user@example.com | python3 scripts/verify_email.py --stdin
从 CSV 文件读取(例如潜在客户列表)
bash
python3 scripts/verify_email.py --csv leads.csv --email-column Contact Email
选项
- - --helo DOMAIN — SMTP 问候的 HELO 域名(默认:verify.local)
- --timeout SECONDS — 连接超时时间(默认:10)
输出
输出到标准输出的 JSON 数组。每个结果包含:
json
{
email: user@example.com,
domain: example.com,
mx_host: aspmx.l.google.com,
smtp_code: 250,
smtp_response: 2.1.5 OK,
deliverable: yes
}
可投递性值
服务器拒绝了收件人(无效) |
| catch-all | 服务器接受所有地址——无法确认收件箱是否存在 |
| unknown | 无法确定(超时、阻止、灰名单) |
速率限制
该脚本包含内置的速率限制以保护您的 IP 声誉:
bash
默认值:每次检查间隔 1 秒,每个域名最多 20 次后暂停 30 秒
python3 scripts/verify_email.py --csv leads.csv --email-column Contact Email
保守模式:较慢的检查,较低的突发限制
python3 scripts/verify_email.py --delay 3 --max-per-domain 10 --burst-pause 60 email@example.com
激进模式(不建议从住宅 IP 使用)
python3 scripts/verify_email.py --delay 0.5 --max-per-domain 50 email@example.com
选项
- - --delay SECONDS — 每次检查之间的暂停时间(默认:1.0)
- --max-per-domain N — 暂停前对单个域名的最大检查次数(默认:20)
- --burst-pause SECONDS — 达到每域名限制后的暂停时长(默认:30)
为什么速率限制很重要
SMTP 验证直接连接到邮件服务器。如果没有速率限制:
- - 您的 IP 会被列入黑名单 — 邮件服务器(尤其是 Gmail、Microsoft)会对发出大量快速 RCPT TO 请求的 IP 进行标记。一旦被标记,您的 IP 可能会被阻止数小时或永久阻止。
- 端口 25 会被封锁 — ISP 会监控出站端口 25 的流量。异常流量可能触发自动封锁。
- 灰名单增加 — 看到快速检查的服务器会开始返回临时失败,使您的结果准确度降低。
- 看起来像垃圾邮件侦察 — 因为这正是垃圾邮件发送者所做的。合法使用需要负责任的节奏控制。
代理指南
| 场景 | 推荐设置 |
|---|
| 快速抽查(1-5 封邮件) | 默认设置即可 |
| 小型潜在客户列表(10-50 封邮件) |
--delay 2 --max-per-domain 15 |
| 较大批次(50-200 封邮件) | --delay 3 --max-per-domain 10 --burst-pause 60 |
| 批量验证(200 封以上) | 改用专用服务(ZeroBounce、NeverBounce) |
经验法则: 从住宅 IP 每天保持少于 50 次不同域名的检查。对于对同一域名的重复检查(模式猜测),每次会话保持少于 15 次。
局限性
- - 全能域名 接受所有地址;是并不保证存在真实的收件箱
- 某些服务器会阻止 SMTP 验证(断开连接或超时)——结果将为未知
- 灰名单 会按设计临时拒绝首次尝试
- 速率限制 — 不要从一个 IP 批量验证数百个地址;对于大型列表请使用专用服务
- 端口 25 被封锁 — 某些 ISP/网络会封锁出站端口 25;在这些环境中无法工作
- 住宅 IP 如果被大量使用可能会被标记——对于批量验证,建议使用 ZeroBounce 或 NeverBounce 等服务