📄 advancedusage.html
字号:
can be encrypted. This naturally requires that the server supportsSSL encrypted connections. To access a folder with POP3/SSL, you shoulduse pops: prefix, ie:<code class="literal">pops://[username@]popserver[:port]/</code>.</p><p>Another way to access your POP3 mail is the <span class="emphasis"><em>fetch-mail</em></span> function(default: G). It allows to connect to <a href="reference.html#pop-host" title="3.210.聽pop_host">$pop_host</a>, fetch all your new mail and place it in thelocal <a href="reference.html#spoolfile" title="3.264.聽spoolfile">$spoolfile</a>. After thispoint, Mutt runs exactly as if the mail had always been local.</p><p><span class="bold"><strong>Note:</strong></span> If you only need to fetch all messages to local mailboxyou should consider using a specialized program, such as <a href="http://www.ccil.org/~esr/fetchmail" target="_top">fetchmail</a></p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="imap"></a>12.聽IMAP Support (OPTIONAL)</h2></div></div></div><p>If Mutt was compiled with IMAP support (by running the <span class="emphasis"><em>configure</em></span>script with the <span class="emphasis"><em>--enable-imap</em></span> flag), it has the ability to workwith folders located on a remote IMAP server.</p><p>You can access the remote inbox by selecting the folder<code class="literal">imap://imapserver/INBOX</code>, where <code class="literal">imapserver</code> is the name of theIMAP server and <code class="literal">INBOX</code> is the special name for your spool mailbox onthe IMAP server. If you want to access another mail folder at the IMAPserver, you should use <code class="literal">imap://imapserver/path/to/folder</code> where<code class="literal">path/to/folder</code> is the path of the folder you want to access.</p><p>You can select an alternative port by specifying it with the server, ie:<code class="literal">imap://imapserver:port/INBOX</code>.</p><p>You can also specify different username for each folder, ie:<code class="literal">imap://username@imapserver[:port]/INBOX</code>.</p><p>If Mutt was compiled with SSL support (by running the <span class="emphasis"><em>configure</em></span>script with the <span class="emphasis"><em>--with-ssl</em></span> flag), connections to IMAP serverscan be encrypted. This naturally requires that the server supportsSSL encrypted connections. To access a folder with IMAP/SSL, you shoulduse <code class="literal">imaps://[username@]imapserver[:port]/path/to/folder</code> as your folder path.</p><p>Pine-compatible notation is also supported, ie<code class="literal">{[username@]imapserver[:port][/ssl]}path/to/folder</code></p><p>Note that not all servers use / as the hierarchy separator. Mutt shouldcorrectly notice which separator is being used by the server and convertpaths accordingly.</p><p>When browsing folders on an IMAP server, you can toggle whether to lookat only the folders you are subscribed to, or all folders with the<span class="emphasis"><em>toggle-subscribed</em></span> command. See also the <a href="reference.html#imap-list-subscribed" title="3.84.聽imap_list_subscribed">$imap_list_subscribed</a> variable.</p><p>Polling for new mail on an IMAP server can cause noticeable delays. So, you'llwant to carefully tune the<a href="reference.html#mail-check" title="3.99.聽mail_check">$mail_check</a>and<a href="reference.html#timeout" title="3.274.聽timeout">$timeout</a>variables. Personally I use</p><pre class="screen">set mail_check=90set timeout=15</pre><p>with relatively good results over my slow modem line.</p><p>Note that if you are using mbox as the mail store on UW servers prior tov12.250, the server has been reported to disconnect a client if another clientselects the same folder.</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id2687412"></a>12.1.聽The Folder Browser</h3></div></div></div><p>As of version 1.2, mutt supports browsing mailboxes on an IMAPserver. This is mostly the same as the local file browser, with thefollowing differences:</p><div class="itemizedlist"><ul type="disc"><li><p>In lieu of file permissions, mutt displays the string "IMAP",possibly followed by the symbol "+", indicatingthat the entry contains both messages and subfolders. OnCyrus-like servers folders will often contain both messages andsubfolders. </p></li><li><p>For the case where an entry can contain both messages andsubfolders, the selection key (bound to <code class="literal">enter</code> by default)will choose to descend into the subfolder view. If you wish to viewthe messages in that folder, you must use <code class="literal">view-file</code> instead(bound to <code class="literal">space</code> by default).</p></li><li><p>You can create, delete and rename mailboxes with the<code class="literal">create-mailbox</code>, <code class="literal">delete-mailbox</code>, and<code class="literal">rename-mailbox</code> commands (default bindings: <code class="literal">C</code>,<code class="literal">d</code> and <code class="literal">r</code>, respectively). You may also<code class="literal">subscribe</code> and <code class="literal">unsubscribe</code> to mailboxes (normallythese are bound to <code class="literal">s</code> and <code class="literal">u</code>, respectively).</p></li></ul></div><p></p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id2687534"></a>12.2.聽Authentication</h3></div></div></div><p>Mutt supports four authentication methods with IMAP servers: SASL,GSSAPI, CRAM-MD5, and LOGIN (there is a patch by Grant Edwards to addNTLM authentication for you poor exchange users out there, but it hasyet to be integrated into the main tree). There is also support forthe pseudo-protocol ANONYMOUS, which allows you to log in to a publicIMAP server without having an account. To use ANONYMOUS, simply makeyour username blank or "anonymous".</p><p>SASL is a special super-authenticator, which selects among several protocols(including GSSAPI, CRAM-MD5, ANONYMOUS, and DIGEST-MD5) the most securemethod available on your host and the server. Using some of these methods(including DIGEST-MD5 and possibly GSSAPI), your entire session will beencrypted and invisible to those teeming network snoops. It is the bestoption if you have it. To use it, you must have the Cyrus SASL libraryinstalled on your system and compile mutt with the <span class="emphasis"><em>--with-sasl</em></span> flag.</p><p>Mutt will try whichever methods are compiled in and available on the server,in the following order: SASL, ANONYMOUS, GSSAPI, CRAM-MD5, LOGIN.</p><p>There are a few variables which control authentication: </p><div class="itemizedlist"><ul type="disc"><li><p><a href="reference.html#imap-user" title="3.90.聽imap_user">$imap_user</a> - controlsthe username under which you request authentication on the IMAP server,for all authenticators. This is overridden by an explicit username inthe mailbox path (ie by using a mailbox name of the form<code class="literal">{user@host}</code>).</p></li><li><p><a href="reference.html#imap-pass" title="3.86.聽imap_pass">$imap_pass</a> - apassword which you may preset, used by all authentication methods wherea password is needed.</p></li><li><p><a href="reference.html#imap-authenticators" title="3.77.聽imap_authenticators">$imap_authenticators</a> - a colon-delimited list of IMAPauthentication methods to try, in the order you wish to try them. Ifspecified, this overrides mutt's default (attempt everything, in the orderlisted above).</p></li></ul></div><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="account-hook"></a>13.聽Managing multiple IMAP/POP accounts (OPTIONAL)</h2></div></div></div><p>If you happen to have accounts on multiple IMAP and/or POP servers,you may find managing all the authentication settings inconvenient anderror-prone. The account-hook command may help. This hook works likefolder-hook but is invoked whenever you access a remote mailbox(including inside the folder browser), not just when you open themailbox.</p><p>Some examples:</p><p></p><pre class="screen">account-hook . 'unset imap_user; unset imap_pass; unset tunnel'account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'</pre><p></p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="urlview"></a>14.聽Start a WWW Browser on URLs (EXTERNAL)</h2></div></div></div><p>If a message contains URLs (<span class="emphasis"><em>unified resource locator</em></span> = address in theWWW space like <span class="emphasis"><em>http://www.mutt.org/</em></span>), it is efficient to geta menu with all the URLs and start a WWW browser on one of them. Thisfunctionality is provided by the external urlview program which can beretrieved at <a href="ftp://ftp.mutt.org/mutt/contrib/" target="_top">ftp://ftp.mutt.org/mutt/contrib/</a> and the configuration commands:</p><pre class="screen">macro index \cb |urlview\nmacro pager \cb |urlview\n</pre><p></p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="caching"></a>15.聽Local caching (OPTIONAL)</h2></div></div></div><p>Mutt contains two types of local caching: <span class="emphasis"><em>(1)</em></span>the so-called ``header caching'' and <span class="emphasis"><em>(2)</em></span> theso-called ``body caching'' which are both described in this section.</p><p>These are optional which means they're not enabled by default.Details on how to enable either of these techniques are given in thefollowing subsections.</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id2687751"></a>15.1.聽Header caching</h3></div></div></div><p>Mutt provides optional support for caching message headers for thefollowing types of folders: IMAP, POP, Maildir and MH. Header cachinggreatly improves speed because for remote folders, headersusually only need to be downloaded once. For Maildir and MH, reading theheaders from a single file is much faster than looking at possiblythousands of single files (since Maildir and MH use one file per message.)</p><p>Header caching can be enabled via the configure script and the<span class="emphasis"><em>--enable--hcache</em></span> option. It's not turned onby default because external database libraries are required: oneof qdbm, gdbm or bdb must be present.</p><p>If enabled, <a href="reference.html#header-cache" title="3.102.聽header_cache">$header_cache</a> can beused to either point to a file or a directory. If set to point toa file, one database file for all folders will be used (which mayresult in lower performance), but one file per folder if it pointsto a directory.</p><p>For the one-file-per-folder case, database files will be named by MD5sums. They may be safely removed if a system is short on space. Youcan compute the name of the header cache file for a particular folderthrough a command like the following:</p><p></p><pre class="screen">$ printf '%s' '/path/to/folder' | md5sum$ printf '%s' 'imaps://user@host/path/to/folder' | md5sum$ printf '%s' 'pops://user@host' | md5sum</pre><p></p><p>The <code class="literal">md5sum</code> command may also benamed <code class="literal">md5</code>, depending on your operating system.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id2687829"></a>15.2.聽Body caching</h3></div></div></div><p>In addition to caching message headers only, mutt can also cachewhole message bodies. This results in faster display of messagesfor POP and IMAP folders because messages usually have to bedownloaded only once.</p><p>If the configure script is called with <span class="emphasis"><em>--enable-pop</em></span>and/or <span class="emphasis"><em>--enable-imap</em></span>, body caching will bebuilt in as it does not require additional software packages suchas database libraries.</p><p>For configuration, the variable <a href="reference.html#message-cachedir" title="3.126.聽message_cachedir">$message_cachedir</a> must point to adirectory. There, mutt will create a hierarchy of subdirectoriesnamed like: <code class="literal">proto:user@hostname</code> where<code class="literal">proto</code> is either ``pop'' or ``imap.'' Withinthere for each folder, mutt stores messages in single files (justlike Maildir) so that with manual symlink creation these cachedirectories can be examined with mutt as read-only Maildir folders.</p><p>All files can be removed as needed if the consumed disk spacebecomes an issue as mutt will silently fetch missing items again.</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configuration.html">Prev</a>聽</td><td width="20%" align="center">聽</td><td width="40%" align="right">聽<a accesskey="n" href="mimesupport.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter聽3.聽Configuration聽</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">聽Chapter聽5.聽Mutt's MIME Support</td></tr></table></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -