Claws-mail and HTML e-mails - a new plugin

2 minute read Published: 2026-06-28

I’m using claws-mail at home for more than 20 years (I switched to mutt a few years in between). It is a very efficient e-mail reader and writer.

Nowadays one receive e-mails without any Content-Type: text/plain; part but only one big Content-Type: text/html; part. For instance I received a message from the public transportation here to say that they received my order. This message is 62.94 Kb long (only one big HTML). All the meaning text is 236 bytes long (counting return carriages) - 266 times smaller !

To view these silly e-mails one can use either fancy, dillo or litehtml_viewer. None of these plugin suits my needs either because it does not display correctly or is too slow. I wanted something fast enough that will only display the text of an HTML content type part. With Claude we wrote a new plugin htmltext-plugin for Claws-mail. See the Github htmltext-plugin repository. It is composed of two parts :

  1. The plugin (htmltext_viewer.so written in C) that you will load in Claws-mail. It is responsible to read the text/html and pass it to the htmltext-render binary and get the return result in order to display it into a GtkTextView

  2. The render binary htmltext-render written in Rust that takes an html input on stdin and converts it to readable text (it does not checks anything on internet, removes images, CSS and scripts).

As a bonus it works fine on RSS feeds.

Testing

Clone the repository, get libgtk-3-dev, libclaws-mail-dev (claws-mail headers) with a C development chain (at least gcc and pkg-config). Go to plugin directory and type make. It should produce a htmltext_viewer.so that you will load in Claws-mail.

git clone https://github.com/dupgit/htmltext-plugin
cd htmltext-plugin/plugin
make

Then install Rust if you haven’t already. Go to the render directory and build it in release mode and then copy it to some directory that you have in your PATH variable.

cd ../render
cargo b --release
cp target/release/htmltext-render ~/.cargo/bin/

Then load the plugin in Claws-mail Configuration → Plugins → Load… select htmltext_viewer.so in the directory where you build it. Then click on a multipart Content-Type: text/html; part - it should print only the text of the HTML page.