-
Notifications
You must be signed in to change notification settings - Fork 14
Feature/rfc compliance #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mmucklo
wants to merge
9
commits into
master
Choose a base branch
from
feature/rfc-compliance
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 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 Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
- 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.