pazz / alot

Terminal-based Mail User Agent
GNU General Public License v3.0
683 stars 163 forks source link

Alot does not render all html parts of a message #1578

Open lucc opened 3 years ago

lucc commented 3 years ago

Describe the bug Not all html parts of a multi part email are rendered in alot.

Software Versions

To Reproduce Steps to reproduce the behaviour:

  1. put the attached alot-bug-multi-part.txt in your notmuch database
  2. set prefer_plaintext = False in the config
  3. make sure you have a mailcap entry for text/html. A simple one like text/html: cat %s; copiousoutput; should suffice.
  4. Open the mail in alot
  5. see here is the document: but not more important text!

The problem

Some mail user agents (like Apple Mail in this case) produce a multipart mixed mime part when the user drags and drops a external file in their mail. They can write text above and below the document in the user interface so they do not notice anything strange. If Apple mail can,it will even display the document in the middle. The resulting mail has a text/html part followed by a application/pdf (or whatever) part and another text/html part.

Alot only renders the first html part potentially hiding important information from our users!

Proposed solution

We should iterate over all items in a multipart/mixed and for each one decide if we can render it.