Syntax validation is the first check in every email verification pipeline, and it is the one most people think they understand. An address has a name, an @ sign, and a domain — what else is there to know? Quite a lot, as it turns out. The rules that define a well-formed address are detailed, they have surprising edge cases, and they are the reason a simple regular expression is never quite enough to validate an email address properly.
This post explains the rules, where they come from, what a syntax check actually tests, and what its limits are. It is useful knowledge for anyone who builds signup forms, cleans lists, or reads verification reports, because syntax results are the cheapest results in the report — and the most commonly misread.
Where the rules come from
Email address syntax is defined by a series of internet standards called RFCs — Requests for Comments — published by the Internet Engineering Task Force. The current standard is RFC 5322, which defines the format of internet messages, with updates in RFC 6531 for internationalised addresses. These documents are the reference that mail servers, verifiers, and form validators are all supposed to follow, and they are the reason the rules are as detailed as they are: email has to work between systems built by different people in different decades, and the standard is the contract that makes that possible.
The standard defines an address as a local part, an @ sign, and a domain. Each part has its own rules, and the rules interact in ways that are not obvious. The local part can contain letters, digits, and a set of special characters; it can contain dots, but not at the start or the end, and not two in a row; it can contain a quoted string, which allows characters that are otherwise forbidden. The domain must be a valid hostname: labels of letters, digits and hyphens, separated by dots, ending in a top-level domain. The whole address must be no more than 254 characters, and the local part no more than 64.
It is worth noting that the standard is more permissive than most people expect. An address such as "very.unusual.@.unusual.com" is valid under a strict reading of the standard, because the quoted string allows the dot at the end of the local part. An address with a plus sign, such as name+tag@example.com, is valid. An address with an exclamation mark or a hash in the local part is valid. Most real mail servers will accept these, even though most signup forms will not.
What a syntax check tests
A practical syntax check tests the rules that matter for deliverability, not every corner of the standard. In order, it typically checks:
- Exactly one @ sign. Zero @ signs means there is no domain. Two or more means the address is ambiguous. Either way, the address cannot be delivered.
- A non-empty local part and domain. An address that is just "@example.com" or "name@" is missing a half, and no server can do anything with it.
- Length limits. The local part must be 64 characters or fewer, the domain 253 or fewer, and the whole address 254 or fewer. Longer addresses are rejected by mail servers, so they are invalid regardless of their shape.
- Allowed characters. The local part may contain letters, digits, and the characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~ and dots, with restrictions. The domain may contain letters, digits, and hyphens only.
- Dot rules. The local part must not start or end with a dot, and must not contain two dots in a row. The domain must not start or end with a dot or a hyphen, and its labels must not be empty.
- A valid top-level domain. The domain must end in a top-level domain of at least two characters. A domain that ends in a single character, or that has no dot at all, is not a valid domain for mail.
These checks are fast — they run in microseconds, with no network access — which is why they run first in a verification pipeline. An address that fails syntax never reaches the DNS check, let alone the SMTP probe, and the effort saved is what makes it possible to verify hundreds of thousands of addresses in a reasonable time.
The edge cases that break simple validators
The most common mistake in syntax validation is using a regular expression that is either too strict or too loose. Too strict, and it rejects addresses that are valid and deliverable — for example, addresses with a plus sign, which many people use to filter their mail, or addresses with a quoted local part. Too loose, and it accepts addresses that no mail server will deliver — for example, an address with a domain that has no top-level domain, or a local part that is 200 characters long.
There are also edge cases that a regular expression cannot handle at all. Internationalised domain names — domains written in non-Latin scripts — are valid, but they are encoded in DNS as punycode, and a validator has to know that. Quoted local parts, such as "john..doe"@example.com, are valid under the standard but are rejected by most mail servers in practice, so a verifier has to decide whether to follow the letter of the standard or the reality of the servers. The right answer for verification is usually the reality: an address that no server will accept is invalid for practical purposes, whatever the standard says.
Another edge case is the difference between syntax and existence. An address can be perfectly well-formed and still belong to no one. Syntax says nothing about whether the domain exists, whether it has mail servers, or whether the mailbox is real. That is why syntax is only the first check, and why a list that has only been syntax-checked is not a verified list — it is a list of addresses that look right, which is a much weaker claim.
Syntax checking in signup forms
The place syntax validation matters most, after the verification pipeline itself, is the signup form. A form that checks syntax as the visitor types — and gives a clear message when the address is malformed — prevents a large share of bad addresses from ever entering the list. The common typos are well known: a missing @, a missing top-level domain (name@example instead of name@example.com), a space in the middle of the address, or a comma instead of a dot.
A good form check does three things. It checks the syntax and explains the problem in plain language, not in an error code. It checks for common domain typos — gmial.com, gmal.com, hotmal.com — and suggests the correction. And it does not reject addresses that are valid but unusual, such as plus-tagged addresses, because rejecting a valid address loses a subscriber who was trying to sign up.
It is also worth checking syntax on the server side, not just in the browser. Browser-side checks can be bypassed, and a form that relies on them alone will accept whatever is submitted by a script or a modified page. Server-side syntax checking is the backstop that keeps malformed addresses out even when the browser check is skipped.
What syntax results mean in a report
In a verification report, a syntax failure appears as Invalid with a sub-status such as invalid_syntax. The action is straightforward: remove the address. There is nothing to retry and nothing to investigate, because the address is malformed and no mail server will accept it. The only question worth asking is where the bad addresses came from — a signup form without syntax checking, a manual import with typos, a list that was typed rather than exported — because fixing the source prevents the next batch of malformed addresses.
It is worth grouping syntax failures and looking at the pattern. A handful of malformed addresses in a large list is normal. A large share suggests a systematic problem: a broken import, a form that accepts anything, or a list that was assembled by hand. The pattern is often more informative than the count, because it points to the process that needs fixing.
Common syntax mistakes in real lists
These are the malformed patterns that appear most often in real lists, and what causes each one:
- Missing @ sign — usually a copy-and-paste error, or a form field that joined two fields together.
- Two @ signs — often an address pasted twice, or a name and an address concatenated.
- Spaces in the address — a name typed with a space where a dot or an underscore should be, or an address copied from a document where a line break became a space.
- Missing top-level domain — the visitor typed the domain but not the ending, and the form accepted it.
- Comma instead of a dot — a typing error, common on mobile keyboards where the comma and the dot are adjacent.
- Trailing dot or leading dot in the local part — a slip of the finger that is easy to make and easy to miss.
- Address far too long — usually a field that captured more than the address, such as a name and an address in one cell.
Most of these can be fixed automatically in some cases — a trailing space can be stripped, a comma can be corrected if the intent is obvious — but automatic fixing is risky, because the corrected address is a guess. A verifier reports the address as Invalid and leaves the correction to the sender, who knows the context. If the address belongs to a known customer, it may be worth contacting them for the correct address rather than guessing.
A checklist for syntax validation
- Check syntax first in any verification job — it is the cheapest check and it removes the addresses that could never be delivered.
- Use a validator that follows the practical rules, not just a simple regular expression — and test it against plus-tagged and quoted addresses to make sure it is not too strict.
- Add syntax checking and typo suggestions to signup forms, on the server side as well as in the browser.
- Group syntax failures in a report and look for a pattern — a large share points to a broken import or form.
- Remove invalid_syntax rows without hesitation, but check the source so the next list does not have the same problem.
- Remember that syntax is only the first check: a well-formed address can still be undeliverable, and only the DNS, MX and SMTP checks can tell you whether it is real.
International addresses and non-Latin scripts
The rules above describe addresses written in the Latin alphabet, but email is a global system, and addresses can contain characters from other scripts. Internationalised email — defined in RFC 6531 — allows non-ASCII characters in both the local part and the domain, so an address can be written in Chinese, Arabic, Cyrillic, or any other script. The domain part is converted to punycode for DNS lookup, so that the underlying system still works with ASCII, while the local part can contain the characters as they are.
In practice, internationalised addresses are still uncommon in most lists, and support for them varies. Some mail servers accept them fully, some accept them only in the domain part, and some reject them outright. A syntax validator that follows the standard should accept a well-formed internationalised address, but a verifier that needs to check the mailbox must be able to handle the encoding — converting the domain to punycode for the DNS lookup, and presenting the local part correctly in the SMTP conversation.
For a sender, the practical point is not to reject internationalised addresses at signup simply because the validator does not recognise them. A visitor with an address in their own script is a real person, and a form that rejects their address loses a subscriber for no good reason. The validator should either support internationalised addresses properly, with punycode conversion, or should pass them through to the verification step rather than rejecting them at the form. The same principle applies to the plus tag, the quoted local part, and every other valid-but-unusual form: a validator that is too strict loses real subscribers, and a validator that is too loose admits addresses that will never work. The right balance is a validator that follows the standard, checks the domain's existence, and leaves the judgement about the mailbox to the probe.
Syntax validation is the least exciting check in the pipeline and one of the most useful. It costs almost nothing, it runs instantly, and it removes a whole class of addresses that could never receive mail. Its limits are real — it cannot tell you whether a mailbox exists — but its purpose is not to answer that question. Its purpose is to clear the way for the checks that can, and to make sure the expensive work of verification is spent on addresses that are at least well-formed enough to be worth asking about.