Want to auto_view html, but try text/plain first

Cameron Simpson cs at cskk.id.au
Sun Oct 21 22:56:12 UTC 2018


On 21Oct2018 09:29, Manish Rai Jain <manishrjain at gmail.com> wrote:
>I'm trying to render the HTML attachments in my email automatically, 
>using
>auto_view. However, I also use alternative_order so it would render any
>text/plain attachment first, and only if it is not present, would it render
>HTML. Here's my config:
>
>.muttrc
># Viewing
>auto_view text/html
>alternative_order text/plain text/enriched text/html
>
>.mailcap
>text/plain; cat %s; copiousoutput;
>text/html; google-chrome-stable %s; nametemplate=%s.html; copiousoutput;
>
>I also tried setting auto_view to text/plain text/html. But, that just
>causes both text and html to render. What am I doing wrong?

I'm not sure what your trying to fix. It sounds like you only one one to 
render, but not always the plain in preference to the html.

I maintain a group containing authors who provide useless plaintext 
accompaniments, and whose html is the only useful version. Sadly, there 
are quite a few.

My muttrc has this:

  ############################
  # alternative-order criteria
  message-hook . 'unalternative_order *; alternative_order text/plain text/html'

  # Apple Mail embeds attachments in the HTML part instead of outside 
  # the multipart/mixed
  message-hook '~h "X-Mailer: Apple Mail" ~X 1-' 'unalternative_order *; alternative_order text/html multipart/mixed text/plain'

  # senders who can't seem to master multipart/mixed, and send empty or 
  # useless text/plain sections
  # or just badly badly formatted plain text, such as live.com etc
  message-hook '%f htmlers | ~f @no-reply at cc.yahoo-inc.com | ~f @outlook.com | ~f live.com | ~f @facebookmail.com' 'unalternative_order *; alternative_order text/html text/plain'

so my default is plain text in preference, but for some expections where 
I swap things.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Mutt-users mailing list