-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mime] Relaxing in-reply-to header validation #44732
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
Conversation
would be great to add a test to prevent regressions |
Hm, since the header type is passed as string... $header = new UnstructuredHeader('Subject', 'Test'); ...how can a regression be tested? |
@ThomasLandauer create an Email with a |
OK, thanks - like this? |
src/Symfony/Component/Mime/Tests/Header/UnstructuredHeaderTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mime/Tests/Header/UnstructuredHeaderTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Mime/Tests/Header/UnstructuredHeaderTest.php
Outdated
Show resolved
Hide resolved
@nicolas-grekas @fabpot based on the issue being solved, I suggest we consider this as a bugfix. |
Works for me |
4d2a7c9
to
04ddc12
Compare
Thank you @ThomasLandauer. |
@nicolas-grekas Isn't this a BC break? The userland code has to be changed when updating from 5.4.1 to 5.4.2 (use the text header and add the brackets yourself). Before: $headers->addIdHeader('References', $messageIds);
$headers->addIdHeader('In-Reply-To', $messageId); After: $headers->addTextHeader('References', '<' . implode('> <', $messageIds) . '>');
$headers->addTextHeader('In-Reply-To', '<' . $messageId. '>'); |
Please open issues if you want further discussion. |
Yeah, you're right, this might be a BC break - sorry about that! |
Yes, you can use the more generic |
…o' and 'References' headers (AlbinoDrought) This PR was merged into the 6.2 branch. Discussion ---------- [Mime] Re-allow addIdHeader to be used for 'In-Reply-To' and 'References' headers | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no (arguable: undo BC break) | New feature? | yes (arguable: undo BC break) | Deprecations? | no | Tickets | Fix #45097 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> #44732 causes messages using `addIdHeader('In-Reply-To', ...)` or `addIdHeader('References', ...)` to fail the headers check (see #44732 (comment) ), requiring users to manually format the header value themselves. This PR re-allows the previous behaviour of `addIdHeader` while keeping the new unstructured behaviour in-place as the default. ----- (I'm not sure if this counts as a new feature or a bug fix since it "reintroduces" a previous feature) Commits ------- ffde0f1 [Mime] Re-allow addIdHeader to be used for 'In-Reply-To' and 'References' headers
@nicolas-grekas
UnstructuredHeader
?IdentificationHeaderTest
are irrelevant now (but still pass) - should I remove them? And create some new test cases inUnstructuredHeaderTest
? Or rely on every aspect being tested with other headers there, and don't add anything?