Since /etc/mailcap is underdocumented and MUAs can't set MIME types properly, people hack their way around it (mutt_octet_view mutt_octet_filter). Unfortunately, this just re-solves the problem that AFAIK, /etc/mailcap was supposed to solve.

The best documentation I found was a man page online (not on my gentoo box, even though I have an /etc/mailcap). If there's better, please let me know.

Caveats include: %s is different in the commmand section than in the test section (in command it's an actual file's name, but without quotes around it; in the test section, it's the name of the attachment with single quotes around it; you can see this in the first octet-stream below). Anyone have any others?

# patrick's mailcap (I know it's missing the proper mime-types for M$) # application/octet-stream; oocalc2 '%s'; test=perl -e "%s !~ /\.xls$/i and exit 1" application/octet-stream; oowriter2 '%s'; test=perl -e "%s !~ /\.doc$/i and exit 1" application/octet-stream; ooimpress2 '%s'; test=perl -e "%s !~ /\.ppt$/i and exit 1" # application/x-pdf; xpdf '%s'; application/octet-stream; xpdf '%s'; test=perl -e "%s !~ /pdf$/i and exit 1" # image/*; display '%s' # audio/basic; /usr/lib/mime/playaudio '%s'; # application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; copiousoutput # text/plain; less '%s'; needsterminal text/richtext; oowriter2 '%s'; description="Richtext" text/enriched; oowriter2 '%s'; description="Enriched Text" text/html; firefox '%s'; needsterminal; description=HTML Text; nametemplate=%s.html text/*; less '%s'; needsterminal # message/partial; showpartial '%s' %{id} %{number} %{total} message/external-body; showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}; needsterminal # application/x-tar; /bin/tar tvf -; copiousoutput application/x-gtar; /bin/tar tvzf -; copiousoutput