5e9350a63c7101bb15bad066d880bd98ad69ed1b
[apps/madmutt.git] / doc / muttrc.man.head
1 '\" t
2 .\" -*-nroff-*-
3 .\"
4 .\"     Copyright (C) 1996-2000 Michael R. Elkins <me@cs.hmc.edu>
5 .\"     Copyright (C) 1999-2000 Thomas Roessler <roessler@guug.de>
6 .\" 
7 .\"     This program is free software; you can redistribute it and/or modify
8 .\"     it under the terms of the GNU General Public License as published by
9 .\"     the Free Software Foundation; either version 2 of the License, or
10 .\"     (at your option) any later version.
11 .\" 
12 .\"     This program is distributed in the hope that it will be useful,
13 .\"     but WITHOUT ANY WARRANTY; without even the implied warranty of
14 .\"     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 .\"     GNU General Public License for more details.
16 .\" 
17 .\"     You should have received a copy of the GNU General Public License
18 .\"     along with this program; if not, write to the Free Software
19 .\"     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
20 .\"
21 .TH muttrc 5 "September 2002" Unix "User Manuals"
22 .SH NAME
23 muttrc \- Configuration file for the Mutt Mail User Agent
24 .SH DESCRIPTION
25 .PP
26 A mutt configuration file consists of a series of \(lqcommands\(rq.
27 Each line of the file may contain one or more commands.  When
28 multiple commands are used, they must be separated by a semicolon
29 (\(lq\fB;\fP\(rq).
30 .PP
31 The hash mark, or pound sign (\(lq\fB#\fP\(rq), is used as a
32 \(lqcomment\(rq character. You can use it to annotate your
33 initialization file. All text after the comment character to the end
34 of the line is ignored.
35 .PP
36 Single quotes (\(lq\fB'\fP\(rq) and double quotes (\(lq\fB"\fP\(rq)
37 can be used to quote strings which contain spaces or other special
38 characters.  The difference between the two types of quotes is
39 similar to that of many popular shell programs, namely that a single
40 quote is used to specify a literal string (one that is not
41 interpreted for shell variables or quoting with a backslash [see
42 next paragraph]), while double quotes indicate a string for which
43 should be evaluated.  For example, backtics are evaluated inside of
44 double quotes, but not for single quotes.
45 .PP
46 \fB\(rs\fP quotes the next character, just as in shells such as bash and zsh.
47 For example, if want to put quotes (\(lq\fB"\fP\(rq) inside of a
48 string, you can use \(lq\fB\(rs\fP\(rq to force the next character
49 to be a literal instead of interpreted character.
50 .PP
51 \(lq\fB\(rs\(rs\fP\(rq means to insert a literal \(lq\fB\(rs\fP\(rq into the
52 line.  \(lq\fB\(rsn\fP\(rq and \(lq\fB\(rsr\fP\(rq have their usual
53 C meanings of linefeed and carriage-return, respectively.
54 .PP
55 A \(lq\fB\(rs\fP\(rq at the end of a line can be used to split commands over
56 multiple lines, provided that the split points don't appear in the
57 middle of command names.
58 .PP
59 It is also possible to substitute the output of a Unix command in an
60 initialization file.  This is accomplished by enclosing the command
61 in backquotes (\fB`\fP\fIcommand\fP\fB`\fP).
62 .PP
63 UNIX environments can be accessed like the way it is done in shells
64 like sh and bash: Prepend the name of the environment by a dollar
65 (\(lq\fB\(Do\fP\(rq) sign.
66 .PP
67 .SH COMMANDS
68 .PP
69 .nf
70 \fBalias\fP \fIkey\fP \fIaddress\fP [\fB,\fP \fIaddress\fP [ ... ]]
71 \fBunalias\fP [\fB * \fP | \fIkey\fP ]
72 .fi
73 .IP
74 \fBalias\fP defines an alias \fIkey\fP for the given addresses.
75 \fBunalias\fP removes the alias corresponding to the given \fIkey\fP or
76 all aliases when \(lq\fB*\fP\(rq is used as an argument.
77 .PP
78 .nf
79 \fBalternates\fP \fIregexp\fP [ \fB,\fP \fIregexp\fP [ ... ]]
80 \fBunalternates\fP [\fB * \fP | \fIregexp\fP [ \fB,\fP \fIregexp\fP [ ... ]] ]
81 .fi
82 .IP
83 \fBalternates\fP is used to inform mutt about alternate addresses
84 where you receive mail; you can use regular expressions to specify
85 alternate addresses.  This affects mutt's idea about messages
86 from you, and messages addressed to you.  \fBunalternates\fP removes
87 a regular expression from the list of known alternates.
88 .PP
89 .nf
90 \fBalternative_order\fP \fItype\fP[\fB/\fP\fIsubtype\fP] [ ... ]
91 \fBunalternative_order\fP [\fB * \fP | \fItype\fP/\fIsubtype\fP] [...]
92 .fi
93 .IP
94 \fBalternative_order\fP command permits you to define an order of preference which is
95 used by mutt to determine which part of a
96 \fBmultipart/alternative\fP body to display.
97 A subtype of \(lq\fB*\fP\(rq matches any subtype, as does an empty
98 subtype.   \fBunalternative_order\fP removes entries from the
99 ordered list or deletes the entire list when \(lq\fB*\fP\(rq is used
100 as an argument.
101 .PP
102 .nf
103 \fBauto_view\fP \fItype\fP[\fB/\fP\fIsubtype\fP] [ ... ]
104 \fBunauto_view\fP \fItype\fP[fB/\fP\fIsubtype\fP] [ ... ]
105 .fi
106 .IP
107 This commands permits you to specify that mutt should automatically
108 convert the given MIME types to text/plain when displaying messages.
109 For this to work, there must be a 
110 .BR mailcap (5)
111 entry for the given MIME type with the 
112 .B copiousoutput
113 flag set.  A subtype of \(lq\fB*\fP\(rq 
114 matches any subtype, as does an empty subtype.
115 .PP
116 .nf
117 \fBmime_lookup\fP \fItype\fP[\fB/\fP\fIsubtype\fP] [ ... ]
118 \fBunmime_lookup\fP \fItype\fP[\fB/\fP\fIsubtype\fP] [ ... ]
119 .fi
120 .IP
121 This command permits you to define a list of "data" MIME content
122 types for which mutt will try to determine the actual file type from
123 the file name, and not use a 
124 .BR mailcap (5)
125 entry given for the original MIME type.  For instance, you may add
126 the \fBapplication/octet-stream\fP MIME type to this list.
127 .TP
128 \fBbind\fP \fImap\fP \fIkey\fP \fIfunction\fP
129 This command binds the given \fIkey\fP for the given \fImap\fP to
130 the given \fIfunction\fP.
131 .IP
132 Valid maps are:
133 .BR generic ", " alias ", " attach ", " 
134 .BR browser ", " editor ", "
135 .BR index ", " compose ", " 
136 .BR pager ", " pgp ", " postpone ", "
137 .BR mix .
138 .IP
139 For more information on keys and functions, please consult the Mutt
140 Manual.
141 .TP
142 \fBaccount-hook\fP [\fB!\fP]\fIregexp\fP \fIcommand\fP
143 This hook is executed whenever you access a remote mailbox. Useful
144 to adjust configuration settings to different IMAP or POP servers.
145 .TP
146 \fBcharset-hook\fP \fIalias\fP \fIcharset\fP
147 This command defines an alias for a character set.  This is useful
148 to properly display messages which are tagged with a character set
149 name not known to mutt.
150 .TP
151 \fBiconv-hook\fP \fIcharset\fP \fIlocal-charset\fP
152 This command defines a system-specific name for a character set.
153 This is useful when your system's 
154 .BR iconv (3)
155 implementation does not understand MIME character set names (such as 
156 .BR iso-8859-1 ),
157 but instead insists on being fed with implementation-specific
158 character set names (such as
159 .BR 8859-1 ).
160 In this specific case, you'd put this into your configuration file:
161 .IP
162 .B "iconv-hook iso-8859-1 8859-1"
163 .TP
164 \fBmessage-hook\fP [\fB!\fP]\fIpattern\fP \fIcommand\fP
165 Before mutt displays (or formats for replying or forwarding) a
166 message which matches the given \fIpattern\fP (or, when it is
167 preceded by an exclamation mark, does not match the \fIpattern\fP),
168 the given \fIcommand\fP is executed.  When multiple
169 \fBmessage-hook\fPs match, they are  executed  in  the order in
170 which they occur in the configuration file.
171 .TP
172 \fBfolder-hook\fP [\fB!\fP]\fIregexp\fP \fIcommand\fP
173 When mutt enters a folder which matches \fIregexp\fP (or, when
174 \fIregexp\fP is preceded by an exclamation mark, does not match
175 \fIregexp\fP), the given \fIcommand\fP is executed.
176 .IP
177 When several \fBfolder-hook\fPs match a given mail folder, they are
178 executed in the order given in the configuration file.
179 .TP
180 \fBmacro\fP \fImap\fP \fIkey\fP \fIsequence\fP [ \fIdescription\fP ]
181 This command binds the given \fIsequence\fP of keys to the given
182 \fIkey\fP in the given \fImap\fP.  For valid maps, see \fBbind\fP.
183 .PP
184 .nf
185 \fBcolor\fP \fIobject\fP \fIforeground\fP \fIbackground\fP [ \fI regexp\fP ]
186 \fBcolor\fP index \fIforeground\fP \fIbackground\fP [ \fI pattern\fP ]
187 \fBuncolor\fP index \fIpattern\fP [ \fIpattern\fP ... ]
188 .fi
189 .IP
190 If your terminal supports color, these commands can be used to
191 assign \fIforeground\fP/\fIbackgound\fP combinations to certain
192 objects.  Valid objects are:
193 .BR attachment ", " body ", " bold ", " header ", "
194 .BR hdrdefault ", " index ", " indicator ", " markers ", "
195 .BR message ", " normal ", " quoted ", " quoted\fIN\fP ", "
196 .BR search ", " signature ", " status ", " tilde ", " tree ", "
197 .BR underline .
198 The
199 .BR body " and " header
200 objects allow you to restrict the colorization to a regular
201 expression.  The \fBindex\fP object permits you to select colored
202 messages by pattern.
203 .IP
204 Valid colors include:
205 .BR white ", " black ", " green ", " magenta ", " blue ", "
206 .BR cyan ", " yellow ", " red ", " default ", " color\fIN\fP .
207 .PP
208 .nf
209 \fBmono\fP \fIobject\fP \fIattribute\fP [ \fIregexp\fP ]
210 \fBmono\fP index \fIattribute\fP [ \fIpattern\fP ]
211 .fi
212 .IP
213 For terminals which don't support color, you can still assign
214 attributes to objects.  Valid attributes include:
215 .BR none ", " bold ", " underline ", " 
216 .BR reverse ", and " standout .
217 .TP
218 [\fBun\fP]\fBignore\fP \fIpattern\fP [ \fIpattern\fP ... ]
219 The \fBignore\fP command permits you to specify header fields which
220 you usually don't wish to see.  Any header field whose tag
221 \fIbegins\fP with an \(lqignored\(rq pattern will be ignored.
222 .IP
223 The \fBunignore\fP command permits you to define exceptions from
224 the above mentioned list of ignored headers.
225 .PP
226 .nf
227 \fBlists\fP \fIregexp\fP [ \fIregexp\fP ... ]
228 \fBunlists\fP \fIregexp\fP [ \fIregexp\fP ... ]
229 \fBsubscribe\fP \fIregexp\fP [ \fIregexp\fP ... ]
230 \fBunsubscribe\fP \fIregexp\fP [ \fIregexp\fP ... ]
231 .fi
232 .IP
233 Mutt maintains two lists of mailing list address patterns, a list of
234 subscribed mailing lists, and a list of known mailing lists.  All
235 subscribed mailing lists are known.  Patterns use regular expressions.
236 .IP
237 The \fBlists\fP command adds a mailing list address to the list of
238 known mailing lists.  The \fBunlists\fP command removes a mailing
239 list from the lists of known and subscribed mailing lists.  The
240 \fBsubscribe\fP command adds a mailing list to the lists of known
241 and subscribed mailing lists.  The \fBunsubscribe\fP command removes
242 it from the list of subscribed mailing lists.
243 .TP
244 \fBmbox-hook\fP [\fB!\fP]\fIpattern\fP \fImailbox\fP
245 When mutt changes to a mail folder which matches \fIpattern\fP,
246 \fImailbox\fP will be used as the \(lqmbox\(rq folder, i.e., read
247 messages will be moved to that folder when the mail folder is left.
248 .IP
249 The first matching \fBmbox-hook\fP applies.
250 .PP
251 .nf
252 \fBmailboxes\fP \fIfilename\fP [ \fIfilename\fP ... ]
253 \fBunmailboxes\fP [ \fB*\fP | \fIfilename\fP ... ]
254 .fi
255 .IP
256 The \fBmailboxes\fP specifies folders which can receive mail and which will
257 be checked for new messages.  When changing folders, pressing space
258 will cycle through folders with new mail.  The \fBunmailboxes\fP
259 command is used to remove a file name from the list of folders which
260 can receive mail.  If "\fB*\fP" is specified as the file name, the
261 list is emptied.
262 .PP
263 .nf
264 \fBmy_hdr\fP \fIstring\fP
265 \fBunmy_hdr\fP \fIfield\fP
266 .fi
267 .IP
268 Using \fBmy_hdr\fP, you can define headers which will be added to
269 the messages you compose.  \fBunmy_hdr\fP will remove the given
270 user-defined headers.
271 .TP
272 \fBhdr_order\fP \fIheader1\fP \fIheader2\fP [ ... ]
273 With this command, you can specify an order in which mutt will
274 attempt to present headers to you when viewing messages.
275 .TP
276 \fBsave-hook\fP [\fB!\fP]\fIpattern\fP \fIfilename\fP
277 When a message matches \fIpattern\fP, the default file name when
278 saving it will be the given \fIfilename\fP.
279 .TP
280 \fBfcc-hook\fP [\fB!\fP]\fIpattern\fP \fIfilename\fP
281 When an outgoing message matches \fIpattern\fP, the default file
282 name for storing a copy (fcc) will be the given \fIfilename\fP.
283 .TP
284 \fBfcc-save-hook\fP [\fB!\fP]\fIpattern\fP \fIfilename\fP
285 This command is an abbreviation for identical \fBfcc-hook\fP and
286 \fBsave-hook\fP commands.
287 .TP
288 \fBsend-hook\fP [\fB!\fP]\fIpattern\fP \fIcommand\fP
289 When composing a message matching \fIpattern\fP, \fIcommand\fP is
290 executed.  When multiple \fBsend-hook\fPs match, they are executed
291 in the order in which they occur in the configuration file.
292 .TP
293 \fBcrypt-hook\fP \fIpattern\fP \fIkey-id\fP
294 The crypt-hook command provides a method by which you can
295 specify the ID of the public key to be used when encrypting messages
296 to a certain recipient.  The meaning of "key ID" is to be taken
297 broadly: This can be a different e-mail address, a numerical key ID,
298 or even just an arbitrary search string.
299 .TP
300 \fBpush\fP \fIstring\fP
301 This command adds the named \fIstring\fP to the keyboard buffer.
302 .PP
303 .nf
304 \fBset\fP [\fBno\fP|\fBinv\fP]\fIvariable\fP[=\fIvalue\fP] [ ... ]
305 \fBtoggle\fP \fIvariable\fP [ ... ]
306 \fBunset\fP \fIvariable\fP [ ... ]
307 \fBreset\fP \fIvariable\fP [ ... ]
308 .fi
309 .IP
310 These commands are used to set and manipulate configuration
311 varibles.
312 .IP
313 Mutt knows four basic types of variables: boolean, number, string
314 and quadoption.  Boolean variables can be \fBset\fP (true),
315 \fBunset\fP (false), or \fBtoggle\fPd. Number variables can be assigned
316 a positive integer value.
317 .IP
318 String variables consist of any number of printable characters.
319 Strings must be enclosed in quotes if they contain spaces or tabs.
320 You may also use the \(lqC\(rq escape sequences \fB\\n\fP and
321 \fB\\t\fP for newline and tab, respectively.
322 .IP
323 Quadoption variables are used to control whether or not to be
324 prompted for certain actions, or to specify a default action.  A
325 value of \fByes\fP will cause the action to be carried out automatically
326 as if you had answered yes to the question.  Similarly, a value of
327 \fBno\fP will cause the the action to be carried out as if you had
328 answered \(lqno.\(rq A value of \fBask-yes\fP will cause a prompt
329 with a default answer of \(lqyes\(rq and \fBask-no\fP will provide a
330 default answer of \(lqno.\(rq
331 .IP
332 The \fBreset\fP command resets all given variables to the compile
333 time defaults.  If you reset the special variabe \fBall\fP, all
334 variables will reset to their system defaults.
335 .TP
336 \fBsource\fP \fIfilename\fP
337 The given file will be evaluated as a configuration file.
338 .TP
339 \fBunhook\fP [\fB * \fP | \fIhook-type\fP ]
340 This command will remove all hooks of a given type, or all hooks
341 when \(lq\fB*\fP\(rq is used as an argument.  \fIhook-type\fP
342 can be any of the \fB-hook\fP commands documented above.
343 .SH PATTERNS
344 .PP
345 In various places with mutt, including some of the abovementioned
346 \fBhook\fP commands, you can specify patterns to match messages.
347 .SS Constructing Patterns
348 .PP
349 A simple pattern consists of an operator of the form
350 \(lq\fB~\fP\fIcharacter\fP\(rq, possibly followed by a parameter
351 against which mutt is supposed to match the object specified by
352 this operator.  (For a list of operators, see below.)
353 .PP
354 With some of these operators, the object to be matched consists of
355 several e-mail addresses.  In these cases, the object is matched if
356 at least one of these e-mail addresses matches. You can prepend a
357 hat (\(lq\fB^\fP\(rq) character to such a pattern to indicate that
358 \fIall\fP addresses must match in order to match the object.
359 .PP
360 You can construct complex patterns by combining simple patterns with
361 logical operators.  Logical AND is specified by simply concatenating
362 two simple patterns, for instance \(lq~C mutt-dev ~s bug\(rq.
363 Logical OR is specified by inserting a vertical bar (\(lq\fB|\fP\(rq)
364 between two patterns, for instance \(lq~C mutt-dev | ~s bug\(rq.
365 Additionally, you can negate a pattern by prepending a bang
366 (\(lq\fB!\fP\(rq) character.  For logical grouping, use braces
367 (\(lq()\(rq). Example: \(lq!(~t mutt|~c mutt) ~f elkins\(rq.
368 .SS Simple Patterns
369 .PP
370 Mutt understands the following simple patterns:
371 .PP
372 .TS
373 l l.
374 ~A      all messages
375 ~b \fIEXPR\fP   messages which contain \fIEXPR\fP in the message body
376 ~B \fIEXPR\fP   messages which contain \fIEXPR\fP in the whole message
377 ~c \fIEXPR\fP   messages carbon-copied to \fIEXPR\fP
378 ~C \fIEXPR\fP   message is either to: or cc: \fIEXPR\fP
379 ~D      deleted messages
380 ~d \fIMIN\fP-\fIMAX\fP  messages with \(lqdate-sent\(rq in a Date range
381 ~E      expired messages
382 ~e \fIEXPR\fP   message which contains \fIEXPR\fP in the \(lqSender\(rq field
383 ~F      flagged messages
384 ~f \fIEXPR\fP   messages originating from \fIEXPR\fP
385 ~g      PGP signed messages
386 ~G      PGP encrypted messages
387 ~h \fIEXPR\fP   messages which contain \fIEXPR\fP in the message header
388 ~k      message contains PGP key material
389 ~i \fIEXPR\fP   message which match \fIEXPR\fP in the \(lqMessage-ID\(rq field
390 ~L \fIEXPR\fP   message is either originated or received by \fIEXPR\fP
391 ~l      message is addressed to a known mailing list
392 ~m \fIMIN\fP-\fIMAX\fP  message in the range \fIMIN\fP to \fIMAX\fP
393 ~n \fIMIN\fP-\fIMAX\fP  messages with a score in the range \fIMIN\fP to \fIMAX\fP
394 ~N      new messages
395 ~O      old messages
396 ~p      message is addressed to you (consults $alternates)
397 ~P      message is from you (consults $alternates)
398 ~Q      messages which have been replied to
399 ~R      read messages
400 ~r \fIMIN\fP-\fIMAX\fP  messages with \(lqdate-received\(rq in a Date range
401 ~S      superseded messages
402 ~s \fIEXPR\fP   messages having \fIEXPR\fP in the \(lqSubject\(rq field.
403 ~T      tagged messages
404 ~t \fIEXPR\fP   messages addressed to \fIEXPR\fP
405 ~U      unread messages
406 ~v      message is part of a collapsed thread.
407 ~x \fIEXPR\fP   messages which contain \fIEXPR\fP in the \(lqReferences\(rq field
408 ~z \fIMIN\fP-\fIMAX\fP  messages with a size in the range \fIMIN\fP to \fIMAX\fP
409 ~=      duplicated messages (see $duplicate_threads)
410 .TE
411 .PP
412 In the above, \fIEXPR\fP is a regular expression.
413 .PP
414 With the \fB~m\fP, \fB~n\fP, and \fB~z\fP operators, you can also
415 specify ranges in the forms \fB<\fP\fIMAX\fP, \fB>\fP\fIMIN\fP,
416 \fIMIN\fP\fB-\fP, and \fB-\fP\fIMAX\fP.
417 .SS Matching dates
418 .PP
419 The \fB~d\fP and \fB~r\fP operators are used to match date ranges,
420 which are interpreted to be given in your local time zone.
421 .PP
422 A date is of the form
423 \fIDD\fP[\fB/\fP\fIMM\fP[\fB/\fP[\fIcc\fP]\fIYY\fP]], that is, a
424 two-digit date, optionally followed by a two-digit month, optionally
425 followed by a year specifications.  Omitted fields default to the
426 current month and year.
427 .PP
428 Mutt understands either two or four digit year specifications.  When
429 given a two-digit year, mutt will interpret values less than 70 as
430 lying in the 21st century (i.e., \(lq38\(rq means 2038 and not 1938,
431 and \(lq00\(rq is interpreted as 2000), and values
432 greater than or equal to 70 as lying in the 20th century.
433 .PP
434 Note that this behaviour \fIis\fP Y2K compliant, but that mutt
435 \fIdoes\fP have a Y2.07K problem.
436 .PP
437 If a date range consists of a single date, the operator in question
438 will match that precise date.  If the date range consists of a dash
439 (\(lq\fB-\fP\(rq), followed by a date, this range will match any
440 date before and up to the date given.  Similarly, a date followed by
441 a dash matches the date given and any later point of time.  Two
442 dates, separated by a dash, match any date which lies in the given
443 range of time.
444 .PP
445 You can also modify any absolute date by giving an error range.  An
446 error range consists of one of the characters
447 .BR + ,
448 .BR - ,
449 .BR * ,
450 followed by a positive number, followed by one of the unit
451 characters
452 .BR y ,
453 .BR m ,
454 .BR w ", or"
455 .BR d ,
456 specifying a unit of years, months, weeks, or days.  
457 .B +
458 increases the maximum date matched by the given interval of time,
459 .B - 
460 decreases the minimum date matched by the given interval of time, and
461 .B *
462 increases the maximum date and decreases the minimum date matched by
463 the given interval of time.  It is possible to give multiple error
464 margins, which cumulate.  Example:
465 .B "1/1/2001-1w+2w*3d"
466 .PP
467 You can also specify offsets relative to the current date.  An
468 offset is specified as one of the characters
469 .BR < ,
470 .BR > ,
471 .BR = ,
472 followed by a positive number, followed by one of the unit
473 characters
474 .BR y ,
475 .BR m ,
476 .BR w ", or"
477 .BR d .
478 .B >
479 matches dates which are older than the specified amount of time, an
480 offset which begins with the character
481 .B < 
482 matches dates which are more recent than the specified amount of time,
483 and an offset which begins with the character
484 .B =
485 matches points of time which are precisely the given amount of time
486 ago.
487 .SH CONFIGURATION VARIABLES