Email Validator
Local skill by Claw0x — runs entirely in your OpenClaw agent.
Validate email addresses for format correctness and assess risk level. Pure local logic processing with no external API calls.
Runs locally. No external API calls, no API key required. Complete privacy.
Prerequisites
None. Just install and use.
Quick Reference
| When This Happens | Do This | What You Get |
|---|
| User provides email | Validate format | Valid/invalid + risk score |
| Check disposable email |
Run validation | Disposable domain detection |
| Bulk email validation | Loop through list | Format check for each |
| Pre-filter signups | Validate before save | Risk score assessment |
5-Minute Quickstart
Step 1: Install (30 seconds)
CODEBLOCK0
Step 2: Use (1 minute)
CODEBLOCK1
Step 3: Get Result (instant)
CODEBLOCK2
How It Works — Under the Hood
100% local processing. Zero external API calls. Complete privacy.
This skill runs entirely in your agent's environment using pure TypeScript logic. All validation happens locally using:
- - Regular expressions for format checking
- String operations for domain extraction
- Array lookups against built-in domain lists
- Simple arithmetic for risk scoring
Step 1: Local Format Validation (RFC 5322)
Uses a regex pattern to check email structure locally:
- - Local part (before
@): 1-64 characters, alphanumeric, dots, hyphens, underscores, plus signs - Domain part (after
@): Valid hostname with TLD - Total length: 3-254 characters
No network calls. Pure string matching.
Step 2: Local Domain Analysis
Compares the extracted domain against built-in lists (stored in code):
- - Disposable domains list: 10+ known providers (mailinator.com, guerrillamail.com, etc.)
- Free providers list: 8+ common providers (gmail.com, yahoo.com, etc.)
- Corporate domains: Anything not in the above lists
No DNS lookups. Pure array lookups.
Step 3: Local Risk Scoring
Calculates risk score using simple arithmetic:
| Factor | Risk Impact |
|---|
| Invalid format | +90 (instant high risk) |
| Disposable domain |
+70 |
| All-number local part | +30 |
| Very short local part (<3 chars) | +20 |
| Free email provider | +10 |
| Valid corporate domain | +10 (baseline) |
No external scoring API. Pure math.
Lower score = safer email.
What This Skill Does NOT Do
- - No SMTP verification: Doesn't connect to mail server
- No DNS MX lookup: Doesn't verify mail exchange records
- No deliverability check: Can't predict if email will bounce
This is by design. The skill is optimized for speed, determinism, and zero external dependencies.
Real-World Use Cases
Scenario 1: Signup Form Validation
Problem: Filter out fake emails during registration
Solution: Validate format and check disposable domains
Example:
CODEBLOCK3
Scenario 2: Bulk Email List Cleaning
Problem: Clean email list before campaign
Solution: Validate all emails and remove invalid ones
Example:
CODEBLOCK4
Scenario 3: B2B Lead Qualification
Problem: Prioritize corporate emails over free providers
Solution: Use risk score to rank leads
Example:
CODEBLOCK5
Integration Recipes
OpenClaw Agent
CODEBLOCK6
LangChain Agent
CODEBLOCK7
Custom Agent
CODEBLOCK8
Input Schema
| Field | Type | Required | Description |
|---|
| INLINECODE2 | string | yes | Email address to validate (3-254 chars) |
Output Schema
CODEBLOCK9
Error Handling
| Error | Cause | Solution |
|---|
| INLINECODE3 | No email provided | Provide email in input |
| INLINECODE4 |
Email too short/long | Check email length |
About Claw0x
This skill is provided by Claw0x, the native skills layer for AI agents.
Cloud version available: For users who need centralized analytics, a cloud version is available at claw0x.com/skills/validate-email.
Explore more skills: claw0x.com/skills
GitHub: github.com/kennyzir/validate-email
邮箱验证器
由Claw0x提供的本地技能 — 完全在您的OpenClaw代理中运行。
验证电子邮件地址的格式正确性并评估风险等级。纯本地逻辑处理,无需外部API调用。
本地运行。 无需外部API调用,无需API密钥。完全隐私保护。
前置条件
无。 安装即可使用。
快速参考
| 触发条件 | 执行操作 | 返回结果 |
|---|
| 用户提供邮箱 | 验证格式 | 有效/无效 + 风险评分 |
| 检查一次性邮箱 |
运行验证 | 检测一次性域名 |
| 批量邮箱验证 | 循环处理列表 | 逐一检查格式 |
| 注册前预过滤 | 保存前验证 | 风险评估 |
5分钟快速上手
第一步:安装(30秒)
bash
openclaw skills install email-validator
第二步:使用(1分钟)
typescript
const result = await agent.run(email-validator, {
email: user@example.com
});
console.log(result.valid); // true/false
console.log(result.risk_score); // 10-100
第三步:获取结果(即时)
json
{
valid: true,
email: user@example.com,
checks: {
format_valid: true,
domain: example.com,
local_part: user,
is_disposable: false
},
risk_score: 10,
suggestion: null
}
工作原理 — 底层机制
100%本地处理。零外部API调用。完全隐私保护。
该技能完全在您的代理环境中使用纯TypeScript逻辑运行。所有验证均在本地完成,使用:
- - 正则表达式进行格式检查
- 字符串操作提取域名
- 对内置域名列表进行数组查找
- 简单算术进行风险评分
第一步:本地格式验证(RFC 5322)
使用正则表达式模式在本地检查邮箱结构:
- - 本地部分(@之前):1-64个字符,字母数字、点号、连字符、下划线、加号
- 域名部分(@之后):带有顶级域名的有效主机名
- 总长度:3-254个字符
无网络调用。纯字符串匹配。
第二步:本地域名分析
将提取的域名与内置列表(存储在代码中)进行比较:
- - 一次性域名列表:10+个已知提供商(mailinator.com、guerrillamail.com等)
- 免费提供商列表:8+个常见提供商(gmail.com、yahoo.com等)
- 企业域名:不在上述列表中的任何域名
无DNS查询。纯数组查找。
第三步:本地风险评分
使用简单算术计算风险评分:
| 因素 | 风险影响 |
|---|
| 无效格式 | +90(即时高风险) |
| 一次性域名 |
+70 |
| 全数字本地部分 | +30 |
| 本地部分过短(<3个字符) | +20 |
| 免费邮箱提供商 | +10 |
| 有效企业域名 | +10(基准值) |
无外部评分API。纯数学计算。
分数越低 = 邮箱越安全。
该技能不执行的操作
- - 无SMTP验证:不连接邮件服务器
- 无DNS MX查询:不验证邮件交换记录
- 无投递性检查:无法预测邮件是否会退回
这是有意设计的。该技能针对速度、确定性和零外部依赖进行了优化。
实际应用场景
场景1:注册表单验证
问题:在注册过程中过滤虚假邮箱
解决方案:验证格式并检查一次性域名
示例:
typescript
const result = await agent.run(email-validator, {
email: test@mailinator.com
});
if (result.risk_score > 70) {
console.log(检测到一次性邮箱);
}
场景2:批量邮箱列表清理
问题:在营销活动前清理邮箱列表
解决方案:验证所有邮箱并移除无效邮箱
示例:
typescript
const emails = [user1@example.com, invalid@, user2@gmail.com];
const results = await Promise.all(
emails.map(email => agent.run(email-validator, { email }))
);
const validEmails = results
.filter(r => r.valid && r.risk_score < 50)
.map(r => r.email);
场景3:B2B线索资格认定
问题:优先处理企业邮箱而非免费提供商
解决方案:使用风险评分对线索进行排序
示例:
typescript
const result = await agent.run(email-validator, {
email: ceo@company.com
});
// 企业域名 = 低风险评分(10-20)
// 免费提供商 = 中等风险(20-30)
// 一次性邮箱 = 高风险(80-100)
集成方案
OpenClaw代理
typescript
import { Claw0xClient } from @claw0x/sdk;
const claw0x = new Claw0xClient(process.env.CLAW0XAPIKEY);
agent.onUserInput(async (input) => {
if (input.includes(@)) {
const result = await claw0x.call(email-validator, {
email: input
});
if (!result.valid) {
return 无效的邮箱格式;
}
if (result.checks.is_disposable) {
return 不允许使用一次性邮箱;
}
}
});
LangChain代理
python
from claw0x import Claw0xClient
client = Claw0xClient(apikey=os.environ[CLAW0XAPI_KEY])
def validate_email(email: str) -> dict:
result = client.call(email-validator, {email: email})
return result
在链中使用
email = user@example.com
validation = validate_email(email)
if validation[valid]:
print(f邮箱有效,风险评分:{validation[risk_score]})
自定义代理
javascript
const response = await fetch(https://api.claw0x.com/v1/call, {
method: POST,
headers: {
Authorization: Bearer ${process.env.CLAW0X
APIKEY},
Content-Type: application/json
},
body: JSON.stringify({
skill: email-validator,
input: { email: test@example.com }
})
});
const result = await response.json();
console.log(result);
输入模式
| 字段 | 类型 | 必填 | 描述 |
|---|
| email | 字符串 | 是 | 要验证的邮箱地址(3-254个字符) |
输出模式
typescript
{
valid: boolean; // 邮箱格式是否有效
email: string; // 标准化(小写)后的邮箱
checks: {
format_valid: boolean; // RFC格式检查结果
domain: string; // 提取的域名
local_part: string; // 提取的本地部分(@之前)
is_disposable: boolean; // 域名是否为一次性域名
};
risk_score: number; // 风险评分(10 = 低,90 = 高)
suggestion: string | null; // 如果无效,提供建议
}
错误处理
| 错误 | 原因 | 解决方案 |
|---|
| 缺少必填字段:email | 未提供邮箱 | 在输入中提供邮箱 |
| email长度必须在3到254个字符之间 |
邮箱过短或过长 | 检查邮箱长度 |
关于Claw0x
该技能由Claw0x提供,是AI代理的原生技能层。
云端版本可用:对于需要集中分析的用户,云端版本可在claw0x.com/skills/validate-email获取。
探索更多技能:claw0x.com/skills
GitHub:github.com/kennyzir/validate-email