Commit Graph
5 Commits
Author SHA1 Message Date
aneurinandClaude Sonnet 5 a992065d6c email: validate with net/mail.ParseAddress
Replace the RFC 5322 mega-regexp with net/mail.ParseAddress, which is the
standard library's address parser and far easier to audit. A bare address
is required: inputs with a display name, angle brackets, a comment, or
trailing content are rejected, as is an address list.

Behaviour change: ParseAddress does not require the domain to contain a
dot, so "alice@localhost" now validates. Layer Match or a DNS lookup on
top if a stricter domain is needed.

Also rewrites FuzzEmail, which previously asserted that *every* input is
invalid, into checks that Email never returns an unexpected error type,
never panics, and gives a stable verdict.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-07 12:53:02 +00:00
Aneurin Barker Snook b8c82f3529 remove unnecessary doc comments 2024-07-19 14:11:53 +01:00
Aneurin Barker Snook 40482060ac update all validation tests 2023-11-19 20:42:48 +00:00
Aneurin Barker Snook c74486d122 add all validator, simplify error messages 2023-10-07 13:42:17 +01:00
Aneurin Barker Snook f41d6f248a add workspace, validation 2023-10-06 11:58:24 +01:00