Drop undocumented *broken-mbox* variable..
[s-mailx.git] / nail.1
blobfbed2ba899c0cd7e3bd893b6a29063074241e15c
1 .\" Copyright (c) 1980, 1990, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\" Copyright (c) 2000
4 .\"     Gunnar Ritter.  All rights reserved.
5 .\" Copyright (c) 2012 Steffen "Daode" Nurpmeso.
6 .\" All rights reserved.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\"    must display the following acknowledgement:
18 .\"     This product includes software developed by the University of
19 .\"     California, Berkeley and its contributors.
20 .\"     This product includes software developed by Gunnar Ritter
21 .\"     and his contributors.
22 .\" 4. Neither the name of the University nor the names of its contributors
23 .\"    may be used to endorse or promote products derived from this software
24 .\"    without specific prior written permission.
25 .\"
26 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS '\fIAS IS\fR' AND
27 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 .\" SUCH DAMAGE.
37 .\"
38 .\"--MKMAN-START--
39 .ds UU S-NAIL
40 .ds uu S-nail
41 .ds UA \\fIS-nail\\fR
42 .ds ua \\fIs-nail\\fR
43 .ds ba \\fBs-nail\\fR
44 .ds UR s-nail.rc
45 .\"--MKMAN-END--
46 .\" If not ~/.mailrc, it breaks POSIX compatibility.  And adjust main.c.
47 .ds ur ~/.mailrc
48 .\"
49 .\" ##  --  >8  --  8<  --  ##
50 .\"
51 .TH "\*(UU" 1 "2012-10-05" "\*(uu" "User Commands"
52 .SH NAME
53 \*(UA \- send and receive Internet mail
54 .SH SYNOPSIS
55 .PD 0
56 .HP
57 .ad l
58 \*(ba [\fB\-BDdEFintv~\fR]
59 [\fB\-A\fI\ account\fR]
60 [\fB\-a\fI\ attachment\fR]
61 [\fB\-b\fI\ bcc-addr\fR] [\fB\-c\fI\ cc-addr\fR]
62 [\fB\-O\fI\ mta-option [\fB\-O\fI mta-option-argument]\fR]
63 [\fB\-q\fI\ quote-file\fR]
64 [\fB\-r\fI\ from-addr\fR]
65 [\fB\-S\fI\ variable\fR[\fB=\fIvalue\fR]]
66 [\fB\-s\fI\ subject\fR]
67 \fIto-addr\fR .\ .\ .
68 .HP
69 .ad l
70 \*(ba [\fB\-BDdEeHIiNnRv~\fR]
71 [\fB\-A\fI\ account\fR]
72 [\fB\-S\fI\ variable\fR[\fB=\fIvalue\fR]]
73 [\fB\-T\fI\ name\fR]
74 \fB\-f\fR [\fIfile\fR]
75 .HP
76 .ad l
77 \*(ba [\fB\-BDdEeiNnRv~\fR]
78 [\fB\-A\fI\ account\fR]
79 [\fB\-S\fI\ variable\fR[\fB=\fIvalue\fR]]
80 [\fB\-u\fI\ user\fR]
81 .br
82 .PD
83 .ad b
84 .SH DESCRIPTION
85 \*(UA is an intelligent mail processing system, which has a command syntax
86 reminiscent of
87 .IR ed (1)
88 with lines replaced by messages.
89 It is based on Heirloom mailx, that is based on Berkeley Mail 8.1,
90 is intended to provide the functionality of the POSIX
91 .B mailx
92 command,
93 and offers extensions for MIME, IMAP, POP3, SMTP, and S/MIME.
94 \*(UA provides enhanced features for interactive use, such as caching
95 and disconnected operation for IMAP, message threading, scoring, and
96 filtering.
97 It is also usable as a mail batch language, both for sending and
98 receiving mail.
99 .PP
100 The following options are accepted:
103 .BI \-A \ name
104 Executes an 
105 .I account
106 command (see below) for \fIname\fR after the startup files have been
107 read.
109 .BI \-a \ file
110 Attach the given file to the message.
112 .B \-B
113 Make standard input and standard output line-buffered.
115 .BI \-b \ address
116 Send blind carbon copies to the given list of addresses.
117 \fISending mail\fR below goes into more detail on that.
119 .BI \-c \ address
120 Send carbon copies to the given list of addresses.
122 .B \-D
123 Start in
124 .I disconnected
125 mode; see the description for the
126 .I disconnected
127 variable option.
129 .B \-d
130 Enables debugging messages and disables the actual delivery of messages.
131 Unlike
132 .IR \-v ,
133 this option is intended for \*(UA development only.
135 .B \-E
136 If an outgoing message does not contain any text in its first or only
137 message part, do not send but discard it silently,
138 effectively setting the
139 .I skipemptybody
140 variable at program startup.
141 This is useful for sending messages from scripts started by
142 .IR cron (8).
144 .B \-e
145 Just check if mail is present in the system mailbox.
146 If yes, return an exit status of zero, a non-zero value otherwise.
148 .B \-F
149 Save the message to send in a file named after the local part of the
150 first recipient's address.
152 \fB\-f\fR [\fIfile\fR]
153 Read in the contents of the user's mbox (or the specified file)
154 for processing;
155 when \*(UA is quit, it writes undeleted messages back to this file.
156 The string \fIfile\fR is handled as described for the
157 .I folder
158 command below.
159 Note that \fIfile\fR is not a direct argument to the \fB-f\fR option,
160 but instead taken from the command line after option processing has been
161 completed.
163 .B \-H
164 Print header summaries for all messages and exit.
166 .B \-I
167 Shows the `Newsgroup:' or `Article-Id:' fields in the header summary.
168 Only applicable in combination with
169 .IR \-f .
171 .B \-i
172 Ignore tty interrupt signals.
173 This is particularly useful when using \*(UA on noisy phone lines.
175 .B \-N
176 Inhibits the initial display of message headers when reading mail
177 or editing a mail folder.
179 .B \-n
180 Inhibits reading \*(UR upon startup.
181 This option should be activated for \*(UA scripts that are invoked on
182 more than one machine, because the contents of that file may differ
183 between them.
185 .BI \-O \ option
186 Pass the given option through to the mail-transfer-agent (MTA).
187 This option has no effect when SMTP is used for sending mail.
188 E.g., to specify the hop count to an old \fIsendmail(1)\fR, use
189 `\fI-O-h -Onumber\fR', which will be passed as `\fI-h number\fR'.
191 .BI \-q \ file
192 Start the message with the contents of the specified file.
193 May be given in send mode only.
195 .B \-R
196 Opens any folders read-only.
198 .BI \-r \ address
199 Sets the
200 .I From
201 address. Overrides any
202 .I from
203 variable specified in environment or startup files.
204 Tilde escapes are disabled.
205 The \fI\-r\fI address\fR options are passed to the mail transfer agent
206 unless SMTP is used.
207 This option exists for compatibility only; it is recommended to set the
208 .I from
209 variable directly instead.
211 \fB\-S\fI\ variable\fR[\fB=\fIvalue\fR]
212 Sets the internal option
213 .I variable
214 and, in case of a string option, assigns \fIvalue\fR to it.
215 These assignments take place after the resource files have been loaded.
217 .BI \-s \ subject
218 Specify subject on command line (only the first argument after the
219 .I \-s
220 flag is used as a subject; be careful to quote subjects containing spaces).
222 .BI \-T \ name
223 Writes the `Message-Id:' and `Article-Id:' header fields of each message
224 read in the file
225 .IR name .
226 Implies
227 .IR \-I .
228 Compressed files are handled as described for the \fIfolder\fR command
229 below.
231 .B \-t
232 The message to be sent is expected to contain a message header with
233 `To:', `Cc:', or `Bcc:' fields giving its recipients and `Subject:'
234 giving the subject of the message.
235 Recipients and subject specified on the command line are ignored.
237 .BI \-u \ user
238 Reads the mailbox of the given user name.
240 .B \-V
241 Print \*(UA's version and exit.
243 .B \-v
244 Verbose mode.
245 The details of delivery are displayed on the user's terminal.
247 .B \-~
248 Enable tilde escapes even if not in interactive mode.
250 .SS "Sending mail"
251 To send a message to one or more people, \*(UA can be invoked with
252 arguments which are the names of people to whom the mail will be sent.
253 These names may be \fIalias\fRes, plain addresses or full address
254 specifications including user names and comments, in which case care
255 for proper quoting may be necessary.
256 The section \fIRecipient address specifications\fR below explains the
257 interpretation of addresses in more detail.
258 The user is then expected to type in his message, followed by an
259 `control-D' at the beginning of a line.
260 The section \fIReplying to or originating mail\fI, describes some
261 features of \*(UA available to help when composing letters.
262 .SS "Reading mail"
263 In normal usage \*(UA is given no arguments and checks the user's mail
264 out of the post office, then prints out a one line header of each
265 message found.
266 The current message is initially the first message (numbered 1) and can
267 be printed using the print command which can be abbreviated `p').
268 The user can move among the messages much as he moves between lines in
269 .IR ed (1),
270 with the commands `+' and `\-' moving backwards and forwards,
271 and simple numbers.
272 .SS "Disposing of mail"
273 After examining a message the user can delete `d') the message or reply
274 `r') to it.
275 Deletion causes the \*(UA program to forget about the message.
276 This is not irreversible;
277 the message can be undeleted `u') by giving its number,
278 or the \*(UA session can be aborted by giving the exit `x') command.
279 Deleted messages will, however, usually disappear never to be seen
280 again.
281 .SS "Specifying messages"
282 Commands such as print and delete can be given a list of message numbers
283 as arguments to apply to a number of messages at once.
284 Thus `\fIdelete 1 2\fR' deletes messages 1 and 2, while
285 `\fIdelete 1-5\fR' deletes messages 1 through 5.
286 In sorted or threaded mode (see the
287 .I sort
289 .I thread
290 commands),
291 `\fIdelete 1-5\fR' deletes the messages that are located between (and
292 including) messages 1 through 5 in the sorted/threaded order, as shown
293 in the header summary.
294 The following special message names exist:
296 .B :n
297 All new messages.
299 .B :o
300 All old messages (any not in state read or new).
302 .B :u
303 All unread messages.
305 .B :d
306 All deleted messages (for the
307 .I undelete
308 command).
310 .B :r
311 All read messages.
313 .B :f
314 All `flagged' messages.
316 .B :a
317 All answered messages
318 (cf. the
319 .I markanswered
320 variable).
322 .B :t
323 All messages marked as draft.
325 .B :k
326 All `killed' messages.
328 .B :j
329 All messages classified as junk.
331 .B .
332 The current message.
334 .B ;
335 The message that was previously the current message.
337 .B ,
338 The parent message of the current message,
339 that is the message with the Message-ID
340 given in the `In-Reply-To:' field
341 or the last entry of the `References:' field
342 of the current message.
344 .B \-
345 The next previous undeleted message,
346 or the next previous deleted message for the
347 .I undelete
348 command.
349 In sorted/threaded mode,
350 the next previous such message in the sorted/threaded order.
352 .B +
353 The next undeleted message,
354 or the next deleted message for the
355 .I undelete
356 command.
357 In sorted/threaded mode,
358 the next such message in the sorted/threaded order.
360 .B ^
361 The first undeleted message,
362 or the first deleted message
363 for the
364 .I undelete
365 command.
366 In sorted/threaded mode,
367 the first such message in the sorted/threaded order.
369 .B $
370 The last message.
371 In sorted/threaded mode,
372 the last message in the sorted/threaded order.
374 .BI & x
375 In threaded mode,
376 selects the message addressed with
377 .IR x ,
378 where
379 .I x
380 is any other message specification,
381 and all messages from the thread that begins at it.
382 Otherwise, it is identical to
383 .IR x .
385 .I x
386 is omitted,
387 the thread beginning with the current message is selected.
389 .B *
390 All messages.
392 .B `
393 All messages that were included in the message list
394 for the previous command.
396 .BI / string
397 All messages that contain
398 .I string
399 in the subject field (case ignored).
400 See also the
401 .I searchheaders
402 variable.
404 .I string
405 is empty,
406 the string from the previous specification of that type is used again.
408 .I address
409 All messages from
410 .IR address .
411 By default, this is a case-sensitive search
412 for the complete email address.
413 If the
414 .I allnet
415 variable is set,
416 only the local part of the addresses is evaluated for the comparison.
417 Otherwise if the
418 .I showname
419 variable is set,
420 a case-sensitive search for the complete real name
421 of a sender is performed.
422 The IMAP-style
423 .BI (from\  address)
424 expression can be used instead
425 if substring matches are desired.
427 .BI ( criterion )
428 All messages that satisfy the given IMAP-style SEARCH
429 .IR criterion .
430 This addressing mode is available with all types of folders;
431 for folders not located on IMAP servers,
432 or for servers unable to execute the SEARCH command,
433 \*(UA will perform the search locally.
434 Strings must be enclosed by double quotes `"' in their entirety
435 if they contain white space or parentheses;
436 within the quotes,
437 only backslash `\e' is recognized as an escape character.
438 All string searches are case-insensitive.
439 When the description indicates
440 that the `envelope' representation of an address field is used,
441 this means that the search string is checked against
442 both a list constructed as
445 \fB("\fIreal name\fB" "\fIsource-route\fB" "\fIlocal-part\fB" "\fIdomain-part\fB")\fR
448 for each address,
449 and the addresses without real names
450 from the respective header field.
451 Criteria can be nested using parentheses.
453 \fB(\fIcriterion1 criterion2\fR .\|.\|. \fIcriterionN\fB)\fR
454 All messages that satisfy all of the given criteria.
456 .BI (or " criterion1 criterion2" )
457 All messages that satisfy either
458 .I criterion1
460 .IR criterion2 ,
461 or both.
462 To connect more than two criteria using `or',
463 (or) specifications have to be nested using additional parentheses,
464 as with `(or\ a\ (or\ b\ c))';
465 `(or\ a\ b\ c)' means ((a or b) and c).
466 For a simple `or' operation of independent criteria
467 on the lowest nesting level,
468 it is possible to achieve similar effects by using
469 three separate criteria, as with
470 `(a)\ (b)\ (c)'.
472 .BI (not " criterion" )
473 All messages that do not satisfy
474 .IR criterion .
476 .BI (bcc " string" )
477 All messages that contain
478 .I string
479 in the `envelope' representation of the
480 .I Bcc:
481 field.
483 .BI (cc " string" )
484 All messages that contain
485 .I string
486 in the `envelope' representation of the
487 .I Cc:
488 field.
490 .BI (from " string" )
491 All messages that contain
492 .I string
493 in the `envelope' representation of the
494 .I From:
495 field.
497 .BI (subject " string" )
498 All messages that contain
499 .I string
500 in the
501 .I Subject:
502 field.
504 .BI (to " string" )
505 All messages that contain
506 .I string
507 in the `envelope' representation of the
508 .I To:
509 field.
511 .BI (header " name string" )
512 All messages that contain
513 .I string
514 in the specified
515 .I Name:
516 field.
518 .BI (body " string" )
519 All messages that contain
520 .I string
521 in their body.
523 .BI (text " string" )
524 All messages that contain
525 .I string
526 in their header or body.
528 .BI (larger " size" )
529 All messages that are larger than
530 .I size
531 (in bytes).
533 .BI (smaller " size" )
534 All messages that are smaller than
535 .I size
536 (in bytes).
538 .BI (before " date" )
539 All messages that were received before
540 .IR date ;
541 .I date
542 must be in the form
543 \fId\fR[\fId\fR]\fB-\fImon\fB-\fIyyyy\fR,
544 where \fId\fR[\fId\fR] is the day of the month
545 as one or two digits,
546 .I mon
547 is the name of the month\(emone of
548 `Jan', `Feb', `Mar',
549 `Apr', `May', `Jun',
550 `Jul', `Aug', `Sep',
551 `Oct', `Nov', or `Dec',
553 .I yyyy
554 is the year as four digits;
555 e.\|g. "30-Aug-2004".
557 .BI (on " date" )
558 All messages that were received on the specified date.
560 .BI (since " date" )
561 All messages that were received since the specified date.
563 .BI (sentbefore " date" )
564 All messages that were sent on the specified date.
566 .BI (senton " date" )
567 All messages that were sent on the specified date.
569 .BI (sentsince " date" )
570 All messages that were sent since the specified date.
572 .B ()
573 The same criterion as for the previous search.
574 This specification cannot be used as part of another criterion.
575 If the previous command line contained more than one independent criterion,
576 the last of those criteria is used.
578 A practical method to read a set of messages
579 is to issue a
580 .I from
581 command with the search criteria first
582 to check for appropriate messages,
583 and to read each single message then by typing `\fB`\fR' repeatedly.
584 .SS "Replying to or originating mail"
586 .I reply
587 command can be used
588 to set up a response to a message,
589 sending it back to the person who it was from.
590 Text the user types in then,
591 up to an end-of-file,
592 defines the contents of the message.
593 While the user is composing a message,
594 \*(UA treats lines beginning with the character `~' specially.
595 For instance, typing `~m' (alone on a line)
596 will place a copy of the current message into the response
597 right shifting it by a tabstop
598 (see
599 .I indentprefix
600 variable, below).
601 Other escapes will set up subject fields,
602 add and delete recipients to the message,
603 attach files to it
604 and allow the user to escape to an editor
605 to revise the message
606 or to a shell to run some commands.
607 (These options are given in the summary below.)
608 .SS "Ending a mail processing session"
609 The user can end a \*(UA session
610 with the quit (`q') command.
611 Messages which have been examined
612 go to the user's mbox file
613 unless they have been deleted
614 in which case they are discarded.
615 Unexamined messages go back
616 to the post office.
617 (See the \-f option above).
618 .SS "Personal and systemwide distribution lists"
619 It is also possible to create
620 a personal distribution lists so that,
621 for instance, the user can send mail
622 to `\fIcohorts\fR' and have it go
623 to a group of people.
624 Such lists can be defined by placing a line like
627         \fBalias\fI cohorts bill ozalp jkf mark kridle@ucbcory\fR
630 in the file \*(ur in the user's home directory.
631 The currently defined list of such aliases can be displayed with the alias
632 command in \*(UA.
633 System wide distribution lists can be created by editing /etc/aliases, see
634 \fIaliases(5)\fR and \fIsendmail(1)\fR;
635 these are kept in a different syntax and are used by the MTA, not \*(UA.
636 In mail the user sends, personal aliases will be expanded in mail sent to
637 others so that they will be able to reply to the recipients.
638 System wide aliases are not expanded when the mail is sent,
639 but any reply returned to the machine will have the system wide alias
640 expanded as all mail goes through \fIsendmail(1)\fR.
641 .SS "Recipient address specifications"
642 When an address is used to name a recipient
643 (in any of To, Cc, or Bcc),
644 names of local mail folders
645 and pipes to external commands
646 can also be specified;
647 the message text is then written to them.
648 The rules are: Any name which starts with a
649 .RB ` | '
650 character specifies a pipe,
651 the command string following the `|'
652 is executed and the message is sent to its standard input;
653 any other name which contains a
654 .RB ` @ '
655 character is treated as a mail address;
656 any other name which starts with a
657 .RB ` + '
658 character specifies a folder name;
659 any other name which contains a
660 .RB ` / '
661 character
662 but no
663 .RB ` ! '
665 .RB ` % '
666 character before also specifies a folder name;
667 what remains is treated as a mail address.
668 Compressed folders are handled as described for the
669 .I folder
670 command below.
671 .SS "Network mail (Internet / ARPA, UUCP, Berknet)"
673 .IR mailaddr (7)
674 for a description of network addresses.
675 \*(UA has a number of options which can be set in the \*(ur file
676 to alter its behavior;
677 thus `\fIset askcc\fR' enables the askcc feature.
678 (These options are summarized below).
679 .SS "MIME types"
680 For any outgoing attachment,
681 \*(UA tries to determine the content type.
682 It does this by reading MIME type files
683 whose lines have the following syntax:
686         \fItype\fB/\fIsubtype      extension \fR[\fIextension \fR.\ .\ .]\fR
689 where type/subtype are strings describing the file contents,
690 and extension is the part of a filename starting after the last dot.
691 Any line not immediately beginning with an ASCII alphabetical character is
692 ignored by \*(UA.
693 If there is a match with the extension of the file to attach,
694 the given type/subtype pair is used.
695 Otherwise, or if the filename has no extension,
696 the content types text/plain or application/octet-stream are used,
697 the first for text or international text files,
698 the second for any file that contains formatting characters
699 other than newlines and horizontal tabulators.
700 .SS "Character sets"
701 \*(UA normally detects the character set of the terminal
702 using the LC_CTYPE locale setting.
703 If the locale cannot be used appropriately,
704 the \fIttycharset\fR variable should be set
705 to provide an explicit value.
706 When reading messages,
707 their text is converted to the terminal character set if possible.
708 Unprintable characters and illegal byte sequences are detected
709 and replaced by Unicode substitute characters or question marks
710 unless the
711 .I print-all-chars
712 is set at initialization time.
714 The character set for outgoing messages
715 is not necessarily the same
716 as the one used on the terminal.
717 If an outgoing text message
718 contains characters not representable in US-ASCII,
719 the character set being used
720 must be declared within its header.
721 Permissible values can be declared
722 using the \fIsendcharsets\fR variable,
723 separated by commas;
724 \*(UA tries each of the values in order
725 and uses the first appropriate one.
726 If the message contains characters that cannot be represented
727 in any of the given character sets,
728 the message will not be sent,
729 and its text will be saved to the `dead.letter' file.
730 Messages that contain NUL bytes are not converted.
732 Outgoing attachments are converted if they are plain text.
733 If the
734 .I sendcharsets
735 variable contains more than one character set name,
737 .I ~@
738 tilde escape will ask for the character sets for individual attachments
739 if it is invoked without arguments.
741 Best results are usually achieved
742 when \*(UA is run in a UTF-8 locale
743 on a UTF-8 capable terminal.
744 In this setup,
745 characters from various countries can be displayed,
746 while it is still possible to use more simple
747 character sets for sending
748 to retain maximum compatibility with older mail clients.
749 .SS "Commands"
750 Each command is typed on a line by itself,
751 and may take arguments following the command word.
752 The command need not be typed in its entirety \(en
753 the first command which matches the typed prefix is used.
754 For commands which take message lists as arguments,
755 if no message list is given,
756 then the next message forward which satisfies
757 the command's requirements is used.
758 If there are no messages forward of the current message,
759 the search proceeds backwards,
760 and if there are no good messages at all,
761 \*(UA types `\fIapplicable messages\fR' and aborts the command.
762 If the command begins with a \fI#\fR sign,
763 the line is ignored.
765 The arguments to commands can be quoted, using the following methods:
766 .IP \(bu
767 An argument can be enclosed between paired double-quotes
768 "\|" or single-quotes '\|'; any white space, shell
769 word expansion, or backslash characters within the quotes
770 are treated literally as part of the argument.
771 A double-quote will be treated literally within
772 single-quotes and vice versa. These special properties of
773 the quote marks occur only when they are paired at the
774 beginning and end of the argument.
775 .IP \(bu
776 A backslash outside of the enclosing quotes is discarded
777 and the following character is treated literally as part of
778 the argument.
779 .IP \(bu
780 An unquoted backslash at the end of a command line is
781 discarded and the next line continues the command.
783 Filenames, where expected, are subjected to the following
784 transformations, in sequence:
785 .IP \(bu
786 If the filename begins with an unquoted plus sign, and
788 .I folder
789 variable is defined,
790 the plus sign will be replaced by the value of the
791 .I folder
792 variable followed by a slash. If the
793 .I folder
794 variable is
795 unset or is set to null, the filename will be unchanged.
796 .IP \(bu
797 Shell word expansions are applied to the filename.
798 If more than a single pathname results
799 from this expansion and the command is expecting one
800 file, an error results.
802 The following commands are provided:
804 .B \-
805 Print out the preceding message.
806 If given a numeric argument n,
807 goes to the n'th previous message and prints it.
809 .B ?
810 Prints a brief summary of commands.
812 .B !
813 Executes the shell (see
814 .IR sh (1)
816 .IR csh (1))
817 command which follows.
819 .B |
820 A synonym for the \fIpipe\fR command.
822 .B account
823 (ac) Creates, selects or lists
824 an email account.
825 An account is formed by a group of commands,
826 primarily of those to set variables.
827 With two arguments,
828 of which the second is a `{',
829 the first argument gives an account name,
830 and the following lines create a group of commands for that account
831 until a line containing a single `}' appears.
832 With one argument,
833 the previously created group of commands
834 for the account name is executed,
835 and a
836 .I folder
837 command is executed for the system mailbox or inbox
838 of that account.
839 Without arguments,
840 the list of accounts and their contents are printed.
841 As an example,
844     \fBaccount\fI myisp\fR \fB{\fR
845         set folder=imaps://mylogin@imap.myisp.example
846         set record=+Sent
847         set from="myname@myisp.example (My Name)"
848         set smtp=smtp.myisp.example
849     \fB}\fR
852 creates an account named `myisp'
853 which can later be selected by specifying `account myisp'.
855 .B alias
856 (a) With no arguments,
857 prints out all currently-defined aliases.
858 With one argument, prints out that alias.
859 With more than one argument,
860 creates a new alias or changes an old one.
862 .B alternates
863 (alt) The alternates command is useful
864 if the user has accounts on several machines.
865 It can be used to inform \*(UA
866 that the listed addresses all belong to the invoking user.
867 When he replies to messages,
868 \*(UA will not send a copy of the message
869 to any of the addresses
870 listed on the alternates list.
871 If the alternates command is given
872 with no argument,
873 the current set of alternate names is displayed.
875 .B answered
876 (ans) Takes a message list and marks each message
877 as a having been answered.
878 This mark has no technical meaning in the mail system;
879 it just causes messages to be marked in the header summary,
880 and makes them specially addressable.
882 .B cache
883 Only applicable to cached IMAP mailboxes;
884 takes a message list and reads the specified messages
885 into the IMAP cache.
887 .B call
888 Calls a macro (see the
889 .I define
890 command).
892 .B cd
893 Same as chdir.
895 .B certsave
896 Only applicable to S/MIME signed messages.
897 Takes a message list and a file name
898 and saves the certificates contained within the message signatures
899 to the named file in both human-readable and PEM format.
900 The certificates can later be used to send encrypted messages
901 to the messages' originators by setting the
902 .I smime-encrypt-user@host
903 variable.
905 .B chdir
906 (ch) Changes the user's working directory to that specified,
907 if given.
908 If no directory is given,
909 then changes to the user's login directory.
911 .B classify
912 (cl) Takes a list of messages and
913 examines their contents for characteristics of junk mail
914 using Bayesian filtering.
915 Messages considered to be junk are then marked as such.
916 The junk mail database is not changed.
918 .B collapse
919 (coll)
920 Only applicable to threaded mode.
921 Takes a message list
922 and makes all replies to these messages invisible
923 in header summaries,
924 unless they are in state `new'.
926 .B connect
927 (conn) If operating in disconnected mode on an IMAP mailbox,
928 switch to online mode and connect to the mail server
929 while retaining the mailbox status.
930 See the description of the
931 .I disconnected
932 variable for more information.
934 .B copy
935 (c) The copy command does the same thing that
936 .I save
937 does,
938 except that it does not mark the messages
939 it is used on for deletion when the user quits.
940 Compressed files and IMAP mailboxes are handled as described for the
941 .I folder
942 command.
944 .B Copy
945 (C) Similar to
946 .IR copy ,
947 but saves the messages in a file named after the local part
948 of the sender address of the first message.
950 .B decrypt
951 (dec) For unencrypted messages,
952 this command is identical to
953 .IR copy .
954 Encrypted messages are first decrypted, if possible,
955 and then copied.
957 .B Decrypt
958 (Dec) Similar to
959 .IR decrypt ,
960 but saves the messages in a file named after the local part
961 of the sender address of the first message.
963 .B define
964 (def) Defines a macro.
965 A macro definition is a sequence of commands in the following form:
968     \fBdefine\fR \fIname\fB {\fR
969         \fIcommand1\fR
970         \fIcommand2\fR
971         .\|.\|.
972         \fIcommandN\fR
973     \fB}\fR
976 Once defined, a macro can be explicitly invoked using the
977 .I call
978 command,
979 or can be implicitly invoked by setting the
980 .I folder-hook
982 .I folder-hook-fullname
983 variables.
985 .B defines
986 Prints the currently defined macros including their contents.
988 .B delete
989 (d) Takes a list of messages as argument
990 and marks them all as deleted.
991 Deleted messages will not be saved in mbox,
992 nor will they be available for most other commands.
994 .B discard
995 Same as ignore.
997 .B disconnect
998 (disco) If operating in online mode on an IMAP mailbox,
999 switch to disconnected mode while retaining the mailbox status.
1000 See the description of the
1001 .I disconnected
1002 variable for more information.
1003 A list of messages may optionally be given as argument;
1004 the respective messages are then read into the cache
1005 before the connection is closed.
1006 Thus `disco *' makes the entire current mailbox
1007 available for disconnected use.
1009 .BR dp \ or \ dt
1010 Deletes the current message
1011 and prints the next message.
1012 If there is no next message,
1013 \*(UA says `\fIat EOF\fR'.
1015 .B draft
1016 Takes a message list and marks each message
1017 as a draft.
1018 This mark has no technical meaning in the mail system;
1019 it just causes messages to be marked in the header summary,
1020 and makes them specially addressable.
1022 .B echo
1023 Echoes its arguments,
1024 resolving special names
1025 as documented for the folder command.
1026 The escape sequences
1027 `\fB\ea\fR',
1028 `\fB\eb\fR',
1029 `\fB\ec\fR',
1030 `\fB\ef\fR',
1031 `\fB\en\fR',
1032 `\fB\er\fR',
1033 `\fB\et\fR',
1034 `\fB\ev\fR',
1035 `\fB\e\e\fR', and
1036 `\fB\e0\fInum\fR'
1037 are interpreted
1038 as with the
1039 .IR echo (1)
1040 command.
1042 .B edit
1043 (e) Takes a list of messages
1044 and points the text editor
1045 at each one in turn.
1046 Modified contents are discarded
1047 unless the
1048 .I writebackedited
1049 variable is set.
1051 .B else
1052 Marks the end of the then-part
1053 of an if statement
1054 and the beginning of the part
1055 to take effect if the condition
1056 of the if statement is false.
1058 .B endif
1059 Marks the end of an if statement.
1061 .B exit
1062 (ex or x) Effects an immediate return to the Shell
1063 without modifying the user's system mailbox,
1064 his mbox file,
1065 or his edit file in \-f.
1067 .B file
1068 (fi) The same as folder.
1070 .B flag
1071 (fl) Takes a message list
1072 and marks the messages as `flagged' for urgent/special attention.
1073 This mark has no technical meaning in the mail system;
1074 it just causes messages to be highlighted in the header summary,
1075 and makes them specially addressable.
1077 .B folders
1078 With no arguments,
1079 list the names of the folders in the folder directory.
1080 With an existing folder as an argument,
1081 lists then names of folders below the named folder;
1082 e.\|g. the command `folders @'
1083 lists the folders on the base level of the current IMAP server.
1084 See also the
1085 .I imap-list-depth
1086 variable.
1088 .B folder
1089 (fold) The folder command switches
1090 to a new mail file or folder.
1091 With no arguments, it tells the user
1092 which file he is currently reading.
1093 If an argument is given,
1094 it will write out changes
1095 (such as deletions) the user has made
1096 in the current file and read in
1097 the new file.
1098 Some special conventions are recognized for the name.
1099 \fB#\fR means the previous file,
1100 \fB%\fR means the invoking user's system mailbox,
1101 \fB%\fIuser\fR means \fIuser's\fR system mailbox,
1102 \fB&\fR means the invoking user's mbox file,
1103 and \fB+\fIfile\fI means a \fIfile\fR in the folder directory.
1104 \fB%:\fIfilespec\fR expands to the same value as \fIfilespec\fR,
1105 but the file is handled as a system mailbox
1106 e.\ g. by the mbox and save commands.
1107 If the name matches one of the strings defined with the
1108 .I shortcut
1109 command,
1110 it is replaced by its long form and expanded.
1111 If the name ends with \fB.gz\fR or \fB.bz2\fR,
1112 it is treated as compressed with
1113 .IR gzip (1)
1115 .IR bzip2 (1),
1116 respectively.
1117 Likewise, if \fIname\fR does not exist,
1118 but either \fIname\fB.gz\fR or \fIname\fB.bz2\fR exists,
1119 the compressed file is used.
1120 If \fIname\fR refers to a directory
1121 with the subdirectories `tmp', `new', and `cur',
1122 it is treated as a folder in
1123 .I maildir
1124 format.
1125 A name of the form
1128        \fIprotocol\fB://\fR[\fIuser\fB@\fR]\fIhost\fR[\fB:\fIport\fR][\fB/\fIfile\fR]
1131 is taken as an Internet mailbox specification.
1132 The supported protocols are currently
1133 .B imap
1134 (IMAP v4r1),
1135 .B imaps
1136 (IMAP with SSL/TLS encryption),
1137 .B pop3
1138 (POP3),
1140 .B pop3s
1141 (POP3 with SSL/TLS encryption).
1143 .I user
1144 contains special characters, in particular `/' or `%',
1145 they must be escaped in URL notation,
1146 as `%2F' or `%25'.
1147 The optional
1148 .I file
1149 part applies to IMAP only;
1150 if it is omitted,
1151 the default `INBOX' is used.
1152 If \*(UA is connected to an IMAP server,
1153 a name of the form \fB@\fImailbox\fR
1154 refers to the \fImailbox\fR on that server.
1155 If the `folder' variable refers to an IMAP account,
1156 the special name `%' selects the `INBOX' on that account.
1158 .B Followup
1159 (F) Similar to
1160 .IR Respond ,
1161 but saves the message in a file
1162 named after the local part of the first recipient's address.
1164 .B followup
1165 (fo) Similar to
1166 .IR respond ,
1167 but saves the message in a file
1168 named after the local part of the first recipient's address.
1170 .B followupall
1171 Similar to
1172 .IR followup ,
1173 but responds to all recipients regardless of the
1174 .I flipr
1176 .I Replyall
1177 variables.
1179 .B followupsender
1180 Similar to
1181 .IR Followup ,
1182 but responds to the sender only regardless of the
1183 .I flipr
1185 .I Replyall
1186 variables.
1188 .B forward
1189 (fwd)
1190 Takes a message and the address of a recipient
1191 and forwards the message to him.
1192 The text of the original message is included in the new one,
1193 with the value of the
1194 .I fwdheading
1195 variable printed before.
1197 .I fwdignore
1199 .I fwdretain
1200 commands specify which header fields are included in the new message.
1201 Only the first part of a multipart message is included unless the
1202 .I forward-as-attachment
1203 option is set.
1205 .B Forward
1206 (Fwd)
1207 Similar to
1208 .IR forward ,
1209 but saves the message in a file named after
1210 the local part of the recipient's address.
1212 .B from
1213 (f) Takes a list of messages
1214 and prints their message headers,
1215 piped through the pager if the output does not fit on the screen.
1217 .B fwdignore
1218 Specifies which header fields are to be ignored with the
1219 .I forward
1220 command.
1221 This command has no effect when the
1222 .I forward-as-attachment
1223 option is set.
1225 .B fwdretain
1226 Specifies which header fields are to be retained with the
1227 .I forward
1228 command.
1229 .I fwdretain
1230 overrides
1231 .IR fwdignore .
1232 This command has no effect when the
1233 .I forward-as-attachment
1234 option is set.
1236 .B good
1237 (go) Takes a list of messages
1238 and marks all of them as not being junk mail.
1239 Data from these messages is then inserted
1240 into the junk mail database for future classification.
1242 .B headers
1243 (h) Lists the current range of headers,
1244 which is an 18-message group.
1245 If a `+' argument is given,
1246 then the next 18-message group is printed,
1247 and if a `\-' argument is given,
1248 the previous 18-message group is printed.
1250 .B help
1251 A synonym for ?.
1253 .B hold
1254 (ho, also preserve) Takes a message list
1255 and marks each message therein to be saved
1256 in the user's system mailbox
1257 instead of in mbox.
1258 Does not override the delete command.
1259 \*(UA deviates from the POSIX standard with this command,
1260 as a `next' command issued after `hold'
1261 will display the following message,
1262 not the current one.
1264 .B if
1265 Commands in \*(UA's startup files
1266 can be executed conditionally
1267 depending on whether the user is sending
1268 or receiving mail with the if command.
1269 For example:
1272     \fBif \fIreceive\fR
1273         \fIcommands .\ .\ .\fR
1274     \fBendif\fR
1277 An else form is also available:
1280     \fBif \fIreceive\fR
1281         \fIcommands .\ .\ .\fR
1282     \fBelse\fR
1283         \fIcommands .\ .\ .\fR
1284     \fBendif\fR
1287 Note that the only allowed conditions are
1288 .BR receive ,
1289 .BR send ,
1291 .B term
1292 (execute command if standard input is a tty).
1294 .B ignore
1295 Add the list of header fields named to the ignored list.
1296 Header fields in the ignore list are not printed
1297 on the terminal when a message is printed.
1298 This command is very handy for suppression
1299 of certain machine-generated header fields.
1300 The Type and Print commands can be used
1301 to print a message in its entirety,
1302 including ignored fields.
1303 If ignore is executed with no arguments,
1304 it lists the current set of ignored fields.
1306 .B imap
1307 Sends command strings directly to the current IMAP server.
1308 \*(UA operates always in IMAP \fIselected state\fR
1309 on the current mailbox;
1310 commands that change this
1311 will produce undesirable results
1312 and should be avoided.
1313 Useful IMAP commands are:
1316 .B create
1317 Takes the name of an IMAP mailbox as an argument
1318 and creates it.
1320 .B getquotaroot
1321 .\" RFC 2087
1322 Takes the name of an IMAP mailbox as an argument
1323 and prints the quotas that apply to the mailbox.
1324 Not all IMAP servers support this command.
1326 .B namespace
1327 .\" RFC 2342
1328 Takes no arguments and prints the Personal Namespaces,
1329 the Other User's Namespaces,
1330 and the Shared Namespaces.
1331 Each namespace type is printed in parentheses;
1332 if there are multiple namespaces of the same type,
1333 inner parentheses separate them.
1334 For each namespace,
1335 a namespace prefix and a hierarchy separator is listed.
1336 Not all IMAP servers support this command.
1339 .B inc
1340 Same as
1341 .IR newmail .
1343 .B junk
1344 (j) Takes a list of messages
1345 and marks all of them as junk mail.
1346 Data from these messages is then inserted
1347 into the junk mail database for future classification.
1349 .B kill
1350 (k) Takes a list of messages and `kills' them.
1351 Killed messages are not printed in header summaries,
1352 and are ignored by the
1353 .I next
1354 command.
1356 .I kill
1357 command also sets the score of the messages to negative infinity,
1358 so that subsequent
1359 .I score
1360 commands will not unkill them again.
1361 Killing is only effective for the current session on a folder;
1362 when it is quit, all messages are automatically unkilled.
1364 .B list
1365 Prints the names of all available commands.
1367 .B Mail
1368 (M) Similar to
1369 .IR mail ,
1370 but saves the message in a file
1371 named after the local part of the first recipient's address.
1373 .B mail
1374 (m) Takes as argument login names
1375 and distribution group names
1376 and sends mail to those people.
1378 .B mbox
1379 Indicate that a list of messages be sent
1380 to mbox in the user's home directory when
1381 \*(UA is quit.
1382 This is the default action for messages
1383 if unless the
1384 .I hold
1385 option is set.
1386 \*(UA deviates from the POSIX standard with this command,
1387 as a `next' command issued after `mbox'
1388 will display the following message,
1389 not the current one.
1391 .B move
1392 (mv) Acts like
1393 .IR copy ,
1394 but marks the messages for deletion
1395 if they were transferred successfully.
1397 .B Move
1398 (Mv) Similar to
1399 .IR move ,
1400 but moves the messages to a file named after the local part
1401 of the sender address of the first message.
1403 .B newmail
1404 Checks for new mail in the current folder
1405 without committing any changes before.
1406 If new mail is present, a message is printed.
1407 If the
1408 .I header
1409 variable is set,
1410 the headers of each new message are also printed.
1412 .B next
1413 (n) like + or CR) Goes to the next message
1414 in sequence and types it.
1415 With an argument list, types the next matching message.
1417 .B New
1418 Same as
1419 .IR unread .
1421 .B new
1422 Same as
1423 .IR unread .
1425 .B online
1426 Same as
1427 .IR connect .
1429 .B noop
1430 If the current folder is located on an IMAP or POP3 server,
1431 a NOOP command is sent.
1432 Otherwise, no operation is performed.
1434 .B Pipe
1435 (Pi) Like
1436 .I pipe
1437 but also
1438 pipes ignored header fields
1439 and all parts of MIME
1440 .I multipart/alternative
1441 messages.
1443 .B pipe
1444 (pi) Takes a message list and a shell command
1445 and pipes the messages through the command.
1446 Without an argument,
1447 the current message is piped
1448 through the command given by the \fIcmd\fR variable.
1449 If the \fI page\fR variable is set,
1450 every message is followed by a formfeed character.
1452 .B preserve
1453 (pre) A synonym for
1454 .IR hold .
1456 .B Print
1457 (P) Like
1458 .I print
1459 but also
1460 prints out ignored header fields
1461 and all parts of MIME
1462 .I multipart/alternative
1463 messages.
1464 See also
1465 .IR print ,
1466 .IR ignore ,
1468 .IR retain .
1470 .B print
1471 (p) Takes a message list and types out each message
1472 on the user's terminal.
1473 If the message is a MIME multipart message,
1474 all parts with a content type of `text' or `message' are shown,
1475 the other are hidden except for their headers.
1476 Messages are decrypted and converted to the terminal character set
1477 if necessary.
1479 .B probability
1480 (prob) For each word given as argument,
1481 the contents of its junk mail database entry are printed.
1483 .B quit
1484 (q) Terminates the session, saving all undeleted,
1485 unsaved messages in the user's mbox file in his login directory,
1486 preserving all messages marked with hold or preserve
1487 or never referenced in his system mailbox,
1488 and removing all other messages from his system mailbox.
1489 If new mail has arrived during the session,
1490 the message `\fIYou have new mail\fR' is given.
1491 If given while editing a mailbox file with the \-f flag,
1492 then the edit file is rewritten.
1493 A return to the Shell is effected,
1494 unless the rewrite of edit file fails,
1495 in which case the user can escape
1496 with the exit command.
1498 .B redirect
1499 (red) Same as
1500 .IR resend .
1502 .B Redirect
1503 (Red) Same as
1504 .IR Resend .
1506 .B remove
1507 (rem) Removes the named folders.
1508 The user is asked for confirmation
1509 in interactive mode.
1511 .B rename
1512 (ren) Takes the name of an existing folder
1513 and the name for the new folder
1514 and renames the first to the second one.
1515 Both folders must be of the same type
1516 and must be located on the current server for IMAP.
1518 .B Reply
1519 (R) Reply to originator.
1520 Does not reply to other recipients
1521 of the original message.
1523 .BR reply
1524 (r) Takes a message list and sends mail
1525 to the sender and all recipients of the specified message.
1526 The default message must not be deleted.
1528 .B replyall
1529 Similar to
1530 .IR reply ,
1531 but responds to all recipients regardless of the
1532 .I flipr
1534 .I Replyall
1535 variables.
1537 .B replysender
1538 Similar to
1539 .IR Reply ,
1540 but responds to the sender only regardless of the
1541 .I flipr
1543 .I Replyall
1544 variables.
1546 .B Resend
1547 Like
1548 .IR resend ,
1549 but does not add any header lines.
1550 This is not a way to hide the sender's identity,
1551 but useful for sending a message again
1552 to the same recipients.
1554 .B resend
1555 Takes a list of messages and a user name
1556 and sends each message to the named user.
1557 `Resent-From:' and related header fields are prepended
1558 to the new copy of the message.
1560 .B Respond
1561 Same as
1562 .IR Reply .
1564 .B respond
1565 Same as
1566 .IR reply .
1568 .B respondall
1569 Same as
1570 .IR replyall .
1572 .B respondsender
1573 Same as
1574 .IR replysender .
1576 .B retain
1577 Add the list of header fields named to the retained list.
1578 Only the header fields in the retain list are shown
1579 on the terminal when a message is printed.
1580 All other header fields are suppressed.
1581 The Type and Print commands can be used
1582 to print a message in its entirety.
1583 If retain is executed with no arguments,
1584 it lists the current set of retained fields.
1586 .B Save
1588 Similar to
1589 .IR save ,
1590 but saves the messages
1591 in a file named after the local part
1592 of the sender of the first message
1593 instead of taking a filename argument.
1595 .B save
1596 (s) Takes a message list and a filename
1597 and appends each message
1598 in turn to the end of the file.
1599 If no filename is given,
1600 the mbox file is used.
1601 The filename in quotes,
1602 followed by the line count and character count
1603 is echoed on the user's terminal.
1604 If editing a system mailbox,
1605 the messages are marked for deletion.
1606 Compressed files and IMAP mailboxes are handled as described for the
1607 .I \-f
1608 command line option above.
1610 .B savediscard
1611 Same as saveignore.
1613 .B saveignore
1614 Saveignore is to save what ignore is to print and type.
1615 Header fields thus marked are filtered out
1616 when saving a message by save
1617 or when automatically saving to mbox.
1618 This command should only be applied to header fields
1619 that do not contain information needed to decode the message,
1620 as MIME content fields do.
1621 If saving messages on an IMAP account,
1622 ignoring fields makes it impossible
1623 to copy the data directly on the server,
1624 thus operation usually becomes much slower.
1626 .B saveretain
1627 Saveretain is to save what retain is to print and type.
1628 Header fields thus marked are the only ones
1629 saved with a message when saving by save
1630 or when automatically saving to mbox.
1631 Saveretain overrides saveignore.
1632 The use of this command is strongly discouraged
1633 since it may strip header fields
1634 that are needed to decode the message correctly.
1636 .B score
1637 (sc) Takes a message list and a floating point number
1638 and adds the number to the score of each given message.
1639 All messages start at score 0 when a folder is opened.
1640 When the score of a message becomes negative, it is `killed'
1641 with the effects described for the
1642 .I kill
1643 command;
1644 otherwise if it was negative before and becomes positive,
1645 it is `unkilled'.
1646 Scores only refer to the currently opened instance of a folder.
1648 .B set
1649 (se) With no arguments, prints all variable values,
1650 piped through the pager if the output does not fit on the screen.
1651 Otherwise, sets option.
1652 Arguments are of the form option=value
1653 (no space before or after =)
1654 or option.
1655 Quotation marks may be placed around any part of the
1656 assignment statement to quote blanks
1657 or tabs, i.\|e. `\fIset indentprefix="\->"\fR'.
1658 If an argument begins with
1659 .BR no ,
1660 as in `\fBset no\fIsave\fR',
1661 the effect is the same as invoking the
1662 .I unset
1663 command with the remaining part of the variable
1664 (`\fIunset \fIsave\fR').
1666 .B seen
1667 Takes a message list and marks all messages as having been read.
1669 .B shell
1670 (sh) Invokes an interactive version of the shell.
1672 .B shortcut
1673 Defines a shortcut name and its string for expansion,
1674 as described for the
1675 .I folder
1676 command.
1677 With no arguments,
1678 a list of defined shortcuts is printed.
1680 .B show
1681 (Sh) Like
1682 .IR print ,
1683 but performs neither MIME decoding nor decryption
1684 so that the raw message text is shown.
1686 .B size
1687 Takes a message list and prints out
1688 the size in characters of each message.
1690 .B sort
1691 Create a sorted representation of the current folder,
1692 and change the
1693 .I next
1694 command and the addressing modes
1695 such that they refer to messages in the sorted order.
1696 Message numbers are the same as in regular mode.
1697 If the
1698 .I header
1699 variable is set,
1700 a header summary in the new order is also printed.
1701 Possible sorting criteria are:
1704 .B date
1705 Sort the messages by their `Date:' field,
1706 that is by the time they were sent.
1708 .B from
1709 Sort messages by the value of their `From:' field,
1710 that is by the address of the sender.
1711 If the
1712 .I showname
1713 variable is set,
1714 the sender's real name (if any) is used.
1716 .B size
1717 Sort the messages by their size.
1719 .B score
1720 Sort the messages by their score.
1722 .B status
1723 Sort the messages by their message status
1724 (new, read, old, etc.).
1726 .B subject
1727 Sort the messages by their subject.
1729 .B thread
1730 Create a threaded order,
1731 as with the
1732 .I thread
1733 command.
1735 .B to
1736 Sort messages by the value of their `To:' field,
1737 that is by the address of the recipient.
1738 If the
1739 .I showname
1740 variable is set,
1741 the recipient's real name (if any) is used.
1744 If no argument is given,
1745 the current sorting criterion is printed.
1747 .B source
1748 The source command reads commands from a file.
1750 .B thread
1751 (th) Create a threaded representation of the current folder,
1752 i.\|e. indent messages that are replies to other messages
1753 in the header display,
1754 and change the
1755 .I next
1756 command and the addressing modes
1757 such that they refer to messages in the threaded order.
1758 Message numbers are the same as in unthreaded mode.
1759 If the
1760 .I header
1761 variable is set,
1762 a header summary in threaded order is also printed.
1764 .B top
1765 Takes a message list and prints the top few lines of each.
1766 The number of lines printed is controlled
1767 by the variable toplines
1768 and defaults to five.
1770 .B touch
1771 Takes a message list
1772 and marks the messages for saving in the
1773 .I mbox
1774 file.
1775 \*(UA deviates from the POSIX standard with this command,
1776 as a `next' command issued after `mbox'
1777 will display the following message,
1778 not the current one.
1780 .B Type
1781 (T) Identical to the Print command.
1783 .B type
1784 (t) A synonym for print.
1786 .B unalias
1787 Takes a list of names defined by alias commands
1788 and discards the remembered groups of users.
1789 The group names no longer have any significance.
1791 .B unanswered
1792 Takes a message list and marks each message
1793 as not having been answered.
1795 .B uncollapse
1796 (unc)
1797 Only applicable to threaded mode.
1798 Takes a message list
1799 and makes the message and all replies to it visible
1800 in header summaries again.
1801 When a message becomes the current message,
1802 it is automatically made visible.
1803 Also when a message with collapsed replies is printed,
1804 all of these are automatically uncollapsed.
1806 .B undef
1807 Undefines each of the named macros.
1808 It is not an error to use a name that does not belong to
1809 one of the currently defined macros.
1811 .B undelete
1812 (u) Takes a message list and marks each message as not being deleted.
1814 .B undraft
1815 Takes a message list and marks each message
1816 as a draft.
1818 .B unflag
1819 Takes a message list and marks each message as not being `flagged'.
1821 .B unfwdignore
1822 Removes the header field names
1823 from the list of ignored fields for the
1824 .I forward
1825 command.
1827 .B unfwdretain
1828 Removes the header field names
1829 from the list of retained fields for the
1830 .I forward
1831 command.
1833 .B ungood
1834 Takes a message list and undoes the effect of a
1835 .I good
1836 command that was previously applied on exactly these messages.
1838 .B unignore
1839 Removes the header field names
1840 from the list of ignored fields.
1842 .B unjunk
1843 Takes a message list and undoes the effect of a
1844 .I junk
1845 command that was previously applied on exactly these messages.
1847 .B unkill
1848 Takes a message list and `unkills' each message.
1849 Also sets the score of the messages to 0.
1851 .B Unread
1852 Same as
1853 .IR unread .
1855 .B unread
1856 (U) Takes a message list and marks each message
1857 as not having been read.
1859 .B unretain
1860 Removes the header field names
1861 from the list of retained fields.
1863 .B unsaveignore
1864 Removes the header field names
1865 from the list of ignored fields for saving.
1867 .B unsaveretain
1868 Removes the header field names
1869 from the list of retained fields for saving.
1871 .B unset
1872 Takes a list of option names and discards their remembered
1873 values;
1874 the inverse of set.
1876 .B unshortcut
1877 Deletes the shortcut names given as arguments.
1879 .B unsort
1880 Disable sorted or threaded mode (see the
1881 .I sort
1883 .I thread
1884 commands), return to normal message order
1885 and,
1886 if the
1887 .I header
1888 variable is set,
1889 print a header summary.
1891 .B unthread
1892 (unth) Same as
1893 .IR unsort .
1895 .B verify
1896 (verif)
1897 Takes a message list and verifies each message.
1898 If a message is not an S/MIME signed message,
1899 verification will fail for it.
1900 The verification process checks
1901 if the message was signed using a valid certificate,
1902 if the message sender's email address matches
1903 one of those contained within the certificate,
1904 and if the message content has been altered.
1906 .B visual
1907 (v) Takes a message list and invokes the display editor
1908 on each message.
1909 Modified contents are discarded
1910 unless the
1911 .I writebackedited
1912 variable is set.
1914 .B write
1915 (w) For conventional messages,
1916 the body without all headers is written.
1917 The output is decrypted and converted
1918 to its native format, if necessary.
1919 If the output file exists,
1920 the text is appended.\(emIf a message is in MIME multipart format,
1921 its first part is written to the specified file
1922 as for conventional messages,
1923 and the user is asked for a filename
1924 to save each other part;
1925 if the contents of the first part are not to be saved,
1926 `write /dev/null' can be used.
1927 For the second and subsequent parts,
1928 if the filename given starts with a `|' character,
1929 the part is piped through the remainder of the filename
1930 interpreted as a shell command.
1931 In non-interactive mode, only the parts of the multipart message
1932 that have a filename given in the part header are written,
1933 the other are discarded.
1934 The original message is never marked for deletion
1935 in the originating mail folder.
1936 For attachments,
1937 the contents of the destination file are overwritten
1938 if the file previously existed.
1939 No special handling of compressed files is performed.
1941 .B xit
1942 (x) A synonym for exit.
1944 .B z
1945 \*(UA presents message headers in windowfuls
1946 as described under the headers command.
1947 The z command scrolls to the next window of messages.
1948 If an argument is given,
1949 it specifies the window to use.
1950 A number prefixed by `+' or `\-' indicates
1951 that the window is calculated in relation
1952 to the current position.
1953 A number without a prefix specifies an
1954 absolute window number,
1955 and a `$' lets \*(UA scroll
1956 to the last window of messages.
1958 .B Z
1959 Similar to
1960 .IR z ,
1961 but scrolls to the next or previous window
1962 that contains at least one new or `flagged' message.
1963 .SS "Tilde escapes"
1964 Here is a summary of the tilde escapes,
1965 which are used when composing
1966 messages to perform special functions.
1967 Tilde escapes are only recognized
1968 at the beginning of lines.
1969 The name `\fItilde escape\fR' is somewhat of a misnomer
1970 since the actual escape character can be set
1971 by the option escape.
1973 .BI ~! command
1974 Execute the indicated shell command,
1975 then return to the message.
1977 .B ~.
1978 Same effect as typing the end-of-file character.
1980 .BI ~< filename
1981 Identical to ~r.
1983 .BI ~<! command
1984 Command is executed using the shell.
1985 Its standard output is inserted into the message.
1987 \fB~@\fR [\fIfilename\fR .\ .\ . ]
1988 With no arguments, edit the attachment list.
1989 First, the user can edit all existing attachment data.
1990 If an attachment's file name is left empty,
1991 that attachment is deleted from the list.
1992 When the end of the attachment list is reached,
1993 \*(UA will ask for further attachments,
1994 until an empty file name is given.
1995 If \fIfilename\fP arguments are specified,
1996 all of them are appended to the end of the attachment list.
1997 Filenames which contain white space
1998 can only be specified
1999 with the first method (no \fIfilename\fP arguments).
2001 .B ~A
2002 Inserts the string contained in the
2003 .I Sign
2004 variable
2005 (same as `~i Sign').
2006 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2007 are understood.
2009 .B ~a
2010 Inserts the string contained in the
2011 .B sign
2012 variable
2013 (same as `~i sign').
2014 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2015 are understood.
2017 .BI ~b "name .\ .\ ."
2018 Add the given names to the list of carbon copy recipients
2019 but do not make the names visible in the Cc: line
2020 (`blind' carbon copy).
2022 .BI ~c "name .\ .\ ."
2023 Add the given names to the list of carbon copy recipients.
2025 .B ~d
2026 Read the file `dead.letter' from the user's home directory
2027 into the message.
2029 .B ~e
2030 Invoke the text editor on the message collected so far.
2031 After the editing session is finished,
2032 the user may continue appending text
2033 to the message.
2035 .BI ~f messages
2036 Read the named messages into the message being sent.
2037 If no messages are specified,
2038 read in the current message.
2039 Message headers currently being ignored
2040 (by the ignore or retain command)
2041 are not included.
2042 For MIME multipart messages,
2043 only the first printable part is included.
2045 .BI ~F messages
2046 Identical to ~f, except all message headers and
2047 all MIME parts are included.
2049 .B ~h
2050 Edit the message header fields
2051 `To:', `Cc:', `Bcc:', and `Subject:'
2052 by typing each one in turn
2053 and allowing the user to append text
2054 to the end or modify the field
2055 by using the current terminal erase and kill characters.
2057 .B ~H
2058 Edit the message header fields
2059 `From:', `Reply-To:', `Sender:', and `Organization:'
2060 in the same manner as described for
2061 .IR ~h .
2062 The default values for these fields originate from the
2063 .IR from ,
2064 .IR replyto ,
2066 .I ORGANIZATION
2067 variables.
2068 If this tilde command has been used,
2069 changing the variables has no effect on the current message anymore.
2071 .BI ~i variable
2072 Insert the value of the specified variable
2073 into the message adding a newline character at the end.
2074 If the variable is unset or empty,
2075 the message remains unaltered.
2076 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
2077 are understood.
2079 .BI ~m messages
2080 Read the named messages into the message being sent,
2081 indented by a tab or by the value of indentprefix.
2082 If no messages are specified,
2083 read the current message.
2084 Message headers currently being ignored
2085 (by the ignore or retain command)
2086 are not included.
2087 For MIME multipart messages,
2088 only the first printable part is included.
2090 .BI ~M messages
2091 Identical to ~m, except all message headers and
2092 all MIME parts are included.
2094 .B ~p
2095 Print out the message collected so far,
2096 prefaced by the message header fields
2097 and followed by the attachment list, if any.
2098 If the message text is longer than the screen size,
2099 it is piped through the pager.
2101 .B ~q
2102 Abort the message being sent,
2103 copying the message to
2104 `dead.letter' in the user's home directory
2105 if save is set.
2107 .BI ~r filename
2108 Read the named file into the message.
2110 .BI ~s string
2111 Cause the named string to become the current subject field.
2113 .BI ~t "name .\ .\ ."
2114 Add the given names to the direct recipient list.
2116 .B ~v
2117 Invoke an alternate editor
2118 (defined by the VISUAL option)
2119 on the message collected so far.
2120 Usually, the alternate editor
2121 will be a screen editor.
2122 After the editor is quit,
2123 the user may resume appending text
2124 to the end of the message.
2126 .BI ~w filename
2127 Write the message onto the named file.
2128 If the file exists,
2129 the message is appended to it.
2131 .B ~x
2132 Same as ~q,
2133 except that the message is not saved to the `dead.letter' file.
2135 .BI ~| command
2136 Pipe the message through the command as a filter.
2137 If the command gives no output or terminates abnormally,
2138 retain the original text of the message.
2139 The command
2140 .IR fmt (1)
2141 is often used
2142 as command to rejustify the message.
2144 .BI ~: \*(ua-command
2145 Execute the given \*(UA command.
2146 Not all commands, however, are allowed.
2148 .BI ~_ \*(ua-command
2149 Identical to ~:.
2151 .BI ~~ string
2152 Insert the string of text in the message
2153 prefaced by a single ~.
2154 If the escape character has been changed,
2155 that character must be doubled
2156 in order to send it at the beginning of a line.
2157 .SS "Variable options"
2158 Options are controlled via set and unset commands,
2159 see their entries for a syntax description.
2160 An option is also set
2161 if it is passed to \*(UA
2162 as part of the environment
2163 (this is not restricted to specific variables as in the POSIX standard).
2164 A value given in a startup file overrides
2165 a value imported from the environment.
2166 Options may be either binary,
2167 in which case it is only significant
2168 to see whether they are set or not;
2169 or string, in which case the actual value is of interest.
2170 .SS "Binary options"
2172 The binary options include the following:
2174 .B add-file-recipients
2175 When file or pipe recipients have been specified,
2176 mention them in the corresponding address fields of the message instead of
2177 silently stripping them from their recipient list.
2178 By default such addressees are not mentioned.
2180 .B allnet
2181 Causes only the local part to be evaluated
2182 when comparing addresses.
2184 .B append
2185 Causes messages saved in mbox to be appended to the end
2186 rather than prepended.
2187 This should always be set.
2189 .BR ask \ or \ asksub
2190 Causes \*(UA to prompt for the subject
2191 of each message sent.
2192 If the user responds with simply a newline,
2193 no subject field will be sent.
2195 .B askatend
2196 Causes the prompts for `Cc:' and `Bcc:' lists
2197 to appear after the message has been edited.
2199 .B askattach
2200 If set, \*(UA asks for files to attach at the end of each message.
2201 Responding with a newline indicates not to include an attachment.
2203 .B askcc
2204 Causes the user to be prompted
2205 for additional carbon copy recipients
2206 (at the end of each message if
2207 .I askatend
2209 .I bsdcompat
2210 is set).
2211 Responding with a newline
2212 indicates the user's satisfaction with the current list.
2214 .B askbcc
2215 Causes the user to be prompted
2216 for additional blind carbon copy recipients
2217 (at the end of each message if
2218 .I askatend
2220 .I bsdcompat
2221 is set).
2222 Responding with a newline
2223 indicates the user's satisfaction with the current list.
2225 .B asksign
2226 Causes the user to be prompted
2227 if the message is to be signed
2228 at the end of each message.
2230 .I smime-sign
2231 variable is ignored when this variable is set.
2233 .B autocollapse
2234 Causes threads to be collapsed automatically when
2235 threaded mode is entered
2236 (see the
2237 .I collapse
2238 command).
2240 .B autoinc
2241 Same as
2242 .IR newmail .
2244 .B autoprint
2245 Causes the delete command to behave like dp \-
2246 thus, after deleting a message,
2247 the next one will be typed automatically.
2249 .B autothread
2250 Causes threaded mode (see the
2251 .I thread
2252 command) to be entered automatically
2253 when a folder is opened.
2255 .B bang
2256 Enables the substitution of `\fB!\fR'
2257 by the contents of the last command line
2258 in shell escapes.
2260 .B bsdannounce
2261 Causes automatic display of a header summary after executing a
2262 .I folder
2263 command.
2265 .B bsdcompat
2266 Sets some cosmetical features to traditional BSD style;
2267 has the same affect as setting `askatend' and
2268 all other variables prefixed with `bsd',
2269 setting prompt to `&\ ', and changing the default pager to
2270 .IR more .
2272 .B bsdflags
2273 Changes the letters printed in the first column of a header summary
2274 to traditional BSD style.
2276 .B bsdheadline
2277 Changes the display of columns in a header summary
2278 to traditional BSD style.
2280 .B bsdmsgs
2281 Changes some informational messages
2282 to traditional BSD style.
2284 .B bsdorder
2285 Causes the `Subject:' field to appear
2286 immediately after the `To:' field
2287 in message headers and with the
2288 .I ~h
2289 tilde command.
2291 .B bsdset
2292 Changes the output format of the
2293 .I set
2294 command to traditional BSD style.
2296 .B chained-junk-tokens
2297 Normally, the Bayesian junk mail filter bases its classifications
2298 on single word tokens extracted from messages.
2299 If this option is set,
2300 adjacent words are combined to pairs,
2301 which are then used as additional tokens.
2302 This usually improves the accuracy of the filter,
2303 but also increases the junk mail database
2304 five- to tenfold.
2306 .B datefield
2307 The date in a header summary
2308 is normally the date of the mailbox `From\ ' line of the message.
2309 If this variable is set,
2310 the date as given in the `Date:' header field is used,
2311 converted to local time.
2313 .B debug
2314 Prints debugging messages and disables the actual delivery of messages.
2315 Unlike
2316 .IR verbose ,
2317 this option is intended for \*(UA development only.
2319 .B disconnected
2320 When an IMAP mailbox is selected and this variable is set,
2321 no connection to the server is initiated.
2322 Instead, data is obtained from the local cache (see
2323 .IR imap-cache ).
2324 Mailboxes that are not present in the cache
2325 and messages that have not yet entirely been fetched from the server
2326 are not available;
2327 to fetch all messages in a mailbox at once,
2328 the command `copy * /dev/null' can be used
2329 while still in
2330 .I online
2331 mode.
2332 Changes that are made to IMAP mailboxes in disconnected mode
2333 are queued and committed later
2334 when a connection to that server is opened in online mode.
2335 This procedure is not completely reliable
2336 since it cannot be guaranteed that the IMAP unique identifiers (UIDs)
2337 on the server still match the ones in the cache at that time.
2338 Data is saved to `dead.letter' when this problem occurs.
2340 \fBdisconnected-\fIuser\fB@\fIhost\fR
2341 The specified account is handled as described for the
2342 .I disconnected
2343 variable above,
2344 but other accounts are not affected.
2346 .B dot
2347 The binary option dot causes \*(UA to interpret
2348 a period alone on a line
2349 as the terminator of a message the user is sending.
2351 .B editheaders
2352 When a message is edited while being composed,
2353 its header is included in the editable text.
2354 `To:', `Cc:', `Bcc:', `Subject:', `From:', `Reply-To:', `Sender:',
2355 and 'Organization:'
2356 fields are accepted within the header,
2357 other fields are ignored.
2359 .B emptybox
2360 If set, an empty mailbox file is not removed.
2361 This may improve the interoperability with other mail user agents
2362 when using a common folder directory.
2364 .B emptystart
2365 If the mailbox is empty,
2366 \*(UA normally prints \fI`No mail for user'\fR
2367 and exits immediately.
2368 If this option is set,
2369 \*(UA starts even with an empty mailbox.
2371 .B flipr
2372 Exchanges the
2373 .I Respond
2374 with the
2375 .I respond
2376 commands and vice-versa.
2378 .B forward-as-attachment
2379 Original messages are normally sent as inline text with the
2380 .I forward
2381 command,
2382 and only the first part of a multipart message is included.
2383 With this option,
2384 messages are sent as MIME
2385 .I message/rfc822
2386 attachments,
2387 and all of their parts are included.
2389 .I fwdignore
2391 .I fwdretain
2392 options are ignored when the
2393 .I forward-as-attachment
2394 option is set.
2396 .B fullnames
2397 When replying to a message,
2398 \*(UA normally removes the comment parts of email addresses,
2399 which by convention contain the full names of the recipients.
2400 If this variable is set,
2401 such stripping is not performed,
2402 and comments are retained.
2404 .B header
2405 Causes the header summary to be written at startup
2406 and after commands that affect the number of messages
2407 or the order of messages in the current folder;
2408 enabled by default.
2410 .B hold
2411 This option is used to hold messages
2412 in the system mailbox by default.
2414 .B ignore
2415 Causes interrupt signals from the terminal
2416 to be ignored and echoed as @'s.
2418 .B ignoreeof
2419 An option related to dot is ignoreeof
2420 which makes \*(UA refuse to
2421 accept a control-d as the end of a message.
2422 Ignoreeof also applies to \*(UA command mode.
2424 .B imap-use-starttls
2425 Causes \*(UA to issue a STARTTLS command
2426 to make an unencrypted IMAP session SSL/TLS encrypted.
2427 This functionality is not supported by all servers,
2428 and is not used if the session is already encrypted by the IMAPS method.
2430 \fBimap-use-starttls-\fIuser\fB@\fIhost\fR
2431 Activates
2432 .I imap-use-starttls
2433 for a specific account.
2435 .B keep
2436 This option causes \*(UA to truncate the user's system mailbox
2437 instead of deleting it when it is empty.
2438 This should always be set,
2439 since it prevents malicious users
2440 from creating fake mail folders
2441 in a world-writable spool directory.
2443 .B keepsave
2444 When a message is saved,
2445 it is usually discarded
2446 from the originating folder
2447 when \*(UA is quit.
2448 Setting this option
2449 causes all saved message to be retained.
2451 .B markanswered
2452 When a message is replied to
2453 and this variable is set,
2454 it is marked as having been answered.
2455 This mark has no technical meaning in the mail system;
2456 it just causes messages to be marked in the header summary,
2457 and makes them specially addressable.
2459 .B metoo
2460 Usually, when a group is expanded
2461 that contains the sender,
2462 the sender is removed from the expansion.
2463 Setting this option causes
2464 the sender to be included in the group.
2466 .B newmail
2467 Checks for new mail in the current folder
2468 each time the prompt is printed.
2469 For IMAP mailboxes,
2470 the server is then polled for new mail,
2471 which may result in delayed operation
2472 if the connection to the server is slow.
2474 .I maildir
2475 folder must be re-scanned to determine
2476 if new mail has arrived.
2478 If this variable is set to the special value
2479 .BR nopoll ,
2480 an IMAP server is not actively asked for new mail,
2481 but new mail may still be detected and announced
2482 with any other IMAP command that is sent to the server.
2484 .I maildir
2485 folder is not scanned then.
2487 In any case,
2488 the IMAP server may send notifications about messages
2489 that have been deleted on the server
2490 by another process or client.
2491 In this case, `Expunged \fIn\fR messages' is printed
2492 regardless of this variable,
2493 and message numbers may have changed.
2495 .B noheader
2496 Setting the option noheader is the same
2497 as giving the \-N flag on the command line.
2499 .B outfolder
2500 Causes the filename given in the
2501 .I record
2502 variable
2503 and the sender-based filenames for the
2504 .I Copy
2506 .I Save
2507 commands
2508 to be interpreted relative to the directory given in the
2509 .I folder
2510 variable rather than to the current directory
2511 unless it is an absolute pathname.
2513 .B page
2514 If set, each message the \fIpipe\fR command prints out
2515 is followed by a formfeed character.
2517 .B piperaw
2518 Send messages to the
2519 .I pipe
2520 command without performing MIME and character set conversions.
2522 .B pop3-use-apop
2523 If this variable is set,
2524 the APOP authentication method is used
2525 when a connection to a POP3 server is initiated.
2526 The advantage of this method over the usual USER/PASS authentication is
2527 that the password is not sent over the network in clear text.
2528 The connection fails
2529 if the server does not support the APOP command.
2531 \fBpop3-use-apop-\fIuser\fB@\fIhost\fR
2532 Enables
2533 .I pop3-use-apop
2534 for a specific account.
2536 .B pop3-use-starttls
2537 Causes \*(UA to issue a STLS command
2538 to make an unencrypted POP3 session SSL/TLS encrypted.
2539 This functionality is not supported by all servers,
2540 and is not used if the session is already encrypted by the POP3S method.
2542 \fBpop3-use-starttls-\fIuser\fB@\fIhost\fR
2543 Activates
2544 .I pop3-use-starttls
2545 for a specific account.
2547 .B print-all-chars
2548 This option causes all characters to be considered printable.
2549 It is only effective if given in a startup file.
2550 With this option set,
2551 some character sequences in messages
2552 may put the user's terminal in an undefined state
2553 when printed;
2554 it should only be used as a last resort
2555 if no working system locale can be found.
2557 .B print-alternatives
2558 When a MIME message part of type
2559 .I multipart/alternative
2560 is displayed and it contains a subpart of type
2561 .IR text/plain ,
2562 other parts are normally discarded.
2563 Setting this variable causes all subparts to be displayed,
2564 just as if the surrounding part was of type
2565 .IR multipart/mixed .
2567 .B quiet
2568 Suppresses the printing of the version when first invoked.
2570 .B recipients-in-cc
2571 On group replies, specify only the sender of the original mail
2572 in \fI`To:'\fR and mention it's other recipients in the secondary
2573 \fI`Cc:'\fR.
2575 .B record-resent
2576 If both this variable and the
2577 .I record
2578 variable are set,
2580 .I resend
2582 .I Resend
2583 commands save messages to the
2584 .I record
2585 folder as it is normally only done for newly composed messages.
2587 .B reply-in-same-charset
2588 If this variable is set,
2589 \*(UA first tries to use the same character set
2590 of the original message for replies.
2591 If this fails,
2593 .I sendcharsets
2594 variable is evaluated as usual.
2596 .B Replyall
2597 Reverses the sense of reply and Reply commands.
2599 .B save
2600 When the user aborts a message
2601 with two RUBOUT (interrupt characters)
2602 \*(UA copies the partial letter
2603 to the file `dead.letter' in the home directory.
2604 This option is set by default.
2606 .B searchheaders
2607 If this option is set, then
2608 a message-list specifier in the form `\fI/x:y\fR'
2609 will expand to all messages containing
2610 the substring `\fIy\fR' in the header field `\fIx\fR'.
2611 The string search is case insensitive.
2613 .B sendwait
2614 When sending a message,
2615 wait until the mail transfer agent exits
2616 before accepting further commands.
2617 If the mail transfer agent returns a non-zero exit status,
2618 the exit status of \*(ua will also be non-zero.
2620 .B showlast
2621 Setting this option causes \*(UA to start at the
2622 last message instead of the first one when opening a mail folder.
2624 .B showname
2625 Causes \*(UA
2626 to use the sender's real name instead of the plain address
2627 in the header field summary and in message specifications.
2629 .B showto
2630 Causes the recipient of the message to be shown in the header summary
2631 if the message was sent by the user.
2633 .B skipemptybody
2634 If an outgoing message does not contain any text
2635 in its first or only message part,
2636 do not send it but discard it silently
2637 (see also the
2638 .I \-E
2639 option).
2641 .B smime-force-encryption
2642 Causes \*(UA
2643 to refuse sending unencrypted messages.
2645 .B smime-sign
2646 If this variable is set,
2647 outgoing messages are S/MIME signed with the user's private key.
2648 Signing a message enables a recipient to verify
2649 that the sender used a valid certificate,
2650 that the email addresses in the certificate
2651 match those in the message header,
2652 and that the message content has not been altered.
2653 It does not change the message text,
2654 and people will be able to read the message as usual.
2656 .B smime-no-default-ca
2657 Do not load the default CA locations
2658 when verifying S/MIME signed messages.
2659 Only applicable if S/MIME support is built using OpenSSL.
2661 .B smtp-use-starttls
2662 Causes \*(UA to issue a STARTTLS command
2663 to make an SMTP session SSL/TLS encrypted.
2664 Not all servers support this command;
2665 because of common implementation defects,
2666 it cannot be automatically determined
2667 whether a server supports it or not.
2669 .B ssl-no-default-ca
2670 Do not load the default CA locations
2671 to verify SSL/TLS server certificates.
2672 Only applicable if SSL/TLS support is built using OpenSSL.
2674 .B ssl-v2-allow
2675 Accept SSLv2 connections.
2676 These are normally not allowed
2677 because this protocol version is insecure.
2679 .B verbose
2680 Setting the option verbose is the same
2681 as using the \-v flag on the command line.
2682 When \*(UA runs in verbose mode,
2683 details of the actual message delivery
2684 and protocol conversations for IMAP, POP3, and SMTP,
2685 as well as of other internal processes,
2686 are displayed on the user's terminal,
2687 This is sometimes useful to debug problems.
2688 \*(UA prints all data that is sent to remote servers in clear texts,
2689 including passwords,
2690 so care should be taken that no unauthorized option
2691 can view the screen if this option is enabled.
2693 .B writebackedited
2694 If this variable is set,
2695 messages modified using the
2696 .I edit
2698 .I visual
2699 commands are written back to the current folder when it is quit.
2700 This is only possible for writable folders in
2701 .I mbox
2702 format.
2703 Setting this variable also disables
2704 MIME decoding and decryption for the editing commands.
2705 .SS "String Options"
2707 The string options include the following:
2709 .B attrlist
2710 A sequence of characters to print in the `attribute'
2711 column of a header summary,
2712 each for one type of messages in the following order:
2713 new,
2714 unread but old,
2715 new but read,
2716 read and old,
2717 saved,
2718 preserved,
2719 mboxed,
2720 flagged,
2721 answered,
2722 draft,
2723 killed,
2724 start of a collapsed thread,
2725 collapsed,
2726 classified as junk.
2727 The default is `NUROSPMFATK+\-J',
2728 or `NU\ \ *HMFATK+\-J' if
2729 .I bsdflags
2730 or the
2731 .I SYSV3
2732 environment variable
2733 are set.
2735 .B autobcc
2736 Specifies a list of recipients to which
2737 a blind carbon copy of each outgoing message
2738 will be sent automatically.
2740 .B autocc
2741 Specifies a list of recipients to which
2742 a carbon copy of each outgoing message
2743 will be sent automatically.
2745 .B autosort
2746 Causes sorted mode (see the
2747 .I sort
2748 command) to be entered automatically
2749 with the value of this option as sorting method
2750 when a folder is opened.
2752 .B cmd
2753 The default value for the \fIpipe\fR command.
2755 .B crt
2756 The valued option crt is used as a threshold
2757 to determine how long a message must be
2758 before PAGER is used to read it.
2759 If crt is set without a value,
2760 then the height of the terminal screen stored in the system
2761 is used to compute the threshold (see
2762 .IR stty (1)).
2764 .B DEAD
2765 The name of the file to use
2766 for saving aborted messages.
2767 This defaults to `dead.letter'
2768 in the user's home directory.
2770 .B EDITOR
2771 Pathname of the text editor to use
2772 in the edit command and ~e escape.
2773 If not defined,
2774 then a default editor is used.
2776 .B encoding
2777 The default MIME encoding to use
2778 in outgoing text messages and message parts.
2779 Valid values are \fI8bit\fR or \fIquoted-printable\fR.
2780 The default is \fI8bit\fR.
2781 In case the mail transfer system
2782 is not ESMTP compliant,
2783 \fIquoted-printable\fR should be used instead.
2784 If there is no need to encode a message,
2785 \fI7bit\fR transfer mode is used,
2786 without regard to the value of this variable.
2787 Binary data is always encoded in \fIbase64\fR mode.
2789 .B escape
2790 If defined, the first character of this option
2791 gives the character to use in the place of ~ to denote escapes.
2793 .B folder
2794 The name of the directory to use
2795 for storing folders of messages.
2796 All folder names that begin with `+'
2797 refer to files below that directory.
2798 If the directory name begins with a `/',
2799 \*(UA considers it to be an absolute pathname;
2800 otherwise, the folder directory is found
2801 relative to the user's home directory.
2803 The directory name may also refer to an IMAP account;
2804 any names that begin with `+'
2805 then refer to IMAP mailboxes on that account.
2806 An IMAP folder is normally given in the form
2809     imaps://mylogin@imap.myisp.example
2812 In this case,
2813 the `+' and `@' prefixes for folder names
2814 have the same effect
2815 (see the
2816 .I folder
2817 command).
2819 Some IMAP servers do not accept the creation of mailboxes
2820 in the hierarchy base;
2821 they require that they are created as subfolders of `INBOX'.
2822 With such servers,
2823 a folder name of the form
2826     imaps://mylogin@imap.myisp.example/INBOX.\&
2829 should be used
2830 (the last character is the server's hierarchy delimiter).
2831 Folder names prefixed by `+' will then refer to folders below `INBOX',
2832 while folder names prefixed by `@'
2833 refer to folders below the hierarchy base.
2834 See the
2835 .I imap namespace
2836 command for a method to detect the appropriate prefix and delimiter.
2838 .B folder-hook
2839 When a folder is opened and this variable is set,
2840 the macro corresponding to the value of this variable is executed.
2841 The macro is also invoked when new mail arrives,
2842 but message lists for commands executed from the macro
2843 only include newly arrived messages then.
2845 \fBfolder-hook-\fIfullname\fR
2846 When a folder named
2847 .I fullname
2848 is opened,
2849 the macro corresponding to the value of this variable is executed.
2850 Unlike other folder specifications,
2851 the fully expanded name of a folder, without metacharacters,
2852 is used to avoid ambiguities.
2853 The macro specified with
2854 .I folder-hook
2855 is not executed if this variable is effective for a folder
2856 (unless it is explicitly invoked within the called macro).
2858 .B from
2859 The address (or a list of addresses)
2860 to put into the \fI`From:'\fR field of the message header.
2861 If replying to a message,
2862 these addresses are handled as if they were in the alternates list.
2863 .\" If this variable is set,
2864 .\" a \fI`Sender:'\fR field containing the user's name
2865 .\" is also generated,
2866 .\" unless the variable \fIsmtp\fR is set
2867 .\" and its value differs from \fIlocalhost\fR.
2868 If the machine's hostname is not valid at the Internet
2869 (for example at a dialup machine),
2870 either this variable or
2871 .I hostname
2872 have to be set or \*(UA will not generate Message-ID header fields
2873 but leave that task up to a (obviously present) local Mail Transfer
2874 Agent (MTA).
2876 .I from
2877 contains more than one address,
2879 .I sender
2880 variable must also be set.
2882 .B fwdheading
2883 The string to print before the text of a message
2884 with the
2885 .I forward
2886 command
2887 (unless the
2888 .I forward-as-attachment
2889 variable is set).
2890 Defaults to ``-------- Original Message --------'' if unset.
2891 If it is set to the empty string,
2892 no heading is printed.
2894 .B headline
2895 A format string to use for the header summary,
2896 similar to
2897 .I printf
2898 formats.
2899 A `%' character introduces a format specifier.
2900 It may be followed by a number indicating the field width.
2901 If the field is a number,
2902 the width may be negative,
2903 which indicates that it is to be left-aligned.
2904 Valid format specifiers are:
2906 .in +4m
2908 l4fB l.
2909 %a      Message attributes.
2910 %c      The score of the message.
2911 %d      The date when the message was received.
2912 %e      The indenting level in threaded mode.
2913 %f      The address of the message sender.
2914 %i      The message thread structure.
2915 %l      The number of lines of the message.
2916 %m      Message number.
2917 %o      The number of octets (bytes) in the message.
2918 %s      Message subject (if any).
2919 %S      Message subject (if any) in double quotes.
2920 %t      The position in threaded/sorted order.
2921 %>      A `>' for the current message, otherwise ` '.
2922 %<      A `<' for the current message, otherwise ` '.
2923 %%      A `%' character.
2925 .in -4m
2927 The default is `%>\&%a\&%m\ %18f\ %16d\ %4l/%\-5o\ %i%s',
2928 or `%>\&%a\&%m\ %20f\ \ %16d\ %3l/%\-5o\ %i%S' if
2929 .I bsdcompat
2930 is set.
2932 .B hostname
2933 Use this string as hostname
2934 when expanding local addresses instead of the value obtained from
2935 .IR uname (2)
2937 .IR getaddrinfo (3).
2938 Note that this must be set explicitly to become used for the
2939 generation of Message-ID fields.
2941 .B imap-auth
2942 Sets the IMAP authentication method.
2943 Valid values are `login' for the usual password-based authentication
2944 (the default),
2945 `cram-md5', which is a password-based authentication
2946 that does not send the password over the network in clear text,
2947 and `gssapi' for GSSAPI-based authentication.
2949 \fBimap-auth-\fIuser\fB@\fIhost\fR
2950 Sets the IMAP authentication method for a specific account.
2952 .B imap-cache
2953 Enables caching of IMAP mailboxes.
2954 The value of this variable must point to a directory
2955 that is either existent or can be created by \*(UA.
2956 All contents of the cache can be deleted by \*(UA
2957 at any time;
2958 it is not safe to make assumptions about them.
2960 .B imap-keepalive
2961 IMAP servers may close the connection
2962 after a period of inactivity;
2963 the standard requires this to be at least 30 minutes,
2964 but practical experience may vary.
2965 Setting this variable to a numeric
2966 .I value
2967 greater than 0
2968 causes a NOOP command to be sent each
2969 .I value
2970 seconds if no other operation is performed.
2972 .B imap-list-depth
2973 When retrieving the list of folders on an IMAP server, the
2974 .I folders
2975 command stops after it has reached a certain depth
2976 to avoid possible infinite loops.
2977 The value of this variable sets the maximum depth allowed.
2978 The default is 2.
2979 If the folder separator on the current IMAP server is a slash `/',
2980 this variable has no effect,
2981 and the
2982 .I folders
2983 command does not descend to subfolders.
2985 .B indentprefix
2986 String used by the `\fI~m\fR' and `\fI~M\fR' tilde escapes
2987 and by the \fIquote\fR option
2988 for indenting messages,
2989 in place of the normal tab character (^I).
2990 Be sure to quote the value
2991 if it contains spaces or tabs.
2993 .B junkdb
2994 The location of the junk mail database.
2995 The string is treated like a folder name,
2996 as described for the
2997 .I folder
2998 command.
3000 The files in the junk mail database are normally stored in
3001 .IR compress (1)
3002 format for saving space.
3003 If processing time is considered more important,
3004 .IR uncompress (1)
3005 can be used to store them in plain form.
3006 \*(UA will then work using the uncompressed files.
3008 .B LISTER
3009 Pathname of the directory lister
3010 to use in the
3011 .I folders
3012 command
3013 when operating on local mailboxes.
3014 Default is /bin/ls.
3016 .B MAIL
3017 Is used as the user's mailbox, if set.
3018 Otherwise, a system-dependent default is used.
3019 Can be a
3020 \fIprotocol\fB://\fR
3021 string (see the
3022 .I folder
3023 command for more information).
3025 .B MBOX
3026 The name of the mbox file.
3027 It can be the name of a folder.
3028 The default is `\fImbox\fR' in the user's home directory.
3030 .B NAIL_EXTRA_RC
3031 The name of an optional startup file to be read after \*(ur.
3032 This variable is ignored if it is imported from the environment;
3033 it has an effect only if it is set in \*(UR or \*(ur to allow bypassing the
3034 configuration with e. g. `MAILRC=/dev/null'.
3035 Use this file for commands that are not understood by other \*(UA
3036 implementations.
3038 .B NAIL_HEAD
3039 A string to put at the beginning of each new message.
3040 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
3041 are understood.
3043 .B NAIL_TAIL
3044 A string to put at the end of each new message.
3045 The escape sequences `\fB\et\fR' (tabulator) and `\fB\en\fR' (newline)
3046 are understood.
3048 .B maximum-unencoded-line-length
3049 Messages that contain lines longer than the value of this variable
3050 are encoded in quoted-printable
3051 even if they contain only ASCII characters.
3052 The maximum effective value is 950.
3053 If set to 0,
3054 all ASCII text messages are encoded in quoted-printable.
3055 S/MIME signed messages are always encoded
3056 in quoted-printable regardless of the value of this variable.
3058 .B newfolders
3059 If this variable has the value
3060 .BR maildir ,
3061 newly created local folders will be in
3062 .I maildir
3063 format.
3065 .B nss-config-dir
3066 A directory that contains the files
3067 .RI cert N .db
3068 to retrieve certificates,
3069 .RI key N .db
3070 to retrieve private keys,
3071 and secmod.db,
3072 where
3073 .I N
3074 is a digit.
3075 These are usually taken from Mozilla installations,
3076 so an appropriate value might be
3077 `~/.mozilla/firefox/default.clm'.
3078 \*(UA opens these files read-only
3079 and does not modify them.
3080 However, if the files are modified by Mozilla
3081 while \*(UA is running,
3082 it will print a `Bad database' message.
3083 It may be necessary to create copies of these files
3084 that are exclusively used by \*(UA then.
3085 Only applicable if S/MIME and SSL/TLS support is built using
3086 Network Security Services (NSS).
3088 .B ORGANIZATION
3089 The value to put into the \fI`Organization:'\fR field of the message header.
3091 .B PAGER
3092 Pathname of the program to use
3093 in the more command
3094 or when crt variable is set.
3095 The default paginator
3096 .IR pg (1)
3097 or, in BSD compatibility mode,
3098 .IR more (1)
3099 is used
3100 if this option is not defined.
3102 \fBpassword-\fIuser\fB@\fIhost\fR
3103 Set the password for
3104 .I user
3105 when connecting to
3106 .IR host .
3107 If no such variable is defined for a host,
3108 the user will be asked for a password on standard input.
3109 Specifying passwords in a startup file
3110 is generally a security risk,
3111 the file should be readable
3112 by the invoking user only.
3114 .BI pipe- content/subcontent
3115 When a MIME message part of
3116 .I content/subcontent
3117 type is displayed or it is replied to,
3118 its text is filtered through the value of this variable
3119 interpreted as a shell command.
3120 Special care must be taken when using such commands
3121 as mail viruses may be distributed by this method;
3122 if messages of type
3123 .I application/x-sh
3124 were filtered through the shell, for example,
3125 a message sender could easily execute arbitrary code
3126 on the system \*(UA is running on.
3128 .B pop3-keepalive
3129 POP3 servers may close the connection
3130 after a period of inactivity;
3131 the standard requires this to be at least 10 minutes,
3132 but practical experience may vary.
3133 Setting this variable to a numeric
3134 .I value
3135 greater than 0
3136 causes a NOOP command to be sent each
3137 .I value
3138 seconds if no other operation is performed.
3140 .B prompt
3141 The string printed when a command is accepted.
3142 Defaults to `\fB?\ \fR',
3143 or to `\fB&\ \fR' if the
3144 .I bsdcompat
3145 variable is set.
3147 .B quote
3148 If set, \*(UA starts a replying message with the original message
3149 prefixed by the value of the variable \fIindentprefix\fR.
3150 Normally, a heading consisting of `Fromheaderfield wrote:' is printed
3151 before the quotation.
3152 If the string \fInoheading\fR is assigned to the \fIquote\fR variable,
3153 this heading is omitted.
3154 If the string \fIheaders\fR is assigned,
3155 the headers selected by the ignore/retain commands
3156 are printed above the message body,
3157 thus \fIquote\fR acts like an automatic ~m command then.
3158 If the string \fIallheaders\fR is assigned,
3159 all headers are printed above the message body,
3160 and all MIME parts are included,
3161 thus \fIquote\fR acts like an automatic ~M command then.
3163 .B quote-fold
3164 If set in addition to \fIindentprefix\fR, \*(UA interprets this
3165 number as the maximum line length of the quotation when replying to a
3166 message.
3167 Setting this turns on a more fancy quotation algorithm in that leading
3168 quotation characters are compressed and overlong lines are folded to
3169 \fIquote-fold\fR characters each, breaking at whitespace as necessary
3170 and starting the follow lines with fillers to pad up to the last
3171 quotation markers width.
3172 The value of \fIquote-fold\fR can't be smaller than the length of
3173 \fIindentprefix\fR plus some additional pad.  It is automatically
3174 adjusted to the minimum as necessary.
3176 .B record
3177 If defined, gives the pathname of the folder
3178 used to record all outgoing mail.
3179 If not defined,
3180 then outgoing mail is not so saved.
3181 When saving to this folder fails,
3182 the message is not sent
3183 but saved to the `dead.letter' file instead.
3185 .B replyto
3186 A list of addresses to put into the \fI`Reply-To:'\fR field
3187 of the message header.
3188 If replying to a message, such addresses are handled
3189 as if they were in the alternates list.
3191 .B screen
3192 When \*(UA initially prints the message headers,
3193 it determines the number to print
3194 by looking at the speed of the terminal.
3195 The faster the terminal, the more it prints.
3196 This option overrides this calculation
3197 and specifies how many message headers
3198 are printed.
3199 This number is also used
3200 for scrolling with the z command.
3202 .B sendcharsets
3203 A comma-separated list of character set names
3204 that can be used in Internet mail.
3205 When a message that contains characters not representable in US-ASCII
3206 is prepared for sending,
3207 \*(UA tries to convert its text
3208 to each of the given character sets in order
3209 and uses the first appropriate one.
3210 The default is `utf-8'.
3212 Character sets assigned to this variable should be ordered
3213 in ascending complexity.
3214 That is, the list should start with e.\|g.
3215 `iso-8859-1' for compatibility with older mail clients,
3216 might contain some other language-specific character sets,
3217 and should end with `utf-8'
3218 to handle messages that combine texts in multiple languages.
3220 .B sender
3221 An address that is put into the `Sender:' field
3222 of outgoing messages.
3223 This field needs not normally be present.
3224 It is, however, required
3225 if the `From:' field contains more than one address.
3226 It can also be used to indicate that a message
3227 was sent on behalf of somebody other;
3228 in this case, `From:' should contain the address
3229 of the person that took responsibility for the message,
3230 and `Sender:' should contain the address
3231 of the person that actually sent the message.
3233 .I sender
3234 address is handled as if it were in the
3235 .I alternates
3236 list.
3238 .B sendmail
3239 To use an alternate mail delivery system,
3240 set this option to the full pathname of the program to use.
3242 .B SHELL
3243 Pathname of the shell to use
3244 in the ! command and the ~! escape.
3245 A default shell is used
3246 if this option is not defined.
3248 .B Sign
3249 A string for use with the
3250 .I ~A
3251 command.
3253 .B sign
3254 A string for use with the
3255 .I ~a
3256 command.
3258 .B signature
3259 Must correspond to the name of a readable file if set.
3260 The file's content is then appended to each singlepart message
3261 and to the first part of each multipart message.
3262 Be warned that there is no possibility
3263 to edit the signature for an individual message.
3265 .B smime-ca-dir
3266 Specifies a directory with CA certificates for verification
3267 of S/MIME signed messages.
3268 The format is the same as described in
3269 .IR SSL_CTX_load_verify_locations (3).
3270 Only applicable if S/MIME support is built using OpenSSL.
3272 .B smime-ca-file
3273 Specifies a file with CA certificates for verification
3274 of S/MIME signed messages.
3275 The format is the same as described in
3276 .IR SSL_CTX_load_verify_locations (3).
3277 Only applicable if S/MIME support is built using OpenSSL.
3279 \fBsmime-cipher-\fIuser@host\fR
3280 Specifies a cipher to use when generating S/MIME encrypted messages
3282 .IR user@host .
3283 Valid ciphers are
3284 .B rc2-40
3285 (RC2 with 40 bits),
3286 .B rc2-64
3287 (RC2 with 64 bits),
3288 .B des
3289 (DES, 56 bits)
3291 .B des-ede3
3292 (3DES, 112/168 bits).
3293 The default is 3DES.
3294 It is not recommended to use the other ciphers
3295 unless a recipient's client is actually unable to handle 3DES
3296 since they are comparatively weak;
3297 but even so, the recipient should upgrade his software in preference.
3299 .B smime-crl-file
3300 Specifies a file that contains a CRL in PEM format
3301 to use when verifying S/MIME messages.
3302 Only applicable if S/MIME support is built using OpenSSL.
3304 .B smime-crl-dir
3305 Specifies a directory that contains files with CRLs in PEM format
3306 to use when verifying S/MIME messages.
3307 Only applicable if S/MIME support is built using OpenSSL.
3309 \fBsmime-encrypt-\fIuser@host\fR
3310 If this variable is set,
3311 messages to
3312 .I user@host
3313 are encrypted before sending.
3314 If S/MIME support is built using OpenSSL,
3315 the value of the variable must be set to the name of a file
3316 that contains a certificate in PEM format.
3317 If S/MIME support is built using NSS,
3318 the value of this variable is ignored,
3319 but if multiple certificates for
3320 .I user@host
3321 are available, the
3322 .I smime-nickname-user@host
3323 variable should be set.
3324 Otherwise a certificate for the recipient
3325 is automatically retrieved from the certificate database,
3326 if possible.
3328 If a message is sent to multiple recipients,
3329 each of them for whom a corresponding variable is set
3330 will receive an individually encrypted message;
3331 other recipients will continue to receive the message in plain text
3332 unless the
3333 .I smime-force-encryption
3334 variable is set.
3335 It is recommended to sign encrypted messages,
3336 i.\|e. to also set the
3337 .I smime-sign
3338 variable.
3340 \fBsmime-nickname-\fIuser@host\fR
3341 Specifies the nickname of a certificate
3342 to be used when encrypting messages for
3343 .I user@host .
3344 Only applicable if S/MIME support is built using NSS.
3346 .B smime-sign-cert
3347 Points to a file in PEM format
3348 that contains the user's private key
3349 as well as his certificate.
3350 Both are used with S/MIME
3351 for signing and decrypting messages.
3352 Only applicable if S/MIME support is built using OpenSSL.
3354 \fBsmime-sign-cert-\fIuser@host\fR
3355 Overrides
3356 .I smime-sign-cert
3357 for the specific addresses.
3358 When signing messages and the value of the
3359 .I from
3360 variable is set
3362 .IR user@host ,
3363 the specific file is used.
3364 When decrypting messages,
3365 their recipient fields (To: and Cc:) are searched for addresses
3366 for which such a variable is set.
3367 \*(UA always uses the first address that matches,
3368 so if the same message is sent to more than one
3369 of the user's addresses using different encryption keys,
3370 decryption might fail.
3371 Only applicable if S/MIME support is built using OpenSSL.
3373 .B smime-sign-include-certs
3374 If used, this must be set to a comma-separated list of files,
3375 each of which containing a single certificate in PEM format
3376 to be included in the S/MIME message in addition to the
3377 .IR smime-sign-cert
3378 certificate.
3379 This is most useful for long certificate chains if it is
3380 desired to aid the receiving party's verification process.
3381 Only applicable if S/MIME support is built using OpenSSL.
3383 \fBsmime-sign-include-certs-\fIuser@host\fR
3384 Overrides
3385 .I smime-sign-include-certs
3386 for the specific addresses.
3387 Refer to the discussion of \fBsmime-sign-cert-\fIuser@host\fR
3388 for more on this topic.
3390 .B smime-sign-nickname
3391 Specifies that the named certificate be used for signing mail.
3392 If this variable is not set,
3393 but a single certificate matching the current
3394 .I from
3395 address is found in the database,
3396 that one is used automatically.
3397 Only applicable if S/MIME support is built using NSS.
3399 \fBsmime-sign-nickname-\fIuser@host\fR
3400 Overrides
3401 .I smime-sign-nickname
3402 for a specific address.
3403 Only applicable if S/MIME support is built using NSS.
3405 .B smtp
3406 Normally, \*(UA invokes \fIsendmail(1)\fR directly to transfer messages.
3407 If the \fIsmtp\fR variable is set, a SMTP connection to the server
3408 specified by the value of this variable is used instead.
3409 If the SMTP server does not use the standard port,
3410 a value of \fIserver:port\fR can be given,
3411 with \fIport\fR as a name or as a number.
3413 There are two possible methods to get SSL/TLS encrypted SMTP sessions:
3414 First, the STARTTLS command can be used to encrypt a session
3415 after it has been initiated,
3416 but before any user-related data has been sent; see
3417 .I \%smtp-use-starttls
3418 above.
3419 Second, some servers accept sessions that are encrypted
3420 from their beginning on. This mode is configured by assigning
3421 \fBsmtps://\fIserver\fR[\fB:\fIport\fR]
3422 to the
3423 .I smtp
3424 variable.
3426 The SMTP transfer is executed in a child process;
3427 unless either the
3428 .I sendwait
3429 or the
3430 .I verbose
3431 variable is set,
3432 this process runs asynchronously.
3433 If it receives a TERM signal,
3434 it will abort and save the message to the `dead.letter' file.
3436 .B smtp-auth
3437 Sets the SMTP authentication method.
3438 If set to `login',
3439 or if unset and smtp-auth-user is set,
3440 AUTH LOGIN is used.
3441 If set to `cram-md5',
3442 AUTH CRAM-MD5 is used;
3443 if set to `plain',
3444 AUTH PLAIN is used.
3445 Otherwise,
3446 no SMTP authentication is performed.
3448 \fBsmtp-auth-\fIuser\fB@\fIhost\fR
3449 Overrides
3450 .I smtp-auth
3451 for specific values of sender addresses,
3452 depending on the
3453 .I from
3454 variable.
3456 .B smtp-auth-password
3457 Sets the global password for SMTP AUTH.
3458 Both user and password have to be given
3459 for AUTH LOGIN and AUTH CRAM-MD5.
3461 \fBsmtp-auth-password-\fIuser\fB@\fIhost\fR
3462 Overrides
3463 .I smtp-auth-password
3464 for specific values of sender addresses,
3465 depending on the
3466 .I from
3467 variable.
3469 .B smtp-auth-user
3470 Sets the global user name for SMTP AUTH.
3471 Both user and password have to be given
3472 for AUTH LOGIN and AUTH CRAM-MD5.
3474 If this variable is set but neither
3475 .I smtp-auth-password
3476 or a matching
3477 .I smtp-auth-password-user@host
3478 can be found,
3479 \*(UA will as for a password on the user's terminal.
3481 \fBsmtp-auth-user-\fIuser\fB@\fIhost\fR
3482 Overrides
3483 .I smtp-auth-user
3484 for specific values of sender addresses,
3485 depending on the
3486 .I from
3487 variable.
3489 .B ssl-ca-dir
3490 Specifies a directory with CA certificates for verification
3491 of SSL/TLS server certificates.
3493 .IR SSL_CTX_load_verify_locations (3)
3494 for more information.
3495 Only applicable if SSL/TLS support is built using OpenSSL.
3497 .B ssl-ca-file
3498 Specifies a file with CA certificates for verification
3499 of SSL/TLS server certificates.
3501 .IR SSL_CTX_load_verify_locations (3)
3502 for more information.
3503 Only applicable if SSL/TLS support is built using OpenSSL.
3505 .B ssl-cert
3506 Sets the file name 
3507 for a SSL/TLS client certificate
3508 required by some servers.
3509 Only applicable if SSL/TLS support is built using OpenSSL.
3511 \fBssl-cert-\fIuser\fB@\fIhost\fR
3512 Sets an account-specific file name
3513 for a SSL/TLS client certificate
3514 required by some servers.
3515 Overrides
3516 .I ssl-cert
3517 for the specified account.
3518 Only applicable if SSL/TLS support is built using OpenSSL.
3520 .B ssl-cipher-list
3521 Specifies a list of ciphers for SSL/TLS connections.
3522 See ciphers(1) for more information.
3523 Only applicable if SSL/TLS support is built using OpenSSL.
3525 .B ssl-crl-file
3526 Specifies a file that contains a CRL in PEM format
3527 to use when verifying SSL/TLS server certificates.
3528 Only applicable if SSL/TLS support is built using OpenSSL.
3530 .B ssl-crl-dir
3531 Specifies a directory that contains files with CRLs in PEM format
3532 to use when verifying SSL/TLS server certificates.
3533 Only applicable if SSL/TLS support is built using OpenSSL.
3535 .B ssl-key
3536 Sets the file name
3537 for the private key of a SSL/TLS client certificate.
3538 If unset, the name of the certificate file is used.
3539 The file is expected to be in PEM format.
3540 Only applicable if SSL/TLS support is built using OpenSSL.
3542 \fBssl-key-\fIuser\fB@\fIhost\fR
3543 Sets an account-specific file name
3544 for the private key of a SSL/TLS client certificate.
3545 Overrides
3546 .I ssl-key
3547 for the specified account.
3548 Only applicable if SSL/TLS support is built using OpenSSL.
3550 .B ssl-method
3551 Selects a SSL/TLS protocol version;
3552 valid values are `ssl2', `ssl3', and `tls1'.
3553 If unset, the method is selected automatically,
3554 if possible.
3556 \fBssl-method-\fIuser\fB@\fIhost\fR
3557 Overrides
3558 .I ssl-method
3559 for a specific account.
3561 .B ssl-rand-egd
3562 Gives the pathname to an entropy daemon socket,
3564 .IR RAND_egd (3).
3566 .B ssl-rand-file
3567 Gives the pathname to a file with entropy data,
3569 .IR RAND_load_file (3).
3570 If the file is a regular file writable by the invoking user,
3571 new data is written to it after it has been loaded.
3572 Only applicable if SSL/TLS support is built using OpenSSL.
3574 .B ssl-verify
3575 Sets the action to be performed if an error occurs
3576 during SSL/TLS server certificate validation.
3577 Valid values are
3578 `strict' (fail and close connection immediately),
3579 `ask' (ask whether to continue on standard input),
3580 `warn' (print a warning and continue),
3581 `ignore' (do not perform validation).
3582 The default is `ask'.
3584 \fBssl-verify-\fIuser\fB@\fIhost\fR
3585 Overrides
3586 .I ssl-verify
3587 for a specific account.
3589 .B stealthmua
3590 If only set without a value assigned, then this option inhibits the
3591 generation of the \fI`Message-Id:'\fR and \fI`User-Agent:'\fR
3592 header fields that include obvious references to \*(UA.
3593 There are two pitfalls associated with this:
3594 First, the message id of outgoing messages is not known anymore.
3595 Second, an expert may still use the remaining information in the header
3596 to track down the originating mail user agent.
3597 If set to the value `noagent', then the mentioned \fI`Message-Id:'\fR
3598 suppression doesn't occur.
3600 .B toplines
3601 If defined, gives the number of lines
3602 of a message to be printed out
3603 with the top command;
3604 normally, the first five
3605 lines are printed.
3607 .B ttycharset
3608 The character set of the terminal \*(UA operates on.
3609 There is normally no need to set this variable
3610 since \*(UA can determine this automatically
3611 by looking at the LC_CTYPE locale setting;
3612 if this succeeds, the value is assigned at startup
3613 and will be displayed by the \fIset\fP command.
3614 Note that this is not necessarily a character set name
3615 that can be used in Internet messages.
3617 .B VISUAL
3618 Pathname of the text editor to use
3619 in the visual command and ~v escape.
3620 .SH ENVIRONMENT VARIABLES
3621 Besides the variables described above, \*(UA uses
3622 the following environment strings:
3624 .B HOME
3625 The user's home directory.
3627 \fBLANG\fR, \fBLC_ALL\fR, \fBLC_COLLATE\fR, \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR
3629 .IR locale (7).
3631 .B MAILRC
3632 Is used as a startup file instead of \*(ur if set.
3633 When \*(UA scripts are invoked on behalf of other users,
3634 this variable should be set to `/dev/null' to avoid side-effects from
3635 reading their configuration files.
3637 .B NAILRC
3638 If this variable is set and
3639 .I MAILRC
3640 is not set,
3641 it is read as startup file.
3643 .B SYSV3
3644 Changes the letters printed in the first column of a header summary.
3646 .B TMPDIR
3647 Used as directory for temporary files instead of /tmp, if set.
3648 .SH FILES
3650 \*(ur
3651 File giving initial commands.
3653 \*(UR
3654 System wide initialization file.
3656 ~/.mime.types
3657 Personal MIME types.
3659 /etc/mime.types
3660 System wide MIME types.
3661 .SH EXAMPLES
3662 .SS "Getting started"
3663 The \*(UA
3664 command has two distinct usages, according to whether one
3665 wants to send or receive mail.
3666 Sending mail is simple: to send a
3667 message to a user whose email address is, say,
3668 <bill@host.example>,
3669 use the shell
3670 command:
3673     $ \*(ba\fI bill@host.example\fR
3676 then type your message.
3677 \*(UA will prompt you for a message
3678 .I subject 
3679 first;
3680 after that, lines typed by you form the body of the message.
3681 When you reach the end of the message, type
3682 an EOT (control\-d) at the beginning of a line, which will cause
3683 \*(UA to echo `EOT' and return you to the shell.
3685 If, while you are composing the message
3686 you decide that you do not wish to send it after all, you can
3687 abort the letter with a \s-2RUBOUT\s0.  Typing a single \s-2RUBOUT\s0
3688 causes \*(UA
3689 to print `(Interrupt -- one more to kill letter)'.
3690 Typing a second
3691 \s-2RUBOUT\s0 causes \*(UA
3692 to save your partial letter on the file `dead.letter'
3693 in your home directory and abort the letter.
3694 Once you have
3695 sent mail to someone, there is no way to undo the act, so be
3696 careful.
3698 If you want to send the same message to several other people,
3699 you can list their email addresses on the command line.
3700 Thus,
3703     $ \*(ba\fI sam@workstation.example bob@server.example\fR
3704     Subject: Fees
3705     Tuition fees are due next Friday.  Don't forget!
3706     <Control\-d>
3707     EOT
3708     $
3711 will send the reminder to \fI<sam@workstation.example>\fR.
3713 \fI<bob@server.example>\fR.
3715 To read your mail, simply type
3718     $ \*(ba
3721 \*(UA
3722 will respond by typing its version number and date and then listing
3723 the messages you have waiting.
3724 Then it will type a prompt and await your command.
3725 The messages are assigned numbers starting with 1\(emyou
3726 refer to the messages with these numbers.
3727 \*(UA keeps track of which messages are
3728 .I new
3729 (have been sent since you last read your mail) and
3730 .I read
3731 (have been read by you).  New messages have an
3732 .B N
3733 next to them in the header listing and old, but unread messages have
3735 .B U
3736 next to them.
3737 \*(UA keeps track of new/old and read/unread messages by putting a
3738 header field called
3739 .I Status
3740 into your messages.
3742 To look at a specific message, use the
3743 .I type
3744 command, which may be abbreviated to simply \fIt\fR.
3745 For example, if you had the following messages:
3748     O 1 drfoo@myhost.example Wed Sep  1 19:52  18/631 "Fees"
3749     O 2 sam@friends.example  Thu Sep  2 00:08  30/895
3752 you could examine the first message by giving the command:
3755     \fBtype\fR 1
3758 which might cause \*(UA to respond with, for example:
3761     Message  1:
3762     From drfoo@myhost.example Wed Sep  1 19:52:25 2004
3763     Subject: Fees
3764     Status: R
3766     Tuition fees are due next Wednesday.  Don't forget!
3770 Many \*(UA
3771 commands that operate on messages take a message number as an
3772 argument like the
3773 .I type
3774 command.
3775 For these commands, there is a notion of a current message.
3776 When you enter the \*(UA
3777 program, the current message is initially the first
3778 (or the first recent) one.
3779 Thus, you can often omit the message number and use, for example,
3782     \fBt\fR
3785 to type the current message.
3786 As a further shorthand, you can type a message
3787 by simply giving its message number.
3788 Hence,
3791     1
3794 would type the first message.
3796 Frequently, it is useful to read the messages in your mailbox in order,
3797 one after another.
3798 You can read the next message in \*(UA
3799 by simply typing a newline.
3800 As a special case, you can type a newline as your first command to
3801 \*(UA to type the first message.
3803 If, after typing a message, you wish to immediately send a reply,
3804 you can do so with the
3805 .I reply
3806 command.
3807 This command,
3808 like
3809 .IR type ,
3810 takes a message number as an argument.
3811 \*(UA
3812 then begins a message addressed to the user who sent you the message.
3813 You may then type in your letter in reply, followed by a <control-d>
3814 at the beginning of a line, as before.
3816 Note that \*(UA
3817 copies the subject header from the original message.
3818 This is useful in that correspondence
3819 about a particular matter will tend to retain the same subject heading,
3820 making it easy to recognize.
3821 If there are other header fields in the message,
3822 like `Cc:',
3823 the information found will also be used.
3825 Sometimes you will receive a message that has been sent to
3826 several people and wish to reply only
3827 to the person who sent it.
3828 .I Reply
3829 with a capital
3830 .I R
3831 replies to a message, but sends a copy to the sender only.
3833 If you wish, while reading your mail, to send a message to someone,
3834 but not as a reply to one of your messages, you can send the message
3835 directly with the
3836 .I mail
3837 command, which takes as arguments the names of the recipients you wish
3838 to send to.
3839 For example, to send a message to <frank@machine.example>,
3840 you would do:
3843     \fBmail\fI frank@machine.example\fR
3846 To delete a message from the mail folder,
3847 you can use the
3848 .I delete
3849 command.
3850 In addition to not saving deleted messages,
3851 \*(UA will not let you type them, either.
3852 The effect is to make the message disappear
3853 altogether, along with its number.
3855 Many features of \*(UA can be tailored to your liking with the
3856 .I set
3857 command.
3859 .I set
3860 command has two forms, depending on whether you are setting a
3861 .I binary
3862 option or a
3863 .I valued
3864 option.
3865 Binary options are either on or off.  For example, the
3866 .I askcc
3867 option informs \*(UA
3868 that each time you send a message, you want it to prompt you for
3869 a `Cc:' header,
3870 to be included in the message.
3871 To set the
3872 .I askcc
3873 option, you would type
3876     \fBset\fR askcc
3879 Valued options are values which \*(UA uses to adapt to your tastes.
3880 For example, the
3881 .I record
3882 option tells \*(UA
3883 where to save messages sent by you,
3884 and is specified by
3887     \fBset\fR record=Sent
3890 for example.
3891 Note that no spaces are allowed in \fI"set record=Sent"\fR.
3893 \*(UA includes a simple facility for maintaining groups of messages
3894 together in folders.
3895 To use the folder facility, you must tell \*(UA
3896 where you wish to keep your folders.
3897 Each folder of messages will be a single file.
3898 For convenience, all of your folders are kept in
3899 a single directory of your choosing.
3900 To tell \*(UA where your folder directory is, put a line of the form
3903     \fBset folder=\fIletters\fR
3906 in your \*(ur file.
3907 If, as in the example above,
3908 your folder directory does not begin with a `/',
3909 \*(UA will assume that your folder directory is to be found starting
3910 from your home directory.
3912 Anywhere a file name is expected, you can use a folder name, preceded
3913 with `+'.
3914 For example, to put a message into a folder with the
3915 .I save
3916 command, you can use:
3919     \fBsave +\fIclasswork\fR
3922 to save the current message in the
3923 .I classwork
3924 folder.
3925 If the
3926 .I classwork
3927 folder does not yet exist, it will be created.
3928 Note that messages which are saved with the
3929 .I save
3930 command are automatically removed from your system mailbox.
3932 In order to make a copy of a message in a folder without causing
3933 that message to be removed from your system mailbox, use the
3934 .I copy
3935 command, which is identical in all other respects to the
3936 .I save
3937 command.
3940 .I folder
3941 command
3942 can be used to direct \*(UA to the contents of a different folder.
3943 For example,
3946     \fBfolder +\fIclasswork\fR
3949 directs \*(UA to read the contents of the
3950 .I classwork
3951 folder.
3952 All of the commands that you can use on your system
3953 mailbox are also applicable to folders, including
3954 .IR type ,
3955 .IR delete ,
3957 .IR reply .
3958 To inquire which folder you are currently editing, use simply:
3961     \fBfolder\fR
3964 To list your current set of folders, use the
3965 .I folders
3966 command.
3968 Finally, the
3969 .I help
3970 command is available to print out a brief summary of the most important
3971 \*(UA commands.
3973 While typing in a message to be sent to others, it is often
3974 useful to be able to invoke the text editor on the partial message,
3975 print the message, execute a shell command, or do some other
3976 auxiliary function. 
3977 \*(UA provides these capabilities through \fI"tilde escapes"\fR,
3978 which consist of a tilde (~) at the beginning of a line, followed by
3979 a single character which indicates the function to be performed.
3980 For example, to print the text of the message so far, use:
3983     \fB~p\fR
3986 which will print a line of dashes, the recipients of your message, and
3987 the text of the message so far.
3988 A list of the most important tilde escapes is available with `~?'.
3989 .SS "IMAP or POP3 client setup"
3990 First you need the following data from your ISP:
3991 the host name of the IMAP or POP3 server,
3992 user name and password for this server,
3993 and a notice whether the server uses SSL/TLS encryption.
3994 Assuming the host name is `server.myisp.example'
3995 and your user name for that server is `mylogin',
3996 you can refer to this account using the
3997 .I folder
3998 command or
3999 .I \-f
4000 command line option with
4003     \fBimaps://\fImylogin\fB@\fIserver.myisp.example\fR
4006 (This string is not necessarily the same as your Internet mail address.)
4007 You can replace `imaps://' with `imap://'
4008 if the server does not support SSL/TLS.
4009 (If SSL/TLS support is built using NSS, the
4010 .I nss-config-dir
4011 variable must be set before a connection can be initiated,
4012 see above).
4013 Use `pop3s://' or `pop3://' if the server does not offer IMAP.
4014 You should use IMAP if you can, though;
4015 first because it requires fewer network operations than POP3
4016 to get the contents of the mailbox
4017 and is thus faster;
4018 and second because message attributes
4019 are maintained by the IMAP server,
4020 so you can easily distinguish new and old messages
4021 each time you connect.
4022 Even if the server does not accept IMAPS or POP3S connections,
4023 it is possible that it supports the STARTTLS method
4024 to make a session SSL/TLS encrypted
4025 after the initial connection has been performed,
4026 but before authentication begins.
4027 The only reliable method to see if this works is to try it; enter one of
4030     \fBset imap-use-starttls\fR
4031     \fBset pop3-use-starttls\fR
4034 before you initiate the connection.
4036 As you probably want messages to be deleted from this account
4037 after saving them,
4038 prefix it with `\fI%:\fR'.
4040 .I shortcut
4041 command can be used to avoid typing that many characters
4042 every time you want to connect:
4045     \fBshortcut \fImyisp\fB \fB%:imaps://\fImylogin\fB@\fIserver.myisp.example\fR
4048 You might want to put this string into a startup file.
4049 As the
4050 .I shortcut
4051 command is specific to this implementation of \*(UA and will confuse other
4052 implementations, it should not be used in \*(ur, instead, put
4055     \fBset NAIL_EXTRA_RC=.\*(uarc
4058 in \*(ur and create a file ~/.\*(uarc containing the
4059 .I shortcut
4060 command above.
4061 You can then access your remote mailbox by invoking
4062 `\*(ua \-f \fImyisp\fR' on the command line,
4063 or by executing `fi \fImyisp\fR' within \*(UA.
4065 If you want to use more than one IMAP mailbox on a server,
4066 or if you want to use the IMAP server for mail storage too,
4068 .I account
4069 command
4070 (which is also \*(UA-\fRspecific)
4071 is more appropriate than the
4072 .I shortcut
4073 command.
4074 You can put the following in
4075 .IR ~/.\*(uarc :
4078     \fBaccount \fImyisp \fB{\fR
4079         \fBset folder=imaps://\fImylogin\fB@\fIserver.myisp.example\fR
4080         \fBset record=+\fISent \fBMBOX=+\fImbox \fBoutfolder\fR
4081     \fB}\fR
4084 and can then access incoming mail for this account by invoking
4085 `\*(ua \-A \fImyisp\fR' on the command line,
4086 or by executing `ac \fImyisp\fR' within \*(UA.
4087 After that,
4088 a command like `copy \fI1\fR +\fIotherfolder\fR'
4089 will refer to \fIotherfolder\fR on the IMAP server.
4090 In particular,
4091 `fi &' will change to the
4092 .I mbox
4093 folder,
4095 `fi +Sent' will show your recorded sent mail,
4096 with both folders located on the IMAP server.
4098 \*(UA will ask you for a password string
4099 each time you connect to a remote account.
4100 If you can reasonably trust the security
4101 of your workstation,
4102 you can give this password in the startup file as
4105     \fBset password-\fImylogin\fB@\fIserver.myisp.example\fB="\fISECRET\fB"\fR
4108 You should change the permissions of this file to 0600, see
4109 .IR chmod (1).
4111 \*(UA supports different authentication methods for both IMAP and POP3.
4112 If Kerberos is used at your location,
4113 you can try to activate GSSAPI-based authentication by
4116     \fBset imap-auth=gssapi\fR
4119 The advantage of this method is that
4120 \*(UA does not need to know your password at all,
4121 nor needs to send sensitive data over the network.
4122 Otherwise, the options
4125     \fBset imap-auth=cram-md5\fR
4126     \fBset pop3-use-apop\fR
4129 for IMAP and POP3, respectively,
4130 offer authentication methods
4131 that avoid to send the password in clear text over the network,
4132 which is especially important if SSL/TLS cannot be used.
4133 If the server does not offer any of these authentication methods,
4134 conventional user/password based authentication must be used.
4135 It is sometimes helpful to set the
4136 .I verbose
4137 option when authentication problems occur.
4138 \*(UA will display all data sent to the server in clear text on the
4139 screen with this option,
4140 including passwords.
4141 You should thus take care that no unauthorized person
4142 can look at your terminal when this option is set.
4144 If you regularly use the same workstation
4145 to access IMAP accounts,
4146 you can greatly enhance performance
4147 by enabling local caching of IMAP messages.
4148 For any message that has been fully or partially fetched from the server,
4149 a local copy is made and is used when the message is accessed again,
4150 so most data is transferred over the network once only.
4151 To enable the IMAP cache,
4152 select a local directory name and put
4155     \fBset imap-cache=\fI~/localdirectory\fR
4158 in the startup file.
4159 All files within that directory
4160 can be overwritten or deleted by \*(UA at any time,
4161 so you should not use the directory to store other information.
4163 Once the cache contains some messages,
4164 it is not strictly necessary anymore
4165 to open a connection to the IMAP server
4166 to access them.
4167 When \*(UA is invoked with the \fI\-D\fR option,
4168 or when the
4169 .I disconnected
4170 variable is set,
4171 only cached data is used
4172 for any folder you open.
4173 Messages that have not yet been completely cached
4174 are not available then,
4175 but all other messages can be handled
4176 as usual.
4177 Changes made to IMAP mailboxes in
4178 .I disconnected
4179 mode are committed to the IMAP server
4180 next time it is used in
4181 .I online
4182 mode.
4183 Synchronizing the local status
4184 with the status on the server
4185 is thus partially within your responsibility;
4186 if you forget to initiate a connection to the server again
4187 before you leave your location,
4188 changes made on one workstation
4189 are not available on others.
4190 Also if you alter IMAP mailboxes from a workstation
4191 while uncommitted changes are still pending on another,
4192 the latter data may become invalid.
4193 The same might also happen because of internal server status changes.
4194 You should thus carefully evaluate this feature in your environment
4195 before you rely on it.
4197 Many servers will close the connection
4198 after a short period of inactivity. Use one of
4201     \fBset pop3-keepalive=\fI30\fR
4202     \fBset imap-keepalive=\fI240\fR
4205 to send a keepalive message each 30 seconds for POP3,
4206 or each 4 minutes for IMAP.
4208 If you encounter problems connecting to a SSL/TLS server,
4209 try the
4210 .I ssl-rand-egd
4212 .I ssl-rand-file
4213 variables (see the OpenSSL FAQ for more information)
4214 or specify the protocol version with
4215 .IR ssl-method .
4216 Contact your ISP
4217 if you need a client certificate
4218 or if verification of the server certificate fails.
4219 If the failed certificate is indeed valid,
4220 fetch its CA certificate by executing the shell command
4223     $ \fBopenssl s_client </dev/null \-showcerts \-connect \e
4224         \fIserver.myisp.example\fB:\fIimaps\fB 2>&1 | tee \fIlog\fR
4227 (see
4228 .IR s_client (1))
4229 and put it into the file specified with
4230 .IR ssl-ca-file .
4231 The data you need is located at the end of the certificate chain
4232 within (and including) the `BEGIN CERTIFICATE'
4233 and `END CERTIFICATE' lines.
4234 Note that the example above is \fIinsecure\fR!
4235 One should use the `-verify' and `-CAfile' options of
4236 .IR s_client (1)
4237 to be "on the safe side" regarding the fetched certificates.
4238 .SS "Creating a score file or message filter"
4239 The scoring commands are best separated
4240 from other configuration for clarity,
4241 and are mostly \*(UA specific.
4242 It is thus recommended to put them in a separate file
4243 that is sourced from your NAIL_EXTRA_RC as follows:
4246     \fBsource\fI ~/.scores\fR
4249 The \fI.scores\fR file could then look as follows:
4252     \fBdefine\fR \fIlist\fR {
4253         \fBscore\fR (subject "important discussion") +10
4254         \fBscore\fR (subject "annoying discussion") \-10
4255         \fBscore\fR (from "nicefellow@goodnet") +15
4256         \fBscore\fR (from "badguy@poornet") \-5
4257         \fBmove\fR (header x-spam-flag "+++++") \fI+junk\fR
4258     }
4259     \fBset folder-hook-\fRimap://user@host/public.list=\fIlist\fR
4262 In this scheme,
4263 you would see any mail from `nicefellow@goodnet',
4264 even if the surrounding discussion is annoying;
4265 but you normally would not see mail from `badguy@poornet',
4266 unless he participates in the important discussion.
4267 Messages that are marked with five or more plus characters
4268 in their `X-Spam-Flag' field
4269 (inserted by some server-side filtering software)
4270 are moved to the folder `junk' in the
4271 .I folder
4272 directory.
4274 Be aware that all criteria in (\|) lead to substring matches,
4275 so you would also score messages
4276 from e.\|g. `notsobadguy@poornetmakers' negative here.
4277 It is possible to select addresses exactly using \fI"address"\fR
4278 message specifications,
4279 but these cannot be executed remotely 
4280 and will thus cause all headers
4281 to be downloaded from IMAP servers while looking for matches.
4283 When searching messages on an IMAP server,
4284 best performance is usually achieved
4285 by sending as many criteria as possible
4286 in one large (\|) specification,
4287 because each single such specification
4288 will result in a separate network operation.
4289 .SS "Activating the Bayesian filter"
4290 The Bayesian junk mail filter works
4291 by examining the words contained in messages.
4292 You decide yourself what a good and what a bad message is.
4293 Thus the resulting filter is your very personal one;
4294 once it is correctly set up,
4295 it will filter only messages similar to those
4296 previously specified by you.
4298 To use the Bayesian filter,
4299 a location for the junk mail database must be defined first:
4302     \fBset junkdb=\fI~/.junkdb\fR
4305 The junk mail database does not contain
4306 actual words extracted from messages,
4307 but hashed representations of them.
4308 A foreign person who can read the database
4309 could only examine the frequency of previously known words
4310 in your mail.
4312 If you have sufficient disk space (several 10\ MB) available,
4313 it is recommended that you set the
4314 .I chained-junk-tokens
4315 option.
4316 The filter will then also consider two-word tokens,
4317 improving its accuracy.
4319 A set of good messages and junk messages must now be available;
4320 it is also possible to use the incoming new messages for this purpose,
4321 although it will of course take some time
4322 until the filter becomes useful then.
4323 Do not underestimate the amount of statistical data needed;
4324 some hundred messages are typically necessary
4325 to get satisfactory results,
4326 and many thousand messages for best operation.
4327 You have to pass the good messages to the
4328 .I good
4329 command,
4330 and the junk messages to the
4331 .I junk
4332 command.
4333 If you ever accidentally mark a good message as junk or vice-versa,
4334 call the
4335 .I ungood
4337 .I unjunk
4338 command to correct this.
4340 Once a reasonable amount of statistics has been collected,
4341 new messages can be classified automatically.
4343 .I classify
4344 command marks all messages that the filter considers to be junk,
4345 but it does not perform any action on them by default.
4346 It is recommended that you move these messages into a separate
4347 folder just for the case that false positives occur,
4348 or to pass them to the
4349 .I junk
4350 command later again to further improve the junk mail database.
4351 To automatically move incoming junk messages
4352 every time the inbox is opened,
4353 put lines like the following into your
4354 .I .scores
4355 file (or whatever name you gave to the file in the last example):
4358     \fBdefine\fR \fIjunkfilter\fR {
4359         \fBclassify (smaller \fI20000\fB) :n\fR
4360         \fBmove :j\fR \fI+junk\fR
4361     }
4362     \fBset folder-hook-\fRimap://user@host/INBOX=\fIjunkfilter\fR
4365 If you set the
4366 .I verbose
4367 option before running the
4368 .I classify
4369 command,
4370 \*(UA prints the words it uses for calculating the junk status
4371 along with their statistical probabilities.
4372 This can help you to find out
4373 why some messages are not classified
4374 as you would like them to be.
4375 To see the statistical probability of a given word,
4376 use the
4377 .I probability
4378 command.
4380 If a junk message was not recognized as such,
4381 use the
4382 .I junk
4383 command to correct this.
4384 Also if you encounter a false positive
4385 (a good message that was wrongly classified as junk),
4386 pass it to the
4387 .I good
4388 command.
4390 Since the
4391 .I classify
4392 command must examine the entire text
4393 of all new messages in the respective folder,
4394 this will also cause all of them to be downloaded from the IMAP server.
4395 You should thus restrict the size of messages for automatic filtering.
4396 If server-based filtering is also available,
4397 you might try if that works for you first.
4398 .SS "Reading HTML mail"
4399 You need either the
4400 .I w3m
4402 .I lynx
4403 utility
4404 or another command-line web browser
4405 that can write plain text to standard output.
4408     \fBset pipe-text/html=\fR"w3m -dump -T text/html"
4414     \fBset pipe-text/html=\fR"lynx -dump -force_html /dev/stdin"
4417 will then cause HTML message parts to be converted into a more friendly form.
4418 .SS "Viewing PDF attachments"
4419 Most PDF viewers do not accept input directly from a pipe.
4420 It is thus necessary to store the attachment in a temporary file, as with
4423     \fBset pipe-application/pdf=\fR"cat >/tmp/\*(ua$$.pdf; \e
4424         acroread /tmp/\*(ua$$.pdf; rm /tmp/\*(ua$$.pdf"
4427 Note that security defects are discovered in PDF viewers
4428 from time to time.
4429 Automatical command execution like this
4430 can compromise your system security,
4431 in particular if you stay not always informed
4432 about such issues.
4433 .SS "Signed and encrypted messages with S/MIME"
4434 S/MIME provides two central mechanisms:
4435 message signing and message encryption.
4436 A signed message contains some data in addition
4437 to the regular text.
4438 The data can be used to verify
4439 that the message was sent using a valid certificate,
4440 that the sender's address in the message header
4441 matches that in the certificate,
4442 and that the message text has not been altered.
4443 Signing a message does not change its regular text;
4444 it can be read regardless of whether the recipient's software
4445 is able to handle S/MIME.
4446 It is thus usually possible to sign all outgoing messages
4447 if so desired.
4448 Encryption, in contrast,
4449 makes the message text invisible for all people except those who have
4450 access to the secret decryption key.
4451 To encrypt a message,
4452 the specific recipient's public encryption key must be known.
4453 It is thus not possible to send encrypted mail to people
4454 unless their key has been retrieved
4455 from either previous communication or public key directories.
4456 A message should always be signed before it is encrypted.
4457 Otherwise, it is still possible that the encrypted message text
4458 is altered.
4460 A central concept to S/MIME is that of the certification authority (CA).
4461 A CA is a trusted institution that issues certificates.
4462 For each of these certificates,
4463 it can be verified that it really originates from the CA,
4464 provided that the CA's own certificate is previously known.
4465 A set of CA certificates is usually delivered with OpenSSL
4466 and installed on your system.
4467 If you trust the source of your OpenSSL software installation,
4468 this offers reasonable security for S/MIME on the Internet.
4469 In general, a certificate cannot be more secure
4470 than the method its CA certificate has been retrieved with, though.
4471 Thus if you download a CA certificate from the Internet,
4472 you can only trust the messages you verify using that certificate
4473 as much as you trust the download process.
4475 The first thing you need for participating in S/MIME message exchange
4476 is your personal certificate,
4477 including a private key.
4478 The certificate contains public information,
4479 in particular your name and your email address,
4480 and the public key that is used by others
4481 to encrypt messages for you,
4482 and to verify signed messages they supposedly received from you.
4483 The certificate is included in each signed message you send.
4484 The private key must be kept secret.
4485 It is used to decrypt messages that were
4486 previously encrypted with your public key,
4487 and to sign messages.
4489 For personal use,
4490 it is recommended that you get a S/MIME certificate
4491 from one of the major CAs on the Internet using your WWW browser.
4492 (Many CAs offer such certificates for free.)
4493 You will usually receive
4494 a combined certificate and private key
4495 in PKCS#12 format which
4496 \*(UA does not directly accept
4497 if S/MIME support is built using OpenSSL.
4498 To convert it to PEM format,
4499 use the following shell command:
4502     $ \fBopenssl pkcs12 \-in \fIcert.p12\fB \-out \fIcert.pem\fB \-clcerts \e
4503         \-nodes\fR
4506 If you omit the
4507 .I \-nodes
4508 parameter,
4509 you can specifiy an additional
4510 .I "PEM pass phrase"
4511 for protecting the private key.
4512 \*(UA will then ask you for that pass phrase
4513 each time it signs or decrypts a message.
4514 You can then use
4517     \fBset smime-sign-cert-\fImyname@myisp.example\fB=\fIcert.pem\fR
4520 to make this private key and certificate known to \*(UA.
4522 If S/MIME support is built using NSS,
4523 the PKCS#12 file must be installed using Mozilla
4524 (provided that
4525 .I nss-config-dir
4526 is set appropriately,
4527 see above),
4528 and no further action is necessary
4529 unless multiple user certificates
4530 for the same email address are installed.
4531 In this case,
4533 .I smime-sign-nickname
4534 variable has to be set appropriately.
4536 You can now sign outgoing messages.
4537 Just use
4540     \fBset smime-sign\fR
4543 to do so.
4545 From each signed message you send,
4546 the recipient can fetch your certificate
4547 and use it to send encrypted mail back to you.
4548 Accordingly if somebody sends you a signed message,
4549 you can do the same.
4550 First use the
4551 .I verify
4552 command to check the validity of the certificate.
4553 After that,
4554 retrieve the certificate and tell
4555 \*(UA that it should use it for encryption:
4558     \fBcertsave\fI filename\fR
4559     \fBset smime-encrypt-\fIuser@host\fB=\fIfilename\fR
4562 If S/MIME support is built using NSS,
4563 the saved certificate must be installed using Mozilla.
4564 The value of the
4565 .I smime-encrypt-user@host
4566 is ignored then,
4567 but if multiple certificates for the recipient are available,
4569 .I smime-nickname-user@host
4570 variable must be set.
4572 You should carefully consider
4573 if you prefer to store encrypted messages in decrypted form.
4574 If you do, anybody who has access to your mail folders can read them,
4575 but if you do not,
4576 you might be unable to read them yourself later
4577 if you happen to lose your private key.
4579 .I decrypt
4580 command saves messages in decrypted form,
4581 while the
4582 .IR save ,
4583 .IR copy ,
4585 .I move
4586 commands leave them encrypted.
4588 Note that neither S/MIME signing nor encryption
4589 applies to message subjects or other header fields.
4590 Thus they may not contain sensitive information
4591 for encrypted messages,
4592 and cannot be trusted even if the message content
4593 has been verified.
4594 When sending signed messages,
4595 it is recommended to repeat any important header information
4596 in the message text.
4597 .SS "Using CRLs with S/MIME or SSL/TLS"
4598 Certification authorities (CAs) issue
4599 certificate revocation lists (CRLs) on a regular basis.
4600 These lists contain the serial numbers of certificates
4601 that have been declared invalid after they have been issued.
4602 Such usually happens
4603 because the private key for the certificate has been compromised,
4604 because the owner of the certificate has left
4605 the organization that is mentioned in the certificate,
4606 etc.
4607 To seriously use S/MIME or SSL/TLS verification,
4608 an up-to-date CRL is required for each trusted CA.
4609 There is otherwise no method
4610 to distinguish between valid and invalidated certificates.
4611 \*(UA currently offers no mechanism to fetch CRLs,
4612 or to access them on the Internet,
4613 so you have to retrieve them by some external mechanism.
4615 If S/MIME and SSL/TLS support are built using OpenSSL,
4616 \*(UA accepts CRLs in PEM format only;
4617 CRLs in DER format must be converted,
4618 e.\|g. with the shell command
4621     $ \fBopenssl crl \-inform DER \-in \fIcrl.der\fB \-out \fIcrl.pem\fR
4624 To tell \*(UA about the CRLs,
4625 a directory
4626 that contains all CRL files
4627 (and no other files)
4628 must be created.
4630 .I smime-crl-dir
4632 .I ssl-crl-dir
4633 variables, respectively,
4634 must then be set to point to that directory.
4635 After that,
4636 \*(UA requires a CRL to be present
4637 for each CA that is used
4638 to verify a certificate.
4640 If S/MIME and SSL/TLS support are built using NSS,
4641 CRLs can be imported in Mozilla applications
4642 (provided that
4643 .I nss-config-dir
4644 is set appropriately).
4645 .SS "Sending mail from scripts"
4646 If you want to send mail from scripts,
4647 you must be aware that
4648 \*(UA reads the user's configuration files by default.
4649 So unless your script is only intended for your own personal use
4650 (as e.g. a cron job),
4651 you need to circumvent this by invoking \*(UA like
4654     \fBMAILRC=/dev/null \*(ua \-n\fR
4657 You then need to create a configuration for \*(UA for your script.
4658 This can be done by either pointing the
4659 .I MAILRC
4660 variable to a custom configuration file,
4661 or by passing the configuration in environment variables.
4662 Since many of the configuration options are not valid shell variables, the
4663 .I env
4664 command is useful in this situation.
4665 An invocation could thus look like
4668     \fBenv MAILRC=/dev/null\fR from=\fIscriptreply@domain\fR smtp=\fIhost\fR \e
4669         smtp-auth-user=\fIlogin\fR smtp-auth-password=\fIsecret\fR \e
4670         smtp-auth=\fIlogin\fR \*(ba\fB \-n\fR \-s "\fIsubject\fR" \e
4671         \-a \fIattachment_file\fR \fIrecipient@domain\fR <\fIcontent_file\fR
4672 .SH "SEE ALSO"
4673 fmt(1),
4674 more(1),
4675 newaliases(1),
4676 openssl(1),
4677 pg(1),
4678 sendmail(1)
4679 vacation(1),
4680 ssl(3),
4681 aliases(5),
4682 locale(7),
4683 mailaddr(7)
4684 .SH NOTES
4686 Variables in the environment passed to \*(UA cannot be unset.
4688 The character set conversion relies
4689 on the
4690 .IR iconv (3)
4691 function.
4692 Its functionality differs widely
4693 between the various system environments \*(UA runs on.
4694 If the message `Cannot convert from \fIa\fR to \fIb\fR' appears,
4695 either some characters within the message header or text
4696 are not appropriate for the currently selected terminal character set,
4697 or the needed conversion is not supported by the system.
4698 In the first case,
4699 it is necessary to set
4700 an appropriate LC_CTYPE locale (e.\|g. \fIen_US\fR)
4701 or the
4702 .I ttycharset
4703 variable.
4704 In the second case, the
4705 .I sendcharsets
4707 .I ttycharset
4708 variables must be set to the same value
4709 to inhibit character set conversion.
4711 .I iconv()
4712 is not available at all,
4713 the value assigned to
4714 .I sendcharsets
4715 must match the character set that is used on the terminal.
4717 \*(UA expects input text to be in Unix format,
4718 with lines separated by 
4719 .I newline
4720 (^J, \en) characters only.
4721 Non-Unix text files that use
4722 .I carriage return
4723 (^M, \er)
4724 characters in addition will be treated as binary data;
4725 to send such files as text, strip these characters e.\ g. by
4727     $ tr \-d '\e015' <input | \*(ua .\ .\ .
4730 or fix the tools that generate them.
4732 Limitations with IMAP mailboxes are:
4733 It is not possible to edit messages,
4734 but it is possible to append them.
4735 Thus to edit a message,
4736 create a local copy of it,
4737 edit it, append it,
4738 and delete the original.
4739 The line count for the header display
4740 is only appropriate if the entire message has been downloaded
4741 from the server.
4742 The marking of messages as `new' is performed by the IMAP server;
4743 use of the
4744 .I exit
4745 command instead of
4746 .I quit
4747 will not cause it to be reset,
4748 and if the
4749 .IR autoinc / newmail
4750 variables are unset,
4751 messages that arrived during a session
4752 will not be in state `new' anymore
4753 when the folder is opened again.
4754 Also if commands queued in disconnected mode are committed,
4755 the IMAP server will delete the `new' flag
4756 for all messages in the changed folder,
4757 and new messages will appear as unread
4758 when it is selected for viewing later.
4759 The `flagged', `answered', and `draft' attributes are usually permanent,
4760 but some IMAP servers are known to drop them without notification.
4761 .\" This is why \*(UA does not even check if storing them succeeds.
4762 Message numbers may change with IMAP
4763 every time before the prompt is printed
4764 if \*(UA is notified by the server
4765 that messages have been deleted
4766 by some other client or process.
4767 In this case, `Expunged \fIn\fR messages' is printed,
4768 and message numbers may have changed.
4770 Limitations with POP3 mailboxes are:
4771 It is not possible to edit messages,
4772 they can only be copied and deleted.
4773 The line count for the header display
4774 is only appropriate if the entire message has been downloaded
4775 from the server.
4776 The status field of a message is maintained by the server
4777 between connections;
4778 some servers do not update it at all,
4779 and with a server that does,
4780 the `exit' command will not cause the message status to be reset.
4781 The `newmail' command and the `newmail' variable
4782 have no effect.
4783 It is not possible to rename or to remove POP3 mailboxes.
4785 If a
4786 .SM RUBOUT
4787 (interrupt) is typed while an IMAP or POP3 operation is in progress,
4788 \*(UA will wait until the operation can be safely aborted,
4789 and will then return to the command loop
4790 and print the prompt again.
4791 When a second
4792 .I RUBOUT
4793 is typed while \*(UA is waiting for the operation to complete,
4794 the operation itself will be cancelled.
4795 In this case,
4796 data that has not been fetched yet
4797 will have to be fetched
4798 before the next command can be performed.
4799 If the cancelled operation
4800 was using an SSL/TLS encrypted channel,
4801 an error in the SSL transport will very likely result,
4802 and the connection is no longer usable.
4804 As \*(UA is a mail user agent,
4805 it provides only basic SMTP services.
4806 If it fails to contact its upstream SMTP server,
4807 it will not make further attempts to transfer the message
4808 at a later time,
4809 and it does not leave other information about this condition
4810 than an error message on the terminal
4811 and a `dead.letter' file.
4812 This is usually not a problem if the SMTP server
4813 is located in the same local network
4814 as the computer on which \*(UA is run.
4815 However, care should be taken when using a remote server of an ISP;
4816 it might be better to set up a local SMTP server then
4817 which just acts as a proxy.
4819 \*(UA immediately contacts the SMTP server (or \fIsendmail(1)\fR)
4820 even when operating in
4821 .I disconnected
4822 mode.
4823 It would not make much sense for \*(UA to defer outgoing mail
4824 since SMTP servers usually provide
4825 much more elaborated delay handling
4826 than \*(UA could perform as a client.
4827 Thus the recommended setup for sending mail in
4828 .I disconnected
4829 mode is to configure a local SMTP server
4830 such that it sends outgoing mail
4831 as soon as an external network connection is available again,
4832 i.\|e. to advise it to do that from a network startup script.
4834 The junk mail filter follows the concepts developed by
4835 Paul Graham in his articles,
4836 ``A Plan for Spam'', August 2002,
4837 \%<http://www.paulgraham.com/spam.html>,
4838 and ``Better Bayesian Filtering'', January 2003,
4839 \%<http://www.paulgraham.com/better.html>.
4840 Chained tokens are due to a paper by
4841 Jonathan A. Zdziarski,
4842 ``Advanced Language Classification using Chained Tokens'',
4843 February 2004,
4844 \%<http://www.nuclearelephant.com/papers/chained.html>.
4846 A \fImail\fR command appeared in Version 1 AT&T Unix.
4847 Berkeley Mail was written in 1978 by Kurt Shoens.
4848 This man page is derived from
4849 from The Mail Reference Manual
4850 originally written by Kurt Shoens.
4851 \fIHeirloom Mailx\fR enhancements are maintained and documented
4852 by Gunnar Ritter.
4853 \fIS-nail\fR enhancements are maintained and documented
4854 by Steffen "Daode" Nurpmeso.
4856 Portions of this text are reprinted and reproduced in electronic form
4857 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
4858 \(em Operating System Interface (POSIX), The Open Group Base
4859 Specifications Issue 6, Copyright \(co 2001-2003 by the Institute of
4860 Electrical and Electronics Engineers, Inc and The Open Group. In the
4861 event of any discrepancy between this version and the original IEEE and
4862 The Open Group Standard, the original IEEE and The Open Group Standard
4863 is the referee document. The original Standard can be obtained online at
4864 \%<http://www.opengroup.org/unix/online.html>.
4865 Redistribution of this material is permitted so long as this notice remains
4866 intact.