# Email Domain Auth Auditor (`your_friendly_developer/email-domain-auth-auditor`) Actor

Audits email authentication (SPF, DMARC, DKIM, MX, MTA-STS, TLS-RPT, BIMI) for one domain or a bulk list, with a deterministic 0 to 100 score and grade per domain. Built for agencies and deliverability consultants.

- **URL**: https://apify.com/your_friendly_developer/email-domain-auth-auditor.md
- **Developed by:** [Jason Ramirez](https://apify.com/your_friendly_developer) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $100.00 / 1,000 domain auditeds

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 Domain Auth Auditor

Bulk SPF, DKIM and DMARC check for up to 1,000 domains in one run. Every domain gets a 0 to 100 configuration score and a letter grade with the specific issues listed, so agencies and deliverability consultants can audit a whole client list at once instead of checking records one domain at a time.

An Apify Actor for agencies and deliverability consultants auditing client domains in bulk. It reads public DNS through Cloudflare DoH with Google DoH fallback. No service credentials are needed for the DNS checks. It emits one dataset item per normalized, deduplicated domain.

### Input

```json
{
  "domains": ["https://Example.com/path", "example.org"],
  "selectors": ["custom2026"]
}
```

`domains` is required, with 1 to 1000 strings before deduplication. Protocols, paths, queries, fragments and trailing dots are stripped; names are lowercased and international names converted to ASCII. Invalid names reject the input before DNS queries. Ports and email addresses are not accepted. Optional selectors extend the built-in list: google, default, selector1, selector2, k1, s1, mail, dkim.

### Output

| Field | Contents |
| --- | --- |
| domain, checkedAt | Normalized domain and ISO timestamp |
| spf | present, first record or null, issues, lookupCountEstimate, all mechanism or null |
| dmarc | present, policy, pct (default 100), alignment.spf/dkim (default r), reporting.aggregate/forensic booleans, issues |
| dkim | selectorsFound and selectorsProbed arrays |
| mx | present, provider (Google, Microsoft 365, other, none), hosts |
| mtaSts, tlsRpt, bimi | Each contains a DNS record presence boolean |
| score, grade | Deterministic configuration score 0 to 100 and A/B/C/D/F |
| issues | Objects containing severity, code and factual message |
| summary | One sentence counting configuration findings |
| error | On DNS failure, replaces check results; domain and checkedAt remain |

Reporting address values are not emitted. SPF record text is emitted. DoH answers are not stored verbatim. A failed DNS query after both providers fail produces a domain error item and the next domain continues. Dataset or key-value storage failures propagate rather than being mislabeled as DNS failures.

The final summary is logged and stored as `LAST_RUN_SUMMARY` in the Actor key-value store:

```json
{"runAt":"2026-11-15T00:00:00.000Z","domainsRequested":3,"domainsAudited":2,"domainsFailed":0}
```

This example represents three input strings with one duplicate. Requested counts raw input entries; audited and failed count unique domains.

### Scoring rubric

Start at 100, subtract each distinct issue code once, clamp to zero. Weights live in the single `ISSUE_WEIGHTS` object in `src/score.js`. Optional configuration practices carry small weights; this score is a project rubric, not a standards compliance certification.

| Code | Deduction | Trigger |
| --- | --- | --- |
| SPF_MISSING | 20 | No SPF record |
| SPF_MULTIPLE | 20 | More than one SPF record |
| SPF_LOOKUPS | 10 | More than ten direct DNS lookup terms |
| SPF_UNSAFE_ALL | 10 | +all, all or ?all |
| SPF_NO_ALL | 5 | No all mechanism |
| DMARC_MISSING | 25 | No DMARC record |
| DMARC_MULTIPLE | 15 | More than one DMARC record |
| DMARC_POLICY | 15 | Absent or invalid policy |
| DMARC_MONITOR | 10 | Policy none |
| DMARC_PCT | 5 | Invalid percentage or below 100 |
| DMARC_ALIGNMENT | 5 | Invalid alignment tag |
| DMARC_REPORTING | 5 | No nonempty rua or ruf tag |
| DKIM_NOT_FOUND | 10 | No key found for probed selectors |
| MX_MISSING | 10 | No usable MX host, including null MX |
| MTA_STS_MISSING | 3 | No MTA-STS DNS version record |
| TLS_RPT_MISSING | 3 | No TLS-RPT DNS version record |
| BIMI_MISSING | 1 | No default BIMI DNS version record |
| DNS_MALFORMED | 5 | Malformed DNS answer or MX data |

A: 90 to 100; B: 80 to 89; C: 70 to 79; D: 60 to 69; F: 0 to 59. Error items have no score or grade.

### Honest limits

DKIM probing covers common selectors and supplied extras only. A negative result means "not found for common selectors", never certainty that DKIM is missing. Nonempty key tags are detected without cryptographic key validation. Revoked empty keys are not counted.

SPF lookup count is an estimate of direct terms, including redirect. It does not recursively expand includes, redirects or MX hosts, calculate void lookups, or validate the full SPF grammar. With multiple SPF records the first is used for these details and an error is reported.

DMARC tags receive basic validation only; reporting address presence does not prove address validity, authorization or report delivery. MTA-STS, TLS-RPT and BIMI checks identify DNS version records only, without fetching policies, validating certificates, checking logos or testing mail transport. MX provider is a hostname pattern guess. No implicit A/AAAA mail fallback is tested. NXDOMAIN is treated as absent records. Other DNS failures produce an error item.

Results describe configuration facts and standard-practice gaps, not inbox placement or deliverability outcomes. DNS changes and resolver caching can affect observations.

### Local run

Use Node.js 20 or later. In a network-enabled environment, run `npm install`, then `npm test`. Tests use only Node built-ins and injected fixture fetch functions, so `npm test` also runs before installation and never needs DNS access.

For an Actor run, put input in `storage/key_value_stores/default/INPUT.json`, then run `npm start` after installation. The entry point uses Apify SDK v3 Actor lifecycle, dataset and key-value storage. The Dockerfile installs the declared SDK dependency on the Apify Node 22 base image.

### Publication setup

This worktree does not publish or configure pricing. Before publication, the owner must configure Apify pay-per-event monetization for a per-domain `domain-audited` event and validate the installed SDK charging integration in a nonbilling test environment. No price or demand estimate is supplied. The entry point calls `Actor.charge` once with `domain-audited` after each successful unique domain dataset write. DNS error items are not charged. Tests inject a fake charging callback and do not spend money. Charging or storage failures halt the run; billing and dataset writes are not transactional.

# Actor input Schema

## `domains` (type: `array`):

One to 1000 domains or URLs to audit.

## `selectors` (type: `array`):

Additional DKIM selectors beyond the eight common selectors.

## Actor input object example

```json
{
  "domains": [
    "google.com"
  ]
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing one audit report row per audited domain

## `keyValueStore` (type: `string`):

Default key-value store holding the LAST_RUN_SUMMARY record

# 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 = {
    "domains": [
        "google.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("your_friendly_developer/email-domain-auth-auditor").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 = { "domains": ["google.com"] }

# Run the Actor and wait for it to finish
run = client.actor("your_friendly_developer/email-domain-auth-auditor").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 '{
  "domains": [
    "google.com"
  ]
}' |
apify call your_friendly_developer/email-domain-auth-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,your_friendly_developer/email-domain-auth-auditor"
        }
    }
}
```

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/9TPT2Atht50boQXjA/builds/gNnVCRbcV431vKKJm/openapi.json
