-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
RFC 2049 section 4 step 2 says we should transform bodies to CRLF line endings ("canonical form"). I've found that emails built using Courriel::Builder's build_email() with plain_body() do not have such line endings when passing a body with LF line endings. The base64 body does, but not the raw body that gets base64 encoded.
For example, if we give Courriel plain_body("hi\nthere") we get something like encode_base64("hi\nthere", "\r\n") where I think we should have encode_base64("hi\r\nthere", "\r\n").
Presumably this is usually okay. However, I've had a recent issue where a more esoteric MUA was not displaying a plaintext email built this way correctly, and this is one possible, though unlikely, culprit. Unfortunately I've not been able to verify whether this is the cause.
I'm not entirely sure this should be Courriel's responsibility, though I think it might make sense. If not, it could be something to document at least so that callers know to do it.
What do you think?
Thank you!