Configuring end-of-line characters for text versions of emails? (default of CR+LF appears double-spaced)

Hi Discourse Community —

Something I’ve noticed for a few years, but only bothered to look into today, is that for emails generated by Discourse, the “Text/PLAIN” version of the mail (as opposed to the “Text/HTML” version) seems to be rendered with too much vertical space in my mail viewer, as though it’s double-spaced. Digging into it a bit, it looks to me that this is because the text version uses both carriage return (CR) and linefeed (LF) to mark the ends-of-lines (where my mail reader’s preference would be to just use LF).

Is this something that is within my ability to configure as a site administrator? (e.g., a “text-email-end-of-line-character(s)” setting).

Thank you,

PS — Screenshots for the curious:

Composing a message:

As viewed in text-based mailer:

As viewed in an editor that will display the carriage returns:


PPS — Potentially related issue by @niemeyer: Excessive spacing on text/plain email content


Following up on my own post:

It’s been posited that the cause for this is that the Discourse-formatted text attachments use CR+CR+LF to mark ends of lines, but that the email standard requires any CR to be followed by a LF, so some mailers may correct the issue by inserting the missing LF to create CR+LF+CR+LF resulting in the apparent double-spacing. I haven’t yet had the time to dig into the Discourse-generated text attachment in a hex editor to validate this yet, though.


[CR = carriage return, LF = linefeed]

1 Like