Skip to content

Conversation

@mmucklo
Copy link
Owner

@mmucklo mmucklo commented Feb 8, 2026

No description provided.

- Define 4 compliance modes: STRICT, NORMAL, RELAXED, LEGACY
- STRICT: RFC 5322 strict (no obsolete syntax)
- NORMAL: RFC 5322 + obsolete (recommended default)
- RELAXED: RFC 2822 compatible (legacy systems)
- LEGACY: Current parser behavior (backward compatibility)

- Document implementation phases
- Plan 95+ new tests across all modes
- Default to LEGACY for v2.x (no breaking changes)
- Can upgrade to NORMAL for v3.0

Ready for implementation in next session.
- Add RfcMode constants (STRICT, NORMAL, RELAXED, LEGACY)
- Add rfcMode and allowSmtpUtf8 to ParseOptions
- Enforce UTF-8 local part handling when SMTPUTF8 enabled
- Add strict local-part validation hook
- Switch domain length checks to strlen (octet-based)
- Update tests to support rfc_mode and allow_smtputf8
- Adjust UTF-8 tests to use allow_smtputf8=false
- All tests passing
- Add RfcMode constants for strict/normal/relaxed/legacy
- Add rfcMode and allowSmtpUtf8 to ParseOptions
- Allow UTF-8 local parts when SMTPUTF8 enabled
- Add strict local-part validation hook
- Use octet-based length checks for domain and total length
- Update tests for strict mode and SMTPUTF8 toggle
- All 114 tests passing
@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 82.50000% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.78%. Comparing base (4ea8f3f) to head (f0fc4db).

Files with missing lines Patch % Lines
src/Parse.php 82.44% 23 Missing ⚠️
src/ParseOptions.php 70.58% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #49      +/-   ##
============================================
+ Coverage     77.02%   78.78%   +1.75%     
- Complexity      219      285      +66     
============================================
  Files             3        4       +1     
  Lines           505      641     +136     
============================================
+ Hits            389      505     +116     
- Misses          116      136      +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

mmucklo and others added 6 commits February 8, 2026 16:12
- Add 11 UTF-8 local-part tests (strict/relaxed/legacy)
- Verify SMTPUTF8 toggle blocks UTF-8 when disabled
- Add strict UTF-8 dot-atom tests and quoted UTF-8
- Reject raw UTF-8 domains in strict mode, allow punycode
- Ensure strict mode accepts private IP literals per RFC 5321
- Add strict edge-case coverage for dots/quotes/escapes
- All 135 tests passing
- Normalize Unicode domains to ASCII (punycode) using IDNA UTS#46
- Preserve original Unicode domain in 'domain'
- Add 'domain_ascii' field for normalized punycode value
- Validate domains against ASCII form and RFC length limits
- Add IDN tests for Unicode and punycode domains
- Update README with IDN usage examples and domain_ascii field
- All tests passing
- Add STRICT_INTL mode for RFC 6531/6532 full internationalization support
- Rename STRICT to STRICT_ASCII for clarity (maintain backward compat)
- Implement Unicode normalization (NFC) using PHP Normalizer class
- Add C0/C1 control character rejection (U+0000-U+001F, U+0080-U+009F)
- Add UTF-8 encoding validation via mb_check_encoding
- Support international Unicode characters (\p{L}\p{N} in regex)
- Add 11 comprehensive STRICT_INTL test cases
- Update DESIGN.md with implementation status (~75% complete)
- Document RFC modes in README with comparison table and examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Implement validateLocalPartNormal() for RFC 5322 + obsolete syntax
- Accept obs-local-part: word *("." word) format
- Allow consecutive dots (user..name), leading dots (.user), trailing dots (user.)
- Add 7 comprehensive NORMAL mode test cases
- NORMAL mode accepts obsolete syntax per RFC 5322 §4
- Tests verify: dot flexibility, valid addresses, UTF-8 rejection (when disabled)

142/143 test assertions passing (1 minor test expectation to fix)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant