Email Validation

Email Validation Overview

Cleanmails includes a built-in email validation engine that checks addresses through multiple layers. Validation runs as a background job when you trigger it on an uploaded lead list — results appear in real-time on the leads table.

Validation Pipeline

Each email in your lead list goes through these checks (in order):

StepCheckWhat It Does
1Syntax validationRFC 5322 compliant regex check — catches obvious typos
2Disposable detectionChecks against 120,000+ known disposable/throwaway domains
3Role-based filterIdentifies generic addresses (info@, admin@, support@, etc.)
4Free email flagFlags Gmail, Yahoo, Outlook, and other free providers
5DNS MX lookupVerifies the domain has valid mail exchange servers (5s timeout)
6A-record fallbackFalls back to DNS A record if no MX records found
7Domain suggestionSuggests corrections for typos (e.g., gmial.com → gmail.com)
How it runs

Validation runs as a background job in the Asynq worker's default queue with 100 concurrent goroutines. Results are written to PostgreSQL as each lead is processed — the frontend shows progress in real-time.

Scoring System

Each lead receives a score from 0–100 based on the checks above:

FactorPoints
Valid syntax+20
Has MX records+35
Not a role account+15
Not a free email+15 (free emails get +5)
Reachable assessment+10 to +15
Disposable domainInstant invalid (score: 5)
No MX recordsInstant invalid (score: 10)

Score Categories

Score RangeStatusColorMeaning
60–100ValidGreenSafe to send — high confidence deliverable
35–59RiskyAmberMay bounce — use with caution
0–34InvalidRedWill likely bounce — do not send

How to Validate Leads

Upload a CSV list, then trigger validation from the dashboard or via API:

bash
# Step 1: Upload a CSV lead list
curl -X POST https://YOUR_SERVER/api/v1/workspaces/1/leads/upload \
  -H "Cookie: auth_token=YOUR_JWT_TOKEN" \
  -F "file=@leads.csv"

# Step 2: Trigger validation
curl -X POST https://YOUR_SERVER/api/v1/workspaces/1/leads/validate \
  -H "Content-Type: application/json" \
  -H "Cookie: auth_token=YOUR_JWT_TOKEN" \
  -d '{"list_id": 1}'

# Step 3: Check results (updated in real-time as validation progresses)
curl https://YOUR_SERVER/api/v1/workspaces/1/leads \
  -H "Cookie: auth_token=YOUR_JWT_TOKEN"
From the dashboard

You can also trigger validation directly from the lead list card in the dashboard — click the list, then hit the Validate button. A progress bar shows real-time status.

CSV Format

The uploaded CSV should include at minimum an email column. Additional supported columns:

ColumnDescription
emailEmail address (required)
first_nameFirst name (used in campaign personalization)
last_nameLast name
companyCompany name
job_titleJob title
phonePhone number

Duplicate emails within the same workspace are automatically deduplicated via a database unique index.

Performance

MetricValue
Concurrency100 parallel goroutines per validation job
Disposable blocklist120,000+ domains
Score range0–100 per email
Queue priorityDefault queue (weight 3)
Max retry2 attempts on failure