I recently managed to set up my mailcap so that mutt can show HTML e-mails in the message window:# ~/.mailcaptext/html; lynx -dump '%s' | more; nametemplate=%s.html; copiousoutput;which is automated by:# ~/.muttrcauto_view text/htmlAlthough I think lynx does a decent job on converting the HTML to text, sometimes this doesn't cut it and I would like to be able to open the HTML attachment in my web browser (luakit).Is there a way to transparently do this? A good workflow for me would look like:open mail (lynx converts it)see that it is too complicated for lynxpress vnavigate to HTML attachmentpress enter to open the mail in luakit.
Open html attachments externally in mutt
mutt;browser;html;lynx
You can do this with mutt's mime support. In addition, you can use this with Autoview to denote two commands for viewing an attachment, one to be viewed automatically, the other to be viewedinteractively from the attachment menu.Essentially, you include two options in your mailcap file1.text/html; luakit '%s' &; test=test -n $DISPLAY; needsterminal;text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput;The first entry tests that Xis running, and if it is, it hands the file to luakit. The default, however, is determined by the copiousoutput tag, so it will be rendered in mutt by lynx.You will need these options in your .muttrc:auto_view text/html                                   # view html automaticallyalternative_order text/plain text/enriched text/html  # save html for lastIf you want to look at it in your browser, it is just a matter of hitting v to view the attached HTML and then m to send it to mailcap. For convenience, I bind Enter to that function in muttrc:bind attach <return>    view-mailcap1. Note, I don't use lynx or luakit, so these options are indicative only.Shamelessly reproduced from this blog post...