Sandboxing HTML e-mails in mu4e
Here’s a neat trick for rich text (HTML) e-mail preview in the mu4e MUA.
Instead of default HTML preview, I use the Fedora sandbox
like this:
(setq mu4e-html2text-command "/usr/bin/sandbox w3m -dump -T text/html")
I have the above line in my .emacs
, and in effect it just filters all HTML e-mails with w3m
run inside the sandbox when I want to read the e-mail.
By default, the sandbox provides standard input and output to the application, and not much anything else. That’s perfectly enough for w3m
in -dump
-mode.
Oh and why I do this? In my use the elisp
HTML-parser is tad too slow, so I wanted to use faster parser. w3m
is a C-program interfacing arbitrary HTML-content from the interwebs and I wanted to make sure it behaves.