webmin / usermin

Usermin source code
http://www.usermin.com/
Other
117 stars 48 forks source link

HTML content type text replies not displaying in Read Email. #76

Open chris001 opened 2 years ago

chris001 commented 2 years ago

This has happened on more than one incoming Reply messages. Sent an email from Usermin with the default text/plain content. The recipient replies with text/html. Their reply message is HTML and appears empty, you see only the original message, wrapped in an html box by their email client, but their text/html message reply is not showing. When you click view raw message, you see, in their multipart text/html, their reply text, with css, is located inside the <head> tag! The original message which they replied to, is formatted inside a box in the <body> tag. Seems to violate the HTML standards regarding do not put content intended to be seen by end users inside the head tag. Is this a standard format for HTML email messages? Should Usermin parse the text from the <head> tag? Possibly related to #58

chris001 commented 2 years ago

Update: iOS Mail app displays the reply message content hiding in the head tag. So it must be somewhat of a standard algorithm, how exactly to strip away the html tags or whatever, and display the message text no matter what tag it's hiding inside of.

chris001 commented 2 years ago

Message is readable in the iOS Mail app, yet the message violates HTML standard by storing content (the html formatted reply message) in the <head> tag. Only metadata about the html document, is allowed to be stored in the <head> tag! IMG_7387

jcameron commented 2 years ago

Could you send an email like this to me at jcameron@virtualmin.com ?

I'd like to see the raw message and so figure out why Usermin isn't parsing it properly..

chris001 commented 2 years ago

OK FYI here's the bug (no head tag text, which is the main content of the message sender's reply) in Usermin on Firefox 102 (latest version) which is a quite conforming to html standards browser. I think the cause of the bug is some anti-standards way of parsing the html before it gets displayed in the email client, so that even text in the head tag, which is normally never shown on web pages, will get shown to the reader of an html email message: usermin read email html display bug

chris001 commented 2 years ago

Sent!

jcameron commented 2 years ago

Got it, thanks! I'm not sure how to handle this case, since it seems like they are completely off-spec by using the tag.

What mail client is sending these messages? It looks like some ticket system..

chris001 commented 2 years ago

I don't know which mail client is sending these messages, I could ask, however, the email renders readable in iPhone iOS Apple Mail client on the iPhone, this tells us the Usermin rendering algorithm isn't doing as much as it should to more closely follow all the important render steps used by such popular email reading apps as iOS Apple Mail.

I searched and found a few decent articles about how and why webmail (in particular Gmail) has decided they must filter and rearrange the HTML from the email message body, before outputting it into the browser for display to the user. It's quite a lot of filtering steps! Which they arrived at after many many many improvements over a significant time exposed and used by the masses! One of which involves literally removing the head start and head end tags, exposing any user generated text content inside the head tags to the user reading the email.

Here's one of these articles that lists steps Gmail does to process the HTML email before it outputs to the browser..