Article
How to Verify an Email From the Command Line: Syntax, DNS, and SMTP Checks
By Unlimited Verifier Team ·

Summary
To verify an email from the command line, check its syntax, confirm the domain has MX records with dig, then ask the receiving server over SMTP whether it accepts the mailbox. A 250 reply means accepted and 550 5.1.1 means unknown mailbox, but catch-all domains and greylisting can distort results.To verify an email from the command line, check the syntax, look up the domain's MX records with dig, then ask the receiving server over SMTP whether it accepts the mailbox: a 250 reply means yes, and a 550 5.1.1 means no such mailbox. The method works for one address or a 50,000-row file, and it needs only a terminal and a short Python script. The SMTP step carries the real signal, and it is also where home-built checkers most often mislead. This guide covers the commands, the reply codes, and the catch-all and greylisting cases that produce wrong answers.
Quick answer
- Run three layers in order: syntax (regex), domain (
dig +short MX), then mailbox (SMTPRCPT TO, neverDATA). - Read the reply code: 250 means accepted, 550 with enhanced code 5.1.1 means unknown mailbox, 4xx means retry later, and 252 means the server cannot confirm the mailbox.
- Test each domain for catch-all behaviour: probe one random address. If it is accepted, every 250 on that domain is only Risky.
- Check outbound port 25 first. Many cloud providers block it by default, and your sending IP's reputation caps how accurate your results can be.
- Choose by volume: a script suits audits and small automated checks. For recurring large lists, compare your engineering hours against a hosted service.
What does it mean to verify an email from the command line?
Command-line verification means running each check yourself, in a terminal or script, rather than uploading a file to a hosted service. Each layer answers a different question, and each costs more than the one before it.
| Layer | Question it answers | Typical tools | Catches | Misses |
|---|---|---|---|---|
| Syntax | Is this shaped like an address? | regex, grep -E, email-validator |
Spaces, double @, missing domain or TLD |
Whether the mailbox exists |
| Domain (DNS) | Does the domain exist and accept mail? | dig MX, dig A, dnspython |
Unregistered domains, domains with no mail server | Live domains with no such user |
| Mailbox (SMTP) | Does the receiving server accept this recipient? | smtplib, swaks, nc |
Unknown mailboxes (550 5.1.1) | Catch-all domains, greylisting, providers that hide answers |
Order matters. Syntax checks are free and local. DNS costs one query per domain, so cache the results. SMTP costs a live connection to someone else's server, so run it last and only on rows that passed the earlier layers.
Layering also prevents false confidence. A typo domain such as gmial.com fails the DNS layer only if it has no MX record. If someone has registered the domain and set up mail records, it passes both the syntax and DNS checks, and only the SMTP layer has a chance of catching it.
Bottom line: Run the layers from cheapest to most expensive. Each later layer says more, and it costs more to run.
Why verify from the command line instead of using a hosted tool?
Use the command line when the check has to live inside your own system, such as a signup handler, a nightly audit, or a CI job, or when policy keeps your list off third-party servers. Use a hosted service when accuracy depends on sending reputation you have not yet built.
- Automation: A script fits into cron jobs, pipelines and form handlers, and it returns exit codes that other tools can read.
- Data control: The list stays on your infrastructure. Each probe still reveals your IP address and HELO name to the receiving server, so privacy is reduced, not eliminated.
- Cost at small volume: There is no per-email fee. You pay in server time and engineering hours instead.
- Where it loses: Large providers rate-limit or block probes from IPs they do not recognise. Those 4xx and 5xx replies say nothing about the mailbox, so your results can degrade without any visible error.
For form-level checks, see real-time email validation. Teams that want an email verification API and automation without running SMTP infrastructure usually buy it. The self-hosted email verifier guide covers the build-versus-buy decision in full.
Bottom line: The command line gives you control and automation. Hosted tools give you sending reputation and scale.
What do you need before running an SMTP check?
You need outbound TCP port 25, a reverse DNS record that matches your HELO name, a mailbox you control as the sender address, and a DNS library. A missing requirement usually shows up as bad data, when the real problem is your infrastructure.
- Outbound port 25. Test with
nc -vz -w 5 <mx-host> 25. "succeeded" means the port is open. A timeout usually means your network or cloud provider is blocking outbound port 25. "Connection refused" is different: your network reached the server, and the server refused the connection. For provider details, see which cloud providers allow outbound port 25. - Reverse DNS (PTR). The PTR name for your IP should match the name you send in EHLO. Receiving servers can treat a probe from an IP with no matching reverse DNS as suspicious. See how to set up reverse DNS for a verification server.
- A sender address you control. Use a mailbox on a domain you own, so any bounce or complaint has somewhere to go.
- Python 3 and dnspython. Install with
pip install dnspython. Any language with DNS and SMTP libraries works the same way.
If your provider blocks port 25 and you cannot change that, you have three options: move the check to a host that allows it, use a hosted service, or run DNS-only checks. DNS-only checks confirm that a domain can receive mail, but they never confirm a mailbox.
Bottom line: Confirm port 25 and reverse DNS before you write any code. Otherwise every result will look like a list problem.
How do you check email syntax from the shell?
Use a pattern that matches the practical subset of the address format, not the full grammar. The complete grammar in RFC 5322 allows quoted strings and comments that real mailboxes rarely use, and many systems reject them.
echo "jane.doe@example.com" | grep -E '^[^@[:space:]]+@[^@[:space:]]+\.[A-Za-z]{2,}$'
The command prints the address and exits with status 0 when the pattern matches, and with 1 when it does not. In scripts, test the exit code directly: if echo "$addr" | grep -qE '...'; then.
A syntax check is only a shape test. jane@acme.zz passes because the pattern does not check whether the TLD exists. Run it first anyway. Every SMTP probe costs time and reputation, so you should not spend either on a string with a space in it.
Bottom line: Syntax checks are cheap, local and worth running first, but they never confirm that a mailbox exists.
How do you check a domain's MX records with dig?
Run dig +short MX example.com | sort -n | head -1 to get the primary mail host. The output looks like 10 mx1.example.com., where the lower preference number is tried first, as RFC 5321 specifies. Use that host as your SMTP target.
Three cases need separate handling:
- No MX, but an A record. RFC 5321 (section 5.1) says that when no MX record exists, a sender falls back to the domain's A record. Check it with
dig +short A example.com. Sources and verifiers disagree on how to treat this case, and some mark no-MX domains invalid immediately. We recommend treating a domain with neither MX nor A records as Invalid, and treating an A-record-only domain as a fallback that still needs the SMTP check. - Null MX. A record of
0 .means the domain has explicitly stated that it accepts no mail, as defined in RFC 7505. Treat it as Invalid. - Timeouts and failed lookups. A timeout is not proof of a dead domain. Retry before you classify it.
Bottom line: The MX lookup tells you where mail should go. It does not tell you whether the person exists there.
How do you check a mailbox over SMTP without sending mail?
Open a connection to the primary MX host on port 25, send EHLO, MAIL FROM and RCPT TO, read the reply code, then send QUIT. A 250 reply to RCPT TO means the server accepts the recipient. You never send DATA, so no message is delivered. Here is an illustrative session; the exact reply text varies by server:
EHLO mail.yourdomain.com
250 mx1.example.com
MAIL FROM:<verify@yourdomain.com>
250 2.1.0 Ok
RCPT TO:<jane.doe@example.com>
550 5.1.1 <jane.doe@example.com>: Recipient address rejected: User unknown
QUIT
Reply codes drive the classification:
| Reply | Meaning | Our classification |
|---|---|---|
| 250 | Recipient accepted at RCPT | Valid, unless the domain is catch-all |
| 252 | Server cannot verify the user but will attempt delivery. RFC 5321 defines this for VRFY; some servers also use it for RCPT | Risky |
| 421, 450, 451, 452 | Temporary failure, greylisting or rate limit | Risky, then recheck later |
| 550 5.1.1 | Unknown mailbox. Enhanced codes are defined in RFC 3463 | Invalid |
| 550 5.7.x | Security or policy block (the 5.7 class in RFC 3463) | Risky. Usually this reflects your IP or sending policy more than the address. |
Here is a minimal checker. It is deliberately short. Retries, throttling and parallel runs come later.
#!/usr/bin/env python3
"""verify.py: syntax, MX, SMTP and catch-all checks for a CSV of addresses."""
import csv, random, re, smtplib, string, sys
import dns.resolver # pip install dnspython
FROM_ADDR = "verify@yourdomain.com" # a mailbox you control
HELO_NAME = "mail.yourdomain.com" # should match your PTR record
EMAIL_RE = re.compile(
r"^[A-Za-z0-9._%+\-]+@[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?"
r"(?:\.[A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?)*\.[A-Za-z]{2,}$")
def mx_hosts(domain):
try:
answers = dns.resolver.resolve(domain, "MX", lifetime=5)
pairs = sorted((r.preference, str(r.exchange).rstrip(".")) for r in answers)
return [host for _, host in pairs if host] # null MX "." yields no host
except dns.resolver.NoAnswer:
try: # RFC 5321 s5.1 implicit MX
dns.resolver.resolve(domain, "A", lifetime=5)
return [domain]
except Exception:
return []
except Exception:
return []
def smtp_probe(host, address):
"""EHLO, MAIL FROM, RCPT TO. Never sends DATA."""
server = None
try:
server = smtplib.SMTP(host, 25, timeout=10)
server.ehlo(HELO_NAME)
server.mail(FROM_ADDR)
code, msg = server.rcpt(address)
return code, msg.decode(errors="replace")
except (smtplib.SMTPException, OSError) as exc:
return 0, str(exc)
finally:
if server is not None:
try:
server.quit()
except Exception:
pass
def classify(address, mx_cache, catch_cache):
if not EMAIL_RE.match(address):
return "Invalid", "bad syntax"
domain = address.split("@", 1)[1]
if domain not in mx_cache:
mx_cache[domain] = mx_hosts(domain)
hosts = mx_cache[domain]
if not hosts:
return "Invalid", "no MX or A record"
code, msg = smtp_probe(hosts[0], address)
if code == 250:
if domain not in catch_cache: # probe once per domain
junk = "zz" + "".join(random.choices(string.ascii_lowercase + string.digits, k=14))
junk_code, _ = smtp_probe(hosts[0], f"{junk}@{domain}")
catch_cache[domain] = (junk_code == 250)
return ("Risky", "catch-all domain") if catch_cache[domain] else ("Valid", "250 accepted")
if 500 <= code < 600:
if "5.1.1" in msg:
return "Invalid", f"{code} 5.1.1 unknown mailbox"
return "Risky", f"{code} {msg[:60]}"
return "Risky", f"temporary, 252 or no reply ({code})"
if __name__ == "__main__":
mx_cache, catch_cache = {}, {}
with open(sys.argv[1], newline="", encoding="utf-8-sig") as src, \
open(sys.argv[2], "w", newline="", encoding="utf-8") as dst:
writer = csv.writer(dst, lineterminator="\n")
writer.writerow(["email", "category", "detail"])
for row in csv.DictReader(src):
addr = row["email"].strip().lower()
writer.writerow([addr, *classify(addr, mx_cache, catch_cache)])
Three details matter:
- Greylisting. Some servers reply 450 to the first attempt from an unknown sender and accept a retry later. The script marks these Risky rather than Invalid. Servers do not publish a standard retry interval, so we recommend one retry after 15 minutes and a second after an hour.
- Byte strings. The SMTP library returns reply text as bytes. The script decodes it before matching on
5.1.1. - Encoding. Files exported from Excel often start with a byte-order mark.
utf-8-sigstrips it, so the header readsemailrather than\ufeffemail, which would otherwise raise aKeyError.
A 250 at RCPT is not a guarantee of delivery. A mailbox can be full, a filter can reject the message after DATA, or a bounce can come back later. Treat 250 as "accepted for now," not as "will receive mail."
Bottom line: A 250 means the server accepts the recipient at that moment. It does not prove the address will receive mail or that the person opted in.
How do you detect catch-all domains from the command line?
Probe a random, nonexistent address at the same domain. If the server accepts it with a 250, the domain is a catch-all, and a 250 on a real address tells you nothing. The script does this once per domain and caches the result.
Caching matters because catch-all status belongs to the domain, not to the mailbox. In an illustrative list of 50,000 addresses spread across 3,000 domains, caching means about 3,000 extra probes. Without it, you could send one extra probe per accepted address, which is tens of thousands of connections to the same servers.
Catch-all addresses should go to Risky, where you can decide how to handle them. Hosted tools also flag catch-all domains. Unlimited Verifier includes catch-all detection in its checks; see its catch-all email verification page.
Bottom line: Test the domain once, not every address on it. A catch-all can hide dead mailboxes behind a 250.
How do you run the checks on a full CSV?
Parallelise across domains and limit each receiving server to one or two connections at a time. Throughput is set by your largest domain, not by the list's total size, because receiving servers rate-limit connections from each source.
The script above runs one address at a time. To go faster, wrap the classifier in a per-domain semaphore:
import threading
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
slots = defaultdict(lambda: threading.BoundedSemaphore(1)) # one probe per domain at a time
slot_lock = threading.Lock()
def throttled_classify(addr, mx_cache, catch_cache):
domain = addr.rsplit("@", 1)[-1]
with slot_lock:
sem = slots[domain]
with sem:
return classify(addr, mx_cache, catch_cache)
with ThreadPoolExecutor(max_workers=20) as pool:
results = list(pool.map(lambda a: throttled_classify(a, mx_cache, catch_cache), addresses))
Set the semaphore to 2 only if your provider tolerates it. Without the limit, a single large provider receives dozens of simultaneous connections and starts refusing them. The guide on how to avoid IP blacklisting when verifying emails yourself covers throttling in more depth, and how to scale SMTP email verification to millions covers the infrastructure side.
Bottom line: Parallelise across domains and throttle within each domain. Your run time is usually set by the largest domain in the list.
How do you verify a single email from the command line?
For one address, you have three quick options.
- Reuse the script. Run
python3 -c "from verify import classify; print(classify('jane@example.com', {}, {}))". It returns a tuple such as('Valid', '250 accepted'). - Use swaks. Find the primary MX host with
dig +short MX example.com | sort -n | head -1, then runswaks --server mx1.example.com --from verify@yourdomain.com --to jane@example.com --quit-after RCPT. The--quit-after RCPTflag stops the conversation before DATA, so nothing is delivered. - Use a hosted checker. The free email checker runs the same layers without port 25 setup. For programmatic checks, the email verification API takes your API key and works from curl or any HTTP client. API access is on the Pro plan, not the Free plan.
Bottom line: For one address, a one-line swaks command is the fastest route. For a file, use the script or a hosted batch.
How accurate is a command-line check, and how do you measure it?
No independent benchmark of command-line SMTP checks is available that we can cite, and results depend on your IP reputation, the domains in your list, and when you run the check. You can measure accuracy yourself.
Pull about 100 addresses that hard-bounced in your history and about 100 that have engaged recently. Run both through your checker. A good checker should flag most of the first group as Invalid and most of the second as Valid, with the rest in Risky. Track the errors separately:
- Accepted, then bounced: usually a catch-all domain, or a provider that accepts everything at RCPT.
- Rejected, but the person is real: usually a probe block, rate limit or greylisting. Retry from a cleaner IP before you trust the result.
Bottom line: Accuracy is a number you calculate from your own list, not a figure you copy from a vendor page.
Which command-line approach should you choose?
Choose by how often you verify, how many addresses you process, and whether you can keep a sending IP clean. The table compares the main options based on their public documentation.
| Approach | Needs port 25 from you | Catch-all detection | Cost | Differentiator and main limit |
|---|---|---|---|---|
regex + dig only |
No | No | Free | Confirms domains, never mailboxes. Its strength is pre-filtering. |
| Your own script (dnspython + smtplib) | Yes | Yes, with a probe | Server plus engineering time | You control every rule. Your IP's reputation is the accuracy ceiling. |
| swaks (Perl SMTP test tool) | Yes | Manual, by probing | Free, open source | --quit-after RCPT stops before DATA. It runs single sessions, so batching and parsing are yours to build. |
| email-validator (Python) | No | No | Free, open source | Syntax checks plus optional DNS deliverability checks. It does not check the mailbox. |
| check-if-email-exists (Rust, self-hosted) | Yes | Yes | Free to self-host, plus your infrastructure | Runs full SMTP checks as a binary or service. You host it, so it faces the same port-25 and reputation limits as your script. See the Reacher email verifier review and running it with Docker. |
| Unlimited Verifier (hosted web app or API) | No, because the service runs the checks | Yes | Standard verification is unlimited on every plan. Free is $0. Pro is $29/month, or $25/month billed annually. | Uploads CSV or Excel files up to 10MB, detects the email column automatically, sorts results into Valid, Risky and Invalid, and exports CSV, Excel or JSON. Free lists are capped at 150 emails. Pro lists are capped at 25,000 each. API access is on Pro. |
Unlimited Verifier also publishes its verification engine on GitHub. You can read the free email verifier source code on GitHub to see how the checks work. The hosted service adds the three-bucket output, a batch workflow, and no server to maintain. The company states 99.5% accuracy for deep verification; that is its own figure, not an independent benchmark. If you are evaluating older open-source projects, see Trumail alternatives for email verification. For the wider market, see our guide to best email verification tools.
Bottom line: A script is the cheapest option in money and the most expensive in time and reputation. A hosted service costs a monthly fee but removes both burdens.
How do you verify a CSV from the terminal, step by step?
Setup takes less than an hour, mostly spent on the port-25 check. The run time depends on list size, as the worked example below shows.
- Confirm port 25. Run
dig +short MX yourdomain.com, thennc -vz -w 5 <mx-host> 25. If you see a timeout, switch to a host that allows outbound 25, or use a hosted service. - Install the library. Run
pip install dnspython. - Save the script. Save the code above as
verify.pyand setFROM_ADDRandHELO_NAME. Confirm the HELO name matches your PTR record. - Test known addresses. Run the single-address command from the earlier section on a mailbox you own. Expect
('Valid', '250 accepted'). Then test a made-up local part on your domain. If your server rejects it with 5.1.1, the result is Invalid. If it accepts everything, the result is Risky because the domain is a catch-all. - Prepare the input. Create
contacts.csvwith a header row that includesemail. In Excel, use Save As and choose "CSV UTF-8." - Run the checks. Run
python3 verify.py contacts.csv results.csv. - Flag disposable domains. Put one domain per line in
disposable.txt. You can start from the open-source disposable email domain lists on GitHub. Then run:
awk -F, 'NR==FNR{bad[tolower($1)]=1; next}
FNR==1{print $0",is_disposable"; next}
{split($1,p,"@"); print $0 "," ((p[2] in bad) ? "yes" : "no")}' disposable.txt results.csv > flagged.csv
- Review the categories. Open
flagged.csv, filter on thecategorycolumn, and check a sample of Risky rows by hand. Look especially at the "temporary" and "catch-all" details. - Keep only Valid rows. Run
awk -F, 'NR==1 || $2=="Valid"' results.csv > valid.csv, then re-importvalid.csvinto your email platform. Unlimited Verifier does not have native ESP, CRM or Zapier integrations, so the export, verify and re-import loop is the workflow for file-based checks.
If you would rather skip the port-25 setup, upload the same CSV to upload and verify a list. Results come back in the same three buckets. Sign up for a free account to try it. Free results are kept for 24 hours, so export them before you close the page.
Bottom line: Test the infrastructure before you trust the output, and review Risky rows before you act on them.
Worked example: how long does a 50,000-row list take?
This example is illustrative. The 1.5-second probe latency and the 30% concentration in one domain are assumptions, not measurements. The arithmetic is what matters.
Assumptions: 50,000 addresses. 15,000 of them (30%) sit at one large consumer domain. Each probe takes about 1.5 seconds. The script allows one connection at a time per receiving server and runs 20 workers in total.
Self-run:
- The big domain: 15,000 probes × 1.5 s = 22,500 s, or 6.25 hours, all on one connection.
- The other 35,000 addresses: 35,000 × 1.5 s ÷ 19 workers ≈ 2,760 s, or about 46 minutes. The other workers finish long before the big domain does.
- Total wall-clock time is the longer of the two, about 6.25 hours. Allowing two connections per domain would cut the big domain to about 3.1 hours.
- Catch-all probes add roughly one connection per domain, which is negligible here.
Hosted, on Unlimited Verifier's plan limits:
- Free: 50,000 ÷ 150 emails per list = 333.3, so 334 lists. At 25 lists a month, that is 334 ÷ 25 = 13.4, so 14 months. The Free plan also has no API access and keeps results for 24 hours.
- Pro: 50,000 ÷ 25,000 per list = 2 lists. Pro allows unlimited lists, so the job fits in one month. At $25/month billed annually, that is $300 a year. If you run this job monthly, each run costs $25 ÷ 50 = $0.50 per 1,000 addresses. Standard verification has no per-email fee on any plan.
- API alternative: 50,000 ÷ 10,000 per request = 5 requests. Pro includes 100,000 API emails a month, so one run of this size uses half the monthly allowance. See the email verification API page for details.
What the numbers mean: A one-off audit of this size is manageable on a self-run script, at a cost of about six hours of waiting and monitoring. A recurring job, or one where you cannot risk your IP's reputation, favours a hosted plan at $25 to $29 a month for this volume. Teams building email verification for ecommerce and SaaS pipelines often reach the same break-even point. The email verification pricing guide shows how the trade-off shifts at other volumes.
Bottom line: The script's real cost is hours of babysitting and reputation risk, not money. Above a few thousand addresses, that trade-off usually favours a hosted service.
What are the most common mistakes?
Most failures come from infrastructure and interpretation, not from the code.
- Sending mail to "double-check." Any DATA command or real message turns a verification run into a delivery. Keep every probe at RCPT.
- Treating 250 as proof of consent. A valid mailbox is not an opted-in subscriber. Verification supports email verification compliance and hygiene, but it does not replace consent records.
- Misreading catch-all results. If the domain accepts everything, the 250 means nothing for that individual address.
- Marking greylisted addresses Invalid. A 4xx reply is a retry signal, not a verdict.
- Probing from an IP without reverse DNS. Some receiving servers reject or throttle probes from unfamiliar IPs, so every result from that IP becomes suspect.
- Hammering one provider. Opening many connections to one MX host often triggers rate limits within the first few thousand addresses, depending on the provider.
- Trusting regex alone.
jane@gmial.compasses the pattern. Only the DNS and SMTP layers can tell you whether a domain works. - Skipping the Excel byte-order mark. The header becomes
\ufeffemail, and the script fails with aKeyError. - Verifying a list you have no right to email. Before you send to a purchased or scraped list, read is it legal to run your own SMTP verification. Also consider whether email verification for sales prospecting fits your outreach model.
- Letting the list decay. Lists degrade as people change jobs and mailboxes close. Schedule re-checks, as described in email list maintenance best practices.
Bottom line: Protect your IP, read 4xx and catch-all results correctly, and remember that a valid mailbox is not an opted-in one.
How we compared (and limitations)
This guide is based on public documentation: RFC 5321 for SMTP and the implicit MX fallback, RFC 5322 for address syntax, RFC 3463 for enhanced status codes, RFC 7505 for null MX, the Python smtplib documentation, the dnspython project site, and the public documentation of the tools named above. We have not benchmarked these tools against each other or run these scripts against a live list of providers.
- Provider behaviour changes. Large consumer providers adjust rate limits and probe handling without notice. Treat the 5.7.x and rate-limit behaviour described here as a pattern to test, not a guarantee.
- Unlimited Verifier figures come from its published plan details. The 99.5% accuracy figure is the company's own stated number for deep verification, not an independent benchmark.
- Worked-example run times are illustrative and depend on your latency, concurrency and domain mix.
- Port-25 policies differ by provider and account type, and they change. Check your provider's current documentation before you build a pipeline around them.
Three-layer check for one address
| Step | Command or rule | Result for ana@gmial.com |
|---|---|---|
| 1. Syntax | regex ^[^@ ]+@[^@ ]+\.[a-z]{2,}$ |
Pass |
| 2. DNS | dig +short MX gmial.com |
Returns mail host, pass |
| 3. Catch-all probe | RCPT TO with random address | 550 5.1.1, domain is not catch-all |
| 3. Target check | RCPT TO ana@gmial.com | 550 5.1.1, mark Invalid |
Reply codes: 250 accepted, 550 5.1.1 unknown mailbox, 4xx retry, 252 cannot confirm.
Frequently asked questions
What does a 250 reply mean when verifying email over SMTP?
A 250 reply to RCPT TO means the receiving server accepted the recipient address. It does not guarantee the mailbox is active, because some servers accept every address. Test the domain with a random address to check for catch-all behaviour before trusting a 250.
What is the dig command to check email MX records?
Run dig +short MX example.com to list the mail servers for a domain. If the output is empty, the domain has no MX records and usually cannot receive mail. If it returns hostnames with priority numbers, the domain accepts mail and you can connect to the lowest-priority server.
Why does my SMTP email check fail or time out?
Most timeouts happen because outbound port 25 is blocked by your network or cloud provider. Test with nc -vz mx-host 25 first. If the port is blocked, request an unblock from your provider or run the check from a host that allows outbound SMTP.
Should I send an actual email when verifying addresses?
No. Verification stops after the RCPT TO command and never sends the DATA command, so no message body is transmitted. Always issue QUIT after the reply so the connection closes cleanly and no mail is delivered.
What is a catch-all domain and why does it affect verification?
A catch-all domain accepts mail for any address, real or not, so every SMTP check returns 250. Probe one random address at the domain first. If the random address is accepted, mark every 250 on that domain as Risky rather than Valid.
What does greylisting do to SMTP email verification?
Greylisting makes the server reply with a 4xx temporary error on first contact and accept mail only on a later retry. Treat 4xx as unknown, retry after a delay, and never count it as a valid or invalid result.
Can I verify email with nslookup instead of dig?
Yes. nslookup -type=mx example.com returns the same MX records as dig on most systems. dig is preferred in scripts because its +short output is easy to parse, but both confirm whether the domain publishes mail servers.
Is command-line email verification legal and compliant?
Checking whether an address exists is generally less intrusive than sending mail, but legality depends on your jurisdiction and purpose. Confirm your use fits your privacy policy and applicable rules such as GDPR or CAN-SPAM before running checks on third-party addresses.
How many addresses can a command-line SMTP check handle?
A script can process large lists, but throughput is limited by rate limits and by receiving servers that block repeated probes. Batch by domain, cache DNS results, pause between connections, and expect that bulk runs from one IP will get throttled or blocked.
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 standard verification on all plans, including Free, with no per-email fees.
- Catch-all detection so you know which domains accept every address.
- Clear Valid / Risky / Invalid results, exportable as CSV, Excel or JSON.
- An open-source verification engine you can inspect on GitHub.
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.