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