# Email List Pre-Cleaner (`settled_marzipan/email-list-pre-cleaner`) Actor

A cheap first pass over an email list: flags bad syntax, duplicates, throwaway domains, role inboxes, likely typos and domains with no mail server. No SMTP probing, so it cannot confirm that a mailbox exists.

- **URL**: https://apify.com/settled_marzipan/email-list-pre-cleaner.md
- **Developed by:** [Andrew Shim](https://apify.com/settled_marzipan) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.05 / 1,000 email checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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 Pre-Cleaner

A cheap first pass over an email list. It removes the obviously bad addresses
**before** you pay a full email verifier to check the rest.

It reads each address, checks that it is written correctly, and looks up
whether its domain has a mail server. That is all. It does **not** contact any
mailbox, so it **cannot confirm that a mailbox exists**.

### What it does

For every address you give it, you get one row back with a status and a
plain-English reason:

| Status | What it means | What most people do |
| --- | --- | --- |
| `valid_syntax_mx_ok` | Written correctly, and the domain has a mail server. | Keep, then verify with an SMTP verifier if you need certainty. |
| `invalid_syntax` | Not a usable email address (missing @, spaces, bad characters...). | Remove. |
| `no_mx` | The domain does not exist or has no mail server. | Remove. |
| `disposable` | The domain is a known throwaway email service. | Remove. |
| `duplicate` | The same address appeared earlier in the list (letter case ignored). | Remove. |
| `role_based` | A shared inbox such as info@, sales@, support@, admin@, noreply@. The domain has a mail server. | Your choice. Many senders skip these. |
| `typo_suspected` | The domain looks like a typo of a big provider, such as `gmial.com`. | Look at the suggestion and decide. |
| `dns_error` | The domain lookup failed twice. Unknown. | Try again later. |

Other things it tells you:

- **Suggestion.** For likely typos it offers a correction, for example
  `sam@gmial.com` gets the suggestion `sam@gmail.com`. It is a suggestion
  only. The address is never changed for you.
- **Free mail.** Whether the domain is a consumer mailbox provider (Gmail,
  Yahoo, Outlook and so on).
- **Possible Gmail alias.** `jane.doe@gmail.com` and `janedoe+shop@gmail.com`
  usually reach the same inbox. These are pointed out in the
  `possibleAliasOf` column but are **not** merged or removed.
- **A-record fallback.** When a domain has no mail server record but does
  have a plain address record, that is noted in its own column. The status
  stays `no_mx`.
- **Summary.** A small record named `SUMMARY` with the count for each status.

### What it does not do

- **No SMTP probing.** It never connects to a mail server and never sends
  anything. So it cannot tell you whether `jane@company.com` is a real,
  working mailbox. An address marked `valid_syntax_mx_ok` can still bounce.
- **No scraping.** It does not visit websites or look anyone up.
- **No catch-all, spam-trap or inbox-full detection.** Those need a full
  verifier.
- **Not a complete disposable list.** About 160 well-known throwaway domains
  are built in. New ones appear every day, so some will get through.
- **Not a full email-standard parser.** The syntax check is a practical,
  careful rule set. It accepts the shapes people really use (plus-addressing
  like `jane+news@`, subdomains, dots, hyphens, apostrophes) and rejects
  obvious garbage. Rare but technically legal forms (quoted names such as
  `"jane doe"@example.com`, and IP-address domains) are reported as
  `invalid_syntax`, with a reason that says so.
- **Typo suggestions can be wrong.** A small real company whose domain is one
  letter away from `gmail.com` would be flagged. That is why nothing is
  changed automatically.
- **Role and free-mail lists are short lists of common names,** not complete.

### When it is worth using

Full SMTP verifiers on this store were listed at roughly $0.50 to $1.00 per
1,000 addresses when this was written (November 2026), and most charge for
every address you send, including the ones that were never going to work.
Run this first, drop the rows marked `invalid_syntax`, `no_mx`, `disposable`
and `duplicate`, and send only the rest to the verifier.

Rough guide: it pays for itself when it removes more than about 5 to 10 in
every 100 addresses, depending on what your verifier charges. On a clean,
recently collected list it may not be worth it. On an old, merged or scraped
list it usually is.

### Input

```json
{
    "emails": [
        "example.user@gmail.com",
        "info@example.org",
        "sam@gmial.com",
        "someone@mailinator.com",
        "EXAMPLE.USER@gmail.com",
        "not-an-email"
    ],
    "maxEmails": 10000
}
```

- `emails`: the list of addresses.
- `emailsText`: optional. Paste addresses, one per line.
- `maxEmails`: safety limit per run, default 10,000 (ceiling 100,000).
  Anything past the limit is left out and is not charged.
- Advanced: `concurrency` (default 20), `dnsTimeoutSecs` (default 5),
  `checkARecordFallback` (default on).

Reading addresses from a CSV file, a URL or another dataset is not built yet.

### Output

One row per address, in the same order as the input:

```json
[
    {
        "original": "example.user@gmail.com",
        "normalized": "example.user@gmail.com",
        "status": "valid_syntax_mx_ok",
        "domain": "gmail.com",
        "hasMx": true,
        "mxHost": "gmail-smtp-in.l.google.com",
        "aRecordFallback": false,
        "isFreeMail": true,
        "isRoleBased": false,
        "isDisposable": false,
        "suggestion": null,
        "possibleAliasOf": null,
        "reason": "Well formed and the domain has a mail server. The mailbox itself was not checked."
    },
    {
        "original": "sam@gmial.com",
        "normalized": "sam@gmial.com",
        "status": "typo_suspected",
        "domain": "gmial.com",
        "hasMx": false,
        "mxHost": null,
        "aRecordFallback": false,
        "isFreeMail": false,
        "isRoleBased": false,
        "isDisposable": false,
        "suggestion": "sam@gmail.com",
        "possibleAliasOf": null,
        "reason": "The domain looks like a typo of gmail.com. Suggestion only, nothing was changed. The domain as typed has no mail server."
    },
    {
        "original": "not-an-email",
        "normalized": null,
        "status": "invalid_syntax",
        "domain": null,
        "hasMx": null,
        "mxHost": null,
        "aRecordFallback": null,
        "isFreeMail": false,
        "isRoleBased": false,
        "isDisposable": false,
        "suggestion": null,
        "possibleAliasOf": null,
        "reason": "Missing the @ sign."
    }
]
```

(The DNS details above are what a lookup returned on 2026-11-15. Real values
come from each domain's live DNS records at the time of your run.)

The `SUMMARY` record looks like this:

```json
{
    "total": 6,
    "byStatus": {
        "valid_syntax_mx_ok": 1,
        "invalid_syntax": 1,
        "no_mx": 1,
        "disposable": 1,
        "role_based": 0,
        "duplicate": 1,
        "typo_suspected": 1,
        "dns_error": 0
    },
    "likelyKeep": 1,
    "likelyRemove": 4,
    "needsReview": 1
}
```

### Pricing

**$0.05 per 1,000 addresses checked** ($0.00005 per address), pay per
event, plus Apify's small standard charge for starting a run.

- You are charged once for each row that is saved to the results, including
  rows marked invalid or duplicate, because finding those is the service.
- You are not charged for blank lines, or for addresses past your
  `maxEmails` limit.
- If you set a maximum cost for the run, the Actor stops cleanly when it is
  reached. Addresses it did not get to are not charged, and the summary says
  how many were left.

It is priced far below the SMTP verifiers because it does far less.

### Limits

- Default 10,000 addresses per run, ceiling 100,000.
- Each domain is looked up once per run, with at most 20 lookups at a time
  (adjustable), a 5 second timeout and one retry.
- Results depend on public DNS at the moment of the run. A domain that is
  briefly unreachable shows up as `dns_error`, not as bad.
- Addresses are processed in memory and written to your own run's dataset.
  The Actor keeps no copy and sends the list nowhere else. The only outside
  traffic is DNS lookups for the domain names.
- No proxies are used or needed.

# Actor input Schema

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

The addresses to check, one per item. Use this field when calling the Actor from the API or from another tool.

## `emailsText` (type: `string`):

Optional. Paste addresses here, one per line. Commas and semicolons also separate addresses. These are added after the addresses in the field above.

## `maxEmails` (type: `integer`):

Safety limit. Addresses beyond this number are left out, are not checked and are not charged. The hard ceiling is 100,000.

## `checkARecordFallback` (type: `boolean`):

When a domain has no mail server (MX) record, also check whether it has a plain address record. The result is still 'no_mx'; the extra finding is shown in the aRecordFallback column.

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

How many domains are looked up at once. Each domain is looked up only once per run, however many addresses share it.

## `dnsTimeoutSecs` (type: `integer`):

How long to wait for one DNS answer. A lookup that times out is tried once more, then reported as 'dns_error'.

## Actor input object example

```json
{
  "emails": [
    "example.user@gmail.com",
    "info@example.org",
    "sam@gmial.com",
    "someone@mailinator.com",
    "EXAMPLE.USER@gmail.com",
    "not-an-email"
  ],
  "maxEmails": 10000,
  "checkARecordFallback": true,
  "concurrency": 20,
  "dnsTimeoutSecs": 5
}
```

# Actor output Schema

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

One row per input address with status, flags, suggestion and reason.

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

Counts per status, DNS lookup counts and whether the run stopped at the charge limit.

# 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": [
        "example.user@gmail.com",
        "info@example.org",
        "sam@gmial.com",
        "someone@mailinator.com",
        "EXAMPLE.USER@gmail.com",
        "not-an-email"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("settled_marzipan/email-list-pre-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": [
        "example.user@gmail.com",
        "info@example.org",
        "sam@gmial.com",
        "someone@mailinator.com",
        "EXAMPLE.USER@gmail.com",
        "not-an-email",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("settled_marzipan/email-list-pre-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": [
    "example.user@gmail.com",
    "info@example.org",
    "sam@gmial.com",
    "someone@mailinator.com",
    "EXAMPLE.USER@gmail.com",
    "not-an-email"
  ]
}' |
apify call settled_marzipan/email-list-pre-cleaner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,settled_marzipan/email-list-pre-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/gbtAs4LII0z46Fr6e/builds/yMnIZMwj2Wl43srYe/openapi.json
