agentleFS
puretechnycpuretechnyc/purebrain-skills/skills/development/email-verification/SKILL.md

email-verification

Skill0 starsChanged 6 months agoMITView on GitHub

Verify and clean email lists before campaigns, CRM imports, or email platform uploads. DNS/MX/syntax/disposable/role-based checks. Includes Python implementation.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify and clean email lists using multi-level checks: syntax validation, DNS/MX lookup, disposable domain detection, role-based address …

    line 13
  2. Distinctive:

    Before any cold outreach campaign push

    line 17
  3. Distinctive:

    Before CRM or list imports

    line 18
  4. Distinctive:

    Before email platform list uploads

    line 19
  5. Distinctive:

    When processing new lead lists from any source

    line 20
  6. Distinctive:

    When cleaning existing contact databases

    line 21
  7. Distinctive:

    Verify: Run the tool on the lead CSV

    line 82
  8. Distinctive:

    If port 25 is blocked on your server, the tool falls back to DNS-only mode.

    line 208
  9. Distinctive:

    No SMTP mailbox existence check (RCPT TO probe)

    line 209
  10. Distinctive:

    No catch-all domain detection

    line 210

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Email Verification

Purpose

Verify and clean email lists using multi-level checks: syntax validation, DNS/MX lookup, disposable domain detection, role-based address flagging, and typo domain correction. Ensures only deliverable addresses reach your campaign tools.

When to Use

  • Before any cold outreach campaign push
  • Before CRM or list imports
  • Before email platform list uploads
  • When processing new lead lists from any source
  • When cleaning existing contact databases

Quick Start

Single email

python3 email_verifier.py --email test@example.com

CSV batch

python3 email_verifier.py \
  --input leads.csv \
  --email-column email \
  --output leads_verified.csv \
  --workers 20

Force DNS-only (skip SMTP probe)

python3 email_verifier.py \
  --input leads.csv \
  --email-column email \
  --output results.csv \
  --workers 20 \
  --skip-smtp

Parameters

ParameterFlagDescriptionDefault
Input file--input, -iCSV file with email column(required for batch)
Email column--email-column, -cColumn name containing emailsemail
Output file--output, -oOutput CSV path{input}_verified.csv
Single email--email, -eVerify one email (no CSV needed)--
Workers--workers, -wMax concurrent threads5
Skip SMTP--skip-smtpForce DNS-only modeauto-detected

Status Meanings

StatusMeaningAction
VALIDDomain has MX records, syntax OK, not disposableSend to campaign
INVALIDDead domain, no MX/A records, disposable provider, bad syntaxRemove from list
RISKYRole-based address (info@, admin@) or A-record-only domainSeparate low-priority sequence or exclude
UNKNOWNDNS timeout or lookup failureRe-verify later or exclude

Flags (in output CSV flags column)

FlagMeaning
ROLE_BASEDAddress is a role mailbox (info@, support@, admin@, etc.)
FREE_PROVIDERGmail, Yahoo, Outlook, etc. (relevant for B2B filtering)
NO_MX_A_ONLYDomain has A record but no MX record -- may not accept mail

Standard Workflow

  1. Verify: Run the tool on the lead CSV
  2. Split by status:
    • VALID -- push to primary campaign sequence
    • RISKY -- push to separate low-priority sequence, or exclude
    • INVALID -- remove entirely
    • UNKNOWN -- re-verify in next batch or exclude
  3. Push: Upload clean list to your email platform or CRM

Implementation

import dns.resolver
import re
import csv
import concurrent.futures
from datetime import datetime, timezone

# Disposable domain blocklist (subset -- expand as needed)
DISPOSABLE_DOMAINS = {
    'mailinator.com', 'guerrillamail.com', 'tempmail.com', 'throwaway.email',
    'yopmail.com', 'sharklasers.com', 'grr.la', 'guerrillamailblock.com',
    'pokemail.net', 'spam4.me', 'trashmail.com', 'dispostable.com',
    # Add 70+ more as needed
}

# Role-based prefixes
ROLE_PREFIXES = {
    'info', 'admin', 'support', 'sales', 'contact', 'help', 'billing',
    'accounts', 'webmaster', 'postmaster', 'abuse', 'noreply', 'no-reply',
    'team', 'office', 'hello', 'careers', 'jobs', 'press', 'media',
    'marketing', 'security', 'privacy', 'compliance', 'legal', 'hr',
    'feedback', 'inquiries', 'enquiries', 'service', 'orders',
}

# Free email providers
FREE_PROVIDERS = {
    'gmail.com', 'yahoo.com', 'outlook.com', 'hotmail.com', 'aol.com',
    'icloud.com', 'protonmail.com', 'mail.com', 'zoho.com', 'yandex.com',
}

# Common typo corrections
TYPO_DOMAINS = {
    'gmial.com': 'gmail.com', 'gmai.com': 'gmail.com', 'gamil.com': 'gmail.com',
    'gmali.com': 'gmail.com', 'gmal.com': 'gmail.com', 'gnail.com': 'gmail.com',
    'yahooo.com': 'yahoo.com', 'yaho.com': 'yahoo.com',
    'outlok.com': 'outlook.com', 'outloo.com': 'outlook.com',
    'hotmal.com': 'hotmail.com', 'hotmial.com': 'hotmail.com',
}

def verify_email(email: str) -> dict:
    """Verify a single email address."""
    email = email.strip().lower()
    result = {
        'email': email,
        'status': 'UNKNOWN',
        'reason': '',
        'mx_host': '',
        'flags': [],
        'checked_at': datetime.now(timezone.utc).isoformat(),
    }

    # Syntax check
    if not re.match(r'^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$', email):
        result['status'] = 'INVALID'
        result['reason'] = 'Bad syntax'
        return result

    local, domain = email.rsplit('@', 1)

    # Typo domain check
    if domain in TYPO_DOMAINS:
        result['status'] = 'INVALID'
        result['reason'] = f'Typo domain -- did you mean {TYPO_DOMAINS[domain]}?'
        return result

    # Disposable domain check
    if domain in DISPOSABLE_DOMAINS:
        result['status'] = 'INVALID'
        result['reason'] = 'Disposable email provider'
        return result

    # Role-based check
    if local in ROLE_PREFIXES:
        result['flags'].append('ROLE_BASED')

    # Free provider check
    if domain in FREE_PROVIDERS:
        result['flags'].append('FREE_PROVIDER')

    # DNS/MX lookup
    try:
        mx_records = dns.resolver.resolve(domain, 'MX')
        result['mx_host'] = str(mx_records[0].exchange)
        result['status'] = 'VALID'
        result['reason'] = 'MX record found'
        if result['flags'] and 'ROLE_BASED' in result['flags']:
            result['status'] = 'RISKY'
            result['reason'] = 'Role-based address'
    except dns.resolver.NoAnswer:
        # Try A record fallback
        try:
            dns.resolver.resolve(domain, 'A')
            result['status'] = 'RISKY'
            result['reason'] = 'A record only, no MX'
            result['flags'].append('NO_MX_A_ONLY')
        except:
            result['status'] = 'INVALID'
            result['reason'] = 'No DNS records'
    except dns.resolver.NXDOMAIN:
        result['status'] = 'INVALID'
        result['reason'] = 'Domain does not exist'
    except Exception as e:
        result['reason'] = f'DNS lookup failed: {str(e)}'

    result['flags'] = '|'.join(result['flags'])
    return result

Performance

  • ~160 emails/sec in DNS-only mode
  • 44K leads in ~5 minutes with --workers 20
  • Per-domain concurrency capped at 2 with 0.5s delay (built-in rate limiting)

Limitation

If port 25 is blocked on your server, the tool falls back to DNS-only mode. This means:

  • No SMTP mailbox existence check (RCPT TO probe)
  • No catch-all domain detection
  • Results are domain-level, not mailbox-level

For full SMTP verification, use an external service (e.g., ZeroBounce, NeverBounce) or run from a server with port 25 open.

Output CSV Columns

ColumnDescription
emailLowercased, trimmed email
statusVALID / INVALID / RISKY / UNKNOWN
reasonHuman-readable explanation
mx_hostMX server hostname (if found)
flagsPipe-separated flags (ROLE_BASED, FREE_PROVIDER, NO_MX_A_ONLY)
checked_atISO 8601 UTC timestamp

Built by PureBrain -- AI-powered marketing operations.

Want the full suite of 183+ production-tested skills? Start your trial ->

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.