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

📄 configuration.html

📁 mutt-1.5.12 源代码。linux 下邮件接受的工具。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<?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聽3.聽Configuration</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="gettingstarted.html" title="Chapter聽2.聽Getting Started" /><link rel="next" href="advancedusage.html" title="Chapter聽4.聽Advanced Usage" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter聽3.聽Configuration</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gettingstarted.html">Prev</a>聽</td><th width="60%" align="center">聽</th><td width="20%" align="right">聽<a accesskey="n" href="advancedusage.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="configuration"></a>Chapter聽3.聽Configuration</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="configuration.html#muttrc-syntax">1. Syntax of Initialization Files</a></span></dt><dt><span class="sect1"><a href="configuration.html#alias">2. Defining/Using aliases</a></span></dt><dt><span class="sect1"><a href="configuration.html#bind">3. Changing the default key bindings</a></span></dt><dt><span class="sect1"><a href="configuration.html#charset-hook">4. Defining aliases for character sets </a></span></dt><dt><span class="sect1"><a href="configuration.html#folder-hook">5. Setting variables based upon mailbox</a></span></dt><dt><span class="sect1"><a href="configuration.html#macro">6. Keyboard macros</a></span></dt><dt><span class="sect1"><a href="configuration.html#color">7. Using color and mono video attributes</a></span></dt><dt><span class="sect1"><a href="configuration.html#ignore">8. Ignoring (weeding) unwanted message headers</a></span></dt><dt><span class="sect1"><a href="configuration.html#alternates">9. Alternative addresses</a></span></dt><dt><span class="sect1"><a href="configuration.html#lists">10. Mailing lists</a></span></dt><dt><span class="sect1"><a href="configuration.html#mbox-hook">11. Using Multiple spool mailboxes</a></span></dt><dt><span class="sect1"><a href="configuration.html#mailboxes">12. Defining mailboxes which receive mail</a></span></dt><dt><span class="sect1"><a href="configuration.html#my-hdr">13. User defined headers</a></span></dt><dt><span class="sect1"><a href="configuration.html#hdr-order">14. Defining the order of headers when viewing messages</a></span></dt><dt><span class="sect1"><a href="configuration.html#save-hook">15. Specify default save filename</a></span></dt><dt><span class="sect1"><a href="configuration.html#fcc-hook">16. Specify default Fcc: mailbox when composing</a></span></dt><dt><span class="sect1"><a href="configuration.html#fcc-save-hook">17. Specify default save filename and default Fcc: mailbox at once</a></span></dt><dt><span class="sect1"><a href="configuration.html#send-hook">18. Change settings based upon message recipients</a></span></dt><dt><span class="sect1"><a href="configuration.html#message-hook">19. Change settings before formatting a message</a></span></dt><dt><span class="sect1"><a href="configuration.html#crypt-hook">20. Choosing the cryptographic key of the recipient</a></span></dt><dt><span class="sect1"><a href="configuration.html#push">21. Adding key sequences to the keyboard buffer</a></span></dt><dt><span class="sect1"><a href="configuration.html#exec">22. Executing functions</a></span></dt><dt><span class="sect1"><a href="configuration.html#score-command">23. Message Scoring</a></span></dt><dt><span class="sect1"><a href="configuration.html#spam">24. Spam detection</a></span></dt><dt><span class="sect1"><a href="configuration.html#set">25. Setting and Querying Variables</a></span></dt><dd><dl><dt><span class="sect2"><a href="configuration.html#set-commands">25.1. Commands</a></span></dt><dt><span class="sect2"><a href="configuration.html#set-myvar">25.2. User-defined variables</a></span></dt></dl></dd><dt><span class="sect1"><a href="configuration.html#source">26. Reading initialization commands from another file</a></span></dt><dt><span class="sect1"><a href="configuration.html#unhook">27. Removing hooks</a></span></dt></dl></div><p>While the default configuration (or ``preferences'') make Muttusable right out of the box, it is often desirable to tailor Mutt tosuit your own tastes. When Mutt is first invoked, it will attempt toread the ``system'' configuration file (defaults set by your localsystem administrator), unless the ``-n'' <a href="reference.html#commandline" title="1.聽Command line options">command line</a> option is specified.  This file is typically<code class="literal">/usr/local/share/mutt/Muttrc</code> or <code class="literal">/etc/Muttrc</code>. Muttwill next look for a file named <code class="literal">.muttrc</code> in your homedirectory.  If this file does not exist and your home directory hasa subdirectory named <code class="literal">.mutt</code>, mutt try to load a file named<code class="literal">.mutt/muttrc</code>. </p><p><code class="literal">.muttrc</code> is the file where you will usually place your <a href="reference.html#commands" title="2.聽Configuration Commands">commands</a> to configure Mutt.</p><p>In addition, mutt supports version specific configuration files that areparsed instead of the default files as explained above.  For instance, ifyour system has a <code class="literal">Muttrc-0.88</code> file in the system configurationdirectory, and you are running version 0.88 of mutt, this file will besourced instead of the <code class="literal">Muttrc</code> file.  The same is true of the userconfiguration file, if you have a file <code class="literal">.muttrc-0.88.6</code> in your homedirectory, when you run mutt version 0.88.6, it will source this fileinstead of the default <code class="literal">.muttrc</code> file.  The version number is thesame which is visible using the ``-v'' <a href="reference.html#commandline" title="1.聽Command line options">command line</a> switch or using the <code class="literal">show-version</code> key (default:V) from the index menu.</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="muttrc-syntax"></a>1.聽Syntax of Initialization Files</h2></div></div></div><p>An initialization file consists of a series of <a href="reference.html#commands" title="2.聽Configuration Commands">commands</a>.  Each line of the file may contain one or more commands.When multiple commands are used, they must be separated by a semicolon (;).</p><pre class="screen">set realname='Mutt user' ; ignore x-</pre><p>The hash mark, or pound sign(``#''), is used as a ``comment'' character. You can use it toannotate your initialization file. All text after the comment characterto the end of the line is ignored. For example,</p><p></p><pre class="screen">my_hdr X-Disclaimer: Why are you listening to me? # This is a comment</pre><p></p><p>Single quotes (') and double quotes (") can be used to quote stringswhich contain spaces or other special characters.  The difference betweenthe two types of quotes is similar to that of many popular shell programs,namely that a single quote is used to specify a literal string (one that isnot interpreted for shell variables or quoting with a backslash [seenext paragraph]), while double quotes indicate a string for whichshould be evaluated.  For example, backtics are evaluated inside of doublequotes, but <span class="bold"><strong>not</strong></span> for single quotes.</p><p>\ quotes the next character, just as in shells such as bash and zsh.For example, if want to put quotes ``"'' inside of a string, you can use``\'' to force the next character to be a literal instead of interpretedcharacter.</p><pre class="screen">set realname="Michael \"MuttDude\" Elkins"</pre><p></p><p>``\\'' means to insert a literal ``\'' into the line.``\n'' and ``\r'' have their usual C meanings of linefeed andcarriage-return, respectively.</p><p>A \ at the end of a line can be used to split commands overmultiple lines, provided that the split points don't appear in themiddle of command names.</p><p>It is also possible to substitute the output of a Unix command in aninitialization file.  This is accomplished by enclosing the command inbackquotes (``).  For example,</p><pre class="screen">my_hdr X-Operating-System: `uname -a`</pre><p>The output of the Unix command ``uname -a'' will be substituted before theline is parsed.  Note that since initialization files are line oriented, onlythe first line of output from the Unix command will be substituted.</p><p>Both environment variables and mutt variables can be accessed byprepending ``$'' to the name of the variable. For example,</p><pre class="screen">set record=+sent_on_$HOSTNAME</pre><p>will cause mutt to save outgoing messages to a folder named``sent_on_kremvax'' if the environment variable HOSTNAME is set to``kremvax.'' (See <a href="reference.html#record" title="3.231.聽record">$record</a> fordetails.)</p><p>Mutt expands the variable when it is assigned, not when it is used. Ifthe value of a variable on the right-hand side of an assignmentchanges after the assignment, the variable on the left-hand side willnot be affected.</p><p>The commands understood by mutt are explained in the next paragraphs.For a complete list, see the <a href="reference.html#commands" title="2.聽Configuration Commands">command reference</a>.</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="alias"></a>2.聽Defining/Using aliases</h2></div></div></div><p>Usage: <code class="literal">alias</code> <span class="emphasis"><em>key</em></span> <span class="emphasis"><em>address</em></span> [ , <span class="emphasis"><em>address</em></span>, ... ]</p><p>It's usually very cumbersome to remember or type out the address of someoneyou are communicating with.  Mutt allows you to create ``aliases'' which mapa short string to a full address.</p><p><span class="bold"><strong>Note:</strong></span> if you want to create an alias for a group (by specifying more thanone address), you <span class="bold"><strong>must</strong></span> separate the addresses with a comma (``,'').</p><p>To remove an alias or aliases (``*'' means all aliases):</p><p><code class="literal">unalias</code> [ * | <span class="emphasis"><em>key</em></span> <span class="emphasis"><em>...</em></span> ]</p><p></p><pre class="screen">alias muttdude me@cs.hmc.edu (Michael Elkins)alias theguys manny, moe, jack</pre><p></p><p>Unlike other mailers, Mutt doesn't require aliases to be definedin a special file.  The <code class="literal">alias</code> command can appear anywhere ina configuration file, as long as this file is <a href="configuration.html#source" title="26.聽Reading initialization commands from another file">sourced</a>.  Consequently, you can have multiple alias files, oryou can have all aliases defined in your muttrc.</p><p>On the other hand, the <a href="gettingstarted.html#create-alias">create-alias</a>function can use only one file, the one pointed to by the <a href="reference.html#alias-file" title="3.3.聽alias_file">$alias_file</a> variable (which is<code class="literal">藴/.muttrc</code> by default). This file is not special either,in the sense that Mutt will happily append aliases to any file, but inorder for the new aliases to take effect you need to explicitly <a href="configuration.html#source" title="26.聽Reading initialization commands from another file">source</a> this file too.</p><p>For example:</p><p></p><pre class="screen">source /usr/local/share/Mutt.aliasessource ~/.mail_aliasesset alias_file=~/.mail_aliases</pre><p></p><p>To use aliases, you merely use the alias at any place in mutt where muttprompts for addresses, such as the <span class="emphasis"><em>To:</em></span> or <span class="emphasis"><em>Cc:</em></span> prompt.  You canalso enter aliases in your editor at the appropriate headers if you have the<a href="reference.html#edit-headers" title="3.46.聽edit_headers">$edit_headers</a> variable set.</p><p>In addition, at the various address prompts, you can use the tab characterto expand a partial alias to the full alias.  If there are multiple matches,mutt will bring up a menu with the matching aliases.  In order to bepresented with the full list of aliases, you must hit tab with out a partialalias, such as at the beginning of the prompt or after a comma denotingmultiple addresses.</p><p>In the alias menu, you can select as many aliases as you want with the<span class="emphasis"><em>select-entry</em></span> key (default: RET), and use the <span class="emphasis"><em>exit</em></span> key(default: q) to return to the address prompt.</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="bind"></a>3.聽Changing the default key bindings</h2></div></div></div><p>Usage: <code class="literal">bind</code> <span class="emphasis"><em>map</em></span> <span class="emphasis"><em>key</em></span> <span class="emphasis"><em>function</em></span></p><p>This command allows you to change the default key bindings (operationinvoked when pressing a key).</p><p><span class="emphasis"><em>map</em></span> specifies in which menu the binding belongs.  Multiple maps maybe specified by separating them with commas (no additional whitespace isallowed). The currently defined maps are:</p><p><a id="maps"></a></p><div class="variablelist"><dl><dt><span class="term">generic</span></dt><dd><p>This is not a real menu, but is used as a fallback for all of the othermenus except for the pager and editor modes.  If a key is not defined inanother menu, Mutt will look for a binding to use in this menu.  This allowsyou to bind a key to a certain function in multiple menus instead of havingmultiple bind statements to accomplish the same task.</p></dd><dt><span class="term">alias</span></dt><dd><p>The alias menu is the list of your personal aliases as defined in yourmuttrc.  It is the mapping from a short alias name to the full emailaddress(es) of the recipient(s).</p></dd><dt><span class="term">attach</span></dt><dd><p>The attachment menu is used to access the attachments on received messages.</p></dd><dt><span class="term">browser</span></dt><dd><p>The browser is used for both browsing the local directory structure, and forlisting all of your incoming mailboxes.</p></dd><dt><span class="term">editor</span></dt><dd><p>The editor is the line-based editor the user enters text data.</p></dd><dt><span class="term">index</span></dt><dd><p>The index is the list of messages contained in a mailbox.</p></dd><dt><span class="term">compose</span></dt><dd><p>The compose menu is the screen used when sending a new message.</p></dd><dt><span class="term">pager</span></dt><dd><p>The pager is the mode used to display message/attachment data, and helplistings.</p></dd><dt><span class="term">pgp</span></dt><dd><p>The pgp menu is used to select the OpenPGP keys used for encrypting outgoingmessages.</p></dd><dt><span class="term">postpone</span></dt><dd><p>The postpone menu is similar to the index menu, except is used whenrecalling a message the user was composing, but saved until later.</p></dd></dl></div><p></p><p><span class="emphasis"><em>key</em></span> is the key (or key sequence) you wish to bind.  To specify acontrol character, use the sequence <span class="emphasis"><em>\Cx</em></span>, where <span class="emphasis"><em>x</em></span> is theletter of the control character (for example, to specify control-A use``\Ca'').  Note that the case of <span class="emphasis"><em>x</em></span> as well as <span class="emphasis"><em>\C</em></span> isignored, so that <span class="emphasis"><em>\CA</em></span>, <span class="emphasis"><em>\Ca</em></span>, <span class="emphasis"><em>\cA</em></span> and <span class="emphasis"><em>\ca</em></span> are all

⌨️ 快捷键说明

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