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

dev/core#2705 - wrap email message lines #20933

Closed
wants to merge 5 commits into from

Conversation

akosgarai
Copy link
Contributor

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.

@civibot
Copy link

civibot bot commented Jul 22, 2021

(Standard links)

@civibot civibot bot added the master label Jul 22, 2021
@seamuslee001
Copy link
Contributor

hmm @akosgarai we currently apply this patch https://raw.githubusercontent.com/civicrm/civicrm-core/74e25f27bb3be32519657539afe8a285c6c99a08/tools/scripts/composer/patches/mail_mime_crm_3133.patch into the mail_mime package which seems to aimed at doing a similar thing to this PR, that patch is added here https://github.com/pear/Mail_Mime/blob/master/Mail/mime.php#L1529 and just wondering the differences with your code.

@akosgarai
Copy link
Contributor Author

You are absolutely right @seamuslee001 That patch does exactly the same thing. To be honest, i didn't expect that that it is fixed, due to my find command (find civicrm-core -type f -name "*.php" -exec grep -r -i wordwrap {} \;) didn't gave me results when i searched for the occurrences of the wordwrap string in the civicrm-core codebase. I searched in the php files only not in the composer json, thats why the fix was hidden for me. I will report it back to the issue and also to the original stack exchange question. Should i close this PR?

@eileenmcnaughton
Copy link
Contributor

Yep - let's close this - I guess you got caught out being on an older version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants