Article

How to Run check-if-email-exists with Docker: Setup, API and Port 25 Checks

By Unlimited Verifier Team ·

Diagram showing an application sending a POST request to a check-if-email-exists Docker container, which runs an SMTP probe over port 25 to the recipient's mail

Summary

To run check-if-email-exists with Docker, pull the reacherhq/backend image, publish port 8080, and POST an address to /v0/check_email, then read is_reachable. Network setup, especially outbound port 25, determines whether most results are usable.

To run check-if-email-exists with Docker, pull the reacherhq/backend image, publish port 8080, and POST an address to /v0/check_email, then read the is_reachable field, which returns one of four values: safe, risky, invalid or unknown.

This guide is part of our self-hosted email verifier series. The Docker step takes minutes. The harder part is the network your server sends from, which decides whether most results are usable. This guide covers both, plus batch processing, production settings and when self-hosting is the wrong choice.

Quick answer

What is check-if-email-exists, and what does the Docker image add?

check-if-email-exists is an open-source Rust library from the Reacher project. It checks an address by running the early steps of an SMTP conversation: it validates the syntax, looks up the domain's MX records, and asks the receiving server whether it would accept that recipient. RFC 5321 defines the dialogue. The probe ends before any message body is sent, so the library doesn't deliver mail.

The library is a Rust crate, so you'd normally have to compile Rust to use it directly. The Docker image wraps it in an HTTP service, which any language that can make a web request can call. The project's GitHub repository and the Docker Hub listing document the current image and options.

Self-hosting matters for two reasons: addresses never leave your infrastructure, and per-check costs don't scale with volume the way a per-email plan does. The trade-off is that you own the network side of every check. For an overview of the project's strengths and limits, see our Reacher email verifier review.

The insight most guides skip is that the container is the easy part. Results depend on the IP address, the reverse DNS record and the sender identity your server presents. A tidy container on a poorly configured host produces a lot of unknown results, which makes the verifier look broken when the network is the problem.

Bottom line: The Docker image turns the library into a local API, but result quality depends on where and how you run it.

What do you need before you run check-if-email-exists in Docker?

You need a Linux host with Docker Engine, a stable public IP address and outbound TCP port 25 open. Port 25 is the most common blocker, so test it before you install anything.

Run this from the server, using Gmail's public inbound mail server as the target:

nc -vz gmail-smtp-in.l.google.com 25

A successful connection means port 25 is open. A timeout usually means your provider is blocking it. Policies differ: some providers lift the restriction after a support request, and others don't allow it for certain account types. A host that can't reach port 25 returns unknown for almost every address, which is a network problem, not a sign that the list is bad.

Two more settings matter:

For server sizing, see email verification server requirements. In practice, throughput is set more by concurrency and provider response times than by CPU or memory.

Bottom line: Confirm port 25 and reverse DNS before installing anything. Otherwise the results won't reflect the addresses themselves.

How do you run the Reacher container with Docker?

Follow these steps on a fresh Linux host.

  1. Install Docker Engine. Follow the official Docker documentation for your distribution, then run docker --version to confirm it works.
  2. Test port 25 with the nc command above.
  3. Create a secret and store it. Run openssl rand -hex 32 once and save the output in a .env file next to your Compose file, like this: RCH_HEADER_SECRET=<your value>. Generating a new secret on every run would lock you out of your own service. The variable name comes from the project README; confirm it for your version.
  4. Choose a version tag. Open the image's tags page on Docker Hub and pick a specific version. Avoid latest in production, because an upgrade can change response fields or defaults without warning.
  5. Pull the image:
    docker pull reacherhq/backend:<version>
    
  6. Start the container, bound to localhost:
    docker run -d --name reacher --restart unless-stopped \
      --env-file .env -p 127.0.0.1:8080:8080 reacherhq/backend:<version>
    
    Binding to 127.0.0.1 keeps the API off the public internet. If other servers need access, put it on a private network or behind a reverse proxy with authentication.
  7. Check the logs with docker logs reacher. Look for a line showing the server is listening on port 8080.
  8. Run a test check with the secret in the header. The header name is also set in the README; x-reacher-secret is the name used in the examples below.
    source .env
    curl -X POST http://localhost:8080/v0/check_email \
      -H "Content-Type: application/json" \
      -H "x-reacher-secret: $RCH_HEADER_SECRET" \
      -d '{"to_email": "test@example.com"}'
    

If step 8 hangs, go back to the port 25 test. If it returns JSON with an is_reachable field, the service works. If it returns an authorization error, check that the header name matches your version's README.

Bottom line: A pinned tag, a generated secret, a localhost-only binding and a test call make a working setup you can build on.

How do you read the is_reachable response?

The main field is is_reachable, which takes one of four values. Map them to your own categories, and always keep the raw value.

is_reachable What it usually means What to do
safe The receiving server accepted the recipient during the probe. Eligible for sending, after you check the other flags.
risky Deliverable but uncertain, such as a catch-all domain, a disposable address or a role account like info@. Hold back from your main sends.
invalid The server rejected the recipient, or the domain has no usable mail setup. Suppress permanently.
unknown No definitive answer: timeouts, blocking, greylisting or rate limits. Retry later. Don't treat it as invalid.

The response also includes detail sections for syntax, MX records, SMTP behaviour and flags such as disposable and role-based addresses. Field names can change between versions, so inspect a sample response from your pinned version before you write parsers against it.

For a full explanation of unknown results, see why self-hosted checks return unknown.

Bottom line: Treat safe as a pass, invalid as a removal, risky as a hold and unknown as a retry.

What should you change before running this in production?

Five settings separate a demo from a service you can rely on.

Whether you need proxies is a separate decision, covered in do you need proxies for SMTP verification.

Bottom line: Lock down the endpoint, control the sender identity and log raw results before you trust the output.

How do you check a whole list with a script?

The endpoint checks one address per request, so batching is your job. The script below reads a CSV with a header row, shuffles the addresses, runs a fixed number of concurrent checks, retries failures and writes the results to a new file. This is the core of any email verification API and automation workflow you build yourself.

import csv, random, time, requests
from concurrent.futures import ThreadPoolExecutor

API = "http://localhost:8080/v0/check_email"
HEADERS = {
    "Content-Type": "application/json",
    "x-reacher-secret": "YOUR_SECRET",  # header name per your version's README
}

def check(email, attempts=3):
    for attempt in range(attempts):
        try:
            r = requests.post(API, json={"to_email": email},
                              headers=HEADERS, timeout=90)
            r.raise_for_status()
            return email, r.json().get("is_reachable", "unknown")
        except requests.RequestException:
            time.sleep(2 ** attempt)  # back off before retrying
    return email, "error"  # rerun these later; never delete them

with open("emails.csv", newline="") as f:
    reader = csv.reader(f)
    next(reader)  # skip the header row
    emails = [row[0].strip() for row in reader if row and row[0].strip()]

random.shuffle(emails)  # spread load across providers

with ThreadPoolExecutor(max_workers=10) as pool, \
     open("results.csv", "w", newline="") as out:
    writer = csv.writer(out)
    writer.writerow(["email", "is_reachable"])
    for email, status in pool.map(check, emails):
        writer.writerow([email, status])

The random.shuffle line matters most. Sorting by domain sends bursts of addresses to one provider, which can trigger rate limits and a wave of unknown results. Shuffling keeps the pressure even. Once the run finishes, feed the error rows back through the script in a second pass, and repeat the pass a few days later for anything still unresolved. Those cadences are our suggestion, not a published standard.

Bottom line: Use a shuffled list, a fixed worker pool, backoff and an error status that triggers a rerun rather than a deletion.

How long will a list take to check?

Throughput equals workers divided by the average seconds per check. The numbers below are illustrative, not measured. Time a sample of your own list, perhaps a few hundred addresses, before you plan.

Suppose each check averages 5 seconds because of slow or timed-out servers:

Doubling workers halves the time only until providers start rate-limiting you. Past that point you get more unknown results, not faster ones. Start at 10 workers, measure your unknown rate, and increase only if it stays low.

Bottom line: Plan capacity from measured latency, and treat a rising unknown rate as the signal to slow down.

Should you self-host check-if-email-exists or use a managed verifier?

The right choice depends on who runs the infrastructure, how often you verify and whether data must stay in-house. The table compares the self-hosted Docker setup with Unlimited Verifier's plans, based on the product's public plan details.

Factor Self-hosted check-if-email-exists (Docker) Unlimited Verifier Free Unlimited Verifier Pro
Cost Server cost plus setup and upkeep time $0 $29/month, or $25/month billed annually
Who runs SMTP probing You, including port 25 and IP reputation The service The service
Output categories Four is_reachable values you map yourself Valid, Risky, Invalid Valid, Risky, Invalid
Batch handling Your script, one address per request 25 lists a month, up to 150 emails each Unlimited lists, up to 25,000 emails each
Catch-all detection Depends on the response fields your version returns Detected and flagged Detected and flagged
Export JSON, plus whatever your script writes CSV, Excel or JSON CSV, Excel or JSON
API Built in, self-run No API access API access, 100,000 emails a month
Result retention Your own storage 24 hours 30 days
Best fit Teams with infrastructure skills and data-residency needs Small, occasional lists Recurring cleanups without running servers

For a broader view of options, see the best email verification tools. For cost modelling, read self-hosted vs SaaS cost. What counts as a billable check is explained in email verification pricing.

Unlimited Verifier also publishes its open-source verification engine on GitHub, so you can inspect how it works. For the trade-offs of open-source verifiers in general, read pros and cons of open-source email verifiers.

Bottom line: Self-hosting suits teams with infrastructure skills and a reason to keep data in-house. A managed plan suits teams that want a clean list without running servers.

Worked example: cleaning a 50,000-row list

Assume a SaaS company has a 50,000-row export from its email verification for ecommerce and SaaS signup database and wants it verified this month.

Self-hosted route

Unlimited Verifier Pro route

The decision: For a single 50,000-row list, the managed route costs $29 against roughly $300 of setup time before you've counted server costs. Self-hosting becomes cheaper only at higher, recurring volume, and the break-even point depends on your server and staff costs. Model it with the self-hosted vs SaaS cost guide before you commit. If sales prospecting is the goal, see email verification for sales prospecting.

Bottom line: For one list of this size, $29 and two uploads beat a day of server work. Self-hosting pays off only when your recurring volume justifies the infrastructure.

Does a self-hosted setup meet compliance needs?

Verification helps with list hygiene, but it doesn't prove anyone opted in. Keep your consent records separate, because they're what show you had permission to email each person. For US email, use the FTC's CAN-SPAM compliance guide as a baseline. The wider practice is covered in email verification compliance and hygiene and email list maintenance best practices.

Self-hosting has a real privacy advantage: addresses never leave your infrastructure. That matters when your legal team asks where personal data is processed, a question covered in self-hosted email validation for data residency.

Bottom line: Verification cleans a list, while consent records show you were allowed to email it. You need both.

What mistakes should you avoid when self-hosting?

Bottom line: When self-hosted setups underperform, the cause is usually the network and the workflow rather than Docker itself.

How we compared (and limitations)

This guide is based on public documentation for the check-if-email-exists project, the Reacher Docker image and Unlimited Verifier's product details. We haven't benchmarked accuracy, throughput or provider behaviour across the two routes. The latency and cost figures are illustrative, and the $50 hourly rate is an assumption.

Environment variable names, header names, response fields and image tags can change between releases, so check the current README and Docker Hub page before you build on them. Unlimited Verifier's 99.5% accuracy figure for deep verification is the company's own stated figure, not an independent benchmark.

To try the managed route on your own data, create a free account and upload a list. If you need programmatic checks, the email verification API is available on the Pro plan. Catch-all email verification explains how those domains are flagged, and if you're building your own service, see how to build an email verification service from scratch for the wider architecture.

Bottom line: Run both routes on a sample of your own data, and choose based on measured results rather than on claims.

Result handling by is_reachable value

is_reachable Meaning Action
safe Server accepted the recipient Keep and send
risky Accepted but may be catch-all or disposable Send with caution or segment
invalid Recipient rejected or bad syntax/domain Remove
unknown Probe blocked, timed out or greylisted Retry later, don't delete

Frequently asked questions

Which Docker image runs check-if-email-exists?

The reacherhq/backend image runs check-if-email-exists as an HTTP service. Pin a specific version tag rather than latest so your results stay consistent across upgrades. Check the project's GitHub repository and Docker Hub listing for current tags and options.

Which port does the check-if-email-exists container use?

The container listens on port 8080 by default. Bind it to 127.0.0.1 so only local services can reach the API, and put a reverse proxy with authentication in front if other machines need access.

Why does check-if-email-exists return unknown?

unknown usually means the receiving server blocked the probe, timed out or greylisted you, not that the address is dead. Retry later, and check your IP reputation, reverse DNS and outbound port 25 access.

Do I need outbound port 25 for check-if-email-exists?

Yes. SMTP probing connects to recipient mail servers on TCP port 25. Many cloud providers block this by default, so test it with nc before installing. Some providers lift the restriction after a support request.

Can I batch check emails with the Docker API?

The endpoint checks one address per request, so batch jobs need a script that sends requests with limited concurrency. Keep concurrency low to avoid rate limits and reputation problems on your sending IP.

Does check-if-email-exists send any email?

No. The SMTP conversation stops before any message body is sent, so the verifier does not deliver mail. It only checks whether the receiving server would accept the recipient.

Is self-hosting check-if-email-exists cheaper than a hosted verifier?

It can be at high volume because per-check costs don't scale with usage like a per-email plan. However, you pay for the server, IP reputation management and maintenance, so compare total cost at your expected volume.

Is check-if-email-exists accurate for all domains?

No single verifier is accurate for every domain. Some providers, especially large consumer mailboxes, block or obscure recipient checks, so treat results as probabilistic and validate a sample against known addresses.

Cut Bounces and Protect Your Sender Reputation With Unlimited Email Verification

Every invalid address you send to hurts your sender reputation and your inbox placement. Verifying your list before each send means fewer bounces, healthier deliverability, and a predictable cost. With Unlimited Verifier, standard verification is unlimited on every plan, with no per-email fees.

Unlimited Verifier checks syntax, domain, MX records and the SMTP mailbox. It also detects catch-all domains and flags disposable and role-based addresses. Export a CSV from your email platform or CRM, upload and verify the list, then re-import the clean results. You can also automate checks with the email verification API.

Free Pro
Price $0 $29/month ($25/month billed annually)
Lists 25 a month, up to 150 emails each Unlimited, up to 25,000 emails each
Deep verifications 750 a month 25,000 a month
API access No Yes (100,000 emails a month)
Result retention 24 hours 30 days

Why teams choose Unlimited Verifier

Unlimited Verifier states 99.5% accuracy for deep verification.

Create a free account and verify your next list before you hit send.

Want to test a single address first? Try the free email checker.