Skip to content

Implement wordwrap for unencoded (7bit/8bit) bodies - #38

Merged
alecpl merged 1 commit into
pear:masterfrom
eileenmcnaughton:patch-1-v2
Oct 29, 2026
Merged

alecpl merged 1 commit into
pear:masterfrom
eileenmcnaughton:patch-1-v2

Conversation

@eileenmcnaughton

Copy link
Copy Markdown
Contributor

We have been running a patch to wrap this line to 750 characters for
the last .... forever. 998 is the RFC 5322 max line length (section
2.1.1) - although 78 is recommended & might be better.

Per review feedback: quoted-printable and base64 already enforce
their own 76-character line wrapping as part of encoding (see
getEncodedData()), so wrapping the raw body in setBody() before
encoding had no effect for those two and only mattered for 7bit/8bit,
which pass through unencoded. Moved the wrap into
Mail_mimePart::getEncodedData()'s 7bit/8bit branch instead, where it
actually affects the transmitted line length. Added a test covering
the 7bit wrap, that short bodies are untouched, and that
quoted-printable's own wrapping is unaffected.

https://datatracker.ietf.org/doc/html/rfc5322#section-2.1.1
https://storage.googleapis.com/civicrm/patches/38231167f0c789e0b368b38c1499973d562de65e87094b402156a6b928cc4c38/crm_3133.patch
eileenmcnaughton added a commit to eileenmcnaughton/civicrm-core that referenced this pull request Oct 29, 2026
CRM-3133 wordwrap body to be 750 characters to apply with RFC 2821 patch is now in core

- created upstream pr for it but handling in our repo

pear/Mail_Mime#38
@alecpl
alecpl merged commit babc802 into pear:master Oct 29, 2026
13 checks passed
@eileenmcnaughton
eileenmcnaughton deleted the patch-1-v2 branch October 29, 2026 20:10
@eileenmcnaughton

Copy link
Copy Markdown
Contributor Author

thanks for the quick merge @alecpl - any chance of getting it tagged?

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.

2 participants