# HTML-entiteiten en escape-tekens in tekst/plain uitgaande e-mail alternatief

**URL:** https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637
**Category:** Bug
**Created:** [5 januari 2024 om 16:04 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637 "2024-01-05T16:04:08Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![strk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strk/32/121193_2.png) [@strk](https://meta.discourse.org/u/strk)
#### Post date: [5 januari 2024 om 16:04 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637/1 "2024-01-05T16:04:08Z")

</div>

We recently setup an experimental Discourse instance and noticed that the posts sent to watchers contain HTML entities in the text/plain alternative version of them. Sounds like a bug to me.

The instance is here: [https://discourse.osgeo.org](https://discourse.osgeo.org)  
Screenshot of one such email can be seen here: [Sandro Santilli 🌍 GIS: "@pmusaraj@mstdn.ca I can tell, and that hurts! @D…" - Mapstodon.Space](https://mapstodon.space/@strk/111704156837762875)  
The compete email can be read from discourse itself here: [PSC Vote: Let's move this list to discourse - #11 by Martin\_Spott - SAC mailing list - OSGeo Discourse](https://discourse.osgeo.org/t/psc-vote-lets-move-this-list-to-discourse/6528/11?u=strk)  
And another view of the email can be read on the Mailman archive, which is how it reached Discourse: [PSC Vote: Let's move this list to discourse](https://lists.osgeo.org/pipermail/sac/2024-January/016417.html)

The mail received by Mailman to subscriber is ONLY text/plain 7bit us-ascii but the one received via Discourse becomes multi-part and also has an HTML version which is obviously made up as the original poster did not write in HTML

---

<div class="post-metadata">

### Author: ![strk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strk/32/121193_2.png) [@strk](https://meta.discourse.org/u/strk)
#### Post date: [5 januari 2024 om 16:11 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637/2 "2024-01-05T16:11:39Z")

</div>

Downstream ticket: [Making sure you're not a bot!](https://trac.osgeo.org/osgeo/ticket/3073)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [11 januari 2024 om 15:43 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637/5 "2024-01-11T15:43:56Z")

</div>

> The upstream ticket is unanswered for 4 days now, I suspect neither Discourse dev nor Discourse proponent care about email mediated communication, making this problem’s only possible fix being a “scratch your own itch” project.

We **do** care about email mediated communications, that’s why we put an extensive amount of work adding support for both incoming and outgoing emails in Discourse. That said, it’s a tremendously difficult task to account for every use cases as those often conflict with one another.

Trying to diagnose your issue and better understand your user case, here’s how I understand things are going

- Your instance is setup to receive incoming email from a mailing list
- The user “Martin\_Spott” sent a text/plain email to your mailling list
- Discourse processed the email, transforming the plain text into markdown / html to be displayed in Discourse
- You received a copy of that email, because you’re watching that topic / category on Discourse
- The content of that email is mangled

Am I correct?

---

<div class="post-metadata">

### Author: ![strk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strk/32/121193_2.png) [@strk](https://meta.discourse.org/u/strk)
#### Post date: [12 januari 2024 om 08:50 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637/6 "2024-01-12T08:50:51Z")

</div>

Well, what happens inside Discourse I don’t know but what I observe is:

- Our instance is setup to receive incoming email ( from anything )
- [trac.osgeo.org](http://trac.osgeo.org) sends text/plain emails to the Discourse incoming email address, assuming monospace fonts are used
- Discourse does something I dunno
- Users of Discourse who opted to receive email notifications receive a multipart email containing an html and a text/plain alternative, with the text/plain having dashes escaped and html entities in them

Now, the above mentioned problem (trac emails being malformed) seems to have been fixed at the moment but I don’t know by which event: [Making sure you're not a bot!](https://trac.osgeo.org/osgeo/ticket/3073#comment:14)

Could things have changed due to me toggling “Mailing List Mode” on and off ?

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [12 januari 2024 om 09:37 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637/7 "2024-01-12T09:37:50Z")

</div>

> [@strk](#):
>
> Could things have changed due to me toggling “Mailing List Mode” on and off ?

I doubt it. It’s more likely the “incoming email prefer html” site setting.

Glad it’s better now 🙌

---

<div class="post-metadata">

### Author: ![strk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strk/32/121193_2.png) [@strk](https://meta.discourse.org/u/strk)
#### Post date: [12 januari 2024 om 16:06 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637/8 "2024-01-12T16:06:14Z")

</div>

I talked too early: [Making sure you're not a bot!](https://trac.osgeo.org/osgeo/ticket/3073#comment:15)

Are you suggesting it is beter to set “incoming email prefer html” to YES or NO ?

---

<div class="post-metadata">

### Author: ![strk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/strk/32/121193_2.png) [@strk](https://meta.discourse.org/u/strk)
#### Post date: [14 januari 2024 om 16:30 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637/9 "2024-01-14T16:30:46Z")

</div>

@robe2 mentioned the (temporary) fix was probably due to her unchecking the “Category is mirror” checkbox - hopefully this gives more information for a fix

---

<div class="post-metadata">

### Author: ![robe2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robe2/32/352390_2.png) [@robe2](https://meta.discourse.org/u/robe2)
#### Post date: [14 januari 2024 om 16:57 UTC](https://meta.discourse.org/t/html-entities-and-escape-characters-in-text-plain-outgoing-email-alternative/290637/10 "2024-01-14T16:57:42Z")

</div>

Correct when I unchecked the “Category is mirror” the email being sent looked better and looking at the posts, they looked cleaner too.

However I had to check the box back because it was preventing threading and was also causing some emails from our ticket tracker to be rejected with rejection error **Title has already been used**
