Valid syntax
How EmailGuard validates addr-spec syntax under RFC 5322 and RFC 5321, converts IDNA domains, and exposes syntax_validation in the detect API.
Loading article…
The syntax_validation field tells you whether an address is structurally valid before you store it or send mail. EmailGuard applies RFC-aware parsing, internationalized domain conversion, and continuously updated domain intelligence so obviously invalid addresses fail before they reach your database.
When syntax fails, the API still returns 200 OK with "syntax_validation": false. Downstream flags (role_address, disposable, and so on) are not meaningful until syntax passes.
RFC 5322 defines the addr-spec grammar: a local part, @, and a domain. EmailGuard parses the full address with an RFC 5322-aware parser that handles quoted local parts and the messy formats developers paste from CRM exports and signup forms.
We reject addresses that violate practical addr-spec constraints after parsing, including:
@RFC 5321 limits mailbox sizes on the wire. EmailGuard enforces:
| Part | Maximum length |
|---|---|
| Local part | 64 octets |
| Domain | 255 octets |
Addresses longer than these limits return "syntax_validation": false even if they look plausible in a UI field.
Unicode domains are converted to ASCII using IDNA2008 lookup rules (RFC 5890, RFC 5891). The domain field in the API response is always the punycode-normalized, lower-case form (for example bücher.example → xn--bcher-kva.example).
Internationalized local parts (SMTPUTF8) are outside what EmailGuard validates today; see RFC 6531 and RFC 6532 for that extension.
Syntax validation goes beyond a simple @ split. EmailGuard combines several maintained data sources so domain labels reflect how mail actually works on the public internet:
*.github.io, so typos and pseudo-domains do not pass as corporate mail.Together, these layers catch addresses that look plausible in a text field but cannot represent a deliverable mailbox on the open internet.
curl -sS \
-H "Authorization: Bearer YOUR_KEY" \
"https://emailguard.co/api/v1/emails/detect?email=not-an-email"{
"code": "OK",
"data": {
"email": "not-an-email",
"syntax_validation": false,
"normalized": "not-an-email",
"subaddressing": false,
"role_address": false,
"public_domain": false,
"relay_domain": false,
"disposable": false,
"domain": "",
"detection_source": "precomputed"
}
}Valid example:
curl -sS \
-H "Authorization: Bearer YOUR_KEY" \
"https://emailguard.co/api/v1/emails/detect?email=pat%40example.com"{
"data": {
"email": "[email protected]",
"syntax_validation": true,
"domain": "example.com"
}
}Use syntax_validation as a cheap gate at signup; combine with disposable and role flags for policy.