Email address validation rules
Learn about the validation rules, accepted formats, and output values that EmailCleanserFn uses when it validates email addresses.
EmailCleanserFn supports commonly used RFC 5321 and RFC 5322 email syntax validation rules. It checks character encoding, email structure, local part formatting, and domain structure.
| Item | Value |
|---|---|
| Cleanser name | EmailCleanserFn |
| Purpose | Validates email address syntax |
| Intended users | Developer, Reltio Configurator |
| Standards | RFC 5321, RFC 5322 |
Email address validation sequence
EmailCleanserFn applies a fixed sequence of checks to each email address. The following table lists the validation checks and shows a valid and invalid example for each one.
| Step | Check | Description | Valid example | Invalid example |
|---|---|---|---|---|
| 1 | Null value | The email value is not null. | user@example.com | null |
| 2 | ASCII characters | Every character is within the ASCII character set. | user@example.com | usér@example.com |
| 3 | Email structure | The email contains one local part and one domain part separated by @. | user@example.com | userexample.com |
| 4 | Leading and trailing whitespace | Leading and trailing whitespace is ignored before validation. | user@example.com | user name@example.com |
| 5 | Trailing dot | The email does not end with a dot. | user@example.com | user@example.com. |
| 6 | Local part validation | The local part follows the defined character and formatting rules. | user.name@example.com | user..name@example.com |
| 7 | Domain validation | The domain follows the symbolic domain format or the bracketed IPv4 format. | user@example.com | user@example |
Local part rules
The local part is the part before the @ symbol.
| Rule | Description | Valid example | Invalid example |
|---|---|---|---|
| Letters and numbers | Letters and numbers are valid in the local part. | user123@example.com | user<123>@example.com |
| Underscore and hyphen | Underscores and hyphens are valid in the local part. | user_name@example.com | user[name]@example.com |
| Apostrophe | Apostrophes are valid in the local part. | user's.name@example.com | user:name@example.com |
| Plus sign | Plus signs are valid in the local part. | user+tag@example.com | user;tag@example.com |
| Spaces | Spaces are valid only inside quoted strings. | "user name"@example.com | user name@example.com |
| At sign inside quotes | @ is valid only inside a quoted local part. | "user@name"@example.com | user@name@example.com |
| Unsupported special characters | Control characters, parentheses, angle brackets, commas, semicolons, colons, backslashes, and square brackets are invalid in the local part. | username@example.com | user<name>@example.com |
| Rule | Description | Valid example | Invalid example |
|---|---|---|---|
| Local part is required | The email includes a value before @. | user@example.com | @example.com |
| Dot-separated segments | Periods separate words in the local part. | user.name.sub@example.com | user..name@example.com |
| Leading dot | The local part does not start with a period. | user.name@example.com | .user@example.com |
| Trailing dot | The local part does not end with a period. | user.name@example.com | user.@example.com |
| Quoted strings | Quoted strings are valid in the local part. | "user name"@example.com | "user name@example.com |
Domain rules
The domain is the portion after the @ symbol.
example.com. Symbolic domain validation is based on the IANA TLD registry.| Rule | Description | Valid example | Invalid example |
|---|---|---|---|
| Domain is required | The email includes a value after @. | user@example.com | user@ |
| Domain labels | Each domain label starts and ends with an alphanumeric character. | user@sub.example.com | user@-example.com |
| Hyphens | Hyphens appear only within a domain label. | user@my-domain.org | user@example-.org |
| Top-level domain length | The top-level domain contains at least two alphabetic characters. | user@example.info | user@example.c |
| Supported top-level domain | The domain ends with a supported top-level domain. | user@example.co.uk | user@example |
| Domain ending | The domain does not end with a dot. | user@example.com | user@example.com. |
| Category | Example |
|---|---|
| Generic | .com, .org, .net, .info, .biz, .edu, .gov, .mil |
| Country code | .uk, .de |
| Infrastructure | .arpa, .root |
| Local domains, when local domain validation is enabled | localhost, localdomain |
| Custom allowed top-level domains | Tenant-specific allowed values |
Domain type classification
After the email address passes the null, ASCII, structure, local part, and domain checks, the EmailCleanserFn classifies the domain as PUBLIC or PRIVATE based on an internal list of commonly used public email providers. The following table describes the domain classifications.
| DomainType | Description | Example |
|---|---|---|
PUBLIC | The domain is in the public domains list. | gmail.com |
PRIVATE | The domain is not in the public domains list. | company.example |
Unsupported validation scenarios
EmailCleanserFn validates email syntax and domain formatting only. It does not verify mailbox availability, mail server configuration, or message deliverability.
The following table lists unsupported validation scenarios.
| Validation type | Description |
|---|---|
| Mailbox verification | Does not verify whether the mailbox exists |
| SMTP connectivity | Does not validate SMTP server connectivity |
| MX record validation | Does not check DNS MX records |
| Verification email delivery | Does not send verification or confirmation emails |
| Disposable email detection | Does not detect temporary or disposable email providers |
| Deliverability validation | Does not guarantee that an email can receive messages |
Output values
After the email address is validated, the validator returns the original email value, the validation result, and, for a valid email address, the parsed email parts and the domain classification. The following table lists the output values along with their examples.
| Output value | Description | Example |
|---|---|---|
| Original email address | Returns the input email address. | user@example.com |
| Validation status | Returns VALID or INVALID. | VALID |
| Username | Returns the local part before @ when the email is valid. | user |
| Domain | Returns the domain part after @ when the email is valid. | example.com |
| Email type | Returns PUBLIC or PRIVATE. | PUBLIC |
Email examples
The following table shows sample email addresses and their validation results.
| Email address | Result | Description |
|---|---|---|
user@example.com | Valid | Standard email format |
user.name@example.com | Valid | Dot-separated local part |
user+tag@example.co.uk | Valid | Plus sign in the local part |
"user name"@example.com | Valid | Quoted local part with a space |
user@[10.x.x.x] | Valid | Bracketed IPv4 domain |
user_name@sub.example.org | Valid | Underscore in the local part and subdomain in the domain |
user@example | Invalid | Missing top-level domain |
user@example. | Invalid | Trailing dot |
user name@example.com | Invalid | Unquoted space in the local part |
user@example..com | Invalid | Consecutive dots in the domain |
user@256.1.1.1 | Invalid | Invalid IP address as it is not within the octet range |
user@ | Invalid | Missing domain |
@example.com | Invalid | Missing local part |