Skip to content

// automation and data tools

Via API

RudderStack email verification with pingutil

RudderStack sends identify events to the warehouse and every connected tool, so disposable and random signups end up as profiles everywhere at once. A transformation can call pingutil with fetchV2, add the category and spam verdict to the event traits, and drop spam events for destinations that should never see them.

Where it connects: Transformations, transformEvent with fetchV2 and getCredential

What goes wrong without it

  • Fake signups are inflating our activation metrics in the warehouse and in every downstream tool.
  • We clean disposable emails in dbt after the fact, but the email platform already got them.
  • We want classification in the pipeline, not a bespoke check in each destination.

What you can do with RudderStack and pingutil

  • Classify emails on identify

    Call /v1/lookup with skip_enrichment: true in the transformation and add context.traits fields for category and spam verdict.

  • Drop spam for marketing destinations

    Connect the transformation to the email destination and return nothing for events where verdict.is_spam is true, so that destination never sees them.

  • Warehouse-ready flags

    Keep every event for the warehouse but with email_category and email_is_spam columns, so analysts can exclude fake signups from metrics.

Set it up

  1. 1

    Store your pingutil key in RudderStack's credential store as pingutil_key (Growth and Enterprise plans).

  2. 2

    Create a JavaScript transformation and paste the code below.

  3. 3

    Test it with a sample identify event that contains an email trait.

  4. 4

    Connect the transformation to the destinations that should receive the enriched events.

  5. 5

    Keep the fetch timeout short so slow responses fall back to the unmodified event.

Transformation: classify the email on identify events
export async function transformEvent(event, metadata) {
  if (event.type !== 'identify') return event;
  const traits = event.context && event.context.traits ? event.context.traits : event.traits || {};
  const email = traits.email;
  if (!email) return event;

  try {
    const res = await fetchV2('https://pingutil.com/v1/lookup', {
      method: 'POST',
      headers: {
        Authorization: 'Bearer ' + getCredential('pingutil_key'),
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ input: email, skip_enrichment: true }),
      timeout: 2000,
    });
    if (res.status !== 200) return event; // fail open on 429 and 5xx

    const data = res.body;
    traits.email_category = data.category;
    traits.email_is_spam = data.verdict.is_spam;
    traits.email_reason = data.verdict.reason;

    // For marketing destinations, drop spam signups entirely:
    // if (data.verdict.is_spam) return;
  } catch (err) {
    // timeout or network error: deliver the event unchanged
  }
  return event;
}

What to do with each result

pingutil resultAction in RudderStack
categorytraits.email_category for warehouse columns and audience filters
verdict.is_spam = truetraits.email_is_spam, or return nothing to drop the event for that destination
verdict.reasontraits.email_reason so analysts see disposable_domain vs randomized_local_part
Non-200 or timeoutReturn the event unchanged

Limits to plan for

  • RudderStack JavaScript transformations have a 4 second execution limit that excludes time spent in fetch or fetchV2; credentials are a Growth and Enterprise feature.
  • pingutil allows 60 requests a minute and 2,000 lookups a day (30,000 a month) per account; only call it on identify, and RudderStack recommends batching where possible. Those are Free plan limits; Enterprise has custom limits.
  • Blocklists lag behind new disposable domains, and privacy-relay aliases can be flagged as randomized.

RudderStack documentation

RudderStack is a trademark of its owner. This integration uses RudderStack's documented extension points; it is not an official RudderStack app.

Common questions

Where should the email trait be read from?
It depends on the SDK: identify events usually carry traits under context.traits, sometimes under traits. The snippet checks both.
Can I verify mailboxes in a transformation?
It is a poor fit. /v1/verify can take seconds per address. Classify in the transformation and run mailbox verification as a separate batch job.

Stop bad addresses in RudderStack today

Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your RudderStack setup will receive.