Skip to content

Signing up for Discord? Some of our domains are accepted there. See which ones on the Domains page.

CyberTemp
All posts

How to Test a Disposable-Email Blocklist Without False Positives

CyberTemp7 min read

Need a disposable inbox right now?

Spin up a temporary email address in seconds — no signup, no spam, no trace.

Get a free inbox

Most teams that block disposable email at signup wrote the blocklist once, shipped it, and never tested it again. The list rots: new throwaway domains appear weekly, and the regex someone wrote in 2024 starts flagging legitimate domains it was never meant to catch. If you own a signup form that blocks temp-mail providers, the question isn't whether your blocklist works today — it's whether it still works after the fifth time someone edited it.

This is a test-harness problem, not a list-maintenance problem. You need a repeatable way to throw real disposable addresses at your signup form and real-looking corporate addresses at the same form, then assert the outcome of both. Here's how to build that harness using CyberTemp as the known-disposable side of the test matrix.


Why naive disposable-email blocklists break real signups

Three failure modes show up in almost every blocklist implementation we've seen referenced by developers wiring CyberTemp into test suites:

  • Substring matching instead of exact-domain matching. A list that blocks any address containing "mail" will flag jmail.co and also [email protected]. Exact-domain comparison against a normalized list is the only safe approach.

  • Stale domain lists. Disposable-mail providers rotate domains constantly specifically to dodge blocklists. A list that was accurate in January is missing a dozen new domains by March and still blocking three that shut down last year.

  • No test coverage for the "allow" path. Teams test that known-bad domains get blocked. Far fewer test that gmail.com, outlook.com, and their own company's domain never get blocked by an overzealous rule.

The fix isn't a better list. It's a test suite that runs against both sides — known disposable addresses and known-good addresses — every time the blocklist changes.

Build a test matrix before you touch the blocklist code

Before writing assertions, write down the categories you actually need to cover. A matrix that's too thin gives you false confidence; one that's unfocused wastes CI time. Four categories cover almost every real-world blocklist bug:

1. Known disposable domains (should block)

Addresses at cybertemp.xyz and a handful of other well-known disposable providers. These should always be rejected.

2. Lookalike corporate domains (should allow)

Domains that share substrings with disposable providers but are legitimate — a company called "TempCo" with a domain like mail.tempco.io is the exact shape of address a substring-matching rule flags by accident.

3. Major consumer webmail (should allow)

gmail.com, outlook.com, icloud.com, yahoo.com. If your rule ever blocks one of these, you've lost real signups and probably didn't notice for weeks.

4. Edge-case formatting (should normalize correctly)

Plus-addressing ([email protected]), mixed case ([email protected]), and trailing whitespace from copy-paste. Your normalization step should strip or lowercase these before the domain comparison runs, not after.

Each category needs a handful of real addresses you control, not synthetic strings you typed into a config file. That's where the disposable side gets interesting: you can't really assert "this blocks disposable mail" against a string that was never a real receiving inbox.

Use CyberTemp as live test traffic for the disposable side

CyberTemp gives you a real domain that actually receives mail, which matters for category 1. A hardcoded string like [email protected] proves your blocklist matches a pattern. It doesn't prove your signup flow handles a real submission the way it would in production — validation middleware, rate limiters, and logging all behave differently when there's a live request behind the address.

The pattern: generate a handful of per-test-case addresses, submit each through your actual signup endpoint, and assert on the HTTP response rather than on the blocklist function in isolation. That catches bugs that live in the glue code between your blocklist check and your signup handler — which is where most of these bugs actually hide.

import httpx

API_KEY = "tk_..."
HEADERS = {"X-API-Key": API_KEY}
BASE = "https://api.cybertemp.xyz"

def generate_test_address(case_name):
    return f"blocklist-test-{case_name}@cybertemp.xyz"

def confirm_inbox_exists(address):
    # GET /getMail also creates the inbox on first read
    resp = httpx.get(f"{BASE}/getMail", params={"email": address}, headers=HEADERS)
    resp.raise_for_status()
    return resp.json()

def run_blocklist_case(case_name, signup_url):
    address = generate_test_address(case_name)
    confirm_inbox_exists(address)
    signup_resp = httpx.post(signup_url, json={"email": address})
    return signup_resp.status_code

cases = ["should-block-1", "should-block-2", "should-block-3"]
for case in cases:
    status = run_blocklist_case(case, "https://yourapp.example.com/api/signup")
    assert status == 422, f"{case} should have been blocked, got {status}"

Pair that with the GET /getDomains endpoint to pull the current list of domains your CyberTemp account can issue inboxes on. If you maintain your own disposable-domain blocklist and want a sanity check that it's current, cross-referencing against a live, actively-used domain list catches drift that a static file review misses.

Automate the blocklist test in CI

This only pays off if it runs on every pull request that touches signup validation, not once a quarter when someone remembers. A few things make the automation durable instead of flaky:

  • Use a dedicated API key for test traffic. Keep it on a lower tier so a runaway test loop can't eat into your production quota — see how to pick the right CyberTemp plan for your workflow if you're not sure which tier fits a CI job that runs a few dozen requests per build.

  • Namespace test addresses by build ID. blocklist-test-{case}-{run_id}@cybertemp.xyz avoids collisions when multiple CI runs execute in parallel.

  • Handle rate limits explicitly. A blocklist suite that fires dozens of requests in a tight loop will eventually hit a 429. Back off and retry rather than failing the build on a transient limit — the pattern is the same one covered in handling rate limits and retries in CyberTemp API scripts.

  • Tear down test inboxes after the run. DELETE /inbox?email=... keeps your account's inbox count from creeping toward a plan limit purely from test noise.

Run the full matrix — blocked cases and allowed cases together — as a single CI job gated on any PR that touches the signup handler, the validation middleware, or the blocklist file itself. A failing "should allow gmail.com" assertion is just as valuable as a failing "should block cybertemp.xyz" one; most teams only wire up the latter.

Catch false positives in production before support tickets pile up

CI coverage handles known cases. Production will still find new ones. The cheapest signal is a logging hook on every rejected signup: log the domain, not the full address, and review the rejected-domain list weekly. A spike in rejections from one domain that isn't on your intended blocklist is a false positive you'll otherwise learn about from an angry email — to a different inbox, since the one they tried to use just got blocked.

If your blocklist source is a third-party list rather than one you maintain, add a manual override path: a short allowlist that takes precedence over the blocklist for domains you've confirmed are legitimate. This turns a code change into a config change, and config changes ship faster than the next deploy.

Bottom line

A disposable-email blocklist that only gets tested against domains it's supposed to catch is half-tested. The other half — real corporate domains, major webmail providers, and address formatting edge cases — is where the costly bugs live, because those failures silently reject real customers instead of loudly rejecting spam. Build the test matrix once, wire CyberTemp's API in as the live disposable-traffic side, and run the whole thing in CI on every change to the validation path.

If you're scripting this kind of test traffic regularly — blocklist checks, signup-flow QA, OTP extraction for other test suites — the paid tiers raise the per-key request ceiling past what CI churn needs and keep concurrent test inboxes from colliding with your production usage. Sign up if that's the workflow you're building.

Share
    How to Test a Disposable-Email Blocklist Without False Positives | CyberTemp Blog