nail.1: short review of the terminal/MLE section
[s-mailx.git] / nail.1
blob1a0cda796293eb43a36ba96c388189289a840db3
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2016 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
5 .\"
6 .\" Copyright (c) 1980, 1990, 1993
7 .\"      The Regents of the University of California.  All rights reserved.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\"--MKREL-START--
34 .\" S-nail(1): v14.9.0-pre1 / 2016-09-15
35 .Dd Sep 15, 2016
36 .ds VV \\%v14.9.0-pre1
37 .\"--MKREL-END--
38 .\"--MKMAN-START--
39 .ds UU \\%S-NAIL
40 .ds UA \\%S-nail
41 .ds uA \\%s-nail
42 .ds UR \\%s-nail.rc
43 .\"--MKMAN-END--
44 .\" --BEGINSTRIP--
45 .\"
46 .\" If not ~/.mailrc, it breaks POSIX compatibility.  And adjust main.c.
47 .ds ur \\%~/.mailrc
48 .ds OB [Obsolete]
49 .ds OP [Option]
50 .ds IN [v15-compat]
51 .ds OU [no v15-compat]
52 .ds ID [v15 behaviour may differ]
53 .ds NQ [Only new quoting rules]
54 .ds BO (Boolean)
55 .ds RO (Read-only)
57 .Dt "\*(UU" 1
58 .Os
59 .Mx -enable
62 .Sh NAME
63 .Nm \*(UA \%[\*(VV]
64 .Nd send and receive Internet mail
67 .\" .Sh SYNOPSIS {{{
68 .Sh SYNOPSIS
70 .\" Keep in SYNC: ./nail.1:"SYNOPSIS, main()
71 .Nm \*(uA
72 .Fl h | Fl Fl help
73 .Nm \*(uA
74 .Bk -words
75 .Op Fl BdEFintv~
76 .Op Fl \&: Ar spec
77 .Op Fl A Ar account
78 .Op Fl a Ar attachment
79 .Op Fl b Ar bcc-addr
80 .Op Fl c Ar cc-addr
81 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
82 .Op Fl r Ar from-addr
83 .Op Fl S Ar var Ns Op Ns = Ns Ar value
84 .Op Fl s Ar subject
85 .Op Fl X Ar cmd
86 .Op Fl \&.
87 .Ar to-addr ...
88 .Op Fl Fl \~ Ns Ar mta-option ...
89 .Ek
90 .Nm \*(uA
91 .Bk -words
92 .Op Fl BdEeHiNnRv~
93 .Op Fl \&: Ar spec
94 .Op Fl A Ar account
95 .Op Fl L Ar spec-list
96 .Op Fl r Ar from-addr
97 .Op Fl S Ar var Ns Op Ns = Ns Ar value
98 .Op Fl u Ar user
99 .Op Fl X Ar cmd
100 .Op Fl Fl \~ Ns Ar mta-option ...
102 .Nm \*(uA
103 .Bk -words
104 .Op Fl BdEeHiNnRv~#
105 .Op Fl \&: Ar spec
106 .Op Fl A Ar account
107 .Fl f
108 .Op Fl L Ar spec-list
109 .Op Fl r Ar from-addr
110 .Op Fl S Ar var Ns Op Ns = Ns Ar value
111 .Op Fl X Ar cmd
112 .Op Ar file
113 .Op Fl Fl \~ Ns Ar mta-option ...
115 .\" }}}
118 .Mx -toc -tree html pdf ps xhtml
121 .\" .Sh DESCRIPTION {{{
122 .Sh DESCRIPTION
124 .Bd -filled -compact -offset indent
125 .Sy Compatibility note:
126 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2018).
127 Backward incompatibility has to be expected \(en
128 .Sx COMMANDS
129 will use
130 .Xr \&\&sh 1 Ns
131 -style argument quoting rules, for example.
132 New and old behaviour is flagged \*(IN and \*(OU, and setting
133 .Va v15-compat ,
134 one of the many
135 .Sx "INTERNAL VARIABLES" ,
136 will choose new behaviour when applicable.
137 \*(OB flags what will vanish, and enabling
138 .Fl d
140 .Fl v
141 enables obsoletion warnings.
145 \*(UA is a mail processing system with a command syntax reminiscent of
146 .Xr ed 1
147 with lines replaced by messages.
148 It is intended to provide the functionality of the POSIX
149 .Xr mailx 1
150 command, but is MIME capable and optionally offers extensions for
151 line editing, S/MIME, SMTP and POP3 among others.
152 It is usable as a mail batch language.
154 .\" .Ss "Options" {{{
155 .Ss "Options"
157 .Bl -tag -width ".Fl _ Ar _ddr"
159 .It Fl \&: Ar spec
160 Explicitly control which of the
161 .Sx "Resource files"
162 shall be loaded: if the letter
163 .Ql s
164 is (case-insensitively) part of the
165 .Ar spec
166 then the system wide
167 .Pa \*(UR
168 is loaded, likewise the letter
169 .Ql u
170 controls loading of the user's personal
171 .Pa \*(ur
172 file, whereas the letters
173 .Ql -
175 .Ql /
176 explicitly forbid loading of any resource files.
177 This option should be used by scripts: to avoid environmental noise they
178 should
179 .Dq detach
180 from any configuration files and create a script-local environment,
181 explicitly setting any of the desired
182 .Sx "INTERNAL VARIABLES"
184 .Fl S .
185 This option overrides
186 .Fl n .
189 .It Fl A Ar account
190 Executes an
191 .Ic account
192 command for the given user email
193 .Ar account
194 after program startup is complete.
195 Being a special incarnation of
196 .Ic define Ns d
197 macros for the purpose of bundling longer-lived settings, activating
198 such an email account also switches to the accounts system
199 .Va inbox ,
200 for example.
203 .It Fl a Ar file
204 Attach the given file to the message.
205 The same filename conventions as described in the section
206 .Sx COMMANDS
207 apply: shell word expansion is restricted to the tilde
208 .Ql ~ .
209 Shall
210 .Ar file
211 not be accessible but contain a
212 .Ql =
213 character, then anything after the
214 .Ql =
215 is assumed to specify the input character set and anything before
216 .Ql =
217 the filename: this is the only option to specify the input character set
218 (and don't perform any character set conversion) for text attachments
219 from the command line, not using the
220 .Ic ~@
221 tilde escape command.
224 .It Fl B
225 Make standard input and standard output line-buffered.
228 .It Fl b Ar addr
229 Send a blind carbon copy to
230 .Ar addr Ns
231 ess.
232 May be used multiple times.
233 Also see the section
234 .Sx "On sending mail, and non-interactive mode" .
237 .It Fl c Ar addr
238 Send carbon copies to the given receiver.
239 May be used multiple times.
242 .It Fl d
243 .Ic set
244 the internal variable
245 .Va debug
246 which enables debug messages and disables message delivery,
247 among others; effectively turns almost any operation into a dry-run.
250 .It Fl E
251 .Ic set
252 .Va skipemptybody
253 and thus discard messages with an empty message part body.
254 This is useful for sending messages from scripts.
257 .It Fl e
258 Just check if mail is present (in the specified or system
259 .Va inbox ) :
260 if yes, return an exit status of zero, a non-zero value otherwise.
261 To restrict the set of mails to consider in this evaluation a message
262 specification can be added with the option
263 .Fl L .
266 .It Fl F
267 Save the message to send in a file named after the local part of the
268 first recipient's address (instead of in
269 .Va record Ns ).
272 .It Fl f
273 Read in the contents of the user's
274 .Ev MBOX
275 (or the specified file) for processing;
276 when \*(UA is quit, it writes undeleted messages back to this file
277 (but be aware of the
278 .Va hold
279 option).
280 Some special conventions are recognized for the optional
281 .Ar file
282 argument which are documented for the
283 .Ic file
284 command below.
285 Note that
286 .Ar file
287 is not a argument to the flag
288 .Fl \&\&f ,
289 but is instead taken from the command line after option processing has
290 been completed.
291 In order to use a
292 .Ar file
293 that starts with a hyphen, prefix it with a (relative) path, as in
294 .Ql ./-hyphenbox.mbox .
297 .It Fl H
298 Display a summary of the
299 .Ic headers
300 of all messages in the specified mailbox or system
301 .Va inbox
302 and exit.
303 A configurable summary view is available via the
304 .Fl L
305 option.
308 .It Fl h
309 Show a short usage summary.
310 Because of widespread use a
311 .Fl Fl help
312 argument will have the same effect.
315 .It Fl i
316 .Ic set
317 .Va ignore
318 to ignore tty interrupt signals.
321 .It Fl L Ar spec-list
322 Display a summary of all
323 .Ic headers
324 of only those messages in the specified mailbox or the system
325 .Va inbox
326 that match the given
327 .Ar spec-list ,
328 then exit.
329 See the section
330 .Sx "Specifying messages"
331 for the format of
332 .Ar spec-list .
333 If the
334 .Fl e
335 (\*(OB or
336 .Fl H )
337 option has been given in addition no header summary is produced,
338 but \*(UA will instead indicate via its exit status whether
339 .Ar spec-list
340 matched any messages
341 .Pf ( Ql 0 )
342 or not
343 .Pf ( Ql 1 ) ;
344 note that any verbose output is suppressed in this mode and must instead
345 be enabled explicitly (e.g., by using the option
346 .Fl v ) .
349 .It Fl M Ar type
350 Special send mode that will flag standard input with the MIME
351 .Ql Content-Type:
352 set to the given
353 .Ar type
354 and use it as the main message body.
355 \*(ID Using this option will bypass processing of
356 .Va message-inject-head ,
357 .Va signature
359 .Va message-inject-tail .
360 Also see
361 .Fl q , m , t .
364 .It Fl m Ar file
365 Special send mode that will MIME classify the specified
366 .Ar file
367 and use it as the main message body.
368 \*(ID Using this option will bypass processing of
369 .Va message-inject-head ,
370 .Va signature
372 .Va message-inject-tail .
373 Also see
374 .Fl q , M , t .
377 .It Fl N
378 .Pf Un Ic set
379 .Va header
380 and thus inhibit initial display of message headers when reading mail or
381 editing a mail folder.
384 .It Fl n
385 Standard flag that inhibits reading the system wide
386 .Pa \*(UR
387 upon startup.
388 The option
389 .Fl \&:
390 allows more control over the startup sequence; also see
391 .Sx "Resource files" .
394 .It Fl q Ar file
395 Special send mode that will initialize the message body with the
396 contents of the specified
397 .Ar file ,
398 which may be standard input
399 .Ql -
400 only in non-interactive context.
401 Also see
402 .Fl M , m , t .
405 .It Fl R
406 Any folder opened will be in read-only mode.
409 .It Fl r Ar from-addr
411 .Ar from-addr
412 is a valid address then it specifies the envelope sender address to be
413 passed to a file-based
414 .Va mta
415 (Mail-Transfer-Agent) as
416 .Ql -f Ar address
417 when a message is send.
418 Shall
419 .Ar from-addr
420 include a user name, then the address components will be separated and
421 the name part will be passed to file-based
422 .Va mta
423 individually via
424 .Ql -F Ar name .
425 The given
426 .Ar from-addr
427 will also be assigned to the
428 .Va from
429 variable (as via
430 .Ql -Sfrom=from-addr ) ,
431 therefore affecting possible SMTP
432 .Va mta
433 data transfer; note this assignment does not cause value fixation.
435 If instead an empty string is passed as
436 .Ar from-addr
437 then the content of the variable
438 .Va from
439 will be evaluated and used for this purpose whenever the
440 .Va mta
441 is contacted.
442 Note that \*(UA by default, without
443 .Fl \&\&r
444 that is, neither passes
445 .Fl \&\&f
447 .Fl \&\&F
448 flags to a file-based MTA by itself.
451 .It Fl S Ar var Ns Op = Ns value
452 .Ic set
453 the internal
454 .Ar var Ns
455 iable and, in case of a non-boolean variable which has a value, assign
456 .Ar value
457 to it.
458 Even though
459 .Sx "INTERNAL VARIABLES"
460 .Ic \&\&set
462 .Fl S
463 may be overwritten from within resource files,
464 the command line setting will be reestablished after all resource files
465 have been loaded.
468 .It Fl s Ar subject
469 Specify the subject of the to-be-sent message.
472 .It Fl t
473 The message given (on standard input) is expected to contain, separated
474 from the message body by an empty line, a message header with
475 .Ql To: ,
476 .Ql Cc: ,
478 .Ql Bcc:
479 fields giving its recipients, which will be added to any recipients
480 specified on the command line.
481 If a message subject is specified via
482 .Ql Subject:
483 then it'll be used in favour of one given on the command line.
485 Also understood are
486 .Ql Reply-To:
487 (possibly overriding
488 .Va replyto ) ,
489 .Ql Sender:
490 .Pf ( Va sender ) ,
491 .Ql From:
492 .Pf ( Va from
493 and / or option
494 .Fl r ) .
495 .Ql Message-ID: ,
496 .Ql In-Reply-To: ,
497 .Ql References:
499 .Ql Mail-Followup-To: ,
500 by default created automatically dependent on message context, will
501 be used if specified (a special address massage will however still occur
502 for the latter).
503 Any other (even custom) header field is passed through entirely
504 unchanged, and in conjunction with the option
505 .Fl ~
506 it is even possible to embed
507 .Sx TILDE ESCAPES .
508 Also see
509 .Fl M , m , q .
512 .It Fl u Ar user
513 Initially read the primary system mailbox of
514 .Ar user ,
515 appropriate privileges presumed; effectively identical to
516 .Ql -f %user .
519 .It Fl V
520 Show \*(UA's
521 .Va version
522 and exit.
523 The command
524 .Ic version
525 will also show the list of
526 .Va features :
527 .Ql $ \*(uA -Xversion -Xx .
530 .It Fl v
531 .Ic set Ns
532 ting the internal variable
533 .Va verbose
534 enables display of some informational context messages.
535 Using it twice increases the level of verbosity.
538 .It Fl X Ar cmd
539 Add the given (or multiple for a multiline argument)
540 .Ar cmd
541 to the list of commands to be executed (as a unit, just as via
542 .Ic source )
543 before normal operation starts.
544 Correlates with
545 .Fl #
547 .Va batch-exit-on-error ;
548 the only possibility to execute commands in non-interactive mode when
549 reading startup files is actively prohibited.
552 .It Fl ~
553 Enable
554 .Sx TILDE ESCAPES
555 even if not in interactive mode.
556 This can be used to, e.g., automatically format the composed message
557 text before sending the message:
558 .Bd -literal -offset indent
559 $ ( echo 'line    one. Word.     Word2.'; \e
560     echo '~| /usr/bin/fmt -tuw66' ) |\e
561   LC_ALL=C \*(uA -:/ -Sttycharset=UTF-8 -d~ bob@exam.ple
565 .It Fl #
566 Enables batch mode.
567 In batch mode the full set of commands is available, just like in
568 interactive mode, and diverse variable settings and internal states are
569 adjusted for batch necessities, e.g., it
570 .Ic set Ns
572 .Va emptystart ,
573 .Pf no Va header ,
574 .Va quiet ,
575 .Va sendwait ,
576 .Va typescript-mode
577 as well as
578 .Ev MAIL ,
579 .Ev MBOX
581 .Va inbox
582 (the latter three to
583 .Pa /dev/null ) ;
584 processing of
585 .Sx "TILDE ESCAPES"
586 is enabled in compose mode.
587 The following prepares an email message in a batched dry run:
588 .Bd -literal -offset indent
589 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' | \e
590   LC_ALL=C \*(uA -:/ -d# -X'alias bob bob@exam.ple'
594 .It Fl \&.
595 This flag forces termination of option processing in order to prevent
596 .Dq option injection
597 (attacks).
598 It also forcefully puts \*(UA into send mode, see
599 .Sx "On sending mail, and non-interactive mode" .
603 In the above list of supported command line options,
604 .Fl d , E , i , N
606 .Fl v
607 are implemented by means of
608 .Ic set Ns
609 ting the respective option, as via
610 .Fl S .
611 .Bk -words
612 .Op Ar mta-option ...
614 arguments that are given at the end of the command line after a
615 .Ql --
616 separator will be passed through to a file-based
617 .Va mta
618 (Mail-Transfer-Agent) and persist for an entire (interactive) session
619 \(en if the setting of
620 .Va expandargv
621 allows their recognition; no such constraints apply to the variable
622 .Va mta-arguments .
623 .\" }}}
625 .\" .Ss "A starter" {{{
626 .Ss "A starter"
628 \*(UA is a direct descendant of
630 Mail, a successor of the Research
632 mail which
633 .Dq was there from the start
634 according to
635 .Sx HISTORY .
638 Mail reference manual begins with the following words:
640 .Bd -ragged -offset indent
641 Mail provides a simple and friendly environment for sending and
642 receiving mail.
643 It divides incoming mail into its constituent messages and allows the
644 user to deal with them in any order.
645 In addition, it provides a set of
646 .Xr ed 1 Ns
647 -like commands for manipulating messages and sending mail.
648 Mail offers the user simple editing capabilities to ease the composition
649 of outgoing messages, as well as providing the ability to define and
650 send to names which address groups of users.
654 \*(UA is thus the user side of the
656 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
657 traditionally taken by
658 .Xr sendmail 8 ,
659 and most MTAs provide a binary of this name for compatibility purposes.
660 If the \*(OPal SMTP
661 .Va mta
662 is included in the
663 .Va features
664 of \*(UA then the system side is not a mandatory precondition for mail
665 delivery.
668 Because \*(UA strives for compliance with POSIX
669 .Xr mailx 1
670 it is likely that some configuration settings have to be adjusted before
671 using it is a smooth experience.
672 The default global
673 .Pa \*(UR
674 resource file bends those standard imposed settings of the
675 .Sx "INTERNAL VARIABLES"
676 a bit towards more user friendliness and safety, however, e.g., it
677 .Ic set Ns s
678 .Va hold
680 .Va keepsave
681 in order to suppress the automatic moving of messages to
682 .Ev MBOX
683 that would otherwise occur (see
684 .Sx "Message states" )
686 .Va keep
687 to not remove empty files in order not to mangle file permissions when
688 files eventually get recreated (\*(UA actively manages the file mode
689 creation mask via
690 .Va umask
691 upon program startup).
692 It also enables
693 .Va sendwait
694 in order to synchronize \*(UA with the exit status report of the used
695 .Va mta
696 when sending mails.
697 The section
698 .Sx EXAMPLES
699 contains some more complete configuration examples.
700 .\" }}}
702 .\" .Ss "On sending mail, and non-interactive mode" {{{
703 .Ss "On sending mail, and non-interactive mode"
705 To send a message to one or more people, using a local or a builtin
706 .Va mta
707 (Mail-Transfer-Agent) transport to actually deliver the generated mail
708 message, \*(UA can be invoked with arguments which are the names of
709 people to whom the mail will be sent, and the command line options
710 .Fl b
712 .Fl c
713 can be used to add (blind) carbon copy receivers:
715 .Bd -literal -offset indent
716 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
717 # But... try it in an isolated dry-run mode first
718 $ LC_ALL=C \*(uA -:/ -d -vv -Ssendwait \e
719    -b bcc@exam.ple -c cc@exam.ple -. \e
720    '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
721 # With SMTP
722 $ LC_ALL=C \*(uA -:/ -d -vv -Sv15-compat -Ssendwait \e
723     -S 'mta=smtps://mylogin@exam.ple:465' -Ssmtp-auth=login \e
724     -S 'from=scriptreply@exam.ple' \e
725     -a /etc/mail.rc \e
726     -. eric@exam.ple
730 If standard input is a terminal rather than the message to be sent,
731 the user is expected to type in the message contents.
732 In this compose mode \*(UA treats lines beginning with the character
733 .Ql ~
734 special \(en these are so-called
735 .Sx "TILDE ESCAPES"
736 which can be used to read in files, process shell commands, add and edit
737 attachments and more; e.g., the tilde escape
738 .Ql Ic ~e
739 will start the text editor to revise the message in it's current state,
740 .Ql Ic ~h
741 allows editing of the most important message headers and
742 .Ql Ic ~?
743 gives an overview of available tilde escapes.
744 Typing
745 .Ql control-D
746 .Pf ( Ql ^D )
747 at the beginning of an empty line leaves compose mode and causes the
748 message to be sent, whereas typing
749 .Ql control-C
750 .Pf ( Ql ^C )
751 twice will abort the current letter (saving its contents in the file
752 denoted by
753 .Ev DEAD
754 unless
755 .Pf no Va save
756 is set).
757 Messages are sent asynchronously, without supervision, unless the variable
758 .Va sendwait
759 is set, therefore send errors are not recognizable until then.
762 A number of
763 .Sx ENVIRONMENT
765 .Sx "INTERNAL VARIABLES"
766 can be used to alter default behavior; e.g.,
767 .Ic set Ns
768 ting (also via
769 .Fl S )
770 .Va editalong
771 will automatically startup a text editor when compose mode is entered,
772 .Va askcc
773 will cause the user to be prompted actively for carbon-copy recipients
774 and the
775 .Va dot
776 option will allow leaving compose mode by writing a line consisting
777 solely of a dot
778 .Pf ( Ql \&. ) .
779 .Va on-compose-enter
781 .Va on-compose-leave
782 hook macros may be set to automatically adjust some settings dependent
783 on receiver, sender or subject contexts.
786 Especially for using public mail provider accounts with the SMTP
787 .Va mta
788 it is often necessary to set
789 .Va from ,
790 and saving a copy of sent messages in a
791 .Va record
792 may be desirable \(en as for most mailbox file targets some special
793 syntax conventions are recognized (see the
794 .Ic file
795 command for more on that).
796 Defining user email
797 .Ic account Ns s
798 for the purpose of arranging a complete environment of settings that can
799 be switched to with a single command or command line option may be
800 useful (the section
801 .Sx EXAMPLES
802 contains example configurations for sending messages via some of the
803 well-known public mail providers and also gives a compact overview on
804 how to setup a secure SSL/TLS environment).
805 Performing some
806 .Fl d
808 .Va debug
809 sandbox dry-run tests first will prove correctness.
812 The section
813 .Sx "On URL syntax and credential lookup"
814 will spread light on the different ways of how to specify user email
815 account credentials, the
816 .Ql USER@HOST
817 variable chains, and accessing protocol-specific resources,
818 the section
819 .Sx "Character sets"
820 goes into the details of character encoding and how to use them for
821 representing messages and MIME part contents by specifying them in
822 .Va sendcharsets ,
823 and reading the section
824 .Sx "The mime.types files"
825 should help to understand how the MIME-type of outgoing attachments are
826 classified, and what can be done for fine-tuning.
829 Message recipients (as specified on the command line or defined in
830 .Ql To: ,
831 .Ql Cc:
833 .Ql Bcc: )
834 may not only be email addressees but can also be names of mailboxes and
835 even complete shell command pipe specifications.
836 If the variable
837 .Va expandaddr
838 is not set then only network addresses (see
839 .Xr mailaddr 7
840 for a description of mail addresses) and plain user names (including MTA
841 aliases) may be used, other types will be filtered out, giving a warning
842 message.
844 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
845 .\" grep the latter for the complete picture
847 If the variable
848 .Va expandaddr
849 is set then extended recipient addresses will optionally be accepted:
850 Any name which starts with a vertical bar
851 .Ql |
852 character specifies a command pipe \(en the command string following the
853 .Ql |
854 is executed and the message is sent to its standard input;
855 Likewise, any name that starts with the character solidus
856 .Ql /
857 or the character sequence dot solidus
858 .Ql ./
859 is treated as a file, regardless of the remaining content.
860 Any other name which contains an at sign
861 .Ql @
862 character is treated as a network address;
863 Any other name which starts with a plus sign
864 .Ql +
865 character specifies a mailbox name;
866 Any other name which contains a solidus
867 .Ql /
868 character but no exclamation mark
869 .Ql \&!
870 or percent sign
871 .Ql %
872 character before also specifies a mailbox name;
873 What remains is treated as a network address.
875 .Bd -literal -offset indent
876 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
877 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
878 $ echo safe | LC_ALL=C \e
879     \*(uA -:/ -Sv15-compat -Ssendwait -Snosave \e
880       -Sexpandaddr=fail,-all,+addr -s test \e
881       -. bob@exam.ple
885 It is possible to create personal distribution lists via the
886 .Ic alias
887 command, so that, for instance, the user can send mail to
888 .Ql cohorts
889 and have it go to a group of people.
890 These aliases have nothing in common with the system wide aliases that
891 may be used by the MTA, which are subject to the
892 .Ql name
893 constraint of
894 .Va expandaddr
895 and are often tracked in a file
896 .Pa /etc/aliases
897 (and documented in
898 .Xr aliases 5
900 .Xr sendmail 1 ) .
901 Personal aliases will be expanded by \*(UA before the message is sent,
902 and are thus a convenient alternative to specifying each addressee by
903 itself:
906 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
909 To avoid environmental noise scripts should
910 .Dq detach
911 \*(UA from any configuration files and create a script-local
912 environment, ideally with the command line options
913 .Fl \&:
914 to disable any configuration file in conjunction with repetitions of
915 .Fl S
916 to specify variables:
918 .Bd -literal -offset indent
919 $ env LC_ALL=C \*(uA -:/ \e
920     -Sv15-compat -Ssendwait -Snosave -Sttycharset=utf-8 \e
921     -Sexpandaddr=fail,-all,+addr \e
922     -S 'mta=smtps://mylogin@exam.ple:465' -Ssmtp-auth=login \e
923     -S 'from=scriptreply@exam.ple' \e
924     -s 'subject' -a attachment_file \e
925     -. "Recipient 1 <rec1@exam.ple>" rec2@exam.ple \e
926     < content_file
930 As shown, scripts can
931 .Dq fake
932 a locale environment, the above specifies the all-compatible 7-bit clean
933 .Ev LC_ALL
934 .Dq C ,
935 but will nonetheless take and send UTF-8 in the message text by using
936 .Va ttycharset .
937 In interactive mode, which is introduced in the next section, messages
938 can be sent by calling the
939 .Ic mail
940 command with a list of recipient addresses \(em the semantics are
941 completely identical to non-interactive message sending:
943 .Bd -literal -offset indent
944 $ \*(uA -d -Squiet -Semptystart
945 "/var/spool/mail/user": 0 messages
946 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
947 ? # Will do the right thing (tm)
948 ? m rec1@exam.ple rec2@exam.ple
950 .\" }}}
952 .\" .Ss "On reading mail, and interactive mode" {{{
953 .Ss "On reading mail, and interactive mode"
955 When invoked without addressees \*(UA enters interactive mode in which
956 mails may be read.
957 When used like that the user's system
958 .Va inbox
959 (see the command
960 .Ic file
961 for an in-depth description of the different mailbox types that exist)
962 is read in and a one line header of each message therein is displayed.
963 The visual style of this summary of
964 .Ic headers
965 can be adjusted through the variable
966 .Va headline
967 and the possible sorting criterion via
968 .Va autosort .
969 Scrolling through
970 .Va screen Ns
971 fuls of
972 .Ic headers
973 can be performed with the command
974 .Ic z .
975 If the initially opened mailbox is empty \*(UA will instead exit
976 immediately (after displaying a message) unless the variable
977 .Va emptystart
978 is set.
981 At the
982 .Va prompt
983 the command
984 .Ic list
985 will give a listing of all available commands and
986 .Ic help
987 will give a summary of some common ones.
988 If the \*(OPal documentation strings are available one can type
989 .Ql help X
990 .Pf "(or " Ql ?X )
991 and see the actual expansion of
992 .Ql X
993 and what it's purpose is, i.e., commands can be abbreviated
994 (note that POSIX defines some abbreviations, so that the alphabetical
995 order of commands doesn't necessarily relate to the abbreviations; it is
996 possible to define overwrites with the
997 .Ic ghost
998 command, however).
999 These commands can also produce a more
1000 .Va verbose
1001 output.
1004 Messages are given numbers (starting at 1) which uniquely identify
1005 messages; the current message \(en the
1006 .Dq dot
1007 \(en will either be the first new message, or the first unread message,
1008 or the first message of the mailbox; the option
1009 .Va showlast
1010 will instead cause usage of the last message for this purpose.
1011 The command
1012 .Ic headers
1013 will display a
1014 .Va screen Ns
1015 ful of header summaries containing the
1016 .Dq dot ,
1017 whereas
1018 .Ic from
1019 will display only the summaries of the given messages, defaulting to the
1020 .Dq dot .
1023 Message content can be displayed on the users' terminal with the
1024 .Ic type
1025 command (shortcut
1026 .Ql t ) .
1027 If instead the command
1028 .Ic top
1029 is used, only the first
1030 .Va toplines
1031 of a message will be shown.
1032 By default the current message
1033 .Pf ( Dq dot )
1034 is displayed, but like with many other commands it is possible to give
1035 a fancy message specification (see
1036 .Sx "Specifying messages" ) ,
1037 e.g.,
1038 .Ql t:u
1039 will display all unread messages,
1040 .Ql t.
1041 will display the
1042 .Dq dot ,
1043 .Ql t 1 5
1044 will type the messages 1 and 5,
1045 .Ql t 1-5
1046 will type the messages 1 through 5, and
1047 .Ql t-
1049 .Ql t+
1050 will display the last and the next message, respectively.
1051 The command
1052 .Ic search
1053 (a more substantial alias of the standard command
1054 .Ic from )
1055 will display a header summary of the given message specification list
1056 instead of their content, e.g., the following will search for subjects:
1059 .Dl from "'@Some subject to search for'"
1062 In the default setup all header fields of a message will be
1063 .Ic type Ns
1064 d, but this can be changed: either by blacklisting a list of fields via
1065 .Ic ignore ,
1066 or by whitelisting only a given list with the
1067 .Ic retain
1068 command, e.g.,
1069 .Ql Ic \:retain Ns \0from_ date from to cc subject .
1070 In order to display all header fields of a message regardless of
1071 currently active ignore or retain lists, use the commands
1072 .Ic Type
1074 .Ic Top .
1075 The variable
1076 .Va crt
1077 controls whether and when \*(UA will use the configured
1078 .Ev PAGER
1079 for display instead of directly writing to the user terminal
1080 .Va screen
1081 (generally speaking).
1082 Note that historically the global
1083 .Pa \*(UR
1084 not only adjusts the list of displayed headers, but also sets
1085 .Va crt .
1088 Dependent upon the configuration a line editor (see the section
1089 .Sx "On terminal control and line editor" )
1090 aims at making user experience with the many
1091 .Sx COMMANDS
1092 a bit nicer.
1093 When reading the system
1094 .Va inbox
1095 or when
1096 .Fl f
1098 .Ic file )
1099 specified a mailbox explicitly prefixed with the special
1100 .Ql %:
1101 modifier (propagating the mailbox to a primary one) then messages which
1102 have been read will be moved to a secondary mailbox, the user's
1103 .Ev MBOX
1104 file, automatically when the mailbox is left, either by changing the
1105 active mailbox or by quitting \*(UA (also see
1106 .Sx "Message states" )
1107 \(en this automatic moving from a system or primary to the secondary
1108 mailbox is not performed when the variable
1109 .Va hold
1110 is set.
1113 After examining a message the user can also
1114 .Ic delete Ql d
1115 the message,
1116 .Ic reply Ql r
1117 to the sender and all recipients or
1118 .Ic Reply Ql R
1119 exclusively to the sender(s).
1120 Messages can also be
1121 .Ic forward Ns
1122 ed (shorter alias is
1123 .Ic fwd Ns ).
1124 Note that when replying to or forwarding a message recipient addresses
1125 will be stripped from comments and names unless the option
1126 .Va fullnames
1127 is set.
1128 Deletion causes \*(UA to forget about the message;
1129 This is not irreversible, though, one can
1130 .Ic undelete Ql u
1131 the message by giving its number,
1132 or the \*(UA session can be ended by giving the
1133 .Ic exit Ql x
1134 command.
1137 To end a mail processing session one may either issue
1138 .Ic quit Ql q
1139 to cause a full program exit, which possibly includes
1140 automatic moving of read messages to
1141 .Ev MBOX
1142 as well as updating the \*(OPal line editor
1143 .Va history-file ,
1144 or use the command
1145 .Ic exit Ql x
1146 instead in order to prevent any of these actions.
1147 .\" }}}
1149 .\" .Ss "HTML mail and MIME attachments" {{{
1150 .Ss "HTML mail and MIME attachments"
1152 Messages which are HTML-only get more and more common and of course many
1153 messages come bundled with a bouquet of MIME attachments.
1154 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter to deal
1155 with HTML messages (see
1156 .Sx "The mime.types files" ) ,
1157 it normally can't deal with any of these itself, but instead programs
1158 need to become registered to deal with specific MIME types or file
1159 extensions.
1160 These programs may either prepare plain text versions of their input
1161 in order to enable \*(UA to display the content on the terminal,
1162 or display the content themselves, for example in a graphical window.
1165 To install an external handler program for a specific MIME type set an
1166 according
1167 .Va pipe-TYPE/SUBTYPE
1168 variable; to instead define a handler for a specific file extension set
1169 the respective
1170 .Va pipe-EXTENSION
1171 variable \(en these handlers take precedence.
1172 \*(OPally \*(UA supports mail user agent configuration as defined in
1173 RFC 1524; this mechanism, documented in the section
1174 .Sx "The Mailcap files" ,
1175 will be queried for display or quote handlers if none of the former two
1176 .\" TODO v15-compat "will be" -> "is"
1177 did; it will be the sole source for handlers of other purpose.
1178 A last source for handlers may be the MIME type definition itself, if
1179 the \*(UA specific type-marker extension was used when defining the type
1180 with the command
1181 .Ic mimetype .
1182 (Many of the builtin MIME types do so by default.)
1185 The variable
1186 .Va mime-counter-evidence
1187 can be set to improve dealing with faulty MIME part declarations as are
1188 often seen in real-life messages.
1189 E.g., to display a HTML message inline (that is, converted to a more
1190 fancy plain text representation than the builtin converter is capable to
1191 produce) with either of the text-mode browsers
1192 .Xr lynx 1
1194 .Xr elinks 1 ,
1195 teach \*(UA about MathML documents and make it display them as plain
1196 text, and to open PDF attachments in an external PDF viewer,
1197 asynchronously and with some other magic attached:
1199 .Bd -literal -offset indent
1200 if $features !@ +filter-html-tagsoup
1201   #set pipe-text/html='elinks -force-html -dump 1'
1202   set pipe-text/html='lynx -stdin -dump -force_html'
1203   # Display HTML as plain text instead
1204   #set pipe-text/html=@
1205 endif
1206 mimetype '@ application/mathml+xml mathml'
1207 wysh set pipe-application/pdf='@&=@ \e
1208   trap "rm -f \e"${NAIL_FILENAME_TEMPORARY}\e"" EXIT;\e
1209   trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1210   mupdf "${NAIL_FILENAME_TEMPORARY}"'
1214 Note: special care must be taken when using such commands as mail
1215 viruses may be distributed by this method: if messages of type
1216 .Ql application/x-sh
1217 or files with the extension
1218 .Ql .sh
1219 were blindly filtered through the shell, for example, a message sender
1220 could easily execute arbitrary code on the system \*(UA is running on.
1221 For more on MIME, also in respect to sending of messages, see the
1222 sections
1223 .Sx "The mime.types files" ,
1224 .Sx "The Mailcap files"
1225 and the command
1226 .Ic mimetype .
1227 .\" }}}
1229 .\" .Ss "Mailing lists" {{{
1230 .Ss "Mailing lists"
1232 \*(UA offers some support to ease handling of mailing lists.
1233 The command
1234 .Ic mlist
1235 promotes all given arguments to known mailing lists, and
1236 .Ic mlsubscribe
1237 sets their subscription attribute, creating them first as necessary.
1238 (On the other hand
1239 .Ic unmlsubscribe
1240 doesn't
1241 .Ic unmlist
1242 automatically, but only resets the subscription attribute.)
1243 Using the commands without arguments will show (a subset of) all
1244 currently defined mailing lists.
1246 .Va headline
1247 format
1248 .Ql \&%T
1249 can be used to mark out messages with configured list addresses
1250 in the header display.
1253 \*(OPally mailing lists may also be specified as (extended) regular
1254 expressions, which allows matching of many addresses with a single
1255 expression.
1256 However, all fully qualified list addresses are matched via a fast
1257 dictionary, whereas expressions are placed in (a) list(s) which is
1258 (are) matched sequentially.
1260 .Bd -literal -offset indent
1261 set followup-to followup-to-honour=ask-yes reply-to-honour=ask-yes
1262 wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1263 mlsubscribe a4@b4.c4 exact@lists.c3
1267 The variable
1268 .Va followup-to-honour
1269 will ensure that a
1270 .Ql Mail-\:Followup-\:To:
1271 header is honoured when the message is being replied to (via
1272 .Ic reply
1274 .Ic Lreply )
1276 .Va followup-to
1277 controls whether this header is created when sending mails; it will be
1278 created automatically for a couple of reasons, too, like when the
1279 special
1280 .Dq mailing list specific
1281 respond command
1282 .Ic Lreply
1283 is used, when
1284 .Ic reply
1285 is used to respond to a message with its
1286 .Ql Mail-Followup-To:
1287 being honoured etc.
1290 A difference in between the handling of known and subscribed lists is
1291 that the address of the sender is usually not part of a generated
1292 .Ql Mail-Followup-To:
1293 when addressing the latter, whereas it is for the former kind of lists.
1294 Usually because there are exceptions: say, if multiple lists are
1295 addressed and not all of them are subscribed lists.
1297 For convenience \*(UA will, temporarily, automatically add a list
1298 address that is presented in the
1299 .Ql List-To:
1300 header of a message that is being responded to to the list of known
1301 mailing lists.
1302 Shall that header have existed \*(UA will instead, dependent on the
1303 variable
1304 .Va reply-to-honour ,
1305 use an also set
1306 .Ql Reply-To:
1307 for this purpose in order to accept a list administrators' wish that
1308 is supposed to have been manifested like that (but only if it provides
1309 a single address which resides on the same domain as what is stated in
1310 .Ql List-To: ) .
1311 .\" }}}
1313 .\" .Ss "Resource files" {{{
1314 .Ss "Resource files"
1316 Upon startup \*(UA reads in several resource files:
1318 .Bl -tag -width ".It Pa _AIL_EXTRA_R_"
1320 .It Pa \*(UR
1321 System wide initialization file.
1322 Reading of this file can be suppressed, either by using the
1323 .Fl \&:
1325 .Fl n
1326 command line options, or by setting the
1327 .Sx ENVIRONMENT
1328 variable
1329 .Ev NAIL_NO_SYSTEM_RC .
1332 .It Pa \*(ur
1333 File giving initial commands.
1334 A different file can be chosen by setting the
1335 .Sx ENVIRONMENT
1336 variable
1337 .Ev MAILRC .
1338 Reading of this file can be suppressed with the
1339 .Fl \&:
1340 command line option.
1342 .It Va NAIL_EXTRA_RC
1343 Can be used to define an optional startup file to be read after all
1344 other resource files.
1345 It can be used to specify settings that are not understood by other
1346 .Xr mailx 1
1347 implementations, for example.
1348 This variable is only honoured when defined in a resource file, e.g.,
1349 it is one of the
1350 .Sx "INTERNAL VARIABLES" .
1354 The content of these files is interpreted as follows:
1357 .Bl -bullet -compact
1359 A lines' leading whitespace is removed.
1361 Empty lines are ignored.
1363 Any other line is interpreted as a command.
1364 It may be spread over multiple input lines if the newline character is
1365 .Dq escaped
1366 by placing a reverse solidus character
1367 .Ql \e
1368 as the last character of the line; whereas any leading whitespace of
1369 follow lines is ignored, trailing whitespace before a escaped newline
1370 remains in the input.
1372 If the line (content) starts with the number sign
1373 .Ql #
1374 then it is a comment-command \(en a real command! \(en and also ignored.
1375 This command is the only form of comment that is understood.
1379 Unless \*(UA is about to enter interactive mode syntax errors that occur
1380 while loading these files are treated as errors and cause program exit.
1381 More files with syntactically equal content can be
1382 .Ic source Ns ed .
1383 The following, saved in a file, would be an examplary content:
1385 .Bd -literal -offset indent
1386  # This line is a comment command.  And y\e
1387     es, it is really continued here.
1388 set debug \e
1389     verbose
1390     set editheaders
1392 .\" }}}
1394 .\" .Ss "Character sets" {{{
1395 .Ss "Character sets"
1397 \*(OP \*(UA detects the character set of the terminal by using
1398 mechanisms that are controlled by the
1399 .Ev LC_CTYPE
1400 locale setting
1401 (the manual for
1402 .Xr setlocale 3
1403 should give an overview); the \*(UA internal variable
1404 .Va ttycharset
1405 will be set to the detected terminal character set accordingly
1406 and will thus show up in the output of the commands
1407 .Ic set
1409 .Ic varshow .
1412 However, a user supplied
1413 .Va ttycharset
1414 value is not overwritten by this detection mechanism: this
1415 .Dq feature
1416 must be used if the detection doesn't work properly,
1417 and it may be used to adjust the name of the locale character set.
1418 E.g., on BSD systems one may use a locale with the character set
1419 ISO8859-1, which is not a valid name for this character set; to be on
1420 the safe side, one may set
1421 .Va ttycharset
1422 to the correct name, which is ISO-8859-1.
1425 Note that changing the value doesn't mean much beside that,
1426 since several aspects of the real character set are implied by the
1427 locale environment of the system,
1428 and that stays unaffected by the content of an overwritten
1429 .Va ttycharset
1430 variable.
1431 (This is mostly an issue when interactively using \*(UA, though.
1432 It is actually possible to send mail in a completely
1433 .Dq faked
1434 locale environment, an option that \*(UA's test-suite uses excessively.)
1437 If no character set conversion capabilities have been compiled into
1438 \*(UA
1439 .Pf ( Va features
1440 doesn't include the term
1441 .Ql +iconv ) ,
1442 then
1443 .Va ttycharset
1444 will be the only supported character set,
1445 it is simply assumed that it can be used to exchange 8-bit messages,
1446 and the rest of this section does not apply;
1447 it may however still be necessary to explicitly set it if automatic
1448 detection fails, since in that case it defaults to the mentioned
1449 .\" (Keep in SYNC: ./nail.1:"Character sets", ./nail.h:CHARSET_*!)
1450 ISO-8859-1.
1453 When reading messages, their text is converted into
1454 .Va ttycharset
1455 as necessary in order to display them on the users terminal.
1456 Unprintable characters and invalid byte sequences are detected
1457 and replaced by proper substitution characters (unless the variable
1458 .Va print-all-chars
1459 was set once \*(UA was started).
1460 Also see
1461 .Va charset-unknown-8bit
1462 to deal with another hairy aspect of message interpretation.
1465 When sending messages all their parts and attachments are classified.
1466 Whereas no character set conversion is performed on those parts which
1467 appear to be binary data,
1468 the character set being used must be declared within the MIME header of
1469 an outgoing text part if it contains characters that do not conform to
1470 the set of characters that are allowed by the email standards.
1471 Permissible values for character sets can be declared using the
1472 .Va sendcharsets
1473 variable, and
1474 .Va charset-8bit ,
1475 which defines a catch-all last-resort fallback character set that is
1476 implicitly appended to the list of character-sets in
1477 .Va sendcharsets .
1480 When replying to a message and the variable
1481 .Va reply-in-same-charset
1482 is set then the character set of the message being replied to is tried
1483 first.
1484 And it is also possible to make \*(UA work even more closely related to
1485 the current locale setting automatically by using the variable
1486 .Va sendcharsets-else-ttycharset ,
1487 please see there for more information.
1490 All the specified character sets are tried in order unless the
1491 conversion of the part or attachment succeeds.
1492 If none of the tried (8-bit) character sets is capable to represent the
1493 content of the part or attachment,
1494 then the message will not be sent and its text will optionally be
1495 .Va save Ns d
1497 .Ev DEAD .
1498 In general, if the message
1499 .Dq Cannot convert from a to b
1500 appears, either some characters are not appropriate for the currently
1501 selected (terminal) character set,
1502 or the needed conversion is not supported by the system.
1503 In the first case, it is necessary to set an appropriate
1504 .Ev LC_CTYPE
1505 locale and/or the variable
1506 .Va ttycharset .
1509 The best results are usually achieved when \*(UA is run in a UTF-8
1510 locale on a UTF-8 capable terminal, in which case the full Unicode
1511 spectrum of characters is available.
1512 In this setup characters from various countries can be displayed,
1513 while it is still possible to use more simple character sets for sending
1514 to retain maximum compatibility with older mail clients.
1517 On the other hand the POSIX standard defines a locale-independent 7-bit
1518 .Dq portable character set
1519 that should be used when overall portability is an issue, the even more
1520 restricted subset named
1521 .Dq portable filename character set
1522 consisting of A-Z, a-z, 0-9, period
1523 .Ql \&. ,
1524 underscore
1525 .Ql _
1527 .Ql -
1528 hyphen.
1529 .\" }}}
1531 .\" .Ss "Message states" {{{
1532 .Ss "Message states"
1534 \*(UA differentiates in between several different message states;
1535 the current state will be reflected in header summary displays if
1536 .Va headline
1537 is configured to do so (via the internal variable
1538 .Va attrlist ) ,
1539 and messages can also be selected and be acted upon depending on their
1540 state (see
1541 .Sx "Specifying messages" ) .
1542 When operating on the system
1543 .Va inbox
1544 or in primary mailboxes opened with the special prefix
1545 .Ql %:
1546 (see
1547 .Ic file )
1548 special actions, like the automatic moving of messages to the secondary
1549 .Ev MBOX
1550 mailbox may be applied when the mailbox is left (also implicitly via
1551 a successful exit of \*(UA, but not if the special command
1552 .Ic exit
1553 is used) \(en however, because this may be irritating to users which
1554 are used to
1555 .Dq more modern
1556 mail-user-agents, the default global
1557 .Pa \*(UR
1558 sets the internal
1559 .Va hold
1561 .Va keepsave
1562 variables in order to suppress this behaviour.
1564 .Bl -tag -width ".It Ql _reserved"
1565 .It Ql new
1566 Message has neither been viewed nor moved to any other state.
1567 Such messages are retained even in the primary system mailbox.
1569 .It Ql unread
1570 Message has neither been viewed nor moved to any other state, but the
1571 message was present already when the mailbox has been opened last:
1572 Such messages are retained even in the primary system mailbox.
1574 .It Ql read
1575 The message has been processed by one of the following commands:
1576 .Ic ~f ,
1577 .Ic ~m ,
1578 .Ic ~F ,
1579 .Ic ~M ,
1580 .Ic copy ,
1581 .Ic mbox ,
1582 .Ic next ,
1583 .Ic pipe  ,
1584 .Ic Print ,
1585 .Ic print ,
1586 .Ic top ,
1587 .Ic Type ,
1588 .Ic type ,
1589 .Ic undelete .
1591 .Ic delete ,
1592 .Ic dp ,
1594 .Ic dt
1595 commands may also cause the next message to be marked as read, depending
1596 on the value of the
1597 .Va autoprint
1598 variable.
1599 Except when the
1600 .Ic exit
1601 command is used, messages that are in the primary system mailbox or in
1602 mailboxes which were opened with the special
1603 .Ql %:
1604 prefix and are in
1605 .Ql read
1606 state when the mailbox is left will be saved in
1607 .Ev MBOX
1608 unless the option
1609 .Va hold
1610 it set.
1612 .It Ql deleted
1613 The message has been processed by one of the following commands:
1614 .Ic delete ,
1615 .Ic dp ,
1616 .Ic dt .
1617 Only
1618 .Ic undelete
1619 can be used to access such messages.
1621 .It Ql preserved
1622 The message has been processed by a
1623 .Ic preserve
1624 command and it will be retained in its current location.
1626 .It Ql saved
1627 The message has been processed by one of the following commands:
1628 .Ic save
1630 .Ic write .
1631 Unless when the
1632 .Ic exit
1633 command is used, messages that are in the primary system mailbox or in
1634 mailboxes which were opened with the special
1635 .Ql %:
1636 prefix and are in
1637 .Ql saved
1638 state when the mailbox is left will be deleted; they will be saved in
1639 .Ev MBOX
1640 when the option
1641 .Va keepsave
1642 is set.
1644 .\" }}}
1646 .\" .Ss "Specifying messages" {{{
1647 .Ss "Specifying messages"
1649 Commands such as
1650 .Ic from ,
1651 .Ic type
1653 .Ic delete
1654 can be given a list of message numbers as arguments to apply to a number
1655 of messages at once.
1656 Thus
1657 .Ql delete 1 2
1658 deletes messages 1 and 2,
1659 whereas
1660 .Ql delete 1-5
1661 will delete the messages 1 through 5.
1662 In sorted or threaded mode (see the
1663 .Ic sort
1664 command),
1665 .Ql delete 1-5
1666 will delete the messages that are located between (and including)
1667 messages 1 through 5 in the sorted/threaded order, as shown in the
1668 .Ic headers
1669 summary.
1670 The following special message names exist:
1673 .Bl -tag -width ".It Ar _n_u"
1674 .It Ar \&.
1675 The current message, the so-called
1676 .Dq dot .
1678 .It Ar \&;
1679 The message that was previously the current message.
1681 .It Ar \&,
1682 The parent message of the current message,
1683 that is the message with the Message-ID given in the
1684 .Ql In-Reply-To:
1685 field or the last entry of the
1686 .Ql References:
1687 field of the current message.
1689 .It Ar -
1690 The next previous undeleted message,
1691 or the next previous deleted message for the
1692 .Ic undelete
1693 command.
1694 In sorted/threaded mode,
1695 the next previous such message in the sorted/threaded order.
1697 .It Ar +
1698 The next undeleted message,
1699 or the next deleted message for the
1700 .Ic undelete
1701 command.
1702 In sorted/threaded mode,
1703 the next such message in the sorted/threaded order.
1705 .It Ar ^
1706 The first undeleted message,
1707 or the first deleted message for the
1708 .Ic undelete
1709 command.
1710 In sorted/threaded mode,
1711 the first such message in the sorted/threaded order.
1713 .It Ar $
1714 The last message.
1715 In sorted/threaded mode,
1716 the last message in the sorted/threaded order.
1718 .It Ar & Ns Ar x
1719 In threaded mode,
1720 selects the message addressed with
1721 .Ar x ,
1722 where
1723 .Ar x
1724 is any other message specification,
1725 and all messages from the thread that begins at it.
1726 Otherwise it is identical to
1727 .Ar x .
1729 .Ar x
1730 is omitted,
1731 the thread beginning with the current message is selected.
1733 .It Ar *
1734 All messages.
1735 .It Ar `
1736 All messages that were included in the message list for the previous
1737 command.
1739 .It Ar x-y
1740 An inclusive range of message numbers.
1741 Selectors that may also be used as endpoints include any of
1742 .Ar .;-+^$ .
1744 .It Ar address
1745 A case-insensitive
1746 .Dq any substring matches
1747 search against the
1748 .Ql From:
1749 header, which will match addresses (too) even if
1750 .Va showname
1751 is set (and POSIX says
1752 .Dq any address as shown in a header summary shall be matchable in this form ) ;
1753 However, if the
1754 .Va allnet
1755 variable is set, only the local part of the address is evaluated
1756 for the comparison, not ignoring case, and the setting of
1757 .Va showname
1758 is completely ignored.
1759 For finer control and match boundaries use the
1760 .Ql @
1761 search expression.
1763 .It Ar / Ns Ar string
1764 All messages that contain
1765 .Ar string
1766 in the subject field (case ignored).
1767 See also the
1768 .Va searchheaders
1769 variable.
1771 .Ar string
1772 is empty,
1773 the string from the previous specification of that type is used again.
1775 .It Xo Op Ar @ Ns Ar name-list Ns
1776 .Ar @ Ns Ar expr
1778 All messages that contain the given case-insensitive search
1779 .Ar expr Ns
1780 ession; if the \*(OPal regular expression (see
1781 .Xr re_format 7 )
1782 support is available
1783 .Ar expr
1784 will be interpreted as (an extended) one if any of the
1785 .Dq magical
1786 (extended) regular expression characters is seen.
1787 If the optional
1788 .Ar @ Ns Ar name-list
1789 part is missing, the search is restricted to the subject field body,
1790 but otherwise
1791 .Ar name-list
1792 specifies a comma-separated list of header fields to search, as in
1794 .Dl '@to,from,cc@Someone i ought to know'
1796 In order to search for a string that includes a
1797 .Ql @
1798 (commercial at) character the
1799 .Ar name-list
1800 is effectively non-optional, but may be given as the empty string.
1801 Some special header fields may be abbreviated:
1802 .Ql f ,
1803 .Ql t ,
1804 .Ql c ,
1805 .Ql b
1807 .Ql s
1808 will match
1809 .Ql From ,
1810 .Ql To ,
1811 .Ql Cc ,
1812 .Ql Bcc
1814 .Ql Subject ,
1815 respectively and case-insensitively.
1816 The special names
1817 .Ql header
1819 .Ql <
1820 can be used to search in (all of) the header(s) of the message, and the
1821 special names
1822 .Ql body
1824 .Ql >
1826 .Ql text
1828 .Ql =
1829 can be used to perform full text searches \(en whereas the former
1830 searches only the body, the latter also searches the message header.
1832 This message specification performs full text comparison, but even with
1833 regular expression support it is almost impossible to write a search
1834 expression that savely matches only a specific address domain.
1835 To request that the content of the header is treated as a list of
1836 addresses, and to strip those down to the plain email address which the
1837 search expression is to be matched against, prefix the header name
1838 (abbreviation) with a tilde
1839 .Ql ~ :
1841 .Dl @~f@@a\e.safe\e.domain\e.match$
1843 .It Ar :c
1844 All messages of state
1845 .Ql c ,
1846 where
1847 .Ql c
1848 is one or multiple of the following colon modifiers:
1850 .Bl -tag -compact -width ".It Ar :M"
1851 .It Ar n
1852 .Ql new
1853 messages.
1854 .It Ar o
1855 Old messages (any not in state
1856 .Ql read
1858 .Ql new ) .
1859 .It Ar u
1860 .Ql unread
1861 messages.
1862 .It Ar d
1863 .Ql deleted
1864 messages (for the
1865 .Ic undelete
1867 .Ic from
1868 commands only).
1869 .It Ar r
1870 .Ql read
1871 messages.
1872 .It Ar f
1873 .Ic flag Ns
1874 ged messages.
1875 .It Ar a
1876 Answered messages
1877 (cf. the
1878 .Va markanswered
1879 variable).
1880 .It Ar t
1881 Messages marked as draft.
1882 .It Ar s
1883 \*(OP Messages classified as spam.
1884 .It Ar S
1885 \*(OP Messages with unsure spam classification.
1891 \*(OP IMAP-style SEARCH expressions may also be used.
1892 This addressing mode is available with all types of folders;
1893 \*(UA will perform the search locally as necessary.
1894 Strings must be enclosed by double quotes
1895 .Ql \&"
1896 in their entirety if they contain white space or parentheses;
1897 within the quotes, only reverse solidus
1898 .Ql \e
1899 is recognized as an escape character.
1900 All string searches are case-insensitive.
1901 When the description indicates that the
1902 .Dq envelope
1903 representation of an address field is used,
1904 this means that the search string is checked against both a list
1905 constructed as
1907 .Bd -literal -offset indent
1908 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
1912 for each address,
1913 and the addresses without real names from the respective header field.
1914 These search expressions can be nested using parentheses, see below for
1915 examples.
1918 .Bl -tag -compact -width ".It Ar _n_u"
1919 .It Ar ( criterion )
1920 All messages that satisfy the given
1921 .Ar criterion .
1922 .It Ar ( criterion1 criterion2 ... criterionN )
1923 All messages that satisfy all of the given criteria.
1925 .It Ar ( or criterion1 criterion2 )
1926 All messages that satisfy either
1927 .Ar criterion1
1929 .Ar criterion2 ,
1930 or both.
1931 To connect more than two criteria using
1932 .Ql or
1933 specifications have to be nested using additional parentheses,
1934 as with
1935 .Ql (or a (or b c)) ,
1936 since
1937 .Ql (or a b c)
1938 really means
1939 .Ql ((a or b) and c) .
1940 For a simple
1941 .Ql or
1942 operation of independent criteria on the lowest nesting level,
1943 it is possible to achieve similar effects by using three separate
1944 criteria, as with
1945 .Ql (a) (b) (c) .
1947 .It Ar ( not criterion )
1948 All messages that do not satisfy
1949 .Ar criterion .
1950 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
1951 All messages that contain
1952 .Ar string
1953 in the envelope representation of the
1954 .Ql Bcc:
1955 field.
1956 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
1957 All messages that contain
1958 .Ar string
1959 in the envelope representation of the
1960 .Ql Cc:
1961 field.
1962 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
1963 All messages that contain
1964 .Ar string
1965 in the envelope representation of the
1966 .Ql From:
1967 field.
1968 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
1969 All messages that contain
1970 .Ar string
1971 in the
1972 .Ql Subject:
1973 field.
1974 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
1975 All messages that contain
1976 .Ar string
1977 in the envelope representation of the
1978 .Ql To:
1979 field.
1980 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
1981 All messages that contain
1982 .Ar string
1983 in the specified
1984 .Ql Name:
1985 field.
1986 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
1987 All messages that contain
1988 .Ar string
1989 in their body.
1990 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
1991 All messages that contain
1992 .Ar string
1993 in their header or body.
1994 .It Ar ( larger size )
1995 All messages that are larger than
1996 .Ar size
1997 (in bytes).
1998 .It Ar ( smaller size )
1999 All messages that are smaller than
2000 .Ar size
2001 (in bytes).
2003 .It Ar ( before date )
2004 All messages that were received before
2005 .Ar date ,
2006 which must be in the form
2007 .Ql d[d]-mon-yyyy ,
2008 where
2009 .Ql d
2010 denotes the day of the month as one or two digits,
2011 .Ql mon
2012 is the name of the month \(en one of
2013 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2015 .Ql yyyy
2016 is the year as four digits, e.g.,
2017 .Ql 28-Dec-2012 .
2019 .It Ar ( on date )
2020 All messages that were received on the specified date.
2021 .It Ar ( since date )
2022 All messages that were received since the specified date.
2023 .It Ar ( sentbefore date )
2024 All messages that were sent on the specified date.
2025 .It Ar ( senton date )
2026 All messages that were sent on the specified date.
2027 .It Ar ( sentsince date )
2028 All messages that were sent since the specified date.
2029 .It Ar ()
2030 The same criterion as for the previous search.
2031 This specification cannot be used as part of another criterion.
2032 If the previous command line contained more than one independent
2033 criterion then the last of those criteria is used.
2035 .\" }}}
2037 .\" .Ss "On URL syntax and credential lookup" {{{
2038 .Ss "On URL syntax and credential lookup"
2040 \*(IN For accessing protocol-specific resources usage of Uniform
2041 Resource Locators (URL, RFC 1738) has become omnipresent.
2042 \*(UA expects and understands URLs in the following form;
2043 parts in brackets
2044 .Ql []
2045 denote optional parts, optional either because there also exist other
2046 ways to define the information in question or because support of the
2047 part is protocol-specific (e.g.,
2048 .Ql /path
2049 is used by the IMAP protocol but not by POP3);
2050 If any of
2051 .Ql USER
2053 .Ql PASSWORD
2054 are specified they must be given in URL percent encoded form (RFC 3986;
2055 the commands
2056 .Ic urlcodec
2057 may be helpful):
2060 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2063 Note that these \*(UA URLs most often don't conform to any real
2064 standard, but instead represent a normalized variant of RFC 1738 \(en
2065 they are not used in data exchange but only meant as a compact,
2066 easy-to-use way of defining and representing information in
2067 a well-known notation.
2070 Many internal variables of \*(UA exist in multiple versions, called
2071 variable chains for the rest of this document: the plain
2072 .Ql variable
2073 as well as
2074 .Ql variable-HOST
2076 .Ql variable-USER@HOST .
2077 Here
2078 .Ql HOST
2079 indeed means
2080 .Ql server:port
2081 if a
2082 .Ql port
2083 had been specified in the respective URL, otherwise it refers to the plain
2084 .Ql server .
2085 Also,
2086 .Ql USER
2087 isn't truly the
2088 .Ql USER
2089 that had been found when doing the user chain lookup as is described
2090 below, i.e., this
2091 .Ql USER
2092 will never be in URL percent encoded form, whether it came from an URL
2093 or not; i.e., values of
2094 .Sx "INTERNAL VARIABLES"
2095 must not be URL percent encoded.
2098 For example, whether an hypothetical URL
2099 .Ql smtp://hey%3Ayou@our.house
2100 had been given that includes a user, or whether the URL was
2101 .Ql smtp://our.house
2102 and the user had been found differently, to lookup the variable chain
2103 .Va smtp-use-starttls
2104 \*(UA first looks for whether
2105 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
2106 is defined, then whether
2107 .Ql smtp-\:use-\:starttls-\:our.house
2108 exists before finally ending up looking at the plain variable itself.
2111 \*(UA obeys the following logic scheme when dealing with the
2112 necessary credential information of an account:
2114 .Bl -bullet
2116 If no
2117 .Ql USER
2118 has been given in the URL the variables
2119 .Va user-HOST
2121 .Va user
2122 are looked up; if no such variable(s) can be found then \*(UA will,
2123 when enforced by the \*(OPal variables
2124 .Va netrc-lookup-HOST
2126 .Va netrc-lookup ,
2127 search the users
2128 .Pa .netrc
2129 file for a
2130 .Ql HOST
2131 specific entry which provides a
2132 .Ql login
2133 name: this lookup will only succeed if unambiguous (one possible matching
2134 entry for
2135 .Ql HOST ) .
2136 It is possible to load encrypted
2137 .Pa .netrc
2138 files via
2139 .Va netrc-pipe .
2141 If there is still no
2142 .Ql USER
2143 then \*(UA will fall back to the user who is supposed to run \*(UA,
2144 the identity of which has been fixated during \*(UA startup and is
2145 known to be a valid user on the current host.
2148 Authentication: unless otherwise noted this will lookup the
2149 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2150 variable chain, falling back to a protocol-specific default should this
2151 have no success.
2154 If no
2155 .Ql PASSWORD
2156 has been given in the URL, then if the
2157 .Ql USER
2158 has been found through the \*(OPal
2159 .Va netrc-lookup
2160 that may have already provided the password, too.
2161 Otherwise the variable chain
2162 .Va password-USER@HOST , password-HOST , password
2163 is looked up and used if existent.
2165 Afterwards the complete \*(OPal variable chain
2166 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2167 is looked up.
2168 If set, the
2169 .Pa .netrc
2170 cache is searched for a password only (multiple user accounts for
2171 a single machine may exist as well as a fallback entry without user
2172 but with a password).
2174 If at that point there is still no password available, but the
2175 (protocols') chosen authentication type requires a password, then in
2176 interactive mode the user will be prompted on the terminal.
2180 .Sy Note:
2181 S/MIME verification works relative to the values found in the
2182 .Ql From:
2184 .Ql Sender: )
2185 header field(s), which means that the values of
2186 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2188 .Va smime-sign-message-digest
2189 will not be looked up using the
2190 .Ql USER
2192 .Ql HOST
2193 chains from above but instead use the corresponding values from the
2194 message that is being worked on.
2195 In unusual cases multiple and different
2196 .Ql USER
2198 .Ql HOST
2199 combinations may therefore be involved \(en on the other hand those
2200 unusual cases become possible.
2201 The usual case is as short as:
2204 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2205 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
2208 The section
2209 .Sx EXAMPLES
2210 contains complete example configurations.
2211 .\" }}}
2213 .\" .Ss "On terminal control and line editor" {{{
2214 .Ss "On terminal control and line editor"
2216 \*(OP Terminal control will be realized through one of the standard
2218 libraries, either the
2219 .Lb libtermcap ,
2220 or, alternatively, the
2221 .Lb libterminfo ,
2222 both of which will be initialized to work with the environment variable
2223 .Ev TERM .
2224 Terminal control will enhance or enable interactive usage aspects, e.g.,
2225 .Sx "Coloured display" ,
2226 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2227 byte-sequences of keys like the cursor and function keys, and which will
2228 automatically enter the so-called
2229 .Dq ca-mode
2230 alternative screen shall the terminal support it.
2231 The internal variable
2232 .Va termcap
2233 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2234 Actual interaction with the chosen library can be disabled completely by
2235 setting the internal variable
2236 .Va termcap-disable ;
2237 .Va termcap
2238 will be queried regardless, even if the \*(OPal support for the
2239 libraries has not been enabled at configuration time.
2242 \*(OP The builtin \*(UA Mailx-Line-Editor (MLE) should work in all
2243 environments which comply to the ISO C standard
2244 .St -isoC-amd1 ,
2245 and will support wide glyphs if possible (the necessary functionality
2246 had been removed from ISO C, but was included in
2247 .St -xpg4 ) .
2248 Prevent usage of a line editor in interactive mode by setting the
2249 internal variable
2250 .Va line-editor-disable .
2251 Especially if the \*(OPal terminal control support is missing setting
2252 entries in the internal variable
2253 .Va termcap
2254 will help shall the MLE misbehave, see there for more.
2255 The MLE can support a little bit of
2256 .Ic colour .
2259 \*(OP If the
2260 .Ic history
2261 feature is available then input from line editor prompts will be saved
2262 in a history list that can be searched in and be expanded from.
2263 Such saving can be prevented by prefixing input with any amount of
2264 whitespace.
2265 Aspects of history, like allowed content and maximum size, as well as
2266 whether history shall be saved persistently, can be configured with the
2267 internal variables
2268 .Va history-file ,
2269 .Va history-gabby ,
2270 .Va history-gabby-persist
2272 .Va history-size .
2275 The MLE supports a set of editing and control commands.
2276 By default (as) many (as possible) of these will be assigned to a set of
2277 single-letter control codes, which should work on any terminal (and can
2278 be generated by holding the
2279 .Dq control
2280 key while pressing the key of desire, e.g.,
2281 .Ql control-D ) .
2282 If the \*(OPal
2283 .Ic bind
2284 command is available then the MLE commands can also be accessed freely
2285 by assigning the command name, which is shown in parenthesis in the list
2286 below, to any desired key-sequence, and the MLE will instead and also use
2287 .Ic bind
2288 to establish its builtin key bindings
2289 (more of them if the \*(OPal terminal control is available),
2290 an action which can then be suppressed completely by setting
2291 .Va line-editor-no-defaults .
2292 The following uses the
2293 .Xr sh 1 Ns
2294 ell-style quote notation that is documented in the introduction of
2295 .Sx COMMANDS ;
2296 combinations not mentioned either cause job control signals or don't
2297 generate a (unique) keycode:
2301 .Bl -tag -compact -width "Ql _M"
2302 .It Ql \ecA
2303 Go to the start of the line
2304 .Pf ( Cd mle-go-home ) .
2306 .It Ql \ecB
2307 Move the cursor backward one character
2308 .Pf ( Cd mle-go-bwd ) .
2310 .It Ql \ecD
2311 Forward delete the character under the cursor;
2312 quits \*(UA if used on the empty line unless the
2313 .Va ignoreeof
2314 option is set
2315 .Pf ( Cd mle-del-fwd ) .
2317 .It Ql \ecE
2318 Go to the end of the line
2319 .Pf ( Cd mle-go-end ) .
2321 .It Ql \ecF
2322 Move the cursor forward one character
2323 .Pf ( Cd mle-go-fwd ) .
2325 .It Ql \ecG
2326 Cancel current operation, full reset.
2327 If there is an active history search or tabulator expansion then this
2328 command will first reset that, reverting to the former line content;
2329 thus a second reset is needed for a full reset in this case
2330 .Pf ( Cd mle-reset ) .
2332 .It Ql \ecH
2333 Backspace: backward delete one character
2334 .Pf ( Cd mle-del-bwd ) .
2336 .It Ql \ecI
2337 \*(NQ
2338 Horizontal tabulator:
2339 try to expand the word before the cursor, also supporting \*(UA
2340 .Ic file
2341 expansions
2342 .Pf ( Cd mle-complete ) .
2343 This is affected by
2344 .Cd mle-quote-rndtrip .
2346 .It Ql \ecJ
2347 Newline:
2348 commit the current line
2349 .Pf ( Cd mle-commit ) .
2351 .It Ql \ecK
2352 Cut all characters from the cursor to the end of the line
2353 .Pf ( Cd mle-snarf-end ) .
2355 .It Ql \ecL
2356 Repaint the line
2357 .Pf ( Cd mle-repaint ) .
2359 .It Ql \ecN
2360 \*(OP Go to the next history entry
2361 .Pf ( Cd mle-hist-fwd ) .
2363 .It Ql \ecO
2364 Invokes the command
2365 .Ql Ic dt .
2367 .It Ql \ecP
2368 \*(OP Go to the previous history entry
2369 .Pf ( Cd mle-hist-bwd ) .
2371 .It Ql \ecQ
2372 Toggle roundtrip mode shell quotes, where produced,
2373 on and off
2374 .Pf ( Cd mle-quote-rndtrip ) .
2375 This setting is temporary, and will be forgotten once the command line
2376 is committed.
2378 .It Ql \ecR
2379 \*(OP Complete the current line from (the remaining) older history entries
2380 .Pf ( Cd mle-hist-srch-bwd ) .
2382 .It Ql \ecS
2383 \*(OP Complete the current line from (the remaining) newer history entries
2384 .Pf ( Cd mle-hist-srch-fwd ) .
2386 .It Ql \ecT
2387 Paste the snarf buffer
2388 .Pf ( Cd mle-paste ) .
2390 .It Ql \ecU
2391 The same as
2392 .Ql \ecA
2393 followed by
2394 .Ql \ecK
2395 .Pf ( Cd mle-snarf-line ) .
2397 .It Ql \ecV
2398 Prompts for a Unicode character (its hexadecimal number) to be inserted
2399 .Pf ( Cd mle-prompt-char ) .
2400 Note this command needs to be assigned to a single-letter control code
2401 in order to become recognized and executed during input of
2402 a key-sequence (only four single-letter control codes can be used for
2403 that shortcut purpose); this control code is special-treated and can't
2404 be part of any other sequence, because any occurrence will perform the
2405 .Cd mle-prompt-char
2406 function immediately.
2408 .It Ql \ecW
2409 Cut the characters from the one preceding the cursor to the preceding
2410 word boundary
2411 .Pf ( Cd mle-snarf-word-bwd ) .
2413 .It Ql \ecX
2414 Move the cursor forward one word boundary
2415 .Pf ( Cd mle-go-word-fwd ) .
2417 .It Ql \ecY
2418 Move the cursor backward one word boundary
2419 .Pf ( Cd mle-go-word-bwd ) .
2421 .It Ql \ec[
2422 Escape: reset a possibly used multibyte character input state machine
2423 and \*(OPally a lingering, incomplete key binding
2424 .Pf ( Cd mle-cancel ) .
2425 This command needs to be assigned to a single-letter control code in
2426 order to become recognized and executed during input of a key-sequence
2427 (only four single-letter control codes can be used for that shortcut
2428 purpose).
2429 This control code may also be part of a multi-byte sequence, but if
2430 a sequence is active and the very control code is currently also an
2431 expected input, then it will first be consumed by the active sequence.
2433 .It Ql \ec\e
2434 Invokes the command
2435 .Ql Ic z Ns + .
2437 .It Ql \ec]
2438 Invokes the command
2439 .Ql Ic z Ns $ .
2441 .It Ql \ec^
2442 Invokes the command
2443 .Ql Ic z Ns 0 .
2445 .It Ql \ec_
2446 Cut the characters from the one after the cursor to the succeeding word
2447 boundary
2448 .Pf ( Cd mle-snarf-word-fwd ) .
2450 .It Ql \ec?
2451 Backspace:
2452 .Cd mle-del-bwd .
2454 .It \(en
2455 .Cd mle-fullreset :
2456 in difference to
2457 .Cd mle-reset
2458 this will immediately reset a possibly active search etc.
2460 .It \(en
2461 .Cd mle-bell :
2462 ring the audible bell.
2464 .\" }}}
2466 .\" .Ss "Coloured display" {{{
2467 .Ss "Coloured display"
2469 \*(OP \*(UA can be configured to support a coloured display and font
2470 attributes by emitting ANSI / ISO 6429 SGR (select graphic rendition)
2471 escape sequences.
2472 Usage of colours and font attributes solely depends upon the
2473 capability of the detected terminal type that is defined by the
2474 environment variable
2475 .Ev TERM
2476 and which can be fine-tuned by the user via the internal variable
2477 .Va termcap .
2480 On top of what \*(UA knows about the terminal the boolean variable
2481 .Va colour-pager
2482 defines whether the actually applicable colour and font attribute
2483 sequences should also be generated when output is going to be paged
2484 through the external program defined by the environment variable
2485 .Ev PAGER
2486 (also see
2487 .Va crt Ns
2489 This is not enabled by default because different pager programs need
2490 different command line switches or other configuration in order to
2491 support those sequences.
2492 \*(UA however knows about some widely used pagers and in a clean
2493 environment it is often enough to simply set
2494 .Va colour-pager ;
2495 please refer to that variable for more on this topic.
2498 If the variable
2499 .Va colour-disable
2500 is set then any active usage of colour and font attribute sequences
2501 is suppressed, but without affecting possibly established
2502 .Ic colour
2503 mappings.
2506 To define and control colours and font attributes a single multiplexer
2507 command family exists:
2508 .Ic colour
2509 shows or defines colour mappings for the given colour type (e.g.,
2510 monochrome) and
2511 .Ic uncolour
2512 can be used to remove mappings of a given colour type.
2513 Since colours are only available in interactive mode, it may make
2514 sense to conditionalize the colour setup by encapsulating it with
2515 .Ic if :
2517 .Bd -literal -offset indent
2518 if terminal && $features =@ +colour
2519   colour iso  view-msginfo  ft=bold,fg=green
2520   colour iso  view-header   ft=bold,fg=red   "from,subject"
2521   colour iso  view-header   fg=red
2523   uncolour iso view-header  from,subject
2524   colour iso  view-header   ft=bold,fg=magenta,bg=cyan
2525   colour 256  view-header   ft=bold,fg=208,bg=230 subject,from
2526   colour mono view-header   ft=bold
2527   colour mono view-header   ft=bold,ft=reverse subject,from
2528 endif
2530 .\" }}}
2531 .\" }}} (DESCRIPTION)
2534 .\" .Sh COMMANDS {{{
2535 .Sh COMMANDS
2537 Each command is typed on a line by itself,
2538 and may take arguments following the command word.
2539 Command names may be abbreviated, in which case the first command that
2540 matches the given prefix will be used.
2541 The command
2542 .Ic list
2543 can be used to show the list of all commands, either alphabetically
2544 sorted or in prefix search order (these don't match, also because the
2545 POSIX standard prescribes a set of abbreviations).
2546 \*(OPally the command
2547 .Ic help
2549 .Ic \&? ) ,
2550 when given an argument, will show a documentation string for the
2551 command matching the expanded argument, as in
2552 .Ql ?t ,
2553 which should be a shorthand of
2554 .Ql ?type .
2555 Both commands support a more
2556 .Va verbose
2557 listing mode which includes the argument type of the command.
2560 For commands which take message lists as arguments, the next message
2561 forward that satisfies the command's requirements will be used shall no
2562 explicit message list have been specified.
2563 If there are no messages forward of the current message,
2564 the search proceeds backwards,
2565 and if there are no good messages at all,
2566 \*(UA shows an error message and aborts the command.
2567 \*(ID Non-message-list arguments can be quoted using the following methods:
2570 .Bl -bullet -compact -offset indent
2572 An argument can be enclosed between paired double-quotes
2573 .Ql """argument"""
2575 single-quotes
2576 .Ql 'argument' ;
2577 any white space, shell word expansion, or reverse solidus characters
2578 (except as described next) within the quotes are treated literally as
2579 part of the argument.
2580 A double-quote will be treated literally within single-quotes and vice
2581 versa.
2582 Inside such a quoted string the actually used quote character can be
2583 used nonetheless by escaping it with a reverse solidus
2584 .Ql \e ,
2585 as in
2586 .Ql """y\e""ou""" .
2589 An argument that is not enclosed in quotes, as above, can usually still
2590 contain space characters if those spaces are reverse solidus escaped, as in
2591 .Ql you\e are .
2594 A reverse solidus outside of the enclosing quotes is discarded
2595 and the following character is treated literally as part of the argument.
2600 Some commands which don't take message-list arguments can also be
2601 prefixed with the special keyword
2602 .Ic \&\&wysh
2603 to choose \*(INible argument quoting rules, and some new commands only
2604 support the new rules (without that keyword) and are flagged \*(NQ.
2605 In the future \*(UA will (mostly) use
2606 .Xr sh 1
2607 compatible argument parsing:
2608 Non-message-list arguments can be quoted using the following shell-style
2609 mechanisms: the escape character, single-quotes, double-quotes and
2610 dollar-single-quotes; any unquoted number sign
2611 .Ql #
2612 that parses as a new token starts a comment that ends argument processing.
2613 The overall granularity of error reporting and diagnostics, also
2614 regarding function arguments and their content, will improve.
2618 .Bl -bullet -compact -offset indent
2620 The literal value of any character can be preserved by preceding it
2621 with the escape character reverse solidus
2622 .Ql \e .
2623 An unquoted dollar
2624 .Ql $
2625 will cause variable expansion of the given name: \*(UA
2626 .Sx "INTERNAL VARIABLES"
2627 as well as
2628 .Sx ENVIRONMENT
2629 (shell) variables can be accessed through this mechanism, brace
2630 enclosing the name is supported.
2633 Arguments which are enclosed in
2634 .Ql 'single-\:quotes'
2635 retain their literal value.
2636 A single-quote cannot occur within single-quotes.
2639 The literal value of all characters enclosed in
2640 .Ql \(dqdouble-\:quotes\(dq
2641 is retained, with the exception of dollar
2642 .Ql $ ,
2643 which will cause variable expansion, as above, backquote (grave accent)
2644 .Ql ` ,
2645 (which not yet means anything special), reverse solidus
2646 .Ql \e ,
2647 which will escape any of the characters dollar
2648 .Ql $
2649 (to prevent variable expansion), backquote (grave accent)
2650 .Ql ` ,
2651 double-quote
2652 .Ql \(dq
2653 (to prevent ending the quote) and reverse solidus
2654 .Ql \e
2655 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
2656 but has no special meaning otherwise.
2659 Arguments enclosed in
2660 .Ql $'dollar-\:single-\:quotes'
2661 extend normal single quotes in that reverse solidus escape sequences are
2662 expanded as follows:
2664 .Bl -tag -compact -width "Ql \eNNN"
2665 .It Ql \ea
2666 alerts (bell).
2667 .It Ql \eb
2668 emits a backspace.
2669 .It Ql \eE
2670 an escape character.
2671 .It Ql \ee
2672 an escape character.
2673 .It Ql \ef
2674 form feed.
2675 .It Ql \en
2676 new line.
2677 .It Ql \er
2678 carriage return.
2679 .It Ql \et
2680 horizontal tab.
2681 .It Ql \ev
2682 vertical tab.
2683 .It Ql \e\e
2684 emits a reverse solidus character.
2685 .It Ql \e'
2686 single quote.
2687 .It Ql \e"
2688 double quote (escaping is optional).
2689 .It Ql \eNNN
2690 eight-bit byte with the octal value
2691 .Ql NNN
2692 (one to three octal digits), optionally prefixed by an additional
2693 .Ql 0 .
2694 A 0 byte will suppress further output for the quoted argument.
2695 .It Ql \exHH
2696 eight-bit byte with the hexadecimal value
2697 .Ql HH
2698 (one or two hexadecimal characters).
2699 A 0 byte will suppress further output for the quoted argument.
2700 .It Ql \eUHHHHHHHH
2701 the Unicode / ISO-10646 character with the hexadecimal codepoint value
2702 .Ql HHHHHHHH
2703 (one to eight hexadecimal digits) \(em note that Unicode defines the
2704 maximum codepoint to be ever supported as
2705 .Ql 0x10FFFF
2706 (in planes of
2707 .Ql 0xFFFF
2708 characters each).
2709 This escape is only supported in locales which support Unicode (see
2710 .Sx "Character sets" ) ,
2711 in other cases the sequence will remain unexpanded unless the given code
2712 point is ASCII compatible or can be represented in the current locale.
2713 The character NUL will suppress further output for the quoted argument.
2714 .It Ql \euHHHH
2715 Identical to
2716 .Ql \eUHHHHHHHH
2717 except it takes only one to four hexadecimal digits.
2718 .It Ql \ecX
2720 .Ql control-X
2721 character.
2722 This is a mechanism that allows usage of the non-printable (ASCII and
2723 compatible) control codes 0 to 31: to be able to create a printable
2724 representation the numeric value 64 is added to the control code of
2725 desire, and the resulting ASCII character set code point is then
2726 printed, e.g., BEL is
2727 .Ql 7 + 64 = 71 = G .
2728 Often circumflex notation is used for the visualization purpose, e.g,
2729 .Ql ^G ,
2730 but the reverse solid notation has been standardized:
2731 .Ql \ecG .
2732 The control code NUL
2733 .Pf ( Ql \ec@ )
2734 ends argument processing without producing further output.
2735 .It Ql \e$NAME
2736 Non-standard extension: expand the given variable name, as above.
2737 Brace enclosing the name is supported.
2738 .It Ql \e`{command}
2739 Not yet supported, just to raise awareness: Non-standard extension.
2745 .Sy Compatibility notes:
2746 \*(ID Note these are new mechanisms which are not supported by all
2747 commands.
2748 Round-tripping (feeding in things shown in list modes again) are not yet
2749 stable or possible at all.
2750 On new-style command lines it is wise to quote semicolon
2751 .Ql \&;
2752 and vertical bar
2753 .Ql |
2754 characters in order to ensure upward compatibility: the author would
2755 like to see things like
2756 .Ql ? echo $'trouble\etahead' | cat >> in_the_shell.txt
2758 .Ql ? top 2 5 10; type 3 22
2759 become possible.
2760 Before \*(UA will switch entirely to shell-style argument parsing there
2761 will be a transition phase where using
2762 .Ic \&\&wysh
2763 will emit obsoletion warnings.
2765 .Bd -literal -offset indent
2766 echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
2767 echo Quotes ${HOME} and tokens differ! # comment
2768 echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
2772 In any event an unquoted reverse solidus at the end of a command line is
2773 discarded and the next line continues the command.
2774 \*(ID Note that line continuation is handled before the above parsing is
2775 applied, i.e., the parsers documented above will see merged lines.
2776 Filenames, where expected, are subsequently subjected to the following
2777 transformations, in sequence:
2780 .Bl -bullet -compact -offset indent
2782 If the filename begins with an unquoted plus sign, and the
2783 .Va folder
2784 variable is defined,
2785 the plus sign will be replaced by the value of the
2786 .Va folder
2787 variable followed by a solidus.
2788 If the
2789 .Va folder
2790 variable is unset or is set to null, the filename will be unchanged.
2793 Meta expansions are applied to the filename: a leading tilde
2794 .Ql ~
2795 character will be replaced by the expansion of
2796 .Ev HOME ,
2797 except when followed by a valid user name, in which case the home
2798 directory of the given user is used instead.
2799 Any occurrence of
2800 .Ql $VARIABLE
2802 .Ql ${VARIABLE} )
2803 will be replaced by the expansion of the variable, if possible; \*(UA
2804 .Sx "INTERNAL VARIABLES"
2805 as well as
2806 .Sx ENVIRONMENT
2807 (shell) variables can be accessed through this mechanism, and the usual
2808 escape mechanism has to be applied to prevent interpretation.
2809 If the fully expanded filename results in multiple pathnames and the
2810 command is expecting only one file, an error results.
2812 In interactive context, in order to allow simple value acceptance (via
2813 .Dq ENTER ) ,
2814 arguments will usually be displayed in a properly quoted form, e.g., a file
2815 .Ql diet\e is \ecurd.txt
2816 may be displayed as
2817 .Ql 'diet\e is \ecurd.txt' .
2821 The following commands are available:
2823 .Bl -tag -width ".Ic _ccount"
2825 .It Ic \&!
2826 Executes the
2827 .Ev SHELL
2828 (see
2829 .Xr sh 1 Ns
2830 ) command which follows.
2833 .It Ic #
2834 The comment-command causes the entire line to be ignored.
2835 .Sy Note:
2836 this really is a normal command which' purpose is to discard its
2837 arguments, not a
2838 .Dq comment-start
2839 indicating special character, which means that, e.g., trailing comments
2840 on a line are not possible.
2843 .It Ic +
2844 Goes to the next message in sequence and types it
2845 (like
2846 .Dq ENTER ) .
2849 .It Ic -
2850 Display the preceding message, or the n'th previous message if given
2851 a numeric argument n.
2854 .It Ic =
2855 Show the current message number (the
2856 .Dq dot ) .
2859 .It Ic \&?
2860 Show a brief summary of commands.
2861 A more
2862 .Va verbose
2863 output is available.
2864 \*(OP Given an argument a synopsis for the command in question is
2865 shown instead; commands can be abbreviated in general and this command
2866 can be used to see the full expansion of an abbreviation including the
2867 synopsis, try, e.g.,
2868 .Ql ?h ,
2869 .Ql ?hel
2871 .Ql ?help
2872 and see how the output changes.
2875 .It Ic \&|
2876 A synonym for the
2877 .Ic pipe
2878 command.
2881 .It Ic ~
2882 Interprets the remainder of the word as a macro name and passes it
2883 through to the
2884 .Ic call
2885 command; e.g.,
2886 .Ql ~ Ns Ar mymacro
2887 is a shorter synonym for
2888 .Ql call Ar mymacro .
2891 .It Ic account
2892 (ac) Creates, selects or lists (an) account(s).
2893 Accounts are special incarnations of
2894 .Ic define Ns d
2895 macros and group commands and variable settings which together usually
2896 arrange the environment for the purpose of creating an email account.
2897 Different to normal macros settings which are covered by
2898 .Ic localopts
2899 \(en here by default enabled! \(en will not be reverted before the
2900 .Ic account
2901 is changed again.
2902 The special account
2903 .Ql null
2904 (case-insensitive) always exists, and all but it can be deleted via
2905 .Ic unaccount .
2907 Without arguments a listing of all defined accounts is shown.
2908 With one argument the given account is activated: the system
2909 .Va inbox
2910 of that account will be activated (as via
2911 .Ic file ) ,
2912 and a possibly installed
2913 .Va folder-hook
2914 will be run.
2915 The two argument form is identical to defining a macro as via
2916 .Ic define :
2917 .Bd -literal -offset indent
2918 account myisp {
2919   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
2920   set from='myname@myisp.example (My Name)'
2921   set mta=smtp://mylogin@smtp.myisp.example
2926 .It Ic alias
2927 (a) With no arguments, shows all currently-defined aliases.
2928 With one argument, shows that alias.
2929 With more than one argument,
2930 creates a new alias or appends to an existing one.
2931 .Ic unalias
2932 can be used to delete aliases.
2935 .It Ic alternates
2936 (alt) Manage a list of alternate addresses / names of the active user,
2937 members of which will be removed from recipient lists when replying to
2938 messages (and the
2939 .Va metoo
2940 variable is not set).
2941 If arguments are given the set of alternate names is replaced by them,
2942 without arguments the current set is displayed.
2945 .It Ic answered
2946 Takes a message list and marks each message as having been answered.
2947 This mark has no technical meaning in the mail system;
2948 it just causes messages to be marked in the header summary,
2949 and makes them specially addressable.
2953 .It Ic bind
2954 \*(OP\*(NQ The bind command extends the MLE (see
2955 .Sx "On terminal control and line editor" )
2956 with freely configurable key bindings.
2957 With one argument all bindings for the given context are shown,
2958 specifying an asterisk
2959 .Ql *
2960 will show the bindings of all contexts; a more verbose listing will be
2961 produced if either of
2962 .Va debug
2964 .Va verbose
2965 are set.
2966 With two or more arguments a binding is (re)established:
2967 the first argument is the context to which the binding shall apply,
2968 the second argument is a comma-separated list of the
2969 .Dq keys
2970 which form the binding, and any remaining arguments form the expansion.
2971 To indicate that a binding shall not be auto-committed, but that the
2972 expansion shall instead be furtherly editable by the user, an at-sign
2973 .Ql @
2974 (that will be removed) can be placed last in the expansion, from which
2975 leading and trailing whitespace will finally be removed.
2978 Contexts define when a binding applies, i.e., a binding won't be seen
2979 unless the context for which it is defined for is currently active.
2980 This is not true for the binding
2981 .Ql base ,
2982 which always applies, but which will be searched secondarily to a more
2983 specialized context and may thus have some or all of its key bindings
2984 transparently replaced by equal bindings of more specialized contexts.
2985 The available contexts are
2986 .Ql base ,
2987 which always applies, and
2988 .Ql compose ,
2989 which applies to compose-mode.
2992 .Dq Keys
2993 which form the binding are specified as a comma-separated list of
2994 byte-sequences, where each list entry corresponds to one key(press).
2995 \*(OPally a list entry may, indicated by a leading colon character
2996 .Ql \&: ,
2997 also refer to the name of a terminal capability;
2998 several dozen names will be compiled into \*(UA and may be specified
2999 either by their
3000 .Xr terminfo 5 ,
3001 or, if existing, by their
3002 .Xr termcap 5
3003 name, regardless of the actually used terminal control library.
3004 It is however possible to use any capability, as long as the name is
3005 resolvable by the control library or defined in the internal variable
3006 .Va termcap .
3007 Input sequences are not case-normalized, so that an exact match is
3008 required to update or remove a binding.
3009 Examples:
3011 .Bd -literal -offset indent
3012 bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
3013 bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
3014 bind compose :kf1 ~e
3015 bind base $'\ecA',:khome,w 'echo An editable binding@'
3016 bind base a,b,c rm -rf / @  # Another editable binding
3020 Note that the entire comma-separated list is first parsed (over) as a
3021 shell-token with whitespace as the field separator, before being parsed
3022 and expanded for real with comma as the field separator, therefore
3023 whitespace needs to be properly quoted:
3024 shell-style quoting is documented in the introduction of
3025 .Sx COMMANDS .
3026 Using Unicode reverse solidus escape sequences renders a binding
3027 defunctional if the locale doesn't support Unicode (see
3028 .Sx "Character sets" ) ,
3029 and using terminal capabilities does so if no terminal control support
3030 is (currently) available.
3033 The following terminal capability names are builtin and can be used in
3034 .Xr terminfo 5
3035 or (if available) the two-letter
3036 .Xr termcap 5
3037 notation regardless of the actually used library.
3038 See the respective manual for a list of capabilities.
3039 The program
3040 .Xr infocmp 1
3041 can be used to show all the capabilities of
3042 .Ev TERM
3043 or the given terminal type;
3044 using the
3045 .Fl \&\&x
3046 flag will also show supported (non-standard) extensions.
3049 .Bl -tag -compact -width kcuuf_or_kcuuf
3050 .It Cd kbs Ns \0or Cd kb
3051 Backspace.
3052 .It Cd kdch1 Ns \0or Cd kD
3053 Delete character.
3054 .It Cd kDC Ns \0or Cd *4
3055 \(em shifted variant.
3056 .It Cd kel Ns \0or Cd kE
3057 Clear to end of line.
3058 .It Cd kext Ns \0or Cd @9
3059 Exit.
3060 .It Cd kich1 Ns \0or Cd kI
3061 Insert character.
3062 .It Cd kIC Ns \0or Cd #3
3063 \(em shifted variant.
3064 .It Cd khome Ns \0or Cd kh
3065 Home.
3066 .It Cd kHOM Ns \0or Cd #2
3067 \(em shifted variant.
3068 .It Cd kend Ns \0or Cd @7
3069 End.
3070 .It Cd knp Ns \0or Cd kN
3071 Next page.
3072 .It Cd kpp Ns \0or Cd kP
3073 Previous page.
3074 .It Cd kcub1 Ns \0or Cd kl
3075 Left cursor (with more modifiers: see below).
3076 .It Cd kLFT Ns \0or Cd #4
3077 \(em shifted variant.
3078 .It Cd kcuf1 Ns \0or Cd kr
3079 Right cursor (ditto).
3080 .It Cd kRIT Ns \0or Cd %i
3081 \(em shifted variant.
3082 .It Cd kcud1 Ns \0or Cd kd
3083 Down cursor (ditto).
3084 .It Cd kDN
3085 \(em shifted variant (only terminfo).
3086 .It Cd kcuu1 Ns \0or Cd ku
3087 Up cursor (ditto).
3088 .It Cd kUP
3089 \(em shifted variant (only terminfo).
3090 .It Cd kf0 Ns \0or Cd k0
3091 Function key 0.
3092 Add one for each function key up to
3093 .Cd kf9
3095 .Cd k9 ,
3096 respectively.
3097 .It Cd kf10 Ns \0or Cd k;
3098 Function key 10.
3099 .It Cd kf11 Ns \0or Cd F1
3100 Function key 11.
3101 Add one for each function key up to
3102 .Cd kf19
3104 .Cd F9 ,
3105 respectively.
3109 Some terminals support key-modifier combination extensions, e.g.,
3110 .Ql Alt+Shift+xy .
3111 For example, the delete key,
3112 .Cd kdch1 :
3113 in its shifted variant, the name is mutated to
3114 .Cd  kDC ,
3115 then a number is appended for the states
3116 .Ql Alt
3117 .Pf ( Cd kDC3 ) ,
3118 .Ql Shift+Alt
3119 .Pf ( Cd kDC4 ) ,
3120 .Ql Control
3121 .Pf ( Cd kDC5 ) ,
3122 .Ql Shift+Control
3123 .Pf ( Cd kDC6 ) ,
3124 .Ql Alt+Control
3125 .Pf ( Cd kDC7 ) ,
3126 finally
3127 .Ql Shift+Alt+Control
3128 .Pf ( Cd kDC8 ) .
3129 The same for the left cursor key,
3130 .Cd kcub1 :
3131 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
3134 Key bindings can be removed with the command
3135 .Ic unbind .
3136 It is advisable to use an initial escape or other control character (e.g.,
3137 .Ql \ecA )
3138 for bindings which describe user key combinations (as opposed to purely
3139 terminal capability based ones), in order to avoid ambiguities whether
3140 input belongs to key sequences or not; it also reduces search time.
3141 Adjusting
3142 .Va bind-timeout
3143 may help shall keys and sequences be falsely recognized.
3147 .It Ic call
3148 Calls a macro that has been created via
3149 .Ic define .
3152 .It Ic cd
3153 (ch) Change the working directory to
3154 .Ev HOME
3155 or the given argument.
3156 Synonym for
3157 .Ic chdir .
3160 .It Ic certsave
3161 \*(OP Only applicable to S/MIME signed messages.
3162 Takes a message list and a file name and saves the certificates
3163 contained within the message signatures to the named file in both
3164 human-readable and PEM format.
3165 The certificates can later be used to send encrypted messages to the
3166 respective message senders by setting
3167 .Va smime-encrypt-USER@HOST
3168 variables.
3171 .It Ic chdir
3172 (ch) Change the working directory to
3173 .Ev HOME
3174 or the given argument.
3175 Synonym for
3176 .Ic cd .
3179 .It Ic collapse
3180 Only applicable to threaded mode.
3181 Takes a message list and makes all replies to these messages invisible
3182 in header summaries, unless they are in state
3183 .Ql new .
3187 .It Ic colour
3188 \*(OP\*(NQ Manage colour mappings for the type of colour given as the
3189 (case-insensitive) first argument, which must be one of
3190 .Ql 256
3191 for 256-colour terminals,
3192 .Ql 8 ,
3193 .Ql ansi
3195 .Ql iso
3196 for the standard 8-colour ANSI / ISO 6429 color palette and
3197 .Ql 1
3199 .Ql mono
3200 for monochrome terminals.
3201 Monochrome terminals cannot deal with colours, but only (some) font
3202 attributes.
3205 Without further arguments the list of all currently defined mappings
3206 for the given colour type is shown (as a special case giving
3207 .Ql all
3209 .Ql *
3210 will iterate over all types in order).
3211 Otherwise the second argument defines the mappable slot, the third
3212 argument a (comma-separated list of) colour and font attribute
3213 specification(s), and the optional fourth argument can be used to
3214 specify a precondition: if conditioned mappings exist they are tested in
3215 (creation) order unless a (case-insensitive) match has been found, and
3216 the default mapping (if any has been established) will only be chosen as
3217 a last resort.
3218 The types of precondition available depend on the mappable slot, the
3219 following of which exist:
3222 Mappings prefixed with
3223 .Ql mle-
3224 are used for the \*(OPal builtin Mailx-Line-Editor (MLE, see
3225 .Sx "On terminal control and line editor" )
3226 and don't support preconditions.
3228 .Bl -tag -compact -width view-partinfo
3229 .It Cd mle-position
3230 This mapping is used for the position indicator that is visible when
3231 a line cannot be fully displayed on the screen.
3232 .It Cd mle-prompt
3233 Used for the
3234 .Va prompt .
3238 Mappings prefixed with
3239 .Ql sum-
3240 are used in header summaries, and they all understand the preconditions
3241 .Ql dot
3242 (the current message) and
3243 .Ql older
3244 for elder messages (only honoured in conjunction with
3245 .Va datefield-markout-older ) .
3247 .Bl -tag -compact -width view-partinfo
3248 .It Cd sum-dotmark
3249 This mapping is used for the
3250 .Dq dotmark
3251 that can be created with the
3252 .Ql %>
3254 .Ql %<
3255 formats of the variable
3256 .Va headline .
3257 .It Cd sum-header
3258 For the complete header summary line except the
3259 .Dq dotmark
3260 and the thread structure.
3261 .It Cd sum-thread
3262 For the thread structure which can be created with the
3263 .Ql %i
3264 format of the variable
3265 .Va headline .
3269 Mappings prefixed with
3270 .Ql view-
3271 are used when displaying messages.
3273 .Bl -tag -compact -width view-partinfo
3274 .It Cd view-from_
3275 This mapping is used for so-called
3276 .Ql From_
3277 lines, which are MBOX file format specific header lines.
3278 .It Cd view-header
3279 For header lines.
3280 A comma-separated list of headers to which the mapping applies may be
3281 given as a precondition; if the \*(OPal regular expression support is
3282 available then if any of the
3283 .Dq magical
3284 (extended) regular expression characters is seen the precondition will
3285 be evaluated as (an extended) one.
3286 .It Cd view-msginfo
3287 For the introductional message info line.
3288 .It Cd view-partinfo
3289 For MIME part info lines.
3293 The following (case-insensitive) colour definitions and font attributes
3294 are understood, multiple of which can be specified in a comma-separated
3295 list:
3297 .Bl -tag -width ft=
3298 .It Cd ft=
3299 a font attribute:
3300 .Ql bold ,
3301 .Ql reverse
3303 .Ql underline .
3304 It is possible (and often applicable) to specify multiple font
3305 attributes for a single mapping.
3307 .It Cd fg=
3308 foreground colour attribute:
3309 .Ql black ,
3310 .Ql blue ,
3311 .Ql green ,
3312 .Ql red ,
3313 .Ql brown ,
3314 .Ql magenta ,
3315 .Ql cyan
3317 .Ql white .
3318 To specify a 256-color mode a decimal number colour specification in
3319 the range 0 to 255, inclusive, is supported, and interpreted as follows:
3321 .Bl -tag -compact -width "999 - 999"
3322 .It 0 - 7
3323 the standard ISO 6429 colors, as above.
3324 .It 8 - 15
3325 high intensity variants of the standard colors.
3326 .It 16 - 231
3327 216 colors in tuples of 6.
3328 .It 232 - 255
3329 grayscale from black to white in 24 steps.
3331 .Bd -literal -offset indent
3332 #!/bin/sh -
3333 fg() { printf "\e033[38;5;${1}m($1)"; }
3334 bg() { printf "\e033[48;5;${1}m($1)"; }
3336 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
3337 printf "\e033[0m\en"
3339 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
3340 printf "\e033[0m\en"
3343 .It Cd bg=
3344 background colour attribute (see
3345 .Cd fg=
3346 for possible values).
3350 Mappings may be removed with the command
3351 .Ic uncolour .
3352 For a generic overview see the section
3353 .Sx "Coloured display" .
3357 .It Ic Copy
3358 (C) Copy messages to files whose names are derived from the author of
3359 the respective message and don't mark them as being saved;
3360 otherwise identical to
3361 .Ic Save .
3364 .It Ic copy
3365 (c) Copy messages to the named file and don't mark them as being saved;
3366 otherwise identical to
3367 .Ic save .
3370 .It Ic customhdr
3371 \*(NQ With no arguments, shows all currently-defined custom headers.
3372 With one argument, shows that custom header.
3373 With more than one argument, creates a new or replaces an existing
3374 custom header with the name given as the first argument, the content of
3375 which being defined by the concatenated remaining arguments.
3376 .Ic uncustomhdr
3377 can be used to delete custom headers.
3378 \*(ID Overwriting of automatically managed headers is neither supported
3379 nor prevented.
3380 Defined custom headers will be injected into newly composed or forwarded
3381 messages, e.g.:
3383 .Dl customhdr OpenPGP id=12345678; url=http://www.YYY.ZZ
3385 The \*(OB variable
3386 .Va customhdr
3387 may also be used to inject custom headers; it is covered by
3388 .Ic localopts .
3391 .It Ic cwd
3392 Show the name of the current working directory.
3395 .It Ic Decrypt
3396 \*(OP For unencrypted messages this command is identical to
3397 .Ic Copy ;
3398 Encrypted messages are first decrypted, if possible, and then copied.
3401 .It Ic decrypt
3402 \*(OP For unencrypted messages this command is identical to
3403 .Ic copy ;
3404 Encrypted messages are first decrypted, if possible, and then copied.
3407 .It Ic define
3408 Without arguments the current list of macros, including their content,
3409 is shown, otherwise a macro is defined.
3410 A macro definition is a sequence of commands in the following form:
3411 .Bd -literal -offset indent
3412 define name {
3413   command1
3414   command2
3415   ...
3416   commandN
3420 A defined macro can be invoked explicitly by using the
3421 .Ic call
3423 .Ic ~
3424 commands, or implicitly if a macro hook is triggered, e.g., a
3425 .Va folder-hook .
3426 Note that interpretation of
3427 .Ic localopts
3428 depends on how (i.e.,
3429 .Dq as what :
3430 normal macro, folder hook, hook, account switch) the macro is invoked.
3431 Macros can be deleted via
3432 .Ic undefine .
3434 .Sy \*(ID:
3435 Macro behaviour, including option localization, will change in v15.
3436 Please be aware of that and possibly embed a version check in a resource
3437 file of yours!
3440 .It Ic delete
3441 (d) Marks the given message list as
3442 .Ql deleted .
3443 Deleted messages will neither be saved in
3444 .Ev MBOX
3445 nor will they be available for most other commands.
3448 .It Ic discard
3449 (di) Identical to
3450 .Ic ignore .
3451 Also see
3452 .Ic retain .
3456 .It Ic dp , dt
3457 Deletes the current message and displays the next message.
3458 If there is no next message, \*(UA says
3459 .Dq at EOF .
3462 .It Ic dotmove
3463 Move the
3464 .Dq dot
3465 up or down by one message when given
3466 .Ql +
3468 .Ql -
3469 argument, respectively.
3472 .It Ic draft
3473 Takes a message list and marks each given message as a draft.
3474 This mark has no technical meaning in the mail system;
3475 it just causes messages to be marked in the header summary,
3476 and makes them specially addressable.
3479 .It Ic echo
3480 (ec) Echoes its arguments after applying
3481 .Xr sh 1 Ns -style
3482 expansions and filename transformations, as documented for
3483 .Sx COMMANDS .
3486 .It Ic edit
3487 (e) Point the text editor (as defined in
3488 .Ev EDITOR )
3489 at each message from the given list in turn.
3490 Modified contents are discarded unless the
3491 .Va writebackedited
3492 variable is set.
3495 .It Ic elif
3496 Part of the
3497 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3498 conditional \(em if the condition of a preceding
3499 .Ic if
3500 was false, check the following condition and execute the following block
3501 if it evaluates true.
3504 .It Ic else
3505 (el) Part of the
3506 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3507 conditional \(em if none of the conditions of the preceding
3508 .Ic if
3510 .Ic elif
3511 commands was true, the
3512 .Ic else
3513 block is executed.
3516 .It Ic endif
3517 (en) Marks the end of an
3518 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3519 conditional execution block.
3523 .It Ic environ
3524 \*(NQ \*(UA has a strict notion about which variables are
3525 .Sx "INTERNAL VARIABLES"
3526 and which are managed in the program
3527 .Sx ENVIRONMENT .
3528 Since some of the latter are a vivid part of \*(UAs functioning,
3529 however, they are transparently integrated into the normal handling of
3530 internal variables via
3531 .Ic set
3533 .Ic unset .
3534 To integrate other environment variables of choice into this
3535 transparent handling, and also to export internal variables into the
3536 process environment where they normally are not, a
3537 .Ql link
3538 needs to become established with this command, as in, e.g.,
3541 .Dl environ link PERL5LIB from TZ
3544 Afterwards changing such variables with
3545 .Ic set
3546 will cause automatic updates of the program environment, and therefore
3547 be inherited by newly created child processes.
3548 Sufficient system support provided (it was in BSD as early as 1987, and
3549 is standardized since Y2K) removing such variables with
3550 .Ic unset
3551 will remove them also from the program environment, but in any way
3552 the knowledge they ever have been
3553 .Ql link Ns
3554 ed will be lost.
3555 Note this implies that
3556 .Ic localopts
3557 may cause loss of links.
3560 The command
3561 .Ql unlink
3562 will remove an existing link, but leaves the variables as such intact.
3563 Additionally the subcommands
3564 .Ql set
3566 .Ql unset
3567 are provided, which work exactly the same as the documented commands
3568 .Ic set
3570 .Ic unset ,
3571 but (additionally) link the variable(s) with the program environment and
3572 thus immediately export them to, or remove them from (if possible),
3573 respectively, the program environment.
3577 .It Ic errors
3578 \*(OP Since \*(UA uses the console as a user interface it can happen
3579 that messages scroll by too fast to become recognized.
3580 Optionally an error message ring queue is available which stores
3581 duplicates of any error message and notifies the user in interactive
3582 sessions whenever a new error has occurred.
3583 The queue is finite: if its maximum size is reached any new message
3584 replaces the eldest.
3585 The command
3586 .Ic errors
3587 can be used to manage this message queue: if given
3588 .Ar show
3589 or no argument the queue will be displayed and cleared,
3590 .Ar clear
3591 will only clear all messages from the queue.
3594 .It Ic exit
3595 (ex or x) Exit from \*(UA without changing the active mailbox and skip
3596 any saving of messages in
3597 .Ev MBOX
3598 as well as a possibly tracked line editor history file.
3601 .It Ic File
3602 (Fi) Like
3603 .Ic file ,
3604 but open the mailbox readonly.
3607 .It Ic file
3608 (fi) The file command switches to a new mailbox.
3609 Without arguments it shows status information of the current mailbox.
3610 If an argument is given, it will write out changes (such as deletions)
3611 the user has made and open a new mailbox.
3612 Some special conventions are recognized for the
3613 .Ar name
3614 argument:
3616 .Bl -tag -compact -offset indent -width ".Ar %:__lespec"
3617 .It Ar #
3618 (number sign) means the previous file,
3619 .It Ar %
3620 (percent sign) means the invoking user's system mailbox, which either
3621 is the (itself expandable)
3622 .Va inbox
3623 if that is set, the standardized absolute pathname indicated by
3624 .Ev MAIL
3625 if that is set, or a builtin compile-time default otherwise.
3626 .It Ar %user
3627 means the primary system mailbox of
3628 .Ar user
3629 (and never the value of
3630 .Va inbox ,
3631 regardless of its actual setting),
3632 .It Ar &
3633 (ampersand) means the invoking user's
3634 .Ev MBOX
3635 file and
3636 .It Ar +file
3637 means a
3638 .Ar file
3639 in the
3640 .Va folder
3641 directory.
3642 .It Ar %:filespec
3643 expands to the same value as
3644 .Ar filespec ,
3645 but the file is handled as a primary system mailbox by, e.g., the
3646 .Ic mbox
3648 .Ic save
3649 commands, meaning that messages that have been read in the current
3650 session will be moved to the
3651 .Ev MBOX
3652 mailbox instead of simply being flagged as read.
3655 If the name matches one of the strings defined with the command
3656 .Ic shortcut ,
3657 it is replaced by its long form and expanded.
3658 If the name ends with
3659 .Ql .gz ,
3660 .Ql .bz2
3662 .Ql .xz
3663 it is treated as being compressed with
3664 .Xr gzip 1 ,
3665 .Xr bzip2 1
3667 .Xr xz 1 ,
3668 respectively, and transparently handled through an intermediate
3669 (un)compression step (using a temporary file) with the according
3670 facility, sufficient support provided.
3671 Likewise, if the named file doesn't exist, but a file with one of the
3672 mentioned compression extensions does, then the name is automatically
3673 expanded and the compressed file is used.
3675 Otherwise, if the name ends with an extension for which
3676 .Va file-hook-load-EXTENSION
3678 .Va file-hook-save-EXTENSION
3679 variables are set, then the given hooks will be used to load and save
3680 .Dq name ,
3681 and \*(UA will work with an intermediate temporary file.
3683 MBOX files (flat file-based mailboxes) are generally locked during file
3684 operations in order to avoid inconsistencies due to concurrent
3685 modifications.
3686 \*(OPal Mailbox files which \*(UA treats as the system
3687 .Va inbox
3688 .Pf ( Ev MAIL )
3689 and primary mailboxes will also be protected by so-called dotlock
3690 files, the traditional way of mail spool file locking: for any file
3691 .Ql a
3692 a lock file
3693 .Ql a.lock
3694 will be created for the duration of the synchronization \(em
3695 as necessary a privilege-separated dotlock child process will be used
3696 to accommodate for necessary privilege adjustments in order to create
3697 the dotlock file in the same directory
3698 and with the same user and group identities as the file of interest.
3701 .Ar name
3702 refers to a directory with the subdirectories
3703 .Ql tmp ,
3704 .Ql new
3706 .Ql cur ,
3707 then it is treated as a folder in
3708 .Dq Maildir
3709 format; \*(ID the variable
3710 .Va newfolders
3711 can be used to control the format of yet non-existent folders.
3712 A name of the form
3714 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
3715 .Dl \*(OU protocol://[user@]host[:port][/path]
3717 is taken as an Internet mailbox specification.
3718 The \*(OPally supported protocols are
3719 .Ar pop3
3720 (POP3) and
3721 .Ar pop3s
3722 (POP3 with SSL/TLS encrypted transport).
3724 .Ar [/path]
3725 part is valid only for IMAP; there it defaults to
3726 .Ar INBOX .
3727 Also see the section
3728 .Sx "On URL syntax and credential lookup" .
3730 \*(OU If
3731 .Ar user
3732 contains special characters, in particular
3733 .Ql /
3735 .Ql % ,
3736 they must be escaped in URL notation \(en the command
3737 .Ic urlcodec
3738 can be used to show the necessary conversion.
3741 .It Ic flag
3742 Takes a message list and marks the messages as
3743 .Ic flag Ns
3744 ged for urgent/special attention.
3745 This mark has no technical meaning in the mail system;
3746 it just causes messages to be highlighted in the header summary,
3747 and makes them specially addressable.
3750 .It Ic folder
3751 (fold) The same as
3752 .Ic file .
3755 .It Ic folders
3756 With no arguments, list the names of the folders in the folder directory.
3757 With an existing folder as an argument,
3758 lists the names of folders below the named folder.
3761 .It Ic Followup
3762 (F) Similar to
3763 .Ic Respond ,
3764 but saves the message in a file named after the local part of the first
3765 recipient's address (instead of in
3766 .Va record Ns ).
3769 .It Ic followup
3770 (fo) Similar to
3771 .Ic respond ,
3772 but saves the message in a file named after the local part of the first
3773 recipient's address (instead of in
3774 .Va record Ns ).
3777 .It Ic followupall
3778 Similar to
3779 .Ic followup ,
3780 but responds to all recipients regardless of the
3781 .Va flipr
3782 variable.
3785 .It Ic followupsender
3786 Similar to
3787 .Ic Followup ,
3788 but responds to the sender only regardless of the
3789 .Va flipr
3790 variable.
3793 .It Ic Forward
3794 Alias for
3795 .Ic Fwd .
3798 .It Ic forward
3799 Alias for
3800 .Ic fwd .
3803 .It Ic from
3804 (f) Takes a list of message specifications and displays a summary of
3805 their message headers, exactly as via
3806 .Ic headers .
3807 An alias of this command is
3808 .Ic search .
3809 Also see
3810 .Sx "Specifying messages" .
3813 .It Ic Fwd
3814 Similar to
3815 .Ic fwd ,
3816 but saves the message in a file named after the local part of the
3817 recipient's address (instead of in
3818 .Va record Ns ).
3821 .It Ic fwd
3822 Takes a message and the address of a recipient
3823 and forwards the message to him.
3824 The text of the original message is included in the new one,
3825 with the value of the
3826 .Va fwdheading
3827 variable preceding it.
3829 .Ic fwdignore
3831 .Ic fwdretain
3832 commands specify which header fields are included in the new message.
3833 Only the first part of a multipart message is included unless the
3834 .Va forward-as-attachment
3835 option is set.
3836 Unless the option
3837 .Va fullnames
3838 is set recipient addresses will be stripped from comments, names etc.
3841 .It Ic fwdignore
3842 Specifies which header fields are to be ignored with the command
3843 .Ic fwd .
3844 This command has no effect when the
3845 .Va forward-as-attachment
3846 option is set.
3849 .It Ic fwdretain
3850 Specifies which header fields are to be retained with the command
3851 .Ic fwd .
3852 .Ic fwdretain
3853 overrides
3854 .Ic fwdignore .
3855 This command has no effect when the
3856 .Va forward-as-attachment
3857 option is set.
3860 .It Ic ghost
3861 Define or list command aliases, so-called ghosts.
3862 Without arguments a list of all currently known aliases is shown.
3863 With one argument the expansion of the given alias is shown.
3864 With two or more arguments a command alias is defined or updated: the
3865 first argument is the name under which the remaining command line should
3866 be accessible, the content of which can be just about anything.
3867 A ghost can be used everywhere a normal command can be used, but always
3868 takes precedence; any arguments that are given to the command alias are
3869 joined onto the alias content, and the resulting string forms the
3870 command line that is, in effect, executed.
3871 Also see
3872 .Ic unghost .
3873 .Bd -literal -offset indent
3874 ? gh xx
3875 `ghost': no such alias: "xx"
3876 ? gh xx echo hello,
3877 ? gh xx
3878 ghost xx "echo hello,"
3879 ? xx
3880 hello,
3881 ? xx world
3882 hello, world
3886 .It Ic headers
3887 (h) Show the current group of headers, the size of which depends on
3888 the variable
3889 .Va screen
3890 and the style of which can be adjusted with the variable
3891 .Va headline .
3892 If a message-specification is given the group of headers containing the
3893 first message therein is shown and the message at the top of the screen
3894 becomes the new
3895 .Dq dot .
3898 .It Ic help
3899 (hel) A synonym for
3900 .Ic \&? .
3903 .It Ic history
3904 \*(OP Either
3905 .Ar show
3907 .Ar clear
3908 the list of history entries;
3909 a decimal
3910 .Ar NUMBER
3911 argument selects and shows the respective history entry \(en
3912 press
3913 .Dq ENTER
3914 to accept it, and the history entry will become the new history top.
3915 The default mode if no arguments are given is
3916 .Ar show .
3919 .It Ic hold
3920 (ho, also
3921 .Ic preserve )
3922 Takes a message list and marks each message therein to be saved in the
3923 user's system
3924 .Va inbox
3925 instead of in
3926 .Ev MBOX .
3927 Does not override the
3928 .Ic delete
3929 command.
3930 \*(UA deviates from the POSIX standard with this command, because a
3931 .Ic next
3932 command issued after
3933 .Ic hold
3934 will display the following message, not the current one.
3938 .It Ic if
3939 (i) Part of the nestable
3940 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
3941 conditional execution construct \(em if the given condition is true then
3942 the encapsulated block is executed.
3943 POSIX only supports the (case-insensitive) conditions
3944 .Ql r Ns
3945 eceive
3947 .Ql s Ns
3948 end, all remaining conditions are non-portable extensions; note that
3949 falsely specified conditions cause the execution of the entire
3950 conditional construct until the (matching) closing
3951 .Ic endif
3952 command to be suppressed.
3953 The syntax of the nestable
3954 .Ic if
3955 conditional execution construct requires that each condition and syntax
3956 element is surrounded by whitespace.
3958 .Bd -literal -offset indent
3959 if receive
3960   commands ...
3961 else
3962   commands ...
3963 endif
3967 The (case-insensitive) condition
3968 .Ql t Ns
3969 erminal will evaluate to true if the standard input is a terminal, i.e.,
3970 in interactive sessions.
3971 Another condition can be any boolean value (see the section
3972 .Sx "INTERNAL VARIABLES"
3973 for textual boolean representations) to mark an enwrapped block as
3974 .Dq never execute
3976 .Dq always execute .
3977 It is possible to check
3978 .Sx "INTERNAL VARIABLES"
3979 as well as
3980 .Sx ENVIRONMENT
3981 variables for existence or compare their expansion against a user given
3982 value or another variable by using the
3983 .Ql $
3984 .Pf ( Dq variable next )
3985 conditional trigger character;
3986 a variable on the right hand side may be signalled using the same
3987 mechanism.
3988 The variable names may be enclosed in a pair of matching braces.
3991 The available comparison operators are
3992 .Ql <
3993 (less than),
3994 .Ql <=
3995 (less than or equal to),
3996 .Ql ==
3997 (equal),
3998 .Ql !=
3999 (not equal),
4000 .Ql >=
4001 (greater than or equal to),
4002 .Ql >
4003 (greater than),
4004 .Ql =@
4005 (is substring of) and
4006 .Ql !@
4007 (is not substring of).
4008 The values of the left and right hand side are treated as strings and
4009 are compared 8-bit byte-wise, ignoring case according to the rules of
4010 the US-ASCII encoding (therefore, dependent on the active locale,
4011 possibly producing false results for strings in the locale encoding).
4012 Except for the substring checks the comparison will instead be performed
4013 arithmetically if both, the user given value as well as the variable
4014 content, can be parsed as numbers (integers).
4015 An unset variable is treated as the empty string.
4018 When the \*(OPal regular expression support is available, the additional
4019 test cases
4020 .Ql =~
4022 .Ql !~
4023 can be used.
4024 They treat the right hand side as an extended regular expression that is
4025 matched case-insensitively and according to the active
4026 .Ev LC_CTYPE
4027 locale, meaning that strings in the locale encoding should be matched
4028 correctly.
4031 Conditions can be joined via AND-OR lists (where the AND operator is
4032 .Ql &&
4033 and the OR operator is
4034 .Ql || ) ,
4035 which have equal precedence and will be evaluated with left
4036 associativity, thus using the same syntax that is known for the
4037 .Xr sh 1 .
4038 It is also possible to form groups of conditions and lists by enclosing
4039 them in pairs of brackets
4040 .Ql [\ \&.\&.\&.\ ] ,
4041 which may be interlocked within each other, and also be joined via
4042 AND-OR lists.
4045 The results of individual conditions and entire groups may be modified
4046 via unary operators: the unary operator
4047 .Ql \&!
4048 will reverse the result.
4050 .Bd -literal -offset indent
4051 if $debug
4052   echo *debug* is set
4053 endif
4054 if $ttycharset == "UTF-8"
4055   echo *ttycharset* is set to UTF-8, case-insensitively
4056 endif
4057 set t1=one t2=one
4058 if ${t1} == ${t2}
4059   echo These two variables are equal
4060 endif
4061 if $version-major >= 15
4062   echo Running a new version..
4063   if $features =@ +regex
4064     if $TERM =~ "^xterm\&.*"
4065       echo ..in an X terminal
4066     endif
4067   endif
4068   if [ [ true ] && [ [ ${debug} ] || [ $verbose ] ] ]
4069     echo Noisy, noisy
4070   endif
4071   if true && $debug || ${verbose}
4072     echo Left associativity, as is known from the shell
4073   endif
4074   if ! ! true && ! [ ! $debug && ! $verbose ]
4075     echo Unary operator support
4076   endif
4077 endif
4082 .It Ic ignore
4083 Without arguments the list of ignored header fields is shown,
4084 otherwise the given list of header fields is added to the ignore list:
4085 Header fields in the ignore list are not shown on the terminal when
4086 a message is displayed.
4087 To display a message in its entirety, use the commands
4088 .Ic Type
4090 .Ic Print .
4091 Also see
4092 .Ic discard
4094 .Ic retain .
4097 .It Ic list
4098 Shows the names of all available commands, alphabetically sorted.
4099 If given any non-whitespace argument the list will be shown in the order
4100 in which command prefixes are searched.
4101 A more
4102 .Va verbose
4103 output is available.
4106 .It Ic localopts
4107 This command can be used to localize changes to variables, meaning that
4108 their state will be reverted to the former one once the covered scope
4109 is left.
4110 It can only be used inside of macro definition blocks introduced by
4111 .Ic account
4113 .Ic define ,
4114 and is interpreted as a boolean (string, see
4115 .Sx "INTERNAL VARIABLES" ) ;
4117 .Dq covered scope
4118 of an account is left once it is switched off again.
4119 .Bd -literal -offset indent
4120 define temporary_settings {
4121   set global_option1
4122   localopts on
4123   set local_option1
4124   set local_option2
4125   localopts off
4126   set global_option2
4130 .Sy Note
4131 that this setting
4132 .Dq stacks up :
4133 i.e., if
4134 .Ql macro1
4135 enables change localization and calls
4136 .Ql macro2 ,
4137 which explicitly resets localization, then any value changes within
4138 .Ql macro2
4139 will still be reverted by
4140 .Ql macro1 !
4141 \*(ID Once the outermost level, the one which enabled localization
4142 first, is left, but no earlier, all adjustments will be unrolled.
4143 \*(ID Likewise worth knowing, if in this example
4144 .Ql macro2
4145 changes to a different
4146 .Ic account
4147 which sets some variables that are yet covered by localizations, their
4148 scope will be extended, and in fact leaving the
4149 .Ic account
4150 will (thus) restore settings in (likely) global scope which actually
4151 were defined in a local, private context.
4154 .It Ic Lreply
4155 Reply to messages that come in via known
4156 .Pf ( Ic mlist )
4157 or subscribed
4158 .Pf ( Ic mlsubscribe )
4159 mailing lists, or pretend to do so (see
4160 .Sx "Mailing lists" ) :
4161 on top of the usual
4162 .Ic reply
4163 functionality this will actively resort and even remove message
4164 recipients in order to generate a message that is supposed to be sent to
4165 a mailing list.
4166 For example it will also implicitly generate a
4167 .Ql Mail-Followup-To:
4168 header if that seems useful, regardless of the setting of the variable
4169 .Va followup-to .
4172 .It Ic Mail
4173 Similar to
4174 .Ic mail ,
4175 but saves the message in a file named after the local part of the first
4176 recipient's address (instead of in
4177 .Va record Ns ).
4180 .It Ic mail
4181 (m) Takes a (list of) recipient address(es) as (an) argument(s),
4182 or asks on standard input if none were given;
4183 then collects the remaining mail content and sends it out.
4186 .It Ic mbox
4187 (mb) The given message list is to be sent to
4188 .Ev MBOX
4189 when \*(UA is quit; this is the default action unless the
4190 .Va hold
4191 option is set.
4192 \*(ID This command can only be used in a primary system mailbox (see
4193 .Ic file ) .
4196 .It Ic mimetype
4197 Without any arguments the content of the MIME type cache will displayed.
4198 Otherwise each argument defines a complete MIME type specification of
4199 a type that shall be added (prepended) to the cache.
4200 In any event MIME type sources are loaded first as necessary \(en
4201 .Va mimetypes-load-control
4202 can be used to fine-tune which sources are actually loaded.
4203 Refer to the section on
4204 .Sx "The mime.types files"
4205 for more on MIME type specifications and this topic in general.
4206 MIME type unregistration and cache resets can be triggered with
4207 .Ic unmimetype .
4210 .It Ic mlist
4211 Without arguments the list of all currently defined mailing lists
4212 (and their attributes, if any) is shown; a more verbose listing will be
4213 produced if either of
4214 .Va debug
4216 .Va verbose
4217 are set.
4218 Otherwise all given arguments (which need not be quoted except for
4219 whitespace) will be added and henceforth be recognized as mailing lists.
4220 Mailing lists may be removed via the command
4221 .Ic unmlist .
4223 If the \*(OPal regular expression support is available then mailing
4224 lists may also be specified as (extended) regular expressions (see
4225 .Xr re_format 7
4226 for more on those).
4229 .It Ic mlsubscribe
4230 Without arguments the list of all currently defined mailing lists which
4231 have a subscription attribute is shown; a more verbose listing will be
4232 produced if either of
4233 .Va debug
4235 .Va verbose
4236 are set.
4237 Otherwise this attribute will be set for all given mailing lists,
4238 newly creating them as necessary (as via
4239 .Ic mlist ) .
4240 Subscription attributes may be removed via the command
4241 .Ic unmlsubscribe .
4242 Also see
4243 .Va followup-to .
4246 .It Ic Move
4247 Similar to
4248 .Ic move ,
4249 but moves the messages to a file named after the local part of the
4250 sender address of the first message (instead of in
4251 .Va record Ns ).
4254 .It Ic move
4255 Acts like
4256 .Ic copy
4257 but marks the messages for deletion if they were transferred
4258 successfully.
4261 .It Ic More
4262 Like
4263 .Ic more ,
4264 but also displays ignored header fields and all MIME parts.
4265 Identical to
4266 .Ic Page .
4269 .It Ic more
4270 Invokes the
4271 .Ev PAGER
4272 on the given messages, even in non-interactive mode and as long as the
4273 standard output is a terminal.
4274 Identical to
4275 .Ic page .
4278 .It Ic netrc
4279 \*(OP When used without arguments or if
4280 .Ar show
4281 has been given the content of the
4282 .Pa .netrc
4283 cache is shown, loading it first as necessary.
4284 If the argument is
4285 .Ar load
4286 then the cache will only be initialized and
4287 .Ar clear
4288 will remove its contents.
4289 Note that \*(UA will try to load the file only once, use
4290 .Ql Ic \&\&netrc Ns \:\0\:clear
4291 to unlock further attempts.
4293 .Va netrc-lookup ,
4294 .Va netrc-pipe
4295 and the section
4296 .Sx "On URL syntax and credential lookup" ;
4297 the section
4298 .Sx "The .netrc file"
4299 documents the file format in detail.
4302 .It Ic newmail
4303 Checks for new mail in the current folder without committing any changes
4304 before.
4305 If new mail is present, a message is shown.
4306 If the
4307 .Va header
4308 variable is set,
4309 the headers of each new message are also shown.
4310 This command is not available for all mailbox types.
4313 .It Ic next
4314 (n) (like
4315 .Ql +
4317 .Dq ENTER )
4318 Goes to the next message in sequence and types it.
4319 With an argument list, types the next matching message.
4322 .It Ic New
4323 Same as
4324 .Ic Unread .
4327 .It Ic new
4328 Same as
4329 .Ic unread .
4332 .It Ic noop
4333 If the current folder is accessed via a network connection, a
4334 .Dq NOOP
4335 command is sent, otherwise no operation is performed.
4338 .It Ic Page
4339 Like
4340 .Ic page ,
4341 but also displays ignored header fields and all MIME parts.
4342 Identical to
4343 .Ic More .
4346 .It Ic page
4347 Invokes the
4348 .Ev PAGER
4349 on the given messages, even in non-interactive mode and as long as the
4350 standard output is a terminal.
4351 Identical to
4352 .Ic more .
4355 .It Ic Pipe
4356 Like
4357 .Ic pipe
4358 but also pipes ignored header fields and all parts of MIME
4359 .Ql multipart/alternative
4360 messages.
4363 .It Ic pipe
4364 (pi) Takes a message list and a shell command
4365 and pipes the messages through the command.
4366 Without an argument the current message is piped through the command
4367 given by the
4368 .Va cmd
4369 variable.
4370 If the
4371 .Va page
4372 variable is set,
4373 every message is followed by a formfeed character.
4376 .It Ic preserve
4377 (pre) A synonym for
4378 .Ic hold .
4381 .It Ic Print
4382 (P) Alias for
4383 .Ic Type .
4386 .It Ic print
4387 (p) Research
4389 equivalent of
4390 .Ic type .
4393 .It Ic quit
4394 (q) Terminates the session, saving all undeleted, unsaved messages in
4395 the current
4396 .Ev MBOX ,
4397 preserving all messages marked with
4398 .Ic hold
4400 .Ic preserve
4401 or never referenced in the system
4402 .Va inbox ,
4403 and removing all other messages from the primary system mailbox.
4404 If new mail has arrived during the session,
4405 the message
4406 .Dq You have new mail
4407 will be shown.
4408 If given while editing a mailbox file with the command line flag
4409 .Fl f ,
4410 then the edit file is rewritten.
4411 A return to the shell is effected,
4412 unless the rewrite of edit file fails,
4413 in which case the user can escape with the exit command.
4416 .It Ic redirect
4417 Same as
4418 .Ic resend .
4421 .It Ic Redirect
4422 Same as
4423 .Ic Resend .
4426 .It Ic remove
4427 Removes the named files or directories.
4428 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
4429 type specific removal will be performed, deleting the complete mailbox.
4430 The user is asked for confirmation in interactive mode.
4433 .It Ic rename
4434 Takes the name of an existing folder
4435 and the name for the new folder
4436 and renames the first to the second one.
4437 Both folders must be of the same type.
4440 .It Ic Reply
4441 (R) Reply to originator.
4442 Does not reply to other recipients of the original message.
4443 .Va flipr
4444 will exchange this command with
4445 .Ic reply .
4446 Unless the option
4447 .Va fullnames
4448 is set the recipient address will be stripped from comments, names etc.
4451 .It Ic reply
4452 (r) Take a message and group-responds to it by addressing the sender
4453 and all recipients.
4454 .Va followup-to ,
4455 .Va followup-to-honour ,
4456 .Va reply-to-honour
4457 as well as
4458 .Va recipients-in-cc
4459 influence response behaviour.
4460 The command
4461 .Ic Lreply
4462 offers special support for replying to mailing lists.
4463 Unless the option
4464 .Va fullnames
4465 is set recipient addresses will be stripped from comments, names etc.
4467 .Va flipr
4468 is set the commands
4469 .Ic Reply
4471 .Ic reply
4472 are exchanged.
4475 .It Ic replyall
4476 Similar to
4477 .Ic reply ,
4478 but initiates a group-reply regardless of the value of
4479 .Va flipr .
4482 .It Ic replysender
4483 Similar to
4484 .Ic Reply ,
4485 but responds to the sender only regardless of the value of
4486 .Va flipr .
4489 .It Ic Resend
4490 Like
4491 .Ic resend ,
4492 but does not add any header lines.
4493 This is not a way to hide the sender's identity,
4494 but useful for sending a message again to the same recipients.
4497 .It Ic resend
4498 Takes a list of messages and a user name
4499 and sends each message to the named user.
4500 .Ql Resent-From:
4501 and related header fields are prepended to the new copy of the message.
4504 .It Ic Respond
4505 Same as
4506 .Ic Reply .
4509 .It Ic respond
4510 Same as
4511 .Ic reply .
4514 .It Ic respondall
4515 Same as
4516 .Ic replyall .
4519 .It Ic respondsender
4520 Same as
4521 .Ic replysender .
4524 .It Ic retain
4525 (ret) Without arguments the list of retained header fields is shown,
4526 otherwise the given list of header fields is added to the retain list:
4527 Header fields in the retain list are shown on the terminal when
4528 a message is displayed, all other header fields are suppressed.
4529 To display a message in its entirety, use the commands
4530 .Ic Type
4532 .Ic Print .
4533 Also see
4534 .Ic discard
4536 .Ic ignore ;
4537 .Ic retain
4538 takes precedence over the mentioned.
4541 .It Ic Save
4542 (S) Similar to
4543 .Ic save,
4544 but saves the messages in a file named after the local part of the
4545 sender of the first message instead of (in
4546 .Va record
4547 and) taking a filename argument.
4550 .It Ic save
4551 (s) Takes a message list and a filename and appends each message in turn
4552 to the end of the file.
4553 If no filename is given, the
4554 .Ev MBOX
4555 file is used.
4556 The filename in quotes, followed by the generated character count
4557 is echoed on the user's terminal.
4558 If editing a primary system mailbox the messages are marked for deletion.
4559 Filename interpretation as described for the
4560 .Ic file
4561 command is performed.
4564 .It Ic savediscard
4565 Same as
4566 .Ic saveignore .
4569 .It Ic saveignore
4570 Is to
4571 .Ic save
4572 what
4573 .Ic ignore
4574 is to
4575 .Ic print
4577 .Ic type .
4578 Header fields thus marked are filtered out when saving a message by
4579 .Ic save
4580 or when automatically saving to
4581 .Ev MBOX .
4582 This command should only be applied to header fields that do not contain
4583 information needed to decode the message,
4584 as MIME content fields do.
4587 .It Ic saveretain
4588 Is to
4589 .Ic save
4590 what
4591 .Ic retain
4592 is to
4593 .Ic print
4595 .Ic type .
4596 Header fields thus marked are the only ones saved with a message when
4597 saving by
4598 .Ic save
4599 or when automatically saving to
4600 .Ev MBOX .
4601 .Ic saveretain
4602 overrides
4603 .Ic saveignore .
4604 The use of this command is strongly discouraged since it may strip
4605 header fields that are needed to decode the message correctly.
4608 .It Ic search
4609 Takes a message specification (list) and displays a header summary of
4610 all matching messages, as via
4611 .Ic headers .
4612 This command is an alias of
4613 .Ic from .
4614 Also see
4615 .Sx "Specifying messages" .
4618 .It Ic seen
4619 Takes a message list and marks all messages as having been read.
4622 .It Ic set
4623 (se) Without arguments this command shows all internal variables which
4624 are currently known to \*(UA (they have been set).
4625 A more verbose listing will be produced if either of
4626 .Va debug
4628 .Va verbose
4629 are set, in which case variables may be preceded with a comment line
4630 that gives some context of what \*(UA knows about the given variable.
4632 Otherwise the given variables (and arguments) are set or adjusted.
4633 Arguments are of the form
4634 .Ql name=value
4635 (no space before or after
4636 .Ql = ) ,
4637 or plain
4638 .Ql name
4639 if there is no value, i.e., a boolean variable.
4640 Quotation marks may be placed around any part of the assignment
4641 statement to quote blanks or tabs, e.g.,
4643 .Dl set indentprefix='->'
4645 If an argument begins with
4646 .Ql no ,
4647 as in
4648 .Ql set nosave ,
4649 the effect is the same as invoking the
4650 .Ic unset
4651 command with the remaining part of the variable
4652 .Pf ( Ql unset save ) .
4655 .Ql name
4656 that is known to map to an environment variable will automatically cause
4657 updates in the program environment (unsetting a variable in the
4658 environment requires corresponding system support).
4659 Please use the command
4660 .Ic environ
4661 for further environmental control.
4662 Also see
4663 .Ic varedit ,
4664 .Ic varshow
4665 and the sections
4666 .Sx "INTERNAL VARIABLES"
4668 .Sx ENVIRONMENT .
4671 .It Ic shell
4672 (sh) Invokes an interactive version of the shell.
4675 .It Ic shortcut
4676 Without arguments the list of all currently defined shortcuts is
4677 shown.
4678 Otherwise all given arguments (which need not be quoted except for
4679 whitespace) are treated as pairs of shortcuts and their expansions,
4680 creating new or changing already existing shortcuts, as necessary.
4681 Shortcuts may be removed via the command
4682 .Ic unshortcut .
4683 The expansion strings should be in the syntax that has been described
4684 for the
4685 .Ic file
4686 command.
4689 .It Ic show
4690 Like
4691 .Ic type ,
4692 but performs neither MIME decoding nor decryption, so that the raw
4693 message text is shown.
4696 .It Ic size
4697 (si) Shows the size in characters of each message of the given
4698 message-list.
4701 .It Ic sort
4702 Shows the current sorting criterion when used without an argument.
4703 Otherwise creates a sorted representation of the current folder,
4704 and changes the
4705 .Ic next
4706 command and the addressing modes such that they refer to messages in
4707 the sorted order.
4708 Message numbers are the same as in regular mode.
4709 If the
4710 .Va header
4711 variable is set,
4712 a header summary in the new order is also displayed.
4713 Automatic folder sorting can be enabled by setting the
4714 .Va autosort
4715 variable, as in, e.g.,
4716 .Ql set autosort=thread .
4717 Possible sorting criterions are:
4719 .Bl -tag -compact -offset indent -width "subject"
4720 .It date
4721 Sort the messages by their
4722 .Ql Date:
4723 field, that is by the time they were sent.
4724 .It from
4725 Sort messages by the value of their
4726 .Ql From:
4727 field, that is by the address of the sender.
4728 If the
4729 .Va showname
4730 variable is set, the sender's real name (if any) is used.
4731 .It size
4732 Sort the messages by their size.
4733 .It spam
4734 \*(OP Sort the message by their spam score, as has been classified by
4735 .Ic spamrate .
4736 .It status
4737 Sort the messages by their message status.
4738 .It subject
4739 Sort the messages by their subject.
4740 .It thread
4741 Create a threaded display.
4742 .It to
4743 Sort messages by the value of their
4744 .Ql To:
4745 field, that is by the address of the recipient.
4746 If the
4747 .Va showname
4748 variable is set, the recipient's real name (if any) is used.
4752 .It Ic source
4753 (so) The source command reads commands from the given file, which is
4754 subject to the usual filename expansions (see introductional words of
4755 .Sx COMMANDS ) .
4756 If the given argument ends with a vertical bar
4757 .Ql |
4758 then the argument will instead be interpreted as a shell command and
4759 \*(UA will read the output generated by it.
4760 Interpretation of commands read is stopped when an error is encountered.
4761 \*(ID Note that
4762 .Ic \&\&source
4763 cannot be used from within macros that execute as
4764 .Va folder-hook Ns s
4766 .Ic account Ns s ,
4767 i.e., it can only be called from macros that were
4768 .Ic call Ns ed .
4771 .It Ic source_if
4772 The difference to
4773 .Ic source
4774 (beside not supporting pipe syntax aka shell command input) is that
4775 this command will not generate an error if the given file argument
4776 cannot be opened successfully.
4779 .It Ic spamclear
4780 \*(OP Takes a list of messages and clears their
4781 .Ql is-spam
4782 flag.
4785 .It Ic spamforget
4786 \*(OP Takes a list of messages and causes the
4787 .Va spam-interface
4788 to forget it has ever used them to train its Bayesian filter.
4789 Unless otherwise noted the
4790 .Ql is-spam
4791 flag of the message is inspected to chose whether a message shall be
4792 forgotten to be
4793 .Dq ham
4795 .Dq spam .
4798 .It Ic spamham
4799 \*(OP Takes a list of messages and informs the Bayesian filter of the
4800 .Va spam-interface
4801 that they are
4802 .Dq ham .
4803 This also clears the
4804 .Ql is-spam
4805 flag of the messages in question.
4808 .It Ic spamrate
4809 \*(OP Takes a list of messages and rates them using the configured
4810 .Va spam-interface ,
4811 without modifying the messages, but setting their
4812 .Ql is-spam
4813 flag as appropriate; because the spam rating headers are lost the rate
4814 will be forgotten once the mailbox is left.
4815 Refer to the manual section
4816 .Sx "Handling spam"
4817 for the complete picture of spam handling in \*(UA.
4820 .It Ic spamset
4821 \*(OP Takes a list of messages and sets their
4822 .Ql is-spam
4823 flag.
4826 .It Ic spamspam
4827 \*(OP Takes a list of messages and informs the Bayesian filter of the
4828 .Va spam-interface
4829 that they are
4830 .Dq spam .
4831 This also sets the
4832 .Ql is-spam
4833 flag of the messages in question.
4836 .It Ic thread
4837 \*(OB The same as
4838 .Ql sort thread
4839 (consider using a
4840 .Ql ghost
4841 as necessary).
4842 Create a threaded representation of the current folder,
4843 i.\|e. indent messages that are replies to other messages in the header
4844 display and change the
4845 .Ic next
4846 command and the addressing modes such that they refer to messages in the
4847 threaded order.
4848 Message numbers are the same as in unthreaded mode.
4849 If the
4850 .Va header
4851 variable is set,
4852 a header summary in threaded order is also displayed.
4855 .It Ic Top
4856 Like
4857 .Ic top
4858 but honours
4859 .Ic ignore
4861 .Ic retain
4862 filter lists.
4865 .It Ic top
4866 (to) Takes a message list and types out the first
4867 .Va toplines
4868 lines of each message on the users' terminal.
4869 The only header fields that are displayed are
4870 .Ql From: ,
4871 .Ql To: ,
4872 .Ql CC: ,
4874 .Ql Subject:
4875 .Pf ( Ic Top
4876 will instead honour configured lists).
4877 It is possible to apply compression to what is displayed by setting
4878 .Va topsqueeze .
4879 Messages are decrypted and converted to the terminal character set
4880 if necessary.
4883 .It Ic touch
4884 (tou) Takes a message list and marks the messages for saving in
4885 .Ev MBOX .
4886 \*(UA deviates from the POSIX standard with this command,
4887 as a following
4888 .Ic next
4889 command will display the following message instead of the current one.
4892 .It Ic Type
4893 (T) Like
4894 .Ic type
4895 but also displays out ignored header fields and all parts of MIME
4896 .Ql multipart/alternative
4897 messages.
4900 .It Ic type
4901 (t) Takes a message list and types out each message on the users'
4902 terminal, honouring
4903 .Ic ignore
4905 .Ic retain
4906 lists.
4907 For MIME multipart messages, all parts with a content type of
4908 .Ql text
4910 .Ql message
4911 are shown, the other are hidden except for their headers.
4912 Messages are decrypted and converted to the terminal character set
4913 if necessary.
4916 .It Ic unaccount
4917 Delete all given accounts.
4918 An error message is shown if a given account is not defined.
4919 The special name
4920 .Ql *
4921 will discard all existing accounts.
4924 .It Ic unalias
4925 (una) Takes a list of names defined by alias commands
4926 and discards the remembered groups of users.
4927 The special name
4928 .Ql *
4929 will discard all existing aliases.
4932 .It Ic unanswered
4933 Takes a message list and marks each message as not having been answered.
4936 .It Ic unbind
4937 Forget about a key
4938 .Ic bind Ns
4939 ing, specified by its context and input sequence, both of which may be
4940 specified as a wildcard (asterisk,
4941 .Ql * ) ,
4942 e.g.,
4943 .Ql unbind * *
4944 will remove all bindings of all contexts.
4947 .It Ic uncollapse
4948 Only applicable to threaded mode.
4949 Takes a message list and makes the message and all replies to it visible
4950 in header summaries again.
4951 When a message becomes the current message,
4952 it is automatically made visible.
4953 Also when a message with collapsed replies is displayed,
4954 all of these are automatically uncollapsed.
4957 .It Ic uncolour
4958 Forget about a
4959 .Ic colour
4960 mapping for the given colour type (see
4961 .Ic colour
4962 for a list of types) and mapping; if the optional precondition argument
4963 is used then only the exact tuple of mapping and precondition is removed.
4964 The special name
4965 .Ql *
4966 will remove all mappings (no precondition allowed).
4967 Also see
4968 .Sx "Coloured display"
4969 for the general picture.
4972 .It Ic uncustomhdr
4973 Deletes the custom headers given as arguments.
4974 The special name
4975 .Ql *
4976 will remove all custom headers.
4979 .It Ic undefine
4980 Undefine all given macros.
4981 An error message is shown if a given macro is not defined.
4982 The special name
4983 .Ql *
4984 will discard all existing macros.
4987 .It Ic undelete
4988 (u) Takes a message list and marks each message as not being deleted.
4991 .It Ic undraft
4992 Takes a message list and
4993 .Pf un Ic draft Ns
4994 s each message.
4997 .It Ic unflag
4998 Takes a message list and marks each message as not being
4999 .Ic flag Ns ged .
5002 .It Ic unfwdignore
5003 Removes the header field names from the list of ignored fields for the
5004 .Ic forward
5005 command.
5006 The special name
5007 .Ql *
5008 will remove all fields.
5011 .It Ic unfwdretain
5012 Removes the header field names from the list of retained fields for the
5013 .Ic forward
5014 command.
5015 The special name
5016 .Ql *
5017 will remove all fields.
5020 .It Ic unghost
5021 Remove all the given command
5022 .Ic ghost Ns s Ns .
5023 The special name
5024 .Ql *
5025 will remove all ghosts.
5028 .It Ic unignore
5029 Removes the header field names from the list of ignored fields.
5030 The special name
5031 .Ql *
5032 will remove all fields.
5035 .It Ic unmimetype
5036 Delete all given MIME types, e.g.,
5037 .Ql unmimetype text/plain
5038 will remove all registered specifications for the MIME type
5039 .Ql text/plain .
5040 The special name
5041 .Ql *
5042 will discard all existing MIME types, just as will
5043 .Ql reset ,
5044 but which also reenables cache initialization via
5045 .Va mimetypes-load-control .
5048 .It Ic unmlist
5049 Forget about all the given mailing lists.
5050 The special name
5051 .Ql *
5052 will remove all lists.
5053 Also see
5054 .Ic mlist .
5057 .It Ic unmlsubscribe
5058 Remove the subscription attribute from all given mailing lists.
5059 The special name
5060 .Ql *
5061 will clear the attribute from all lists which have it set.
5062 Also see
5063 .Ic mlsubscribe .
5066 .It Ic Unread
5067 Same as
5068 .Ic unread .
5071 .It Ic unread
5072 Takes a message list and marks each message as not having been read.
5075 .It Ic unretain
5076 Removes the header field names from the list of retained fields.
5077 The special name
5078 .Ql *
5079 will remove all fields.
5082 .It Ic unsaveignore
5083 Removes the header field names from the list of ignored fields for
5084 saving.
5085 The special name
5086 .Ql *
5087 will remove all fields.
5090 .It Ic unsaveretain
5091 Removes the header field names from the list of retained fields for
5092 saving.
5093 The special name
5094 .Ql *
5095 will remove all fields.
5098 .It Ic unset
5099 (uns) Takes a list of internal variable names and discards their
5100 remembered values; the reverse of
5101 .Ic set .
5102 Also see
5103 .Ic environ .
5106 .It Ic unshortcut
5107 Deletes the shortcut names given as arguments.
5108 The special name
5109 .Ql *
5110 will remove all shortcuts.
5113 .It Ic unsort
5114 Disable sorted or threaded mode
5115 (see the
5116 .Ic sort
5118 .Ic thread
5119 commands),
5120 return to normal message order and,
5121 if the
5122 .Va header
5123 variable is set,
5124 displays a header summary.
5127 .It Ic unthread
5128 \*(OB
5129 Same as
5130 .Ic unsort .
5133 .It Ic urlcodec
5134 Perform URL percent codec operations, rather according to RFC 3986,
5135 on all given strings.
5136 This is character set agnostic and thus locale dependent, and it may
5137 decode bytes which are invalid in the current locale, unless the input
5138 solely consists of characters in the portable character set, see
5139 .Sx "Character sets" .
5140 The first argument specifies the operation:
5141 .Ar enc[ode]
5143 .Ar dec[code]
5144 perform plain URL percent en- and decoding, respectively.
5145 .Ar p[ath]enc[ode]
5147 .Ar p[ath]dec[ode]
5148 perform a slightly modified operation which should be better for
5149 pathnames: it doesn't allow a tilde
5150 .Ql ~ ,
5151 and will neither accept hyphen
5152 .Ql -
5153 nor dot
5154 .Ql .
5155 as an initial character.
5158 .It Ic varedit
5159 Edit the values of or create the given variable(s) in the
5160 .Ev EDITOR .
5161 Boolean variables cannot be edited.
5164 .It Ic varshow
5165 This command produces the same output as the listing mode of
5166 .Ic set ,
5167 including
5168 .Va verbose Ns
5169 ity adjustments, but only for the given variables.
5172 .It Ic verify
5173 \*(OP Takes a message list and verifies each message.
5174 If a message is not a S/MIME signed message,
5175 verification will fail for it.
5176 The verification process checks if the message was signed using a valid
5177 certificate,
5178 if the message sender's email address matches one of those contained
5179 within the certificate,
5180 and if the message content has been altered.
5183 .It Ic version
5184 Shows the
5185 .Va version
5187 .Va features
5188 of \*(UA.
5191 .It Ic visual
5192 (v) Takes a message list and invokes the display editor on each message.
5193 Modified contents are discarded unless the
5194 .Va writebackedited
5195 variable is set.
5198 .It Ic write
5199 (w) For conventional messages the body without all headers is written.
5200 The original message is never marked for deletion in the originating
5201 mail folder.
5202 The output is decrypted and converted to its native format as necessary.
5203 If the output file exists, the text is appended.
5204 If a message is in MIME multipart format its first part is written to
5205 the specified file as for conventional messages, handling of the remains
5206 depends on the execution mode.
5207 No special handling of compressed files is performed.
5209 In interactive mode the user is consecutively asked for the filenames of
5210 the processed parts.
5211 For convience saving of each part may be skipped by giving an empty
5212 value, the same result as writing it to
5213 .Pa /dev/null .
5214 Shell piping the part content by specifying a leading vertical bar
5215 .Ql |
5216 character for the filename is supported.
5217 Other user input is expanded as usually for folders, e.g., tilde
5218 expansion is performed, and contents of the destination file are
5219 overwritten if the file previously existed.
5221 \*(ID In non-interactive mode any part which does not specify a filename
5222 is ignored, and suspicious parts of filenames of the remaining parts are
5223 URL percent encoded (as via
5224 .Ic urlencode )
5225 to prevent injection of malicious character sequences, resulting in
5226 a filename that will be written into the current directory.
5227 Existing files won't be overwritten, instead the part number or
5228 a dot are appended after a number sign
5229 .Ql #
5230 to the name until file creation succeeds (or fails due to other
5231 reasons).
5234 .It Ic xit
5235 (x) A synonym for
5236 .Ic exit .
5239 .It Ic z
5240 \*(UA presents message headers in
5241 .Va screen Ns
5242 fuls as described under the
5243 .Ic headers
5244 command.
5245 Without arguments this command scrolls to the next window of messages,
5246 likewise if the argument is
5247 .Ql + .
5248 An argument of
5249 .Ql -
5250 scrolls to the last,
5251 .Ql ^
5252 scrolls to the first, and
5253 .Ql $
5254 to the last
5255 .Va \&\&screen
5256 of messages.
5257 A number argument prefixed by
5258 .Ql +
5260 .Ql \-
5261 indicates that the window is calculated in relation to the current
5262 position, and a number without a prefix specifies an absolute position.
5265 .It Ic Z
5266 Similar to
5267 .Ic z ,
5268 but scrolls to the next or previous window that contains at least one
5269 .Ql new
5271 .Ic flag Ns
5272 ged message.
5274 .\" }}}
5277 .\" .Sh TILDE ESCAPES {{{
5278 .Sh "TILDE ESCAPES"
5280 Here is a summary of the tilde escapes,
5281 which are used to perform special functions when composing messages.
5282 Tilde escapes are only recognized at the beginning of lines.
5283 The name
5284 .Dq tilde escape
5285 is somewhat of a misnomer since the actual escape character can be
5286 changed by adjusting the option
5287 .Va escape .
5289 .Bl -tag -width ".Ic __ filename"
5291 .It Ic ~~ Ar string
5292 Insert the string of text in the message prefaced by a single
5293 .Ql ~ .
5294 (If the escape character has been changed,
5295 that character must be doubled
5296 in order to send it at the beginning of a line.)
5299 .It Ic ~! Ar command
5300 Execute the indicated shell
5301 .Ar command ,
5302 then return to the message.
5305 .It Ic ~.
5306 Same effect as typing the end-of-file character.
5309 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
5310 Execute the given \*(UA command.
5311 Not all commands, however, are allowed.
5314 .It Ic ~?
5315 Write a summary of command escapes.
5318 .It Ic ~< Ar filename
5319 Identical to
5320 .Ic ~r .
5323 .It Ic ~<! Ar command
5324 .Ar command
5325 is executed using the shell.
5326 Its standard output is inserted into the message.
5329 .It Ic ~@ Op Ar filename...
5330 With no arguments, edit the attachment list interactively.
5331 If an attachment's file name is left empty,
5332 that attachment is deleted from the list.
5333 When the end of the attachment list is reached,
5334 \*(UA will ask for further attachments until an empty name is given.
5335 If a given file name solely consists of the number sign
5336 .Ql #
5337 followed by a valid message number of the currently active mailbox, then
5338 the given message is attached as a MIME
5339 .Ql message/rfc822
5340 and the rest of this section does not apply.
5342 If character set conversion has been compiled into \*(UA, then this mode
5343 gives the user the option to specify input and output character sets,
5344 unless the file extension indicates binary content, in which case \*(UA
5345 asks whether this step shall be skipped for the attachment in question.
5346 If not skipped, then the charset that succeeds to represent the
5347 attachment data will be used in the
5348 .Ql charset=
5349 MIME parameter of the mail message:
5351 .Bl -bullet -compact
5353 If input and output character sets are specified, then the conversion is
5354 performed on the fly.
5355 The user will be asked repeatedly until the desired conversion succeeds.
5357 If only an output character set is specified, then the input is assumed
5358 to be in the
5359 .Va ttycharset
5360 charset and will be converted to the given output charset on the fly.
5361 The user will be asked repeatedly until the desired conversion succeeds.
5363 If no character sets are specified at all then the algorithm that is
5364 documented in the section
5365 .Sx "Character sets"
5366 is applied, but directly and on the fly.
5367 The user will be asked repeatedly until the desired conversion succeeds.
5369 Finally, if an input-, but no output character set is specified, then no
5370 conversion is ever performed, but the
5371 .Ql charset=
5372 MIME parameter value will still be set to the user input.
5374 The character set selection loop can be left by typing
5375 .Ql control-C ,
5376 i.e., causing an interrupt.
5377 .\" \*(OU next sentence
5378 Note that before \*(UA version 15.0 this terminates the entire
5379 current attachment selection, not only the character set selection.
5382 Without character set conversion support, \*(UA will ask for the input
5383 character set only, and it'll set the
5384 .Ql charset=
5385 MIME parameter value to the given input, if any;
5386 if no user input is seen then the
5387 .Va ttycharset
5388 character set will be used for the parameter value instead.
5389 Note that the file extension check isn't performed in this mode, since
5390 no conversion will take place anyway.
5392 Note that in non-interactive mode, for reproduceabilities sake, there
5393 will always be two questions for each attachment, regardless of whether
5394 character set conversion is available and what the file extension is.
5395 The first asks for the filename, and the second asks for the input
5396 character set to be passed through to the corresponding MIME parameter;
5397 no conversion will be tried if there is input to the latter question,
5398 otherwise the usual conversion algorithm, as above, is applied.
5399 For message attachments, the answer to the second question is completely
5400 ignored.
5402 If (instead)
5403 .Ar filename
5404 arguments are specified for the
5405 .Ic \&\&~@
5406 command they are treated as a file list of
5407 .Xr sh 1 Ns
5408 -style quoted arguments, optionally also separated by commas, which are
5409 expanded and then appended to the existing list of message attachments.
5410 Message attachments can only be added via the first method.
5411 In this mode the (text) attachments are assumed to be in
5412 .Va ttycharset
5413 encoding, and will be evaluated as documented in the section
5414 .Sx "Character sets" .
5417 .It Ic ~A
5418 Inserts the string contained in the
5419 .Va Sign
5420 variable (same as
5421 .Ql Ic ~i Ns \0Sign ) .
5422 The escape sequences tabulator
5423 .Ql \et
5424 and newline
5425 .Ql \en
5426 are understood.
5429 .It Ic ~a
5430 Inserts the string contained in the
5431 .Va sign
5432 variable (same as
5433 .Ql Ic ~i Ns \0sign ) .
5434 The escape sequences tabulator
5435 .Ql \et
5436 and newline
5437 .Ql \en
5438 are understood.
5441 .It Ic ~b Ar name ...
5442 Add the given names to the list of blind carbon copy recipients.
5445 .It Ic ~c Ar name ...
5446 Add the given names to the list of carbon copy recipients.
5449 .It Ic ~d
5450 Read the file specified by the
5451 .Ev DEAD
5452 variable into the message.
5455 .It Ic ~e
5456 Invoke the text editor on the message collected so far.
5457 After the editing session is finished,
5458 the user may continue appending text to the message.
5461 .It Ic ~F Ar messages
5462 Read the named messages into the message being sent, including all
5463 message headers and MIME parts.
5464 If no messages are specified, read in the current message.
5467 .It Ic ~f Ar messages
5468 Read the named messages into the message being sent.
5469 If no messages are specified, read in the current message.
5470 .Ic ignore
5472 .Ic retain
5473 lists are used to modify the message headers.
5474 For MIME multipart messages,
5475 only the first displayable part is included.
5478 .It Ic ~H
5479 Edit the message header fields
5480 .Ql From: ,
5481 .Ql Reply-To:
5483 .Ql Sender:
5484 by typing each one in turn and allowing the user to edit the field.
5485 The default values for these fields originate from the
5486 .Va from , replyto
5488 .Va sender
5489 variables.
5492 .It Ic ~h
5493 Edit the message header fields
5494 .Ql To: ,
5495 .Ql Cc: ,
5496 .Ql Bcc:
5498 .Ql Subject:
5499 by typing each one in turn and allowing the user to edit the field.
5502 .It Ic ~i Ar variable
5503 Insert the value of the specified variable into the message,
5504 adding a newline character at the end.
5505 The message remains unaltered if the variable is unset or empty.
5506 The escape sequences tabulator
5507 .Ql \et
5508 and newline
5509 .Ql \en
5510 are understood.
5513 .It Ic ~M Ar messages
5514 Read the named messages into the message being sent,
5515 indented by
5516 .Va indentprefix .
5517 If no messages are specified, read the current message.
5520 .It Ic ~m Ar messages
5521 Read the named messages into the message being sent,
5522 indented by
5523 .Va indentprefix .
5524 If no messages are specified, read the current message.
5525 .Ic ignore
5527 .Ic retain
5528 lists are used to modify the message headers.
5529 For MIME multipart messages,
5530 only the first displayable part is included.
5533 .It Ic ~p
5534 Display the message collected so far,
5535 prefaced by the message header fields
5536 and followed by the attachment list, if any.
5539 .It Ic ~q
5540 Abort the message being sent,
5541 copying it to the file specified by the
5542 .Ev DEAD
5543 variable if
5544 .Va save
5545 is set.
5548 .It Ic ~R Ar filename
5549 Read the named file into the message, indented by
5550 .Va indentprefix .
5553 .It Ic ~r Ar filename
5554 Read the named file into the message.
5557 .It Ic ~s Ar string
5558 Cause the named string to become the current subject field.
5561 .It Ic ~t Ar name ...
5562 Add the given name(s) to the direct recipient list.
5565 .It Ic ~U Ar messages
5566 Read in the given / current message(s) excluding all headers, indented by
5567 .Va indentprefix .
5570 .It Ic ~u Ar messages
5571 Read in the given / current message(s), excluding all headers.
5574 .It Ic ~v
5575 Invoke an alternate editor (defined by the
5576 .Ev VISUAL
5577 option) on the message collected so far.
5578 Usually, the alternate editor will be a screen editor.
5579 After the editor is quit,
5580 the user may resume appending text to the end of the message.
5583 .It Ic ~w Ar filename
5584 Write the message onto the named file.
5585 If the file exists,
5586 the message is appended to it.
5589 .It Ic ~x
5590 Same as
5591 .Ic ~q ,
5592 except that the message is not saved at all.
5595 .It Ic ~| Ar command
5596 Pipe the message through the specified filter command.
5597 If the command gives no output or terminates abnormally,
5598 retain the original text of the message.
5599 E.g., the command
5600 .Xr fmt 1
5601 is often used as a rejustifying filter.
5603 .\" }}}
5606 .\" .Sh INTERNAL VARIABLES {{{
5607 .Sh "INTERNAL VARIABLES"
5609 Internal \*(UA variables are controlled via the
5610 .Ic set
5612 .Ic unset
5613 commands; prefixing a variable name with the string
5614 .Ql no
5615 and calling
5616 .Ic set
5617 has the same effect as using
5618 .Ic unset :
5619 .Ql unset crt
5621 .Ql set nocrt
5622 do the same thing.
5623 Creation or editing of variables can be performed in the
5624 .Ev EDITOR
5625 with the command
5626 .Ic varedit .
5627 .Ic varshow
5628 will give more insight on the given variable(s), and
5629 .Ic set ,
5630 when called without arguments, will show a listing of all variables.
5631 Some well-known variables will also become inherited from the
5632 program
5633 .Sx ENVIRONMENT
5634 implicitly, others can be explicitly imported with the command
5635 .Ic environ
5636 and henceforth share the said properties.
5639 Two different kind of internal variables exist.
5640 There are boolean variables, which can only be in one of the two states
5641 .Dq set
5643 .Dq unset ,
5644 and value variables with a(n optional) string value.
5645 For the latter proper quoting is necessary upon assignment time, the
5646 introduction of the section
5647 .Sx COMMANDS
5648 documents the supported quoting rules.
5650 .Bd -literal -offset indent
5651 wysh set one=val\e 1 two="val 2" \e
5652     three='val "3"' four=$'val \e'4\e''
5653 varshow one two three four
5654 unset one two three four
5658 Dependent upon the actual option the string values will be interpreted
5659 as numbers, colour names, normal text etc., but there also exists
5660 a special kind of string value, the
5661 .Dq boolean string ,
5662 which must either be a decimal integer (in which case
5663 .Ql 0
5664 is false and
5665 .Ql 1
5666 and any other value is true) or any of the (case-insensitive) strings
5667 .Ql off ,
5668 .Ql no ,
5669 .Ql n
5671 .Ql false
5672 for a false boolean and
5673 .Ql on ,
5674 .Ql yes ,
5675 .Ql y
5677 .Ql true
5678 for a true boolean; a special kind of boolean string is the
5679 .Dq quadoption ,
5680 which is a boolean string that can optionally be prefixed with the
5681 (case-insensitive) term
5682 .Ql ask- ,
5683 as in
5684 .Ql ask-yes ,
5685 which causes prompting of the user in interactive mode, with the given
5686 boolean as the default value.
5688 .\" .Ss "Initial settings" {{{
5689 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
5690 .Ss "Initial Settings"
5692 The standard POSIX 2008/Cor 2-2016 mandates the following initial
5693 variable settings:
5694 .Pf no Va allnet ,
5695 .Pf no Va append ,
5696 .Va asksub ,
5697 .Pf no Va askbcc ,
5698 .Pf no Va autoprint ,
5699 .Pf no Va bang ,
5700 .Pf no Va cmd ,
5701 .Pf no Va crt ,
5702 .Pf no Va debug ,
5703 .Pf no Va dot ,
5704 .Va escape
5705 set to
5706 .Ql ~ ,
5707 .Pf no Va flipr ,
5708 .Pf no Va folder ,
5709 .Va header ,
5710 .Pf no Va hold ,
5711 .Pf no Va ignore ,
5712 .Pf no Va ignoreeof ,
5713 .Pf no Va keep ,
5714 .Pf no Va keepsave ,
5715 .Pf no Va metoo ,
5716 .Pf no Va outfolder ,
5717 .Pf no Va page ,
5718 .Va prompt
5719 set to
5720 .Ql ?\0
5721 (note that \*(UA deviates from the standard by using
5722 .Ql \e&\0 ,
5723 but the
5724 .Ql \e&
5725 special prompt escape results in
5726 .Dq \&?
5727 being shown unless
5728 .Va bsdcompat
5729 is set),
5730 .Pf no Va quiet ,
5731 .Pf no Va record ,
5732 .Va save ,
5733 .Pf no Va sendwait ,
5734 .Pf no Va showto ,
5735 .Pf no Va Sign ,
5736 .Pf no Va sign ,
5737 .Va toplines
5738 set to
5739 .Ql 5 .
5742 Notes: \*(UA doesn't support the
5743 .Pf no Va onehop
5744 variable \(en use command line options or
5745 .Va mta-arguments
5746 to pass options through to a
5747 .Va mta .
5748 And the default global
5749 .Pa \*(UR
5750 file (which is loaded unless the
5751 .Fl n
5752 command line flag has been used or the
5753 .Ev NAIL_NO_SYSTEM_RC
5754 environment variable is set) bends those initial settings a bit, e.g.,
5755 it sets the variables
5756 .Va hold ,
5757 .Va keepsave
5759 .Va keep ,
5760 to name a few, calls
5761 .Ic retain
5762 etc., and should thus be taken into account.
5763 .\" }}}
5765 .\" .Ss "Variables" {{{
5766 .Ss "Variables"
5768 .Bl -tag -width ".It Va _utoprin_"
5770 .It Va add-file-recipients
5771 \*(BO When file or pipe recipients have been specified,
5772 mention them in the corresponding address fields of the message instead
5773 of silently stripping them from their recipient list.
5774 By default such addressees are not mentioned.
5777 .It Va allnet
5778 \*(BO Causes only the local part to be evaluated
5779 when comparing addresses.
5782 .It Va append
5783 \*(BO Causes messages saved in
5784 .Ev MBOX
5785 to be appended to the end rather than prepended.
5786 This should always be set.
5789 .It Va ask
5790 \*(BO Causes \*(UA to prompt for the subject of each message sent.
5791 If the user responds with simply a newline,
5792 no subject field will be sent.
5795 .It Va askatend
5796 \*(BO Causes the prompts for
5797 .Ql Cc:
5799 .Ql Bcc:
5800 lists to appear after the message has been edited.
5803 .It Va askattach
5804 \*(BO If set, \*(UA asks for files to attach at the end of each message,
5805 shall the list be found empty at that time.
5806 An empty line finalizes the list.
5809 .It Va askcc
5810 \*(BO Causes the user to be prompted for carbon copy recipients
5811 (at the end of each message if
5812 .Va askatend
5814 .Va bsdcompat
5815 are set) shall the list be found empty (at that time).
5816 An empty line finalizes the list.
5819 .It Va askbcc
5820 \*(BO Causes the user to be prompted for blind carbon copy
5821 recipients (at the end of each message if
5822 .Va askatend
5824 .Va bsdcompat
5825 are set) shall the list be found empty (at that time).
5826 An empty line finalizes the list.
5829 .It Va asksign
5830 \*(BO\*(OP Causes the user to be prompted if the message is to be
5831 signed at the end of each message.
5833 .Va smime-sign
5834 variable is ignored when this variable is set.
5837 .It Va asksub
5838 \*(BO Alternative name for
5839 .Va ask .
5845 .It Va attachment-ask-content-description , \
5846   attachment-ask-content-disposition , \
5847   attachment-ask-content-id , \
5848   attachment-ask-content-type
5849 \*(BO If set then the user will be prompted for some attachment
5850 information when editing the attachment list.
5851 It is advisable to not use these but for the first of the variables;
5852 even for that it has to be noted that the data is used
5853 .Dq as is .
5857 .It Va attrlist
5858 A sequence of characters to display in the
5859 .Ql attribute
5860 column of the
5861 .Va headline
5862 as shown in the display of
5863 .Ic headers ;
5864 each for one type of messages (see
5865 .Sx "Message states" ) ,
5866 with the default being
5867 .Ql NUROSPMFAT+\-$~
5869 .Ql NU\ \ *HMFAT+\-$~
5870 if the
5871 .Va bsdflags
5872 variable is set, in the following order:
5874 .Bl -tag -compact -offset indent -width ".It Ql _"
5875 .It Ql N
5876 new.
5877 .It Ql U
5878 unread but old.
5879 .It Ql R
5880 new but read.
5881 .It Ql O
5882 read and old.
5883 .It Ql S
5884 saved.
5885 .It Ql P
5886 preserved.
5887 .It Ql M
5888 mboxed.
5889 .It Ql F
5890 flagged.
5891 .It Ql A
5892 answered.
5893 .It Ql T
5894 draft.
5895 .It Ql +
5896 start of a collapsed thread.
5897 .It Ql -
5898 an uncollapsed thread (TODO ignored for now).
5899 .It Ql $
5900 classified as spam.
5901 .It Ql ~
5902 classified as possible spam.
5907 .It Va autobcc
5908 Specifies a list of recipients to which a blind carbon copy of each
5909 outgoing message will be sent automatically.
5912 .It Va autocc
5913 Specifies a list of recipients to which a carbon copy of each outgoing
5914 message will be sent automatically.
5917 .It Va autocollapse
5918 \*(BO Causes threads to be collapsed automatically when threaded mode
5919 is entered (see the
5920 .Ic collapse
5921 command).
5924 .It Va autoprint
5925 \*(BO Causes the delete command to behave like
5926 .Ql dp - ;
5927 thus, after deleting a message the next one will be typed automatically.
5930 .It Va autothread
5931 \*(BO\*(OB Causes threaded mode (see the
5932 .Ic thread
5933 command) to be entered automatically when a folder is opened.
5934 The same as
5935 .Ql autosort=thread .
5938 .It Va autosort
5939 Causes sorted mode (see the
5940 .Ic sort
5941 command) to be entered automatically with the value of this option as
5942 sorting method when a folder is opened, e.g.,
5943 .Ql set autosort=thread .
5946 .It Va bang
5947 \*(BO Enables the substitution of
5948 .Ql \&!
5949 by the contents of the last command line in shell escapes.
5952 .It Va batch-exit-on-error
5953 \*(BO If the batch mode has been enabled via the
5954 .Fl #
5955 command line option, then this variable will be consulted whenever \*(UA
5956 completes one operation (returns to the command prompt); if it is set
5957 then \*(UA will terminate if the last operation generated an error.
5960 .It Va bind-timeout
5961 \*(OP Terminals generate multi-byte sequences for certain forms of
5962 input, for example for function and other special keys.
5963 Some terminals however do not write these multi-byte sequences as
5964 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
5965 This variable specifies the timeout in milliseconds that the MLE (see
5966 .Sx "On terminal control and line editor" )
5967 waits for more bytes to arrive unless it considers a sequence
5968 .Dq complete .
5969 The default is 200.
5972 .It Va bsdannounce
5973 \*(BO Causes automatic display of a header summary after executing a
5974 .Ic file
5975 command, and thus complements the standard variable
5976 .Va header ,
5977 which controls header summary display on program startup.
5978 It is only meaningful if
5979 .Va header
5980 is also set.
5983 .It Va bsdcompat
5984 \*(BO Sets some cosmetical features to traditional BSD style;
5985 has the same affect as setting
5986 .Va askatend
5987 and all other variables prefixed with
5988 .Ql bsd ;
5989 it also changes the meaning of the \*(UA specific
5990 .Ql \e&
5991 .Va prompt
5992 escape sequence and changes behaviour of
5993 .Va emptystart
5994 (which doesn't exist in BSD).
5997 .It Va bsdflags
5998 \*(BO Changes the letters shown in the first column of a header
5999 summary to traditional BSD style.
6002 .It Va bsdheadline
6003 \*(BO Changes the display of columns in a header summary to traditional
6004 BSD style.
6007 .It Va bsdmsgs
6008 \*(BO Changes some informational messages to traditional BSD style.
6011 .It Va bsdorder
6012 \*(BO Causes the
6013 .Ql Subject:
6014 field to appear immediately after the
6015 .Ql To:
6016 field in message headers and with the
6017 .Ic ~h
6018 .Sx "TILDE ESCAPES" .
6021 .It Va charset-7bit
6022 The value that should appear in the
6023 .Ql charset=
6024 parameter of
6025 .Ql Content-Type:
6026 MIME header fields when no character set conversion of the message data
6027 was performed.
6028 This defaults to US-ASCII, and the chosen character set should be
6029 US-ASCII compatible.
6032 .It Va charset-8bit
6033 \*(OP The default 8-bit character set that is used as an implicit last
6034 member of the variable
6035 .Va sendcharsets .
6036 This defaults to UTF-8.
6037 If no character set conversion capabilities are available in \*(UA then
6038 the only supported character set is
6039 .Va ttycharset .
6040 Refer to the section
6041 .Sx "Character sets"
6042 for the complete picture of character set conversion in \*(UA.
6045 .It Va charset-unknown-8bit
6046 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
6047 .Dq upgrade
6048 the content of a mail message by using a character set with the name
6049 .Ql unknown-8bit .
6050 Because of the unclassified nature of this character set \*(UA will not
6051 be capable to convert this character set to any other character set.
6052 If this variable is set any message part which uses the character set
6053 .Ql unknown-8bit
6054 is assumed to really be in the character set given in the value,
6055 otherwise the (final) value of
6056 .Va charset-8bit
6057 is used for this purpose.
6059 This variable will also be taken into account if a MIME type (see
6060 .Sx "The mime.types files" )
6061 of a MIME message part that uses the
6062 .Ql binary
6063 character set is forcefully treated as text.
6066 .It Va cmd
6067 The default value for the
6068 .Ic pipe
6069 command.
6072 .It Va colour-disable
6073 \*(BO\*(OP Forcefully disable usage of colours.
6074 Also see the section
6075 .Sx "Coloured display" .
6078 .It Va colour-pager
6079 \*(BO\*(OP Whether colour shall be used for output that is paged through
6080 .Ev PAGER .
6081 Note that pagers may need special flags, e.g.,
6082 .Xr less 1
6083 requires the option
6084 .Fl \&\&R
6086 .Xr lv 1
6087 the option
6088 .Fl \&\&c
6089 in order to support colours.
6090 Often doing manual adjustments is unnecessary since \*(UA may perform
6091 adjustments dependend on the value of the environment variable
6092 .Ev PAGER
6093 (see there for more).
6096 .It Va crt
6097 In a(n interactive) terminal session, then if this valued option is set
6098 it'll be used as a threshold to determine how many lines the given
6099 output has to span before it will be displayed via the configured
6100 .Ev PAGER ;
6101 Usage of the
6102 .Ev PAGER
6103 can be forced by setting this to the value
6104 .Ql 0 ,
6105 setting it without a value will deduce the current height of the
6106 terminal screen to compute the treshold (see
6107 .Ev LINES ,
6108 .Va screen
6110 .Xr stty 1 ) .
6113 .It Va customhdr
6114 \*(OB A variable counterpart of the
6115 .Ic customhdr
6116 command (see there for documentation), interpreted as a comma-separated
6117 list of custom headers to be injected, to include commas in the header
6118 bodies escape them with reverse solidus, e.g.:
6120 .Dl set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
6123 .It Va datefield
6124 In the summary of
6125 .Ic headers
6126 the message date, if any is to be displayed according to the format of
6127 .Va headline ,
6128 is by default taken from the
6129 .Ql From_
6130 line of the message.
6131 If this variable is set the date as given in the
6132 .Ql Date:
6133 header field is used instead, converted to local time.
6134 To control the display format of the date assign a valid
6135 .Xr strftime 3
6136 format string.
6137 (Note that the
6138 .Ql %n
6139 format should not be used, because \*(UA doesn't take embedded newlines
6140 into account when calculating how many lines fit onto the screen.)
6141 Also see
6142 .Va datefield-markout-older .
6145 .It Va datefield-markout-older
6146 This option, when set in addition to
6147 .Va datefield ,
6148 is used to display
6149 .Dq older
6150 messages (concept is rather comparable to the
6151 .Fl \&\&l
6152 option of the POSIX utility
6153 .Xr ls 1 ) .
6154 The content interpretation is identical to
6155 .Va \&\&datefield .
6158 .It Va debug
6159 \*(BO Enables debug messages and obsoletion warnings, disables the
6160 actual delivery of messages and also implies
6161 .Pf no Va record
6162 as well as
6163 .Pf no Va save .
6166 .It Va disposition-notification-send
6167 \*(BO\*(OP Emit a
6168 .Ql Disposition-Notification-To:
6169 header (RFC 3798) with the message.
6170 This requires the
6171 .Va from
6172 variable to be set.
6173 .\" TODO .It Va disposition-notification-send-HOST
6174 .\"Overrides
6175 .\".Va disposition-notification-send
6176 .\" for SMTP accounts on a specific host.
6177 .\" TODO .It Va disposition-notification-send-USER@HOST
6178 .\"Overrides
6179 .\".Va disposition-notification-send
6180 .\"for a specific account.
6183 .It Va dot
6184 \*(BO When dot is set, a period
6185 .Ql \&.
6186 on a line by itself during message input in (interactive) compose mode
6187 will be treated as end-of-message (in addition to the normal end-of-file
6188 condition).
6190 .Va ignoreeof
6191 is set
6192 .Pf no Va dot
6193 is ignored.
6196 .It Va dotlock-ignore-error
6197 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as system
6198 mailboxes (see the command
6199 .Ic file )
6200 will be protected with so-called dotlock files\(emthe traditional mail
6201 spool file locking method\(emin addition to system file locking.
6202 Because \*(UA ships with a privilege-separated dotlock creation program
6203 that should always be able to create such a dotlock file there is no
6204 good reason to ignore dotlock file creation errors, and thus these are
6205 fatal unless this variable is set.
6208 .It Va editalong
6209 \*(BO If this variable is set then the editor is started automatically
6210 when a message is composed in interactive mode, as if the
6211 .Ic ~e
6212 .Sx "TILDE ESCAPES"
6213 had been specified.
6215 .Va editheaders
6216 variable is implied for this automatically spawned editor session.
6219 .It Va editheaders
6220 \*(BO When a message is edited while being composed,
6221 its header is included in the editable text.
6223 .Ql To: ,
6224 .Ql Cc: ,
6225 .Ql Bcc: ,
6226 .Ql Subject: ,
6227 .Ql From: ,
6228 .Ql Reply-To:
6230 .Ql Sender:
6231 fields are accepted within the header, other fields are ignored.
6234 .It Va emptystart
6235 \*(BO When entering interactive mode \*(UA normally writes
6236 .Dq \&No mail for user
6237 and exits immediately if a mailbox is empty or doesn't exist.
6238 If this option is set \*(UA starts even with an empty or nonexistent
6239 mailbox (the latter behaviour furtherly depends upon
6240 .Va bsdcompat ,
6241 though).
6244 .It Va encoding
6245 Suggestion for the MIME encoding to use in outgoing text messages
6246 and message parts.
6247 Valid values are the default
6248 .Ql quoted-printable ,
6249 .Ql 8bit
6251 .Ql base64 .
6252 .Ql 8bit
6253 may cause problems when transferring mail messages over channels that
6254 are not ESMTP (RFC 1869) compliant.
6255 If there is no need to encode a message,
6256 .Ql 7bit
6257 transfer mode is always used regardless of this variable.
6258 Binary data is always encoded as
6259 .Ql base64 .
6262 .It Va escape
6263 If defined, the first character of this option
6264 gives the character to use in place of
6265 .Ql ~
6266 to denote
6267 .Sx "TILDE ESCAPES" .
6270 .It Va expandaddr
6271 If not set then file and command pipeline targets are not allowed,
6272 and any such address will be filtered out, giving a warning message.
6273 If set without a value then all possible recipient address
6274 specifications will be accepted \(en see the section
6275 .Sx "On sending mail, and non-interactive mode"
6276 for more on this.
6277 To accept them, but only in interactive mode, or when tilde commands
6278 were enabled explicitly by using one of the command line options
6279 .Fl ~
6281 .Fl # ,
6282 set this to the (case-insensitive) value
6283 .Ql restrict
6284 (note right now this is actually like setting
6285 .Ql restrict,-all,+name,+addr ) .
6287 In fact the value is interpreted as a comma-separated list of values.
6288 If it contains
6289 .Ql fail
6290 then the existence of disallowed specifications is treated as a hard
6291 send error instead of only filtering them out.
6292 The remaining values specify whether a specific type of recipient
6293 address specification is allowed (optionally indicated by a plus sign
6294 .Ql +
6295 prefix) or disallowed (prefixed with a hyphen
6296 .Ql - ) .
6297 The value
6298 .Ql all
6299 addresses all possible address specifications,
6300 .Ql file
6301 file targets,
6302 .Ql pipe
6303 command pipeline targets,
6304 .Ql name
6305 plain user names and (MTA) aliases (\*(OB
6306 .Ql noalias
6307 may be used as an alternative syntax to
6308 .Ql -name )
6310 .Ql addr
6311 network addresses.
6312 These kind of values are interpreted in the given order, so that
6313 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
6314 will cause hard errors for any non-network address recipient address
6315 unless \*(UA is in interactive mode or has been started with the
6316 .Fl ~
6318 .Fl #
6319 command line option; in the latter case(s) any address may be used, then.
6322 .It Va expandargv
6323 Unless this variable is set additional
6324 .Va mta
6325 (Mail-Transfer-Agent)
6326 arguments from the command line, as can be given after a
6327 .Fl \&\&-
6328 separator, are ignored due to safety reasons.
6329 However, if set to the special (case-insensitive) value
6330 .Ql fail ,
6331 then the presence of additional MTA arguments is treated as a hard
6332 error that causes \*(UA to exit with failure status.
6333 A lesser strict variant is the otherwise identical
6334 .Ql restrict ,
6335 which does accept such arguments in interactive mode, or if tilde
6336 commands were enabled explicitly by using one of the command line options
6337 .Fl ~
6339 .Fl # .
6342 .It Va features
6343 \*(RO String giving a list of features \*(UA, preceded with a plus-sign
6344 .Ql +
6345 if the feature is available, and a minus-sign
6346 .Ql -
6347 otherwise.
6348 The output of the command
6349 .Ic version
6350 will include this information.
6353 .It Va flipr
6354 \*(BO This option reverses the meanings of a set of reply commands,
6355 turning the lowercase variants, which by default address all recipients
6356 included in the header of a message
6357 .Pf ( Ic reply , respond , followup )
6358 into the uppercase variants, which by default address the sender only
6359 .Pf ( Ic Reply , Respond , Followup )
6360 and vice versa.
6361 The commands
6362 .Ic replysender , respondsender , followupsender
6363 as well as
6364 .Ic replyall , respondall , followupall
6365 are not affected by the current setting of
6366 .Va flipr .
6370 .It Va file-hook-load-EXTENSION , file-hook-save-EXTENSION
6371 It is possible to install file hooks which will be used by the
6372 .Ic file
6373 command in order to be able to transparently handle (through an
6374 intermediate temporary file) files with specific
6375 .Ql EXTENSION Ns
6376 s: the variable values can include shell snippets and are expected to
6377 write data to standard output / read data from standard input,
6378 respectively.
6379 \*(ID The variables may not be changed while there is a mailbox
6380 attendant.
6381 .Bd -literal -offset indent
6382 set file-hook-load-xy='echo >&2 XY-LOAD; gzip -cd' \e
6383     file-hook-save-xy='echo >&2 XY-SAVE; gzip -c' \e
6384     record=+null-sent.xy
6388 .It Va folder
6389 The default path under which mailboxes are to be saved:
6390 file names that begin with the plus-sign
6391 .Ql +
6392 will be expanded by prefixing them with the value of this variable.
6393 The same special syntax conventions as documented for the
6394 .Ic file
6395 command may be used; if the non-empty value doesn't start with a solidus
6396 .Ql / ,
6397 then the value of
6398 .Ev HOME
6399 will be prefixed automatically.
6400 If unset or the empty string any
6401 .Ql +
6402 prefixing file names will remain unexpanded.
6405 .It Va folder-hook
6406 This variable can be set to the name of a
6407 .Ic define Ns d
6408 macro which will be called whenever a
6409 .Ic file
6410 is opened.
6411 The macro will also be invoked when new mail arrives,
6412 but message lists for commands executed from the macro
6413 only include newly arrived messages then.
6414 .Ic localopts
6415 are activated by default in a folder hook, causing the covered settings
6416 to be reverted once the folder is left again.
6418 .Sy \*(ID:
6419 Macro behaviour, including option localization, will change in v15.
6420 Please be aware of that and possibly embed a version check in a resource
6421 file of yours.
6424 .It Va folder-hook-FOLDER
6425 Overrides
6426 .Va folder-hook
6427 for a folder named
6428 .Ql FOLDER .
6429 Unlike other folder specifications, the fully expanded name of a folder,
6430 without metacharacters, is used to avoid ambiguities.
6431 However, if the mailbox resides under
6432 .Va folder
6433 then the usual
6434 .Ql +
6435 specification is tried in addition, e.g., if
6436 .Va \&\&folder
6438 .Dq mail
6439 (and thus relative to the user's home directory) then
6440 .Pa /home/usr1/mail/sent
6441 will be tried as
6442 .Ql folder-hook-/home/usr1/mail/sent
6443 first, but then followed by
6444 .Ql folder-hook-+sent .
6447 .It Va followup-to
6448 \*(BO Controls whether a
6449 .Ql Mail-Followup-To:
6450 header is generated when sending messages to known mailing lists.
6451 Also see
6452 .Va followup-to-honour
6453 and the commands
6454 .Ic mlist , mlsubscribe , reply
6456 .Ic Lreply .
6459 .It Va followup-to-honour
6460 Controls whether a
6461 .Ql Mail-Followup-To:
6462 header is honoured when group-replying to a message via
6463 .Ic reply
6465 .Ic Lreply .
6466 This is a quadoption; if set without a value it defaults to
6467 .Dq yes .
6468 Also see
6469 .Va followup-to
6470 and the commands
6471 .Ic mlist
6473 .Ic mlsubscribe .
6476 .It Va forward-as-attachment
6477 \*(BO Original messages are normally sent as inline text with the
6478 .Ic forward
6479 command,
6480 and only the first part of a multipart message is included.
6481 With this option messages are sent as unmodified MIME
6482 .Ql message/rfc822
6483 attachments with all of their parts included.
6486 .It Va from
6487 The address (or a list of addresses) to put into the
6488 .Ql From:
6489 field of the message header, quoting RFC 5322:
6490 the author(s) of the message, that is, the mailbox(es) of the person(s)
6491 or system(s) responsible for the writing of the message.
6492 When
6493 .Ic reply Ns
6494 ing to messages these addresses are handled as if they were in the
6495 .Ic alternates
6496 list.
6498 If the machine's hostname is not valid at the Internet (for example at
6499 a dialup machine) then either this variable or
6500 .Va hostname
6501 (\*(IN and with a defined SMTP protocol in
6502 .Va mta
6503 .Va smtp-hostname
6504 adds even more fine-tuning capabilities),
6505 have to be set.
6507 .Va \&\&from
6508 contains more than one address,
6509 setting the
6510 .Va sender
6511 variable is required (according to the standard RFC 5322).
6514 .It Va fullnames
6515 \*(BO When replying to or forwarding a message \*(UA normally removes
6516 the comment and name parts of email addresses.
6517 If this variable is set such stripping is not performed,
6518 and comments, names etc. are retained.
6521 .It Va fwdheading
6522 The string to put before the text of a message with the
6523 .Ic forward
6524 command
6525 (unless the
6526 .Va forward-as-attachment
6527 variable is set).
6528 Defaults to
6529 .Dq -------- Original Message --------
6530 if unset; No heading is put if it is set to the empty string.
6533 .It Va header
6534 \*(BO Causes the header summary to be written at startup and after
6535 commands that affect the number of messages or the order of messages in
6536 the current folder; enabled by default.
6537 The command line option
6538 .Fl N
6539 can be used to set
6540 .Pf no Va header .
6541 The variable
6542 .Va bsdannounce
6543 complements this and controls header summary display on folder changes.
6547 .It Va headline
6548 A format string to use for the summary of
6549 .Ic headers ,
6550 similar to the ones used for
6551 .Xr printf 3
6552 formats.
6553 Format specifiers in the given string start with a percent character
6554 .Ql %
6555 and may be followed by an optional decimal number indicating the field
6556 width \(em if that is negative, the field is to be left-aligned.
6557 Valid format specifiers are:
6560 .Bl -tag -compact -offset indent -width "_%%_"
6561 .It Ql %%
6562 A plain percent character.
6563 .It Ql %>
6564 .Dq Dotmark :
6565 a space character but for the current message
6566 .Pf ( Dq dot ) ,
6567 for which it expands to
6568 .Ql > .
6569 .It Ql %<
6570 .Dq Dotmark :
6571 a space character but for the current message
6572 .Pf ( Dq dot ) ,
6573 for which it expands to
6574 .Ql < .
6575 .It Ql %$
6576 \*(OP The spam score of the message, as has been classified via the
6577 command
6578 .Ic spamrate .
6579 Shows only a replacement character if there is no spam support.
6580 .It Ql %a
6581 Message attribute character (status flag); the actual content can be
6582 adjusted by setting
6583 .Va attrlist .
6584 .It Ql %d
6585 The date when the message was received, or the date found in the
6586 .Ql From:
6587 header when the
6588 .Va datefield
6589 variable is set (optionally to a date display format string).
6590 .It Ql %e
6591 The indenting level in threaded mode.
6592 .It Ql %f
6593 The address of the message sender.
6594 .It Ql %i
6595 The message thread tree structure.
6596 (Note that this format doesn't support a field width.)
6597 .It Ql %l
6598 The number of lines of the message, if available.
6599 .It Ql %m
6600 Message number.
6601 .It Ql %o
6602 The number of octets (bytes) in the message, if available.
6603 .It Ql %s
6604 Message subject (if any).
6605 .It Ql %S
6606 Message subject (if any) in double quotes.
6607 .It Ql \&%T
6608 Message recipient flags: is the addressee of the message a known or
6609 subscribed mailing list \(en see
6610 .Ic mlist
6612 .Ic mlsubscribe .
6613 .It Ql %t
6614 The position in threaded/sorted order.
6617 The default is
6618 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
6620 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
6622 .Va bsdcompat
6623 is set.
6624 Also see
6625 .Va attrlist
6627 .Va headline-bidi .
6631 .It Va headline-bidi
6632 Bidirectional text requires special treatment when displaying headers,
6633 because numbers (in dates or for file sizes etc.) will not affect the
6634 current text direction, in effect resulting in ugly line layouts when
6635 arabic or other right-to-left text is to be displayed.
6636 On the other hand only a minority of terminals is capable to correctly
6637 handle direction changes, so that user interaction is necessary for
6638 acceptable results.
6639 Note that extended host system support is required nonetheless, e.g.,
6640 detection of the terminal character set is one precondition;
6641 and this feature only works in an Unicode (i.e., UTF-8) locale.
6643 In general setting this variable will cause \*(UA to encapsulate text
6644 fields that may occur when displaying
6645 .Va headline
6646 (and some other fields, like dynamic expansions in
6647 .Va prompt )
6648 with special Unicode control sequences;
6649 it is possible to fine-tune the terminal support level by assigning
6650 a value:
6651 no value (or any value other than
6652 .Ql 1 ,
6653 .Ql 2
6655 .Ql 3 )
6656 will make \*(UA assume that the terminal is capable to properly deal
6657 with Unicode version 6.3, in which case text is embedded in a pair of
6658 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
6659 characters.
6660 In addition no space on the line is reserved for these characters.
6662 Weaker support is chosen by using the value
6663 .Ql 1
6664 (Unicode 6.3, but reserve the room of two spaces for writing the control
6665 sequences onto the line).
6666 The values
6667 .Ql 2
6669 .Ql 3
6670 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
6671 again reserves room for two spaces in addition.
6674 .It Va history-file
6675 \*(OP If a line editor is available then this can be set to
6676 name the (expandable) path of the location of a permanent history file.
6679 .It Va history-gabby
6680 \*(BO\*(OP Add more entries to the history as is normally done.
6683 .It Va history-gabby-persist
6684 \*(BO\*(OP \*(UA's own MLE will not save the additional
6685 .Va history-gabby
6686 entries in persistent storage unless this variable is set.
6687 On the other hand it will not loose the knowledge of whether
6688 a persistent entry was gabby or not.
6689 Also see
6690 .Va history-file .
6693 .It Va history-size
6694 \*(OP If a line editor is available this value restricts the
6695 amount of history entries that are saved into a set and valid
6696 .Va history-file .
6697 A value of less than 0 disables this feature;
6698 note that loading and incorporation of
6699 .Va history-file
6700 upon program startup can also be suppressed by doing this.
6701 If unset or 0, a default value will be used.
6702 Dependent on the available line editor this will also define the
6703 number of history entries in memory;
6704 it is also editor-specific whether runtime updates of this value will
6705 be honoured.
6708 .It Va hold
6709 \*(BO This option is used to hold messages in the system
6710 .Va inbox ,
6711 and it is set by default.
6714 .It Va hostname
6715 Use this string as hostname when expanding local addresses instead of
6716 the value obtained from
6717 .Xr uname 3
6719 .Xr getaddrinfo 3 ,
6720 i.e., in
6721 .Ql Message-ID:
6723 .Ql From:
6724 fields.
6725 Note that when SMTP transport is not used (via
6726 .Va mta ) ,
6727 then it is normally the responsibility of the MTA to create these
6728 fields, \*(IN in conjunction with SMTP however
6729 .Va smtp-hostname
6730 also influences the results:
6731 you should produce some test messages with the desired combination of
6732 .Va \&\&hostname ,
6733 and/or
6734 .Va from ,
6735 .Va sender
6736 etc. first.
6739 .It Va idna-disable
6740 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
6741 names according to the rules of IDNA (internationalized domain names
6742 for applications).
6743 Since the IDNA code assumes that domain names are specified with the
6744 .Va ttycharset
6745 character set, an UTF-8 locale charset is required to represent all
6746 possible international domain names (before conversion, that is).
6749 .It Va ignore
6750 \*(BO Ignore interrupt signals from the terminal while entering
6751 messages; instead echo them as
6752 .Ql @
6753 characters and discard the current line.
6756 .It Va ignoreeof
6757 \*(BO Ignore end-of-file conditions
6758 .Pf ( Ql control-D )
6759 in compose mode on message input and in interactive command input.
6760 If set an interactive command input session can only be left by
6761 explicitly using one of the commands
6762 .Ic exit
6764 .Ic quit ,
6765 and message input in compose mode can only be terminated by entering
6766 a period
6767 .Ql \&.
6768 on a line by itself or by using the
6769 .Ic ~.
6770 .Sx "TILDE ESCAPES" ;
6771 .Va ignoreeof
6772 overrides a setting of
6773 .Pf no Va dot .
6776 .It Va inbox
6777 If this is set to a non-empty string it will be used for expansions of
6778 .Ql % ,
6780 .Ic file
6781 for more.
6782 The value supports a subset of filename expansions itself.
6785 .It Va indentprefix
6786 String used by the
6787 .Ic ~m , ~M
6789 .Ic ~R
6790 .Sx "TILDE ESCAPES"
6791 and by the
6792 .Va quote
6793 option for indenting messages,
6794 in place of the normal tabulator character
6795 .Ql ^I ,
6796 which is the default.
6797 Be sure to quote the value if it contains spaces or tabs.
6800 .It Va keep
6801 \*(BO If set, an empty mailbox file is not removed.
6802 This may improve the interoperability with other mail user agents
6803 when using a common folder directory, and prevents malicious users
6804 from creating fake mailboxes in a world-writable spool directory.
6805 Note this only applies to local regular (MBOX) files, other mailbox
6806 types will never be removed.
6809 .It Va keep-content-length
6810 \*(BO When (editing messages and) writing
6811 .Ev MBOX
6812 mailbox files \*(UA can be told to keep the
6813 .Ql Content-Length:
6815 .Ql Lines:
6816 header fields that some MUAs generate by setting this variable.
6817 Since \*(UA does neither use nor update these non-standardized header
6818 fields (which in itself shows one of their conceptual problems),
6819 stripping them should increase interoperability in between MUAs that
6820 work with with same mailbox files.
6821 Note that, if this is not set but
6822 .Va writebackedited ,
6823 as below, is, a possibly performed automatic stripping of these header
6824 fields already marks the message as being modified.
6827 .It Va keepsave
6828 \*(BO When a message is saved it is usually discarded from the
6829 originating folder when \*(UA is quit.
6830 Setting this option causes all saved message to be retained.
6833 .It Va line-editor-disable
6834 \*(BO Turn off any enhanced line editing capabilities (see
6835 .Sx "On terminal control and line editor"
6836 for more).
6839 .It Va line-editor-no-defaults
6840 \*(BO\*(OP Do not establish any default key binding.
6843 .It Va markanswered
6844 \*(BO When a message is replied to and this variable is set,
6845 it is marked as having been answered.
6846 This mark has no technical meaning in the mail system;
6847 it just causes messages to be marked in the header summary,
6848 and makes them specially addressable.
6851 .It Va memdebug
6852 \*(BO Internal development variable.
6855 .It Va message-id-disable
6856 \*(BO By setting this option the generation of
6857 .Ql Message-ID:
6858 can be completely suppressed, effectively leaving this task up to the
6859 .Va mta
6860 (Mail-Transfer-Agent) or the SMTP server.
6861 (According to RFC 5321 your SMTP server is not required to add this
6862 field by itself, so you should ensure that it accepts messages without a
6863 .Ql Message-ID . )
6866 .It Va message-inject-head
6867 A string to put at the beginning of each new message.
6868 The escape sequences tabulator
6869 .Ql \et
6870 and newline
6871 .Ql \en
6872 are understood.
6875 .It Va message-inject-tail
6876 A string to put at the end of each new message.
6877 The escape sequences tabulator
6878 .Ql \et
6879 and newline
6880 .Ql \en
6881 are understood.
6884 .It Va metoo
6885 \*(BO Usually, when an
6886 .Ic alias
6887 expansion contains the sender, the sender is removed from the expansion.
6888 Setting this option suppresses these removals.
6889 Note that a set
6890 .Va metoo
6891 also causes a
6892 .Ql -m
6893 option to be passed through to the
6894 .Va mta
6895 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
6896 this flag, no MTA is known which doesn't support it (for historical
6897 compatibility).
6900 .It Va mime-allow-text-controls
6901 \*(BO When sending messages, each part of the message is MIME-inspected
6902 in order to classify the
6903 .Ql Content-Type:
6905 .Ql Content-Transfer-Encoding:
6906 (see
6907 .Va encoding )
6908 that is required to send this part over mail transport, i.e.,
6909 a computation rather similar to what the
6910 .Xr file 1
6911 command produces when used with the
6912 .Ql --mime
6913 option.
6915 This classification however treats text files which are encoded in
6916 UTF-16 (seen for HTML files) and similar character sets as binary
6917 octet-streams, forcefully changing any
6918 .Ql text/plain
6920 .Ql text/html
6921 specification to
6922 .Ql application/octet-stream :
6923 If that actually happens a yet unset charset MIME parameter is set to
6924 .Ql binary ,
6925 effectively making it impossible for the receiving MUA to automatically
6926 interpret the contents of the part.
6928 If this option is set, and the data was unambiguously identified as text
6929 data at first glance (by a
6930 .Ql .txt
6932 .Ql .html
6933 file extension), then the original
6934 .Ql Content-Type:
6935 will not be overwritten.
6938 .It Va mime-alternative-favour-rich
6939 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
6940 HTML) will be preferred in favour of included plain text versions when
6941 displaying messages, provided that a handler exists which produces
6942 output that can be (re)integrated into \*(UA's normal visual display.
6943 (E.g., at the time of this writing some newsletters ship their full
6944 content only in the rich HTML part, whereas the plain text part only
6945 contains topic subjects.)
6948 .It Va mime-counter-evidence
6949 Normally the
6950 .Ql Content-Type:
6951 field is used to decide how to handle MIME parts.
6952 Some MUAs however don't use
6953 .Xr mime.types 5
6954 or a similar mechanism to correctly classify content, but simply specify
6955 .Ql application/octet-stream ,
6956 even for plain text attachments like
6957 .Ql text/diff .
6958 If this variable is set then \*(UA will try to classify such MIME
6959 message parts on its own, if possible, for example via a possibly
6960 existent attachment filename.
6961 A non-empty value may also be given, in which case a number is expected,
6962 actually a carrier of bits.
6963 Creating the bit-carrying number is a simple addition:
6964 .Bd -literal -offset indent
6965 ? !echo Value should be set to $((2 + 4 + 8))
6966 Value should be set to 14
6969 .Bl -bullet -compact
6971 If bit two is set (2) then the detected
6972 .Dq real
6973 content-type will be carried along with the message and be used for
6974 deciding which
6975 .Va pipe-TYPE/SUBTYPE
6976 is responsible for the MIME part, shall that question arise;
6977 when displaying such a MIME part the part-info will indicate the
6978 overridden content-type by showing a plus-sign
6979 .Ql + .
6981 If bit three is set (4) then the counter-evidence is always produced
6982 and a positive result will be used as the MIME type, even forcefully
6983 overriding the parts given MIME type.
6985 If bit four is set (8) then as a last resort the actual content of
6986 .Ql application/octet-stream
6987 parts will be inspected, so that data which looks like plain text can be
6988 treated as such.
6992 .It Va mimetypes-load-control
6993 This option can be used to control which of the
6994 .Xr mime.types 5
6995 databases are loaded by \*(UA, as furtherly described in the section
6996 .Sx "The mime.types files" .
6997 If the letter
6998 .Ql u
6999 is part of the option value, then the user's personal
7000 .Pa ~/.mime.types
7001 file will be loaded (if it exists); likewise the letter
7002 .Ql s
7003 controls loading of the system wide
7004 .Pa /etc/mime.types ;
7005 directives found in the user file take precedence, letter matching is
7006 case-insensitive.
7007 If this option is not set \*(UA will try to load both files.
7008 Incorporation of the \*(UA-builtin MIME types cannot be suppressed,
7009 but they will be matched last.
7011 More sources can be specified by using a different syntax: if the
7012 value string contains an equals sign
7013 .Ql =
7014 then it is instead parsed as a comma-separated list of the described
7015 letters plus
7016 .Ql f=FILENAME
7017 pairs; the given filenames will be expanded and loaded, and their
7018 content may use the extended syntax that is described in the section
7019 .Sx "The mime.types files" .
7020 Directives found in such files always take precedence (are prepended to
7021 the MIME type cache).
7025 .It Va mta
7026 To choose an alternate Mail-Transfer-Agent, set this option to either
7027 the full pathname of an executable (optionally prefixed with a
7028 .Ql file://
7029 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
7031 .Dl smtps?://[user[:password]@]server[:port]
7033 (\*(OU:
7034 .Ql [smtp://]server[:port] . )
7035 The default has been chosen at compie time.
7036 All supported data transfers are executed in child processes, which
7037 run asynchronously, and without supervision, unless either the
7038 .Va sendwait
7039 or the
7040 .Va verbose
7041 variable is set.
7042 If such a child receives a TERM signal, it will abort and
7043 .Va save
7044 the message to
7045 .Ev DEAD ,
7046 if so configured.
7049 For a file-based MTA it may be necessary to set
7050 .Va mta-argv0
7051 in in order to choose the right target of a modern
7052 .Xr mailwrapper 8
7053 environment.
7054 It will be passed command line arguments from several possible sources:
7055 from the variable
7056 .Va mta-arguments
7057 if set, from the command line if given and the variable
7058 .Va expandargv
7059 allows their use.
7060 Argument processing of the MTA will be terminated with a
7061 .Fl \&\&-
7062 separator.
7065 The otherwise occurring implicit usage of the following MTA command
7066 line arguments can be disabled by setting the boolean option
7067 .Va mta-no-default-arguments
7068 (which will also disable passing
7069 .Fl \&\&-
7070 to the MTA):
7071 .Fl \&\&i
7072 (for not treating a line with only a dot
7073 .Ql \&.
7074 character as the end of input),
7075 .Fl \&\&m
7076 (shall the option
7077 .Va metoo
7078 be set) and
7079 .Fl \&\&v
7080 (if the
7081 .Va verbose
7082 option is set); in conjunction with the
7083 .Fl r
7084 command line option \*(UA will also pass
7085 .Fl \&\&f
7086 as well as possibly
7087 .Fl \&\&F .
7090 \*(OP \*(UA can send mail over SMTP network connections to a single
7091 defined SMTP smarthost, the access URL of which has to be assigned to
7092 .Va mta .
7093 To use this mode it is helpful to read
7094 .Sx "On URL syntax and credential lookup" .
7095 It may be necessary to set the
7096 .Va smtp-hostname
7097 variable in order to use a specific combination of
7098 .Va from ,
7099 .Va hostname
7101 .Va mta
7102 with some mail providers.
7105 .Bl -bullet -compact
7107 The plain SMTP protocol (RFC 5321) that normally lives on the
7108 server port 25 and requires setting the
7109 .Va smtp-use-starttls
7110 variable to enter a SSL/TLS encrypted session state.
7111 Assign a value like \*(IN
7112 .Ql smtp://[user[:password]@]server[:port]
7113 (\*(OU
7114 .Ql smtp://server[:port] )
7115 to choose this protocol.
7117 The so-called SMTPS which is supposed to live on server port 465
7118 and is automatically SSL/TLS secured.
7119 Unfortunately it never became a standardized protocol and may thus not
7120 be supported by your hosts network service database
7121 \(en in fact the port number has already been reassigned to other
7122 protocols!
7124 SMTPS is nonetheless a commonly offered protocol and thus can be
7125 chosen by assigning a value like \*(IN
7126 .Ql smtps://[user[:password]@]server[:port]
7127 (\*(OU
7128 .Ql smtps://server[:port] ) ;
7129 due to the mentioned problems it is usually necessary to explicitly
7130 specify the port as
7131 .Ql :465 ,
7132 however.
7134 Finally there is the SUBMISSION protocol (RFC 6409), which usually
7135 lives on server port 587 and is practically identically to the SMTP
7136 protocol from \*(UA's point of view beside that; it requires setting the
7137 .Va smtp-use-starttls
7138 variable to enter a SSL/TLS secured session state.
7139 Assign a value like \*(IN
7140 .Ql submission://[user[:password]@]server[:port]
7141 (\*(OU
7142 .Ql submission://server[:port] ) .
7147 .It Va mta-arguments
7148 Arguments to pass through to a file-based
7149 .Va mta
7150 can be given via this variable, the content of which will be split up in
7151 a vector of arguments, to be joined onto other possible MTA options:
7153 .Dl set mta-arguments='-t -X \&"/tmp/my log\&"'
7156 .It Va mta-no-default-arguments
7157 \*(BO Unless this option is set \*(UA will pass some well known
7158 standard command line options to a file-based
7159 .Va mta
7160 (Mail-Transfer-Agent), see there for more.
7163 .It Va mta-argv0
7164 Many systems use a so-called
7165 .Xr mailwrapper 8
7166 environment to ensure compatibility with
7167 .Xr sendmail 1 .
7168 This works by inspecting the name that was used to invoke the mail
7169 delivery system.
7170 If this variable is set then the mailwrapper (the program that is
7171 actually executed when calling the file-based
7172 .Va mta )
7173 will treat its contents as that name.
7174 The default is
7175 .Ql sendmail .
7178 .It Va NAIL_EXTRA_RC
7179 The name of an optional startup file to be read last.
7180 This variable has an effect only if it is set in any of the
7181 .Sx "Resource files" ,
7182 it is not imported from the environment.
7183 Use this file for commands that are not understood by other POSIX
7184 .Xr mailx 1
7185 implementations.
7187 .Mx Va netrc-lookup
7188 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
7189 \*(BO\*(IN\*(OP Used to control usage of the users
7190 .Pa .netrc
7191 file for lookup of account credentials, as documented in the section
7192 .Sx "On URL syntax and credential lookup"
7193 and for the command
7194 .Ic netrc ;
7195 the section
7196 .Sx "The .netrc file"
7197 documents the file format.
7198 Also see
7199 .Va netrc-pipe .
7202 .It Va netrc-pipe
7203 \*(IN\*(OP When
7204 .Pa .netrc
7205 is loaded (see
7206 .Ic netrc
7208 .Va netrc-lookup )
7209 then \*(UA will read the output of a shell pipe instead of the users
7210 .Pa .netrc
7211 file if this variable is set (to the desired shell command).
7212 This can be used to, e.g., store
7213 .Pa .netrc
7214 in encrypted form:
7216 .Dl set netrc-pipe='gpg -qd ~/.netrc.pgp'
7219 .It Va newfolders
7220 If this variable has the value
7221 .Ql maildir ,
7222 newly created local folders will be in Maildir format.
7225 .It Va newmail
7226 Checks for new mail in the current folder each time the prompt is shown.
7227 A Maildir folder must be re-scanned to determine if new mail has arrived.
7228 If this variable is set to the special value
7229 .Ql nopoll
7230 then a Maildir folder will not be rescanned completely, but only
7231 timestamp changes are detected.
7235 .It Va on-compose-enter , on-compose-leave
7236 \*(ID Macro hooks which will be executed before compose mode is
7237 entered, and after composing has been finished, respectively.
7238 Please note that this interface is very likely to change in v15, and
7239 should therefore possibly even be seen as experimental.
7240 .Ic localopts
7241 are by default enabled for these hooks, causing any setting to be
7242 forgotten after the message has been sent.
7243 The following variables will be set temporarily during execution of the
7244 macros.
7246 .Bl -tag -compact -width ".It Va compose_subject"
7247 .It Va compose-from
7248 .Va from .
7249 .It Va compose-sender
7250 .Va sender .
7251 .It Va compose-to , compose-cc , compose-bcc
7252 The list of receiver addresses as a space-separated list.
7253 .It Va compose-subject
7254 The subject.
7258 .It Va outfolder
7259 \*(BO Causes the filename given in the
7260 .Va record
7261 variable
7262 and the sender-based filenames for the
7263 .Ic Copy
7265 .Ic Save
7266 commands to be interpreted relative to the directory given in the
7267 .Va folder
7268 variable rather than to the current directory,
7269 unless it is set to an absolute pathname.
7272 .It Va page
7273 \*(BO If set, each message feed through the command given for
7274 .Ic pipe
7275 is followed by a formfeed character
7276 .Ql \ef .
7278 .Mx Va password
7279 .It Va password-USER@HOST , password-HOST , password
7280 \*(IN Variable chain that sets a password, which is used in case none has
7281 been given in the protocol and account-specific URL;
7282 as a last resort \*(UA will ask for a password on the user's terminal if
7283 the authentication method requires a password.
7284 Specifying passwords in a startup file is generally a security risk;
7285 the file should be readable by the invoking user only.
7287 .It Va password-USER@HOST
7288 \*(OU (see the chain above for \*(IN)
7289 Set the password for
7290 .Ql USER
7291 when connecting to
7292 .Ql HOST .
7293 If no such variable is defined for a host,
7294 the user will be asked for a password on standard input.
7295 Specifying passwords in a startup file is generally a security risk;
7296 the file should be readable by the invoking user only.
7299 .It Va piperaw
7300 \*(BO Send messages to the
7301 .Ic pipe
7302 command without performing MIME and character set conversions.
7306 .It Va pipe-TYPE/SUBTYPE
7307 When a MIME message part of type
7308 .Ql TYPE/SUBTYPE
7309 (case-insensitive) is displayed or quoted,
7310 its text is filtered through the value of this variable interpreted as
7311 a shell command.
7312 The special value
7313 .Ql @
7314 forces interpretation of the message part as plain text, e.g.,
7315 .Ql set pipe-application/xml=@
7316 will henceforth display XML
7317 .Dq as is .
7318 (The same could also be achieved by adding a MIME type marker with the
7319 .Ic mimetype
7320 command.
7321 And \*(OPally MIME type handlers may be defined via
7322 .Sx "The Mailcap files"
7323 \(em corresponding flag strings are shown in parenthesis below.)
7326 The special value
7327 .Ql @
7328 can in fact be used to adjust usage and behaviour of a following shell
7329 command specification by appending trigger characters to it, e.g., the
7330 following hypothetical command specification could be used:
7331 .Bd -literal -offset indent
7332 set pipe-X/Y='@*!++=@vim ${NAIL_FILENAME_TEMPORARY}'
7336 .Bl -tag -compact -width ".It Ql __"
7337 .It Ql *
7338 Simply by using the special
7339 .Ql @
7340 prefix the MIME type (shell command) handler will only be invoked to
7341 display or convert the MIME part if the message is addressed directly
7342 and alone by itself.
7343 Use this trigger to disable this and always invoke the handler
7344 .Pf ( Cd x-mailx-always ) .
7346 .It Ql #
7347 If set the handler will not be invoked when a message is to be quoted,
7348 but only when it will be displayed
7349 .Pf ( Cd x-mailx-noquote ) .
7351 .It Ql &
7352 The command will be run asynchronously, i.e., without blocking \*(UA,
7353 which may be a handy way to display a, e.g., PDF file while also
7354 continuing to read the mail message
7355 .Pf ( Cd x-mailx-async ) .
7356 Asynchronous execution implies
7357 .Ql # .
7359 .It Ql \&!
7360 The command must be run on an interactive terminal, \*(UA will
7361 temporarily release the terminal to it
7362 .Pf ( Cd needsterminal ) .
7363 This flag is mutual exclusive with
7364 .Ql & ,
7365 will only be used in interactive mode and implies
7366 .Ql # .
7368 .It Ql +
7369 Request creation of a zero-sized temporary file, the absolute pathname
7370 of which will be made accessible via the environment variable
7371 .Ev NAIL_FILENAME_TEMPORARY
7372 .Pf ( Cd x-mailx-tmpfile ) .
7373 If this trigger is given twice then the file will be unlinked
7374 automatically by \*(UA when the command loop is entered again at latest
7375 .Pf ( Cd x-mailx-tmpfile-unlink ) .
7376 (Don't use this for asynchronous handlers.)
7378 .It Ql =
7379 Normally the MIME part content is passed to the handler via standard
7380 input; if this flag is set then the data will instead be written into
7381 .Ev NAIL_FILENAME_TEMPORARY
7382 .Pf ( Cd x-mailx-tmpfile-fill ) ,
7383 the creation of which is implied; note however that in order to cause
7384 deletion of the temporary file you still have to use two plus signs
7385 .Ql ++
7386 explicitly!
7388 .It Ql @
7389 To avoid ambiguities with normal shell command content you can use
7390 another at-sign to forcefully terminate interpretation of remaining
7391 characters.
7392 (Any character not in this list will have the same effect.)
7396 Some information about the MIME part to be displayed is embedded into
7397 the environment of the shell command:
7400 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
7402 .It Ev NAIL_CONTENT
7403 The MIME content-type of the part, if known, the empty string otherwise.
7406 .It Ev NAIL_CONTENT_EVIDENCE
7408 .Va mime-counter-evidence
7409 includes the carry-around-bit (2), then this will be set to the detected
7410 MIME content-type; not only then identical to
7411 .Ev \&\&NAIL_CONTENT
7412 otherwise.
7415 .It Ev NAIL_FILENAME
7416 The filename, if any is set, the empty string otherwise.
7419 .It Ev NAIL_FILENAME_GENERATED
7420 A random string.
7423 .It Ev NAIL_FILENAME_TEMPORARY
7424 If temporary file creation has been requested through the command prefix
7425 this variable will be set and contain the absolute pathname of the
7426 temporary file.
7429 .It Ev NAIL_TMPDIR
7430 The temporary directory that \*(UA uses.
7431 Usually identical to
7432 .Ev TMPDIR ,
7433 but guaranteed to be set and usable by child processes;
7434 to ensure the latter condition for
7435 .Ev \&\&TMPDIR
7436 also, it'll be set.
7441 .It Va pipe-EXTENSION
7442 This is identical to
7443 .Va pipe-TYPE/SUBTYPE
7444 except that
7445 .Ql EXTENSION
7446 (normalized to lowercase using character mappings of the ASCII charset)
7447 names a file extension, e.g.,
7448 .Ql xhtml .
7449 Handlers registered using this method take precedence.
7451 .Mx Va pop3-auth
7452 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
7453 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
7454 The only possible value as of now is
7455 .Ql plain ,
7456 which is thus the default.
7459 .Mx Va pop3-bulk-load
7460 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
7461 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
7462 the messages, and only requests the message bodies on user request.
7463 For the POP3 protocol this means that the message headers will be
7464 downloaded twice.
7465 If this option is set then \*(UA will download only complete messages
7466 from the given POP3 server(s) instead.
7468 .Mx Va pop3-keepalive
7469 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
7470 \*(OP POP3 servers close the connection after a period of inactivity;
7471 the standard requires this to be at least 10 minutes,
7472 but practical experience may vary.
7473 Setting this variable to a numeric value greater than
7474 .Ql 0
7475 causes a
7476 .Ql NOOP
7477 command to be sent each value seconds if no other operation is performed.
7479 .Mx Va pop3-no-apop
7480 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
7481 \*(BO\*(OP Unless this variable is set the
7482 .Ql APOP
7483 authentication method will be used when connecting to a POP3 server that
7484 advertises support.
7485 The advantage of
7486 .Ql APOP
7487 is that the password is not sent in clear text over the wire and that
7488 only a single packet is sent for the user/password tuple.
7489 Note that
7490 .Va pop3-no-apop-HOST
7491 requires \*(IN.
7493 .Mx Va pop3-use-starttls
7494 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
7495 \*(BO\*(OP Causes \*(UA to issue a
7496 .Ql STLS
7497 command to make an unencrypted POP3 session SSL/TLS encrypted.
7498 This functionality is not supported by all servers,
7499 and is not used if the session is already encrypted by the POP3S method.
7500 Note that
7501 .Va pop3-use-starttls-HOST
7502 requires \*(IN.
7505 .It Va print-alternatives
7506 \*(BO When a MIME message part of type
7507 .Ql multipart/alternative
7508 is displayed and it contains a subpart of type
7509 .Ql text/plain ,
7510 other parts are normally discarded.
7511 Setting this variable causes all subparts to be displayed,
7512 just as if the surrounding part was of type
7513 .Ql multipart/mixed .
7516 .It Va prompt
7517 The string shown when a command is accepted.
7518 Prompting may be prevented by setting this to the null string
7519 (or by setting
7520 .Pf no Va prompt ) .
7521 If a value is assigned the following \*(UA specific additional sequences
7522 are understood:
7523 .Ql \e& ,
7524 which expands to
7525 .Dq \&?
7526 unless
7527 .Va bsdcompat
7528 is set, in which case it expands to
7529 .Dq \&& ;
7530 note that
7531 .Ql \e&\0
7532 is the default value of
7533 .Va \&\&prompt .
7534 .Ql \e? ,
7535 which will expand to
7536 .Dq 1
7537 if the last command failed and to
7538 .Dq 0
7539 otherwise,
7540 .Ql \e$ ,
7541 which will expand to the name of the currently active
7542 .Ic account ,
7543 if any, and to the empty string otherwise, and
7544 .Ql \e@ ,
7545 which will expand to the name of the currently active mailbox.
7546 (Note that the prompt buffer is size-limited, excess is cut off.)
7548 Even though
7549 .Va \&\&prompt
7550 checks for
7551 .Va headline-bidi
7552 to encapsulate the expansions of the
7553 .Ql \e$
7555 .Ql \e@
7556 escape sequences as necessary to correctly display bidirectional text,
7557 this is not true for the final string that makes up
7558 .Va \&\&prompt
7559 as such, i.e., real BIDI handling is not supported.
7562 .It Va quiet
7563 \*(BO Suppresses the printing of the version when first invoked.
7566 .It Va quote
7567 If set, \*(UA starts a replying message with the original message
7568 prefixed by the value of the variable
7569 .Va indentprefix .
7570 Normally, a heading consisting of
7571 .Dq Fromheaderfield wrote:
7572 is put before the quotation.
7573 If the string
7574 .Ql noheading
7575 is assigned to the
7576 .Va \&\&quote
7577 variable, this heading is omitted.
7578 If the string
7579 .Ql headers
7580 is assigned, the headers selected by the
7581 .Ic ignore Ns / Ns Ic retain
7582 commands are put above the message body,
7583 thus
7584 .Va \&\&quote
7585 acts like an automatic
7586 .Pf ` Ic ~m Ns '
7587 .Sx "TILDE ESCAPES"
7588 command, then.
7589 If the string
7590 .Ql allheaders
7591 is assigned, all headers are put above the message body and all MIME
7592 parts are included, making
7593 .Va \&\&quote
7594 act like an automatic
7595 .Pf ` Ic ~M Ns '
7596 command; also see
7597 .Va quote-as-attachment .
7600 .It Va quote-as-attachment
7601 \*(BO Add the original message in its entirety as a
7602 .Ql message/rfc822
7603 MIME attachment when replying to a message.
7604 Note this works regardless of the setting of
7605 .Va quote .
7608 .It Va quote-fold
7609 \*(OP Can be set in addition to
7610 .Va indentprefix .
7611 Setting this turns on a more fancy quotation algorithm in that leading
7612 quotation characters are compressed and overlong lines are folded.
7613 .Va \&\&quote-fold
7614 can be set to either one or two (space separated) numeric values,
7615 which are interpreted as the maximum (goal) and the minimum line length,
7616 respectively, in a spirit rather equal to the
7617 .Xr fmt 1
7618 program, but line-, not paragraph-based.
7619 If not set explicitly the minimum will reflect the goal algorithmically.
7620 The goal can't be smaller than the length of
7621 .Va indentprefix
7622 plus some additional pad.
7623 Necessary adjustments take place silently.
7626 .It Va recipients-in-cc
7627 \*(BO On group replies, specify only the sender of the original mail in
7628 .Ql To:
7629 and mention the other recipients in the secondary
7630 .Ql Cc: .
7631 By default all recipients of the original mail will be addressed via
7632 .Ql To: .
7635 .It Va record
7636 If defined, gives the pathname of the folder used to record all outgoing
7637 mail.
7638 If not defined, then outgoing mail is not saved.
7639 When saving to this folder fails the message is not sent,
7640 but instead saved to
7641 .Ev DEAD .
7644 .It Va record-resent
7645 \*(BO If both this variable and the
7646 .Va record
7647 variable are set,
7649 .Ic resend
7651 .Ic Resend
7652 commands save messages to the
7653 .Va record
7654 folder as it is normally only done for newly composed messages.
7657 .It Va reply-in-same-charset
7658 \*(BO If this variable is set \*(UA first tries to use the same
7659 character set of the original message for replies.
7660 If this fails, the mechanism described in
7661 .Sx "Character sets"
7662 is evaluated as usual.
7665 .It Va reply_strings
7666 Can be set to a comma-separated list of (case-insensitive according to
7667 ASCII rules) strings which shall be recognized in addition to the
7668 builtin strings as
7669 .Ql Subject:
7670 reply message indicators \(en builtin are
7671 .Ql Re: ,
7672 which is mandated by RFC 5322, as well as the german
7673 .Ql Aw: .
7676 .It Va replyto
7677 A list of addresses to put into the
7678 .Ql Reply-To:
7679 field of the message header.
7680 Members of this list are handled as if they were in the
7681 .Ic alternates
7682 list.
7685 .It Va reply-to-honour
7686 Controls whether a
7687 .Ql Reply-To:
7688 header is honoured when replying to a message via
7689 .Ic reply
7691 .Ic Lreply .
7692 This is a quadoption; if set without a value it defaults to
7693 .Dq yes .
7696 .It Va rfc822-body-from_
7697 \*(BO This variable can be used to force displaying a so-called
7698 .Ql From_
7699 line for messages that are embedded into an envelope mail via the
7700 .Ql message/rfc822
7701 MIME mechanism, for more visual convenience.
7704 .It Va save
7705 \*(BO Enable saving of (partial) messages in
7706 .Ev DEAD
7707 upon interrupt or delivery error.
7710 .It Va screen
7711 The number of lines that represents a
7712 .Dq screenful
7713 of lines, used in
7714 .Ic headers
7715 summary display,
7716 .Ic from
7717 .Ic search Ns
7718 ing, message
7719 .Ic top Ns
7720 line display and scrolling via
7721 .Ic z .
7722 If this variable is not set \*(UA falls back to a calculation based upon
7723 the detected terminal window size and the baud rate: the faster the
7724 terminal, the more will be shown.
7725 Overall screen dimensions and pager usage is influenced by the
7726 environment variables
7727 .Ev COLUMNS
7729 .Ev LINES
7730 and the variable
7731 .Va crt .
7734 .It Va searchheaders
7735 \*(BO Expand message-list specifiers in the form
7736 .Ql /x:y
7737 to all messages containing the substring
7738 .Dq y
7739 in the header field
7740 .Ql x .
7741 The string search is case insensitive.
7744 .It Va sendcharsets
7745 \*(OP A comma-separated list of character set names that can be used in
7746 outgoing internet mail.
7747 The value of the variable
7748 .Va charset-8bit
7749 is automatically appended to this list of character-sets.
7750 If no character set conversion capabilities are compiled into \*(UA then
7751 the only supported charset is
7752 .Va ttycharset .
7753 Also see
7754 .Va sendcharsets-else-ttycharset
7755 and refer to the section
7756 .Sx "Character sets"
7757 for the complete picture of character set conversion in \*(UA.
7760 .It Va sendcharsets-else-ttycharset
7761 \*(BO\*(OP If this variable is set, but
7762 .Va sendcharsets
7763 is not, then \*(UA acts as if
7764 .Va sendcharsets
7765 had been set to the value of the variable
7766 .Va ttycharset .
7767 In effect this combination passes through the message data in the
7768 character set of the current locale (given that
7769 .Va ttycharset
7770 hasn't been set manually), i.e., without converting it to the
7771 .Va charset-8bit
7772 fallback character set.
7773 Thus, mail message text will be in ISO-8859-1 encoding when send from
7774 within a ISO-8859-1 locale, and in UTF-8 encoding when send from within
7775 an UTF-8 locale.
7776 If no character set conversion capabilities are available in \*(UA then
7777 the only supported character set is
7778 .Va ttycharset .
7781 .It Va sender
7782 An address that is put into the
7783 .Ql Sender:
7784 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
7785 responsible for the actual transmission of the message.
7786 This field should normally not be used unless the
7787 .Ql From:
7788 field contains more than one address, on which case it is required.
7790 .Va \&\&sender
7791 address is handled as if it were in the
7792 .Ic alternates
7793 list.
7796 .It Va sendmail
7797 \*(OB Predecessor of
7798 .Va mta .
7801 .It Va sendmail-arguments
7802 \*(OB Predecessor of
7803 .Va mta-arguments .
7806 .It Va sendmail-no-default-arguments
7807 \*(OB\*(BO Predecessor of
7808 .Va mta-no-default-arguments .
7811 .It Va sendmail-progname
7812 \*(OB Predecessor of
7813 .Va mta-argv0 .
7816 .It Va sendwait
7817 \*(BO When sending a message wait until the
7818 .Va mta
7819 (including the builtin SMTP one) exits before accepting further commands.
7820 .Sy Only
7821 with this variable set errors reported by the MTA will be recognizable!
7822 If the MTA returns a non-zero exit status,
7823 the exit status of \*(UA will also be non-zero.
7826 .It Va showlast
7827 \*(BO Setting this option causes \*(UA to start at the last message
7828 instead of the first one when opening a mail folder.
7831 .It Va showname
7832 \*(BO Causes \*(UA to use the sender's real name instead of the plain
7833 address in the header field summary and in message specifications.
7836 .It Va showto
7837 \*(BO Causes the recipient of the message to be shown in the header
7838 summary if the message was sent by the user.
7841 .It Va Sign
7842 A string for use with the
7843 .Ic ~A
7844 tilde escape.
7847 .It Va sign
7848 A string for use with the
7849 .Ic ~a
7850 tilde escape.
7853 .It Va signature
7854 Must correspond to the name of a readable file if set.
7855 The file's content is then appended to each singlepart message
7856 and to the first part of each multipart message.
7857 Be warned that there is no possibility to edit the signature for an
7858 individual message.
7861 .It Va skipemptybody
7862 \*(BO If an outgoing message does not contain any text in its first or
7863 only message part, do not send it but discard it silently (see also the
7864 command line option
7865 .Fl E ) .
7868 .It Va smime-ca-dir
7869 \*(OP Specifies a directory with CA certificates in PEM (Privacy
7870 Enhanced Mail) format for verification of S/MIME signed messages.
7873 .It Va smime-ca-file
7874 \*(OP Specifies a file with CA certificates in PEM format for
7875 verification of S/MIME signed messages.
7877 .Mx Va smime-cipher
7878 .It Va smime-cipher-USER@HOST , smime-cipher
7879 \*(OP Specifies the cipher to use when generating S/MIME encrypted
7880 messages (for the specified account).
7881 RFC 5751 mandates a default of
7882 .Ql aes128
7883 (AES-128 CBC).
7884 Possible values are (case-insensitive and) in decreasing cipher strength:
7885 .Ql aes256
7886 (AES-256 CBC),
7887 .Ql aes192
7888 (AES-192 CBC),
7889 .Ql aes128
7890 (AES-128 CBC),
7891 .Ql des3
7892 (DES EDE3 CBC, 168 bits; default if
7893 .Ql aes128
7894 isn't available) and
7895 .Ql des
7896 (DES CBC, 56 bits).
7898 The actually available cipher algorithms depend on the cryptographic
7899 library that \*(UA uses.
7900 \*(OP Support for more cipher algorithms may be available through
7901 dynamic loading via, e.g.,
7902 .Xr EVP_get_cipherbyname 3
7903 (OpenSSL) if \*(UA has been compiled to support this.
7906 .It Va smime-crl-dir
7907 \*(OP Specifies a directory that contains files with CRLs in PEM format
7908 to use when verifying S/MIME messages.
7911 .It Va smime-crl-file
7912 \*(OP Specifies a file that contains a CRL in PEM format to use when
7913 verifying S/MIME messages.
7916 .It Va smime-encrypt-USER@HOST
7917 \*(OP If this variable is set, messages send to the given receiver are
7918 encrypted before sending.
7919 The value of the variable must be set to the name of a file that
7920 contains a certificate in PEM format.
7922 If a message is sent to multiple recipients,
7923 each of them for whom a corresponding variable is set will receive an
7924 individually encrypted message;
7925 other recipients will continue to receive the message in plain text
7926 unless the
7927 .Va smime-force-encryption
7928 variable is set.
7929 It is recommended to sign encrypted messages, i.e., to also set the
7930 .Va smime-sign
7931 variable.
7934 .It Va smime-force-encryption
7935 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
7938 .It Va smime-no-default-ca
7939 \*(BO\*(OP Don't load default CA locations when verifying S/MIME signed
7940 messages.
7943 .It Va smime-sign
7944 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
7945 and include the user's certificate as a MIME attachment.
7946 Signing a message enables a recipient to verify that the sender used
7947 a valid certificate,
7948 that the email addresses in the certificate match those in the message
7949 header and that the message content has not been altered.
7950 It does not change the message text,
7951 and people will be able to read the message as usual.
7952 Also see
7953 .Va smime-sign-cert , smime-sign-include-certs
7955 .Va smime-sign-message-digest .
7957 .Mx Va smime-sign-cert
7958 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
7959 \*(OP Points to a file in PEM format.
7960 For the purpose of signing and decryption this file needs to contain the
7961 user's private key as well as his certificate.
7963 For message signing
7964 .Ql USER@HOST
7965 is always derived from the value of
7966 .Va from
7967 (or, if that contains multiple addresses,
7968 .Va sender ) .
7969 For the purpose of encryption the recipient's public encryption key
7970 (certificate) is expected; the command
7971 .Ic certsave
7972 can be used to save certificates of signed messages (the section
7973 .Sx "Signed and encrypted messages with S/MIME"
7974 gives some details).
7975 This mode of operation is usually driven by the specialized form.
7977 When decrypting messages the account is derived from the recipient
7978 fields
7979 .Pf ( Ql To:
7981 .Ql Cc: )
7982 of the message, which are searched for addresses for which such
7983 a variable is set.
7984 \*(UA always uses the first address that matches,
7985 so if the same message is sent to more than one of the user's addresses
7986 using different encryption keys, decryption might fail.
7988 .Mx Va smime-sign-include-certs
7989 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
7990 \*(OP If used, this is supposed to a consist of a comma-separated list
7991 of files, each of which containing a single certificate in PEM format to
7992 be included in the S/MIME message in addition to the
7993 .Va smime-sign-cert
7994 certificate.
7995 This is most useful for long certificate chains if it is desired to aid
7996 the receiving party's verification process.
7997 Note that top level certificates may also be included in the chain but
7998 don't play a role for verification.
7999 Also see
8000 .Va smime-sign-cert .
8001 Remember that for this
8002 .Ql USER@HOST
8003 refers to the variable
8004 .Va from
8005 (or, if that contains multiple addresses,
8006 .Va sender ) .
8008 .Mx Va smime-sign-message-digest
8009 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
8010 \*(OP Specifies the message digest to use when signing S/MIME messages.
8011 RFC 5751 mandates a default of
8012 .Ql sha1 .
8013 Possible values are (case-insensitive and) in decreasing cipher strength:
8014 .Ql sha512 ,
8015 .Ql sha384 ,
8016 .Ql sha256 ,
8017 .Ql sha224
8019 .Ql md5 .
8021 The actually available message digest algorithms depend on the
8022 cryptographic library that \*(UA uses.
8023 \*(OP Support for more message digest algorithms may be available
8024 through dynamic loading via, e.g.,
8025 .Xr EVP_get_digestbyname 3
8026 (OpenSSL) if \*(UA has been compiled to support this.
8027 Remember that for this
8028 .Ql USER@HOST
8029 refers to the variable
8030 .Va from
8031 (or, if that contains multiple addresses,
8032 .Va sender ) .
8035 .It Va smtp
8036 \*(OB\*(OP To use the builtin SMTP transport, specify a SMTP URL in
8037 .Va mta .
8038 \*(ID For compatibility reasons a set
8039 .Va smtp
8040 is used in preference of
8041 .Va mta .
8043 .Mx Va smtp-auth
8044 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
8045 \*(OP Variable chain that controls the SMTP
8046 .Va mta
8047 authentication method, possible values are
8048 .Ql none
8049 (\*(OU default),
8050 .Ql plain
8051 (\*(IN default),
8052 .Ql login
8053 as well as the \*(OPal methods
8054 .Ql cram-md5
8056 .Ql gssapi .
8058 .Ql none
8059 method doesn't need any user credentials,
8060 .Ql gssapi
8061 requires a user name and all other methods require a user name and
8062 a password.
8063 See \*(IN
8064 .Va mta ,
8065 .Va user
8067 .Va password
8068 (\*(OU
8069 .Va smtp-auth-password
8071 .Va smtp-auth-user ) .
8072 Note that
8073 .Va smtp-auth-HOST
8074 is \*(IN.
8075 \*(OU: Note for
8076 .Va smtp-auth-USER@HOST :
8077 may override dependent on sender address in the variable
8078 .Va from .
8080 .It Va smtp-auth-password
8081 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
8082 If the authentication method requires a password, but neither
8083 .Va smtp-auth-password
8084 nor a matching
8085 .Va smtp-auth-password-USER@HOST
8086 can be found,
8087 \*(UA will ask for a password on the user's terminal.
8089 .It Va smtp-auth-password-USER@HOST
8090 \*(OU Overrides
8091 .Va smtp-auth-password
8092 for specific values of sender addresses, dependent upon the variable
8093 .Va from .
8095 .It Va smtp-auth-user
8096 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
8097 If the authentication method requires a user name, but neither
8098 .Va smtp-auth-user
8099 nor a matching
8100 .Va smtp-auth-user-USER@HOST
8101 can be found,
8102 \*(UA will ask for a user name on the user's terminal.
8104 .It Va smtp-auth-user-USER@HOST
8105 \*(OU Overrides
8106 .Va smtp-auth-user
8107 for specific values of sender addresses, dependent upon the variable
8108 .Va from .
8111 .It Va smtp-hostname
8112 \*(OP\*(IN Normally \*(UA uses the variable
8113 .Va from
8114 to derive the necessary
8115 .Ql USER@HOST
8116 information in order to issue a
8117 .Ql MAIL FROM:<>
8118 SMTP
8119 .Va mta
8120 command.
8121 Setting
8122 .Va smtp-hostname
8123 can be used to use the
8124 .Ql USER
8125 from the SMTP account
8126 .Pf ( Va mta
8127 or the
8128 .Va user
8129 variable chain)
8130 and the
8131 .Ql HOST
8132 from the content of this variable (or, if that is the empty string,
8133 .Va hostname
8134 or the local hostname as a last resort).
8135 This often allows using an address that is itself valid but hosted by
8136 a provider other than which (in
8137 .Va from )
8138 is about to send the message.
8139 Setting this variable also influences the generated
8140 .Ql Message-ID: .
8142 .Mx Va smtp-use-starttls
8143 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
8144 \*(BO\*(OP Causes \*(UA to issue a
8145 .Ql STARTTLS
8146 command to make an SMTP
8147 .Va mta
8148 session SSL/TLS encrypted, i.e., to enable transport layer security.
8152 .It Va spam-interface
8153 \*(OP In order to use any of the spam-related commands (like, e.g.,
8154 .Ic spamrate )
8155 the desired spam interface must be defined by setting this variable.
8156 Please refer to the manual section
8157 .Sx "Handling spam"
8158 for the complete picture of spam handling in \*(UA.
8159 All or none of the following interfaces may be available:
8161 .Bl -tag -width ".It Ql _ilte_"
8162 .It Ql spamc
8163 Interaction with
8164 .Xr spamc 1
8165 from the
8166 .Xr spamassassin 1
8167 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
8168 suite.
8169 Different to the generic filter interface \*(UA will automatically add
8170 the correct arguments for a given command and has the necessary
8171 knowledge to parse the program's output.
8172 A default value for
8173 .Va spamc-command
8174 will have been compiled into the \*(UA binary if
8175 .Xr spamc 1
8176 has been found in
8177 .Ev PATH
8178 during compilation.
8179 Shall it be necessary to define a specific connection type (rather than
8180 using a configuration file for that), the variable
8181 .Va spamc-arguments
8182 can be used as in, e.g.,
8183 .Ql -d server.example.com -p 783 .
8184 It is also possible to specify a per-user configuration via
8185 .Va spamc-user .
8186 Note that this interface doesn't inspect the
8187 .Ql is-spam
8188 flag of a message for the command
8189 .Ic spamforget .
8191 .It Ql filter
8192 generic spam filter support via freely configurable hooks.
8193 This interface is meant for programs like
8194 .Xr bogofilter 1
8195 and requires according behaviour in respect to the hooks' exit
8196 status for at least the command
8197 .Ic spamrate
8198 .Pf ( Ql 0
8199 meaning a message is spam,
8200 .Ql 1
8201 for non-spam,
8202 .Ql 2
8203 for unsure and any other return value indicating a hard error);
8204 since the hooks can include shell code snippets diverting behaviour
8205 can be intercepted as necessary.
8206 The hooks are
8207 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
8208   spamfilter-rate
8210 .Va spamfilter-spam ;
8211 the manual section
8212 .Sx "Handling spam"
8213 contains examples for some programs.
8214 The process environment of the hooks will have the variables
8215 .Ev NAIL_TMPDIR , TMPDIR
8217 .Ev NAIL_FILENAME_GENERATED
8218 set.
8219 Note that spam score support for
8220 .Ic spamrate
8221 isn't supported unless the \*(OPtional regular expression support is
8222 available and the
8223 .Va spamfilter-rate-scanscore
8224 variable is set.
8229 .It Va spam-maxsize
8230 \*(OP Messages that exceed this size won't be passed through to the
8231 configured
8232 .Va spam-interface .
8233 If unset or 0, the default of 420000 bytes is used.
8236 .It Va spamc-command
8237 \*(OP The path to the
8238 .Xr spamc 1
8239 program for the
8240 .Ql spamc
8241 .Va spam-interface .
8242 Note that the path is not expanded, but used
8243 .Dq as is .
8244 A fallback path will have been compiled into the \*(UA binary if the
8245 executable had been found during compilation.
8248 .It Va spamc-arguments
8249 \*(OP Even though \*(UA deals with most arguments for the
8250 .Ql spamc
8251 .Va spam-interface
8252 automatically, it may at least sometimes be desirable to specify
8253 connection-related ones via this variable, e.g.,
8254 .Ql -d server.example.com -p 783 .
8257 .It Va spamc-user
8258 \*(OP Specify a username for per-user configuration files for the
8259 .Ql spamc
8260 .Va spam-interface .
8261 If this is set to the empty string then \*(UA will use the name of the
8262 current
8263 .Va user .
8270 .It Va spamfilter-ham , spamfilter-noham , \
8271   spamfilter-nospam , spamfilter-rate , spamfilter-spam
8272 \*(OP Command and argument hooks for the
8273 .Ql filter
8274 .Va spam-interface .
8275 The manual section
8276 .Sx "Handling spam"
8277 contains examples for some programs.
8280 .It Va spamfilter-rate-scanscore
8281 \*(OP Because of the generic nature of the
8282 .Ql filter
8283 .Va spam-interface
8284 spam scores are not supported for it by default, but if the \*(OPtional
8285 regular expression support is available then setting this variable can
8286 be used to overcome this restriction.
8287 It is interpreted as follows: first a number (digits) is parsed that
8288 must be followed by a semicolon
8289 .Ql \&;
8290 and an extended regular expression.
8291 Then the latter is used to parse the first output line of the
8292 .Va spamfilter-rate
8293 hook, and, in case the evaluation is successful, the group that has been
8294 specified via the number is interpreted as a floating point scan score.
8297 .It Va ssl-ca-dir
8298 \*(OP Specifies a directory with CA certificates in PEM (Pricacy
8299 Enhanced Mail) for verification of of SSL/TLS server certificates.
8301 .Xr SSL_CTX_load_verify_locations 3
8302 for more information.
8305 .It Va ssl-ca-file
8306 \*(OP Specifies a file with CA certificates in PEM format for
8307 verification of SSL/TLS server certificates.
8309 .Xr SSL_CTX_load_verify_locations 3
8310 for more information.
8312 .Mx Va ssl-cert
8313 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
8314 \*(OP Variable chain that sets the file name for a SSL/TLS client
8315 certificate required by some servers.
8316 This is a direct interface to the
8317 .Ql Certificate
8318 slot of the
8319 .Xr SSL_CONF_cmd 3
8320 function of the OpenSSL library, if available.
8322 .Mx Va ssl-cipher-list
8323 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
8324 \*(OP Specifies a list of ciphers for SSL/TLS connections.
8325 This is a direct interface to the
8326 .Ql CipherString
8327 slot of the
8328 .Xr SSL_CONF_cmd 3
8329 function of the OpenSSL library, if available; see
8330 .Xr ciphers 1
8331 for more information.
8332 By default \*(UA doesn't set a list of ciphers, which in effect will use a
8333 .Va ssl-protocol
8334 specific cipher (protocol standards ship with a list of acceptable
8335 ciphers), possibly cramped to what the actually used SSL/TLS library
8336 supports \(en the manual section
8337 .Sx "An example configuration"
8338 also contains a SSL/TLS use case.
8341 .It Va ssl-config-file
8342 \*(OP If this variable is set \*(UA will call
8343 .Xr CONF_modules_load_file 3
8344 to allow OpenSSL to be configured according to the host system wide
8345 security settings.
8346 If a non-empty value is given then this will be used to specify the
8347 configuration file to be used instead of the global OpenSSL default;
8348 note that in this case it is an error if the file cannot be loaded.
8349 The application name will always be passed as
8350 .Dq \*(uA .
8353 .It Va ssl-crl-file
8354 \*(OP Specifies a file that contains a CRL in PEM format to use when
8355 verifying SSL/TLS server certificates.
8358 .It Va ssl-crl-dir
8359 \*(OP Specifies a directory that contains files with CRLs in PEM format
8360 to use when verifying SSL/TLS server certificates.
8362 .Mx Va ssl-key
8363 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
8364 \*(OP Variable chain that sets the file name for the private key of
8365 a SSL/TLS client certificate.
8366 If unset, the name of the certificate file is used.
8367 The file is expected to be in PEM format.
8368 This is a direct interface to the
8369 .Ql PrivateKey
8370 slot of the
8371 .Xr SSL_CONF_cmd 3
8372 function of the OpenSSL library, if available.
8374 .Mx Va ssl-method
8375 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
8376 \*(OB\*(OP Please use the newer and more flexible
8377 .Va ssl-protocol
8378 instead: if both values are set,
8379 .Va ssl-protocol
8380 will take precedence!
8381 Can be set to the following values, the actually used
8382 .Va ssl-protocol
8383 specification to which it is mapped is shown in parenthesis:
8384 .Ql tls1.2
8385 .Pf ( Ql -ALL, TLSv1.2 ) ,
8386 .Ql tls1.1
8387 .Pf ( Ql -ALL, TLSv1.1 ) ,
8388 .Ql tls1
8389 .Pf ( Ql -ALL, TLSv1 )
8391 .Ql ssl3
8392 .Pf ( Ql -ALL, SSLv3 ) ;
8393 the special value
8394 .Ql auto
8395 is mapped to
8396 .Ql ALL, -SSLv2
8397 and thus includes the SSLv3 protocol.
8398 Note that SSLv2 is no longer supported at all.
8401 .It Va ssl-no-default-ca
8402 \*(BO\*(OP Don't load default CA locations to verify SSL/TLS server
8403 certificates.
8405 .Mx Va ssl-protocol
8406 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
8407 \*(OP Specify the used SSL/TLS protocol.
8408 This is a direct interface to the
8409 .Ql Protocol
8410 slot of the
8411 .Xr SSL_CONF_cmd 3
8412 function of the OpenSSL library, if available;
8413 otherwise an \*(UA internal parser is used which understands the
8414 following subset of (case-insensitive) command strings:
8415 .Ql SSLv3 ,
8416 .Ql TLSv1 ,
8417 .Ql TLSv1.1
8419 .Ql TLSv1.2 ,
8420 as well as the special value
8421 .Ql ALL .
8422 Multiple specifications may be given via a comma-separated list which
8423 ignores any whitespace.
8424 An optional
8425 .Ql +
8426 plus prefix will enable a protocol, a
8427 .Ql -
8428 minus prefix will disable it, so that
8429 .Ql -ALL, TLSv1.2
8430 will enable only the TLSv1.2 protocol.
8432 It depends upon the used TLS/SSL library which protocols are actually
8433 supported and which protocols are used if
8434 .Va ssl-protocol
8435 is not set, but note that SSLv2 is no longer supported at all and
8436 actively disabled.
8437 Especially for older protocols explicitly securing
8438 .Va ssl-cipher-list
8439 may be worthwile, see
8440 .Sx "An example configuration" .
8443 .It Va ssl-rand-egd
8444 \*(OP Gives the pathname to an entropy daemon socket, see
8445 .Xr RAND_egd 3 .
8446 Not all SSL/TLS libraries support this.
8449 .It Va ssl-rand-file
8450 \*(OP Gives the filename to a file with random entropy data, see
8451 .Xr RAND_load_file 3 .
8452 If this variable is not set, or set to the empty string, or if the
8453 filename expansion failed, then
8454 .Xr RAND_file_name 3
8455 will be used to create the filename if, and only if,
8456 .Xr RAND_status 3
8457 documents that the SSL PRNG is not yet sufficiently seeded.
8458 If \*(UA successfully seeded the SSL PRNG then it'll update the file via
8459 .Xr RAND_write_file 3 .
8460 This variable is only used if
8461 .Va ssl-rand-egd
8462 is not set (or not supported by the SSL/TLS library).
8464 .Mx Va ssl-verify
8465 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
8466 \*(OP Variable chain that sets the action to be performed if an error
8467 occurs during SSL/TLS server certificate validation.
8468 Valid (case-insensitive) values are
8469 .Ql strict
8470 (fail and close connection immediately),
8471 .Ql ask
8472 (ask whether to continue on standard input),
8473 .Ql warn
8474 (show a warning and continue),
8475 .Ql ignore
8476 (do not perform validation).
8477 The default is
8478 .Ql ask .
8481 .It Va stealthmua
8482 If only set without an assigned value, then this option inhibits the
8483 generation of the
8484 .Ql Message-ID:
8486 .Ql User-Agent:
8487 header fields that include obvious references to \*(UA.
8488 There are two pitfalls associated with this:
8489 First, the message id of outgoing messages is not known anymore.
8490 Second, an expert may still use the remaining information in the header
8491 to track down the originating mail user agent.
8492 If set to the value
8493 .Ql noagent ,
8494 then the mentioned
8495 .Ql Message-ID:
8496 suppression doesn't occur.
8500 .It Va termcap
8501 (\*(OP) This specifies a comma-separated list of
8502 .Lb libterminfo
8503 and/or
8504 .Lb libtermcap
8505 capabilities (see
8506 .Sx "On terminal control and line editor" ,
8507 escape commas with reverse solidus) to be used to overwrite or define
8508 entries.
8509 Note that this variable will only be queried once at program startup and
8510 can thus only be specified in resource files or on the command line.
8513 String capabilities form
8514 .Ql cap=value
8515 pairs and are expected unless noted otherwise.
8516 Numerics have to be notated as
8517 .Ql cap#number
8518 where the number is expected in normal decimal notation.
8519 Finally, booleans don't have any value but indicate a true or false
8520 state simply by being defined or not; this indeed means that \*(UA
8521 doesn't support undefining an existing boolean.
8522 String capability values will undergo some expansions before use:
8523 for one notations like
8524 .Ql ^LETTER
8525 stand for
8526 .Ql control-LETTER ,
8527 and for clarification purposes
8528 .Ql \eE
8529 can be used to specify
8530 .Ql escape
8531 (the control notation
8532 .Ql ^[
8533 could lead to misreadings when a left bracket follows, which it does for
8534 the standard CSI sequence);
8535 finally three letter octal sequences, as in
8536 .Ql \e061 ,
8537 are supported.
8538 To specify that a terminal supports 256-colours, and to define sequences
8539 that home the cursor and produce an audible bell, one might write:
8541 .Bd -literal -offset indent
8542 set termcap='Co#256,home=\eE[H,bel=^G'
8546 The following terminal capabilities are or may be meaningful for the
8547 operation of the builtin line editor or \*(UA in general:
8550 .Bl -tag -compact -width yay
8551 .\" HAVE_COLOUR
8552 .It Cd colors Ns \0or Cd Co
8553 .Cd max_colors :
8554 numeric capability specifying the maximum number of colours.
8555 Note that \*(UA doesn't actually care about the terminal beside that,
8556 but always emits ANSI / ISO 6429 escape sequences.
8558 .\" HAVE_TERMCAP
8559 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
8560 .Cd exit_ca_mode
8562 .Cd enter_ca_mode ,
8563 respectively: exit and enter the alternative screen
8564 .Dq ca-mode ,
8565 effectively turning \*(UA into a fullscreen application.
8566 To disable that, set (at least) one to the empty string.
8568 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
8569 .Cd keypad_xmit
8571 .Cd keypad_local ,
8572 respectively: enable and disable the keypad.
8573 This is always enabled if available, because it seems even keyboards
8574 without keypads generate other key codes for, e.g., cursor keys in that
8575 case, and only if enabled we see the codes that we are interested in.
8577 .It Cd ed Ns \0or Cd cd
8578 .Cd clr_eos :
8579 clear the screen.
8581 .It Cd clear Ns \0or Cd cl
8582 .Cd clear_screen :
8583 clear the screen and home cursor.
8584 (Will be simulated via
8585 .Cd ho
8586 plus
8587 .Cd cd . )
8589 .It Cd home Ns \0or Cd ho
8590 .Cd cursor_home :
8591 home cursor.
8593 .\" HAVE_MLE
8594 .It Cd el Ns \0or Cd ce
8595 .Cd clr_eol :
8596 clear to the end of line.
8597 (Will be simulated via
8598 .Cd ch
8599 plus repetitions of space characters.)
8601 .It Cd hpa Ns \0or Cd ch
8602 .Cd column_address :
8603 move the cursor (to the given column parameter) in the current row.
8604 (Will be simulated via
8605 .Cd cr
8606 plus
8607 .Cd nd . )
8609 .It Cd cr
8610 .Cd carriage_return :
8611 move to the first column in the current row.
8612 The default builtin fallback is
8613 .Ql \er .
8615 .It Cd cub1 Ns \0or Cd le
8616 .Cd cursor_left :
8617 move the cursor left one space (non-destructively).
8618 The default builtin fallback is
8619 .Ql \eb .
8621 .It Cd cuf1 Ns \0or Cd nd
8622 .Cd cursor_right :
8623 move the cursor right one space (non-destructively).
8624 The default builtin fallback is
8625 .Ql \eE[C ,
8626 which is used by most terminals.
8627 Less often occur
8628 .Ql \eEC
8630 .Ql \eEOC .
8634 Many more capabilities which describe key-sequences are documented for
8635 .Ic bind .
8638 .It Va termcap-disable
8639 \*(OP Disable any interaction with a terminal control library.
8640 If set only some generic fallback builtins and possibly the content of
8641 .Va termcap
8642 describe the terminal to \*(UA.
8643 .Sy Note
8644 that this variable will only be queried once at program startup and can
8645 thus only be specified in resource files or on the command line.
8648 .It Va toplines
8649 If defined, gives the number of lines of a message to be displayed
8650 with the command
8651 .Ic top ;
8652 if unset, the first five lines are printed, if set to 0 the variable
8653 .Va screen
8654 is inspected.
8655 If the value is negative then its absolute value will be used for right
8656 shifting the
8657 .Va screen
8658 height;  (shifting bitwise is like dividing algorithmically, but since
8659 it takes away bits the value decreases pretty fast).
8662 .It Va topsqueeze
8663 \*(BO If set then the
8664 .Ic top
8665 command series will strip adjacent empty lines and quotations.
8668 .It Va ttycharset
8669 The character set of the terminal \*(UA operates on,
8670 and the one and only supported character set that \*(UA can use if no
8671 character set conversion capabilities have been compiled into it,
8672 in which case it defaults to ISO-8859-1 unless it can deduce a value
8673 from the
8674 .Ev LC_CTYPE
8675 locale environment.
8676 Refer to the section
8677 .Sx "Character sets"
8678 for the complete picture about character sets.
8681 .It Va typescript-mode
8682 \*(BO A special multiplex variable that disables all variables and
8683 settings which result in behaviour that interferes with running \*(UA in
8684 .Xr script 1 ,
8685 e.g., it sets
8686 .Va colour-disable ,
8687 .Va line-editor-disable
8688 and (before startup completed only)
8689 .Va termcap-disable .
8690 Unsetting it doesn't restore the former state of the covered settings.
8693 .It Va umask
8694 For a safety-by-default policy \*(UA sets its process
8695 .Xr umask 2
8697 .Ql 0077 ,
8698 but this variable can be used to override that:
8699 set it to an empty value to don't change the (current) setting,
8700 otherwise the process file mode creation mask is updated to the new value.
8701 Child processes inherit the process file mode creation mask.
8703 .Mx Va user
8704 .It Va user-HOST , user
8705 \*(IN Variable chain that sets a global fallback user name, which is
8706 used in case none has been given in the protocol and account-specific
8707 URL.
8708 This variable defaults to the name of the user who runs \*(UA.
8711 .It Va v15-compat
8712 \*(BO Setting this option enables upward compatibility with \*(UA
8713 version 15.0 in respect to which configuration options are available and
8714 how they are handled.
8715 This manual uses \*(IN and \*(OU to refer to the new and the old way of
8716 doing things, respectively.
8719 .It Va verbose
8720 \*(BO Setting this option, also controllable via the command line option
8721 .Fl v ,
8722 causes \*(UA to be more verbose, e.g., it will display obsoletion
8723 warnings and SSL/TLS certificate chains.
8724 Even though marked \*(BO this option may be set twice in order to
8725 increase the level of verbosity even more, in which case even details of
8726 the actual message delivery and protocol conversations are shown.
8727 A single
8728 .Pf no Va verbose
8729 is sufficient to disable verbosity as such.
8735 .It Va version , version-major , version-minor , version-update
8736 \*(RO \*(UA version information: the first variable contains a string
8737 containing the complete version identification, the latter three contain
8738 only digits: the major, minor and update version numbers.
8739 The output of the command
8740 .Ic version
8741 will include this information.
8744 .It Va writebackedited
8745 If this variable is set messages modified using the
8746 .Ic edit
8748 .Ic visual
8749 commands are written back to the current folder when it is quit;
8750 it is only honoured for writable folders in MBOX format, though.
8751 Note that the editor will be pointed to the raw message content in that
8752 case, i.e., neither MIME decoding nor decryption will have been
8753 performed, and proper RFC 4155
8754 .Ql From_
8755 quoting of newly added or edited content is also left as an excercise to
8756 the user.
8758 .\" }}} (Variables)
8759 .\" }}} (INTERNAL VARIABLES)
8762 .\" .Sh ENVIRONMENT {{{
8763 .Sh ENVIRONMENT
8765 The term
8766 .Dq environment variable
8767 should be considered an indication that these variables are either
8768 standardized as vivid parts of process environments, or that they are
8769 commonly found in there.
8770 The process environment is inherited from the
8771 .Xr sh 1
8772 once \*(UA is started, and unless otherwise explicitly noted handling of
8773 the following variables transparently integrates into that of the
8774 .Sx "INTERNAL VARIABLES"
8775 from \*(UA's point of view.
8776 This means that, e.g., they can be managed via
8777 .Ic set
8779 .Ic unset ,
8780 causing automatic program environment updates (to be inherited by
8781 newly created child processes).
8784 In order to transparently integrate other environment variables equally
8785 they need to be imported (linked) with the command
8786 .Ic environ .
8787 This command can also be used to set and unset non-integrated
8788 environment variables from scratch, sufficient system support provided.
8789 The following example, applicable to a POSIX shell, sets the
8790 .Ev COLUMNS
8791 environment variable for \*(UA only, and beforehand exports the
8792 .Ev EDITOR
8793 in order to affect any further processing in the running shell:
8795 .Bd -literal -offset indent
8796 $ EDITOR="vim -u ${HOME}/.vimrc"
8797 $ export EDITOR
8798 $ COLUMNS=80 \*(uA -R
8801 .Bl -tag -width ".It Ev _AILR_"
8803 .It Ev COLUMNS
8804 The user's preferred width in column positions for the terminal screen
8805 or window.
8806 Queried and used once on program startup, actively managed for child
8807 processes and the MLE (see
8808 .Sx "On terminal control and line editor" )
8809 in interactive mode thereafter.
8812 .It Ev DEAD
8813 The name of the (mailbox)
8814 .Ic file
8815 to use for saving aborted messages if
8816 .Va save
8817 is set; this defaults to
8818 .Pa dead.letter
8819 in the user's
8820 .Ev HOME
8821 directory.
8822 If the variable
8823 .Va debug
8824 is set no output will be generated, otherwise the contents of the file
8825 will be replaced.
8828 .It Ev EDITOR
8829 Pathname of the text editor to use in the
8830 .Ic edit
8831 command and
8832 .Ic ~e
8833 .Sx "TILDE ESCAPES" .
8834 A default editor is used if this value is not defined.
8837 .It Ev HOME
8838 The user's home directory.
8839 This variable is only used when it resides in the process environment.
8846 .It Ev LANG , LC_ALL , LC_COLLATE , LC_CTYPE , LC_MESSAGES
8848 .Xr locale 7
8850 .Sx "Character sets" .
8853 .It Ev LINES
8854 The user's preferred number of lines on a page or the vertical screen
8855 or window size in lines.
8856 Queried and used once on program startup, actively managed for child
8857 processes in interactive mode thereafter.
8860 .It Ev LISTER
8861 Pathname of the directory lister to use in the
8862 .Ic folders
8863 command when operating on local mailboxes.
8864 Default is
8865 .Xr ls 1
8866 (path search through
8867 .Ev SHELL ) .
8870 .It Ev LOGNAME
8871 Upon startup \*(UA will actively ensure that this variable refers to the
8872 name of the user who runs \*(UA, in order to be able to pass a verified
8873 name to any newly created child process.
8876 .It Ev MAIL
8877 Is used as the user's primary system mailbox, unless
8878 .Va inbox
8879 is set, see
8880 .Ic file .
8881 This is assumed to be an absolute pathname.
8884 .It Ev MAILCAPS
8885 \*(OP Overrides the default path search for
8886 .Sx "The Mailcap files" ,
8887 which is defined in the standard RFC 1524 as
8888 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
8889 .\" TODO we should have a mailcaps-default virtual RDONLY option!
8890 (\*(UA makes it a configuration option, however.)
8891 Note this is not a search path, but a path search.
8894 .It Ev MAILRC
8895 Is used as a startup file instead of
8896 .Pa \*(ur
8897 if set.
8898 When \*(UA scripts are invoked on behalf of other users,
8899 either this variable should be set to
8900 .Pa /dev/null
8901 or the
8902 .Fl \&:
8903 command line option should be used in order to avoid side-effects from
8904 reading their configuration files.
8905 This variable is only used when it resides in the process environment.
8908 .It Ev MBOX
8909 The name of the user's mbox file.
8910 A logical subset of the special conventions that are documented for the
8911 .Ic file
8912 command and the
8913 .Va folder
8914 option may be used.
8915 The fallback default is
8916 .Pa mbox
8917 in the user's
8918 .Ev HOME
8919 directory.
8920 Traditionally this secondary mailbox is used as the file to save
8921 messages from the primary system mailbox that have been read.
8922 Also see
8923 .Sx "Message states" .
8926 .It Ev NAIL_NO_SYSTEM_RC
8927 If this variable is set then reading of
8928 .Pa \*(UR
8929 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
8930 had been started up with the option
8931 .Fl n .
8932 This variable is only used when it resides in the process environment.
8935 .It Ev NETRC
8936 \*(IN\*(OP This variable overrides the default location of the user's
8937 .Pa .netrc
8938 file.
8941 .It Ev PAGER
8942 Pathname of the program to use for backing the command
8943 .Ic more ,
8944 and when the
8945 .Va crt
8946 variable enforces usage of a pager for output.
8947 The default paginator is
8948 .Xr more 1
8949 (path search through
8950 .Ev SHELL ) .
8952 \*(UA inspects the contents of this variable: if its contains the string
8953 .Dq less
8954 then a non-existing environment variable
8955 .Va LESS
8956 will be set to
8957 .Ql FRXi ,
8958 .Ql FRi
8960 .Ql Ri ,
8961 dependent on whether terminal control support is available and whether
8962 that supports full (alternative) screen mode or not (also see
8963 .Sx "On terminal control and line editor" ) .
8964 Likewise for
8965 .Dq lv
8966 .Va LV
8967 will optionally be set to
8968 .Dq -c .
8969 Alse see
8970 .Va colour-pager .
8973 .It Ev PATH
8974 A colon-separated list of directories that is searched by the shell when
8975 looking for commands, e.g.,
8976 .Ql /bin:/usr/bin:/usr/local/bin .
8979 .It Ev SHELL
8980 The shell to use for the commands
8981 .Ic \&! ,
8982 .Ic shell ,
8984 .Ic ~!
8985 .Sx "TILDE ESCAPES"
8986 and when starting subprocesses.
8987 A default shell is used if this option is not defined.
8990 .It Ev SOURCE_DATE_EPOCH
8991 If set, this specifies a time in seconds since the Unix epoch
8992 (1970-01-01) to be used in place of the current time.
8993 This is for the sake of reproduceability of tests, to be used during
8994 development or by software packagers.
8997 .It Ev TERM
8998 \*(OP The terminal type for which output is to be prepared.
8999 For extended colour and font control please refer to
9000 .Sx "Coloured display" ,
9001 and for terminal management in general to
9002 .Sx "On terminal control and line editor" .
9005 .It Ev TMPDIR
9006 Used as directory for temporary files instead of
9007 .Pa /tmp ,
9008 if set.
9009 This variable is only used when it resides in the process environment.
9012 .It Ev USER
9013 Identical to
9014 .Ev LOGNAME
9015 (see there), but this variable is not standardized, should therefore not
9016 be used, and is only corrected if already set.
9019 .It Ev VISUAL
9020 Pathname of the text editor to use in the
9021 .Ic visual
9022 command and
9023 .Ic ~v
9024 .Sx "TILDE ESCAPES" .
9026 .\" }}}
9029 .\" .Sh FILES {{{
9030 .Sh FILES
9032 .Bl -tag -width ".It Pa _etc/mime.type_"
9033 .It Pa \*(ur
9034 File giving initial commands.
9036 .It Pa \*(UR
9037 System wide initialization file.
9040 .It Pa ~/.mailcap
9041 \*(OP Personal MIME type handler definition file, see
9042 .Sx "The Mailcap files" .
9043 (RFC 1524 location, the actual path is a configuration option.)
9046 .It Pa /etc/mailcap
9047 \*(OP System wide MIME type handler definition file, see
9048 .Sx "The Mailcap files" .
9049 (RFC 1524 location, the actual path is a configuration option.)
9052 .It Pa ~/.mime.types
9053 Personal MIME types, see
9054 .Sx "The mime.types files" .
9057 .It Pa /etc/mime.types
9058 System wide MIME types, see
9059 .Sx "The mime.types files" .
9062 .It Pa ~/.netrc
9063 \*(IN\*(OP The default location of the users
9064 .Pa .netrc
9065 file \(en the section
9066 .Sx "The .netrc file"
9067 documents the file format.
9070 .\" .Ss "The mime.types files" {{{
9071 .Ss "The mime.types files"
9073 When sending messages \*(UA tries to determine the content type of all
9074 attachments.
9075 When displaying message content or attachments \*(UA uses the content
9076 type to decide whether it can directly display data or whether it needs
9077 to deal with content handlers.
9078 It learns about MIME types and how to treat them by reading
9079 .Pa mime.types
9080 files, the loading of which can be controlled by setting the variable
9081 .Va mimetypes-load-control .
9082 (The command
9083 .Ic mimetype
9084 can also be used to deal with MIME types.)
9085 .Pa mime.types
9086 files have the following syntax:
9089 .Dl type/subtype extension [extension ...]
9092 where
9093 .Ql type/subtype
9094 are strings describing the file contents, and one or multiple
9095 .Ql extension Ns
9096 s, separated by whitespace, name the part of a filename starting after
9097 the last dot (of interest).
9098 Comments may be introduced anywhere on a line with a number sign
9099 .Ql # ,
9100 causing the remaining line to be discarded.
9102 \*(UA also supports an extended, non-portable syntax in specially
9103 crafted files, which can be loaded via the alternative value syntax of
9104 .Va mimetypes-load-control
9105 and prepends an optional
9106 .Ql type-marker :
9109 .Dl [type-marker ]type/subtype extension [extension ...]
9112 The following type markers are supported:
9115 .Bl -tag -compact -offset indent -width ".It Ar _n_u"
9116 .It Ar @
9117 Treat message parts with this content as plain text.
9118 .It Ar @t@
9119 The same as plain
9120 .Ar @ .
9121 .It Ar @h@
9122 Treat message parts with this content as HTML tagsoup.
9123 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
9124 the content as plain text instead.
9125 .It Ar @H@
9126 Likewise
9127 .Ar @h@
9128 but instead of falling back to plain text require an explicit content
9129 handler to be defined.
9133 Further reading:
9134 for sending messages:
9135 .Ic mimetype ,
9136 .Va mime-allow-text-controls ,
9137 .Va mimetypes-load-control .
9138 For reading etc. messages:
9139 .Sx "HTML mail and MIME attachments" ,
9140 .Sx "The Mailcap files" ,
9141 .Ic mimetype ,
9142 .Va mime-counter-evidence ,
9143 .Va mimetypes-load-control ,
9144 .Va pipe-TYPE/SUBTYPE ,
9145 .Va pipe-EXTENSION .
9146 .\" }}}
9148 .\" .Ss "The Mailcap files" {{{
9149 .Ss "The Mailcap files"
9151 RFC 1524 defines a
9152 .Dq User Agent Configuration Mechanism
9153 which \*(UA \*(OPally supports.
9154 It defines a file format to be used to inform mail user agent programs
9155 about the locally-installed facilities for handling various data
9156 formats, i.e., about commands and how they can be used to display, edit
9157 etc. MIME part contents, as well as a default path search that includes
9158 multiple possible locations of
9159 .Dq mailcap
9160 files and the
9161 .Ev MAILCAPS
9162 environment variable that can be used to overwrite that (repeating here
9163 that it is not a search path, but instead a path search specification).
9164 Any existing files will be loaded in sequence, appending any content to
9165 the list of MIME type handler directives.
9168 .Dq Mailcap
9169 files consist of a set of newline separated entries.
9170 Comment lines start with a number sign
9171 .Ql #
9172 (in the first column!) and are ignored.
9173 Empty lines are also ignored.
9174 All other lines form individual entries that must adhere to the syntax
9175 described below.
9176 To extend a single entry (not comment) its line can be continued on
9177 follow lines if newline characters are
9178 .Dq escaped
9179 by preceding them with the reverse solidus character
9180 .Ql \e .
9181 The standard doesn't specify how leading whitespace of follow lines is
9182 to be treated, therefore \*(UA retains it.
9185 .Dq Mailcap
9186 entries consist of a number of semicolon
9187 .Ql \&;
9188 separated fields, and the reverse solidus
9189 .Ql \e
9190 character can be used to escape any following character including
9191 semicolon and itself.
9192 The first two fields are mandatory and must occur in the specified
9193 order, the remaining fields are optional and may appear in any order.
9194 Leading and trailing whitespace of content is ignored (removed).
9197 The first field defines the MIME
9198 .Ql TYPE/SUBTYPE
9199 the entry is about to handle (case-insensitively, and no reverse solidus
9200 escaping is possible in this field).
9201 If the subtype is specified as an asterisk
9202 .Ql *
9203 the entry is meant to match all subtypes of the named type, e.g.,
9204 .Ql audio/*
9205 would match any audio type.
9206 The second field defines the shell command which shall be used to
9207 .Dq display
9208 MIME parts of the given type; it is implicitly called the
9209 .Cd view
9210 command.
9213 For data
9214 .Dq consuming
9215 shell commands message (MIME part) data is passed via standard input
9216 unless the given shell command includes one or more instances of the
9217 (unquoted) string
9218 .Ql %s ,
9219 in which case these instances will be replaced with a temporary filename
9220 and the data will have been stored in the file that is being pointed to.
9221 Likewise, for data
9222 .Dq producing
9223 shell commands data is assumed to be generated on standard output unless
9224 the given command includes (one ore multiple)
9225 .Ql %s .
9226 In any case any given
9227 .Ql %s
9228 format is replaced with a(n already) properly quoted filename.
9229 Note that when a command makes use of a temporary file via
9230 .Ql %s
9231 then \*(UA will remove it again, as if the
9232 .Cd x-mailx-tmpfile ,
9233 .Cd x-mailx-tmpfile-fill
9235 .Cd x-mailx-tmpfile-unlink
9236 flags had been set; see below for more.
9239 The optional fields either define a shell command or an attribute (flag)
9240 value, the latter being a single word and the former being a keyword
9241 naming the field followed by an equals sign
9242 .Ql =
9243 succeeded by a shell command, and as usual for any
9244 .Dq Mailcap
9245 content any whitespace surrounding the equals sign will be removed, too.
9246 Optional fields include the following:
9249 .Bl -tag -width textualnewlines
9250 .It Cd compose
9251 A program that can be used to compose a new body or body part in the
9252 given format.
9253 (Currently unused.)
9255 .It Cd composetyped
9256 Similar to the
9257 .Cd compose
9258 field, but is to be used when the composing program needs to specify the
9259 .Ql Content-type:
9260 header field to be applied to the composed data.
9261 (Currently unused.)
9263 .It Cd edit
9264 A program that can be used to edit a body or body part in the given
9265 format.
9266 (Currently unused.)
9268 .It Cd print
9269 A program that can be used to print a message or body part in the given
9270 format.
9271 (Currently unused.)
9273 .It Cd test
9274 Specifies a program to be run to test some condition, e.g., the machine
9275 architecture, or the window system in use, to determine whether or not
9276 this mailcap entry applies.
9277 If the test fails, a subsequent mailcap entry should be sought; also see
9278 .Cd x-mailx-test-once .
9280 .It Cd needsterminal
9281 This flag field indicates that the given shell command must be run on
9282 an interactive terminal.
9283 \*(UA will temporarily release the terminal to the given command in
9284 interactive mode, in non-interactive mode this entry will be entirely
9285 ignored; this flag implies
9286 .Cd x-mailx-noquote .
9288 .It Cd copiousoutput
9289 A flag field which indicates that the output of the
9290 .Cd view
9291 command will be an extended stream of textual output that can be
9292 (re)integrated into \*(UA's normal visual display.
9293 It is mutually exclusive with
9294 .Cd needsterminal
9295 and implies
9296 .Cd x-mailx-always .
9298 .It Cd textualnewlines
9299 A flag field which indicates that this type of data is line-oriented and
9300 that, if encoded in
9301 .Ql base64 ,
9302 all newlines should be converted to canonical form (CRLF) before
9303 encoding, and will be in that form after decoding.
9304 (Currently unused.)
9306 .It Cd nametemplate
9307 This field gives a file name format, in which
9308 .Ql %s
9309 will be replaced by a random string, the joined combination of which
9310 will be used as the filename denoted by
9311 .Ev NAIL_FILENAME_TEMPORARY .
9312 One could specify that a GIF file being passed to an image viewer should
9313 have a name ending in
9314 .Ql .gif
9315 by using
9316 .Ql nametemplate=%s.gif .
9317 Note that \*(UA ignores the name template unless that solely specifies
9318 a filename suffix that consists of (ASCII) alphabetic and numeric
9319 characters, the underscore and dot only.
9321 .It Cd x11-bitmap
9322 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
9323 icon to be used to visually denote the presence of this kind of data.
9324 This field is not used by \*(UA.
9326 .It Cd description
9327 A textual description that describes this type of data.
9329 .It Cd x-mailx-always
9330 Extension flag field that denotes that the given
9331 .Cd view
9332 command shall be executed even if multiple messages will be displayed
9333 at once.
9334 Normally messages which require external viewers that produce output
9335 which doesn't integrate into \*(UA's visual display (i.e., don't have
9336 .Cd copiousoutput
9337 set) have to be addressed directly and individually.
9338 (To avoid cases where, e.g., a thousand PDF viewer instances are spawned
9339 in sequence.)
9341 .It Cd x-mailx-even-if-not-interactive
9342 An extension flag test field \(em by default handlers without
9343 .Cd copiousoutput
9344 are entirely ignored in non-interactive mode, but if this flag is set
9345 then their use will be considered.
9346 It is an error if this flag is set for commands that use the flag
9347 .Cd needsterminal .
9349 .It Cd x-mailx-noquote
9350 An extension flag field that indicates that even a
9351 .Cd copiousoutput
9352 .Cd view
9353 command shall not be used to generate message quotes
9354 (as it would be by default).
9356 .It Cd x-mailx-async
9357 Extension flag field that denotes that the given
9358 .Cd view
9359 command shall be executed asynchronously, without blocking \*(UA.
9360 Cannot be used in conjunction with
9361 .Cd needsterminal .
9363 .It Cd x-mailx-test-once
9364 Extension flag which denotes whether the given
9365 .Cd test
9366 command shall be evaluated once only and the (boolean) result be cached.
9367 This is handy if some global unchanging condition is to be queried, like
9368 .Dq running under the X Window System .
9370 .It Cd x-mailx-tmpfile
9371 Extension flag field that requests creation of a zero-sized temporary
9372 file, the name of which is to be placed in the environment variable
9373 .Ev NAIL_FILENAME_TEMPORARY .
9374 It is an error to use this flag with commands that include a
9375 .Ql %s
9376 format.
9378 .It Cd x-mailx-tmpfile-fill
9379 Normally the MIME part content is passed to the handler via standard
9380 input; if this flag is set then the data will instead be written into
9381 the implied
9382 .Cd x-mailx-tmpfile .
9383 In order to cause deletion of the temporary file you will have to set
9384 .Cd x-mailx-tmpfile-unlink
9385 explicitly!
9386 It is an error to use this flag with commands that include a
9387 .Ql %s
9388 format.
9390 .It Cd x-mailx-tmpfile-unlink
9391 Extension flag field that requests that the temporary file shall be
9392 deleted automatically when the command loop is entered again at latest.
9393 (Don't use this for asynchronous handlers.)
9394 It is an error to use this flag with commands that include a
9395 .Ql %s
9396 format, or without also setting
9397 .Cd x-mailx-tmpfile
9399 .Cd x-mailx-tmpfile-fill .
9401 .It Cd x-mailx-tmpfile-keep
9402 Using the string
9403 .Ql %s
9404 implies the three tmpfile related flags above, but if you want, e.g.,
9405 .Cd x-mailx-async
9406 and deal with the temporary file yourself, you can add in this flag to
9407 forcefully ignore
9408 .Cd x-mailx-tmpfile-unlink .
9413 The standard includes the possibility to define any number of additional
9414 entry fields, prefixed by
9415 .Ql x- .
9416 Flag fields apply to the entire
9417 .Dq Mailcap
9418 entry \(em in some unusual cases, this may not be desirable, but
9419 differentiation can be accomplished via separate entries, taking
9420 advantage of the fact that subsequent entries are searched if an earlier
9421 one does not provide enough information.
9422 E.g., if a
9423 .Cd view
9424 command needs to specify the
9425 .Cd needsterminal
9426 flag, but the
9427 .Cd compose
9428 command shall not, the following will help out the latter (with enabled
9429 .Va debug
9430 or an increased
9431 .Va verbose
9432 level \*(UA will show information about handler evaluation):
9434 .Bd -literal -offset indent
9435 application/postscript; ps-to-terminal %s; needsterminal
9436 application/postscript; ps-to-terminal %s; compose=idraw %s
9440 In fields any occurrence of the format string
9441 .Ql %t
9442 will be replaced by the
9443 .Ql TYPE/SUBTYPE
9444 specification.
9445 Named parameters from the
9446 .Ql Content-type:
9447 field may be placed in the command execution line using
9448 .Ql %{
9449 followed by the parameter name and a closing
9450 .Ql }
9451 character.
9452 The entire parameter should appear as a single command line argument,
9453 regardless of embedded spaces; thus:
9455 .Bd -literal -offset indent
9456 # Message
9457 Content-type:  multipart/mixed; boundary=42
9459 # Mailcap file
9460 multipart/*; /usr/local/bin/showmulti \e
9461   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
9463 # Executed shell command
9464 /usr/local/bin/showmulti multipart/mixed 42
9468 .\" TODO v15: Mailcap: %n,%F
9469 Note that \*(UA doesn't support handlers for multipart MIME parts as
9470 shown in this example (as of today).
9471 \*(UA doesn't support the additional formats
9472 .Ql %n
9474 .Ql %F .
9475 An example file, also showing how to properly deal with the expansion of
9476 .Ql %s ,
9477 which includes any quotes that are necessary to make it a valid shell
9478 argument by itself and thus will cause undesired behaviour when placed
9479 in additional user-provided quotes:
9481 .Bd -literal -offset indent
9482 # Comment line
9483 text/richtext; richtext %s; copiousoutput
9485 text/x-perl; perl -cWT %s
9487 application/pdf; \e
9488   infile=%s\e; \e
9489     trap "rm -f ${infile}" EXIT\e; \e
9490     trap "exit 75" INT QUIT TERM\e; \e
9491     mupdf %s; \e
9492   x-mailx-async; x-mailx-tmpfile-keep
9494 application/*; echo "This is \e"%t\e" but \e
9495     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
9496   copiousoutput; x-mailx-noquote
9500 Further reading:
9501 .Sx "HTML mail and MIME attachments" ,
9502 .Sx "The mime.types files" ,
9503 .Ic mimetype ,
9504 .Ev MAILCAPS ,
9505 .Va mime-counter-evidence ,
9506 .Va pipe-TYPE/SUBTYPE ,
9507 .Va pipe-EXTENSION .
9508 .\" }}}
9510 .\" .Ss "The .netrc file" {{{
9511 .Ss "The .netrc file"
9514 .Pa .netrc
9515 file contains user credentials for machine accounts.
9516 The default location in the user's
9517 .Ev HOME
9518 directory may be overridden by the
9519 .Ev NETRC
9520 environment variable.
9521 The file consists of space, tabulator or newline separated tokens.
9522 \*(UA implements a parser that supports a superset of the original BSD
9523 syntax, but users should nonetheless be aware of portability glitches
9524 of that file format, shall their
9525 .Pa .netrc
9526 be usable across multiple programs and platforms:
9529 .Bl -bullet -compact
9531 BSD doesn't support single, but only double quotation marks, e.g.,
9532 .Ql password="pass with spaces" .
9534 BSD (only?) supports escaping of single characters via a reverse solidus
9535 (e.g., a space can be escaped via
9536 .Ql \e\0 ) ,
9537 in- as well as outside of a quoted string.
9539 BSD doesn't require the final quotation mark of the final user input token.
9541 The original BSD (Berknet) parser also supported a format which allowed
9542 tokens to be separated with commas \(en whereas at least Hewlett-Packard
9543 still seems to support this syntax, \*(UA does not!
9545 As a non-portable extension some widely-used programs support
9546 shell-style comments: if an input line starts, after any amount of
9547 whitespace, with a number sign
9548 .Ql # ,
9549 then the rest of the line is ignored.
9551 Whereas other programs may require that the
9552 .Pa .netrc
9553 file is accessible by only the user if it contains a
9554 .Cd password
9555 token for any other
9556 .Cd login
9557 than
9558 .Dq anonymous ,
9559 \*(UA will always require these strict permissions.
9563 Of the following list of supported tokens \*(UA only uses (and caches)
9564 .Cd machine ,
9565 .Cd login
9567 .Cd password .
9568 At runtime the command
9569 .Ic netrc
9570 can be used to control \*(UA's
9571 .Pa .netrc
9572 cache.
9574 .Bl -tag -width password
9575 .It Cd machine Ar name
9576 The hostname of the entries' machine, lowercase-normalized by \*(UA
9577 before use.
9578 Any further file content, until either end-of-file or the occurrence
9579 of another
9580 .Cd machine
9581 or a
9582 .Cd default
9583 first-class token is bound (only related) to the machine
9584 .Ar name .
9586 As an extension that shouldn't be the cause of any worries
9587 \*(UA supports a single wildcard prefix for
9588 .Ar name :
9589 .Bd -literal -offset indent
9590 machine *.example.com login USER password PASS
9591 machine pop3.example.com login USER password PASS
9592 machine smtp.example.com login USER password PASS
9595 which would match
9596 .Ql xy.example.com
9597 as well as
9598 .Ql pop3.example.com ,
9599 but neither
9600 .Ql example.com
9602 .Ql local.smtp.example.com .
9603 Note that in the example neither
9604 .Ql pop3.example.com
9606 .Ql smtp.example.com
9607 will be matched by the wildcard, since the exact matches take
9608 precedence (it is however faster to specify it the other way around).
9610 .It Cd default
9611 This is the same as
9612 .Cd machine
9613 except that it is a fallback entry that is used shall none of the
9614 specified machines match; only one default token may be specified,
9615 and it must be the last first-class token.
9617 .It Cd login Ar name
9618 The user name on the remote machine.
9620 .It Cd password Ar string
9621 The user's password on the remote machine.
9623 .It Cd account Ar string
9624 Supply an additional account password.
9625 This is merely for FTP purposes.
9627 .It Cd macdef Ar name
9628 Define a macro.
9629 A macro is defined with the specified
9630 .Ar name ;
9631 it is formed from all lines beginning with the next line and continuing
9632 until a blank line is (consecutive newline characters are) encountered.
9633 (Note that
9634 .Cd macdef
9635 entries cannot be utilized by multiple machines, too, but must be
9636 defined following the
9637 .Ic machine
9638 they are intended to be used with.)
9639 If a macro named
9640 .Ar init
9641 exists, it is automatically run as the last step of the login process.
9642 This is merely for FTP purposes.
9644 .\" }}}
9646 .\" }}}
9649 .\" .Sh EXAMPLES {{{
9650 .Sh EXAMPLES
9652 .\" .Ss "An example configuration" {{{
9653 .Ss "An example configuration"
9655 .Bd -literal -offset indent
9656 # This example assumes v15.0 compatibility mode
9657 set v15-compat
9659 # Where are the up-to-date SSL certificates?
9660 #set ssl-ca-dir=/etc/ssl/certs
9661 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
9663 # (Since we manage up-to-date ones explicitly, don't use any,
9664 # possibly outdated, default certificates shipped with OpenSSL)
9665 set ssl-no-default-ca
9667 # Don't use protocols older than TLS v1.2.
9668 # Change this only when the remote server doesn't support it:
9669 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
9670 # such explicit exceptions, then
9671 set ssl-protocol='-ALL,+TLSv1.2'
9673 # Explicitly define the list of ciphers, which may improve security,
9674 # especially with protocols older than TLS v1.2.  See ciphers(1).
9675 # Including "@STRENGTH" will sort the final list by algorithm strength.
9676 # In reality it is possibly best to only use ssl-cipher-list-HOST
9677 # (or -USER@HOST), as necessary, again..
9678 set ssl-cipher-list=TLSv1.2:!aNULL:!eNULL:!MEDIUM:!LOW:!EXPORT:@STRENGTH
9679 # ALL:!aNULL:!MEDIUM:!LOW:!MD5:!RC4:!EXPORT:@STRENGTH
9681 # Request strict transport security checks!
9682 set ssl-verify=strict
9684 # Essential setting: select allowed character sets
9685 set sendcharsets=utf-8,iso-8859-1
9687 # A very kind option: when replying to a message, first try to
9688 # use the same encoding that the original poster used herself!
9689 set reply-in-same-charset
9691 # When replying to or forwarding a message the comment and name
9692 # parts of email addresses are removed unless this variable is set
9693 set fullnames
9695 # When sending messages, wait until the Mail-Transfer-Agent finishs.
9696 # Only like this you'll be able to see errors reported through the
9697 # exit status of the MTA (including the builtin SMTP one)!
9698 set sendwait
9700 # Only use builtin MIME types, no mime.types(5) files
9701 set mimetypes-load-control
9703 # Default directory where we act in (relative to $HOME)
9704 set folder=mail
9705 # A leading "+" (often) means: under *folder*
9706 # *record* is used to save copies of sent messages
9707 set MBOX=+mbox.mbox record=+sent.mbox DEAD=+dead.txt
9709 # Make "file mymbox" and "file myrec" go to..
9710 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
9712 # Not really optional, e.g., for S/MIME
9713 set from='Your Name <address@exam.ple>'
9715 # It may be necessary to set hostname and/or smtp-hostname
9716 # if the "SERVER" of mta and "domain" of from don't match.
9717 # The `urlencode' command can be used to encode USER and PASS
9718 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
9719     smtp-auth=login/plain... \e
9720     smtp-use-starttls
9722 # Never refuse to start into interactive mode, and more
9723 set emptystart \e
9724     colour-pager crt= \e
9725     followup-to followup-to-honour=ask-yes \e
9726     history-file=+.\*(uAhist history-size=-1 history-gabby \e
9727     mime-counter-evidence=0xE \e
9728     prompt='?\e?[\e$ \e@]\e& ' \e
9729     reply-to-honour=ask-yes \e
9730     umask=
9732 # When `t'yping messages, show only these headers
9733 # (use `T'ype for all headers and `S'how for raw message)
9734 retain date from to cc subject
9736 # Some mailing lists
9737 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
9738 mlsubscribe '^xfans@xfans\e.xyz$'
9740 # A real life example of a very huge free mail provider
9741 account XooglX {
9742   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
9743   set from='Your Name <address@examp.ple>'
9744   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
9747 # Here is a pretty large one which does not allow sending mails
9748 # if there is a domain name mismatch on the SMTP protocol level,
9749 # which would bite us if the value of from does not match, e.g.,
9750 # for people who have a sXXXXeforge project and want to speak
9751 # with the mailing list under their project account (in from),
9752 # still sending the message through their normal mail provider
9753 account XandeX {
9754   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
9755   set from='Your Name <address@exam.ple>'
9756   set mta=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
9757       hostname=yaXXex.com smtp-hostname=
9760 # Create some new commands so that, e.g., `ls /tmp' will..
9761 wysh ghost lls '!ls ${LS_COLOR_FLAG} -aFlrS'
9762 wysh ghost llS '!ls ${LS_COLOR_FLAG} -aFlS'
9763 wysh ghost ls '!ls ${LS_COLOR_FLAG} -aFrS'
9764 wysh ghost lS '!ls ${LS_COLOR_FLAG} -aFS'
9765 wysh ghost lla '!ls ${LS_COLOR_FLAG} -aFlr'
9766 wysh ghost llA '!ls ${LS_COLOR_FLAG} -aFl'
9767 wysh ghost la '!ls ${LS_COLOR_FLAG} -aFr'
9768 wysh ghost lA '!ls ${LS_COLOR_FLAG} -aF'
9769 wysh ghost ll '!ls ${LS_COLOR_FLAG} -aFltr'
9770 wysh ghost lL '!ls ${LS_COLOR_FLAG} -aFlt'
9771 wysh ghost l '!ls ${LS_COLOR_FLAG} -aFtr'
9772 wysh ghost L '!ls ${LS_COLOR_FLAG} -aFt'
9774 # We don't support gpg(1) directly yet.  But simple --clearsign'd
9775 # message parts can be dealt with as follows:
9776 define V {
9777   wysh set pipe-text/plain=$'@*#++=@\e
9778     < "${NAIL_FILENAME_TEMPORARY}" awk \e
9779         -v TMPFILE="${NAIL_FILENAME_TEMPORARY}" \e'\e
9780       BEGIN {done=0}\e
9781       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/{\e
9782         if (done++ != 0)\e
9783           next;\e
9784         print "--- GPG --verify ---";\e
9785         system("gpg --verify " TMPFILE " 2>&1");\e
9786         print "--- GPG --verify ---";\e
9787         print "";\e
9788         next;\e
9789       }\e
9790       /^-----BEGIN PGP SIGNATURE-----/,\e
9791           /^-----END PGP SIGNATURE-----/{\e
9792         next;\e
9793       }\e
9794       {print}\e
9795       \e''
9796   print
9798 ghost V call V
9800 define RK {
9801   !printf 'Key IDs to gpg --recv-keys: ';\e
9802     read keyids;\e
9803     gpg --recv-keys ${keyids};
9805 ghost RK call RK
9809 When storing passwords in
9810 .Pa \*(ur
9811 appropriate permissions should be set on this file with
9812 .Ql $ chmod 0600 \*(ur .
9813 If the \*(OPal
9814 .Va netrc-lookup
9815 is available user credentials can be stored in the central
9816 .Pa .netrc
9817 file instead; e.g., here is a different version of the example account
9818 that sets up SMTP and POP3:
9820 .Bd -literal -offset indent
9821 account XandeX {
9822   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
9823   set from='Your Name <address@exam.ple>'
9824   set netrc-lookup
9825   # Load an encrypted ~/.netrc by uncommenting the next line
9826   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
9828   set mta=smtps://smtp.yXXXXx.ru:465 \e
9829       smtp-hostname= hostname=yXXXXx.com
9830   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
9831   ghost xp fi pop3s://pop.yXXXXx.ru
9836 and, in the
9837 .Pa .netrc
9838 file:
9840 .Bd -literal -offset indent
9841 machine *.yXXXXx.ru login USER password PASS
9845 This configuration should now work just fine:
9848 .Dl $ echo text | \*(uA -vv -AXandeX -s Subject user@exam.ple
9849 .\" }}}
9851 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
9852 .Ss "Signed and encrypted messages with S/MIME"
9854 \*(OP S/MIME provides two central mechanisms:
9855 message signing and message encryption.
9856 A signed message contains some data in addition to the regular text.
9857 The data can be used to verify that the message was sent using a valid
9858 certificate, that the sender's address in the message header matches
9859 that in the certificate, and that the message text has not been altered.
9860 Signing a message does not change its regular text;
9861 it can be read regardless of whether the recipient's software is able to
9862 handle S/MIME.
9865 It is thus usually possible to sign all outgoing messages if so desired.
9866 Encryption, in contrast, makes the message text invisible for all people
9867 except those who have access to the secret decryption key.
9868 To encrypt a message, the specific recipient's public encryption key
9869 must be known.
9870 It is therefore not possible to send encrypted mail to people unless their
9871 key has been retrieved from either previous communication or public key
9872 directories.
9873 A message should always be signed before it is encrypted.
9874 Otherwise, it is still possible that the encrypted message text is
9875 altered.
9878 A central concept to S/MIME is that of the certification authority (CA).
9879 A CA is a trusted institution that issues certificates.
9880 For each of these certificates it can be verified that it really
9881 originates from the CA, provided that the CA's own certificate is
9882 previously known.
9883 A set of CA certificates is usually delivered with OpenSSL and installed
9884 on your system.
9885 If you trust the source of your OpenSSL software installation,
9886 this offers reasonable security for S/MIME on the Internet.
9887 (Otherwise set
9888 .Va ssl-no-default-ca
9889 and use
9890 .Va smime-ca-file
9891 and/or
9892 .Va smime-ca-dir . )
9893 In general, a certificate cannot be more secure than the method its CA
9894 certificate has been retrieved with, though.
9895 Thus if you download a CA certificate from the Internet,
9896 you can only trust the messages you verify using that certificate as
9897 much as you trust the download process.
9900 The first thing you need for participating in S/MIME message exchange is
9901 your personal certificate, including a private key.
9902 The certificate contains public information, in particular your name and
9903 your email address(es), and the public key that is used by others to
9904 encrypt messages for you,
9905 and to verify signed messages they supposedly received from you.
9906 The certificate is included in each signed message you send.
9907 The private key must be kept secret.
9908 It is used to decrypt messages that were previously encrypted with your
9909 public key, and to sign messages.
9912 For personal use it is recommended that you get a S/MIME certificate
9913 from one of the major CAs on the Internet using your WWW browser.
9914 Many CAs offer such certificates for free.
9915 There is also
9916 .Lk https://www.CAcert.org
9917 which issues client and server certificates to members of their
9918 community for free; their root certificate
9919 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
9920 is often not in the default set of trusted CA root certificates, though,
9921 which means you will have to download their root certificate separately
9922 and ensure it is part of our S/MIME certificate validation chain by
9923 including it in
9924 .Va smime-ca-dir
9925 or as a vivid member of the
9926 .Va smime-ca-file .
9927 But let's take a step-by-step tour on how to setup S/MIME with
9928 a certificate from CAcert.org despite this situation!
9931 First of all you will have to become a member of the CAcert.org
9932 community, simply by registrating yourself via the web interface.
9933 Once you are, create and verify all email addresses you want to be able
9934 to create signed and encrypted messages for/with using the corresponding
9935 entries of the web interface.
9936 Now ready to create S/MIME certificates, so let's create a new
9937 .Dq client certificate ,
9938 ensure to include all email addresses that should be covered by the
9939 certificate in the following web form, and also to use your name as the
9940 .Dq common name .
9943 Create a private key and a certificate request on your local computer
9944 (please see the manual pages of the used commands for more in-depth
9945 knowledge on what the used arguments etc. do):
9948 .Dl openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
9951 Afterwards copy-and-paste the content of
9952 .Dq creq.pem
9953 into the certificate-request (CSR) field of the web form on the
9954 CAcert.org website (you may need to unfold some
9955 .Dq advanced options
9956 to see the corresponding text field).
9957 This last step will ensure that your private key (which never left your
9958 box) and the certificate belong together (through the public key that
9959 will find its way into the certificate via the certificate-request).
9960 You are now ready and can create your CAcert certified certificate.
9961 Download and store or copy-and-paste it as
9962 .Dq pub.crt .
9965 Yay.
9966 In order to use your new S/MIME setup you will have to create
9967 a combined private key/public key (certificate) file:
9970 .Dl cat key.pem pub.crt > ME@HERE.com.paired
9973 This is the file \*(UA will work with.
9974 If you have created your private key with a passphrase then \*(UA will
9975 ask you for it whenever a message is signed or decrypted.
9976 Set the following variables to henceforth use S/MIME (setting
9977 .Va smime-ca-file
9978 is of interest for verification only):
9980 .Bd -literal -offset indent
9981 set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
9982   smime-sign-cert=ME@HERE.com.paired \e
9983   smime-sign-message-digest=SHA256 \e
9984   smime-sign
9988 From each signed message you send, the recipient can fetch your
9989 certificate and use it to send encrypted mail back to you.
9990 Accordingly if somebody sends you a signed message, you can do the same,
9991 and use the
9992 .Ic verify
9993 command to check the validity of the certificate.
9996 Variables of interest for S/MIME signing:
9997 .Va smime-ca-dir ,
9998 .Va smime-ca-file ,
9999 .Va smime-crl-dir ,
10000 .Va smime-crl-file ,
10001 .Va smime-no-default-ca ,
10002 .Va smime-sign ,
10003 .Va smime-sign-cert ,
10004 .Va smime-sign-include-certs
10006 .Va smime-sign-message-digest .
10009 After it has been verified save the certificate via
10010 .Ic certsave
10011 and tell \*(UA that it should use it for encryption for further
10012 communication with that somebody:
10014 .Bd -literal -offset indent
10015 certsave FILENAME
10016 set smime-encrypt-USER@HOST=FILENAME \e
10017     smime-cipher-USER@HOST=AES256
10021 Additional variables of interest for S/MIME en- and decryption:
10022 .Va smime-cipher
10024 .Va smime-encrypt-USER@HOST .
10027 You should carefully consider if you prefer to store encrypted messages
10028 in decrypted form.
10029 If you do, anybody who has access to your mail folders can read them,
10030 but if you do not, you might be unable to read them yourself later if
10031 you happen to lose your private key.
10033 .Ic decrypt
10034 command saves messages in decrypted form, while the
10035 .Ic save , copy ,
10037 .Ic move
10038 commands leave them encrypted.
10041 Note that neither S/MIME signing nor encryption applies to message
10042 subjects or other header fields yet.
10043 Thus they may not contain sensitive information for encrypted messages,
10044 and cannot be trusted even if the message content has been verified.
10045 When sending signed messages,
10046 it is recommended to repeat any important header information in the
10047 message text.
10048 .\" }}}
10050 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
10051 .Ss "Using CRLs with S/MIME or SSL/TLS"
10053 \*(OP Certification authorities (CAs) issue certificate revocation
10054 lists (CRLs) on a regular basis.
10055 These lists contain the serial numbers of certificates that have been
10056 declared invalid after they have been issued.
10057 Such usually happens because the private key for the certificate has
10058 been compromised,
10059 because the owner of the certificate has left the organization that is
10060 mentioned in the certificate, etc.
10061 To seriously use S/MIME or SSL/TLS verification,
10062 an up-to-date CRL is required for each trusted CA.
10063 There is otherwise no method to distinguish between valid and
10064 invalidated certificates.
10065 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
10066 the Internet, so you have to retrieve them by some external mechanism.
10069 \*(UA accepts CRLs in PEM format only;
10070 CRLs in DER format must be converted, like, e.\|g.:
10073 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
10076 To tell \*(UA about the CRLs, a directory that contains all CRL files
10077 (and no other files) must be created.
10079 .Va smime-crl-dir
10081 .Va ssl-crl-dir
10082 variables, respectively, must then be set to point to that directory.
10083 After that, \*(UA requires a CRL to be present for each CA that is used
10084 to verify a certificate.
10085 .\" }}}
10087 .\" .Ss "Handling spam" {{{
10088 .Ss "Handling spam"
10090 \*(OP \*(UA can make use of several spam interfaces for the purpose of
10091 identification of, and, in general, dealing with spam messages.
10092 A precondition of most commands in order to function is that the
10093 .Va spam-interface
10094 variable is set to one of the supported interfaces.
10095 Once messages have been identified as spam their (volatile)
10096 .Ql is-spam
10097 state can be prompted: the
10098 .Ql Ar :s
10100 .Ql Ar :S
10101 message specifications will address respective messages and their
10102 .Va attrlist
10103 entries will be used when displaying the
10104 .Va headline
10105 in the header display.
10107 .Bl -bullet
10109 .Ic spamrate
10110 rates the given messages and sets their
10111 .Ql is-spam
10112 flag accordingly.
10113 If the spam interface offers spam scores those can also be displayed in
10114 the header display by including the
10115 .Ql %$
10116 format in the
10117 .Va headline
10118 variable.
10120 .Ic spamham ,
10121 .Ic spamspam
10123 .Ic spamforget
10124 will interact with the Bayesian filter of the chosen interface and learn
10125 the given messages as
10126 .Dq ham
10128 .Dq spam ,
10129 respectively; the last command can be used to cause
10130 .Dq unlearning
10131 of messages; it adheres to their current
10132 .Ql is-spam
10133 state and thus reverts previous teachings.
10135 .Ic spamclear
10137 .Ic spamset
10138 will simply set and clear, respectively, the mentioned volatile
10139 .Ql is-spam
10140 message flag, without any interface interaction.
10145 .Xr spamassassin 1
10146 based
10147 .Va spam-interface
10148 .Ql spamc
10149 requires a running instance of the
10150 .Xr spamd 1
10151 server in order to function, started with the option
10152 .Fl -allow-tell
10153 shall Bayesian filter learning be possible.
10155 .Bd -literal -offset indent
10156 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
10157 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
10158     --daemonize [--local] [--allow-tell]
10162 Thereafter \*(UA can make use of these interfaces:
10164 .Bd -literal -offset indent
10165 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
10166     -Sspamc-command=/usr/local/bin/spamc \e
10167     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
10169 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
10170     -Sspamc-command=/usr/local/bin/spamc \e
10171     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
10175 Using the generic filter approach allows usage of programs like
10176 .Xr bogofilter 1 .
10177 Here is an example, requiring it to be accessible via
10178 .Ev PATH :
10180 .Bd -literal -offset indent
10181 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
10182     -Sspamfilter-ham="bogofilter -n" \e
10183     -Sspamfilter-noham="bogofilter -N" \e
10184     -Sspamfilter-nospam="bogofilter -S" \e
10185     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
10186     -Sspamfilter-spam="bogofilter -s" \e
10187     -Sspamfilter-rate-scanscore="1;^(.+)$"
10191 Because messages must exist on local storage in order to be scored (or
10192 used for Bayesian filter training), it is possibly a good idea to
10193 perform the local spam check last:
10195 .Bd -literal -offset indent
10196 define spamdelhook {
10197   # Server side DCC
10198   spamset (header x-dcc-brand-metrics "bulk")
10199   # Server-side spamassassin(1)
10200   spamset (header x-spam-flag "YES")
10201   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
10202   move :S +maybe-spam
10203   spamrate :u
10204   del :s
10205   move :S +maybe-spam
10207 set folder-hook-FOLDER=spamdelhook
10211 See also the documentation for the variables
10212 .Va spam-interface , spam-maxsize ,
10213 .Va spamc-command , spamc-arguments , spamc-user ,
10214 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
10215   spamfilter-rate
10217 .Va spamfilter-rate-scanscore .
10218 .\" }}}
10219 .\" }}} (Examples)
10222 .\" .Sh "FAQ" {{{
10223 .Sh "FAQ"
10225 In general it is a good idea to turn on
10226 .Va debug
10227 .Pf ( Fl d )
10228 and / or
10229 .Va verbose
10230 .Pf ( Fl v ,
10231 twice) if something doesn't work well.
10232 Very often a diagnostic message can be produced that leads to the
10233 problems' solution.
10235 .\" .Ss "\*(UA shortly hangs on startup" {{{
10236 .Ss "\*(UA shortly hangs on startup"
10238 This can have two reasons, one is the necessity to wait for a file lock
10239 and can't be helped, the other being that \*(UA calls the function
10240 .Xr uname 2
10241 in order to query the nodename of the box (sometimes the real one is
10242 needed instead of the one represented by the internal variable
10243 .Va hostname ) .
10244 You may have varying success by ensuring that the real hostname and
10245 .Ql localhost
10246 have entries in
10247 .Pa /etc/hosts ,
10248 or, more generally, that the name service is properly setup \(en
10249 and does
10250 .Xr hostname 1
10251 return what you'd expect?
10252 Does this local hostname has a domain suffix?
10253 RFC 6762 standardized the link-local top-level domain
10254 .Ql .local .
10255 .\" }}}
10257 .\" .Ss "\*(UA exits quick, and output is cleared away" {{{
10258 .Ss "\*(UA exits quick, and output is cleared away"
10260 When this happens even with
10261 .Va emptystart
10262 set, then this most likely indicates a problem with the creation of
10263 so-called dotlock files: setting
10264 .Va dotlock-ignore-error
10265 should overcome this situation.
10266 This only avoids symptoms, it doesn't address the problem, though.
10267 Since the output is cleared away \*(UA has support for
10268 .Sx "On terminal control and line editor" ,
10269 and switches to the
10270 .Dq ca-mode ,
10271 which causes the output clearance: by doing
10272 .Ql set termcap='smcup='
10273 this mode can be suppressed, and by setting
10274 .Va verbose
10275 (twice) the actual problem should be reported.
10276 .\" }}}
10278 .\" .Ss "I can't login to Google mail aka GMail" {{{
10279 .Ss "I can't login to Google mail aka GMail"
10281 Since 2014 some free service providers classify programs as
10282 .Dq less secure
10283 unless they use a special authentification method (OAuth 2.0) which
10284 wasn't standardized for non-HTTP protocol authentication token query
10285 until August 2015 (RFC 7628).
10288 Different to Kerberos / GSSAPI, which is developed since the mid of the
10289 1980s, where a user can easily create a local authentication ticket for
10290 her- and himself with the locally installed
10291 .Xr kinit 1
10292 program, that protocol has no such local part but instead requires
10293 a world-wide-web query to create or fetch a token; since there is no
10294 local cache this query has to be performed whenever \*(UA is invoked
10295 from the command line (in interactive sessions situation may differ).
10298 \*(UA doesn't support OAuth.
10299 Because of this it is necessary to declare \*(UA a
10300 .Dq less secure app
10301 (on the providers account web page) in order to read and send mail.
10302 However, it also seems possible to take the following steps instead:
10305 .Bl -enum -compact
10307 give the provider the number of a mobile phone,
10309 enable
10310 .Dq 2-Step Verification ,
10312 create an application specific password (16 characters), and
10314 use that special password instead of your real Google account password in
10315 \*(UA (for more on that see the section
10316 .Sx "On URL syntax and credential lookup" ) .
10318 .\" }}}
10320 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key won't work" {{{
10321 .Ss "Not \(dqdefunctional\(dq, but the editor key won't work"
10323 It can happen that the terminal library (see
10324 .Sx "On terminal control and line editor",
10325 .Ic bind ,
10326 .Va termcap )
10327 reports different codes than the terminal really sends, in which case
10328 \*(UA will tell that a key binding is functional, but won't be able to
10329 recognize it because the received data doesn't match anything expected.
10330 The verbose listing of
10331 .Ic bind Ns
10332 ings will show the byte sequences that are expected.
10335 To overcome the situation, use, e.g., the program
10336 .Xr cat 1 ,
10337 in conjunction with the
10338 .Fl \&\&v
10339 flag if available, to see the byte sequences which are actually produced
10340 by keypresses, and use the variable
10341 .Va termcap
10342 to make \*(UA aware of them.
10343 E.g., the terminal this is typed on produces some false sequences, here
10344 an example showing the shifted home key:
10346 .Bd -literal -offset indent
10347 ? set verbose
10348 ? bind*
10349 # 1B 5B=[ 31=1 3B=; 32=2 48=H
10350   bind base :kHOM z0
10351 ? x
10352 $ cat -v
10353 ^[[H
10354 ? \*(uA -v -Stermcap='kHOM=\eE[H'
10355 ? bind*
10356 # 1B 5B=[ 48=H
10357   bind base :kHOM z0
10359 .\" }}}
10360 .\" }}}
10363 .\" .Sh "SEE ALSO" {{{
10364 .Sh "SEE ALSO"
10366 .Xr bogofilter 1 ,
10367 .Xr gpg 1 ,
10368 .Xr more 1 ,
10369 .Xr newaliases 1 ,
10370 .Xr openssl 1 ,
10371 .Xr sendmail 1 ,
10372 .Xr sh 1 ,
10373 .Xr spamassassin 1 ,
10374 .Xr iconv 3 ,
10375 .Xr setlocale 3 ,
10376 .Xr aliases 5 ,
10377 .Xr termcap 5 ,
10378 .Xr terminfo 5 ,
10379 .Xr locale 7 ,
10380 .Xr mailaddr 7 ,
10381 .Xr re_format 7 ,
10382 .Xr mailwrapper 8 ,
10383 .Xr sendmail 8
10384 .\" }}}
10387 .\" .Sh HISTORY {{{
10388 .Sh HISTORY
10390 M. Douglas McIlroy writes in his article
10391 .Dq A Research UNIX Reader: Annotated Excerpts \
10392 from the Programmer's Manual, 1971-1986
10394 .Xr mail 1
10395 command already appeared in First Edition
10397 in 1971:
10399 .Bd -ragged -offset indent
10400 Electronic mail was there from the start.
10401 Never satisfied with its exact behavior, everybody touched it at one
10402 time or another: to assure the safety of simultaneous access, to improve
10403 privacy, to survive crashes, to exploit uucp, to screen out foreign
10404 freeloaders, or whatever.
10405 Not until v7 did the interface change (Thompson).
10406 Later, as mail became global in its reach, Dave Presotto took charge and
10407 brought order to communications with a grab-bag of external networks
10408 (v8).
10413 Mail was written in 1978 by Kurt Shoens and developed as part of the
10416 distribution until 1995.
10417 Mail has then seen further development in open source
10419 variants, noticeably by Christos Zoulas in
10420 .Pf Net Bx .
10421 Basing upon this Nail, later Heirloom Mailx, was developed by Gunnar
10422 Ritter in the years 2000 until 2008.
10423 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
10424 This man page is derived from
10425 .Dq The Mail Reference Manual
10426 that was originally written by Kurt Shoens.
10427 .\" }}}
10430 .Sh AUTHORS
10432 .An "Kurt Shoens" ,
10433 .An "Edward Wang" ,
10434 .An "Keith Bostic" ,
10435 .An "Christos Zoulas" ,
10436 .An "Gunnar Ritter" ,
10437 .An "Steffen Nurpmeso" Aq Mt s-nail-users@lists.sourceforge.net
10438 (later
10439 .Mt s-mailx@sdaoden.eu ) .
10442 .\" .Sh CAVEATS {{{
10443 .Sh CAVEATS
10445 \*(ID Interrupting an operation via
10446 .Dv \&\&SIGINT
10448 .Ql control-C
10449 is often problematic: many library functions cannot deal with the
10450 .Fn siglongjmp 3
10451 that this software (still) performs.
10454 The SMTP and POP3 protocol support of \*(UA is very basic.
10455 Also, if it fails to contact its upstream SMTP server, it will not make
10456 further attempts to transfer the message at a later time (setting
10457 .Va save
10459 .Va sendwait
10460 may be useful).
10461 If this is a concern, it might be better to set up a local SMTP server
10462 that is capable of message queuing.
10463 .\" }}}
10466 .Sh BUGS
10468 After deleting some message of a POP3 mailbox the header summary falsely
10469 claims that there are no messages to display, you need to perform
10470 a scroll or dot movement to restore proper state.
10472 In threaded display a power user may encounter crashes very
10473 occasionally (this is may and very).
10475 The file
10476 .Pa TODO
10477 in the source repository lists future directions.
10478 .\" s-ts-mode