Skip to content

Blog

How to verify an email address: syntax, domain, MX, SMTP and catch-all

How email verification works, step by step: syntax rules from RFC 5321 and 5322, DNS and MX records, the SMTP mailbox check, and catch-all detection.

Updated 2026-11-23

To verify an email address, check it in five steps: the syntax against RFC 5322 and RFC 5321, the domain in DNS, the domain's MX records, the mailbox itself by asking the mail server over SMTP without sending a message, and finally a random address on the same domain to detect a catch-all server. Each step catches something the previous one cannot. None of them replaces a confirmation email when you need proof that a person reads the inbox.

The five checks at a glance

Step Question Standard What a failure looks like
1. Syntax Is the address well formed? RFC 5322, RFC 5321 jane@@example.com, jane@example
2. Domain Does the domain exist? DNS (RFC 1034, RFC 1035) jane@exmaple-mail.invalid
3. MX Does the domain accept mail, and where? RFC 5321 section 5, RFC 7505 A domain with no mail servers, or a null MX
4. Mailbox Does the mail server accept this recipient? RFC 5321, reply codes and RFC 3463 status codes 550 5.1.1 User unknown
5. Catch-all Does the server accept every recipient, real or not? Same exchange, with a random address The random address is accepted too

The order matters. Each step is cheaper than the next, and each failure stops the chain: there is no point asking a mail server about a domain that does not exist.

Step 1: syntax

RFC 5322 defines what an address looks like: a local part, an @, a domain. RFC 5321, the SMTP standard, adds the limits that matter when mail actually travels.

  • Lengths. The local part can have 64 octets and the domain 255. The whole path is capped at 256 octets including the angle brackets around it in SMTP commands, which leaves 254 characters for an address.
  • Case. RFC 5321 says the local part may be case-sensitive, so a server could treat Jane and jane differently. In practice almost none do, but a verifier should not rewrite the local part. Domain names are never case-sensitive.
  • Characters. The unquoted local part allows letters, digits and a set of symbols including ., +, -, _ and '. Dots cannot start or end it, or appear twice in a row.

Some addresses look wrong and are right:

Address Valid? Why
jane+news@example.com Yes Subaddressing (RFC 5233). It reaches Jane's inbox with a tag.
o'brien@example.com Yes ' is allowed in the local part.
"jane doe"@example.com Yes, but rare A quoted local part may hold spaces. Many systems refuse it anyway.
jane..doe@example.com No Two dots in a row outside quotes.
.jane@example.com No A dot cannot start the local part.
jane@example Syntactically, maybe; usefully, no A bare name is not a domain anyone can deliver public mail to.

Two more details. Browsers check type="email" fields with a pattern the WHATWG HTML standard calls a "willful violation" of RFC 5322: simpler and stricter in places, so it is a good first filter and not a reference. And addresses with non-ASCII characters exist: internationalized domains are converted to ASCII under IDNA, and RFC 6531 extends SMTP for non-ASCII local parts, which not every server supports.

Catch typos before you judge the address

The most common bad address is not malformed at all. jane@gmial.com passes every syntax rule. A verifier that compares the domain with common providers can suggest jane@gmail.com. In the API that suggestion is the did_you_mean field. Show it as a question with a one-click fix, and never apply it silently: some people really do use unusual domains.

The free email syntax checker shows which rule an address breaks.

Step 2: the domain exists

A DNS query for the domain either finds it or returns NXDOMAIN, the DNS answer for "no such name". A domain that does not exist cannot receive mail, so the verdict is final: undeliverable with the reason domain_not_found.

A typo domain can exist, though. Some are registered by people who hope to collect misdirected mail. That is why the did_you_mean check looks at spelling and does not rely on DNS alone.

Step 3: MX records

A domain says where its mail goes with MX records. Each one names a mail server and a preference number; senders try the lowest number first.

dig +short MX example.com
10 mx1.example.com.
20 mx2.example.com.

The output above is illustrative. Three situations need care:

  • No MX record. RFC 5321 section 5.1 lets senders fall back to the domain's own address record, an "implicit MX". Few domains that want mail rely on it. The API applies the stricter rule and treats such a domain as unable to receive mail: domain_no_mx.
  • A null MX. RFC 7505 defines a single MX record with preference 0 and the target . as a declaration that the domain accepts no mail at all. The verdict is domain_null_mx.
  • A DNS failure. If the domain's name servers do not answer, nothing is known. The API returns unknown with dns_error, does not bill the call, and does not cache the result.

The free MX lookup shows the mail servers of any domain, null MX records included.

Step 4: the SMTP mailbox check

This is the step that tells a real mailbox from a typo on a real domain. The verifier connects to the domain's mail server on port 25 and starts an ordinary delivery:

S: 220 mx.example.com ESMTP ready
C: EHLO probe.example.net
S: 250 mx.example.com
C: MAIL FROM:<verify@probe.example.net>
S: 250 2.1.0 OK
C: RCPT TO:<jane@example.com>
S: 250 2.1.5 OK
C: QUIT
S: 221 2.0.0 Bye

The answer to RCPT TO, the command that names the recipient, is the verdict. The verifier then quits. It never sends DATA, so no message exists and the owner sees nothing.

Reply to RCPT TO Meaning Verdict
250 Recipient accepted Deliverable, pending the catch-all test
550 5.1.1 No such mailbox Undeliverable
552 or 5.2.2 Mailbox over its quota Risky: the mailbox exists but cannot take mail now
450 or 451, retry later Temporary refusal, often greylisting (RFC 6647) Unknown: check again later
5.7.x naming a policy or blocklist The server refuses the check itself Unknown, not undeliverable

Codes like 5.1.1 are the enhanced status codes of RFC 3463: the first digit gives the class, 2 for success, 4 for a temporary failure, 5 for a permanent one.

Why not just use VRFY?

SMTP has a command made for the question, VRFY. RFC 5321 section 7.3 notes that sites may disable it for security reasons, and most servers on the public internet answer it with nothing useful. RCPT TO is the question servers still answer, because refusing it would break their own mail.

Why you should not run this from your app server

The mailbox check looks simple, but the network around it is not. Many hosting platforms block outbound port 25 by default to fight spam. Mail servers judge the reputation of the connecting IP address, and an address that probes many domains can end up on blocklists, which then hurts any real mail sent from it. Some servers greylist first contacts and only answer properly on a retry minutes later. A verification service runs the probe from infrastructure built for it, and caches answers so the same mailbox is not asked over and over.

Step 5: the catch-all test

A 250 only means something if the server would say no to an address that does not exist. So the verifier also asks about a random address on the same domain:

C: RCPT TO:<5f2c9a81d04e7b36c1x@example.com>
S: 550 5.1.1 User unknown

Rejected: the server checks recipients, and its yes for jane@ was real. If the server accepts the random address too, it accepts everything, and the result is risky with the reason catch_all. Some providers accept or block every probe for every domain they host; for those the result is unknown with provider_unverifiable, because a yes would mean nothing either way. Catch-all email covers how to treat both.

Three more signals worth reading

Verification is also the moment to classify the address:

  • Disposable. The domain belongs to a temporary inbox service. Detected from a list, without the mailbox check. See disposable email detection.
  • Role. The local part names a function, such as info@ or sales@, rather than a person.
  • Free provider. The domain is a free consumer mailbox service. Normal for consumers, less telling than a company domain in B2B.

None of them makes an address undeliverable. They feed your policy.

Verify an address with the API

One call runs all five steps and the three classifications:

curl https://api.qelka.com/v1/email \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "jane@example.com"}'
{
  "id": "lkp_01M84BQ0P685M4955R9BRN1V99",
  "object": "email",
  "input": "jane@example.com",
  "status": "deliverable",
  "reason": "accepted_email",
  "did_you_mean": null,
  "checks": {
    "syntax": true,
    "mx": true,
    "smtp": true,
    "catch_all": false,
    "disposable": false,
    "role": false,
    "free_provider": false
  },
  "domain": { "name": "example.com", "spf": true, "dmarc": true },
  "score": 100,
  "credits_used": 1,
  "cached": false
}

In JavaScript, with a timeout that leaves room for the mail server:

export async function verifyEmail(email) {
  try {
    const response = await fetch('https://api.qelka.com/v1/email', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({ email }),
      signal: AbortSignal.timeout(15000),
    })
    if (!response.ok) return { status: 'unchecked' }
    const result = await response.json()
    return { status: result.status, reason: result.reason, suggestion: result.did_you_mean, checks: result.checks }
  } catch {
    return { status: 'unchecked' }
  }
}

A call costs 1 credit in either mode. Send "mode": "fast" to skip the mailbox step: it catches typos, dead domains and disposable inboxes without waiting for a mail server, but it can never return deliverable. Its best answer is unknown with smtp_not_checked. Checks that could not run on our side (smtp_unavailable) or whose DNS lookups failed (dns_error) are not billed.

What to do with the result

status Typical reason In a signup form On a mailing list
deliverable accepted_email Accept Keep
undeliverable invalid_syntax, domain_not_found, domain_no_mx, domain_null_mx Ask for a correction; show did_you_mean Remove
undeliverable mailbox_not_found, mailbox_disabled Ask the person to check the address Remove
risky catch_all Accept; the confirmation email settles it Keep engaged contacts, test the rest in a small send
risky disposable Your policy: refuse or flag Remove from marketing sends
risky mailbox_full Accept Hold back, recheck later
unknown greylisted, smtp_timeout Accept Retry later
unknown smtp_blocked, provider_unverifiable Accept Treat like catch-all

Never block a signup on unknown. It describes the mail server, not the address.

What verification cannot tell you

  • Inbox placement. Filters judge the message and the sender, not the address. Your own SPF, DKIM and DMARC records matter more here.
  • The future. A result describes the moment of the check. Mailboxes close and domains expire.
  • Late rejections. RFC 5321 lets a server accept a recipient and bounce the message after reading it.
  • Who typed it. A deliverable address can belong to someone else. A confirmation link proves control.

The free email verifier runs these checks on one address at a time. For forms, Validate signup forms has the full flow in code. The email API reference documents every status and reason.

Frequently asked questions

How can I verify an email address without sending an email?
Run the checks a mail server would run before delivery. Parse the address against RFC 5322 and RFC 5321, confirm the domain exists, read its MX records, then connect to the mail server and ask about the mailbox with the SMTP commands MAIL FROM and RCPT TO, leaving before DATA. The server's answer to RCPT TO tells you whether it accepts that recipient, and no message is ever delivered.
Does email verification send anything to the person?
No. The mailbox check stops after the RCPT TO command, which names the recipient, and quits before the DATA command that would carry a message. Nothing lands in the inbox and the owner sees nothing. A confirmation email is a different thing: it is a message you choose to send, and it remains the only proof that a person can read the inbox.
Why does email verification return unknown?
Unknown means the checks could not reach a conclusion, not that the address is bad. The mail server may have asked to retry later (greylisting), answered too slowly, refused to answer the check, or belong to a provider that accepts or blocks every probe. In fast mode, the mailbox step is skipped on purpose. Accept unknown addresses at signup and confirm them by email, or check them again later.
What is the maximum length of an email address?
254 characters in practice. RFC 5321 allows 64 octets for the local part before the @ and 255 for the domain, but it also caps the whole path at 256 octets including the angle brackets that surround the address in SMTP commands. That leaves 254 for the address itself. Longer values cannot travel through a compliant SMTP exchange, whatever a form accepts.
Is a deliverable email address guaranteed to reach the inbox?
No. Deliverable means the recipient's mail server accepted that exact mailbox when asked. Spam filters still judge each message, its sender and its authentication, so a deliverable address can route your mail to a spam folder. RFC 5321 also lets a server accept a recipient and bounce the message later. And a mailbox that exists today can be closed, filled or disabled next month.
How long does email verification take?
The syntax, DNS and list checks take milliseconds. The SMTP mailbox check waits for the recipient's mail server, which usually means a few seconds and occasionally longer. That is why verification APIs offer a fast mode that skips the mailbox step for forms where every second counts. Give full checks a client timeout of several seconds, and fail open if it expires.
What does a catch-all result mean in email verification?
The domain's mail server accepted a random address that cannot exist, so it accepts mail for every address at the domain. Its yes for the address you checked therefore proves nothing about that mailbox. The result is risky, not deliverable. Accept such addresses where a confirmation email settles the question, and send to them carefully on marketing lists. Catch-all email explains how to treat them.

Put this check in your product

Get an API key in under a minute. 100 free credits every month, no card required.