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