Email platforms

Mailgun integration

A sync script you run on your own computer checks the members of a Mailgun mailing list as one bulk list and writes each verdict into five of the member’s vars, keeping the rest. Nothing else changes unless you ask: it can unsubscribe the members or suppress the addresses you name.

Read the full setup guideGet an API key

  • Setup guide
  • A script you download

mailgun.mjsNode 22.18 or later

Terminal
export EV_API_KEY=…  MAILGUN_API_KEY=…
node mailgun.mjs --lists
node mailgun.mjs --list <list address> --dry-run
node mailgun.mjs --list <list address>

At a glance.

Status
Setup guide. Not listed on a marketplace yet: you set it up yourself in a few steps, below and in the full guide.
For
Teams who send newsletters and announcements to Mailgun mailing lists and want the members that will bounce, or should not be mailed at all, marked before the next send.
You need
Node 22.18 or later, an API key of ours with Bulk lists (off by default), and a Mailgun account API key whose role may update mailing lists (a domain sending key can only send).
Costs
1 credit = 1 validated address, as with any API request. Free: unknown results, API errors, malformed addresses and test addresses on sandbox.email-validation.org.
Full guide
Read the full setup guide

Typical uses.

  • Know which members to leave out

    Each member gets ev_status, ev_reason, ev_action, ev_checked_at and ev_address_hash, usable in templates as %recipient.ev_status%. Spam traps and complainers are valid with the action remove, so filter on ev_action.

  • Unsubscribe or suppress, if you ask

    Off by default. --unsubscribe invalid,disposable sets those members to unsubscribed on the list; --suppress invalid adds them to your sending domain’s suppressions. Never for valid.

  • Check before a single send

    The guide shows a check with our API to run before you call Mailgun for one message: only a definite invalid holds it back, and every failure lets it through.

Set it up. 4 steps.

The short version of the full setup guide, which stays the reference when a step does not match what you see.

Read the full setup guide

  1. Download and unzip

    It is not on a marketplace: download email-validation-mailgun.zip from the guide. It holds mailgun.mjs and the licence.

  2. Find the list

    node mailgun.mjs --lists shows your mailing lists with their addresses and member counts. For an EU account, add --mailgun-region eu.

  3. Try it free on a test list

    Make a list for the try with one member, no_mailbox@sandbox.email-validation.org, send nothing to it, and run the script on it: the member is marked invalid. Then delete the list.

  4. Dry run, then run

    node mailgun.mjs --list <list address> --dry-run counts what it would check and spends nothing. Run it again without --dry-run to check and write the vars.

Good to know.

  • By default it writes only its five vars and keeps every other var: it never deletes, adds or renames a member, and changes no list. Writing vars does not change who receives mail sent to the list address.

  • Run the same command again after any stop and it resumes the same bulk list and never pays twice (within the 30 days a list is kept). It prints ids and counts, never a member’s address or a key.

  • Mailgun keeps lists in one region: --mailgun-region eu is your Mailgun account’s region, and --region eu is where we check and keep the list.

  • Mailgun sends no webhook when a member joins a list, so run the script on a schedule: each run checks only the members without a verdict, and those still unknown.

Connect Mailgun.

Test it on our sandbox addresses for free, then on your own contacts.

Create your accountRead the full setup guide

Updated · Maintained by: Email Validation LLC