thunderbird / thunderbird/thunderbird-android

Full (sandboxed) HTML support for viewing email

Open
#7,737 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Kotlin
Stars
14k
Forks
2.8k
Avg merge
3d 3h
Merged PRs (30d)
57

Description

Checklist
  • I have used the search function to see if someone else has already submitted the same feature request.
  • I will describe the problem with as much detail as possible.
  • This issue only contains a request for one single feature, not multiple (related) features.
App version

6.801

Problem you are trying to solve

I am trying to read an email that uses "advanced" HTML features.

Suggested solution

K9 should allow basically all HTML. Presumably only the following should be blocked:

  • Scripting
  • Remote content loads (when not allowed)

This would allow email authors to better control the formatting and provide a better reading experience.

Screenshots / Drawings / Technical details

I originally noticed this issue because I wasn't seeing some expected padding. I eventually figured that this was because it was applied on an <article> element and K9 uses a whitelist (https://github.com/thunderbird/thunderbird-android/blob/main/library/html-cleaner/src/main/kotlin/app/k9mail/html/cleaner/BodyCleaner.kt). (I assume, I haven't read the source too closely.)

At first I thought I would just extend the list, but it seems like a small step and maybe a bigger solution is ideal. It seems that K9 is using a full browser engine to render the mail so it should be possible to input any HTML. This is just like how Thunderbird desktop works. I don't think there is any major issue with this approach. The whitelist already allows any CSS so there is little more that can be done. I guess <video>, <audio>, <object> and <iframe> may be interesting. But Ideally those would be implemented with a generic block on remote content. (Actually it would be nice if <video> and <audio> were allowed, if not automatically when clicking at least when remote-content is enabled).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading library/html-cleaner/src/main/kotlin/app/k9mail/html/cleaner/BodyCleaner.kt and trace how email HTML is sanitized before rendering. Define how broader HTML support should preserve elements such as article while keeping scripting and disallowed remote content blocked, including the requested video and audio behavior when remote content is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.