⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mimesupport.html

📁 mutt-1.5.12 源代码。linux 下邮件接受的工具。
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<?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.68.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="reference.html" title="Chapter聽6.聽Reference" /></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="reference.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#id2687943">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#id2688300">3.1. The Basics of the mailcap file</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#id2688432">3.2. Secure use of mailcap</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#id2688503">3.3. Advanced mailcap Usage</a></span></dt><dt><span class="sect2"><a href="mimesupport.html#id2688963">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-modeMIME MUA.  Every effort has been made to provide the functionality thatthe discerning MIME user requires, and the conformance to the standardswherever possible.  When configuring Mutt for MIME, there are two extratypes of configuration files which Mutt uses.  One is the<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 specifiesthe 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 thepager (while viewing a message), the attachment menu and the composemenu.</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id2687943"></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, Muttdecodes the message to a text representation.  Mutt internally supportsa number of MIME types, including <code class="literal">text/plain, text/enriched,message/rfc822, and message/news</code>.  In addition, the exportcontrolled version of Mutt recognizes a variety of PGP MIME types,including PGP/MIME and application/pgp.</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 theattachment, 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>The default binding for <code class="literal">view-attachments</code> is `v', which displays theattachment menu for a message.  The attachment menu displays a list ofthe attachments in a message.  From the attachment menu, you can save,print, pipe, delete, and view attachments.  You can apply theseoperations to a group of attachments at once, by tagging the attachmentsand by using the ``tag-prefix'' operator.  You can also reply to thecurrent message from this menu, and only the current attachment (or theattachments tagged) will be quoted in your reply.  You can viewattachments 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 replyand forward 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>The compose menu is the menu you see before you send a message.  Itallows you to edit the recipient list, the subject, and other aspectsof your message.  It also contains a list of the attachments of yourmessage, including the main body.  From this menu, you can print, copy,filter, pipe, edit, compose, review, and rename an attachment or alist of tagged attachments.  You can also modifying the attachmentinformation, 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 &lt;no description&gt;    2 [applica/x-gunzip, base64, 422K]   ~/src/mutt-0.85.tar.gz &lt;no description&gt;</pre><p></p><p>The '-' denotes that Mutt will delete the file after sending (orpostponing, or cancelling) the message.  It can be toggled with the<code class="literal">toggle-unlink</code> command (default: u).  The next field is the MIMEcontent-type, and can be changed with the <code class="literal">edit-type</code> command(default: ^T).  The next field is the encoding for the attachment,which allows a binary message to be encoded for transmission on 7bitlinks.  It can be changed with the <code class="literal">edit-encoding</code> command(default: ^E).  The next field is the size of the attachment,rounded to kilobytes or megabytes.  The next field is the filename,which can be changed with the <code class="literal">rename-file</code> command (default: R).The final field is the description of the attachment, and can bechanged with the <code class="literal">edit-description</code> command (default: d).</p></div></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mime-types"></a>2.聽MIME Type configuration with <code class="literal">mime.types</code></h2></div></div></div><p>When you add an attachment to your mail message, Mutt searches yourpersonal mime.types file at <code class="literal">${HOME}/.mime.types</code>, and thenthe system mime.types file at <code class="literal">/usr/local/share/mutt/mime.types</code> or<code class="literal">/etc/mime.types</code></p><p>The mime.types file consist of lines containing a MIME type and a spaceseparated list of extensions.  For example:</p><pre class="screen">application/postscript          ps epsapplication/pgp                 pgpaudio/x-aiff                    aif aifc aiff</pre><p>A sample <code class="literal">mime.types</code> file comes with the Mutt distribution, andshould contain most of the MIME types you are likely to use.</p><p>If Mutt can not determine the mime type by the extension of the file youattach, it will look at the file.  If the file is free of binaryinformation, Mutt will assume that the file is plain text, and mark itas <code class="literal">text/plain</code>.  If the file contains binary information, then Mutt willmark it as <code class="literal">application/octet-stream</code>.  You can change the MIMEtype that Mutt assigns to an attachment by using the <code class="literal">edit-type</code>command from the compose menu (default: ^T). The MIME type is actually amajor mime type followed by the sub-type, separated by a '/'. 6 majortypes: application, text, image, video, audio, and model have been approvedafter various internet discussions. Mutt recognises all of these if the appropriate entry is found in the mime.types file. It also recognises othermajor mime types, such as the chemical type that is widely used in the molecular modelling community to pass molecular data in various forms to various molecular viewers. Non-recognised 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>Mutt supports RFC 1524 MIME Configuration, in particular the Unixspecific format specified in Appendix A of RFC 1524.  This file formatis commonly referred to as the mailcap format.  Many MIME compliantprograms utilize the mailcap format, allowing you to specify handlingfor all MIME types in one place for all programs.  Programs known touse this format include Netscape, XMosaic, lynx and metamail.</p><p>In order to handle various MIME types that Mutt can not handleinternally, Mutt parses a series of external configuration files tofind an external handler.  The default search string for these filesis a colon delimited list set to</p><pre class="screen">${HOME}/.mailcap:/usr/local/share/mutt/mailcap:/etc/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap</pre><p>where <code class="literal">$HOME</code> is your home directory.</p><p>In particular, the metamail distribution will install a mailcap file,usually as <code class="literal">/usr/local/etc/mailcap</code>, which contains some baselineentries.</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id2688300"></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>A comment line consists of a # character followed by anything you want.</p><p>A blank line is blank.</p><p>A definition line consists of a content type, a view command, and anynumber of optional fields.  Each field of a definition line is dividedby a semicolon ';' character.</p><p>The content type is specified in the MIME standard type/subtype method.For example,<code class="literal">text/plain, text/html, image/gif, </code>etc.  In addition, the mailcap format includes two formats forwildcards, one using the special '*' subtype, the other is the implicitwild, where you only include the major type.  For example, <code class="literal">image/*</code>, or<code class="literal">video,</code> will match all image types and video types,respectively.</p><p>The view command is a Unix command for viewing the type specified. Thereare two different types of commands supported. The default is to sendthe body of the MIME message to the command on stdin. You can changethis behaviour by using %s as a parameter to your view command.This will cause Mutt to save the body of the MIME message to a temporaryfile, and then call the view command with the %s replaced bythe name of the temporary file. In both cases, Mutt will turn over theterminal to the view program until the program quits, at which time Muttwill remove the temporary file if it exists.</p><p>So, in the simplest form, you can send a text/plain message to theexternal 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 message:</p><pre class="screen">text/html; lynx %s</pre><p>In this case, lynx does not support viewing a file from stdin, so youmust use the %s syntax.<span class="bold"><strong>Note:</strong></span> <span class="emphasis"><em>Some older versions of lynx contain a bug where theywill check the mailcap file for a viewer for text/html.  They will findthe line which calls lynx, and run it.  This causes lynx to continuouslyspawn itself to view the object.</em></span></p><p>On the other hand, maybe you don't want to use lynx interactively, youjust want to have it convert the text/html to text/plain, then you canuse:</p><pre class="screen">text/html; lynx -dump %s | more</pre><p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -