mime alternative text/plain vs text/html working incorrectly in Ubuntu 16.04 LTS

30 views
Skip to first unread message

Mike Hayward

unread,
Jun 19, 2017, 9:08:09 AM6/19/17
to mu-discuss
I have been using emacs rmail forever and thought I'd give mu4e a try since I like the idea of being able to access my mail via imap or as individual files.  I have installed it as an Ubuntu package and it fires up fine.

The problem I'm having is that the default behavior is to display mime/alternative as text/html instead of as text/plain.  Not sure why this would be the default behavior in a plain text editor.  I tried to fix this by adding (setq mu4e-view-prefer-html nil) to my .emacs file but still it is hiding the fact that there is readable plain text.  Actually I haven't even been able to figure out how to make it display the plain text period.  Has anyone figure out how to work around this so mu4e will show that there are alternatives and let you choose which to display, display them both, or at least have it show you the plain version by default?

John Mastro

unread,
Jun 19, 2017, 4:22:25 PM6/19/17
to mu-di...@googlegroups.com
Depending on the email messages in question it could be related to
`mu4e-view-html-plaintext-ratio-heuristic'.

By default, mu4e will show the HTML part if the text part is "too short"
relative to the HTML part, based on a simple heuristic. This is the case
even if you set `mu4e-view-prefer-html' to nil.

To override that and always show the text part when available, you can
add this to your init file:

(setq mu4e-view-html-plaintext-ratio-heuristic most-positive-fixnum)

Hope that helps

John

Mike Hayward

unread,
Jun 20, 2017, 12:13:20 AM6/20/17
to mu-discuss
Hi John,

Thanks for the suggestion; I added that to my .emacs but still it is displaying the html instead of plain.  Honestly I'd rather have it just show all sections like RMAIL.  It's a bummer it is hiding stuff!

John Mastro

unread,
Jun 20, 2017, 10:55:21 AM6/20/17
to mu-di...@googlegroups.com
Mike Hayward <loup...@gmail.com> wrote:
> Thanks for the suggestion; I added that to my .emacs but still it is
> displaying the html instead of plain. Honestly I'd rather have it just show
> all sections like RMAIL. It's a bummer it is hiding stuff!

Hmm. One more thing you could try, though the mu4e documentation seems
to imply it shouldn't be necessary, is:

(with-eval-after-load 'mm-decode
(add-to-list 'mm-discouraged-alternatives "text/html"))
Reply all
Reply to author
Forward
0 new messages