-   Slackware (
-   -   Another Mutt Problem: MIME Viewing & mailcap (

HaroldWho 02-17-2013 09:40 AM

Another Mutt Problem: MIME Viewing & mailcap
Yep, I'm back with another puzzler. In mutt I can view a text/html attachment with lynx as specified in my ~/.mailcap file:


# $Id$

text/html; cat %s | lynx -stdin
image/gif; xv %s
image/jpg; display %s
application/pgp-keys; pgp -f < %s ; copiousoutput

With the *same* .mailcap file viewing of text/html fails in 1.5.21 with this message:


[-- text/html is unsupported --]
mailcap entry for type text/html not found
I've relocated the mailcap file; I've tried other syntax for the lynx entry, but no joy. I'm going nuts trying to get a handle on this.


ml4711 02-17-2013 09:53 AM

Maybe try this one:


text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html

andrew.46 02-17-2013 03:14 PM

On my own system I use w3m as this offers better html table support with the following in my mailcap:


text/html; /usr/bin/w3m -cols 90 -dump -T text/html '%s'; copiousoutput
and the following in .muttrc


set mailcap_path="~/mail/mutt/mutt_mailcap"
auto_view text/html                      # Automatically parse html messages through w3m
auto_view text/x-vcard                  # vcard attachments viewed through mutt.vcard.filter
set implicit_autoview=yes                # Load in pager if setting in .mailcap says 'copiousoutput'.

(I have a specific mailcap file for mutt).

HaroldWho 02-18-2013 04:26 PM

First, the suggestion for using the -dump option with lynx works. I changed it a little:

text/html; lynx -nonumbers -dump %s; copiousoutput; nametemplate=%s.html
to eliminate clutter from numbered references.

Yet here's a suggestion right from the mutt html documentation:

text/html; lynx %s; nametemplate=%s.html
that FAILS to launch lynx.

I'll have to see how I like using the copiousoutput text dump.

Thanks for proposing a solution. The failure to launch lynx directly still bugs me though.

HaroldWho 02-19-2013 04:00 PM

A final thought:

I removed the text/html; entry in .mailcap and added this macro:

macro  attach  "l" "|lynx -stdin \r" "View text/html with lynx"
Now I can hit "v" to view the attachment list, then "l" to launch lynx directly.

Thanks again for the help.

ml4711 02-20-2013 02:28 PM

Just for the record.
If you have these two in the mailcap:


text/html; lynx %s; nametemplate=%s.html
text/html; lynx -nonumbers -dump %s; copiousoutput; nametemplate=%s.html

The first entry still works in the "view-attachments" i.e "v" command in the main
pager, but mutt has changed in the way, that if you use "Enter" on the attachment,
the line with "copiousoutput" is used. And if you use "m" i.e force mailcap use,
the first line is used, and you see the page in the real lynx window.


HaroldWho 02-20-2013 04:35 PM

Now that IS interesting. I certainly missed the "m" entry in the docs. I can't wait to try this out.

Thanks for sharing your expertise.

All times are GMT -5. The time now is 11:27 PM.