# Email List Cleaner & Validator: Dedupe, Typos, Disposable (`lyfe_tools/email-list-cleaner`) Actor

Email list cleaner for messy lists: fix gmial.com-style typos, remove duplicates (Gmail dots and +tags), flag disposable, role and free-provider addresses, and drop domains with no mail server.

- **URL**: https://apify.com/lyfe_tools/email-list-cleaner.md
- **Developed by:** [LYFE Offshore](https://apify.com/lyfe_tools) (community)
- **Categories:** Lead generation, Automation, MCP servers
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.28 / 1,000 address cleaneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Email List Cleaner: Dedupe, Typo Fix, Disposable & Role Filter

Bulk email list cleaner and validator: fixes typos like `gmial.com`, removes duplicates, flags disposable,
role and free-provider addresses, and checks MX records so domains that cannot receive mail are dropped.

**Clean a messy email list before you send, import or verify it.** Duplicates are merged including Gmail dots and
`+tags`. No external service is involved: normalisation, typo repair, de-duplication and flags run on built-in code
and lists; the only network use is one DNS lookup per domain.

### Before and after

A real run on a 34-row list (the `INPUT.json` in this repo):

| As submitted | Cleaned | What happened |
|---|---|---|
| ` Maria.Gonzalez@GMAIL.com` | `maria.gonzalez@gmail.com` | trimmed, lowercased; **2 duplicates merged** (`maria.gonzalez@gmial.com`, `m.a.r.i.a.gonzalez+news@gmail.com`) |
| `john.smith@hotmail.con` | `john.smith@hotmail.com` | TLD typo corrected (`correctedFrom` keeps the old value); merged with `John.Smith@Hotmail.com` |
| `jan.jansen@outlok.com` | `jan.jansen@outlook.com` | typo corrected |
| `"Tomáš Koutný" <tomas.koutny@lyfeoffshore.com>` | `tomas.koutny@lyfeoffshore.com` | address extracted from the display-name form |
| `mailto:support@apify.com` | `support@apify.com` | unwrapped; flagged `role_address` |
| `info@bücher.de` | `info@xn--bcher-kva.de` | internationalised domain converted to punycode |
| `someone@mailinator.com` | unchanged, `usable: false` | `disposable_domain` |
| `bob@thisdomaindoesnotexist-xyz123.com` | unchanged, `usable: false` | `no_domain` (DNS says it does not exist) |
| `example@example.com` | unchanged, `usable: false` | `null_mx` (the domain publishes RFC 7505 "no mail here") |
| `alex..dot@gmail.com`, `bob@`, `not an email` | unchanged, `usable: false` | `bad_local`, `empty_domain`, `missing_at` |

Run summary for that list: **34 rows → 28 unique, 18 usable** — 5 duplicates merged, 1 blank row skipped,
4 invalid, 4 typos corrected, 3 disposable, 3 domains without a mail server, 7 role addresses, 9 free-provider
addresses, 15 domains looked up.

### What it does

- **Normalises** case, whitespace, `Name <a@b.com>`, `mailto:`, stray quotes and trailing punctuation; converts
  internationalised domains to punycode; checks syntax (local part, labels, TLD, lengths).
- **Fixes typos** in domains: a list of common slips (`gmial`, `hotmial`, `yahho`, `outlok`, `iclod`…), TLD slips
  (`.con`, `.cmo`, `.ocm`…), and one-edit matches against big providers (Gmail, Yahoo, Hotmail, Outlook, iCloud,
  Proton). It is deliberately conservative: a real small domain is never "corrected" to gmail.com.
  `fixTypos` = `apply` (default; the old address is kept in `correctedFrom`), `suggest` (leave the address alone,
  put the fix in `suggestion`) or `off`.
- **Merges duplicates** after typo repair. Gmail and Googlemail addresses ignore dots and `+tags`, so those are
  collapsed. For every other provider only case is ignored, because `a+x@acme.com` and `a@acme.com` can be different
  mailboxes. The first occurrence wins and carries the count in `duplicates`; extra columns of object rows are kept.
- **Flags** `role` (info@, sales@, support@, noreply@…), `disposable` (about 9,200 throwaway domains from the
  [disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains) list, CC0) and
  `freeProvider`.
- **Checks DNS** (on by default), once per domain: MX records, with the A-record fallback of RFC 5321. Reports
  `no_domain`, `null_mx`, `no_mx`. A timeout or resolver error gives `mxOk: null` and never rejects an address.
- **`usable`** = valid syntax, the domain can receive mail, not disposable (unless you turn that off), not a role
  address (only if you turn that on). `outputMode: clean-only` returns just those rows.

### What it does not do

It cannot tell you whether a mailbox exists. `tomas@acme.com` passes if `acme.com` has a mail server, even if
nobody called Tomas works there, and it says nothing about catch-all domains. That needs an SMTP-level or
statistical check, which is a different job; if you want it,
[Catch-All Email Verifier](https://apify.com/lyfe_tools/catchall-email-verifier) does it. This Actor is useful
without it.

Other limits: the disposable list is a snapshot, so brand-new throwaway domains are missed; the typo list is
English/Western-European biased; role detection looks at the part before `+` only.

### Input example

`emails` takes strings or objects (`emailField` names the column; auto-detected when it is called `email`,
`e-mail`, `Email Address`…), or set `inputDatasetId` to read another Actor's dataset. Options: `fixTypos`,
`checkMx`, `removeDisposable`, `removeRole`, `outputMode`, `concurrency`.

```json
{
  "emails": ["  Maria.Gonzalez@GMAIL.com ", "maria.gonzalez@gmial.com", "m.a.r.i.a.gonzalez+news@gmail.com",
             "john.smith@hotmail.con", "someone@mailinator.com", "info@lyfeoffshore.com"],
  "fixTypos": "apply",
  "checkMx": true,
  "outputMode": "all"
}
```

### Output example

One row per unique address. This is the second row of a local run of the input above (6 rows in, 4 unique,
3 usable):

```json
{
  "original": "john.smith@hotmail.con",
  "email": "john.smith@hotmail.com",
  "valid": true,
  "issues": ["typo_corrected"],
  "correctedFrom": "john.smith@hotmail.con",
  "suggestion": null,
  "role": false,
  "disposable": false,
  "freeProvider": true,
  "mxOk": true,
  "duplicates": 0,
  "usable": true
}
```

| Field | Meaning |
|---|---|
| `email` | The cleaned address (lowercased, unwrapped, typo fixed when `fixTypos` is `apply`) |
| `usable` | `true` when the syntax is valid, the domain can receive mail, and it is not filtered as disposable or role |
| `valid` | Syntax check passed |
| `issues` | Codes such as `typo_corrected`, `disposable_domain`, `role_address`, `no_domain`, `null_mx`, `no_mx`, `bad_local`, `missing_at` |
| `correctedFrom` | The address before the typo fix, or `null` |
| `suggestion` | The proposed fix when `fixTypos` is `suggest`, or `null` |
| `role` / `disposable` / `freeProvider` | Flags, always set whatever the filter settings |
| `mxOk` | `true` the domain has a mail server, `false` it does not, `null` not checked (DNS off, timeout, or a disposable domain, which is not looked up) |
| `duplicates` | How many later rows were merged into this one |
| `original` | The value as submitted |

Object rows keep their other columns. The key-value store holds `SUMMARY` with the run totals.

### Price

Price per 1,000 by your Apify plan (Apify applies the right column automatically):

| | Free | Starter | Scale | Business and up |
|---|---|---|---|---|
| Address cleaned, per 1,000 | $0.40 | $0.40 | $0.34 | $0.28 |

No start fee. The figures below use the Free-plan price; on a paid plan the same run costs less.

Pay per event: **$0.0004 per unique address**, platform usage included, no start fee.

| List | Cost |
|---|---|
| 1,000 unique addresses | $0.40 |
| 10,000 unique addresses | $4.00 |
| 100,000 unique addresses | $40.00 |

Duplicates and blank rows are free; a list of 10,000 rows with 2,000 duplicates costs $3.20. Invalid addresses
count as unique addresses and are charged. You are charged per unique address checked in both output modes. Set a
maximum cost per run and the Actor processes only as many rows as that limit pays for, and says so in the log.

### Use it from code or an AI agent

```bash
curl -X POST "https://api.apify.com/v2/acts/lyfe_tools~email-list-cleaner/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"emails": ["john.smith@hotmail.con", "someone@mailinator.com"], "outputMode": "all"}'
```

The response is the dataset rows as a JSON array. The Actor also works through the Apify MCP server
(https://mcp.apify.com), so AI agents such as Claude or Cursor can call it as a tool: an agent sends `emails`
(and optionally `outputMode`, `removeRole`) and reads `email`, `usable` and `issues` from each row.

### Part of a lead-list workflow

1. Find: [Local Business Leads](https://apify.com/lyfe_tools/osm-business-email-leads) (role addresses such as info@, by city and category)
2. **Clean: Email List Cleaner (this Actor)**
3. Verify: [Catch-All Email Verifier](https://apify.com/lyfe_tools/catchall-email-verifier)
4. Check the domain: [SPF, DKIM & DMARC Checker](https://apify.com/lyfe_tools/domain-email-health-check)

Next step: run the cleaned list through the [Catch-All Email Verifier](https://apify.com/lyfe_tools/catchall-email-verifier)
to score whether each mailbox is likely to exist. Each step accepts the previous run's dataset ID in
`inputDatasetId`: this Actor reads the finder's `email` column (people without a found address are skipped as
blank and not charged), and the verifier reads this Actor's `email` column. Use `outputMode: clean-only` first, so
only usable addresses go on.

### FAQ

**How do I remove duplicate emails from a list, including Gmail dots and +tags?**
Duplicates are merged after typo repair. For Gmail and Googlemail, dots and `+tags` are ignored; for every other
provider only case is ignored, since `a+x@acme.com` and `a@acme.com` can be different mailboxes.

**Does it check MX records?**
Yes, once per domain, with the RFC 5321 A-record fallback. A timeout gives `mxOk: null` and never rejects the
address. Turn it off with `checkMx: false`.

**Does it remove disposable and role-based emails?**
Both are always flagged. Disposable addresses are marked not usable by default (`removeDisposable`); role
addresses (info@, sales@) only when you set `removeRole: true`.

**Does it tell me whether a mailbox exists or is catch-all?**
No. See "What it does not do" above; that is the verifier's job.

**Can I upload a CSV?**
Pass rows as objects (any columns, one of them the address) or point `inputDatasetId` at a dataset. Extra columns
are kept in the output.

Questions or a wrong result: tools@lyfeoffshore.com.

# Actor input Schema

## `emails` (type: `array`):

Plain strings, or objects with an email column (other columns are kept in the output). Formats like "Name <a@b.com>" and mailto: links are unwrapped.

## `inputDatasetId` (type: `string`):

Read the rows from an existing dataset instead of (or in addition to) the list above.

## `emailField` (type: `string`):

Column that holds the address when rows are objects. Leave empty to auto-detect a column named email, e-mail, Email Address and the like.

## `fixTypos` (type: `string`):

apply: replace gmial.com with gmail.com (the old value stays in correctedFrom). suggest: leave the address alone and put the fix in the suggestion column. off: no typo detection.

## `checkMx` (type: `boolean`):

Looks up MX records once per domain and flags domains that do not exist, publish a null MX, or have no mail server.

## `removeDisposable` (type: `boolean`):

Mark addresses at known throwaway domains (mailinator, guerrillamail, ...) as not usable. They are always flagged either way.

## `removeRole` (type: `boolean`):

Mark shared inboxes such as info@, sales@, support@ as not usable. They are always flagged either way.

## `outputMode` (type: `string`):

all: every unique address with its flags and a usable column. clean-only: only the usable ones. You are charged per unique address checked in both modes.

## `concurrency` (type: `integer`):

How many DNS lookups run at once. The default is fine for lists of any size.

## Actor input object example

```json
{
  "emails": [
    "  Maria.Gonzalez@GMAIL.com ",
    "maria.gonzalez@gmial.com",
    "m.a.r.i.a.gonzalez+news@gmail.com",
    "info@lyfeoffshore.com",
    "someone@mailinator.com",
    "john.smith@hotmail.con",
    "not an email",
    "\"Tomáš Koutný\" <tomas@lyfeoffshore.com>",
    "bob@thisdomaindoesnotexist-xyz123.com"
  ],
  "fixTypos": "apply",
  "checkMx": true,
  "removeDisposable": true,
  "removeRole": false,
  "outputMode": "all",
  "concurrency": 20
}
```

# Actor output Schema

## `results` (type: `string`):

One row per unique address with flags and a usable verdict.

## `summary` (type: `string`):

Counts: duplicates removed, typos fixed, invalid, disposable, role, no mail server, usable.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "emails": [
        "  Maria.Gonzalez@GMAIL.com ",
        "maria.gonzalez@gmial.com",
        "m.a.r.i.a.gonzalez+news@gmail.com",
        "info@lyfeoffshore.com",
        "someone@mailinator.com",
        "john.smith@hotmail.con",
        "not an email",
        "\"Tomáš Koutný\" <tomas@lyfeoffshore.com>",
        "bob@thisdomaindoesnotexist-xyz123.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lyfe_tools/email-list-cleaner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "emails": [
        "  Maria.Gonzalez@GMAIL.com ",
        "maria.gonzalez@gmial.com",
        "m.a.r.i.a.gonzalez+news@gmail.com",
        "info@lyfeoffshore.com",
        "someone@mailinator.com",
        "john.smith@hotmail.con",
        "not an email",
        "\"Tomáš Koutný\" <tomas@lyfeoffshore.com>",
        "bob@thisdomaindoesnotexist-xyz123.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("lyfe_tools/email-list-cleaner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "emails": [
    "  Maria.Gonzalez@GMAIL.com ",
    "maria.gonzalez@gmial.com",
    "m.a.r.i.a.gonzalez+news@gmail.com",
    "info@lyfeoffshore.com",
    "someone@mailinator.com",
    "john.smith@hotmail.con",
    "not an email",
    "\\"Tomáš Koutný\\" <tomas@lyfeoffshore.com>",
    "bob@thisdomaindoesnotexist-xyz123.com"
  ]
}' |
apify call lyfe_tools/email-list-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,lyfe_tools/email-list-cleaner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/bgJn5Zr9kKAiufFLT/builds/IBSX4ybZbPjScRlYz/openapi.json
