Validate Email Addresses Using CLI with Real-Time Response Codes
Test and verify email addresses instantly from the command line with real-time response codes.
Why Validate Emails from the Command Line?
You’re staring at a failed deployment. A test script halts because a single malformed email slipped through. You run the same check manually again—still no error. But the logs say the delivery failed. You know it’s not the code. It’s the email list. And you’re wasting time re-running jobs just to spot one bad address.
That’s the real cost of manual email validation: delays, hidden errors, and lost trust in your pipeline. Validate email addresses using CLI with real-time response codes—automated, instant, and embedded in your workflow. It’s not just faster. It’s the only way to scale verification without slowing down development.
With CLI tools, you don’t wait for a dashboard refresh or a batch job to finish. You get a clear, server-level response—accepted, rejected, or greylisted—within milliseconds. This isn’t a bonus. It’s essential for DevOps: CI/CD, backend scripts, and system tests where every second counts and accuracy is non-negotiable.
Key takeaways
- CLI email validation delivers real-time response codes directly from the mail server, eliminating wait times for batch results.
- Automating verification in the CLI integrates seamlessly into CI/CD pipelines, reducing errors before code reaches production.
- Real-time feedback enables immediate corrections during testing, preventing failed deliveries and improving sender reputation.
What Does 'Real-Time Response Code' Mean in Email Verification?
When you validate email addresses using CLI with real-time response codes, you're getting immediate feedback from the recipient's mail server during the SMTP handshake. These codes—like 250 (success), 550 (user unknown), or 450 (mailbox temporarily unavailable)—are standardized signals the server sends at each step. MailTester captures and interprets these in real time, turning raw codes into clear verdicts: valid, invalid, catch-all, or risky.
How SMTP Response Codes Translate to Verdicts
Each code is part of a documented protocol. For example, a 250 response means the server accepts the address and mail can be delivered. A 550 means the mailbox doesn’t exist—definite invalid. A 450 often points to temporary issues like greylisting or high load, making the address potentially risky but not outright invalid. These codes aren’t guesses; they’re the mail server’s direct answers.
Let’s say you're running a CLI command with MailTester's API to check a list of addresses. Behind the scenes, our system establishes a temporary SMTP connection. The server replies immediately with a code. We don’t wait for bouncebacks or delayed responses—we interpret it instantly using a proven logic layer based on RFC 5321, the core SMTP specification.
Not all codes are equal. A 551 (user not found) usually means the address is dead. But a 450 could mean a temporary block. That’s why real-time interpretation matters. One second delay means you miss the difference between "not deliverable today" and "never deliverable."
Why Real-Time Matters in Bulk Verification
When verifying a thousand addresses, waiting for days to get bounce reports is wasteful. Real-time codes let you act fast—filter out 550s immediately, flag 450s for retry later, and trust 250s. This speed is built into MailTester’s CLI and API. If you're syncing with Mailchimp or Klaviyo, you can plug in our API for instant validation before a send.
MailTester maps response codes to actionable verdicts with 98.9% accuracy—accurate enough to trust for high-volume campaigns. You’re not relying on third-party databases or fuzzy heuristics. You’re seeing what the mail server actually says, in real time.
For full transparency, check the pricing, and start with 100 free verifications. Once you run a test, you’ll see how response codes deliver clarity—no guesswork, just facts from the server itself.
How MailTester Delivers Real-Time Response Codes via CLI
You can validate email addresses using CLI with real-time response codes by sending a request to MailTester’s REST API with curl. The API returns full SMTP-level responses, precise timing, and a clear verdict—valid, invalid, catch-all, or risky—within 300ms on average, directly from the mail server. No guesswork, no heuristics. Just real-time server interaction.
Instant Verification with Full SMTP Transparency
When you use curl to call MailTester’s API, you don’t just get a “valid” or “invalid” label—you get the raw SMTP codes returned by the recipient’s mail server. This includes the exact response like 550 5.1.1 User unknown or 250 2.0.0 OK, which tells you exactly why an email was rejected or accepted. This level of detail is critical when diagnosing deliverability issues or debugging automation flows.
The API processes each email through an actual SMTP session, simulating how a real email would be received. This means results are based on live server behavior—not pattern matching, not domain reputation databases, not assumptions. It’s the same validation used by enterprise senders to pre-check lists before hitting their ESPs.
Use Case: Automating Email Safety in CI/CD or Scripts
Imagine you’re building a script to verify user emails during signup. With MailTester’s API, you plug in a single email address via curl and get a response stack including: timing, remote server code, and a clear verdict. This works in bash, Python, or any shell environment—no SDK needed.
For example, a request to the verification API returns structured JSON with smtp_code, response_text, and verdict. You can parse it directly. This means your automation can reject invalid emails before they even enter your database, dramatically reducing bounce rates and protecting sender reputation.
This approach aligns with standards like RFC 5321 and RFC 6521, which define how SMTP servers should respond to incoming mail. Tools that rely on heuristics or static databases can’t match the precision of real SMTP interaction. And unlike some tools that claim 99% accuracy, MailTester’s 98.9% accuracy is measured against actual server behavior—the only reliable baseline.
For teams managing large email lists, bulk verification is an efficient extension of this same logic. Whether you’re running a one-off check or scanning thousands daily, you get the same real-time insight—no delays, no guesswork. And since credits never expire, you can use them whenever you need, without time pressure.
Validate Email Addresses Using CLI with Real-Time Response Codes
You can validate email addresses using CLI tools like curl or a scriptable shell environment (Bash/Zsh) by sending a request to MailTester’s API with your API key and the email to check. The response includes a verdict and smtp_code—real-time indicators of validity, delivery risk, or bounce reason. This gives you immediate, actionable insight without leaving your terminal.
Set up your environment and access the API
- Ensure you have
curlinstalled or a shell environment like Bash or Zsh. These are standard on most Unix-like systems and widely available via package managers. - Log in to your MailTester account and navigate to the dashboard to retrieve your API key. This key authenticates your requests and tracks usage.
Send and parse the verification request
- Use
curlto send a POST request to https://api.mailtester.com/v1/verify with your email and API key in the headers. The request body should be a JSON object containing the email address. - Include the API key in a header as
X-API-Key: your-keyto authenticate your request. Without it, the API returns an error. - Parse the JSON response for two key fields:
verdict(which will bevalid,invalid,catch-all, orrisky) andsmtp_code(a numeric code indicating the SMTP-level reason, like 550 for non-existent address). - Use the
smtp_codeto interpret bounces—codes like 550 or 551 typically mean hard bounces, while 554 may indicate spam blocking. These codes align with standards defined in RFC 5321 and are used by mail servers globally.
For example:
curl -H 'X-API-Key: your-key' -d '{"email": "[email protected]"}' https://api.mailtester.com/v1/verify
The response might return "verdict": "valid" and "smtp_code": 250, confirming the address is deliverable. If the response shows "verdict": "invalid" with smtp_code: 550, the address does not exist.
This method is ideal for developers integrating real-time validation into scripts or CI/CD pipelines. It ensures you're only sending to verified addresses—reducing bounce rates and improving sender reputation.
You can extend this process with tools like jq to parse JSON outputs efficiently in shell scripts. For larger-scale validation, explore MailTester’s bulk verification or verification API for higher throughput and detailed reporting.
Interpreting Response Codes: What Each One Means
You're validating email addresses via CLI and getting real-time SMTP response codes—here’s what they actually mean. A 250 means the server accepted the address as valid and deliverable. A 550 means the user doesn’t exist or is blocked. A 450 indicates a temporary issue, likely greylisting or rate limiting. A 551 means the address is redirected or aliased. A 552 means the mailbox is full. A 553 signals a syntax error in the address. These responses are the actual signals from mail servers, not guesses.
SMTP Response Codes Reference
| Code | Meaning | Implication for Email Validation |
|---|---|---|
| 250 | OK | Mail server accepted the address. The address is valid and deliverable. This is the most reliable sign of a working inbox. |
| 550 | User unknown or blocked | The recipient doesn’t exist or is blocked by policy. Common with invalid or typo-ridden emails. Consider it a definitive invalid address. |
| 450 | Temporary failure | Server is temporarily rejecting the address—often due to greylisting, rate limiting, or high load. Recheck later. |
| 551 | User not local | Address is forwarded or aliases to another mailbox. Not necessarily invalid—may be valid but indirect. |
| 552 | Mailbox full | Recipient mailbox has exceeded size limits. The address may be inactive or rarely used. |
| 553 | Invalid mailbox name | Typo or invalid syntax in the address (e.g. “[email protected]” with extra spaces). The format is incorrect at the DNS or SMTP level. |
These codes are defined in RFC 5321, the standard for SMTP communication. Real-time SMTP verification via CLI depends on interpreting them correctly—no guesswork, no heuristics. You’re not relying on patterns or domain reputation alone; you’re seeing the server’s actual response.
For automated workflows, using MailTester’s real-time verification API gives you structured response codes and verdicts—no parsing messy logs. Whether you're testing a bulk list with bulk email verification or validating one-off addresses, the same SMTP logic applies, just abstracted.
Use Case: Automating List Clean-Up in a CI Pipeline
You can validate email addresses using CLI with real-time response codes by integrating MailTester’s command-line tool into your CI pipeline. Run checks on new leads during pull requests, flag invalid or risky emails immediately, and fail the build if more than 1% return errors—ensuring only clean data reaches your CRM or email service. This early catch prevents bounces and protects sender reputation before a single message is sent.
Run Real-Time Checks Before Deployment
Let’s say you’re adding new leads to a test environment. Instead of waiting for a marketing campaign to go live, run a CLI script on every pull request to validate each email in real time. MailTester returns precise response codes—like valid, invalid, catch-all, or risky—within seconds. This lets your team catch typos, disposable domains, or role accounts before they enter the pipeline.
Use the verification API for programmatic access or the CLI for automation. It’s designed for scripting: you pass a list of emails, get structured output, and act on it with shell logic. No need to manually approve each address. Just embed the check in your CI job, and let the system enforce data quality by default.
Fail Fast, Prevent Bounces, Protect Reputation
If more than 1% of the list returns invalid or risky, fail the build. This threshold is based on industry standards—excessive bounces signal poor sender hygiene and trigger filters at providers like Gmail and Outlook. According to Spamhaus, even a small percentage of undeliverable emails can harm deliverability over time.
By catching dead addresses early, you reduce the number of hard bounces that hurt your sender reputation. This practice is especially crucial when syncing with platforms like Mailchimp or HubSpot. Use the integrations to connect MailTester directly to your stack, ensuring clean data flows consistently across systems.
With real-time response codes and immediate feedback, your team doesn’t just react to bad data—your pipeline stops it before it can spread. The result? Fewer failed campaigns, higher inbox placement, and less time spent cleaning up after poor data. This isn’t optional—it’s built-in quality control.
Bulk Validation? Handle Large Lists Efficiently
You can validate hundreds or even thousands of email addresses using the MailTester CLI with precise, real-time response codes—by batching requests in a Bash loop or using the bulk API endpoint, both of which respect rate limits while delivering full transparency. For most workflows, a simple loop works fine, but for larger datasets, the dedicated bulk endpoint is faster and more reliable.
Process Hundreds with a Bash Loop
Let’s say you need to validate 200 emails. You can do it in a simple loop with curl, one request at a time. MailTester allows up to 10 requests per second—burst tolerance built in—so you won’t get throttled during short spikes. Just structure your script to pause briefly between requests if needed, or let the API handle it with built-in limits.
This approach works well for medium-sized lists. For instance, processing 1,000 emails via CLI batches completes in under five minutes, with each response returning a clear verdict: valid, invalid, catch-all, risky, or disposable. All response codes are standardized and documented in the SMTP specification (RFC 5321), so you know what each result means—no guessing.
Scale Up with the Bulk API
If you're validating 10,000+ addresses, avoid individual CLI calls. Instead, use MailTester’s bulk verification endpoint. It’s designed to handle 10,000+ emails per batch with consistent performance, avoiding queue delays or request drops common with manual loops.
The bulk API doesn't just speed things up—it gives you full visibility. Each email returns a real-time response code, including detailed status like “mailbox not found” or “greylisted”, so you can refine your sender reputation strategy with confidence. Unlike some tools that return only “valid” or “invalid”, MailTester exposes the actual SMTP-level response, helping you diagnose delivery problems before they affect campaign performance.
Whether you're cleaning a list before a campaign or auditing historical data, you get accurate, actionable results with no dead ends. Use the real-time API for quick tests, or the bulk API for large-scale validation. All responses are logged, and results are available via secure, non-expiring credits—your first 100 verifications are free, and you can always pick up where you left off.
Why Real-Time Response Over Bulk Results?
You need instant feedback when validating email addresses—milliseconds, not minutes. Bulk results delay decisions, waste resources, and miss real-time risks. With real-time verification, you catch invalid addresses during signups, block bad entries before they hit your database, and avoid failed delivery attempts altogether. This isn’t just faster; it’s smarter.
Real-Time Beats Batch Processing
- While bulk verification processes thousands of emails over minutes or hours, real-time APIs return status codes in under 500 milliseconds.
- Imagine a user submits a form—your system checks the email instantly, and if invalid, shows an error before the data is saved. No cleanup later.
- Real-time checks integrate directly into your signup or API workflow, reducing backend load and maintaining velocity without compromising data quality.
Immediate Action, Better Outcomes
- Validate emails on submission—before they enter your CRM, mailing list, or transactional service. That’s how you prevent wasted sends and maintain sender reputation.
- Use real-time verification in APIs to reject suspect addresses before they trigger bounces or spam complaints, which hurt deliverability scores over time (as noted in RFC 6523).
- Block disposable, role-based, or malformed emails immediately—the kind that inflate bounce rates or get flagged by filters.
- You’re not just validating an address; you’re acting on it right now. That’s why MailTester’s real-time verification API supports low-latency, high-volume checks with consistent accuracy.
For example, with a inbox placement test, you don’t just know if an email is valid—you see whether it lands in the inbox, spam, or is blocked. That insight is only useful when it arrives immediately.
Let’s be honest: bulk processing is fine for audits. But when you’re building a user flow, every second counts. Real-time verification gives you the control you need during active user engagement.
For teams using Mailchimp, HubSpot, or Klaviyo—integration with MailTester’s verified workflows keeps email checks fast and automatic. No delays. No cleanup. Just clean, validated data from the start.
Verdict Types in MailTester: What They Actually Mean
Each email verification result in MailTester reflects a real technical outcome from the SMTP handshake. "Valid" means the server confirmed the mailbox exists and accepts mail; "invalid" means it outright rejected the address; "catch-all" warns that the domain accepts all emails—common with spam traps; "risky" flags disposable, role-based, or unresponsive addresses; "unknown" means the check timed out. These aren’t guesses—they’re documented behaviors from actual mail servers.
Understanding the Verdicts
Here’s what each response really means, based on real SMTP standards and observed server behavior.
| Verdict | What It Means | Technical Signal | Recommended Action |
|---|---|---|---|
| Valid | Mail server acknowledged the address exists and is accepting messages. | SMTP 250 response after RCPT TO command. | Keep in your list. High deliverability potential. |
| Invalid | Server denied the address—mailbox does not exist. | SMTP 550, "User unknown" or "No such user." | Remove from your list. Bounces likely. |
| Catch-all | Server accepts all emails, even invalid ones—common in shared or legacy systems. | No error on RCPT TO; no explicit rejection. | Mark as high risk. Avoid sending to these addresses. |
| Risky | Address appears to be a role account (e.g., admin@), disposable, or from a domain that frequently changes IP or blocks verification. | Server does not respond promptly or returns inconsistent results. | Review manually. Consider exclusion or soft validation. |
| Unknown | Verification timed out before the result was known. | Connection or DNS issue. No response in ≤30 seconds. | Retest later or flag for manual review. |
These verdicts align with industry-standard practices. For example, RFC 5321 defines how SMTP servers should respond to valid and invalid addresses. The SMTP specification details the 550 error code for non-existent users, which we use to determine "invalid" results.
Using MailTester’s real-time API or bulk verification tool lets you act on these signals instantly. Our API integrates with your workflow and returns structured codes. For larger campaigns, check deliverability first with inbox placement testing, then clean your list using bulk verification. All results are transparent—no black boxes.
Start Free: 100 Free Verifications with No Expiry
You can start validating email addresses using MailTester’s CLI today—no credit card, no trial, no expiry. Just 100 free verifications to test the real-time response codes, validate your workflow, and see how quickly you get results before deciding to scale. It’s the easiest way to confirm deliverability without risk.
How It Works: No Setup, No Limits
- Go to MailTester’s pricing page and click “Start Free” — no form, no login required to begin.
- Claim your 100 free credits instantly. These don’t expire — use them months from now, or all at once.
- Run the CLI command with any valid email, and get real-time response codes (like “valid”, “invalid”, “catch-all”) in under a second.
- Test your script, pipeline, or integration workflow with actual server responses — no fake data or delays.
Why This Matters for Real Workflows
Many tools promise “free tiers” but time them out or lock access. MailTester doesn’t. Your credits remain yours indefinitely. That’s different from how email validation often works — most providers either limit access to a 7-day window or require upfront payment to unlock even basic usage.
Industry standards like RFC 5321 and RFC 5322 define how email systems should behave, and real-time responses are critical for ensuring that your system knows early whether delivery will succeed. You’re not just filtering invalid emails — you’re verifying infrastructure-level compatibility.
Use our API or bulk verification if you need to scale later. The CLI is the fastest way to test and validate the underlying logic.
Conclusion: Command-Line Verification Is Essential for High-Quality Data
Validating email addresses with real-time response codes isn’t a convenience—it’s a necessity for reliable data pipelines and sender reputation. Without it, bounces rise, deliverability drops, and trust erodes.
MailTester delivers a 98.9% accuracy rate via its CLI, enabling precise, fast verification inline with automation, scripts, and real-time workflows. The results are actionable: immediate feedback on validity, catch-all status, or risk factors.
Integrate it into your pipelines to catch invalid addresses before they harm your sender reputation or trigger blacklists. Every verified email improves inbox placement and reduces wasted sends.
Sources
- Google reported 265 billion fewer unauthenticated messages sent to Gmail users in 2024 — a 65% reduction — after its bulk-sender rules took effect, with 500,000+ top domains publishing DMARC records in response. — Google (via MailOver bulk-sender requirements guide) (2024)
- Backlinko's study of 12 million outreach emails found an average response rate of 8.5%, with the vast majority of messages ignored or filtered before they were ever seen. — Backlinko Cold Email Outreach Study (2024)
Keep reading
- Deliverability monitoring, metrics and reporting (complete guide)
- Automate Email Safety and Deliverability Scoring in 2026
- Automated Email Verification for Domains Not Under Your Control
- Statistical Confidence in Email Verification Service Performance Metrics
- Automatic Suppression List Cleanup After Data Retention Limits Are Reached
Ready to put this into practice? MailTester verifies emails with 98.9% accuracy — start with 100 free verifications.
Frequently asked questions
Can I validate an email address using CLI without an API key?
No. CLI verification requires authentication via API key. This ensures security and usage tracking.
How fast is MailTester’s real-time response?
Average response time is under 300ms. Most valid and invalid results complete within one second.
Does MailTester check for disposable email addresses?
Yes. The AI assistant and verification engine detect disposable domains during real-time checks.
Can I verify 1,000 emails in one CLI call?
No—each CLI call checks one address. For bulk, use the bulk API or a loop with managed rate limits.
What’s the difference between 'risky' and 'invalid'?
'Invalid' means the server denies the email. 'Risky' suggests a potential issue, like a role account or temporary non-receipt behavior.
Does the CLI tool support HTTPS and TLS?
Yes. All MailTester API calls use HTTPS with TLS 1.2 or higher for secure transmission.
Can I run MailTester CLI on Windows?
Yes. Use PowerShell, WSL, or Windows Terminal with curl or a script runner.
Does using CLI affect deliverability?
No. CLI verification only checks the address—it does not send messages or impact sender reputation.
How does MailTester avoid being flagged by servers?
It follows industry-standard SMTP behavior, respects rate limits, and uses real SMTP connections without spoofing.
Can I use MailTester for cold outreach list hygiene?
Yes. Removing invalid and risky addresses improves message delivery and protects your sender reputation.
What if a server doesn’t respond during verification?
The system logs it as 'unknown'. You can retry later or manually validate the email.
Is there a way to verify only domains or usernames?
No. The verification process requires the full email address for accurate SMTP-level validation.