Quoting in e-mail notifications does not comply with e-mail standards

TL;DR: Can we change how Discourse formats quotes in plain text e-mail?

I’ve followed the discussion on the devel list regarding the move to Discourse in favor of Mailman. In order to get a better idea how well Discourse works when interacting with it from my inbox[1] I made some changes to my settings and I am now receiving notifications in my mail client.

The first thing I noticed, and which I find really annoying, is the way Discourse sends quoted text:

[quote="André Costa, post:1, topic:81489, username:ocosta"]
IMHO it wouldn’t hurt having a “Upgrading using DNF?” link somewhere on the main page
[/quote]

That’s an example from a recent thread. The [quote] / [/quote] tags aren’t very helpful in plain text mail and they do not comply with e-mail standards. My favorite site to turn to in these matters is Use plaintext email. It references RFC3676, The Text/Plain Format and DelSp Parameters[2].

What it boils down to is the way mail clients should quote text in the plain text space. In the example above, this should look something like:

André Costa:
> IMHO it wouldn’t hurt having a “Upgrading using DNF?” link somewhere on the main page

I left out the rather useless information in the header regarding post and topic. The username might be helpful and could be included above the quote.

The question is, can we change that in the settings or by some easy means of “hacking”? Or should I report that upstream and ask Discourse to properly format plain text e-mail quotes?

On a side note[3], I’m writing this thread starter in the web interface. Ideally, I would like to use my mail client for that as well. But I have no idea where to send the mail to, so it ends up in the right category with the right tag.


  1. Yes, I’m one of those oldskool guys, who have deeply engraved preferences (think of old dogs and new tricks). ↩︎

  2. https://www.ietf.org/rfc/rfc3676.txt ↩︎

  3. Usually a good indicator that this deserves a thread of its own… ↩︎

2 Likes

I think this is an upstream thing — I don’t think there’s an option to replace the forum quoting markup with email-standard.

1 Like

I think this is an upstream thing — I don’t think there’s an option to replace the forum quoting markup with email-standard.

Okay. I will open an issue upstream then and tag you in it (for leverage) :wink:

But look how well properly formatted quotes in my client are formatted:

What it boils down to is the way mail clients should quote text in the plain text space. In the example above, this should look something like:

André Costa:
> IMHO it wouldn’t hurt having a “Upgrading using DNF?” link somewhere on the main page

/me hopes this is not turning into a mess since he’s replying by ye olde
e-mail

2 Likes

I know I’m opening up an old topic, and apologies for that, but I just wanted to point out the formatting of @gui1ty 's reply email, when it comes to quoting — when viewed in the web interface.

It’s not terrible, but there are differences. In the quoted section where @mattdm quotes @gui1ty , because its MarkDown source still includes Discourse’s BBCode-esque quote header:

[quote="Penguinpee, post:1, topic:81489, username:gui1ty"]

…even in @gui1ty 's subsequent (email-submitted) reply, the quoted section is formatted with rich attribution, showing @gui1ty’s avatar and identity, along with an uparrow linking to the original post from which the quote came.

In an email reply where quoting is done using standard email quote formatting, all of that information is lost and the system is forced to format the quoted section as an unattributed quote. It can still parse the > leaders and transform the text that follows into a <blockquote>, but the quote headers serve far more purpose than just that.

In theory email replies can include richer attribution than just a name — GMail, for instance, attributes quoted sections with,

On Wkdy, Mnth DD, YYYY at HH:MM Sender Name <sender@mail.host> wrote:

But that still isn’t really enough to definitively tie a quote back to its source post, and more importantly I don’t know if there are any standards for formatting and/or parsing those attributions, so Discourse doesn’t attempt to. (Notice that in @gui1ty 's reply, the quoted section at the top is not attributed to @mattdm).

Point is, the [quote ...] block headers have a meaningful purpose, so for the system to throw them away when formatting messages for email recipients would be a mistake.

I’d only personally be in support of using “proper” (read: crippled) plaintext quote formatting in email, if reply via those emails was also disabled. That’d prevent the “dumbed-down” plaintext message format from infecting the web conversations with its lack of quoting metadata. But I doubt any “use Discourse like it’s a mailing list server” proponents would want that.

I don’t think that information is lost. It might not be in the body of the e-mail, but is in the headers (aka metadata) of the e-mail. So, with some effort and maybe additional headers, Discourse should be able to deliver the same details and attributions as when one replies using the web interface (which I’m using now).

While there are improvements to be mad on how replies by e-mail are rendered in the web interface, the reverse, web replies rendered in e-mail, leaves much more to be desired. Sometimes it’s so bad that I turn to the web interface for better readability.

More challenging though is quoting from different replies. But I can live with having to post one reply for every user quoted as long as the formatting works both ends.

1 Like

If the reply is to just one person, it’s easy. If there are bunch of interleaved quotes in traditional email / usenet > style, correctly attributing them to the right person seems like a challenge.

| Penguinpee gui1ty Packaging Team
August 23 |

  • | - |

Frank Dana (FeRD):

In an email reply where quoting is done using standard email quote formatting, all of that information is lost and the system is forced to format the quoted section as an unattributed quote. It can still parse the > leaders and transform the text that follows into a <blockquote>, but the quote headers serve far more purpose than just that.

I don’t think that information is lost. It might not be in the body of the e-mail, but is in the headers (aka metadata) of the e-mail. So, with some effort and maybe additional headers, Discourse should be able to deliver the same details and attributions as when one replies using the web interface (which I’m using now).

How do you figure? Even if, for the sake of argument, the extra metadata is transferred into the message headers when Discourse sends an email notification, it still won’t be included in your reply to that email, because your client won’t know to include those headers.

The idea that Discourse can transform its rich conversation text into plain-text, and then magically transform a plaintext-format reply to that message back into the native rich-text format again, beggars the imagination.

As an experiment, I’m actually sending THIS reply via email — but as an HTML-format reply to the HTML-format notification email. I’m curious how much of the formatting is preserved that way.

If it’s “still very little”, that’s OK as email isn’t meant to be the primary means of communication anyway. Never was.

If it’s “a pretty good amount”, then that’s one more argument not to dumb down the notification messages into a format standardized just short of 20 years ago, and has been in use informally since the 1970s, really. We have color TVs and flying machines now. It’s, like, the future and stuff.