the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
1.01k stars 121 forks source link

Rendering issue #564

Closed relikd closed 1 year ago

relikd commented 1 year ago

Describe the bug SnappyMail can not display an email properly which works fine in Rainloop. External images are disabled for both plugins. It seems SnappyMail does two things differently:

If needed I can provide the email source.

Screenshots With Rainloop: 1

With SnappyMail: 2

Please complete the following information:

the-djmaze commented 1 year ago

Correct. SnappyMail shows info about the hidden images on purpose, where RainLoop does not. The reason behind this has several reasons:

The "long links" you refer to indicate that they are tracking images and that you should avoid clicking "Bilder anzeigen". Else the text should be much shorter.

However, maybe i can add a max-width with ellipsis to it.

Secondly, SnappyMail indeed removes all <style>sheets. The problem is that they may conflict with the whole application because the mail is not rendered in an iframe. RainLoop does the same thing.

the-djmaze commented 1 year ago

P.S. If you want the click tracking removed from those emails, then provide the .eml source and i will look what is possible.

Currently a view are stripped/decoded as you can see at: https://github.com/the-djmaze/snappymail/blob/master/dev/Common/Html.js#L25

relikd commented 1 year ago

There is no tracking to be removed, sadly. This email is from a typical newsletter provider (in this case send-in-blue). Nowadays these providers replace all links with tracking links so that the newsletter transmitter gets their statistics. You can't even disable this tracking "feature" (tried that for my newsletter provider ...).

But I must disagree on the stylesheet issue. Rainloop must do something differently because the email is displayed properly there. You can see the missing padding and blue font in the button for SnappyMail whereas Rainloop looks fine. What is more likely, that disabling styles will break the email format or that enabling styles will break the UI? And how could we circumvent this problem then? Could we add an iframe for the Email preview? Or have very unique css classes for snappy? I wonder how Rainloop has solved this problem.

the-djmaze commented 1 year ago

SnappyMail removes a lot because of the "dark mode" it has. There's even a user setting to remove all text and background colors!

In the past there were several view issues with e-mails and some were mine to solve and others by the sender. Mostly because the sender wrote invalid HTML/CSS that screwed up big time.

If you provide the email source i can have a look why yours is failing.

relikd commented 1 year ago

email.eml.txt

the-djmaze commented 1 year ago

Found 2 to solve.

The HTML source does have issues though. I found <a><p> which is not valid HTML.

the-djmaze commented 1 year ago

Also added stripping of SendInBlue image tracking

relikd commented 1 year ago

Regarding <a><p>, it may feel weird but is actually fine with the standard (using HTML5 or "HTML 4.01 + RDFa 1.1" as Doctype) https://validator.w3.org/#validate-by-input

<!DOCTYPE html>
<html lang="en">
<head><title>#</title></head>
<a href="#"><p>Lorem Ipsum</p></a>
</html>

And if you argue that a strict HTML 4.01 is required for older browsers, then I'd argue that SnappyMail does not support old browsers (I get a browser-update warning on my 6y old smartphone).

...

With 2.19.2 it looks better but is still cluttered. If I had an option, I would disable the display-hidden-images altogether.

screen