← 返回
未分类 中文

validate email

Validate email addresses with format checking and risk scoring. Use when users need to verify email format, check disposable emails, or validate bulk email l...
{ "answer": "通过格式检查和风险评分验证电子邮件地址。适用于验证邮件格式、检查一次性邮件或批量验证邮件列表。" }
kennyzir
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 381
下载
💾 0
安装
1
版本
#latest

概述

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)

openclaw skills install email-validator

Step 2: Use (1 minute)

const result = await agent.run('email-validator', {
  email: 'user@example.com'
});

console.log(result.valid); // true/false
console.log(result.risk_score); // 10-100

Step 3: Get Result (instant)

{
  "valid": true,
  "email": "user@example.com",
  "checks": {
    "format_valid": true,
    "domain": "example.com",
    "local_part": "user",
    "is_disposable": false
  },
  "risk_score": 10,
  "suggestion": null
}

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:

const result = await agent.run('email-validator', {
  email: 'test@mailinator.com'
});

if (result.risk_score > 70) {
  console.log('Disposable email detected');
}

Scenario 2: Bulk Email List Cleaning

Problem: Clean email list before campaign

Solution: Validate all emails and remove invalid ones

Example:

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);

Scenario 3: B2B Lead Qualification

Problem: Prioritize corporate emails over free providers

Solution: Use risk score to rank leads

Example:

const result = await agent.run('email-validator', {
  email: 'ceo@company.com'
});

// Corporate domain = low risk score (10-20)
// Free provider = medium risk (20-30)
// Disposable = high risk (80-100)

Integration Recipes

OpenClaw Agent

import { Claw0xClient } from '@claw0x/sdk';

const claw0x = new Claw0xClient(process.env.CLAW0X_API_KEY);

agent.onUserInput(async (input) => {
  if (input.includes('@')) {
    const result = await claw0x.call('email-validator', {
      email: input
    });
    
    if (!result.valid) {
      return 'Invalid email format';
    }
    
    if (result.checks.is_disposable) {
      return 'Disposable email not allowed';
    }
  }
});

LangChain Agent

from claw0x import Claw0xClient

client = Claw0xClient(api_key=os.environ['CLAW0X_API_KEY'])

def validate_email(email: str) -> dict:
    result = client.call('email-validator', {'email': email})
    return result

# Use in chain
email = "user@example.com"
validation = validate_email(email)
if validation['valid']:
    print(f"Email is valid with risk score: {validation['risk_score']}")

Custom Agent

const response = await fetch('https://api.claw0x.com/v1/call', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.CLAW0X_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    skill: 'email-validator',
    input: { email: 'test@example.com' }
  })
});

const result = await response.json();
console.log(result);

Input Schema

| Field | Type | Required | Description |

|-------|------|----------|-------------|

| email | string | yes | Email address to validate (3-254 chars) |

Output Schema

{
  valid: boolean;              // Whether email format is valid
  email: string;               // Normalized (lowercased) email
  checks: {
    format_valid: boolean;     // RFC format check result
    domain: string;            // Extracted domain
    local_part: string;        // Extracted local part (before @)
    is_disposable: boolean;    // Whether domain is disposable
  };
  risk_score: number;          // Risk score (10 = low, 90 = high)
  suggestion: string | null;   // Suggestion if invalid
}

Error Handling

| Error | Cause | Solution |

|-------|-------|----------|

| Missing required field: email | No email provided | Provide email in input |

| email must be between 3 and 254 characters | 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

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-31 17:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

AI Text Humanizer

kennyzir
通过 Claw0x API 去除文本中的 AI 生成痕迹。当用户要求让文本更人性化、使 AI 写作更自然、消除 AI 模式时使用。
★ 0 📥 674
data-analysis

Capability Evolver

kennyzir
用于AI智能体自我改进的元技能。分析运行日志以检测错误模式、回归和低效问题,随后生成结构化改进方案。
★ 32 📥 13,866

security scanner

kennyzir
扫描AI智能体技能中的安全漏洞、危险代码模式和未声明权限。三层分析:依赖项CVE扫描、静态代码分析...
★ 0 📥 689