<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 5. Mutt's MIME Support</title><meta name="generator" content="DocBook XSL Stylesheets V1.71.1" /><link rel="start" href="index.html" title="The Mutt E-Mail Client" /><link rel="up" href="index.html" title="The Mutt E-Mail Client" /><link rel="prev" href="advancedusage.html" title="Chapter 4. Advanced Usage" /><link rel="next" href="optionalfeatures.html" title="Chapter 6. Optional features" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Mutt's MIME Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="advancedusage.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="optionalfeatures.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="mimesupport"></a>Chapter 5. Mutt's MIME Support</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="mimesupport.html#using-mime">1. Using MIME in Mutt</a></span></dt><dd><dl><dt><span class="sect2"><a href="mimesupport.html#id473793">1.1. Viewing MIME messages in the pager</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#attach-menu">1.2. The Attachment Menu</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#compose-menu">1.3. The Compose Menu</a></span></dt></dl></dd><dt><span class="sect1"><a href="mimesupport.html#mime-types">2. MIME Type configuration with <code class="literal">mime.types</code></a></span></dt><dt><span class="sect1"><a href="mimesupport.html#mime-viewers">3. MIME Viewer configuration with <code class="literal">mailcap</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="mimesupport.html#id474197">3.1. The Basics of the mailcap file</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#id474319">3.2. Secure use of mailcap</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#id474390">3.3. Advanced mailcap Usage</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#id474837">3.4. Example mailcap files</a></span></dt></dl></dd><dt><span class="sect1"><a href="mimesupport.html#auto-view">4. MIME Autoview</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#alternative-order">5. MIME Multipart/Alternative</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#attachments">6. Attachment Searching and Counting</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#mime-lookup">7. MIME Lookup</a></span></dt></dl></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 5. Mutt's MIME Support</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><link rel="start" href="index.html" title="The Mutt E-Mail Client" /><link rel="up" href="index.html" title="The Mutt E-Mail Client" /><link rel="prev" href="advancedusage.html" title="Chapter 4. Advanced Usage" /><link rel="next" href="optionalfeatures.html" title="Chapter 6. Optional features" /><style xmlns="" type="text/css">
+ body { margin-left:2%; margin-right:2%; font-family:serif; }
+.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
+h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
+em.replaceable code { font-family:sans-serif; }
+p { text-align:justify; }
+div.table p.title, div.example p.title { font-size:smaller; font-family:sans-serif; }
+.email, .email a { font-family:monospace; }
+div.table-contents table { border-collapse:collapse; border:1px solid #c0c0c0; }
+div.table-contents table td, div.table-contents table th { padding:5px; text-align:left; }
+div.table-contents table th {
+ font-family:sans-serif;
+ background:#d0d0d0;
+ font-weight:normal;
+ vertical-align:top;
+}
+pre.screen, div.note { background:#f0f0f0; border:1px solid #c0c0c0; padding:5px; }
+div.note h3 { font-size:small; font-style:italic; font-variant: small-caps; }
+div.note h3:after { content: ":" }
+div.note { margin-bottom: 5px; }
+
+ </style></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 5. Mutt's MIME Support</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="advancedusage.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="optionalfeatures.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="mimesupport"></a>Chapter 5. Mutt's MIME Support</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="mimesupport.html#using-mime">1. Using MIME in Mutt</a></span></dt><dd><dl><dt><span class="sect2"><a href="mimesupport.html#mime-pager">1.1. Viewing MIME messages in the pager</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#attach-menu">1.2. The Attachment Menu</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#compose-menu">1.3. The Compose Menu</a></span></dt></dl></dd><dt><span class="sect1"><a href="mimesupport.html#mime-types">2. MIME Type configuration with <code class="literal">mime.types</code></a></span></dt><dt><span class="sect1"><a href="mimesupport.html#mailcap">3. MIME Viewer configuration with <code class="literal">mailcap</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="mimesupport.html#mailcap-basics">3.1. The Basics of the mailcap file</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#secure-mailcap">3.2. Secure use of mailcap</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#advanced-mailcap">3.3. Advanced mailcap Usage</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#mailcap-example">3.4. Example mailcap files</a></span></dt></dl></dd><dt><span class="sect1"><a href="mimesupport.html#auto-view">4. MIME Autoview</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#alternative-order">5. MIME Multipart/Alternative</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#attachments">6. Attachment Searching and Counting</a></span></dt><dt><span class="sect1"><a href="mimesupport.html#mime-lookup">7. MIME Lookup</a></span></dt></dl></div><p>
Quite a bit of effort has been made to make Mutt the premier text-mode
MIME MUA. Every effort has been made to provide the functionality that
the discerning MIME user requires, and the conformance to the standards
wherever possible. When configuring Mutt for MIME, there are two extra
types of configuration files which Mutt uses. One is the
-<code class="literal">mime.types</code> file, which contains the mapping of file extensions to
+<code class="literal">mime.types</code> file, which contains the mapping of file extensions to
IANA MIME types. The other is the <code class="literal">mailcap</code> file, which specifies
the external commands to use for handling specific MIME types.
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="using-mime"></a>1. Using MIME in Mutt</h2></div></div></div><p>
There are three areas/menus in Mutt which deal with MIME, they are the
pager (while viewing a message), the attachment menu and the compose
menu.
-</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id473793"></a>1.1. Viewing MIME messages in the pager</h3></div></div></div><p>
+</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="mime-pager"></a>1.1. Viewing MIME messages in the pager</h3></div></div></div><p>
When you select a message from the index and view it in the pager, Mutt
decodes the message to a text representation. Mutt internally supports
a number of MIME types, including <code class="literal">text/plain, text/enriched,
</p><p>
Mutt will denote attachments with a couple lines describing them.
These lines are of the form:
-
</p><pre class="screen">
[-- Attachment #1: Description --]
[-- Type: text/plain, Encoding: 7bit, Size: 10000 --]
</pre><p>
-
Where the <code class="literal">Description</code> is the description or filename given for the
attachment, and the <code class="literal">Encoding</code> is one of
<code class="literal">7bit/8bit/quoted-printable/base64/binary</code>.
</p><p>
If Mutt cannot deal with a MIME type, it will display a message like:
-
</p><pre class="screen">
[-- image/gif is unsupported (use 'v' to view this part) --]
-</pre><p>
-
-</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="attach-menu"></a>1.2. The Attachment Menu</h3></div></div></div><p>
+</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="attach-menu"></a>1.2. The Attachment Menu</h3></div></div></div><p>
The default binding for <code class="literal">view-attachments</code> is `v', which displays the
attachment menu for a message. The attachment menu displays a list of
the attachments in a message. From the attachment menu, you can save,
print, pipe, delete, and view attachments. You can apply these
operations to a group of attachments at once, by tagging the attachments
-and by using the ``tag-prefix'' operator. You can also reply to the
+and by using the “<span class="quote">tag-prefix</span>” operator. You can also reply to the
current message from this menu, and only the current attachment (or the
attachments tagged) will be quoted in your reply. You can view
attachments as text, or view them using the mailcap viewer definition.
</p><p>
-Finally, you can apply the usual message-related functions (like
-<a href="gettingstarted.html#resend-message">resend-message</a>, and the reply
-and forward functions) to attachments of type <code class="literal">message/rfc822</code>.
+Finally, you can apply the usual message-related functions (like
+<a class="link" href="gettingstarted.html#resend-message"><code class="literal"><resend-message></code></a>, and the
+<code class="literal"><reply></code> and <code class="literal"><forward></code>
+functions) to attachments of type <code class="literal">message/rfc822</code>.
</p><p>
See the help on the attachment menu for more information.
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="compose-menu"></a>1.3. The Compose Menu</h3></div></div></div><p>
information, notably the type, encoding and description.
</p><p>
Attachments appear as follows:
-
</p><pre class="screen">
- 1 [text/plain, 7bit, 1K] /tmp/mutt-euler-8082-0 <no description>
2 [applica/x-gunzip, base64, 422K] ~/src/mutt-0.85.tar.gz <no description>
</pre><p>
-
-</p><p>
The '-' denotes that Mutt will delete the file after sending (or
postponing, or canceling) the message. It can be toggled with the
<code class="literal">toggle-unlink</code> command (default: u). The next field is the MIME
</p><p>
The mime.types file consist of lines containing a MIME type and a space
separated list of extensions. For example:
-
</p><pre class="screen">
application/postscript ps eps
application/pgp pgp
audio/x-aiff aif aifc aiff
</pre><p>
-
A sample <code class="literal">mime.types</code> file comes with the Mutt distribution, and
should contain most of the MIME types you are likely to use.
</p><p>
command from the compose menu (default: ^T). The MIME type is actually a
major mime type followed by the sub-type, separated by a '/'. 6 major
types: application, text, image, video, audio, and model have been approved
-after various internet discussions. Mutt recognizes all of these if the
+after various internet discussions. Mutt recognizes all of these if the
appropriate entry is found in the mime.types file. It also recognizes other
-major mime types, such as the chemical type that is widely used in the
-molecular modeling community to pass molecular data in various forms to
-various molecular viewers. Non-recognized mime types should only be used
+major mime types, such as the chemical type that is widely used in the
+molecular modeling community to pass molecular data in various forms to
+various molecular viewers. Non-recognized mime types should only be used
if the recipient of the message is likely to be expecting such attachments.
-</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mime-viewers"></a>3. MIME Viewer configuration with <code class="literal">mailcap</code></h2></div></div></div><p>
+</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mailcap"></a>3. MIME Viewer configuration with <code class="literal">mailcap</code></h2></div></div></div><p>
Mutt supports RFC 1524 MIME Configuration, in particular the Unix
specific format specified in Appendix A of RFC 1524. This file format
is commonly referred to as the mailcap format. Many MIME compliant
internally, Mutt parses a series of external configuration files to
find an external handler. The default search string for these files
is a colon delimited list containing the following files:
-
</p><div class="orderedlist"><ol type="1"><li><p><code class="literal">$HOME/.mailcap</code></p></li><li><p><code class="literal">$PKGDATADIR/mailcap</code></p></li><li><p><code class="literal">$SYSCONFDIR/mailcap</code></p></li><li><p><code class="literal">/etc/mailcap</code></p></li><li><p><code class="literal">/usr/etc/mailcap</code></p></li><li><p><code class="literal">/usr/local/etc/mailcap</code></p></li></ol></div><p>
-
where <code class="literal">$HOME</code> is your home directory. The
<code class="literal">$PKGDATADIR</code> and the
<code class="literal">$SYSCONFDIR</code> directories depend on where mutt
In particular, the metamail distribution will install a mailcap file,
usually as <code class="literal">/usr/local/etc/mailcap</code>, which contains some baseline
entries.
-</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id474197"></a>3.1. The Basics of the mailcap file</h3></div></div></div><p>
+</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="mailcap-basics"></a>3.1. The Basics of the mailcap file</h3></div></div></div><p>
A mailcap file consists of a series of lines which are comments, blank,
or definitions.
</p><p>
</p><p>
So, in the simplest form, you can send a text/plain message to the
external pager more on stdin:
-
</p><pre class="screen">
text/plain; more
</pre><p>
-
Or, you could send the message as a file:
-
</p><pre class="screen">
text/plain; more %s
</pre><p>
-
-Perhaps you would like to use lynx to interactively view a text/html
+Perhaps you would like to use lynx to interactively view a text/html
message:
-
</p><pre class="screen">
text/html; lynx %s
</pre><p>
-
In this case, lynx does not support viewing a file from stdin, so you
must use the %s syntax.
-<span class="bold"><strong>Note:</strong></span> <span class="emphasis"><em>Some older versions of lynx contain a bug where they
+</p><div class="note"><h3 class="title">Note</h3><p>
+<span class="emphasis"><em>Some older versions of lynx contain a bug where they
will check the mailcap file for a viewer for text/html. They will find
the line which calls lynx, and run it. This causes lynx to continuously
spawn itself to view the object.</em></span>
-</p><p>
+</p></div><p>
On the other hand, maybe you don't want to use lynx interactively, you
just want to have it convert the text/html to text/plain, then you can
use:
-
</p><pre class="screen">
text/html; lynx -dump %s | more
</pre><p>
-
-</p><p>
Perhaps you wish to use lynx to view text/html files, and a pager on
all other text formats, then you would use the following:
-
</p><pre class="screen">
text/html; lynx %s
text/*; more
</pre><p>
-
This is the simplest form of a mailcap file.
-</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id474319"></a>3.2. Secure use of mailcap</h3></div></div></div><p>
+</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="secure-mailcap"></a>3.2. Secure use of mailcap</h3></div></div></div><p>
The interpretation of shell meta-characters embedded in MIME parameters
can lead to security problems in general. Mutt tries to quote parameters
in expansion of %s syntaxes properly, and avoids risky characters by
-substituting them, see the <a href="reference.html#mailcap-sanitize" title="3.106. mailcap_sanitize">$mailcap_sanitize</a> variable.
+substituting them, see the <a class="link" href="reference.html#mailcap-sanitize" title="3.107. mailcap_sanitize">$mailcap_sanitize</a> variable.
</p><p>
Although mutt's procedures to invoke programs with mailcap seem to be
safe, there are other applications parsing mailcap, maybe taking less care
and reference the shell variable where necessary, as in the following
example (using <code class="literal">$charset</code> inside the backtick expansion is safe,
since it is not itself subject to any further expansion):
-</p><p>
-
</p><pre class="screen">
text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
&& test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1
-</pre><p>
-
-</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id474390"></a>3.3. Advanced mailcap Usage</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474395"></a>3.3.1. Optional Fields</h4></div></div></div><p>
+</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="advanced-mailcap"></a>3.3. Advanced mailcap Usage</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="optional-mailcap-fields"></a>3.3.1. Optional Fields</h4></div></div></div><p>
In addition to the required content-type and view command fields, you
can add semi-colon ';' separated fields to set flags and other options.
Mutt recognizes the following optional fields:
of the view command. Without this flag, Mutt assumes that the command
is interactive. One could use this to replace the pipe to <code class="literal">more</code>
in the <code class="literal">lynx -dump</code> example in the Basic section:
-
</p><pre class="screen">
text/html; lynx -dump %s ; copiousoutput
</pre><p>
-
This will cause lynx to format the text/html output as text/plain
and Mutt will use your standard pager to display the results.
</p></dd><dt><span class="term">needsterminal</span></dt><dd><p>
-Mutt uses this flag when viewing attachments with <a href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a>, in order to decide whether it should honor the setting
-of the <a href="reference.html#wait-key" title="3.299. wait_key">$wait_key</a> variable or
+Mutt uses this flag when viewing attachments with <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a>, in order to decide whether it should honor the setting
+of the <a class="link" href="reference.html#wait-key" title="3.300. wait_key">$wait_key</a> variable or
not. When an attachment is viewed using an interactive program, and the
corresponding mailcap entry has a <span class="emphasis"><em>needsterminal</em></span> flag, Mutt will use
-<a href="reference.html#wait-key" title="3.299. wait_key">$wait_key</a> and the exit status
+<a class="link" href="reference.html#wait-key" title="3.300. wait_key">$wait_key</a> and the exit status
of the program to decide if it will ask you to press a key after the
external program has exited. In all other situations it will not prompt
you for a key.
interpret a file as <code class="literal">text/html</code> if the file ends in <code class="literal">.html</code>.
So, you would specify lynx as a <code class="literal">text/html</code> viewer with a line in
the mailcap file like:
-
</p><pre class="screen">
text/html; lynx %s; nametemplate=%s.html
-</pre><p>
-
-</p></dd><dt><span class="term">test=<command></span></dt><dd><p>
+</pre></dd><dt><span class="term">test=<command></span></dt><dd><p>
This field specifies a command to run to test whether this mailcap
entry should be used. The command is defined with the command expansion
rules defined in the next section. If the command returns 0, then the
test passed, and Mutt uses this entry. If the command returns non-zero,
then the test failed, and Mutt continues searching for the right entry.
-<span class="bold"><strong>Note:</strong></span> <span class="emphasis"><em>the content-type must match before Mutt performs the test.</em></span>
+Note that the content-type must match before Mutt performs the test.
For example:
-
</p><pre class="screen">
text/html; netscape -remote 'openURL(%s)' ; test=RunningX
text/html; lynx %s
</pre><p>
-
In this example, Mutt will run the program RunningX which will return 0
if the X Window manager is running, and non-zero if it isn't. If
RunningX returns 0, then Mutt will call netscape to display the
text/html object. If RunningX doesn't return 0, then Mutt will go on
to the next entry and use lynx to display the text/html object.
-</p></dd></dl></div><p>
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474641"></a>3.3.2. Search Order</h4></div></div></div><p>
+</p></dd></dl></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="mailcap-search-order"></a>3.3.2. Search Order</h4></div></div></div><p>
When searching for an entry in the mailcap file, Mutt will search for
the most useful entry for its purpose. For instance, if you are
attempting to print an <code class="literal">image/gif</code>, and you have the following
entries in your mailcap file, Mutt will search for an entry with the
print command:
-
</p><pre class="screen">
image/*; xv %s
image/gif; ; print= anytopnm %s | pnmtops | lpr; \
nametemplate=%s.gif
</pre><p>
-
Mutt will skip the <code class="literal">image/*</code> entry and use the <code class="literal">image/gif</code>
entry with the print command.
</p><p>
-In addition, you can use this with <a href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a>
+In addition, you can use this with <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a>
to denote two commands for viewing an attachment, one to be viewed
automatically, the other to be viewed interactively from the attachment
menu. In addition, you can then use the test feature to determine which
viewer to use interactively depending on your environment.
-
</p><pre class="screen">
text/html; netscape -remote 'openURL(%s)' ; test=RunningX
text/html; lynx %s; nametemplate=%s.html
text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput
</pre><p>
-
-For <a href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a>, Mutt will choose the third
+For <a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a>, Mutt will choose the third
entry because of the copiousoutput tag. For interactive viewing, Mutt
will run the program RunningX to determine if it should use the first
entry. If the program returns non-zero, Mutt will use the second entry
for interactive viewing.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474717"></a>3.3.3. Command Expansion</h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="mailcap-command-expansion"></a>3.3.3. Command Expansion</h4></div></div></div><p>
The various commands defined in the mailcap files are passed to the
<code class="literal">/bin/sh</code> shell using the system() function. Before the
command is passed to <code class="literal">/bin/sh -c</code>, it is parsed to expand
Mutt will expand this to the value of the specified parameter
from the Content-Type: line of the mail message. For instance, if
Your mail message contains:
-
</p><pre class="screen">
Content-Type: text/plain; charset=iso-8859-1
</pre><p>
-
then Mutt will expand %{charset} to iso-8859-1. The default metamail
mailcap file uses this feature to test the charset to spawn an xterm
using the right charset to view the message.
Mutt does not currently support the %F and %n keywords
specified in RFC 1524. The main purpose of these parameters is for
multipart messages, which is handled internally by Mutt.
-</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id474837"></a>3.4. Example mailcap files</h3></div></div></div><p>
+</p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="mailcap-example"></a>3.4. Example mailcap files</h3></div></div></div><p>
This mailcap file is fairly simple and standard:
-
-</p><pre class="programlisting">
+</p><pre class="screen">
# I'm always running X :)
video/*; xanim %s > /dev/null
image/*; xv %s > /dev/null
# I'm always running netscape (if my computer had more memory, maybe)
text/html; netscape -remote 'openURL(%s)'
</pre><p>
-
-</p><p>
This mailcap file shows quite a number of examples:
-</p><p>
-
-</p><pre class="programlisting">
+</p><pre class="screen">
# Use xanim to view all videos Xanim produces a header on startup,
# send that to /dev/null so I don't see it
video/*; xanim %s > /dev/null
# Send excel spreadsheets to my NT box
application/ms-excel; open.pl %s
-</pre><p>
-
-</p></div></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="auto-view"></a>4. MIME Autoview</h2></div></div></div><p>
+</pre></div></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="auto-view"></a>4. MIME Autoview</h2></div></div></div><p>
In addition to explicitly telling Mutt to view an attachment with the
MIME viewer defined in the mailcap file, Mutt has support for
automatically viewing MIME attachments while in the pager.
</p><p>
-To work, you must define a viewer in the mailcap file which uses the
+To work, you must define a viewer in the mailcap file which uses the
<code class="literal">copiousoutput</code> option to denote that it is non-interactive.
Usually, you also use the entry to convert the attachment to a text
representation which you can view in the pager.
content-types that you wish to view automatically.
</p><p>
For instance, if you set auto_view to:
-
</p><pre class="screen">
auto_view text/html application/x-gunzip \
application/postscript image/gif application/x-tar-gz
</pre><p>
-
-</p><p>
Mutt could use the following mailcap entries to automatically view
attachments of these types.
-
</p><pre class="screen">
text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
image/*; anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | \
application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
application/postscript; ps2ascii %s; copiousoutput
</pre><p>
-
-</p><p>
-``unauto_view'' can be used to remove previous entries from the autoview list.
+“<span class="quote">unauto_view</span>” can be used to remove previous entries from the autoview list.
This can be used with message-hook to autoview messages based on size, etc.
-``unauto_view *'' will remove all previous entries.
+“<span class="quote">unauto_view *</span>” will remove all previous entries.
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="alternative-order"></a>5. MIME Multipart/Alternative</h2></div></div></div><p>
Mutt has some heuristics for determining which attachment of a
-multipart/alternative type to display. First, mutt will check the
+multipart/alternative type to display. First, mutt will check the
alternative_order list to determine if one of the available types
is preferred. The alternative_order list consists of a number of
mimetypes in order, including support for implicit and explicit
wildcards, for example:
-
</p><pre class="screen">
alternative_order text/enriched text/plain text application/postscript image/*
</pre><p>
-
-</p><p>
-Next, mutt will check if any of the types have a defined
-<a href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a>, and use that. Failing
+Next, mutt will check if any of the types have a defined
+<a class="link" href="mimesupport.html#auto-view" title="4. MIME Autoview">auto_view</a>, and use that. Failing
that, Mutt will look for any text type. As a last attempt, mutt will
look for any type it knows how to handle.
</p><p>
attachments ?
</pre><p>
Disposition is the attachment's Content-disposition type -- either
-"inline" or "attachment". You can abbreviate this to I or A.
+<code class="literal">inline</code> or <code class="literal">attachment</code>.
+You can abbreviate this to <code class="literal">I</code> or <code class="literal">A</code>.
</p><p>
-Disposition is prefixed by either a + symbolor a - symbol. If it's
+Disposition is prefixed by either a + symbol or a - symbol. If it's
a +, you're saying that you want to allow this disposition and MIME
type to qualify. If it's a -, you're saying that this disposition
and MIME type is an exception to previous + rules. There are examples
below of how this is useful.
</p><p>
Mime-type is, unsurprisingly, the MIME type of the attachment you want
-to affect. A MIME type is always of the format "major/minor", where
-"major" describes the broad category of document you're looking at, and
-"minor" describes the specific type within that category. The major
-part of mim-type must be literal text (or the special token "*"), but
-the minor part may be a regular expression. (Therefore, "*/.*" matches
+to affect. A MIME type is always of the format <code class="literal">major/minor</code>, where
+<code class="literal">major</code> describes the broad category of document you're looking at, and
+<code class="literal">minor</code> describes the specific type within that category. The major
+part of mime-type must be literal text (or the special token “<span class="quote"><code class="literal">*</code></span>”), but
+the minor part may be a regular expression. (Therefore, “<span class="quote"><code class="literal">*/.*</code></span>” matches
any MIME type.)
</p><p>
The MIME types you give to the attachments directive are a kind of
</p><p>
Some examples might help to illustrate. The examples that are not
commented out define the default configuration of the lists.
-</p><pre class="screen">
+</p><div class="example"><a id="ex-attach-count"></a><p class="title"><b>Example 5.1. Attachment counting</b></p><div class="example-contents"><pre class="screen">
## Removing a pattern from a list removes that pattern literally. It
## does not remove any type matching the pattern.
##
## You probably don't really care to know about deleted attachments.
attachments -A message/external-body
attachments -I message/external-body
-</pre><p>
-"attachments ?" will list your current settings in Muttrc format, so
-that it can be pasted elsewhere.
+</pre></div></div><br class="example-break" /><p>
+Entering the command “<span class="quote"><code class="literal">attachments ?</code></span>”
+as a command will list your current settings in Muttrc format, so that
+it can be pasted elsewhere.
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mime-lookup"></a>7. MIME Lookup</h2></div></div></div><p>
Mutt's mime_lookup list specifies a list of mime-types that should not
be treated according to their mailcap entry. This option is designed to
associated with this extension will then be used to process the attachment
according to the rules in the mailcap file and according to any other configuration
options (such as auto_view) specified. Common usage would be:
-
</p><pre class="screen">
mime_lookup application/octet-stream application/X-Lotus-Manuscript
</pre><p>
-
-</p><p>
In addition, the unmime_lookup command may be used to disable this feature
for any particular mime-type if it had been set, for example, in a global
muttrc.