dev/core#2705 - wrap email message lines #20933
Closed
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.
Overview
Patch for CORE-2705.
Wrap long lines that could cause invalid DKIM signatures.
Before
If you send an email with lines longer than 1000 characters, the lines are not wrapped.
After
The lines in the email are wrapped after 990 characters.
Technical Details
The wordwrap functionality has been called after the alterMailParams hook has been executed, to prevent the overwrite with the hook. This functionality has been added after every alterMailParam hook call except when the context is messageTemplate, because that hook is called before the tokens are applied.
Comments
I'm not familiar with the flexmailer and the hook is also triggered from there with the flexmailer context. I'm not sure that I put the wrapping logic into the right place. If you could point me to the relevant documentation, that would be welcome.