5.3 Reading rich-text messages

These days, many e-mail messages contain rich-text (typically, HTML); either as an alternative to a text-only version, or even as the only option.

By default, mu4e tries to display the ’richest’ option, which is the last MIME-part of the alternatives. You can customize this to prefer the text version, if available, with something like the following in your configuration (and see the docstring for mm-discouraged-alternatives for details):

(with-eval-after-load "mm-decode"
  (add-to-list 'mm-discouraged-alternatives "text/html")
  (add-to-list 'mm-discouraged-alternatives "text/richtext"))

When displaying rich-text messages inline, mu4e (through gnus) uses the shr built-in HTML-renderer. If you’re using a dark color theme, and the messages are hard to read, it can help to change the luminosity, e.g.:

(setq shr-color-visible-luminance-min 80)

Note that you can switch between the HTML and text versions by clicking on the relevant part in the messages headers; you can make it even clearer by indicating them in the message itself, using:

(setq gnus-unbuttonized-mime-types nil)

Note that you can jump to the relevant MIME-parts using mu4e-view-jump-to-mime-part, which ask for the number or uses the prefix-argument.

5.3.1 Inline images

When you run Emacs in graphical mode, by default images attached to messages are shown inline in the message view buffer.

To disable this, set gnus-inhibit-images to t. By default, external images in HTML are not retrieved from external URLs because they can be used to track you.

Apart from that, you can also control whether to load remote images; since loading remote images is often used for privacy violations, by default this is not allowed.

You can specify what URLs to block by setting gnus-blocked-images to a regular expression or to a function that will receive a single parameter which is not meaningful for mu4e.

For example, to enable images in Github notifications, you could use the following:

(setq gnus-blocked-images
   (lambda(&optional _ignore)
     (if (mu4e-message-contact-field-matches
         (mu4e-message-at-point) :from "notifications@github.com")
        nil ".")))

mu4e inherits the default gnus-blocked-images from Gnus and ensures that it works with mu4e too. However, mu4e is not Gnus, so if you have Gnus-specific settings for gnus-blocked-images, you should verify that they have the desired effect in mu4e as well.

Finally, for some message with big images it can be useful to enable buttons and full display, e.g. for saving inline images. For this you can try M-x mu4e-view-show-mime-parts. This can be a little slow.