MCPcopy Index your code
hub / github.com/simstudioai/sim / validateEmailSyntax

Function validateEmailSyntax

apps/sim/lib/messaging/email/validation.ts:44–48  ·  view source on GitHub ↗

* Validates email syntax using RFC 5322 compliant regex

(email: string)

Source from the content-addressed store, hash-verified

42 * Validates email syntax using RFC 5322 compliant regex
43 */
44function validateEmailSyntax(email: string): boolean {
45 const emailRegex =
46 /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/
47 return emailRegex.test(email) && email.length <= 254
48}
49
50/**
51 * Checks if email is from a known disposable email provider

Callers 1

quickValidateEmailFunction · 0.85

Calls 1

testMethod · 0.80

Tested by

no test coverage detected