Skip to content
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

Message-id validator #290

Merged
merged 14 commits into from
Mar 6, 2021
Merged

Message-id validator #290

merged 14 commits into from
Mar 6, 2021

Conversation

egulias
Copy link
Owner

@egulias egulias commented Feb 28, 2021

message-id header validation according to RFC2822 section 3.6.4. This header field has some differences to an addr-spec, like not allowing comments and explicity allowing for many other charcters in the "domain part".
For message-id, parts are id-left @ id-right.

Added a new validator, refactor of internals to allow for extension.

Fixes #282 & symfony/symfony#39685

@egulias
Copy link
Owner Author

egulias commented Feb 28, 2021

I'd appreciate your thoughts @driesvints @derrabus , this should fix Swiftmailer & Symfony mailer needs.

Copy link
Contributor

@derrabus derrabus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new validator passes the test suite of Symfony's MIME component. Thank you! 👍🏻

Comment on lines 30 to 33
public function __construct(EmailLexer $lexer)
{
$this->lexer = $lexer;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The constructor could be moved to the new Parser class as well.

src/Parser.php Outdated Show resolved Hide resolved
src/Parser.php Outdated Show resolved Hide resolved
@driesvints
Copy link
Contributor

Awesome. I'm not sure when I'll have time to try this out but hope to soon. Thanks!

@driesvints
Copy link
Contributor

Hey @egulias. I can confirm this fixes the failing test for SwiftMailer. Thanks!

I'll keep an eye out until a new release with this has been tagged and then I'll send in a patch to SwiftMailer.

egulias and others added 5 commits March 6, 2021 17:53
Co-authored-by: Alexander M. Turek <me@derrabus.de>
Co-authored-by: Alexander M. Turek <me@derrabus.de>
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.

Failing SwiftMailer test after upgrade to v3
3 participants