colour_table_create(): auto-enable $TERMs named "color" (Gavin Troy)
[s-mailx.git] / nail.1
blobae2a22353e17cb70f44b6600d08afee3b0c932fa
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 - 2014 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\"    notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\"    notice, this list of conditions and the following disclaimer in the
14 .\"    documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\"    must display the following acknowledgement:
17 .\"     This product includes software developed by the University of
18 .\"     California, Berkeley and its contributors.
19 .\"     This product includes software developed by Gunnar Ritter
20 .\"     and his contributors.
21 .\" 4. Neither the name of the University nor the names of its contributors
22 .\"    may be used to endorse or promote products derived from this software
23 .\"    without specific prior written permission.
24 .\"
25 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS '\fIAS IS\fR' AND
26 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" SUCH DAMAGE.
36 .\"
37 .Dd Jun 03, 2014
38 .\"--MKMAN-START--
39 .ds UU \\%S-NAIL
40 .ds UA \\%S-nail
41 .ds UV \\%S-nail dirty
42 .ds ua \\%s-nail
43 .ds UR \\%s-nail.rc
44 .\"--MKMAN-END--
45 .\" If not ~/.mailrc, it breaks POSIX compatibility.  And adjust main.c.
46 .ds ur \\%~/.mailrc
47 \."
48 .ds OP [Option]
49 .ds IN [v15-compat]
50 .ds OU [no v15-compat]
51 \."
52 .Dt "\*(UU" 1
53 .Sh NAME
54 .Nm \*(UV
55 .Nd send and receive Internet mail
56 .\"
57 .\" .Sh SYNOPSIS {{{
58 .Sh SYNOPSIS
59 .Nm \*(ua
60 .Op Fl BDdEFintv~
61 .Op Fl A Ar account
62 .Op Fl a Ar attachment
63 .Op Fl b Ar bcc-addr
64 .Op Fl c Ar cc-addr
65 .Op Fl q Ar quote-file
66 .Op Fl r Ar from-addr
67 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
68 .Op Fl s Ar subject
69 .Bk
70 .Ar to-addr ...
71 .Ek
72 .Bk
73 .Op Fl - Ar mta-option ...
74 .Ek
75 .Nm \*(ua
76 .Op Fl BDdEeHiNnRv~#
77 .Op Fl A Ar account
78 .Op Fl L Ar spec-list
79 .Bk
80 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
81 .Ek
82 .Bk
83 .Fl f Op Ar file
84 .Ek
85 .Bk
86 .Op Fl - Ar mta-option ...
87 .Ek
88 .Nm \*(ua
89 .Op Fl BDdEeHiNnRv~#
90 .Op Fl A Ar account
91 .Op Fl L Ar spec-list
92 .Op Fl S Ar variable Ns Op Ns = Ns Ar value
93 .Op Fl u Ar user
94 .Bk
95 .Op Fl - Ar mta-option ...
96 .Ek
97 .\"
98 .\" --  >8  --  8<  --
99 .\"
100 .Sh DESCRIPTION
101 .Bd -filled -offset indent -compact
102 .Sy Compatibility note:
103 \*(UA and part of its configuration syntax will change in v15.0.
104 Until then there will exist a partial but growing number of
105 backward and forward compatibility configuration options.
106 To choose the new syntax and behaviour already today, the binary option
107 .Va v15-compat
108 must be set.
109 The manual will refer to it via \*(IN and \*(OU as necessary.
112 \*(UA is a mail processing system with a command syntax reminiscent of
113 .Xr ed 1
114 with lines replaced by messages.
115 It is intended to provide the functionality of the POSIX
116 .Xr mailx 1
117 command and offers (mostly optional) extensions for line editing, IDNA,
118 MIME, S/MIME, SMTP and POP3 (and IMAP).
119 It is usable as a mail batch language.
121 In the following list of supported command line options,
122 .Fl D ,
123 .Fl d ,
124 .Fl E ,
125 .Fl i ,
126 .Fl N
128 .Fl v
129 are implemented by means of setting the respective option, as via
130 .Fl S .
132 .Op Ar mta-option ...
134 arguments that are given at the end of the command line after an `--'
135 separator persist for an entire (interactive) session and will be passed
136 through unchanged to the mail-transfer-agent (MTA).
137 Additional MTA arguments can be specified via the option
138 .Va sendmail-arguments .
139 All of these are ignored when mail is send via SMTP data transfer.
140 .\" ---
141 .Bl -tag -width ".Fl A Ar account"
142 .It Fl A Ar account
143 Executes an
144 .Ic account
145 command (see below) for
146 .Ar account
147 after the startup files have been read.
148 .It Fl a Ar file
149 Attach the given file to the message.
150 The same filename conventions as described in the section
151 .Sx "Commands"
152 apply.
153 .It Fl B
154 Make standard input and standard output line-buffered.
155 .It Fl b Ar address
156 Send blind carbon copies to the given list of addresses.
157 .Sx "Sending mail"
158 below goes into more detail on that.
159 .It Fl c Ar address
160 Send carbon copies to the given list of addresses.
161 .It Fl D
162 \*(OP Set the
163 .Va disconnected
164 variable.
165 .It Fl d
166 Set the
167 .Va debug
168 variable, which enables debug messages and disables message delivery.
169 Note that this is not a real `sandbox' mode.
170 .It Fl E
171 Set the
172 .Va skipemptybody
173 variable and thus discard messages with an empty message part body.
174 This is useful for sending messages from scripts.
175 .It Fl e
176 Just check if mail is present in the system mailbox.
177 If yes, return an exit status of zero, a non-zero value otherwise.
178 .It Fl F
179 Save the message to send in a file named after the local part of the
180 first recipient's address.
181 .It Fl f Op Ar file
182 Read in the contents of the user's mbox (or the specified file)
183 for processing;
184 when \*(UA is quit, it writes undeleted messages back to this file.
185 The string
186 .Ar file
187 is interpreted as described for the
188 .Ic folder
189 command below.
190 Note that
191 .Ar file
192 is not a direct argument to the flag
193 .Fl f ,
194 but is instead taken from the command line after option processing has
195 been completed.
196 .It Fl H
197 Print a header summary of all messages and exit.
198 A configurable summary view is available via the
199 .Fl L
200 option.
201 .It Fl i
202 Set the
203 .Va ignore
204 variable to ignore tty interrupt signals.
205 .It Fl L Ar spec-list
206 Print a header summary of only those messages that match the given
207 .Ar spec-list ,
208 then exit.
209 See the section
210 .Sx "Specifying messages"
211 for the format of
212 .Ar spec-list .
213 If the
214 .Fl H
215 option has been given in addition to
216 .Fl L ,
217 then printing of the header summary is suppressed,
218 and \*(UA will instead indicate via its exit status wether
219 .Ar spec-list
220 matched any messages (`0') or not (`1');
221 note that messages are forcefully suppressed, then, and unless verbosity
222 is explicitly enabled (e.g., by using the
223 .Fl v
224 option).
225 .It Fl N
226 Unset the
227 .Va header
228 variable and thus inhibits the initial display of message headers when
229 reading mail or editing a mail folder.
230 .It Fl n
231 Inhibits reading \*(UR upon startup.
232 This option should be activated for \*(UA scripts that are invoked on
233 more than one machine, because the contents of that file may differ
234 between them.
235 (The same behaviour can be achieved by setting the
236 .Ev NAIL_NO_SYSTEM_RC
237 environment variable.)
238 .It Fl q Ar file
239 Start the message with the contents of the specified file.
240 May be given in send mode only.
241 .It Fl R
242 Opens any folders read-only.
243 .It Fl r Ar address
244 Sets the envelope sender address by passing an
245 .Ns ` Ns Fl f
246 .Ar address Ns '
247 option to the MTA when a message is send.
248 If a non-empty
249 .Ar address
250 argument is given it'll be checked for validity and then fixated to
251 the given value, but otherwise the content of the variable
252 .Va from
253 will be used for that purpose \(en i.e., it'll be passed through to
254 the MTA via the
255 .Fl f
256 option whenever a message is send.
257 A valid non-empty value will also be set as if an additional
258 .Ns ` Ns Li "-Sfrom=VALUE" Ns '
259 option had been used and therefore affect sending of messages via SMTP
260 (as a consideration for `From:').
261 .It Fl S Ar variable Ns Op = Ns value
262 Sets the internal option
263 .Ar variable
264 and, in case of a value option, assigns
265 .Ar value
266 to it.
267 Even though options set via
268 .Fl S
269 may be overwritten from within resource files,
270 the command line setting will be reestablished after all resources have
271 been loaded.
272 .It Fl s Ar subject
273 Specify the subject on the command line
274 (be careful to quote subjects containing spaces).
275 .It Fl t
276 The message to be sent is expected to contain a message header with
277 `To:', `Cc:', or `Bcc:' fields giving its recipients and `Subject:'
278 giving the subject of the message.
279 Recipients and subject specified on the command line are ignored.
280 .It Fl u Ar user
281 Read the system mailbox of
282 .Ar user
283 (appropriate privileges presumed), and `assume to be'
284 .Ar user
285 in some aspects, e.g. in respect to expansions of `%' etc.
286 Also see
287 .Ev USER .
288 .It Fl V
289 Print \*(UA's version and exit.
290 .It Fl v
291 Setting the
292 .Va verbose
293 option causes some verbosity (like printing of certificate chains).
294 Using it twice increases the level of verbosity.
295 .It Fl ~
296 Enable tilde escapes even if not in interactive mode.
297 .It Fl #
298 This sets multiple options to prepare \*(UA for working in batch mode
299 (most likely in non-interactive mode):
300 .Va dot ,
301 .Va emptystart ,
302 .Va noheader ,
303 .Va quiet ,
304 .Va sendwait ,
305 as well as
306 .Va MBOX
308 .Va folder
310 .Pa /dev/null .
311 it also enables processing of tilde escapes.
312 E.g., the following should send an email message to `alias'.
314 .Dl printf 'm alias\en~s Subject\enBody\en.\enx\en' | \
315    MAILRC=/dev/null s-nail -n -#
317 .\" }}}
319 .\" .Ss "Sending mail" {{{
320 .Ss "Sending mail"
321 To send a message to one or more people,
322 \*(UA can be invoked with arguments which are the names of people to
323 whom the mail will be sent.
324 These names may be
325 .Ic alias Ns
326 es, plain addresses or full address specifications including user names
327 and comments,
328 in which case care for proper quoting may be necessary.
329 If this manual refers to a \fIlist of addresses\fR,
330 then \*(UA expects a comma-separated list of such names.
331 The section
332 .Sx "Recipient address specifications"
333 below explains the interpretation of names in more detail.
334 The user is then expected to type in his message, followed by a
335 .Li `control-D'
336 (`^D') at the beginning of a line.
337 The section
338 .Sx "Replying to or originating mail"
339 describes some features of \*(UA available to help when composing
340 letters.
341 .\" }}}
343 .\" .Ss "Reading mail" {{{
344 .Ss "Reading mail"
345 When invoked without addressees \*(UA enters interactive mode in which
346 mails may be read.
347 When used like that \*(UA checks the user's mail out of the post office,
348 then prints out a one line header of each message found.
349 Unless the
350 .Va emptystart
351 option is set \*(UA will only print a notification message and exit if
352 the mailbox is empty.
353 Messages are given numbers (starting at 1) which uniquely identify
354 messages; the current message \(en the dot \(en will be the first
355 message unless the option
356 .Va showlast
357 is set, in which case the last message will be initial dot.
358 (Note this only applies to boxes with all-unread messages.
359 Boxes opened regulary, e.g., via the `-f' command line option, will have
360 the initial dot point to the first unread message.)
362 Messages can be printed with the
363 .Ic print
364 command, or short: `p'.
365 By default the current message (dot) is printed, but just like many
366 other commands it is possible to specify lists of messages, as is
367 documented in
368 .Sx "Specifying messages" ;
369 e.g., `p:u' will display all unread messages, `p.' will print the dot,
370 `p 1 5' will print the messages 1 and 5 and `p-' and `p+' will print the
371 last and the next message, respectively.
372 Dependent upon the configuration a
373 .Sx "Command line editor"
374 aims at making user experience with the many
375 .Sx "Commands"
376 a bit nicer.
377 .\" }}}
379 .\" .Ss "Disposing of mail" {{{
380 .Ss "Disposing of mail"
381 After examining a message the user can
382 .Ic delete
383 (`d') the message or
384 .Ic reply
385 (`r') to it.
386 Deletion causes the \*(UA program to forget about the message.
387 This is not irreversible;
388 one can
389 .Ic undelete
390 (`u') the message by giving its number,
391 or the \*(UA session can be ended by giving the
392 .Ic exit
393 (`x') command.
394 Deleted messages will, however, usually disappear never to be seen
395 again.
396 .\" }}}
398 .\" .Ss "Specifying messages" {{{
399 .Ss "Specifying messages"
400 Commands such as print and delete can be given a list of message numbers
401 as arguments to apply to a number of messages at once.
402 Thus
403 .Ns ` Ns Li "delete 1 2" Ns '
404 deletes messages 1 and 2,
405 whereas
406 .Ns ` Ns Li "delete 1-5" Ns '
407 will delete the messages 1 through 5.
408 In sorted or threaded mode (see the
409 .Ic sort
411 .Ic thread
412 commands),
413 .Ns ` Ns Li "delete 1-5" Ns '
414 will delete the messages that are located between (and including)
415 messages 1 through 5 in the sorted/threaded order, as shown in the
416 header summary.
417 The following special message names exist:
418 .\" ---
419 .Bl -tag -width ".It .Ar :n:u"
420 .It Ar :n
421 All new messages.
422 .It Ar :o
423 All old messages (any not in state read or new).
424 .It Ar :u
425 All unread messages.
426 .It Ar :d
427 All deleted messages (for the
428 .Ic undelete
429 command).
430 .It Ar :r
431 All read messages.
432 .It Ar :f
433 All `flagged' messages.
434 .It Ar :a
435 All answered messages
436 (cf. the
437 .Va markanswered
438 variable).
439 .It Ar :t
440 All messages marked as draft.
441 .It Ar :s
442 \*(OP All messages classified as spam.
443 .It Ar \&.
444 The current message.
445 .It Ar \&;
446 The message that was previously the current message.
447 .It Ar \&,
448 The parent message of the current message,
449 that is the message with the Message-ID given in the `In-Reply-To:' field
450 or the last entry of the `References:' field of the current message.
451 .It Ar -
452 The next previous undeleted message,
453 or the next previous deleted message for the
454 .Ic undelete
455 command.
456 In sorted/threaded mode,
457 the next previous such message in the sorted/threaded order.
458 .It Ar +
459 The next undeleted message,
460 or the next deleted message for the
461 .Ic undelete
462 command.
463 In sorted/threaded mode,
464 the next such message in the sorted/threaded order.
465 .It Ar ^
466 The first undeleted message,
467 or the first deleted message for the
468 .Ic undelete
469 command.
470 In sorted/threaded mode,
471 the first such message in the sorted/threaded order.
472 .It Ar $
473 The last message.
474 In sorted/threaded mode,
475 the last message in the sorted/threaded order.
476 .It Ar & Ns Ar x
477 In threaded mode,
478 selects the message addressed with
479 .Ar x ,
480 where
481 .Ar x
482 is any other message specification,
483 and all messages from the thread that begins at it.
484 Otherwise it is identical to
485 .Ar x .
487 .Ar x
488 is omitted,
489 the thread beginning with the current message is selected.
490 .It Ar *
491 All messages.
492 .It Ar `
493 All messages that were included in the message list for the previous
494 command.
495 .It Ar / Ns Ar string
496 All messages that contain
497 .Ar string
498 in the subject field (case ignored).
499 See also the
500 .Va searchheaders
501 variable.
503 .Ar string
504 is empty,
505 the string from the previous specification of that type is used again.
506 .It Xo Op Ar @ Ns Ar name-list Ns
507 .Ar @ Ns Ar expr
509 All messages that contain the given case-insensitive search
510 .Ar expr Ns
511 ession; if the \*(OPal regular expression (see
512 .Xr re_format 7 )
513 support is available
514 .Ar expr
515 will be interpreted as one if any of the `magic'al regular expression
516 characters is seen.
517 If the optional
518 .Ar @ Ns Ar name-list
519 part is missing, the search is restricted to the subject field body,
520 but otherwise
521 .Ar name-list
522 specifies a comma-separated list of header fields to search, as in
524 .Dl '@to,from,cc@Someone i ought to know'
526 The special name `header' (or `<') can be used to search in the header
527 of the message, and the special names `body' (or `>') and `text' (or `=')
528 can be used to perform full text searches \(en whereas the former
529 searches only the body, the latter also searches the message header.
530 In order to search for a string that includes a `@' (commercial at)
531 character the
532 .Ar name-list
533 is effectively non-optional, but may be given as the empty string.
534 .It Ar address
535 All messages from
536 .Ar address .
537 By default, this is a case-sensitive search for the complete email
538 address.
539 If the
540 .Va allnet
541 variable is set,
542 only the local part of the addresses is evaluated for the comparison.
543 Otherwise if the
544 .Va showname
545 variable is set,
546 a case-sensitive search for the complete real name of a sender is
547 performed.
548 The IMAP-style
549 .Ns ` Ns Li "(from address)" Ns '
550 expression can be used instead if substring matches are desired.
552 .\" ---
554 \*(OP IMAP-style SEARCH expressions may also be used.
555 This addressing mode is available with all types of folders;
556 for folders not located on IMAP servers,
557 or for servers unable to execute the SEARCH command,
558 \*(UA will perform the search locally.
559 Strings must be enclosed by double quotes `"' in their entirety
560 if they contain white space or parentheses;
561 within the quotes,
562 only backslash `\e' is recognized as an escape character.
563 All string searches are case-insensitive.
564 When the description indicates that the `envelope' representation of an
565 address field is used,
566 this means that the search string is checked against both a list
567 constructed as
569 .Dl ( \*q Ns name Ns \*q \*q Ns source Ns \*q \*q Ns \
570     local-part Ns \*q \*q Ns domain-part Ns \*q )
572 for each address,
573 and the addresses without real names from the respective header field.
574 These search expressions can be nested using parentheses, see below for
575 examples.
576 .Bl -tag -width ".It .Ar :n:u"
577 .It Ar ( criterion )
578 All messages that satisfy the given
579 .Ar criterion .
580 .It Ar ( criterion1 criterion2 ... criterionN )
581 All messages that satisfy all of the given criteria.
582 .It Ar ( or criterion1 criterion2 )
583 All messages that satisfy either
584 .Ar criterion1
586 .Ar criterion2 ,
587 or both.
588 To connect more than two criteria using `or',
589 (or) specifications have to be nested using additional parentheses,
590 as with
591 .Ns ` Ns Li "(or a (or b c))" Ns ',
592 since
593 .Ns ` Ns Li "(or a b c)" Ns '
594 really means
595 .Ns ` Ns Li "((a or b) and c)" Ns '.
596 For a simple `or' operation of independent criteria on the lowest
597 nesting level,
598 it is possible to achieve similar effects by using three separate
599 criteria, as with
600 .Ns ` Ns Li "(a) (b) (c)" Ns '.
601 .It Ar ( not criterion )
602 All messages that do not satisfy
603 .Ar criterion .
604 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
605 All messages that contain
606 .Ar string
607 in the `envelope' representation of the `Bcc:' field.
608 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
609 All messages that contain
610 .Ar string
611 in the `envelope' representation of the `Cc:' field.
612 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
613 All messages that contain
614 .Ar string
615 in the `envelope' representation of the `From:' field.
616 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
617 All messages that contain
618 .Ar string
619 in the `Subject:' field.
620 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
621 All messages that contain
622 .Ar string
623 in the `envelope' representation of the `To:' field.
624 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
625 All messages that contain
626 .Ar string
627 in the specified
628 .Ar Name:
629 field.
630 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
631 All messages that contain
632 .Ar string
633 in their body.
634 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
635 All messages that contain
636 .Ar string
637 in their header or body.
638 .It Ar ( larger size )
639 All messages that are larger than
640 .Ar size
641 (in bytes).
642 .It Ar ( smaller size )
643 All messages that are smaller than
644 .Ar size
645 (in bytes).
646 .It Ar ( before date )
647 All messages that were received before
648 .Ar date ,
649 which must be in the form
650 .Li "d[d]-mon-yyyy" ,
651 where `d' denotes the day of the month as one or two digits,
652 `mon' is the name of the month \(en one of
653 `Jan', `Feb', `Mar', `Apr', `May', `Jun',
654 `Jul', `Aug', `Sep', `Oct', `Nov', or `Dec',
655 and `yyyy' is the year as four digits, e.g., "28-Dec-2012".
656 .It Ar ( on date )
657 All messages that were received on the specified date.
658 .It Ar ( since date )
659 All messages that were received since the specified date.
660 .It Ar ( sentbefore date )
661 All messages that were sent on the specified date.
662 .It Ar ( senton date )
663 All messages that were sent on the specified date.
664 .It Ar ( sentsince date )
665 All messages that were sent since the specified date.
666 .It Ar ()
667 The same criterion as for the previous search.
668 This specification cannot be used as part of another criterion.
669 If the previous command line contained more than one independent
670 criterion then the last of those criteria is used.
672 .\" }}}
674 .\" .Ss "Replying to or originating mail" {{{
675 .Ss "Replying to or originating mail"
676 The command
677 .Ic reply
678 can be used to set up a response to a message,
679 sending it back to the person who it was from.
680 Text the user types in, up to an end-of-file,
681 defines the contents of the message.
682 While the user is composing a message \*(UA treats lines beginning with
683 the character `~' specially.
684 For instance, typing `~m' (alone on a line) will place a copy of the
685 current message into the response, each line prefixed by the value of
686 .Va indentprefix .
687 Other escapes will set up subject fields,
688 add and delete recipients to the message,
689 attach files to it
690 and allow the user to escape to an editor to revise the message
691 or to a shell to run some commands.
692 (These options are given in the summary below.)
693 .\" }}}
695 .\" .Ss "Ending a mail processing session" {{{
696 .Ss "Ending a mail processing session"
697 The user can end a \*(UA session by issuing the
698 .Ic quit
699 (`q') command.
700 Messages which have been examined go to the user's mbox file unless they
701 have been deleted,
702 in which case they are discarded.
703 Unexamined messages go back to the post office.
704 (Also see the
705 .Fl f
706 option above.)
707 When command line history is tracked, an updated history file is
708 written.
709 None of these actions is performed when the command
710 .Ic exit
711 (`x') is used instead of
712 .Ic quit
713 (`q').
714 .\" }}}
716 .\" .Ss "Personal and systemwide distribution lists" {{{
717 .Ss "Personal and systemwide distribution lists"
718 It is possible to create personal distribution lists so that,
719 for instance, the user can send mail to `cohorts'
720 and have it go to a group of people.
721 Such lists can be defined via the
722 .Ic alias
723 command by, e.g., placing lines like
725 .Dl alias cohorts bill ozalp jkf mark kridle@ucbcory
727 in the file \*(ur in the user's home directory.
728 Using
729 .Ic alias
730 without arguments lists all the currently known aliases.
732 Please note that this mechanism has nothing in common with the system
733 wide aliases that may be used by the local MTA (mail-transfer-agent)
734 and are often tracked in a file
735 .Pa /etc/aliases
736 (and documented in
737 .Xr aliases 5
739 .Xr sendmail 1 Ns
741 Personal aliases will be expanded by \*(UA before the message is sent.
742 They are a convenient alternative to specifying each addressee by
743 itself.
744 .\" }}}
746 .\" .Ss "Recipient address specifications" {{{
747 .Ss "Recipient address specifications"
748 When an address is used to name a recipient (in `To:', `Cc:', or `Bcc:'),
749 names of local mail folders and pipes to external commands may also be
750 specified \(en the message text is then written to them.
751 The rules are: Any name which starts with a `|' (vertical bar) character
752 specifies a pipe \(en the command string following the `|' is executed
753 and the message is sent to its standard input;
754 any other name which contains a `@' (at sign) character is treated as
755 a mail address;
756 any other name which starts with a `+' (plus sign) character specifies
757 a folder name;
758 any other name which contains a `/' (slash) character but no `!'
759 (exclamation mark) or `%' (percent sign) character before also specifies
760 a folder name;
761 what remains is treated as a mail address.
762 Compressed folders are handled as described for the
763 .Ic folder
764 command.
765 .\" }}}
767 .\" .Ss "Network mail (Internet / ARPA, UUCP, Berknet)" {{{
768 .Ss "Network mail (Internet / ARPA, UUCP, Berknet)"
770 .Xr mailaddr 7
771 for a description of network addresses.
772 If support for IDNA (internationalized domain names for applications)
773 has been compiled into \*(UA,
774 then the domain name part of network addresses will be converted via
775 IDNA mechanisms as necessary, effectively treating it as a name in the
776 .Va ttycharset
777 character set; see
778 .Sx "Character sets"
779 for the complete picture about character sets.
781 \*(UA has a number of options which can be set in the \*(ur file
782 to alter its behavior; e.g.,
783 .Ic "set askcc"
784 enables the
785 .Va askcc
786 feature, and
787 .Ic "set idna-disable"
788 will disable the mentioned IDNA conversion even if support is available.
789 (These options are summarized below.)
790 .\" }}}
792 .\" .Ss "URL syntax" {{{
793 .Ss "URL syntax"
794 \*(IN For accessing protocol-specific resources, like an IMAP mailbox,
795 usage of compact and standardized Uniform Resource Locators (URL) has
796 become omnipresent.
797 \*(UA expects and understands URLs in the following form;
798 parts in brackets `[]' denote optional parts, optional either because
799 there also exist other ways to define the information in question or
800 because support of the part is protocol-specific \(en
801 e.g., `/path' is used by the IMAP protocol but not by POP3.
803 .Dl PROTO://[USER[:PASSWORD]@]server[:port][/path]
805 In general \*(UA adheres to the following logic scheme when dealing with
806 the necessary informations of a resource:
807 .Bl -bullet -offset indent
809 If no `USER' is given: a variable of the scheme
810 .Va user-HOST
811 is looked up (`HOST' relates to the `server' specified in the URL),
812 followed by the plain
813 .Va user ,
814 which in turn defaults to
815 .Va USER
816 which, again, defaults to `getpwuid(getuid())' a.k.a. the current user.
818 If no `PASSWORD' is given: a variable
819 .Va password-USER@HOST
820 is looked up (`HOST' again is the one found in the URL, `USER' is the
821 result of the user lookup described in the former item),
822 followed by the global
823 .Va password ;
824 if still no password is available afterwards, but the (protocols')
825 chosen authentication type requires a password, the user will be
826 prompted on the terminal.
828 Authentication: unless otherwise noted this will first look for
829 .Va PROTO-auth-USER@HOST ,
830 then
831 .Va PROTO-auth-HOST
832 and finally
833 .Va PROTO-auth ,
834 which has a protocol-specific default should none of the variables be
835 set.
838 Note:
839 For SMTP the rules are a bit more complicated, since \*(UA will always
840 work relative to
841 .Va from
842 instead of a given SMTP account in respect to S/MIME
843 .Ns ( Va smime-sign
845 .Va smime-sign-include-certs )
846 \(en this is because S/MIME verification works relative to the values
847 found in `From:' (or `Sender:').
848 .\" }}}
850 .\" .Ss "MIME types" {{{
851 .Ss "MIME types"
852 For any outgoing attachment \*(UA tries to determine the content type.
853 It does this by reading MIME type files whose lines have the following
854 syntax:
856 .Dl type/subtype        extension [extension ...]
858 where `type/subtype' are strings describing the file contents,
859 and `extension' is the part of a filename starting after the last dot.
860 Any line not immediately beginning with an ASCII alphabetical character
861 is ignored by \*(UA.
862 The variable
863 .Va mimetypes-load-control
864 can be used to control the sources of MIME types, and the
865 .Ic mimetypes
866 command can be used to show the list of mime types known to \*(UA.
867 If there is a match with the `extension' of the file to attach,
868 the given `type/subtype' pair is used.
869 Otherwise, or if the filename has no extension,
870 the content types `text/plain' or `application/octet-stream' are used,
871 dependent upon file content inspection.
872 Also see
873 .Va mime-allow-text-controls .
874 .\" }}}
876 .\" .Ss "Character sets" {{{
877 .Ss "Character sets"
878 \*(OP \*(UA detects the character set of the terminal by using
879 mechanisms that are controlled by the
880 .Va LC_CTYPE
881 locale setting
882 (the manual for
883 .Xr setlocale 3
884 should give an overview); the \*(UA internal variable
885 .Va ttycharset
886 will be set to the detected terminal character set accordingly
887 and will thus show up in the output of the command
888 .Ic set .
890 However, a user supplied
891 .Va ttycharset
892 value is not overwritten by this detection mechanism;
893 this feature must be used if the detection doesn't work properly,
894 and it may be used to adjust the name of the locale character set.
895 E.g., on BSD systems one may use a locale with the character set
896 `ISO8859-1', which is not a valid name for this character set;
897 to be on the safe side, one may set
898 .Va ttycharset
899 to the correct name, `ISO-8859-1'.
901 Note that changing the value doesn't mean much beside that,
902 since several aspects of the real character set are implied by the
903 locale environment of the system,
904 and that stays unaffected by the content of an overwritten
905 .Va ttycharset
906 variable.
907 (This is mostly an issue when interactively using \*(UA, though.
908 It is actually possible to send mail in a completely "faked" locale
909 environment.)
911 If no character set conversion capabilities have been compiled into
912 \*(UA (i.e., no
913 .Xr iconv 3
914 library has been found), then
915 .Va ttycharset
916 will be the only supported character set,
917 it is simply assumed that it can be used to exchange 8 bit messages,
918 and the rest of this section does not apply;
919 it may however still be necessary to explicitly set it if automatic
920 detection fails, since in that case it defaults to `ISO-8859-1'.
922 When reading messages, their text is converted into
923 .Va ttycharset
924 as necessary in order to display them on the users terminal.
925 Unprintable characters and invalid byte sequences are detected
926 and replaced by proper substitution characters
927 (unless the variable
928 .Va print-all-chars
929 was set once \*(UA was started).
931 When sending messages all their parts and attachments are classified.
932 Whereas no character set conversion is performed on those parts which
933 appear to be binary data,
934 the character set being used must be declared within the MIME header of
935 an outgoing text part if it contains characters that do not conform to
936 the set of characters that are allowed by the email standards.
937 Permissible values for character sets can be declared using the
938 .Va sendcharsets
939 variable, and
940 .Va charset-8bit ,
941 which defines a catch-all last-resort fallback character set that is
942 implicitly appended to the list of character-sets in
943 .Va sendcharsets .
945 All the specified character sets are tried in order unless the
946 conversion of the part or attachment succeeds.
947 If none of the tried (8 bit) character sets is capable to represent the
948 content of the part or attachment,
949 then the message will not be sent and its text will be saved to
950 .Va DEAD .
951 In general, if the message `Cannot convert from a to b' appears, either
952 some characters are not appropriate for the currently selected
953 (terminal) character set,
954 or the needed conversion is not supported by the system.
955 In the first case, it is necessary to set an appropriate `LC_CTYPE'
956 locale and/or the variable
957 .Va ttycharset .
959 The best results are usually achieved when \*(UA is run in a UTF-8
960 locale on a UTF-8 capable terminal,
961 in which case the full Unicode spectrum of characters is available.
962 In this setup characters from various countries can be displayed,
963 while it is still possible to use more simple character sets for sending
964 to retain maximum compatibility with older mail clients.
965 .\" }}}
967 .\" .Ss "Command line editor" {{{
968 .Ss "Command line editor"
969 \*(OP \*(UA can be configured to support a command line editor and
970 command history lists which are saved in between sessions.
971 One may link against fully-fledged external libraries
972 .Ns ( Ns Xr readline 3 ,
973 .Xr editline 3 Ns
974 ) or use \*(UA's own command line editor NCL (nail-command-line)
975 instead, which should work in all environments which comply to ISO
976 C (ISO/IEC 9899:1990/Amendment 1:1995).
977 When an external library is used, interactive behaviour of \*(UA relies
978 on that library and may not correspond one-to-one to what is described
979 in this manual.
981 Regardless of the actually used command line editor history entries
982 will be created for lines entered in command mode only, and creation of
983 such an entry can be forcefully suppressed by starting the line with
984 a space character.
985 Note that history handling is by itself an optional feature and may
986 therefore not be available.
987 For more information see the documentation of the options
988 .Va emptystart ,
989 .Va history-gabby ,
990 .Va line-editor-disable ,
991 .Va NAIL_HISTFILE
993 .Va NAIL_HISTSIZE .
995 The builtin \*(UA command line editor supports the following operations;
996 the notation `^-character' stands for the combination of the `control'
997 key plus the mentioned character, e.g., `^A' means "hold control key
998 while adding an A key on top of it":
999 .Bl -tag -width "^M^"
1000 .It ^A
1001 Go to the start of the line.
1002 .It ^B
1003 Move the cursor backward one character.
1004 .It ^D
1005 Forward delete the character under the cursor;
1006 quits \*(UA if used on the empty line, unless the
1007 .Va ignoreeof
1008 option is set.
1009 .It ^E
1010 Go to the end of the line.
1011 .It ^F
1012 Move the cursor forward one character.
1013 .It ^G
1014 Cancel current operation, full reset.
1015 If there is an active history search or tabulator expansion then this
1016 command will first reset that, reverting to the former line content;
1017 thus a second reset is needed for a full reset in this case.
1018 In all cases \*(UA will reset a possibly used multibyte character input
1019 state machine.
1020 .It ^H
1021 The same as `backspace': backward delete one character.
1022 .It ^I
1023 \*(OP The same as `horizontal tabulator': try to expand the "word"
1024 before the cursor.
1025 Here "expansion" refers to the \*(UA expansion, as documented for
1026 .Ic folder ,
1027 and thus includes shell word expansion (as a last step).
1028 I.e., this is \*(UA "expansion", not what one usually expects from
1029 "tab-completion".
1030 .It ^J
1031 The same as `ENTER': complete this line of input.
1032 .It ^K
1033 Delete all characters from the cursor to the end of the line.
1034 .It ^L
1035 Repaint the line.
1036 .It ^N
1037 \*(OP Go to the next history entry.
1038 .It ^P
1039 \*(OP Go to the previous history entry.
1040 .It ^R
1041 \*(OP Complete the current line from (the remaining older) history entries.
1042 .It ^U
1043 The same as `^A' followed by `^K'.
1044 .It ^W
1045 Delete the characters from the one preceding the cursor to the preceding
1046 word boundary.
1047 .It ^X
1048 Move the cursor forward one word boundary.
1049 .It ^Y
1050 Move the cursor backward one word boundary.
1053 If problems with commands that are based upon rightwise movement are
1054 encountered, adjustments of the option
1055 .Va line-editor-cursor-right
1056 may solve the problem, as documented for it.
1058 If the terminal produces key sequences which are compatible with
1059 .Xr xterm 1
1060 then the left and right cursor keys will map to `^B' and `^F',
1061 respectively, the up and down cursor keys will map to `^P' and `^N',
1062 and the Home/End/PgUp/PgDown keys will call the
1063 .Ic z
1064 command with the respective arguments `0', `$', `-' and `+'
1065 (i.e., perform scrolling through the header summary list).
1066 .\" }}}
1068 .\" .Ss "Coloured message display" {{{
1069 .Ss "Coloured message display"
1070 \*(OP \*(UA can be configured to support coloured message display.
1071 Colours are used only when the
1072 .Va TERM
1073 environment variable is set and the terminal type can be found in
1074 .Va colour-terms
1075 (or includes the string "color").
1076 On top of that the binary option
1077 .Va colour-pager
1078 defines wether ANSI colour sequences are generated when the output
1079 of a command needs to go through the
1080 .Va PAGER
1081 (also see
1082 .Va crt Ns
1083 ); this is not enabled by default.
1085 "Coloured message display" can be configured through font attributes
1086 (`ft=' \(en `bold', `invers' and `underline'), foreground (`fg=') and
1087 background (`bg=') colours (`black', `blue', `green', `red', `brown',
1088 `magenta', `cyan' and `white').
1089 Multiple specifications can be joined in a comma separated list, as in
1091 .Dl set colour-msginfo="ft=bold,fg=magenta,bg=cyan"
1093 Options to be set are
1094 .Va colour-msginfo ,
1095 .Va colour-partinfo ,
1096 .Va colour-from_ ,
1097 .Va colour-header
1099 .Va colour-uheader ,
1100 as well as
1101 .Va colour-user-headers ,
1102 which is a list of headers to be colourized via
1103 .Va colour-uheader
1104 instead of the default
1105 .Va colour-header .
1106 To forcefully disable colours, set
1107 .Va colour-disable .
1108 .\" }}}
1110 .\" .Ss "Commands" {{{
1111 .Ss "Commands"
1112 Each command is typed on a line by itself,
1113 and may take arguments following the command word.
1114 The command need not be typed in its entirety \(en
1115 the first command which matches the typed prefix is used.
1116 (The command
1117 .Ic list
1118 prints a sorted list of available commands, and the command
1119 .Ic ? ,
1120 when given an argument, will show a documentation string for the
1121 expansion, as in
1122 .Ns ` Ns Ic ? Ns Ar unc Ns ' ;
1123 documentation strings are however \*(OP.)
1125 For commands which take message lists as arguments,
1126 if no message list is given,
1127 then the next message forward which satisfies the command's requirements
1128 is used.
1129 If there are no messages forward of the current message,
1130 the search proceeds backwards,
1131 and if there are no good messages at all,
1132 \*(UA types `no applicable messages' and aborts the command.
1133 If the command begins with a `#' (number sign) character,
1134 the line is ignored.
1136 The arguments to commands can be quoted, using the following methods:
1137 .Bl -bullet -offset indent
1139 An argument can be enclosed between paired double-quotes `"argument"' or
1140 single-quotes `'argument'';
1141 any white space, shell word expansion, or backslash characters (except
1142 as described next) within the quotes are treated literally as part of
1143 the argument.
1144 A double-quote will be treated literally within single-quotes and vice
1145 versa.
1146 Inside such a quoted string the actually used quote character can be
1147 used nonetheless by escaping it with a backslash `\\', as in
1148 `"y\\"ou"'.
1150 An argument that is not enclosed in quotes, as above, can usually still
1151 contain space characters if those spaces are backslash-escaped.
1153 A backslash outside of the enclosing quotes is discarded
1154 and the following character is treated literally as part of the argument.
1156 An unquoted backslash at the end of a command line is discarded and the
1157 next line continues the command.
1160 Filenames, where expected, are subsequently subjected to the following
1161 transformations, in sequence:
1162 .Bl -bullet -offset indent
1164 If the filename begins with an unquoted plus sign, and the
1165 .Va folder
1166 variable is defined,
1167 the plus sign will be replaced by the value of the
1168 .Va folder
1169 variable followed by a slash.
1170 If the
1171 .Va folder
1172 variable is unset or is set to null, the filename will be unchanged.
1174 Shell word expansions are applied to the filename.
1175 If more than a single pathname results from this expansion and the
1176 command is expecting one file, an error results.
1180 The following commands are available:
1181 .Bl -tag -width ".Ic account"
1182 .It Ic #
1183 This is the comment-command and causes the entire line to be ignored.
1184 Note: since it is a normal command you cannot have trailing comments in
1185 lines from resource files etc.
1186 .It Ic ~
1187 Interprets the remainder of the word as a macro name and passes it
1188 through to the
1189 .Ic call
1190 command; e.g.,
1191 .Ns ` Ns Ic ~ Ns Ar mymacro Ns '
1192 is a shorter synonym for
1193 .Ns ` Ns Ic call Ar mymacro Ns ' .
1194 .It Ic -
1195 Print out the preceding message.
1196 If given a numeric argument n,
1197 goes to the n'th previous message and prints it.
1198 .It Ic \&?
1199 Prints a brief summary of commands.
1200 \*(OP Given an argument a synopsis for the command in question is
1201 printed instead;
1202 note it is possible to abbreviate the command and see the expansion
1203 \(en try, e.g., `?h', `?hel' and `?help' and see how the display changes.
1204 .It Ic \&!
1205 Executes the shell (see
1206 .Xr sh 1
1208 .Xr csh 1 Ns
1209 ) command which follows.
1210 .It Ic \&|
1211 A synonym for the
1212 .Ic pipe
1213 command.
1214 .It Ic account
1215 (ac) Creates, selects or lists an email account.
1216 An account is formed by a group of commands,
1217 primarily of those to set variables.
1218 With two arguments,
1219 of which the second is a `{',
1220 the first argument gives an account name,
1221 and the following lines create a group of commands for that account
1222 until a line containing a single `}' appears.
1223 With one argument the previously created group of commands for the
1224 account name is executed, and a
1225 .Ic folder
1226 command is executed for the system mailbox or inbox of that account.
1227 Without arguments the list of accounts and their contents are printed.
1228 As an example,
1229 .Bd -literal -offset indent
1230    account myisp {
1231       set folder=imaps://mylogin@imap.myisp.example
1232       set record=+Sent
1233       set from="myname@myisp.example (My Name)"
1234       set smtp=smtp://mylogin@smtp.myisp.example
1235    }
1238 creates an account named `myisp' which can later be selected by
1239 specifying `account myisp'.
1240 The special account `null' (case-insensitive) always exists.
1241 .Ic localopts
1242 can be used to localize account settings.
1243 Accounts can be deleted via
1244 .Ic unaccount .
1245 .It Ic alias
1246 (a) With no arguments, prints out all currently-defined aliases.
1247 With one argument, prints out that alias.
1248 With more than one argument,
1249 creates a new alias or changes an old one.
1250 .Ic unalias
1251 can be used to delete aliases.
1252 .It Ic alternates
1253 (alt) The alternates command is useful if the user has accounts on
1254 several machines.
1255 It can be used to inform \*(UA that the listed addresses all belong to
1256 the invoking user.
1257 When replying to messages \*(UA will not send a copy of the message
1258 to any of the addresses listed on the alternates list.
1259 If the alternates command is given with no argument,
1260 the current set of alternate names is displayed.
1261 .It Ic answered
1262 (ans) Takes a message list and marks each message as having been
1263 answered.
1264 This mark has no technical meaning in the mail system;
1265 it just causes messages to be marked in the header summary,
1266 and makes them specially addressable.
1267 .It Ic cache
1268 \*(OP Only applicable to cached IMAP mailboxes;
1269 takes a message list and reads the specified messages into the IMAP
1270 cache.
1271 .It Ic call
1272 Calls a macro (see the
1273 .Ic define
1274 command).
1275 .It Ic cd
1276 Same as
1277 .Ic chdir .
1278 .It Ic certsave
1279 \*(OP Only applicable to S/MIME signed messages.
1280 Takes a message list and a file name and saves the certificates
1281 contained within the message signatures to the named file in both
1282 human-readable and PEM format.
1283 The certificates can later be used to send encrypted messages to the
1284 respective message senders by setting
1285 .Va smime-encrypt-USER@HOST
1286 variables.
1287 .It Ic chdir
1288 (ch) Changes the user's working directory to the specified one,
1289 or to the user's login directory, if none was given.
1290 .It Ic collapse
1291 (coll)
1292 Only applicable to threaded mode.
1293 Takes a message list and makes all replies to these messages invisible
1294 in header summaries,
1295 unless they are in state `new'.
1296 .It Ic connect
1297 \*(OP (conn) If operating in disconnected mode on an IMAP mailbox,
1298 switch to online mode and connect to the mail server while retaining the
1299 mailbox status.
1300 See the description of the
1301 .Va disconnected
1302 variable for more information.
1303 .It Ic copy
1304 (c) The copy command does the same thing that
1305 .Ic save
1306 does except that it does not mark the given messages for deletion when
1307 the user quits.
1308 Compressed files and IMAP mailboxes are handled as described for the
1309 .Ic folder
1310 command.
1311 .It Ic Copy
1312 (C) Similar to
1313 .Ic copy ,
1314 but saves the messages in a file named after the local part of the
1315 sender address of the first message.
1316 .It Ic cwd
1317 Print the current working directory.
1318 .It Ic decrypt
1319 \*(OP (dec) For unencrypted messages,
1320 this command is identical to
1321 .Ic copy .
1322 Encrypted messages are first decrypted, if possible, and then copied.
1323 .It Ic Decrypt
1324 \*OP (Dec) Similar to
1325 .Ic decrypt ,
1326 but saves the messages in a file named after the local part of the
1327 sender address of the first message.
1328 .It Ic define
1329 (def) Without arguments the current list of macros, including their
1330 content, is printed.
1331 If arguments are given this command defines a macro.
1332 A macro definition is a sequence of commands in the following form:
1333 .Bd -literal -offset indent
1334    define name {
1335       command1
1336       command2
1337       ...
1338       commandN
1339    }
1342 A defined macro can be explicitly invoked using
1343 .Ic call
1345 .Ic ~ ,
1346 or it can be implicitly invoked by setting the
1347 .Va folder-hook
1349 .Va folder-hook-fullname
1350 variables.
1351 Macros can be deleted via
1352 .Ic undefine .
1353 .It Ic delete
1354 (d) Takes a list of messages as argument and marks them all as deleted.
1355 Deleted messages will not be saved in `mbox',
1356 nor will they be available for most other commands.
1357 .It Ic discard
1358 Same as
1359 .Ic ignore .
1360 .It Ic disconnect
1361 \*(OP (disco) If operating in online mode on an IMAP mailbox,
1362 switch to disconnected mode while retaining the mailbox status.
1363 See the description of the
1364 .Va disconnected
1365 variable for more.
1366 A list of messages may optionally be given as argument;
1367 the respective messages are then read into the cache before the
1368 connection is closed.
1369 Thus `disco *' makes the entire mailbox available for disconnected use.
1370 .It Ic dp Ns \ or Ic dt
1371 Deletes the current message and prints the next message.
1372 If there is no next message, \*(UA says `at EOF'.
1373 .It Ic draft
1374 Takes a message list and marks each given message as a draft.
1375 This mark has no technical meaning in the mail system;
1376 it just causes messages to be marked in the header summary,
1377 and makes them specially addressable.
1378 .It Ic echo
1379 Echoes its arguments,
1380 resolving special names as documented for the command
1381 .Ic folder .
1382 The escape sequences `\ea', `\eb', `\ec', `\ef', `\en', `\er', `\et',
1383 `\ev', `\e\e', and `\e0octal-num\fR' are interpreted just as they are by
1384 .Xr printf 1
1385 (proper quoting provided).
1386 .It Ic edit
1387 (e) Point the text editor at each message from the given list in turn.
1388 Modified contents are discarded unless the
1389 .Va writebackedited
1390 variable is set.
1391 .It Ic elif
1392 Part of the
1393 .Ic if /
1394 .Ic elif /
1395 .Ic else /
1396 .Ic endif
1397 conditional \(em if the condition of a preceeding
1398 .Ic if
1399 was false, check the following condition and execute the following block
1400 if it evaluates true.
1401 .It Ic else
1402 Part of the
1403 .Ic if /
1404 .Ic elif /
1405 .Ic else /
1406 .Ic endif
1407 conditional \(em if none of the conditions of the preceeding
1408 .Ic if
1410 .Ic elif
1411 commands was true, the
1412 .Ic else
1413 block is executed.
1414 .It Ic endif
1415 Marks the end of an
1416 .Ic if /
1417 .Ic elif /
1418 .Ic else /
1419 .Ic endif
1420 conditional execution block.
1421 .It Ic exit
1422 (ex or x) Effects an immediate return to the Shell without modifying the
1423 user's system mailbox, his `mbox' file, or his edit file in
1424 .Fl f ,
1425 as well as a possibly tracked command line editor history file.
1426 .It Ic features
1427 Print the list of features that have been compiled into \*(UA.
1428 .It Ic file
1429 (fi) The same as
1430 .Ic folder .
1431 .It Ic flag
1432 (fl) Takes a message list and marks the messages as `flagged' for
1433 urgent/special attention.
1434 This mark has no technical meaning in the mail system;
1435 it just causes messages to be highlighted in the header summary,
1436 and makes them specially addressable.
1437 .It Ic folder
1438 (fold) The folder command switches to a new mail file or folder.
1439 With no arguments, it tells the user which file he is currently reading.
1440 If an argument is given, it will write out changes (such as deletions)
1441 the user has made in the current file and read in the new file.
1442 Some special conventions are recognized for the
1443 .Ar name
1444 argument:
1445 .Bl -tag -offset indent -width ".Ar %:filespec"
1446 .It Ar #
1447 (number sign) means the previous file,
1448 .It Ar %
1449 (percent sign) means the invoking user's system mailbox
1450 (or the value of
1451 .Va folder
1452 for IMAP folders),
1453 .It Ar %user
1454 means the system mailbox of `user'
1455 (and never the value of
1456 .Va folder ,
1457 regardless of its actual setting),
1458 .It Ar &
1459 (ampersand) means the invoking user's `mbox' file (see
1460 .Va MBOX Ns
1461 ) and
1462 .It Ar +file
1463 means a `file' in the
1464 .Va folder
1465 directory.
1466 .It Ar %:filespec
1467 expands to the same value as `filespec',
1468 but the file is handled as a system mailbox by, e.g., the
1469 .Ic mbox
1471 .Ic save
1472 commands.
1475 If the name matches one of the strings defined with the command
1476 .Ic shortcut ,
1477 it is replaced by its long form and expanded.
1478 If the name ends with `.gz', `.bz2' or `.xz' it is treated as being
1479 compressed with
1480 .Xr gzip 1 ,
1481 .Xr bzip2 1
1483 .Xr xz 1 ,
1484 respectively, and transparently handled through an intermediate
1485 (un)compression step (using a temporary file) with the respective
1486 utility, which thus must be available in the path.
1487 If `name' refers to a directory with the subdirectories `tmp', `new',
1488 and `cur', then it is treated as a folder in `maildir' format.
1489 A name of the form
1491 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
1492 .Dl \*(OU protocol://[user@]host[:port][/path]
1494 is taken as an Internet mailbox specification.
1495 The \*(OPally supported protocols are `imap' (IMAP v4r1), `imaps'
1496 (IMAP with SSL/TLS encrypted transport), `pop3' (POP3) and `pop3s' (POP3
1497 with SSL/TLS encrypted transport).
1498 The `[/path]' part is valid only for IMAP; there it defaults to `INBOX'.
1499 Also see the section
1500 .Sx "URL syntax" .
1502 \*(OU If `user' contains special characters, in particular `/' or `%',
1503 they must be escaped in URL notation \(en the command
1504 .Ic urlencode
1505 can be used to show the necessary conversion.
1506 The optional `path' part applies to IMAP only;
1507 if it is omitted, the default `INBOX' is used.
1509 If \*(UA is connected to an IMAP server,
1510 a name of the form `@mailbox' refers to the `mailbox' on that server,
1511 but otherwise a `@' prefix has no special meaning.
1512 .It Ic folders
1513 With no arguments, list the names of the folders in the folder directory.
1514 With an existing folder as an argument,
1515 lists the names of folders below the named folder;
1516 e.\|g. the command `folders @' lists the folders on the base level of
1517 the current IMAP server.
1518 See also the variable
1519 .Va imap-list-depth .
1520 .It Ic Followup
1521 (F) Similar to
1522 .Ic Respond ,
1523 but saves the message in a file named after the local part of the first
1524 recipient's address.
1525 .It Ic followup
1526 (fo) Similar to
1527 .Ic respond ,
1528 but saves the message in a file named after the local part of the first
1529 recipient's address.
1530 .It Ic followupall
1531 Similar to
1532 .Ic followup ,
1533 but responds to all recipients regardless of the
1534 .Va flipr
1536 .Va Replyall
1537 variables.
1538 .It Ic followupsender
1539 Similar to
1540 .Ic Followup ,
1541 but responds to the sender only regardless of the
1542 .Va flipr
1544 .Va Replyall
1545 variables.
1546 .It Ic forward
1547 (fwd) Takes a message and the address of a recipient
1548 and forwards the message to him.
1549 The text of the original message is included in the new one,
1550 with the value of the
1551 .Va fwdheading
1552 variable printed before.
1554 .Ic fwdignore
1556 .Ic fwdretain
1557 commands specify which header fields are included in the new message.
1558 Only the first part of a multipart message is included unless the
1559 .Va forward-as-attachment
1560 option is set.
1561 .It Ic Forward
1562 (Fwd) Similar to
1563 .Ic forward ,
1564 but saves the message in a file named after the local part of the
1565 recipient's address.
1566 .It Ic from
1567 (f) Takes a list of messages and prints their message headers,
1568 piped through the pager if the output does not fit on the screen.
1569 .It Ic fwdignore
1570 Specifies which header fields are to be ignored with the command
1571 .Ic forward .
1572 This command has no effect when the
1573 .Va forward-as-attachment
1574 option is set.
1575 .It Ic fwdretain
1576 Specifies which header fields are to be retained with the command
1577 .Ic forward .
1578 .Ic fwdretain
1579 overrides
1580 .Ic fwdignore .
1581 This command has no effect when the
1582 .Va forward-as-attachment
1583 option is set.
1584 .It Ic ghost
1585 Without arguments it lists all currently defined command aliases,
1586 so-called ghosts.
1587 With two arguments it defines a new command alias: the first argument is
1588 the name under which the second should be accessible.
1589 The content of the second argument can be just about anything.
1590 A ghost can be used everywhere a normal command can be used, but always
1591 takes precedence; any arguments that are given to the command alias are
1592 joined onto the alias content, and the resulting string forms the
1593 command line that is, in effect, executed.
1594 Also see
1595 .Ic unghost .
1597 .Dl ? ghost ls '!ls -latro'
1598 .Dl ? ls /usr/local
1599 .It Ic headers
1600 (h) Lists the current range of headers, which is an 18-message group.
1601 If a `+' argument is given the next 18-message group is printed,
1602 likewise the previous is printed if the argument was `-'.
1603 .It Ic help
1604 A synonym for
1605 .Ic \&? .
1606 .It Ic history
1607 \*(OP Either
1608 .Ar show
1610 .Ar clear
1611 the list of history entries;
1612 a decimal
1613 .Ar NUMBER
1614 argument selects and shows the respective history entry \(en
1615 press `ENTER' to accept it, and the history entry will become the new
1616 history top.
1617 The default mode if no arguments are given is
1618 .Ar show .
1619 .It Ic hold
1620 (ho, also preserve) Takes a message list and marks each message therein
1621 to be saved in the user's system mailbox instead of in `mbox'.
1622 Does not override the
1623 .Ic delete
1624 command.
1625 \*(UA deviates from the POSIX standard with this command,
1626 as a
1627 .Ic next
1628 command issued after
1629 .Ic hold
1630 will display the following message, not the current one.
1631 .It Ic if
1632 Part of the nestable
1633 .Ic if /
1634 .Ic elif /
1635 .Ic else /
1636 .Ic endif
1637 conditional execution construct \(em if the given condition is false
1638 execute the following block.
1639 .Bd -literal -offset indent
1640    if receive
1641       commands ...
1642    else
1643       commands ...
1644    endif
1647 Note that POSIX only supports the conditions `[Rr]eceive', `[Ss]end'
1648 and `[Tt]erm' (execute if standard input is a tty).
1649 Extensions are `0' (never execute) and `1' (always execute);
1650 it is also possible to conditionalize upon wether an option is set,
1651 or set to a specific value, by using the `$' conditional trigger, e.g.:
1652 .Bd -literal -offset indent
1653    if $debug
1654       commands ...
1655    endif
1656    if $encoding == "UTF-8"
1657       commands ...
1658    endif
1659    if $encoding != "UTF-8"
1660       commands ...
1661    endif
1664 The first form simply checks wether an option is set, the other two also
1665 perform value content comparison (equality and non-equality,
1666 respectively); an unset value is treated as the empty string, then.
1667 The \*(OPal regular expression support adds `=~' and `!~' tests, which
1668 treat the right hand side as a regular expression, e.g., `^UTF.*' (see
1669 .Xr re_format 7 Ns
1671 .It Ic ignore
1672 Add the list of header fields named to the ignored list.
1673 Header fields in the ignore list are not printed on the terminal when
1674 a message is printed.
1675 This command is very handy for suppression of certain machine-generated
1676 header fields.
1678 .Ic Type
1680 .Ic Print
1681 commands can be used to print a message in its entirety, including
1682 ignored fields.
1683 It lists the current set of ignored fields if no arguments were given.
1684 .It Ic imap
1685 \*(OP Sends command strings directly to the current IMAP server.
1686 \*(UA operates always in IMAP `selected state' on the current mailbox;
1687 commands that change this will produce undesirable results and should be
1688 avoided.
1689 Useful IMAP commands are:
1690 .Bl -tag -offset indent -width ".Ic getquotearoot"
1691 .It create
1692 Takes the name of an IMAP mailbox as an argument and creates it.
1693 .It getquotaroot
1694 (RFC 2087) Takes the name of an IMAP mailbox as an argument
1695 and prints the quotas that apply to the mailbox.
1696 Not all IMAP servers support this command.
1697 .It namespace
1698 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
1699 the Other User's Namespaces and the Shared Namespaces.
1700 Each namespace type is printed in parentheses;
1701 if there are multiple namespaces of the same type,
1702 inner parentheses separate them.
1703 For each namespace a prefix and a hierarchy separator is listed.
1704 Not all IMAP servers support this command.
1706 .It Ic inc
1707 Same as
1708 .Ic newmail .
1709 .It Ic list
1710 Prints the names of all available commands, alphabetically sorted.
1711 .It Ic localopts
1712 Can only be used inside of a macro definition block introduced by
1713 .Ic account
1715 .Ic define ,
1716 and is interpreted as a boolean (value `0' means false, everything
1717 else true).
1718 Any option that had been set while `localopts' was in effect will be
1719 reverted to its former value once the block is left / the `account'
1720 is switched.
1721 .Bd -literal -offset indent
1722 define temporary_settings {
1723         set global_option1
1724         localopts 1
1725         set local_option1
1726         set local_option2
1727         localopts 0
1728         set global_option2
1732 Note that these options stack upon each other, i.e., if macro1 sets
1733 `localopts' and calls macro2, which explicitly resets `localopts', then
1734 any values set within macro2 will still be cleaned up by macro1.
1735 .It Ic Mail
1736 (M) Similar to
1737 .Ic mail ,
1738 but saves the message in a file named after the local part of the first
1739 recipient's address.
1740 .It Ic mail
1741 (m) Takes a (list of) recipient address(es) as (an) argument(s),
1742 or asks on standard input if none were given;
1743 then collects the remaining mail content and sends it out.
1744 .It Ic mbox
1745 The given message list is to be sent to `mbox' when \*(UA is quit.
1746 This is the default action unless the
1747 .Va hold
1748 option is set.
1749 \*(UA deviates from the POSIX standard with this command,
1750 as a
1751 .Ic next
1752 command issued after
1753 .Ic mbox
1754 will display the following message, not the current one.
1755 .It Ic mimetypes
1756 Either
1757 .Ns ( Ar show
1759 .Ar clear
1761 .Xr mime.types 5
1762 cache.
1763 In the former case all sources are loaded first as necessary.
1765 .Va mimetypes-load-control
1766 option can be used to fine-tune which sources are loaded.
1767 .It Ic move
1768 (mv) Acts like
1769 .Ic copy
1770 but marks the messages for deletion if they were transferred
1771 successfully.
1772 .It Ic more
1773 Takes a message list and invokes the
1774 .Va PAGER
1775 on that list, printing a form-feed (`\\f') in between messages.
1776 .It Ic More
1777 Like
1778 .Ic more ,
1779 but also prints ignored header fields and all MIME parts.
1780 .It Ic Move
1781 (Mv) Similar to
1782 .Ic move ,
1783 but moves the messages to a file named after the local part of the
1784 sender address of the first message.
1785 .It Ic newmail
1786 Checks for new mail in the current folder without committing any changes
1787 before.
1788 If new mail is present, a message is printed.
1789 If the
1790 .Va header
1791 variable is set,
1792 the headers of each new message are also printed.
1793 .It Ic next
1794 (n) (like `+' or `ENTER') Goes to the next message in sequence
1795 and types it.
1796 With an argument list, types the next matching message.
1797 .It Ic New
1798 Same as
1799 .Ic unread .
1800 .It Ic new
1801 Same as
1802 .Ic unread .
1803 .It Ic noop
1804 If the current folder is located on an IMAP or POP3 server,
1805 a `NOOP' command is sent.
1806 Otherwise, no operation is performed.
1807 .It Ic Pipe
1808 (Pi) Like
1809 .Ic pipe
1810 but also pipes ignored header fields and all parts of MIME
1811 `multipart/alternative' messages.
1812 .It Ic pipe
1813 (pi) Takes a message list and a shell command
1814 and pipes the messages through the command.
1815 Without an argument the current message is piped through the command
1816 given by the
1817 .Va cmd
1818 variable.
1819 If the
1820 .Va page
1821 variable is set,
1822 every message is followed by a formfeed character.
1823 .It Ic preserve
1824 (pre) A synonym for
1825 .Ic hold .
1826 .It Ic Print
1827 (P) Like
1828 .Ic print
1829 but also prints out ignored header fields and all parts of MIME
1830 `multipart/alternative' messages.
1831 See also
1832 .Ic print ,
1833 .Ic ignore
1835 .Ic retain .
1836 .It Ic print
1837 (p) Takes a message list and types out each message on the user's
1838 terminal.
1839 If the message is a MIME multipart message,
1840 all parts with a content type of `text' or `message' are shown,
1841 the other are hidden except for their headers.
1842 Messages are decrypted and converted to the terminal character set
1843 if necessary.
1844 .It Ic quit
1845 (q) Terminates the session, saving all undeleted, unsaved messages in
1846 the current `mbox', preserving all messages marked with
1847 .Ic hold
1849 .Ic preserve
1850 or never referenced in his system mailbox,
1851 and removing all other messages from his system mailbox.
1852 If new mail has arrived during the session,
1853 the message `You have new mail' is given.
1854 If given while editing a mailbox file with the command line flag
1855 .Fl f ,
1856 then the edit file is rewritten.
1857 A return to the shell is effected,
1858 unless the rewrite of edit file fails,
1859 in which case the user can escape with the exit command.
1860 .It Ic redirect
1861 (red) Same as
1862 .Ic resend .
1863 .It Ic Redirect
1864 (Red) Same as
1865 .Ic Resend .
1866 .It Ic remove
1867 (rem) Removes the named folders.
1868 The user is asked for confirmation in interactive mode.
1869 .It Ic rename
1870 (ren) Takes the name of an existing folder
1871 and the name for the new folder
1872 and renames the first to the second one.
1873 Both folders must be of the same type
1874 and must be located on the current server for IMAP.
1875 .It Ic Reply
1876 (R) Reply to originator.
1877 Does not reply to other recipients of the original message.
1878 .It Ic reply
1879 (r) Takes a message list and sends mail to the sender and all recipients
1880 of the specified messages.
1881 The default message must not be deleted.
1882 .It Ic replyall
1883 Similar to
1884 .Ic reply ,
1885 but responds to all recipients regardless of the
1886 .Va flipr
1888 .Va Replyall
1889 variables.
1890 .It Ic replysender
1891 Similar to
1892 .Ic Reply ,
1893 but responds to the sender only regardless of the
1894 .Va flipr
1896 .Va Replyall
1897 variables.
1898 .It Ic Resend
1899 Like
1900 .Ic resend ,
1901 but does not add any header lines.
1902 This is not a way to hide the sender's identity,
1903 but useful for sending a message again to the same recipients.
1904 .It Ic resend
1905 Takes a list of messages and a user name
1906 and sends each message to the named user.
1907 `Resent-From:' and related header fields are prepended to the new copy
1908 of the message.
1909 .It Ic Respond
1910 Same as
1911 .Ic Reply .
1912 .It Ic respond
1913 Same as
1914 .Ic reply .
1915 .It Ic respondall
1916 Same as
1917 .Ic replyall .
1918 .It Ic respondsender
1919 Same as
1920 .Ic replysender .
1921 .It Ic retain
1922 Add the list of header fields named to the retained list.
1923 Only the header fields in the retain list are shown on the terminal when
1924 a message is printed, all other header fields are suppressed.
1926 .Ic Type
1928 .Ic Print
1929 commands can be used to print a message in its entirety.
1930 The current set of retained fields is shown if
1931 .Ic retain
1932 is used without arguments.
1933 .It Ic Save
1934 (S) Similar to
1935 .Ic save,
1936 but saves the messages in a file named after the local part of the
1937 sender of the first message instead of taking a filename argument.
1938 .It Ic save
1939 (s) Takes a message list and a filename and appends each message in turn
1940 to the end of the file.
1941 If no filename is given, the `mbox' file is used.
1942 The filename in quotes, followed by the line count and character count
1943 is echoed on the user's terminal.
1944 If editing a system mailbox the messages are marked for deletion.
1945 Compressed files and IMAP mailboxes are handled as described for the
1946 .Fl f
1947 command line option above.
1948 .It Ic savediscard
1949 Same as
1950 .Ic saveignore .
1951 .It Ic saveignore
1952 Is to
1953 .Ic save
1954 what
1955 .Ic ignore
1956 is to
1957 .Ic print
1959 .Ic type .
1960 Header fields thus marked are filtered out when saving a message by
1961 .Ic save
1962 or when automatically saving to `mbox'.
1963 This command should only be applied to header fields that do not contain
1964 information needed to decode the message,
1965 as MIME content fields do.
1966 If saving messages on an IMAP account ignoring fields makes it
1967 impossible to copy the data directly on the server,
1968 thus operation usually becomes much slower.
1969 .It Ic saveretain
1970 Is to
1971 .Ic save
1972 what
1973 .Ic retain
1974 is to
1975 .Ic print
1977 .Ic type .
1978 Header fields thus marked are the only ones saved with a message when
1979 saving by
1980 .Ic save
1981 or when automatically saving to `mbox'.
1982 .Ic saveretain
1983 overrides
1984 .Ic saveignore .
1985 The use of this command is strongly discouraged since it may strip
1986 header fields that are needed to decode the message correctly.
1987 .It Ic seen
1988 Takes a message list and marks all messages as having been read.
1989 .It Ic set
1990 (se) With no arguments, prints all variable values.
1991 Otherwise, sets an option.
1992 Arguments are of the form `option=value' (no space before or after `='),
1993 or plain `option' if there is no value.
1994 Quotation marks may be placed around any part of the assignment
1995 statement to quote blanks or tabs, e.g.,
1997 .Dl set indentprefix="->"
1999 If an argument begins with `no', as in `set nosave',
2000 the effect is the same as invoking the
2001 .Ic unset
2002 command with the remaining part of the variable (`unset save').
2003 .It Ic setenv
2004 Identical to
2005 .Ic set
2006 except that the options are also exported into the program environment;
2007 since this task requires native host support the command will always
2008 report error if that is not available (but still act like
2009 .Ic set Ns
2011 This operation is a no-op unless all resource files have been loaded.
2012 Also see
2013 .Ic unsetenv .
2014 .It Ic shell
2015 (sh) Invokes an interactive version of the shell.
2016 .It Ic shortcut
2017 Defines a shortcut name and its string for expansion,
2018 as described for the
2019 .Ic folder
2020 command.
2021 If used without arguments the currently defined shortcuts are printed.
2022 .It Ic show
2023 (Sh) Like
2024 .Ic print ,
2025 but performs neither MIME decoding nor decryption so that the raw
2026 message text is shown.
2027 .It Ic size
2028 Print the size in characters of each message of the given message-list.
2029 .It Ic sort
2030 Create a sorted representation of the current folder,
2031 and change the
2032 .Ic next
2033 command and the addressing modes such that they refer to messages in the
2034 sorted order.
2035 Message numbers are the same as in regular mode.
2036 If the
2037 .Va header
2038 variable is set,
2039 a header summary in the new order is also printed.
2040 Possible sorting criteria are:
2041 .Bl -tag -offset indent -width "subject"
2042 .It date
2043 Sort the messages by their `Date:' field,
2044 that is by the time they were sent.
2045 .It from
2046 Sort messages by the value of their `From:' field,
2047 that is by the address of the sender.
2048 If the
2049 .Va showname
2050 variable is set,
2051 the sender's real name (if any) is used.
2052 .It size
2053 Sort the messages by their size.
2054 .It spam
2055 \*(OP Sort the message by their spam score, as has been classified via
2056 the command
2057 .Ic spamrate .
2058 .It status
2059 Sort the messages by their message status (new, read, old, etc.).
2060 .It subject
2061 Sort the messages by their subject.
2062 .It thread
2063 Create a threaded order,
2064 as with the command
2065 .Ic thread .
2066 .It to
2067 Sort messages by the value of their `To:' field,
2068 that is by the address of the recipient.
2069 If the
2070 .Va showname
2071 variable is set,
2072 the recipient's real name (if any) is used.
2075 If no argument is given,
2076 the current sorting criterion is printed.
2077 .It Ic source
2078 The source command reads commands from a file.
2079 .It Ic spamclear
2080 \*(OP Takes a list of messages and clears their `is-spam' flag.
2081 .It Ic spamforget
2082 \*(OP Takes a list of messages and forces the spam detector to forget it
2083 has ever used them to train its Bayesian filter, wether as `ham' or
2084 `spam'.
2085 .It Ic spamham
2086 \*(OP Takes a list of messages and teaches them to the spam detector as
2087 being `ham'.
2088 This also clears the `is-spam' flag of the messages in question.
2089 .It Ic spamrate
2090 \*(OP Takes a list of messages and rates them using the configured spam
2091 detector, setting their `is-spam' flag as appropriate.
2092 Note that the messages are not modified, and due to that the rating will
2093 get lost once the mailbox is left.
2094 Refer to the manual section
2095 .Sx "Handling spam"
2096 for the complete picture of spam handling in \*(UA.
2097 .It Ic spamset
2098 \*(OP Takes a list of messages and sets their `is-spam' flag.
2099 .It Ic spamspam
2100 \*(OP Takes a list of messages and teaches them to the spam detector as
2101 being `spam'.
2102 This also sets the `is-spam' flag of the messages in question.
2103 .It Ic thread
2104 (th) Create a threaded representation of the current folder,
2105 i.\|e. indent messages that are replies to other messages in the header
2106 display and change the
2107 .Ic next
2108 command and the addressing modes such that they refer to messages in the
2109 threaded order.
2110 Message numbers are the same as in unthreaded mode.
2111 If the
2112 .Va header
2113 variable is set,
2114 a header summary in threaded order is also printed.
2115 .It Ic top
2116 Takes a message list and prints the top few lines of each.
2117 The number of lines printed is controlled by the variable
2118 .Va toplines
2119 and defaults to five.
2120 .It Ic touch
2121 Takes a message list and marks the messages for saving in `mbox'.
2122 \*(UA deviates from the POSIX standard with this command,
2123 as a
2124 .Ic next
2125 command issued after `mbox' will display the following message instead
2126 of the current one.
2127 .It Ic Type
2128 (T) Identical to the
2129 .Ic Print
2130 command.
2131 .It Ic type
2132 (t) A synonym for
2133 .Ic print .
2134 .It Ic unaccount
2135 Delete all given accounts.
2136 An error message is printed if a given account is not defined.
2137 Attempts to delete the currently active account are rejected.
2138 .It Ic unalias
2139 Takes a list of names defined by alias commands
2140 and discards the remembered groups of users.
2141 .It Ic unanswered
2142 Takes a message list and marks each message as not having been answered.
2143 .It Ic uncollapse
2144 (unc) Only applicable to threaded mode.
2145 Takes a message list and makes the message and all replies to it visible
2146 in header summaries again.
2147 When a message becomes the current message,
2148 it is automatically made visible.
2149 Also when a message with collapsed replies is printed,
2150 all of these are automatically uncollapsed.
2151 .It Ic undefine
2152 Undefine all given macros.
2153 An error message is printed if a given macro is not defined.
2154 .It Ic undelete
2155 (u) Takes a message list and marks each message as not being deleted.
2156 .It Ic undraft
2157 Takes a message list and
2158 .Ns un Ns Ic draft Ns
2159 s each message.
2160 .It Ic unflag
2161 Takes a message list and marks each message as not being
2162 .Ic flag Ns ged .
2163 .It Ic unfwdignore
2164 Removes the header field names from the list of ignored fields for the
2165 .Ic forward
2166 command.
2167 .It Ic unfwdretain
2168 Removes the header field names from the list of retained fields for the
2169 .Ic forward
2170 command.
2171 .It Ic unghost
2172 Remove an existing command
2173 .Ic ghost .
2174 .It Ic unignore
2175 Removes the header field names from the list of ignored fields.
2176 .It Ic Unread
2177 Same as
2178 .Ic unread .
2179 .It Ic unread
2180 (U) Takes a message list and marks each message as not having been read.
2181 .It Ic unretain
2182 Removes the header field names from the list of retained fields.
2183 .It Ic unsaveignore
2184 Removes the header field names from the list of ignored fields for
2185 saving.
2186 .It Ic unsaveretain
2187 Removes the header field names from the list of retained fields for
2188 saving.
2189 .It Ic unset
2190 Takes a list of option names and discards their remembered values;
2191 the inverse of
2192 .Ic set .
2193 .It Ic unsetenv
2194 Identical to
2195 .Ic unset
2196 except that the options are also removed from the program environment;
2197 since this task requires native host support the command will always
2198 report error if that is not available (but still act like
2199 .Ic unset Ns
2201 This operation is a no-op unless all resource files have been loaded.
2202 Also see
2203 .Ic setenv .
2204 .It Ic unshortcut
2205 Deletes the shortcut names given as arguments.
2206 .It Ic unsort
2207 Disable sorted or threaded mode
2208 (see the
2209 .Ic sort
2211 .Ic thread
2212 commands),
2213 return to normal message order and,
2214 if the
2215 .Va header
2216 variable is set,
2217 print a header summary.
2218 .It Ic unthread
2219 (unth) Same as
2220 .Ic unsort .
2221 .It Ic urldecode
2222 Decode the given URL-encoded string arguments and show the results.
2223 .It Ic urlencode
2224 URL-encode the given arguments and show the results.
2225 .It Ic varshow
2226 Show information about all given options.
2227 .It Ic verify
2228 \*(OP (verif) Takes a message list and verifies each message.
2229 If a message is not an S/MIME signed message,
2230 verification will fail for it.
2231 The verification process checks if the message was signed using a valid
2232 certificate,
2233 if the message sender's email address matches one of those contained
2234 within the certificate,
2235 and if the message content has been altered.
2236 .It Ic visual
2237 (v) Takes a message list and invokes the display editor on each message.
2238 Modified contents are discarded unless the
2239 .Va writebackedited
2240 variable is set.
2241 .It Ic write
2242 (w) For conventional messages the body without all headers is written.
2243 The output is decrypted and converted to its native format as necessary.
2244 If the output file exists, the text is appended.
2245 If a message is in MIME multipart format its first part is written to
2246 the specified file as for conventional messages,
2247 and the user is asked for a filename to save each other part.
2248 For convience saving of each part may be skipped by giving an empty value;
2249 the same result can also be achieved by writing it to
2250 .Pa /dev/null .
2251 For the second and subsequent parts a leading `|' character causes the
2252 part to be piped to the remainder of the user input interpreted as
2253 a shell command;
2254 otherwise the user input is expanded as usually for folders,
2255 e.g., tilde expansion is performed.
2256 In non-interactive mode, only the parts of the multipart message
2257 that have a filename given in the part header are written,
2258 the others are discarded.
2259 The original message is never marked for deletion in the originating
2260 mail folder.
2261 For attachments,
2262 the contents of the destination file are overwritten if the file
2263 previously existed.
2264 No special handling of compressed files is performed.
2265 .It Ic xit
2266 (x) A synonym for
2267 .Ic exit .
2268 .It Ic z
2269 \*(UA presents message headers in windowfuls as described under the
2270 .Ic headers
2271 command.
2272 This command scrolls to the next window of messages.
2273 If an argument is given,
2274 it specifies the window to use.
2275 A number prefixed by `+' or `\-' indicates
2276 that the window is calculated in relation to the current position.
2277 A number without a prefix specifies an absolute window number,
2278 and a `$' lets \*(UA scroll to the last window of messages.
2279 .It Ic Z
2280 Similar to
2281 .Ic z ,
2282 but scrolls to the next or previous window that contains at least one
2283 new or `flagged' message.
2285 .\" }}}
2287 .\" .Ss "Tilde escapes" {{{
2288 .Ss "Tilde escapes"
2289 Here is a summary of the tilde escapes,
2290 which are used to perform special functions when composing messages.
2291 Tilde escapes are only recognized at the beginning of lines.
2292 The name `tilde escape' is somewhat of a misnomer since the actual
2293 escape character can be set by the option
2294 .Va escape .
2295 .Bl -tag -width ".Ic ~< filename"
2296 .It Ic ~~ Ar string
2297 Insert the string of text in the message prefaced by a single `~'.
2298 (If the escape character has been changed,
2299 that character must be doubled
2300 in order to send it at the beginning of a line.)
2301 .It Ic ~! Ar command
2302 Execute the indicated shell
2303 .Ar command ,
2304 then return to the message.
2305 .It Ic ~.
2306 Same effect as typing the end-of-file character.
2307 .It Ic ~: Ar \*(UA-command Ns \ or Ic ~_ Ar \*(UA-command
2308 Execute the given \*(UA command.
2309 Not all commands, however, are allowed.
2310 .It Ic ~?
2311 Write a summary of command escapes.
2312 .It Ic ~< Ar filename
2313 Identical to
2314 .Ic ~r .
2315 .It Ic ~<! Ar command
2316 .Ar command
2317 is executed using the shell.
2318 Its standard output is inserted into the message.
2319 .It Ic ~@ Op Ar filename...
2320 With no arguments, edit the attachment list interactively.
2321 If an attachment's file name is left empty,
2322 that attachment is deleted from the list.
2323 When the end of the attachment list is reached,
2324 \*(UA will ask for further attachments until an empty name is given.
2325 If a given file name solely consists of the number sign `#' followed
2326 by a valid message number of the currently active mailbox, the given
2327 message is attached as a MIME `message/rfc822' and the rest of this
2328 section does not apply.
2330 If character set conversion has been compiled into \*(UA, then this mode
2331 gives the user the option to specify input and output character sets,
2332 unless the file extension indicates binary content, in which case \*(UA
2333 asks wether this step shall be skipped for the attachment in question.
2334 If not skipped, then the charset that succeeds to represent the
2335 attachment data will be used in the `charset=' MIME parameter of the
2336 mail message.
2337 .Bl -bullet
2339 If input and output character sets are specified, then the conversion is
2340 performed on the fly.
2341 The user will be asked repeatedly until the desired conversion succeeds.
2343 If only an output character set is specified, then the input is assumed
2344 to be in the
2345 .Va ttycharset
2346 charset and will be converted to the given output charset on the fly.
2347 The user will be asked repeatedly until the desired conversion succeeds.
2349 If no character sets are specified at all then the algorithm that is
2350 documented in the section
2351 .Sx "Character sets"
2352 is applied, but directly and on the fly.
2353 The user will be asked repeatedly until the desired conversion succeeds.
2355 Finally, if an input-, but no output character set is specified, then no
2356 conversion is ever performed, but the `charset=' MIME parameter will
2357 still be set to the user input.
2359 The character set selection loop can be left by typing `control-C',
2360 i.e., causing an interrupt.
2361 .\" \*(OU next sentence
2362 Note that before \*(UA version 15.0 this terminates the entire
2363 current attachment selection, not only the character set selection.
2366 Without character set conversion support, \*(UA will ask for the input
2367 character set only, and it'll set the `charset=' MIME parameter to the
2368 given input, if any;
2369 if no user input is seen then the
2370 .Va ttycharset
2371 character set will be used for the `charset=' parameter instead.
2372 Note that the file extension check isn't performed in this mode, since
2373 no conversion will take place anyway.
2375 Note that in non-interactive mode, for reproduceabilities sake, there
2376 will always be two questions for each attachment, regardless of wether
2377 character set conversion is available and what the file extension is.
2378 The first asks for the filename, and the second asks for the input
2379 character set to be passed through to the `charset=' MIME parameter;
2380 no conversion will be tried if there is input to the latter question,
2381 otherwise the usual conversion algorithm, as above, is applied.
2382 For message attachments, the answer to the second question is completely
2383 ignored.
2386 .Ar filename
2387 arguments are specified,
2388 they are treated as a comma separated list of files,
2389 which are all expanded and appended to the end of the attachment list.
2390 (Filenames with commas, or with leading or trailing whitespace can only
2391 be added via the command line or the first method.
2392 Message attachments can only be added via the first method;
2393 filenames which clash with message numbers can only be added via the
2394 command line or the second method.)
2395 In this mode the (text) attachments are assumed to be in
2396 .Va ttycharset
2397 encoding, and will be evaluated as documented in the section
2398 .Sx "Character sets" .
2399 .It Ic ~A
2400 Inserts the string contained in the
2401 .Va Sign
2402 variable (same as `~i Sign').
2403 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
2404 .It Ic ~a
2405 Inserts the string contained in the
2406 .Va sign
2407 variable (same as `~i sign').
2408 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
2409 .It Ic ~b Ar name ...
2410 Add the given names to the list of blind carbon copy recipients.
2411 .It Ic ~c Ar name ...
2412 Add the given names to the list of carbon copy recipients.
2413 .It Ic ~d
2414 Read the file specified by the
2415 .Va DEAD
2416 variable into the message.
2417 .It Ic ~e
2418 Invoke the text editor on the message collected so far.
2419 After the editing session is finished,
2420 the user may continue appending text to the message.
2421 .It Ic ~F Ar messages
2422 Read the named messages into the message being sent, including all
2423 message headers and MIME parts.
2424 If no messages are specified, read in the current message.
2425 .It Ic ~f Ar messages
2426 Read the named messages into the message being sent.
2427 If no messages are specified, read in the current message.
2428 Message headers currently being ignored (by the
2429 .Ic ignore
2431 .Ic retain
2432 command) are not included.
2433 For MIME multipart messages,
2434 only the first printable part is included.
2435 .It Ic ~H
2436 Edit the message header fields `From:', `Reply-To:', `Sender:' and
2437 `Organization:' by typing each one in turn and allowing the user to edit
2438 the field.
2439 The default values for these fields originate from the
2440 .Va from ,
2441 .Va replyto ,
2442 .Va sender
2444 .Va ORGANIZATION
2445 variables.
2446 .It Ic ~h
2447 Edit the message header fields `To:', `Cc:', `Bcc:', and `Subject:' by
2448 typing each one in turn and allowing the user to edit the field.
2449 .It Ic ~i Ar variable
2450 Insert the value of the specified variable into the message,
2451 adding a newline character at the end.
2452 The message remains unaltered if the variable is unset or empty.
2453 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
2454 .It Ic ~M Ar messages
2455 Read the named messages into the message being sent,
2456 indented by
2457 .Va indentprefix .
2458 If no messages are specified, read the current message.
2459 .It Ic ~m Ar messages
2460 Read the named messages into the message being sent,
2461 indented by
2462 .Va indentprefix .
2463 If no messages are specified, read the current message.
2464 Message headers currently being ignored (by the
2465 .Ic ignore
2467 .Ic retain
2468 commands) are not included.
2469 For MIME multipart messages,
2470 only the first printable part is included.
2471 .It Ic ~p
2472 Print out the message collected so far,
2473 prefaced by the message header fields
2474 and followed by the attachment list, if any.
2475 .It Ic ~q
2476 Abort the message being sent,
2477 copying it to the file specified by the
2478 .Va DEAD
2479 variable if
2480 .Va save
2481 is set.
2482 .It Ic ~R Ar filename
2483 Read the named file into the message, indented by
2484 .Va indentprefix .
2485 .It Ic ~r Ar filename
2486 Read the named file into the message.
2487 .It Ic ~s Ar string
2488 Cause the named string to become the current subject field.
2489 .It Ic ~t Ar name ...
2490 Add the given name(s) to the direct recipient list.
2491 .It Ic ~U Ar messages
2492 Like `~m', but exclude all message headers.
2493 .It Ic ~u Ar messages
2494 Like `~f', but exclude all message headers.
2495 .It Ic ~v
2496 Invoke an alternate editor (defined by the
2497 .Va VISUAL
2498 option) on the message collected so far.
2499 Usually, the alternate editor will be a screen editor.
2500 After the editor is quit,
2501 the user may resume appending text to the end of the message.
2502 .It Ic ~w Ar filename
2503 Write the message onto the named file.
2504 If the file exists,
2505 the message is appended to it.
2506 .It Ic ~x
2507 Same as `~q', except that the message is not saved at all.
2508 .It Ic ~| Ar command
2509 Pipe the message through the specified filter command.
2510 If the command gives no output or terminates abnormally,
2511 retain the original text of the message.
2512 E.g., the command
2513 .Xr fmt 1
2514 is often used as a rejustifying filter.
2516 .\" }}}
2518 .\" .Ss "Variable options" {{{
2519 .Ss "Variable options"
2520 Options are controlled via
2521 .Ic set
2523 .Ic unset
2524 commands, see the corresponding entries for a syntax description.
2525 An option is also set if it is passed to \*(UA as part of the program
2526 environment (this is not restricted to specific variables as in the
2527 POSIX standard).
2528 A value given in a startup file overrides a value imported from the
2529 environment.
2530 Options may be either binary, in which case it is only significant to
2531 see whether they are set or not;
2532 or string, in which case the actual value is of interest.
2533 .\" }}}
2535 .\" .Ss "Binary options" {{{
2536 .Ss "Binary options"
2537 The binary options include the following:
2538 .Bl -tag -width ".Va autoprint"
2539 .It Va add-file-recipients
2540 When file or pipe recipients have been specified,
2541 mention them in the corresponding address fields of the message instead
2542 of silently stripping them from their recipient list.
2543 By default such addressees are not mentioned.
2544 .It Va allnet
2545 Causes only the local part to be evaluated
2546 when comparing addresses.
2547 .It Va append
2548 Causes messages saved in mbox to be appended to the end rather than
2549 prepended.
2550 This should always be set.
2551 .It Va ask Ns \ or Va asksub
2552 Causes \*(UA to prompt for the subject of each message sent.
2553 If the user responds with simply a newline,
2554 no subject field will be sent.
2555 .It Va askatend
2556 Causes the prompts for `Cc:' and `Bcc:' lists to appear after the
2557 message has been edited.
2558 .It Va askattach
2559 If set, \*(UA asks for files to attach at the end of each message.
2560 An empty line finalizes the list.
2561 .It Va askcc
2562 Causes the user to be prompted for additional carbon copy recipients (at
2563 the end of each message if
2564 .Va askatend
2566 .Va bsdcompat
2567 are set).
2568 An empty line finalizes the list.
2569 .It Va askbcc
2570 Causes the user to be prompted for additional blind carbon copy
2571 recipients (at the end of each message if
2572 .Va askatend
2574 .Va bsdcompat
2575 are set).
2576 An empty line finalizes the list.
2577 .It Va asksign
2578 \*(OP Causes the user to be prompted if the message is to be signed at
2579 the end of each message.
2581 .Va smime-sign
2582 variable is ignored when this variable is set.
2583 .It Va autocollapse
2584 Causes threads to be collapsed automatically when threaded mode is
2585 entered (see the
2586 .Ic collapse
2587 command).
2588 .It Va autoprint
2589 Causes the delete command to behave like `dp -';
2590 thus, after deleting a message the next one will be typed automatically.
2591 .It Va autothread
2592 Causes threaded mode (see the
2593 .Ic thread
2594 command) to be entered automatically when a folder is opened.
2595 .It Va bang
2596 Enables the substitution of `!' by the contents of the last command line
2597 in shell escapes.
2598 .It Va batch-exit-on-error
2599 If the batch mode has been enabled via the
2600 .Fl #
2601 command line option, then this variable will be consulted whenever \*(UA
2602 completes one operation (returns to the command prompt); if it is set
2603 then \*(UA will terminate if the last operation generated an error.
2604 .It Va bsdannounce
2605 Causes automatic display of a header summary after executing a
2606 .Ic folder
2607 command.
2608 .It Va bsdcompat
2609 Sets some cosmetical features to traditional BSD style;
2610 has the same affect as setting
2611 .Va askatend
2612 and all other variables prefixed with `bsd';
2613 it also changes the meaning of the \*(UA specific `\\&'
2614 .Va prompt
2615 escape sequence.
2616 .It Va bsdflags
2617 Changes the letters printed in the first column of a header summary
2618 to traditional BSD style.
2619 .It Va bsdheadline
2620 Changes the display of columns in a header summary to traditional BSD
2621 style.
2622 .It Va bsdmsgs
2623 Changes some informational messages to traditional BSD style.
2624 .It Va bsdorder
2625 Causes the `Subject:' field to appear immediately after the `To:' field
2626 in message headers and with the `~h' tilde command.
2627 .It Va bsdset
2628 Changes the output format of the
2629 .Ic set
2630 command to traditional BSD style.
2631 .It Va colour-disable
2632 \*(OP Forcefully disable usage of colours.
2633 Also see the section
2634 .Sx "Coloured message display" .
2635 .It Va colour-pager
2636 \*(OP Wether colour shall be used for output that is paged through
2637 .Va PAGER .
2638 Note that pagers may need special flags, e.g.,
2639 .Xr less 1
2640 requires the option
2641 .Fl R
2643 .Xr lv 1
2644 the option
2645 .Fl c
2646 in order to support colours; therefore \*(UA will inspect the variable
2647 .Va PAGER
2648 \(en if that starts with the string `less' a non-existing
2649 environment variable
2650 .Va LESS
2651 will be set to "FRSXi", likewise for `lv'
2652 .Va LV
2653 will be optionally set to "-c".
2654 Also see the section
2655 .Sx "Coloured message display"
2656 for more on this.
2657 .It Va debug
2658 Prints debugging messages and disables the actual delivery of messages.
2659 Unlike
2660 .Va verbose ,
2661 this option is intended for \*(UA development only.
2662 .It Va disconnected
2663 \*(OP When an IMAP mailbox is selected and this variable is set,
2664 no connection to the server is initiated.
2665 Instead, data is obtained from the local cache (see
2666 .Va imap-cache Ns
2668 Mailboxes that are not present in the cache
2669 and messages that have not yet entirely been fetched from the server
2670 are not available;
2671 to fetch all messages in a mailbox at once,
2672 the command
2673 .Ns ` Ns Li copy * /dev/null Ns '
2674 can be used while still in connected mode.
2675 Changes that are made to IMAP mailboxes in disconnected mode are queued
2676 and committed later when a connection to that server is made.
2677 This procedure is not completely reliable since it cannot be guaranteed
2678 that the IMAP unique identifiers (UIDs) on the server still match the
2679 ones in the cache at that time.
2680 Data is saved to
2681 .Va DEAD
2682 when this problem occurs.
2683 .It Va disconnected-USER@HOST
2684 The specified account is handled as described for the
2685 .Va disconnected
2686 variable above,
2687 but other accounts are not affected.
2688 .It Va dot
2689 When dot is set, a dot (`.') on a line by itself during message input
2690 from a terminal shall be treated as end-of-message (in addition to the
2691 normal end-of-file condition).
2693 .Va ignoreeof
2694 is set
2695 .Va nodot
2696 is ignored and using a dot is the only method to terminate input mode.
2697 .It Va editalong
2698 If this variable is set then the editor is started automatically when
2699 composing a message in an interactive mode,
2700 as if the `~e' tilde command had been specified.
2702 .Va editheaders
2703 variable is implied for this automatically spawned editor session.
2704 .It Va editheaders
2705 When a message is edited while being composed,
2706 its header is included in the editable text.
2707 The `To:', `Cc:', `Bcc:', `Subject:', `From:', `Reply-To:', `Sender:',
2708 and 'Organization:' fields are accepted within the header,
2709 other fields are ignored.
2710 .It Va emptybox
2711 If set, an empty mailbox file is not removed.
2712 This may improve the interoperability with other mail user agents
2713 when using a common folder directory.
2714 .It Va emptystart
2715 If the mailbox is empty \*(UA normally prints `No mail for user' and
2716 exits immediately.
2717 If this option is set \*(UA starts even with an empty mailbox.
2718 .It Va flipr
2719 Exchanges the
2720 .Ic Respond
2721 with the
2722 .Ic respond
2723 commands and vice-versa.
2724 .It Va forward-as-attachment
2725 Original messages are normally sent as inline text with the
2726 .Ic forward
2727 command,
2728 and only the first part of a multipart message is included.
2729 With this option messages are sent as MIME `message/rfc822' attachments
2730 with all of their parts included.
2732 .Va fwdignore
2734 .Va fwdretain
2735 options are ignored when the
2736 .Va forward-as-attachment
2737 option is set.
2738 .It Va fullnames
2739 When replying to a message \*(UA normally removes the comment parts of
2740 email addresses,
2741 which by convention contain the full names of the recipients.
2742 If this variable is set such stripping is not performed,
2743 and comments are retained.
2744 .It Va header
2745 Causes the header summary to be written at startup and after commands
2746 that affect the number of messages or the order of messages in the
2747 current folder; enabled by default.
2748 The command line option
2749 .Fl N
2750 can be used to set
2751 .Va noheader .
2752 .It Va history-gabby
2753 \*(OP Add more entries to the history as is normally done.
2754 .It Va history-gabby-persist
2755 \*(OP \*(UAs own NCL will not save the additional (gabby) history
2756 entries in persistent storage unless this variable is also set.
2757 Also see
2758 .Va NAIL_HISTFILE .
2759 .It Va hold
2760 This option is used to hold messages in the system mailbox by default.
2761 .It Va idna-disable
2762 \*(OP Can be used to turn off the automatic conversion of domain names
2763 according to the rules of IDNA (internationalized domain names for
2764 applications).
2765 Since the IDNA code assumes domain names are specified with the
2766 .Va ttycharset
2767 character set, an UTF-8 locale charset is required to represent
2768 all possible international domain names (before conversion, that is).
2769 .It Va ignore
2770 Ignore interrupt signals from the terminal while entering messages;
2771 instead echo them as `@' characters and discard the current line.
2772 .It Va ignoreeof
2773 Ignore end-of-file conditions (`control-D') on message input,
2774 which instead can be terminated only by entering a
2775 .Va dot
2776 (`.') on a line by itself or by using the `~.' tilde escape.
2777 This option also applies to \*(UA command mode.
2778 .It Va imap-use-starttls
2779 \*(OP Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
2780 IMAP session SSL/TLS encrypted.
2781 This functionality is not supported by all servers,
2782 and is not used if the session is already encrypted by the IMAPS method.
2783 .It Va imap-use-starttls-USER@HOST
2784 Activates
2785 .Va imap-use-starttls
2786 for a specific account.
2787 .It Va keep
2788 This option causes \*(UA to truncate the user's system mailbox instead
2789 of deleting it when it is empty.
2790 This should always be set since it prevents malicious users from
2791 creating fake mail folders in a world-writable spool directory.
2792 .It Va keepsave
2793 When a message is saved it is usually discarded from the originating
2794 folder when \*(UA is quit.
2795 Setting this option causes all saved message to be retained.
2796 .It Va line-editor-disable
2797 Turn off any enhanced command line editing capabilities (see
2798 .Sx "Command line editor"
2799 for more).
2800 .It Va markanswered
2801 When a message is replied to and this variable is set,
2802 it is marked as having been answered.
2803 This mark has no technical meaning in the mail system;
2804 it just causes messages to be marked in the header summary,
2805 and makes them specially addressable.
2806 .It Va message-id-disable
2807 By setting this option the generation of `Message-ID:' can be completely
2808 suppressed, effectively leaving this task up to the mail-transfer-agent
2809 (MTA) or the SMTP server.
2810 (According to RFC 5321 your SMTP server is not required to add this
2811 field by itself, so you should ensure that it accepts messages without
2812 a `Message-ID'.)
2813 .It Va metoo
2814 Usually, when a group is expanded that contains the sender,
2815 the sender is removed from the expansion.
2816 Setting this option causes the sender to be included in the group.
2817 .It Va mime-allow-text-controls
2818 When sending messages, each part of the message is MIME-inspected in
2819 order to classify the `Content-Type:' and `Content-Transfer-Encoding:'
2820 that is required to send this part over mail transport, i.e.,
2821 a computation rather similar to what the
2822 .Xr file 1
2823 command produces when used with the
2824 .Fl -mime
2825 option.
2827 This classification however treats text files which are encoded in
2828 UTF-16 (often found for HTML files) and similar character sets as binary
2829 octet-streams, forcefully changing any `text/plain' or `text/html'
2830 specification to `application/octet-stream';
2831 if that actually happens, then a yet unset charset MIME parameter is set
2832 to `binary', effectively making it impossible for the receiving MUA to
2833 automatically interpret the contents of the part.
2835 If this option is set, and the data was unambiguously identified as text
2836 data at first glance (by a `.txt' or `.html' file extension), then the
2837 original `Content-Type:' will not be overwritten.
2838 .It Va mime-counter-evidence
2839 Normally the `Content-Type:' field is used to decide how to treat
2840 a messages MIME part.
2841 Some MUAs however don't use
2842 .Xr mime.types 5
2843 or a similar mechanism to correctly classify content,
2844 but simply specify `application/octet-stream',
2845 even for plain text attachments like `text/diff'.
2846 If this variable is set then \*(UA will use the file extension of
2847 attachments to classify such MIME message parts, if possible.
2848 .It Va outfolder
2849 Causes the filename given in the
2850 .Va record
2851 variable
2852 and the sender-based filenames for the
2853 .Ic Copy
2855 .Ic Save
2856 commands to be interpreted relative to the directory given in the
2857 .Va folder
2858 variable rather than to the current directory,
2859 unless it is set to an absolute pathname.
2860 .It Va page
2861 If set, each message the
2862 .Ic pipe
2863 command prints out is followed by a formfeed character.
2864 .It Va piperaw
2865 Send messages to the
2866 .Ic pipe
2867 command without performing MIME and character set conversions.
2868 .It Va pop3-bulk-load
2869 \*(OP When accessing a POP3 server \*(UA loads the headers of the
2870 messages, and only requests the message bodies on user request.
2871 For the POP3 protocol this means that the message headers will be
2872 downloaded twice.
2873 If this option is set then \*(UA will download only complete messages
2874 from POP3 servers instead.
2875 It may be useful to
2876 .Ic define
2877 a macro that temporarily sets this option, then accesses a POP3 account
2878 that is known to only get small text messages, and then unsets this
2879 variable again.
2880 .It Va pop3-no-apop
2881 \*(OP Unless this variable is set the `APOP' authentication method
2882 will be used when connecting to a POP3 server that advertises support.
2883 The advantage of APOP over `USER/PASS' authentication is that the
2884 password is not sent in clear text over the wire and that only a single
2885 packet is sent for the user/password tuple.
2886 .It Va pop3-no-apop-HOST
2887 \*(IN Disables the `APOP' authentication method for a specific host.
2888 .It Va pop3-no-apop-USER@HOST
2889 Disables the `APOP' authentication method for a specific account.
2890 .It Va pop3-use-starttls
2891 \*(OP Causes \*(UA to issue a `STLS' command to make an unencrypted POP3
2892 session SSL/TLS encrypted.
2893 This functionality is not supported by all servers,
2894 and is not used if the session is already encrypted by the POP3S method.
2895 .It Va pop3-use-starttls-HOST
2896 \*(IN Activates
2897 .Va pop3-use-starttls
2898 for a specific host.
2899 .It Va pop3-use-starttls-USER@HOST
2900 Activates
2901 .Va pop3-use-starttls
2902 for a specific account.
2903 .It Va print-all-chars
2904 This option causes all characters to be considered printable.
2905 It is only effective if given in a startup file.
2906 With this option set some character sequences in messages may put the
2907 user's terminal in an undefined state when printed;
2908 it should only be used as a last resort if no working system locale can
2909 be found.
2910 .It Va print-alternatives
2911 When a MIME message part of type `multipart/alternative' is displayed
2912 and it contains a subpart of type `text/plain',
2913 other parts are normally discarded.
2914 Setting this variable causes all subparts to be displayed,
2915 just as if the surrounding part was of type `multipart/mixed'.
2916 .It Va quiet
2917 Suppresses the printing of the version when first invoked.
2918 .It Va quote-as-attachment
2919 If this is set, then the original message is added in its entirety
2920 as a `message/rfc822' MIME attachment when replying to a message.
2921 Note this works regardless of the setting of
2922 .Va quote .
2923 .It Va recipients-in-cc
2924 On group replies, specify only the sender of the original mail in `To:'
2925 and mention it's other recipients in the secondary `Cc:'.
2926 .It Va record-resent
2927 If both this variable and the
2928 .Va record
2929 variable are set,
2931 .Ic resend
2933 .Ic Resend
2934 commands save messages to the
2935 .Va record
2936 folder as it is normally only done for newly composed messages.
2937 .It Va reply-in-same-charset
2938 If this variable is set \*(UA first tries to use the same character set
2939 of the original message for replies.
2940 If this fails, the mechanism described in
2941 .Sx "Character sets"
2942 is evaluated as usual.
2943 .It Va Replyall
2944 Reverses the sense of
2945 .Ic reply
2947 .Ic Reply
2948 commands.
2949 .It Va rfc822-body-from_
2950 This variable can be used to force the display of a so-called `From_'
2951 line for messages that are embedded into an envelope mail via the
2952 `message/rfc822' MIME mechanism.
2953 .It Va save
2954 When the user aborts a message with two `RUBOUT' (interrupt,
2955 `control-C') characters,
2956 \*(UA will copy the partial letter to the file
2957 .Va DEAD .
2958 This option is set by default.
2959 .It Va searchheaders
2960 Expand message-list specifiers in the form `/x:y' to all messages
2961 containing the substring `y' in the header field `x'.
2962 The string search is case insensitive.
2963 .It Va sendcharsets-else-ttycharset
2964 \*(OP If this variable is set, but
2965 .Va sendcharsets
2966 is not, then \*(UA acts as if
2967 .Va sendcharsets
2968 had been set to the value of the variable
2969 .Va ttycharset .
2970 In effect this combination passes through the message data in the
2971 character set of the current locale (given that
2972 .Va ttycharset
2973 hasn't been set manually), i.e., without converting it to the
2974 .Va charset-8bit
2975 fallback character set.
2976 Thus, mail message text will be in `ISO-8859-1' encoding when send from
2977 within a `ISO-8859-1' locale, and in `UTF-8' encoding when send from
2978 within an `UTF-8' locale.
2979 If no character set conversion capabilities are available in \*(UA then
2980 the only supported character set is
2981 .Va ttycharset .
2982 .It Va sendwait
2983 When sending a message wait until the MTA exits before accepting further
2984 commands.
2985 If the MTA returns a non-zero exit status,
2986 the exit status of \*(ua will also be non-zero.
2987 .It Va showlast
2988 Setting this option causes \*(UA to start at the last message instead of
2989 the first one when opening a mail folder.
2990 .It Va showname
2991 Causes \*(UA to use the sender's real name instead of the plain address
2992 in the header field summary and in message specifications.
2993 .It Va showto
2994 Causes the recipient of the message to be shown in the header summary
2995 if the message was sent by the user.
2996 .It Va skipemptybody
2997 If an outgoing message does not contain any text in its first or only
2998 message part,
2999 do not send it but discard it silently (see also the command line option
3000 .Fl E Ns
3002 .It Va smime-force-encryption
3003 \*(OP Causes \*(UA to refuse sending unencrypted messages.
3004 .It Va smime-sign
3005 \*(OP S/MIME sign outgoing messages with the user's private key and
3006 include the user's certificate as a MIME attachment.
3007 Signing a message enables a recipient to verify that the sender used
3008 a valid certificate,
3009 that the email addresses in the certificate match those in the message
3010 header and that the message content has not been altered.
3011 It does not change the message text,
3012 and people will be able to read the message as usual.
3013 Also see
3014 .Va smime-sign-cert
3016 .Va smime-sign-include-certs .
3017 .It Va smime-no-default-ca
3018 \*(OP Don't load default CA locations when verifying S/MIME signed
3019 messages.
3020 .It Va smtp-use-starttls
3021 \*(OP Causes \*(UA to issue a `STARTTLS' command to make an SMTP session
3022 SSL/TLS encrypted.
3023 Not all servers support this command \(en because of common
3024 implementation defects it can't be automatically determined whether
3025 a server supports it or not.
3026 .It Va ssl-no-default-ca
3027 \*(OP Don't load default CA locations to verify SSL/TLS server
3028 certificates.
3029 .It Va ssl-v2-allow
3030 \*(OP Accept SSLv2 connections.
3031 These are normally not allowed because this protocol version is insecure.
3032 .It Va keep-content-length
3033 When (editing messages and) writing MBOX mailbox files \*(UA can be told
3034 to keep the `Content-Length:' and `Lines:' header fields that some MUAs
3035 generate by setting this variable.
3036 Since \*(UA does neither use nor update these non-standardized header
3037 fields (which in itself shows one of their conceptual problems),
3038 stripping them should increase interoperability in between MUAs that
3039 work with with same mailbox files.
3040 Note that, if this is not set but
3041 .Va writebackedited ,
3042 as below, is, a possibly performed automatic stripping of these header
3043 fields already marks the message as being modified.
3044 .It Va v15-compat
3045 Setting this option enables upward compatibility with \*(UA version 15.0
3046 in respect to which configuration options are available and how they are
3047 handled.
3048 This manual uses \*(IN and \*(OU to refer to the new and the old way of
3049 doing things, respectively.
3050 .It Va verbose
3051 Setting this option, also controllable via the command line option
3052 .Fl v ,
3053 causes \*(UA to be more verbose, so that, e.g., certificate chains will
3054 be displayed on the users terminal.
3055 Setting this binary options twice increases the level of verbosity, in
3056 which case even details of the actual message delivery and protocol
3057 conversations are also shown.
3058 A single
3059 .Va noverbose
3060 is sufficient to disable verbosity as such.
3061 .It Va writebackedited
3062 If this variable is set messages modified using the
3063 .Ic edit
3065 .Ic visual
3066 commands are written back to the current folder when it is quit;
3067 it is only honoured for writable folders in `mbox' format, though.
3068 Note that the editor will be pointed to the raw message content in that
3069 case, i.e., neither MIME decoding nor decryption will have been
3070 performed,
3071 and proper RFC 4155 `From ' quoting of newly added or edited content is
3072 also left as an excercise to the user.
3074 .\" }}}
3076 .\" .Ss "Value options" {{{
3077 .Ss "Value options"
3078 The value options include the following:
3079 .Bl -tag -width ".Va autoprint"
3080 .It Va attrlist
3081 A sequence of characters to print in the `attribute' column of a header
3082 summary,
3083 each for one type of messages in the following order:
3084 new (N), unread but old (U), new but read (R), read and old (O), saved
3085 (S), preserved (P), mboxed (M), flagged (F), answered (A), draft (T),
3086 start of a collapsed thread (+), collapsed (\-), classified as spam ($).
3087 The default is `NUROSPMFAT+\-$',
3088 or `NU\ \ *HMFAT+\-$' if
3089 .Va bsdflags
3090 or the
3091 .Va SYSV3
3092 environment variable are set.
3093 .It Va autobcc
3094 Specifies a list of recipients to which a blind carbon copy of each
3095 outgoing message will be sent automatically.
3096 .It Va autocc
3097 Specifies a list of recipients to which a carbon copy of each outgoing
3098 message will be sent automatically.
3099 .It Va autosort
3100 Causes sorted mode (see the
3101 .Ic sort
3102 command) to be entered automatically with the value of this option as
3103 sorting method when a folder is opened.
3104 .It Va charset-7bit
3105 The value that should appear in the `charset=' parameter of
3106 `Content-Type:' MIME header fields when no character set conversion of
3107 the message data was performed.
3108 This defaults to `US-ASCII', and the chosen character set should be
3109 `US-ASCII' compatible.
3110 .It Va charset-8bit
3111 \*(OP The default 8 bit character set that is used as an implied last
3112 member of the variable
3113 .Va sendcharsets .
3114 Defaults to `UTF-8'.
3115 If no character set conversion capabilities are available in \*(UA then
3116 the only supported character set is
3117 .Va ttycharset .
3118 Refer to the section
3119 .Sx "Character sets"
3120 for the complete picture of character set conversion in \*(UA.
3121 .It Va cmd
3122 The default value for the
3123 .Ic pipe
3124 command.
3125 .It Va colour-from_
3126 \*(OP The colour specification for so-called `From_' lines.
3127 See the section
3128 .Sx "Coloured message display"
3129 for the format of the value.
3130 .It Va colour-header
3131 \*(OP The colour specification for header lines.
3132 See the section
3133 .Sx "Coloured message display"
3134 for the format of the value.
3135 .It Va colour-msginfo
3136 \*(OP The colour specification for the introductional message info line.
3137 See the section
3138 .Sx "Coloured message display"
3139 for the format of the value.
3140 .It Va colour-partinfo
3141 \*(OP The colour specification for MIME part info lines.
3142 See the section
3143 .Sx "Coloured message display"
3144 for the format of the value.
3145 .It Va colour-terms
3146 \*(OP A comma-separated list of
3147 .Va TERM Ns
3148 inals for which coloured message display can be used.
3149 Entries only need to be added if the string "color" isn't part of the
3150 terminal name itself; the default value is
3152 .Dl cons25,linux,rxvt,rxvt-unicode,\:screen,\:sun,\:vt100,\:vt220,\:\
3153 wsvt25,\:xterm
3154 .It Va colour-uheader
3155 \*(OP The colour specification for those header lines that have been
3156 placed in the
3157 .Va colour-user-headers
3158 list.
3159 See the section
3160 .Sx "Coloured message display"
3161 for the format of the value.
3162 .It Va colour-user-headers
3163 A comma separated list of (case-insensitive) header names which should
3164 be colourized with the alternative
3165 .Va colour-uheader
3166 colours.
3167 The default value is `from,subject'.
3168 .It Va crt
3169 The valued option crt is used as a threshold to determine how long
3170 a message must be before
3171 .Va PAGER
3172 is used to read it.
3174 .Va crt
3175 is set without a value then the height of the terminal screen stored in
3176 the system is used to compute the threshold (see
3177 .Va LINES
3179 .Xr stty 1 Ns
3181 .It Va DEAD
3182 The name of the file to use for saving aborted messages.
3183 This defaults to `dead.letter' in the user's home directory.
3184 .It Va datefield
3185 The date in a header summary is normally the date of the mailbox `From\ '
3186 line of the message.
3187 If this variable is set, then the date as given in the `Date:' field is
3188 used, converted to local time.
3189 It is possible to control the display of the date by assigning a value,
3190 in which case the
3191 .Xr strftime 3
3192 function will be used to format the date accordingly.
3193 Please read your system manual for the available formats.
3194 Note that the `%n' format should not be used, because \*(UA doesn't
3195 take embedded newlines into account when calculating how many lines fit
3196 onto the screen.
3197 .It Va datefield-markout-older
3198 This option, when set in addition to
3199 .Va datefield ,
3200 modifies the display of messages that are not really current in a way
3201 that is rather comparable to the
3202 .Fl l
3203 option of the POSIX
3204 .Xr ls 1
3205 command.
3206 The interpretation of the value is identical to what has been described
3208 .Va datefield .
3209 .It Va EDITOR
3210 Pathname of the text editor to use in the
3211 .Ic edit
3212 command and
3213 .Ic ~e
3214 tilde escape.
3215 A default editor is used if this value is not defined.
3216 .It Va encoding
3217 Suggestion for the MIME encoding to use in outgoing text messages
3218 and message parts.
3219 Valid values are the default `quoted-printable', `8bit' and `base64'.
3220 `8bit' may cause problems with when transferring mail messages over
3221 channels that are not ESMTP (RFC 1869) compliant.
3222 If there is no need to encode a message,
3223 `7bit' transfer mode is always used regardless of this variable.
3224 Binary data is always encoded as `base64'.
3225 .It Va escape
3226 If defined, the first character of this option
3227 gives the character to use in place of `~' to denote tilde escapes.
3228 .It Va folder
3229 The name of the directory to use for storing folders of messages.
3230 All folder names that begin with `+' refer to files below it.
3231 The same special conventions as documented for the
3232 .Ic folder
3233 command may be used when specifying a new value for
3234 .Va folder ,
3235 but be aware that the expansion is fully performed immediately.
3236 E.g., if the expanded name refers to an IMAP account, all names that
3237 begin with `+' refer to IMAP mailboxes below the
3238 .Va folder
3239 target box.
3241 Note: some IMAP servers do not accept the creation of mailboxes in
3242 the hierarchy base, but require that they are created as subfolders of
3243 `INBOX' \(en with such servers a folder name of the form
3245 .Dl imaps://mylogin@imap.myisp.example/INBOX.
3247 should be used (the last character is the server's hierarchy delimiter).
3248 Folder names prefixed by `+' will then refer to folders below `INBOX',
3249 while folder names prefixed by `@' refer to folders below the hierarchy
3250 base.
3251 See the
3252 .Ic imap
3253 namespace command for a method to detect the appropriate prefix and
3254 delimiter.
3255 .It Va folder-hook
3256 When a folder is opened and this variable is set,
3257 the macro corresponding to the value of this variable is executed.
3258 The macro is also invoked when new mail arrives,
3259 but message lists for commands executed from the macro
3260 only include newly arrived messages then.
3261 .It Va folder-hook-fullname
3262 When a folder named `fullname' is opened,
3263 the macro corresponding to the value of this variable is executed.
3264 Unlike other folder specifications,
3265 the fully expanded name of a folder, without metacharacters,
3266 is used to avoid ambiguities.
3267 The macro specified with
3268 .Va folder-hook
3269 is not executed if this variable is effective for a folder
3270 (but it can be
3271 .Ic call Ns
3272 ed from within the actually executed macro).
3273 .It Va from
3274 The address (or a list of addresses) to put into the `From:' field of
3275 the message header, quoting RFC 5322:
3276 the author(s) of the message, that is, the mailbox(es) of the person(s)
3277 or system(s) responsible for the writing of the message.
3278 If replying to messages these addresses are handled as if they were in
3280 .Ic alternates
3281 list.
3282 If the machine's hostname is not valid at the Internet (for example at
3283 a dialup machine) then either this variable or
3284 .Va hostname
3285 (\*(IN and with
3286 .Va smtp
3287 .Va smtp-hostname
3288 adds even more fine-tuning capabilities),
3289 have to be set.
3291 .Va from
3292 contains more than one address,
3293 setting the
3294 .Va sender
3295 variable is required (according to the standard RFC 5322).
3296 .It Va fwdheading
3297 The string to print before the text of a message with the
3298 .Ic forward
3299 command
3300 (unless the
3301 .Va forward-as-attachment
3302 variable is set).
3303 Defaults to `-------- Original Message --------' if unset.
3304 No heading is printed if it is set to the empty string.
3305 .It Va headline
3306 A format string to use for the header summary,
3307 similar to
3308 .Xr printf 3
3309 formats.
3310 A `%' character introduces a format specifier.
3311 It may be followed by a number indicating the field width.
3312 If the (possibly implicitly implied) field width is negative, the field
3313 is to be left-aligned.
3314 Valid format specifiers are:
3315 .Bl -tag -offset indent -width "%%"
3316 .It %a
3317 Message attributes.
3318 .It %d
3319 The date when the message was received.
3320 .It %e
3321 The indenting level in threaded mode.
3322 .It %f
3323 The address of the message sender.
3324 .It %i
3325 The message thread structure.
3326 (Note that this format doesn't support a field width.)
3327 .It %l
3328 The number of lines of the message.
3329 .It %m
3330 Message number.
3331 .It %o
3332 The number of octets (bytes) in the message.
3333 .It %s
3334 Message subject (if any).
3335 .It %S
3336 Message subject (if any) in double quotes.
3337 .It %t
3338 The position in threaded/sorted order.
3339 .It %>
3340 A `>' for the current message, otherwise ` '.
3341 .It %<
3342 A `<' for the current message, otherwise ` '.
3343 .It %$
3344 The spam score of the message, as has been classified via the command
3345 .Ic spamrate .
3346 .It %%
3347 A `%' character.
3350 The default is `%>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s',
3351 or `%>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S' if
3352 .Va bsdcompat
3353 is set.
3354 Also see
3355 .Va headline-bidi .
3356 .It Va headline-bidi
3357 Bidirectional text requires special treatment when displaying headers,
3358 because numbers (in dates or for file sizes etc.) will not affect the
3359 current text direction, in effect resulting in ugly line layouts when
3360 arabic or other right-to-left text is to be displayed.
3361 On the other hand only a minority of terminals is capable to correctly
3362 handle direction changes, so that user interaction is necessary for
3363 acceptable results.
3364 Note that extended host system support is required nonetheless, e.g.,
3365 detection of the terminal character set is one precondition;
3366 and this feature only works in an Unicode (i.e., UTF-8) locale.
3368 In general setting this variable will cause \*(UA to encapsulate text
3369 fields that may occur when printing
3370 .Va headline
3371 (and some other fields, like dynamic expansions in
3372 .Va prompt )
3373 with special Unicode control sequences;
3374 it is possible to fine-tune the terminal support level by assigning
3375 a value:
3376 no value (or any value other than `1', `2' and `3') will make \*(UA
3377 assume that the terminal is capable to properly deal with Unicode
3378 version 6.3, in which case text is embedded in a pair of U+2068 (FIRST
3379 STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE) characters.
3380 In addition no space on the line is reserved for these characters.
3382 Weaker support is chosen by using the value `1' (Unicode 6.3, but
3383 reserve the room of two spaces for writing the control sequences onto
3384 the line).
3385 The values `2' and `3' select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT
3386 MARK); the latter again reserves room for two spaces in addition.
3387 .It Va hostname
3388 Use this string as hostname when expanding local addresses instead of
3389 the value obtained from
3390 .Xr uname 2
3392 .Xr getaddrinfo 3 ,
3393 i.e., in `Message-ID:' and `From:' fields.
3394 Note that when
3395 .Va smtp
3396 transport is not used then it is normally the responsibility of the MTA
3397 to create these fields, \*(IN in conjunction with
3398 .Va smtp
3399 however
3400 .Va smtp-hostname
3401 also influences the results;
3402 you should produce some test messages with the desired combination of
3403 .Va hostname ,
3404 and/or
3405 .Va from ,
3406 .Va sender
3407 etc. first.
3408 .It Va imap-auth
3409 \*(OP Sets the IMAP authentication method.
3410 Valid values are `login' for the usual password-based authentication
3411 (the default),
3412 `cram-md5', which is a password-based authentication that does not send
3413 the password over the network in clear text,
3414 and `gssapi' for GSS-API based authentication.
3415 .It Va imap-auth-USER@HOST
3416 Sets the IMAP authentication method for a specific account.
3417 .It Va imap-cache
3418 \*(OP Enables caching of IMAP mailboxes.
3419 The value of this variable must point to a directory that is either
3420 existent or can be created by \*(UA.
3421 All contents of the cache can be deleted by \*(UA at any time;
3422 it is not safe to make assumptions about them.
3423 .It Va imap-keepalive
3424 \*(OP IMAP servers may close the connection after a period of
3425 inactivity; the standard requires this to be at least 30 minutes,
3426 but practical experience may vary.
3427 Setting this variable to a numeric `value' greater than 0 causes
3428 a `NOOP' command to be sent each `value' seconds if no other operation
3429 is performed.
3430 .It Va imap-list-depth
3431 \*(OP When retrieving the list of folders on an IMAP server, the
3432 .Ic folders
3433 command stops after it has reached a certain depth to avoid possible
3434 infinite loops.
3435 The value of this variable sets the maximum depth allowed.
3436 The default is 2.
3437 If the folder separator on the current IMAP server is a slash `/',
3438 this variable has no effect and the
3439 .Ic folders
3440 command does not descend to subfolders.
3441 .It Va indentprefix
3442 String used by the `~m', `~M' and `~R' tilde escapes and by the
3443 .Va quote
3444 option for indenting messages,
3445 in place of the normal tabulator character (`^I'), which is the default.
3446 Be sure to quote the value if it contains spaces or tabs.
3447 .It Va LISTER
3448 Pathname of the directory lister to use in the
3449 .Ic folders
3450 command when operating on local mailboxes.
3451 Default is
3452 .Pa /bin/ls .
3453 .It Va line-editor-cursor-right
3454 \*(OP If the builtin command line editor is used, actions which are
3455 based on rightwise movement may not work on some terminals.
3456 If you encounter such problems, set this variable to the terminal
3457 control sequence that is necessary to move the cursor one column to the
3458 right.
3459 The default is `\\033[C', which should work for most terminals.
3460 Less often occur `\\033OC' and `\\014'.
3461 Note that `ESCAPE' and other control character have to be written as
3462 shell-style escape sequences, e.g., `\\033' for `ESCAPE'.
3463 .It Va MAIL
3464 Is used as the user's mailbox, if set.
3465 Otherwise, a system-dependent default is used.
3466 Supports a logical subset of the special conventions that are documented
3467 for the
3468 .Ic folder
3469 command and the
3470 .Va folder
3471 option.
3472 .It Va MBOX
3473 The name of the mbox file.
3474 Supports a logical subset of the special conventions that are documented
3475 for the
3476 .Ic folder
3477 command and the
3478 .Va folder
3479 option.
3480 The fallback default is `mbox' in the user's home directory.
3481 .It Va mimetypes-load-control
3482 This option can be used to control which of the
3483 .Xr mime.types 5
3484 MIME type databases are loaded by \*(UA.
3485 If the letter `u' (or `U') is part of this options value, then the
3486 user's personal
3487 .Pa ~/.mime.types
3488 file will be loaded (if it exists);
3489 likewise the letter `s' (or `S') controls loading of the system wide
3490 .Pa /etc/mime.types .
3491 If this option is not set \*(UA will try to load both files instead.
3492 Incorporation of the MIME types that are compiled into \*(UA cannot be
3493 suppressed.
3494 .It Va NAIL_EXTRA_RC
3495 The name of an optional startup file to be read after \*(ur.
3496 This variable is ignored if it is imported from the environment;
3497 it has an effect only if it is set in \*(UR or \*(ur to allow bypassing
3498 the configuration with, e.g., `MAILRC=/dev/null'.
3499 Use this file for commands that are not understood by other \*(UA
3500 implementations.
3501 .It Va NAIL_HEAD
3502 A string to put at the beginning of each new message.
3503 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
3504 .It Va NAIL_HISTFILE
3505 \*(OP If a command line editor is available then this can be set to
3506 name the (expandable) path of the location of a permanent history file.
3507 .It Va NAIL_HISTSIZE
3508 \*(OP If a command line editor is available this value restricts the
3509 amount of history entries that are saved into a set and valid
3510 .Va NAIL_HISTFILE .
3511 A value of less than 0 disables this feature;
3512 note that loading and incorporation of
3513 .Va NAIL_HISTFILE
3514 upon program startup can also be suppressed by doing this.
3515 An unset or invalid value, or 0, causes a default value to be used.
3516 Dependent on the available command line editor this will also define the
3517 number of history entries in memory;
3518 it is also editor-specific wether runtime updates of this value will be
3519 honoured.
3520 .It Va NAIL_TAIL
3521 A string to put at the end of each new message.
3522 The escape sequences `\et' (tabulator) and `\en' (newline) are understood.
3523 .It Va newfolders
3524 If this variable has the value `maildir',
3525 newly created local folders will be in `maildir' format.
3526 .It Va newmail
3527 Checks for new mail in the current folder each time the prompt is
3528 printed.
3529 For IMAP mailboxes the server is then polled for new mail,
3530 which may result in delayed operation if the connection to the server is
3531 slow.
3532 A `maildir' folder must be re-scanned to determine if new mail has
3533 arrived.
3535 If this variable is set to the special value `nopoll' an IMAP server is
3536 not actively asked for new mail,
3537 but new mail may still be detected and announced with any other IMAP
3538 command that is sent to the server.
3539 A `maildir' folder is not scanned, then.
3541 In either case the IMAP server may send notifications about messages
3542 that have been deleted on the server by another process or client.
3543 In this case, `Expunged X messages' is printed regardless of this
3544 variable,
3545 and message numbers may have changed.
3546 .It Va ORGANIZATION
3547 The value to put into the `Organization:' field of the message header.
3548 .It Va PAGER
3549 Pathname of the program to use in the more command or when the
3550 .Va crt
3551 variable is set.
3552 The default paginator is
3553 .Xr more 1 .
3554 .It Va password
3555 \*(IN Sets a global fallback password, which is used in case none has
3556 been given in the protocol and account-specific URL and neither is there
3557 a matching `password-USER@HOST' nor a matching `password-HOST';
3558 as a last resort \*(UA will ask for a password on the user's terminal if
3559 the authentication method requires a password.
3560 Specifying passwords in a startup file is generally a security risk;
3561 the file should be readable by the invoking user only.
3562 .It Va password-HOST
3563 \*(IN Override
3564 .Va password
3565 for accounts on a specific host.
3566 .It Va password-USER@HOST
3567 \*(IN Override
3568 .Va password
3570 .Va password-HOST
3571 for a specific account.
3572 \*(OU
3573 Set the password for `user' when connecting to `host'.
3574 If no such variable is defined for a host,
3575 the user will be asked for a password on standard input.
3576 Specifying passwords in a startup file is generally a security risk;
3577 the file should be readable by the invoking user only.
3578 .It Va pipe-content/subcontent
3579 When a MIME message part of `content/subcontent' type is displayed or
3580 is replied to,
3581 its text is filtered through the value of this variable interpreted as
3582 a shell command.
3584 The special value `@' can be used to force interpretation of the message
3585 part as plain text, e.g., `set pipe-application/pgp-signature=@' will
3586 henceforth treat signatures as plain text and display them "as is".
3588 Also, if a normal shell command is prefixed with `@', then the command
3589 will only be used to prepare the MIME message part if the message is
3590 displayed by itself, but not when multiple messages are displayed at
3591 once.
3593 Finally, if a normal shell command is prefixed with `@&', then, in
3594 addition to what has been described for the plain `@' shell command
3595 prefix, the command will be run asynchronously, i.e., without blocking
3596 \*(UA, which may be a handy way to display a, e.g., PDF file while also
3597 continuing to read the mail message.
3599 Special care must be taken when using such commands as mail viruses may
3600 be distributed by this method;
3601 if messages of type `application/x-sh' were filtered through the shell,
3602 for example,
3603 a message sender could easily execute arbitrary code on the system \*(UA
3604 is running on.
3605 .It Va pop3-keepalive
3606 \*(OP POP3 servers close the connection after a period of inactivity;
3607 the standard requires this to be at least 10 minutes,
3608 but practical experience may vary.
3609 Setting this variable to a numeric `value' greater than 0 causes
3610 a `NOOP' command to be sent each `value' seconds if no other operation
3611 is performed.
3612 .It Va prompt
3613 The string printed when a command is accepted.
3614 Prompting may be prevented by either setting this to the null string
3615 or by setting
3616 .Va noprompt .
3617 The same XSI escape sequences that are understood by the
3618 .Ic echo
3619 command may be used within
3620 .Va prompt .
3622 In addition, the following \*(UA specific additional sequences are
3623 understood:
3624 `\\&', which expands to `?' unless
3625 .Va bsdcompat
3626 is set, in which case it expands to `&';
3627 note that "\\& " is the default value for
3628 .Va prompt .
3629 `\\?', which will expand to `1' if the last command failed, and to `0'
3630 otherwise,
3631 `\\$', which will expand to the name of the currently active
3632 .Ic account ,
3633 if any, and to the empty string otherwise,
3634 and `\\@', which will expand to the name of the currently active mailbox.
3635 (Note that the prompt buffer is size-limited, excess is cut off.)
3637 Even though
3638 .Va prompt
3639 checks for
3640 .Va headline-bidi
3641 to encapsulate the expansions of the `\\$' and `\\@' escape sequences as
3642 necessary to correctly display bidirectional text, this is not true for
3643 the final string that makes up
3644 .Va prompt
3645 as such, i.e., real BIDI handling is not supported.
3647 When a newer version of the
3648 .Xr editline 3
3649 .Sx "Command line editor"
3650 is used, any escape sequence must itself be encapsulated with another
3651 escape character for usage with the
3652 .Va EL_PROMPT_ESC
3653 mechanism: \*(UA configures the control character `\\01' for this.
3654 .It Va quote
3655 If set, \*(UA starts a replying message with the original message
3656 prefixed by the value of the variable
3657 .Va indentprefix .
3658 Normally, a heading consisting of `Fromheaderfield wrote:' is printed
3659 before the quotation.
3660 If the string `noheading' is assigned to the
3661 .Va quote
3662 variable, this heading is omitted.
3663 If the string `headers' is assigned, the headers selected by the
3664 .Ic ignore Ns / Ns Ic retain
3665 commands are printed above the message body,
3666 thus
3667 .Va quote
3668 acts like an automatic `~m' tilde escape command, then.
3669 If the string `allheaders' is assigned, all headers are printed above
3670 the message body and all MIME parts are included,
3671 making
3672 .Va quote
3673 act like an automatic `~M' command.
3674 Also see
3675 .Va quote-as-attachment .
3676 .It Va quote-fold
3677 \*(OP Can be set in addition to
3678 .Va indentprefix .
3679 Setting this turns on a more fancy quotation algorithm in that leading
3680 quotation characters are compressed and overlong lines are folded.
3681 .Va quote-fold
3682 can be set to either one or two (space separated) numeric values,
3683 which are interpreted as the maximum (goal) and the minimum line length,
3684 respectively, in a spirit rather equal to the
3685 .Xr fmt 1
3686 program, but line-, not paragraph-based.
3687 If not set explicitly the minimum will reflect the goal algorithmically.
3688 The goal can't be smaller than the length of
3689 .Va indentprefix
3690 plus some additional pad.
3691 Necessary adjustments take place silently.
3692 .It Va record
3693 If defined, gives the pathname of the folder used to record all outgoing
3694 mail.
3695 If not defined, then outgoing mail is not saved.
3696 When saving to this folder fails the message is not sent,
3697 but instead saved to
3698 .Va DEAD .
3699 .It Va replyto
3700 A list of addresses to put into the `Reply-To:' field of the message
3701 header.
3702 Members of this list are handled as if they were in the
3703 .Ic alternates
3704 list.
3705 .It Va screen
3706 When \*(UA initially prints the message headers it determines the number
3707 to print by looking at the speed of the terminal.
3708 The faster the terminal, the more it prints.
3709 This option overrides this calculation and specifies how many message
3710 headers are printed.
3711 This number is also used for scrolling with the
3712 .Ic z
3713 command.
3714 .It Va sendcharsets
3715 \*(OP A comma-separated list of character set names that can be used in
3716 outgoing Internet mail.
3717 The value of the variable
3718 .Va charset-8bit
3719 is automatically appended to this list of character-sets.
3720 If no character set conversion capabilities are compiled into \*(UA then
3721 the only supported charset is
3722 .Va ttycharset .
3723 Also see
3724 .Va sendcharsets-else-ttycharset
3725 and refer to the section
3726 .Sx "Character sets"
3727 for the complete picture of character set conversion in \*(UA.
3728 .It Va sender
3729 An address that is put into the `Sender:' field of outgoing messages,
3730 quoting RFC 5322: the mailbox of the agent responsible for the actual
3731 transmission of the message.
3732 This field should normally not be used unless the `From:' field contains
3733 more than one address, on which case it is required.
3735 .Va sender
3736 address is handled as if it were in the
3737 .Ic alternates
3738 list.
3739 .It Va sendmail
3740 To use an alternate mail delivery system,
3741 set this option to the full pathname of the program to use.
3742 It may be necessary to set
3743 .Va sendmail-progname
3744 in addition.
3745 .It Va sendmail-arguments
3746 Arguments to pass through to the Mail-Transfer-Agent can be given via
3747 this option.
3748 These will be joined onto MTA options that have been given on the
3749 command line.
3751 .Dl set sendmail-arguments='-t -X \&"/tmp/my log\&"'
3752 .It Va sendmail-progname
3753 Many systems use a so-called
3754 .Xr mailwrapper 8
3755 environment to ensure compatibility with
3756 .Xr sendmail 1 .
3757 This works by inspecting the name that was used to invoke the mail
3758 delivery system.
3759 If this variable is set then the mailwrapper (the program that is
3760 actually executed when calling `sendmail') will treat its contents as
3761 that name.
3762 The default is `sendmail'.
3763 .It Va SHELL
3764 Pathname of the shell to use in the
3765 .Ic !
3766 command and the `~!' tilde escape.
3767 A default shell is used if this option is not defined.
3768 .It Va Sign
3769 A string for use with the `~A' tilde escape.
3770 .It Va sign
3771 A string for use with the `~a' tilde escape.
3772 .It Va signature
3773 Must correspond to the name of a readable file if set.
3774 The file's content is then appended to each singlepart message
3775 and to the first part of each multipart message.
3776 Be warned that there is no possibility to edit the signature for an
3777 individual message.
3778 .It Va smime-ca-dir
3779 \*(OP Specifies a directory with CA certificates in PEM (Privacy
3780 Enhanced Mail) format for verification of S/MIME signed messages.
3781 .It Va smime-ca-file
3782 \*(OP Specifies a file with CA certificates in PEM format for
3783 verification of S/MIME signed messages.
3784 .It Va smime-cipher-USER@HOST
3785 \*(OP Specifies a cipher to use when generating S/MIME encrypted
3786 messages for the specified account.
3787 RFC 5751 mandates a default of `aes-128' (AES-128 CBC).
3789 The actually available cipher algorithms depend on the cryptographic
3790 library that \*(UA uses; possible values are, in decreasing cipher
3791 strength:
3792 `aes-256' (AES-256 CBC), `aes-192' (AES-192 CBC), `aes-128' (AES-128 CBC),
3793 `des3' (DES EDE3 CBC, 168 bits; default if `aes-128' isn't available)
3794 and `des' (DES CBC, 56 bits).
3796 The following ciphers have been obsoleted and are no longer mentioned by
3797 the S/MIME specification (RFC 5751), but may be selected if available:
3798 `rc2-64' (RC2 CBC, 64 bits) and `rc2-40' (RC2 CBC, 40 bits).
3799 .It Va smime-crl-file
3800 \*(OP Specifies a file that contains a CRL in PEM format to use when
3801 verifying S/MIME messages.
3802 .It Va smime-crl-dir
3803 \*(OP Specifies a directory that contains files with CRLs in PEM format
3804 to use when verifying S/MIME messages.
3805 .It Va smime-encrypt-USER@HOST
3806 \*(OP If this variable is set, messages send to the given receiver are
3807 encrypted before sending.
3808 The value of the variable must be set to the name of a file that
3809 contains a certificate in PEM format.
3811 If a message is sent to multiple recipients,
3812 each of them for whom a corresponding variable is set will receive an
3813 individually encrypted message;
3814 other recipients will continue to receive the message in plain text
3815 unless the
3816 .Va smime-force-encryption
3817 variable is set.
3818 It is recommended to sign encrypted messages, i.e., to also set the
3819 .Va smime-sign
3820 variable.
3821 .It Va smime-sign-cert
3822 \*(OP Points to a file in PEM format.
3823 For the purpose of signing and decryption this file needs to contain the
3824 user's private key as well as his certificate.
3826 For the purpose of encryption the recipient's public encryption key
3827 (certificate) is expected; the command
3828 .Ic certsave
3829 can be used to save certificates of signed messages (the section
3830 .Sx "Signed and encrypted messages with S/MIME"
3831 gives some details).
3832 This mode of operation is usually driven via
3833 .Va smime-sign-cert-USER@HOST ,
3834 though.
3835 .It Va smime-sign-cert-USER@HOST
3836 Overrides
3837 .Va smime-sign-cert
3838 for a specific account.
3839 For message signing `USER@HOST' is always derived from the value of
3840 .Va from
3841 (or, if that contains multiple addresses,
3842 .Va sender Ns
3845 When decrypting messages the account is derived from the recipient
3846 fields (`To:' and `Cc:') of the message, which are searched for
3847 addresses for which such a variable is set.
3848 \*(UA always uses the first address that matches,
3849 so if the same message is sent to more than one of the user's addresses
3850 using different encryption keys, decryption might fail.
3851 .It Va smime-sign-include-certs
3852 \*(OP If used, this is supposed to a consist of a comma-separated list
3853 of files, each of which containing a single certificate in PEM format to
3854 be included in the S/MIME message in addition to the
3855 .Va smime-sign-cert
3856 certificate.
3857 This is most useful for long certificate chains if it is desired to aid
3858 the receiving party's verification process.
3859 Note that top level certificates may also be included in the chain but
3860 don't play a role for verification.
3861 Also see
3862 .Va smime-sign-cert
3864 .Va smime-sign-cert-USER@HOST .
3865 .It Va smime-sign-include-certs-USER@HOST
3866 Overrides
3867 .Va smime-sign-include-certs
3868 for a specific account.
3869 .It Va smtp
3870 \*(OP Normally \*(UA invokes the program defined via
3871 .Va sendmail
3872 to transfer messages.
3873 Setting the
3874 .Va smtp
3875 variable will instead cause `SMTP' network connections be made to the
3876 server specified therein in order to directly submit the message.
3877 \*(UA knows about three different "SMTP protocols":
3878 .Bl -bullet -offset indent
3880 The plain `SMTP' protocol (RFC 5321) that normally lives on the
3881 server port 25 and requires setting of the
3882 .Va smtp-use-starttls
3883 variable as above to enter a SSL/TLS encrypted session state.
3884 Assign a value like \*(IN `[smtp://][user[:password]@]server[:port]'
3885 (\*(OU `[smtp://]server[:port]')
3886 to choose this protocol.
3888 Then the so-called `SMTPS' which is supposed to live on server port 465
3889 and is automatically SSL/TLS secured.
3890 Unfortunately it never became a standardized protocol and may thus not
3891 be supported by your hosts network service database
3892 \(en in fact the port number has already been reassigned to other
3893 protocols!
3895 `SMTPS' is nonetheless a commonly offered "protocol" and thus can be
3896 chosen by assigning a value like \*(IN
3897 `smtps://[user[:password]@]server[:port]'
3898 (\*(OU `smtps://server[:port]');
3899 due to the mentioned problems it is usually necessary to explicitly
3900 specify the port as `:465', however.
3902 Finally there is the `SUBMISSION' protocol (RFC 6409), which usually
3903 lives on server port 587 and is practically identically to the `SMTP'
3904 protocol from \*(UAs point of view beside that; it requires setting the
3905 .Va smtp-use-starttls
3906 variable to enter a SSL/TLS secured session state.
3907 Assign a value like \*(IN `submission://[user[:password]@]server[:port]'
3908 (\*(OU `submission://server[:port]').
3911 The SMTP transfer is executed in a child process, which runs
3912 asynchronously unless either the
3913 .Va sendwait
3914 or the
3915 .Va verbose
3916 variable is set.
3917 If it receives a TERM signal, it will abort and save the message to
3918 .Va DEAD .
3919 .It Va smtp-auth
3920 \*(OP Sets the SMTP authentication method.
3921 Possible values are `none' (the default), `plain', `login'
3922 as well as the \*(OPal methods `cram-md5' and `gssapi'.
3923 The `none' method doesn't need any user credentials,
3924 `gssapi' requires a user name
3925 and all other methods require a user name and a password.
3926 See \*(IN
3927 .Va smtp ,
3928 .Va user
3930 .Va password
3931 (\*(OU
3932 .Va smtp-auth-password
3934 .Va smtp-auth-user Ns
3936 .It Va smtp-auth-HOST
3937 \*(IN Overrides
3938 .Va smtp-auth
3939 for SMTP accounts on a specific host.
3940 .It Va smtp-auth-USER@HOST
3941 Overrides
3942 .Va smtp-auth
3943 for a specific account.
3944 (\*(OU For specific values of sender addresses, dependend upon the variable
3945 .Va from Ns
3946 .Ns .)
3947 .It Va smtp-auth-password
3948 \*(OP \*(OU Sets the global fallback password for SMTP authentication.
3949 If the authentication method requires a password, but neither
3950 .Va smtp-auth-password
3951 nor a matching
3952 .Va smtp-auth-password-USER@HOST
3953 can be found,
3954 \*(UA will ask for a password on the user's terminal.
3955 .It Va smtp-auth-password-USER@HOST
3956 Overrides
3957 .Va smtp-auth-password
3958 for specific values of sender addresses, dependent upon the variable
3959 .Va from .
3960 .It Va smtp-auth-user
3961 \*(OP \*(OU Sets the global fallback user name for SMTP authentication.
3962 If the authentication method requires a user name, but neither
3963 .Va smtp-auth-user
3964 nor a matching
3965 .Va smtp-auth-user-USER@HOST
3966 can be found,
3967 \*(UA will ask for a user name on the user's terminal.
3968 .It Va smtp-auth-user-USER@HOST
3969 Overrides
3970 .Va smtp-auth-user
3971 for specific values of sender addresses, dependent upon the variable
3972 .Va from .
3973 .It Va smtp-hostname
3974 \*(IN Normally \*(UA uses the variable
3975 .Va from
3976 to derive the necessary `USER@HOST' information to issue a
3977 `MAIL FROM:<>' SMTP command.
3978 Setting
3979 .Va smtp-hostname
3980 can be used to use the `USER' from the SMTP account
3981 .Ns ( Va smtp
3982 or the
3983 .Va user
3984 variable chain)
3985 and the `HOST' from the content of this variable
3986 (or, if that is the empty string,
3987 .Va hostname
3988 or the local hostname as a last resort).
3989 Setting this variable also influences the generated `Message-Id:'.
3990 .It Va spam-command
3991 \*(OP The path to the spam detector.
3992 Note that the path is not expanded, but used "as is".
3993 A fallback path will have been compiled into the \*(UA binary if the
3994 .Xr spamc 1
3995 executable had been found during compilation.
3996 .It Va spam-host
3997 \*(OP Can be used to specify the host on which
3998 .Xr spamd 1
3999 listens for connections; if not set, defaults to `localhost'.
4000 .It Va spam-maxsize
4001 \*(OP Spam detectors like
4002 .Xr spamc 1
4003 decline to work with messages which exceed a specific size;
4004 if this variable is set then \*(UA won't even try to pass messages which
4005 exceed the given limit.
4006 The default is 420000 bytes.
4007 .It Va spam-port
4008 \*(OP Can be used to explicitly specify the port on which
4009 .Xr spamd 1
4010 listens for connections.
4011 .It Va spam-socket
4012 \*(OP If the spam detector listens on a path-based UNIX domain socket,
4013 then setting this variable to the fully qualified path will force its
4014 usage for communication.
4015 .It Va spam-user
4016 \*(OP This can be used to support multiple, per-used configuration files
4017 of the spam detector.
4018 Note that \*(UA doesn't automatically set this to reflect a possibly set
4019 .Fl u
4020 option.
4021 .It Va ssl-ca-dir
4022 \*(OP Specifies a directory with CA certificates in PEM (Pricacy
4023 Enhanced Mail) for verification of of SSL/TLS server certificates.
4025 .Xr SSL_CTX_load_verify_locations 3
4026 for more information.
4027 .It Va ssl-ca-file
4028 \*(OP Specifies a file with CA certificates in PEM format for
4029 verification of SSL/TLS server certificates.
4031 .Xr SSL_CTX_load_verify_locations 3
4032 for more information.
4033 .It Va ssl-cert
4034 \*(OP Sets the file name for a SSL/TLS client certificate required by
4035 some servers.
4036 .It Va ssl-cert-USER@HOST
4037 Sets an account-specific file name for a SSL/TLS client certificate
4038 required by some servers.
4039 Overrides
4040 .Va ssl-cert
4041 for the specified account.
4042 .It Va ssl-cipher-list
4043 \*(OP Specifies a list of ciphers for SSL/TLS connections.
4045 .Xr ciphers 1
4046 for more information.
4047 .It Va ssl-crl-file
4048 \*(OP Specifies a file that contains a CRL in PEM format to use when
4049 verifying SSL/TLS server certificates.
4050 .It Va ssl-crl-dir
4051 \*(OP Specifies a directory that contains files with CRLs in PEM format
4052 to use when verifying SSL/TLS server certificates.
4053 .It Va ssl-key
4054 \*(OP Sets the file name for the private key of a SSL/TLS client
4055 certificate.
4056 If unset, the name of the certificate file is used.
4057 The file is expected to be in PEM format.
4058 .It Va ssl-key-USER@HOST
4059 Sets an account-specific file name for the private key of a SSL/TLS
4060 client certificate.
4061 Overrides
4062 .Va ssl-key
4063 for the specified account.
4064 .It Va ssl-method
4065 \*(OP Selects the used TLS/SSL protocol version.
4066 The actually available protocol versions depend on the TLS/SSL
4067 library that \*(UA uses; possible values are, from newest to oldest:
4068 `tls1.2', `tls1.1', `tls1', `ssl3' and `ssl2'.
4070 Setting
4071 .Va ssl-method
4072 to any of these values will fixate the used protocol, which means that
4073 connections will fail if the server doesn't support it.
4074 The value `auto', which is the default, chooses a compatibility method
4075 that automatically uses the newest protocol version that the server
4076 is capable to understand.
4078 It has to be noted that `auto' is used as a fallback method if
4079 the actual setting of
4080 .Va ssl-method
4081 isn't supported by the used TLS/SSL library \(em in this case an error
4082 message will be printed first, however.
4083 .It Va ssl-method-USER@HOST
4084 Overrides
4085 .Va ssl-method
4086 for a specific account.
4087 .It Va ssl-rand-egd
4088 \*(OP Gives the pathname to an entropy daemon socket, see
4089 .Xr RAND_egd 3 .
4090 Note that (as of 2014) not all OpenSSL installations include this
4091 functionality.
4092 .It Va ssl-rand-file
4093 \*(OP Gives the pathname to a file with entropy data, see
4094 .Xr RAND_load_file 3 .
4095 If the file is a regular file writable by the invoking user,
4096 new data is written to it after it has been loaded.
4097 .It Va ssl-verify
4098 \*(OP Sets the action to be performed if an error occurs during SSL/TLS
4099 server certificate validation.
4100 Valid values are
4101 `strict' (fail and close connection immediately),
4102 `ask' (ask whether to continue on standard input),
4103 `warn' (print a warning and continue),
4104 `ignore' (do not perform validation).
4105 The default is `ask'.
4106 .It Va ssl-verify-USER@HOST
4107 Overrides
4108 .Va ssl-verify
4109 for a specific account.
4110 .It Va stealthmua
4111 If only set without an assigned value, then this option inhibits the
4112 generation of the `Message-Id:' and `User-Agent:' header fields that
4113 include obvious references to \*(UA.
4114 There are two pitfalls associated with this:
4115 First, the message id of outgoing messages is not known anymore.
4116 Second, an expert may still use the remaining information in the header
4117 to track down the originating mail user agent.
4118 If set to the value `noagent', then the mentioned `Message-Id:'
4119 suppression doesn't occur.
4120 .It Va toplines
4121 If defined, gives the number of lines of a message to be printed out
4122 with the top command;
4123 normally, the first five lines are printed.
4124 .It Va ttycharset
4125 The character set of the terminal \*(UA operates on,
4126 and the one and only supported character set that \*(UA can use if no
4127 character set conversion capabilities have been compiled into it,
4128 in which case it defaults to `ISO-8859-1' unless it can deduce a value
4129 from the `LC_CTYPE' locale environment.
4130 Refer to the section
4131 .Sx "Character sets"
4132 for the complete picture about character sets.
4133 .It Va user
4134 \*(IN Sets a global fallback user name, which is used in case none has
4135 been given in the protocol and account-specific URL and there is also
4136 no matching
4137 .Va user-HOST .
4138 This variable defaults to the value of
4139 .Va USER .
4140 .It Va user-HOST
4141 \*(IN Overrides
4142 .Va user
4143 for a specific host.
4144 .It Va VISUAL
4145 Pathname of the text editor to use in the
4146 .Ic visual
4147 command and `~v' tilde escape.
4149 .\" }}}
4151 .\" .Sh ENVIRONMENT {{{
4152 .Sh ENVIRONMENT
4153 Besides the variables described above,
4154 \*(UA uses the following environment variables:
4155 .Bl -tag -width ".It Va MAILRC"
4156 .It Va COLUMNS
4157 The user's preferred width in column positions for the terminal screen
4158 or window (only used during startup).
4159 .It Va HOME
4160 The user's home directory.
4161 .It Va LANG , Va LC_ALL , Va LC_COLLATE , Va LC_CTYPE , Va LC_MESSAGES
4163 .Xr locale 7 .
4164 .It Va LINES
4165 The user's preferred number of lines on a page or the vertical screen or
4166 window size in lines (only used during startup).
4167 .It Va MAILRC
4168 Is used as a startup file instead of \*(ur if set.
4169 When \*(UA scripts are invoked on behalf of other users,
4170 this variable should be set to
4171 .Pa /dev/null
4172 to avoid side-effects from reading their configuration files.
4173 .It Va NAILRC
4174 If this variable is set and
4175 .Va MAILRC
4176 is not, it is treated as a startup configuration file and read.
4177 .It Va NAIL_NO_SYSTEM_RC
4178 If this variable is set then reading of \*(UR at startup is inhibited,
4179 i.e., the same effect is achieved as if \*(UA had been started up with
4180 the option
4181 .Fl n .
4182 .It Va SYSV3
4183 Changes the letters printed in the first column of a header summary.
4184 .It Va TERM
4185 \*(OP The terminal type for which output is to be prepared.
4186 .It Va TMPDIR
4187 Used as directory for temporary files instead of
4188 .Pa /tmp ,
4189 if set.
4190 .It Va USER
4191 Can be used to force identification as
4192 .Va USER ,
4193 i.e., identical to the
4194 .Fl u
4195 command line option.
4197 .\" }}}
4199 .\" .Sh FILES {{{
4200 .Sh FILES
4201 .Bl -tag -width ".It Pa /etc/mime.types"
4202 .It Pa \*(ur
4203 File giving initial commands.
4204 .It Pa \*(UR
4205 System wide initialization file.
4206 .It Pa ~/.mime.types
4207 Personal MIME types.
4208 .It Pa /etc/mime.types
4209 System wide MIME types.
4211 .\" }}}
4213 .\" .Sh EXAMPLES {{{
4214 .Sh EXAMPLES
4216 .\" .Ss "Getting started" {{{
4217 .Ss "Getting started"
4218 The \*(UA command has two distinct usages, according to whether one
4219 wants to send or receive mail.
4220 Sending mail is simple: to send a message to a user whose email address
4221 is, say, `<bill@host.example>', use the shell command:
4223 .Dl $ \*(ua bill@host.example
4225 then type your message.
4226 \*(UA will prompt you for a message `Subject:' first;
4227 after that, lines typed by you form the body of the message.
4228 When you reach the end of the message,
4229 type an EOT (`control\-D') at the beginning of a line,
4230 which will cause \*(UA to echo `EOT' and return you to the shell.
4232 If, while you are composing the message you decide that you do not wish
4233 to send it after all, you can abort the letter by typing two `RUBOUT'
4234 (interrupt, `control-C') characters.
4235 Typing a single `RUBOUT' causes \*(UA to print
4236 .Ns ` Ns Li (Interrupt -- one more to kill letter) Ns '.
4237 Typing a second `RUBOUT' causes \*(UA to save your partial letter on the
4238 file
4239 .Va DEAD
4240 and abort the letter.
4241 Once you have sent mail to someone, there is no way to undo the act, so
4242 be careful.
4244 If you want to send the same message to several other people,
4245 you can list their email addresses on the command line.
4246 .Bd -literal -offset indent
4247 $ \*(ua sam@workstation.example bob@server.example
4248 Subject: Fees
4249 Tuition fees are due next Friday.  Don't forget!
4250 <control\-D>
4255 will sendout to `<sam@workstation.example>' and `<bob@server.example>'.
4256 To read your mail, simply type
4258 .Dl $ \*(ua
4260 \*(UA will respond by typing its version number and date and then
4261 listing the messages you have waiting.
4262 Then it will type a prompt and await your command.
4263 The messages are assigned numbers starting with 1 \(en you refer to the
4264 messages with these numbers.
4265 \*(UA keeps track of which messages are `new' (have been sent since you
4266 last read your mail) and `read' (have been read by you).
4267 New messages have an `N' next to them in the header listing and old,
4268 but unread messages have a `U' next to them.
4269 \*(UA keeps track of new/old and read/unread messages by putting a
4270 header field called `Status' into your messages.
4272 To look at a specific message, use the
4273 .Ic type
4274 command, which may be abbreviated to simply `t'.
4275 For example, if you had the following messages:
4276 .Bd -literal -offset indent
4277 O 1 drfoo@myhost.example Wed Sep  1 19:52   5/421 "Fees"
4278 O 2 sam@friends.example  Thu Sep  2 00:08  30/895
4281 you could examine the first message by giving the command:
4283 .Dl type 1
4285 which might cause \*(UA to respond with, for example:
4286 .Bd -literal -offset indent
4287 [-- Message  1 -- 5 lines, 421 bytes --]:
4288 From drfoo@myhost.example Wed Sep  1 19:52:25 2004
4289 Subject: Fees
4290 Status: R
4292 Tuition fees are due next Wednesday.  Don't forget!
4295 Many \*(UA commands that operate on messages take a message number as an
4296 argument, just as the shown
4297 .Ic type
4298 command.
4299 For these commands, there is a notion of a current message.
4300 When you enter the \*(UA program,
4301 the current message is initially the first (or the first recent) one.
4302 Thus, you can often omit the message number and use, for example, `t` to
4303 type the current message.
4304 As a further shorthand, you can type a message by simply giving its
4305 message number \(en hence `1` would type the first message.
4307 Frequently, it is useful to read the messages in your mailbox in order,
4308 one after another.
4309 You can read the next message in \*(UA by simply typing a newline.
4310 As a special case, you can type a newline as your first command to
4311 \*(UA to type the first message.
4313 If, after typing a message, you wish to immediately send a reply,
4314 you can do so with the command
4315 .Ic reply .
4316 This command, like
4317 .Ic type ,
4318 takes a message number as an argument.
4319 \*(UA then begins a message addressed to the user who sent you the
4320 message and let you type in your letter in reply, followed by
4321 a `control-D' (`^D')at the beginning of a line, as before.
4323 Note that \*(UA copies the subject header from the original message.
4324 This is useful in that correspondence about a particular matter will
4325 tend to retain the same subject heading, making it easy to recognize.
4326 If there are other header fields in the message, like `Cc:',
4327 the information found will also be used.
4329 Sometimes you will receive a message that has been sent to several
4330 people and wish to reply only to the person who sent it.
4331 .Ic Reply
4332 (with a capital `R') replies to a message, but sends a copy to the
4333 sender only.
4335 If you wish, while reading your mail, to send a message to someone,
4336 but not as a reply to one of your messages, you can send the message
4337 directly with the
4338 .Ic mail
4339 command, which takes as arguments the names of the recipients you wish
4340 to send to.
4341 For example, to send a message to `<frank@machine.example>':
4343 .Dl mail frank@machine.example
4345 To delete a message from the mail folder, you can use the command
4346 .Ic delete .
4347 In addition to not saving deleted messages,
4348 \*(UA will not let you type them, either.
4349 The effect is to make the message disappear altogether, along with its
4350 number.
4352 Many features of \*(UA can be tailored to your liking with the
4353 .Ic set
4354 command; it has two forms, depending on whether you are setting
4355 a `binary' or a `valued' option.
4356 Binary options are either on or off \(en for example, the
4357 .Va askcc
4358 option informs \*(UA that each time you send a message, you want it to
4359 prompt you for a `Cc:' header to be included in the message.
4360 To set the
4361 .Va askcc
4362 option, you would type
4364 .Dl set askcc
4366 Valued options are values which \*(UA uses to adapt to your tastes.
4367 For example, the
4368 .Va record
4369 option tells \*(UA where to save messages sent by you,
4370 and is specified by, e.g.,
4372 .Dl set record=Sent
4374 Note that no spaces are allowed in `set record=Sent'.
4376 \*(UA includes a simple facility for maintaining groups of messages
4377 together in folders.
4378 To use the folder facility, you must tell \*(UA where you wish to keep
4379 your folders.
4380 Each folder of messages will be a single file.
4381 For convenience, all of your folders are kept in a single directory of
4382 your choosing.
4383 To tell \*(UA where your folder directory is, put a line of the form
4385 .Dl set folder=letters
4387 in your \*(ur file.
4388 If, as in the example above, your folder directory does not begin with
4389 a `/', \*(UA will assume that your folder directory is to be found
4390 starting from your home directory.
4392 Anywhere a file name is expected, you can use a folder name, preceded
4393 with `+'.
4394 For example, to put a message into a folder with the
4395 .Ic save
4396 command, you can use:
4398 .Dl save +classwork
4400 to save the current message in the `classwork' folder.
4401 If the `classwork' folder does not yet exist, it will be created.
4402 Note that messages which are saved with the
4403 .Ic save
4404 command are automatically removed from your system mailbox.
4406 In order to make a copy of a message in a folder without causing
4407 that message to be removed from your system mailbox, use the
4408 .Ic copy
4409 command, which is identical in all other respects to the
4410 .Ic save
4411 command.
4414 .Ic folder
4415 command
4416 can be used to direct \*(UA to the contents of a different folder.
4417 For example,
4419 .Dl folder +classwork
4421 directs \*(UA to read the contents of the `classwork' folder.
4422 All of the commands that you can use on your system mailbox are also
4423 applicable to folders, including
4424 .Ic type ,
4425 .Ic delete ,
4427 .Ic reply .
4428 To inquire which folder you are currently editing, use `folder' without
4429 arguments.
4430 And to list your current set of folders, use the
4431 .Ic folders
4432 command.
4434 Finally, the
4435 .Ic help
4436 command is available to print out a brief summary of the most important
4437 \*(UA commands.
4439 While typing in a message to be sent to others it is often useful to be
4440 able to invoke the text editor on the partial message, print the
4441 message, execute a shell command, or do some other auxiliary function.
4442 \*(UA provides these capabilities through `tilde escapes',
4443 which consist of a tilde (`~') at the beginning of a line, followed by
4444 a single character which indicates the function to be performed.
4445 For example, to print the text of the message so far, use:
4447 .Dl ~p
4449 which will print a line of dashes, the recipients of your message, and
4450 the text of the message so far.
4451 A list of the most important tilde escapes is available with `~?'.
4452 .\" }}}
4454 .\" .Ss "IMAP or POP3 client setup" {{{
4455 .Ss "IMAP or POP3 client setup"
4456 \*(OP First you need the following data from your ISP:
4457 the host name of the IMAP or POP3 server,
4458 user name and password for this server,
4459 and a notice whether the server uses SSL/TLS encryption.
4460 Assuming the SSL/TLS secured host name of your IMAP account is
4461 `server.myisp.example' and your user name for that server is `mylogin',
4462 you could refer to this account using the
4463 .Ic folder
4464 command or the
4465 .Fl f
4466 command line option with
4468 .Dl imaps://mylogin@server.myisp.example
4470 (This string is not necessarily the same as your Internet mail address.)
4471 Even if the server does not accept IMAPS or POP3S connections,
4472 it is possible that it supports the `STARTTLS' method of upgrading
4473 already connected, but not yet authenticated sessions to use SSL/TLS
4474 encryption.
4475 The only reliable method to see if this works is to try it; enter one of
4477 .Dl set imap-use-starttls
4478 .Dl set pop3-use-starttls
4480 before you initiate the connection, dependent on the actual protocol.
4482 As you probably want messages to be deleted from this account
4483 after saving them, prefix it with `%:'.
4485 .Ic shortcut
4486 command can be used to avoid typing that many characters every time you
4487 want to connect:
4489 .Dl shortcut myisp %:imaps://mylogin@server.myisp.example
4491 You might want to put this string into a startup file.
4492 .Ic shortcut
4493 is one of those commands that are specific to \*(UA and will thus
4494 confuse other implementations of POSIX
4495 .Xr mailx 1 ,
4496 so it should possibly not be placed in \*(ur.
4497 Instead, put
4499 .Dl set NAIL_EXTRA_RC=.\*(uarc
4501 in \*(ur and create a file
4502 .Pa ~/.\*(uarc
4503 containing all the commands that are specific to \*(UA.
4504 You can then access your remote mailbox by invoking
4506 .Dl \*(ua \-f myisp
4508 on the command line, or by executing
4510 .Dl fi myisp
4512 within \*(UA.
4513 If you want to use more than one IMAP mailbox on a server,
4514 or if you want to use the IMAP server for mail storage too, the
4515 .Ic account
4516 command (which is also \*(UA-specific) is possibly more appropriate.
4517 You can put the following in
4518 .Pa ~/.\*(uarc :
4519 .Bd -literal -offset indent
4520 account myisp {
4521    set folder=imaps://mylogin@server.myisp.example
4522    set record=+Sent MBOX=+mbox outfolder
4526 and can then access incoming mail for this account by invoking
4527 `\*(ua \-A myisp' on the command line or by executing `ac myisp' within
4528 \*(UA.
4529 After that, a command like `copy 1 +otherfolder' will refer to
4530 `otherfolder' on the IMAP server.
4531 In particular, `fi&' will change to the `mbox' folder,
4532 and `fi+Sent' will show your recorded sent mail,
4533 with both folders located on the IMAP server.
4535 \*(UA will ask you for a password string each time you connect to
4536 a remote account.
4537 If you can reasonably trust the security of your workstation,
4538 you can give this password in the startup file as
4540 .Dl set password-mylogin@server.myisp.example="SECRET"
4542 You should change the permissions of this file to 0600, see
4543 .Xr chmod 1 .
4545 \*(UA supports different authentication methods for both IMAP and POP3.
4546 If Kerberos is used at your location,
4547 you can try to activate (the optional) GSS-API based authentication via
4549 .Dl set imap-auth=gssapi
4551 The advantage of this method is that \*(UA doesn't need to know your
4552 password at all, nor does it have to send sensitive data over the network.
4553 If that isn't possible, try to use authentication methods that at least
4554 avoid sending the password in clear over the wire, which is especially
4555 important if SSL/TLS cannot be used, e.g.,
4557 .Dl set imap-auth=cram-md5
4559 For POP3 \*(UA will try to use the `APOP' mechanism automatically unless
4560 explicitly disabled.
4561 If the server does not offer any such authentication methods,
4562 conventional user/password based authentication must be used.
4563 It is sometimes helpful, especially when setting up an account or when
4564 there are authentification problems, to enable verbosity by setting the
4565 .Va verbose
4566 option \(en \*(UA will display all data sent to the server in clear text
4567 on the screen when this option is set.
4568 (Because this may also include passwords you should take care that no
4569 unauthorized person can look at your terminal when this option is set.)
4571 If you regularly use the same workstation to access IMAP accounts,
4572 you can greatly enhance performance by enabling local caching of IMAP
4573 messages.
4574 For any message that has been fully or partially fetched from the server,
4575 a local copy is made and is used when the message is accessed again,
4576 so most data is transferred over the network once only.
4577 To enable the IMAP cache, select a local directory name and put
4579 .Dl set imap-cache=~/localdirectory
4581 in the (\*(UA-specific) startup file.
4582 All files within that directory can be overwritten or deleted by \*(UA
4583 at any time,
4584 so you should not use the directory to store other information.
4586 Once the cache contains some messages,
4587 it is not strictly necessary anymore to open a connection to the IMAP
4588 server to access them.
4589 When \*(UA is invoked with the option
4590 .Fl D ,
4591 or when the
4592 .Va disconnected
4593 variable is set,
4594 only cached data is used for any folder you open.
4595 Messages that have not yet been completely cached are not available
4596 then, but all other messages can be handled as usual.
4597 Changes made to IMAP mailboxes in
4598 .Va disconnected
4599 mode are committed to the IMAP server next time it is being connected to.
4600 Synchronizing the local status with the status on the server is thus
4601 partially within your responsibility;
4602 if you forget to initiate a connection to the server again before you
4603 leave your location,
4604 changes made on one workstation are not available on others.
4605 Also if you alter IMAP mailboxes from a workstation while uncommitted
4606 changes are still pending on another,
4607 the latter data may become invalid.
4608 The same might also happen because of internal server status changes.
4609 You should thus carefully evaluate this feature in your environment
4610 before you rely on it.
4612 Many servers will close the connection after a short period of
4613 inactivity \(en use one of
4615 .Dl set pop3-keepalive=30
4616 .Dl set imap-keepalive=240
4618 to send a keepalive message each 30 seconds for POP3,
4619 or each 4 minutes for IMAP.
4621 If you encounter problems connecting to a SSL/TLS server,
4622 try the
4623 .Va ssl-rand-egd
4625 .Va ssl-rand-file
4626 variables (see the OpenSSL FAQ for more information) or specify the
4627 protocol version with
4628 .Va ssl-method .
4629 Contact your ISP if you need a client certificate or if verification of
4630 the server certificate fails.
4631 If the failed certificate is indeed valid,
4632 fetch its CA certificate by executing the shell command
4634 .Dl $ </dev/null openssl s_client \-showcerts \-connect \e
4635 .Dl \ \ \ \ \ \ server.myisp.example:imaps 2>&1 | tee log.txt
4637 (see
4638 .Xr s_client 1 Ns
4639 ) and put it into the file specified with
4640 .Va ssl-ca-file .
4641 The data you need is located at the end of the certificate chain
4642 within (and including) the `BEGIN CERTIFICATE'
4643 and `END CERTIFICATE' lines.
4644 Note that the example above is \fBinsecure\fR!
4645 One should use the `-verify' and `-CAfile' options of
4646 .Xr s_client 1
4647 to be "on the safe side" regarding the fetched certificates.
4648 .\" }}}
4650 .\" .Ss "Reading HTML mail" {{{
4651 .Ss "Reading HTML mail"
4652 You need either the
4653 .Xr elinks 1
4655 .Xr lynx 1
4656 utility or another command-line web browser that can write plain text to
4657 standard output.
4659 .Dl set pipe-text/html="elinks -force-html -dump 1"
4660 .Dl set pipe-text/html="lynx -stdin -dump -force_html"
4662 will cause HTML message parts to be converted into a more friendly form.
4663 .\" }}}
4665 .\" .Ss "Viewing PDF attachments" {{{
4666 .Ss "Viewing PDF attachments"
4667 Most PDF viewers do not accept input directly from a pipe.
4668 It is thus necessary to store the attachment in a temporary file first:
4670 .Dl set pipe-application/pdf="@&cat >/tmp/\*(ua$$.pdf; \e
4671 .Dl \ \ \ \ \ \ acroread /tmp/\*(ua$$.pdf; rm /tmp/\*(ua$$.pdf"
4673 Note that security defects are discovered in PDF viewers from time to
4674 time.
4675 Automatical command execution like this can compromise your system
4676 security,
4677 in particular if you stay not always informed about such issues.
4678 .\" }}}
4680 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
4681 .Ss "Signed and encrypted messages with S/MIME"
4682 \*(OP S/MIME provides two central mechanisms:
4683 message signing and message encryption.
4684 A signed message contains some data in addition to the regular text.
4685 The data can be used to verify that the message was sent using a valid
4686 certificate, that the sender's address in the message header matches
4687 that in the certificate, and that the message text has not been altered.
4688 Signing a message does not change its regular text;
4689 it can be read regardless of whether the recipient's software is able to
4690 handle S/MIME.
4691 It is thus usually possible to sign all outgoing messages if so desired.
4692 Encryption, in contrast, makes the message text invisible for all people
4693 except those who have access to the secret decryption key.
4694 To encrypt a message, the specific recipient's public encryption key
4695 must be known.
4696 It is thus not possible to send encrypted mail to people unless their
4697 key has been retrieved from either previous communication or public key
4698 directories.
4699 A message should always be signed before it is encrypted.
4700 Otherwise, it is still possible that the encrypted message text is
4701 altered.
4703 A central concept to S/MIME is that of the certification authority (CA).
4704 A CA is a trusted institution that issues certificates.
4705 For each of these certificates it can be verified that it really
4706 originates from the CA, provided that the CA's own certificate is
4707 previously known.
4708 A set of CA certificates is usually delivered with OpenSSL and installed
4709 on your system.
4710 If you trust the source of your OpenSSL software installation,
4711 this offers reasonable security for S/MIME on the Internet.
4712 In general, a certificate cannot be more secure than the method its CA
4713 certificate has been retrieved with, though.
4714 Thus if you download a CA certificate from the Internet,
4715 you can only trust the messages you verify using that certificate as
4716 much as you trust the download process.
4718 The first thing you need for participating in S/MIME message exchange is
4719 your personal certificate, including a private key.
4720 The certificate contains public information, in particular your name and
4721 your email address, and the public key that is used by others to encrypt
4722 messages for you,
4723 and to verify signed messages they supposedly received from you.
4724 The certificate is included in each signed message you send.
4725 The private key must be kept secret.
4726 It is used to decrypt messages that were previously encrypted with your
4727 public key, and to sign messages.
4729 For personal use it is recommended that you get a S/MIME certificate
4730 from one of the major CAs on the Internet using your WWW browser.
4731 (Many CAs offer such certificates for free.)
4732 You will usually receive a combined certificate and private key in
4733 PKCS#12 format which \*(UA does not directly accept.
4734 To convert it to PEM format, use the following shell command:
4736 .Dl $ openssl pkcs12 \-in cert.p12 \-out cert.pem \-clcerts \-nodes
4738 If you omit the `\-nodes' parameter, you can specifiy an additional `PEM
4739 pass phrase' for protecting the private key.
4740 \*(UA will then ask you for that pass phrase each time it signs or
4741 decrypts a message.
4742 You can then use
4744 .Dl set smime-sign-cert-myname@myisp.example=cert.pem
4746 to make this private key and certificate known to \*(UA.
4747 You can now sign outgoing messages.
4748 Just use
4750 .Dl set smime-sign
4752 to do so.
4753 From each signed message you send,
4754 the recipient can fetch your certificate and use it to send encrypted
4755 mail back to you.
4756 Accordingly if somebody sends you a signed message, you can do the same.
4757 First use the
4758 .Ic verify
4759 command to check the validity of the certificate.
4760 After that, retrieve the certificate and tell \*(UA that it should use
4761 it for encryption:
4763 .Dl certsave filename
4764 .Dl set smime-encrypt-USER@HOST=filename
4766 You should carefully consider if you prefer to store encrypted messages
4767 in decrypted form.
4768 If you do, anybody who has access to your mail folders can read them,
4769 but if you do not, you might be unable to read them yourself later if
4770 you happen to lose your private key.
4772 .Ic decrypt
4773 command saves messages in decrypted form, while the
4774 .Ic save ,
4775 .Ic copy ,
4777 .Ic move
4778 commands leave them encrypted.
4780 Note that neither S/MIME signing nor encryption applies to message
4781 subjects or other header fields.
4782 Thus they may not contain sensitive information for encrypted messages,
4783 and cannot be trusted even if the message content has been verified.
4784 When sending signed messages,
4785 it is recommended to repeat any important header information in the
4786 message text.
4787 .\" }}}
4789 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
4790 .Ss "Using CRLs with S/MIME or SSL/TLS"
4791 \*(OP Certification authorities (CAs) issue certificate revocation
4792 lists (CRLs) on a regular basis.
4793 These lists contain the serial numbers of certificates that have been
4794 declared invalid after they have been issued.
4795 Such usually happens because the private key for the certificate has
4796 been compromised,
4797 because the owner of the certificate has left the organization that is
4798 mentioned in the certificate, etc.
4799 To seriously use S/MIME or SSL/TLS verification,
4800 an up-to-date CRL is required for each trusted CA.
4801 There is otherwise no method to distinguish between valid and
4802 invalidated certificates.
4803 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
4804 the Internet, so you have to retrieve them by some external mechanism.
4806 \*(UA accepts CRLs in PEM format only;
4807 CRLs in DER format must be converted, like, e.\|g.:
4809 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
4811 To tell \*(UA about the CRLs, a directory that contains all CRL files
4812 (and no other files) must be created.
4814 .Va smime-crl-dir
4816 .Va ssl-crl-dir
4817 variables, respectively, must then be set to point to that directory.
4818 After that, \*(UA requires a CRL to be present for each CA that is used
4819 to verify a certificate.
4820 .\" }}}
4822 .\" .Ss "Handling spam" {{{
4823 .Ss "Handling spam"
4824 \*(OP \*(UA can make use of spam detection and learning facilities \(en
4825 more precisely, SpamAssassin (\%<http://spamassassin.apache.org>).
4826 A very comprehensive documentation of
4827 .Xr spamassassin 1
4828 can be found at the O'Reilly Commons
4829 (\%<http://commons.oreilly.com/wiki/index.php/SpamAssassin>).
4831 Currently \*(UA supports interaction with
4832 .Xr spamassassin 1
4833 only via its daemonized
4834 .Xr spamd 1 /
4835 .Xr spamc 1
4836 server / client pair, which means that, in order to detect and work
4837 with spam through \*(UA, an instance of the
4838 .Xr spamd 1
4839 daemon must be running (the examples are equivalent):
4840 .Bd -literal -offset indent
4841 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
4842 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \\
4843     --daemonize [--local] [--allow-tell]
4846 Note that if
4847 .Xr spamd 1
4848 should only listen on a local, path-based UNIX domain socket instead of
4849 offering its service over the network, it maybe necessary to use
4850 a single
4851 .Li --socketpath
4852 option instead of the shown
4853 .Li --listen .
4854 In order to support training of the Bayesian classifier through \*(UA,
4855 .Xr spamd 1
4856 must have been started with the
4857 .Li --allow-tell
4858 option.
4860 Once
4861 .Xr spamd 1
4862 is running \*(UA can classify messages by using the client side program,
4863 .Xr spamc 1 ,
4864 as in:
4865 .Bd -literal -offset indent
4866 $ \*(ua -Sspam-command=/usr/local/bin/spamc \\
4867     -Sspam-socket=/tmp/.spamsock -Sspam-maxsize=500000
4870 The commands offered are
4871 .Ic spamclear
4873 .Ic spamset ,
4874 which simply set an `is-spam' flag that can be used for, e.g., message
4875 selection,
4876 .Ic spamrate ,
4877 which passes messages through to the spam detector in order to gain
4878 a spam score and conditionally set the `is-spam' flag accordingly,
4879 as well as the Bayesian filter related
4880 .Ic spamforget ,
4881 .Ic spamham
4883 .Ic spamspam .
4885 Because messages must exist on local storage in order to be scored (or
4886 used for Bayesian filter training), it is possibly a good idea to
4887 perform the local spam check last:
4888 .Bd -literal -offset indent
4889 define spamdelhook {
4890         # Server side DCC
4891         spamset (header x-dcc-brand-metrics "bulk")
4892         # Server-side spamassassin(1)
4893         spamset (header x-spam-flag "YES")
4894         del :s # TODO we HAVE to be able to do `spamrate :u ! :s'
4895         # And finally the local spamc(1)
4896         spamrate :u
4897         del :s
4899 set folder-hook-FOLDER=spamdelhook
4902 See also the documentation for the variables
4903 .Va spam-command ,
4904 .Va spam-host ,
4905 .Va spam-port ,
4906 .Va spam-socket ,
4907 .Va spam-user
4909 .Va spam-maxsize .
4910 .\" }}}
4912 .\" .Ss "Sending mail from scripts" {{{
4913 .Ss "Sending mail from scripts"
4914 If you want to send mail from scripts, you must be aware that \*(UA
4915 reads the user's configuration files by default.
4916 So unless your script is only intended for your own personal use
4917 (as, e.g., a cron job), you need to circumvent this:
4919 .Dl MAILRC=/dev/null LC_ALL=en_US.UTF-8 \*(ua \-n
4921 You then need to create a script-local configuration for \*(UA.
4922 This can be done by either pointing the
4923 .Va MAILRC
4924 variable to a custom configuration file,
4925 by passing the configuration in environment variables,
4926 or by using the
4927 .Fl S
4928 command line option to specify options.
4929 Since many configuration options are not valid shell variables, the
4930 .Xr env 1
4931 command is useful if the approach via environment variables is used:
4932 .Bd -literal -offset indent
4933 env MAILRC=/dev/null LC_ALL=C password=secret \*(ua -n -Sv15-compat \e
4934     -S 'smtp=smtps://mylogin@some.host:465' -Ssmtp-auth=login \e
4935     -S 'from=scriptreply@domain' \e
4936     -s 'subject' -a attachment_file recipient@domain < content_file
4938 .\" }}}
4939 .\" }}} (Examples)
4941 .\" .Sh "SEE ALSO" {{{
4942 .Sh "SEE ALSO"
4943 .Xr bzip2 1 ,
4944 .Xr file 1 ,
4945 .Xr fmt 1 ,
4946 .Xr gzip 1 ,
4947 .Xr less 1 ,
4948 .Xr more 1 ,
4949 .Xr newaliases 1 ,
4950 .Xr openssl 1 ,
4951 .Xr printf 1 ,
4952 .Xr sendmail 1 ,
4953 .Xr sh 1,
4954 .Xr spamassassin 1 ,
4955 .Xr spamc 1 ,
4956 .Xr spamd 1 ,
4957 .Xr vacation 1 ,
4958 .Xr xz 1 ,
4959 .Xr editline 3 ,
4960 .Xr iconv 3 ,
4961 .Xr readline 3 ,
4962 .Xr setlocale 3 ,
4963 .Xr ssl 3 ,
4964 .Xr aliases 5 ,
4965 .Xr locale 7 ,
4966 .Xr mailaddr 7 ,
4967 .Xr re_format 7 ,
4968 .Xr mailwrapper 8 ,
4969 .Xr xterm 1
4970 .\" }}}
4972 .\" .Sh "IMPLEMENTATION NOTES" {{{
4973 .Sh "IMPLEMENTATION NOTES"
4974 The character set conversion uses and relies upon the
4975 .Xr iconv 3
4976 function.
4977 Its functionality differs widely between the various system environments
4978 \*(UA runs on.
4980 Limitations with IMAP mailboxes are:
4981 It is not possible to edit messages, but it is possible to append them.
4982 Thus to edit a message, create a local copy of it, edit it, append it,
4983 and delete the original.
4984 The line count for the header display is only appropriate if the entire
4985 message has been downloaded from the server.
4986 The marking of messages as `new' is performed by the IMAP server;
4987 use of the
4988 .Ic exit
4989 command instead of
4990 .Ic quit
4991 will not cause it to be reset, and if the
4992 .Va newmail
4993 variable is unset, messages that arrived during a session will not be
4994 in state `new' anymore when the folder is opened again.
4995 Also if commands queued in disconnected mode are committed,
4996 the IMAP server will delete the `new' flag for all messages in the
4997 changed folder,
4998 and new messages will appear as unread when it is selected for viewing
4999 later.
5000 The `flagged', `answered', and `draft' attributes are usually permanent,
5001 but some IMAP servers are known to drop them without notification.
5002 Message numbers may change with IMAP every time before the prompt is
5003 printed if \*(UA is notified by the server that messages have been
5004 deleted by some other client or process.
5005 In this case, `Expunged n messages' is printed, and message numbers may
5006 have changed.
5008 Limitations with POP3 mailboxes are:
5009 It is not possible to edit messages, they can only be copied and deleted.
5010 The line count for the header display is only appropriate if the entire
5011 message has been downloaded from the server.
5012 The status field of a message is maintained by the server between
5013 connections; some servers do not update it at all, and with a server
5014 that does, the `exit' command will not cause the message status to be
5015 reset.
5016 The `newmail' command and the `newmail' variable have no effect.
5017 It is not possible to rename or to remove POP3 mailboxes.
5019 If a `RUBOUT' (interrupt, `control-C') is typed while an IMAP or POP3
5020 operation is in progress, \*(UA will wait until the operation can be
5021 safely aborted,
5022 and will then return to the command loop and print the prompt again.
5023 When a second `RUBOUT' is typed while \*(UA is waiting for the operation
5024 to complete, the operation itself will be cancelled.
5025 In this case, data that has not been fetched yet will have to be fetched
5026 before the next command can be performed.
5027 If the cancelled operation was using an SSL/TLS encrypted channel,
5028 an error in the SSL transport will very likely result and render the
5029 connection unusable.
5031 As \*(UA is a mail user agent, it provides only basic SMTP services.
5032 If it fails to contact its upstream SMTP server, it will not make
5033 further attempts to transfer the message at a later time,
5034 and it does not leave other information about this condition than an
5035 error message on the terminal and an entry in
5036 .Va DEAD .
5037 This is usually not a problem if the SMTP server is located in the same
5038 local network as the computer on which \*(UA is run.
5039 However, care should be taken when using a remote server of an ISP;
5040 it might be better to set up a local SMTP server then which just acts as
5041 a proxy.
5043 \*(UA immediately contacts the SMTP server (or
5044 .Xr sendmail 1 Ns
5045 ) even when operating in
5046 .Va disconnected
5047 mode.
5048 It would not make much sense for \*(UA to defer outgoing mail since SMTP
5049 servers usually provide much more elaborated delay handling than \*(UA
5050 could perform as a client.
5051 Thus the recommended setup for sending mail in
5052 .Va disconnected
5053 mode is to configure a local SMTP server such that it sends outgoing
5054 mail as soon as an external network connection is available again,
5055 i.e., to advise it to do that from a network startup script.
5056 .\" }}}
5058 .\" .Sh HISTORY {{{
5059 .Sh HISTORY
5060 A \fImail\fR command appeared in Version 1 AT&T Unix.
5061 Berkeley Mail was written in 1978 by Kurt Shoens.
5062 This man page is derived from from The Mail Reference Manual originally
5063 written by Kurt Shoens.
5064 "Heirloom Mailx" enhancements are maintained and documented by Gunnar
5065 Ritter.
5066 "S-nail" is maintained and documented by Steffen (Daode) Nurpmeso.
5068 Portions of this text are reprinted and reproduced in electronic form
5069 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
5070 \(en Operating System Interface (POSIX), The Open Group Base
5071 Specifications Issue 6, Copyright \(co 2001-2003 by the Institute of
5072 Electrical and Electronics Engineers, Inc and The Open Group.
5073 In the event of any discrepancy between this version and the original
5074 IEEE and The Open Group Standard, the original IEEE and The Open Group
5075 Standard is the referee document.
5076 The original Standard can be obtained online at
5077 \%<http://www.opengroup.org/unix/online.html>.
5078 Redistribution of this material is permitted so long as this notice
5079 remains intact.
5080 .\" }}}
5082 .Sh AUTHORS
5083 .An "Kurt Shoens" ,
5084 .An "Christos Zoulas" ,
5085 .An "Gunnar Ritter" ,
5086 .An Steffen Po Daode Pc Nurpmeso Aq s-nail-users@lists.sourceforge.net
5088 .Sh BUGS
5089 Too many (see the file `TODO' from the distribution or the repository).