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

Line wrap plain text and HTML parts #63

Open
jhillyerd opened this issue Feb 25, 2018 · 4 comments
Open

Line wrap plain text and HTML parts #63

jhillyerd opened this issue Feb 25, 2018 · 4 comments

Comments

@jhillyerd
Copy link
Owner

enmime does not enforce a line-length on text parts. It should wrap the content in a way that preserves the original bytes upon decoding.

@jhillyerd jhillyerd changed the title Wrap plain text and HTML parts Line wrap plain text and HTML parts Feb 28, 2018
@requaos
Copy link
Collaborator

requaos commented Jan 21, 2019

So it looks like there is a hard-limit at 998 characters per line, but a suggested soft-limit at 78 characters per line (excluding CRLF line termination)

RFC-5322:

2.3. Body

The body of a message is simply lines of US-ASCII characters. The
only two limitations on the body are as follows:

o CR and LF MUST only occur together as CRLF; they MUST NOT appear
independently in the body.
o Lines of characters in the body MUST be limited to 998 characters,
and SHOULD be limited to 78 characters, excluding the CRLF.

Note: As was stated earlier, there are other documents,
specifically the MIME documents ([RFC2045], [RFC2046], [RFC2049],
[RFC4288], [RFC4289]), that extend (and limit) this specification
to allow for different sorts of message bodies. Again, these
mechanisms are beyond the scope of this document.

@jhillyerd
Copy link
Owner Author

I'd definitely prefer to respect the 78 char limit. It would be annoying to "view source" in an email client and get a massively wide window to scroll around.

@requaos
Copy link
Collaborator

requaos commented Jan 23, 2019

Yeah, at 78-char wide it would look nice and tidy when you scroll by the base64 (72-char wide blocks)

@requaos
Copy link
Collaborator

requaos commented Nov 30, 2019

@jhillyerd I was looking at https://github.com/yosssi/gohtml as a drop in for satisfying the HTML line wrapping requirement.

There is still more work to be done implementing format=flowed for text/plain

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

No branches or pull requests

2 participants