Disable stripping emails

AI-generated summary

Jared_Needell reported that Discourse strips content from automated emails sent from CruiseControl.NET, suspecting HTML or signature detection as the cause. cpradio suggested testing by pasting the raw email source into a Discourse topic to isolate the issue. Jared_Needell confirmed pasting the full HTML body (not just rendered text) showed no stripping in manual posts, pointing to parsing quirks in email ingestion. Further investigation revealed the emails contain a second <head> tag and URL-encoded line breaks (=0D=CR, =0A=LF), which Discourse appears to mishandle, truncating content after the second <head>. downey noted Discourse doesn’t strip signatures due to lack of standard, though frictionel referenced RFC 3676’s -- signature delimiter as a quasi-standard ignored by Discourse. sam advised PMing @zogstrip the full email source for diagnosis. The thread ends with sam asking Jared_Needell for an update on resolution. No solution is confirmed in the thread, but the root cause appears to be Discourse’s HTML parsing limitations with malformed/multi-head emails and encoded newlines.

I have an automated report that gets sent to a discourse category but I noticed discourse is stripping half of it either maybe because it’s HTML or thinking it’s a signature.

I don’t see any option to disable striping signature/text out of incoming emails.

To identify which, can you take the source of the email and paste it into a Discourse Topic manually on your installation?

That will tell you if it is HTML being stripped out or if it is something to do with signature detection (specific to email).

at least I think this will work as a valid test

Hmm…

“We don’t strip out user signatures since there’s no standard.” - @zogstrip

Oh yeah, so that probably means it is the HTML then.

when I paste the email into a new topic, nothing is getting stripped out.

And you are pasting the HTML and text right, you aren’t just copying the text from your email client and pasting it? As that would be entirely different.

I’m opening the raw email and copying the entire body content which includes HTML

Anyone able to help with this?

Without specifics of the content in question, it will be hard to diagnose.

Ok,

So I did a little more digging, the email reports are emails from our CruiseControl.NET application which return a report of a “build” failure or success after a new build was created.

I noticed a couple things with the email,

  • The html body has a 2nd snippet that Discourse appears to stop reading the email after this point
  • The email uses URL encoding for line feed and new lines (HTML URL Encoding Reference)
    “=0D” and “=0A”.

If I manually remove the 2nd and get rid of the encoding. The output is pretty close to what the email actually looks like.

Any way to bypass those quirks and Discourse creates the message?

For starters, can you PM @zogstrip the full source of the problem email.

…but actually there is. Kind of: RFC 3676 - The Text/Plain Format and DelSp Parameters

I use "-- " since like forever. Had set up incoming email in Discourse, just did a test and was now wondering why my signature is not stripped. The above quote seems to explain why this quasi standard is ignored. (sorry, I didn’t find the source of the quote)

@Jared_Needell curious, what ended up happening here?