Lies We Tell Ourselves About Email Addresses
13 hours ago
- #p
- #d
- #g
- #e
- #r
- #a
- #c
- #m
- #t
- #o
- #v
- #-
- #i
- #
- #,
- #f
- #s
- #n
- #l
- #w
- Do not rely on regex for email validation because it's error-prone, hard to maintain, and may reject valid addresses due to evolving standards.
- Email addresses can have non-ASCII characters (via SMTPUTF8), exceed length limits, and include edge cases like IP addresses or trailing dots, often working despite RFC violations.
- Local-part case sensitivity is allowed by RFCs but rarely implemented; use database collations like citext or utf8mb4_general_ci for uniqueness checks instead of case folding.
- Plus tags (e.g., user+tag@domain) are valid in email local-parts, but support varies; assumptions about universal subaddressing can break user experience.
- Send verification emails as the primary method to confirm email validity, avoiding overcomplicated validation logic and focusing on user assistance rather than strict input rejection.