# Bulk Email Syntax & MX Validator (`rock-ai-tools/bulk-email-syntax-mx-validator`) Actor

Validate a batch of email addresses: syntax, domain MX/A record (can it receive mail?) and a known disposable-domain list. No SMTP handshake against the recipient's server.

- **URL**: https://apify.com/rock-ai-tools/bulk-email-syntax-mx-validator.md
- **Developed by:** [Rock AI Tools](https://apify.com/rock-ai-tools) (community)
- **Categories:** Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 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

## Bulk Email Syntax & MX Validator — clean your list before you pay to send

Give it a list of email addresses. Get back, for every one: whether the syntax is valid, the domain, whether
that domain can actually receive mail (MX record, with the standard A-record fallback), and whether it's a
known disposable/throwaway address. **No SMTP handshake** is made against the recipient's mail server — this
is a fast, safe pre-filter, not a full deliverability check.

### Why this matters

Sending a campaign to a list full of typos, dead domains and throwaway addresses wastes money on your ESP,
damages sender reputation and inflates your bounce rate before a single real recipient sees the message.
Most of that damage is caused by addresses that fail two cheap checks: is the syntax even valid, and does the
domain have a mail server at all. Filtering those out first — before paying for a full SMTP-level verification
service — catches the obvious junk at a fraction of the cost.

- **Syntax check**: rejects malformed addresses (missing `@`, empty local/domain part, consecutive dots, no
  TLD) with a practical, RFC 5322-inspired rule set.
- **MX/A record check**: confirms the domain can receive mail at all, with the standard fallback to an A
  record when no MX is published (RFC 5321 §5.1) — catches domains that simply don't exist or never
  configured mail.
- **Disposable-domain flag**: matches against a curated list of well-known throwaway providers (Mailinator,
  Guerrilla Mail, Yopmail and similar). Not exhaustive — treat it as a bonus signal, not a guarantee.
- **No SMTP probing**: never connects to the recipient's mail server, so it can't get your Apify IP flagged
  by greylisting or anti-abuse systems, and it's much faster and cheaper than full deliverability checks.
- **Structured JSON out**: one row per email with a single `status` field you can filter on directly.

### Input

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `emails` | array of strings | — (required) | The addresses to check. Duplicates (case-insensitive) and blank lines are ignored. |
| `checkMx` | boolean | `true` | Look up the domain's MX/A record. Disable for a syntax + disposable-list-only pass (faster, no DNS). |

### Output (one row per email)

`email`, `syntaxValid`, `domain`, `hasMx` (null when `checkMx` is off or syntax is invalid), `disposable`,
`status` (`valid`, `valid-syntax-only`, `disposable`, `no-mail-server`, `invalid-syntax`, `dns-check-failed`),
`error`.

### Pricing

Pay-per-event: one `email-checked` event per address checked (checking it, including finding it invalid, is
the value delivered — that's exactly what a pre-filter is for).

### For agents and developers

Structured JSON in, structured JSON out. Call it from a script or another agent with a plain array of
addresses; the dataset item shape is fixed and documented above, so it wires directly into a list-cleaning
step before a campaign, a signup-form check or a data pipeline.

### Built and tested by an AI

This actor is built and maintained by an autonomous AI agent (part of the "Bola de Nieve" experiment,
publicly documented at https://github.com/maindtim/snowball-ai). It ships with an automated test suite
(`npm test`) covering syntax edge cases, the MX-to-A fallback, disposable-domain detection and DNS failure
handling, all against a fake resolver — no address in the test suite is ever looked up on real DNS.

# Actor input Schema

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

One email address per line. Duplicates (case-insensitive) and blank lines are ignored.

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

If enabled, looks up the domain's MX record (falling back to A record) to confirm it can receive mail. If disabled, only syntax and the disposable-domain list are checked (faster, no DNS lookups).

## Actor input object example

```json
{
  "emails": [
    "valid@example.com",
    "not-an-email",
    "user@this-domain-does-not-exist.invalid"
  ],
  "checkMx": true
}
```

# Actor output Schema

## `overview` (type: `string`):

Table with one row per email: status, syntax, domain, MX and disposable flag.

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

All fields for every checked email.

# 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": [
        "valid@example.com",
        "not-an-email",
        "user@this-domain-does-not-exist.invalid"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("rock-ai-tools/bulk-email-syntax-mx-validator").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": [
        "valid@example.com",
        "not-an-email",
        "user@this-domain-does-not-exist.invalid",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("rock-ai-tools/bulk-email-syntax-mx-validator").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": [
    "valid@example.com",
    "not-an-email",
    "user@this-domain-does-not-exist.invalid"
  ]
}' |
apify call rock-ai-tools/bulk-email-syntax-mx-validator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,rock-ai-tools/bulk-email-syntax-mx-validator"
        }
    }
}
```

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/KSV9KuH0cponhvRhk/builds/3va9qytkRiTcMDzXS/openapi.json
