Integrations · Websites and CMS

Validate emails in Directus

Check the email addresses saved into your Directus collections before Directus writes them. An extension bundle you copy into your project checks the fields you list on every create and update, from the Data Studio, the REST and GraphQL API and your own extensions, and refuses the addresses whose status you refuse with one neutral message at the field. An email interface tells editors, as soon as they leave the field, whether the save will accept the address. The key stays on your server. Download it: email-validation-directus.zip holds the extension folder directus-extension-email-validation-org/ and the MIT licence.

What you need

  • A self-hosted Directus 10.10 or later, 11 or 12, on Node 22 or later (Directus 12.6 and later installed from npm need Node 26 or later; the Docker image brings its own Node), whose extensions folder and environment you can change and which you can restart. Directus is free to self-host for organisations under its revenue and size limits (Directus pricing). The extension has no dependencies and no build step.
  • An API key of ours from the API keys page with Validate addresses (on by default). It never needs Bulk lists.

Install

  1. Unzip the download and copy the folder directus-extension-email-validation-org into the project's extensions folder: ./extensions by default (the EXTENSIONS_PATH variable), or with Docker the folder mounted at /directus/extensions.

  2. Set the key and the fields to check, as <collection>.<field>, in Directus's environment (the project's .env or the container's environment):

    EMAIL_VALIDATION_ORG_API_KEY=ev_live_…
    EMAIL_VALIDATION_ORG_FIELDS=leads.email,directus_users.email
  3. Restart Directus. Settings → Extensions shows the hook, the endpoint and the interface, each on.

  4. Optional: for an editor's live verdict, pick the interface Email (checked) for the field in Settings → Data Model. The hook checks the listed fields whatever their interface.

Without a key nothing is checked and Directus's log says so at start. On a value that cannot be meant (an unknown EMAIL_VALIDATION_ORG_ variable, a status typo, a malformed field entry), Directus leaves the extension out and its log says why, so a typo never silently checks nothing.

Public forms and sign-ups

Directus runs the extension's filters before its own permission check, so the extension checks visitors and members only where they may write. Admins, users with Data Studio access and Directus itself are checked on every listed field. A visitor of the public role, or a member without Data Studio access, is checked only:

  • when creating an item in a collection you list in EMAIL_VALIDATION_ORG_PUBLIC_COLLECTIONS (a public form, for example EMAIL_VALIDATION_ORG_PUBLIC_COLLECTIONS=leads); give such users create permission there, not update;
  • when signing up through /users/register or changing their own address, with directus_users.email listed.

Try it free first

Sandbox addresses cost nothing and return the result their name says. In the Data Studio, create an item in a listed collection with the address no_mailbox@sandbox.email-validation.org: the save is refused at the field. Change it to accepted@sandbox.email-validation.org and it saves. That domain receives no mail, so never use it where Directus or a Flow sends mail (a sign-up with verification, a Flow that mails the address): test those with an address that receives mail.

Settings

All environment variables:

VariableDefaultItem
EMAIL_VALIDATION_ORG_API_KEYnoneThe API key.
EMAIL_VALIDATION_ORG_REGIONuseu: checked in the EU, with the same key and credits.
EMAIL_VALIDATION_ORG_FIELDSnoneThe fields checked, as <collection>.<field>, comma-separated. Of Directus's own collections only directus_users is checked.
EMAIL_VALIDATION_ORG_PUBLIC_COLLECTIONSnoneCollections whose creates by visitors and members without Data Studio access are checked (above).
EMAIL_VALIDATION_ORG_REFUSEinvalid,disposableThe statuses refused: any of invalid, disposable, catch_all, unknown. valid is never refused. none refuses nothing and spends nothing.
EMAIL_VALIDATION_ORG_FAIL_CLOSEDfalseRefuse the address when the check cannot be made (no key, no credits, our API slow or out of reach).
EMAIL_VALIDATION_ORG_VISITOR_LIMIT20Paid checks one signed-in user, or one visitor of the public role, may cause per hour; 0 turns it off.
EMAIL_VALIDATION_ORG_REGISTRATION_LIMIT50Paid checks all sign-ups together may cause per hour; 0 turns it off.
EMAIL_VALIDATION_ORG_SITE_LIMIT200Paid checks all visitors and members without Data Studio access may cause together per hour; 0 turns it off.
EMAIL_VALIDATION_ORG_EDITOR_LIMIT60Live verdicts one user may ask for per hour; 0 turns it off.
EMAIL_VALIDATION_ORG_MESSAGE"This email address cannot be accepted. Please check it or use another one."The one message every refused address gets.

See what each status means. An unknown whose reason is timeout or internal_error is our side failing, so it counts as a check that could not be made, not as an answer.

What it costs and how it works

  • Only the listed fields a write carries are checked (an update carries only what changed), and only a value that looks like an address. Each check costs one credit (an unknown result is free); the extension waits at most 8 seconds for it. When it cannot be made, the write goes through unless EMAIL_VALIDATION_ORG_FAIL_CLOSED is on.
  • An answer (other than unknown) is kept for an hour in the Directus process's memory, under a keyed hash, never the address. The live verdict and the save that follows share it, so they cost one credit. Each replica keeps its own.
  • A refusal is a 400 FAILED_VALIDATION error at the field. Neither it nor the live verdict says which status the address has.
  • Beyond a limit nothing is sent and the write goes through, even with fail closed. Admins and Directus itself are not limited. Behind a reverse proxy, set IP_TRUST_PROXY to your proxies' addresses or hop count (it defaults to true on Directus 10 and 11, which lets a visitor choose the IP address the limit counts).
  • Directus's log gets the API's error code and request id only, never an address, a user, an IP address or the key.

Not covered: a Flow's Create Data or Update Data operation is checked only with its Emit Events option on, and code that writes with emitEvents: false is not checked. EMAIL_VALIDATION_ORG_API_KEY_FILE (Docker secrets) is not read: pass the key itself.

Remove it

Turn the three entries off in Settings → Extensions, or delete the folder and restart Directus, then delete the key on the API keys page. The extension stores nothing in your database.

More on Directus

Updated · Maintained by: Email Validation LLC

Need help? Contact support, or ask the help chat. Something wrong or missing on this page? Tell us