NEWS: fix typos
[s-mailx.git] / nail.1
blob662e4bcd90dfdbd48ce2aa0aec17c0ff1ca77818
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2017 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 v14.9.1 / 2017-07-31
35 .Dd July 31, 2017
36 .ds VV \\%v14.9.1
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 .Pp
74 .Nm \*(uA
75 .Bk -words
76 .Op Fl BdEFinv~#
77 .Op Fl \&: Ar spec
78 .Op Fl A Ar account
79 .Op : Ns Fl a Ar attachment Ns \&:
80 .Op : Ns Fl b Ar bcc-addr Ns \&:
81 .Op : Ns Fl c Ar cc-addr Ns \&:
82 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
83 .Op Fl r Ar from-addr
84 .Oo : Ns
85 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
86 .Pf \&: Oc
87 .Op Fl s Ar subject
88 .Op : Ns Fl X Ar cmd Ns \&:
89 .Op Fl \&.
90 .Pf : Ar to-addr Ns \&:
91 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
92 .Ek
93 .Pp
94 .Nm \*(uA
95 .Bk -words
96 .Op Fl BdEeHiNnRv~#
97 .Op Fl \&: Ar spec
98 .Op Fl A Ar account
99 .Op Fl L Ar spec
100 .Op Fl r Ar from-addr
101 .Oo : Ns
102 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
103 .Pf \&: Oc
104 .Op Fl u Ar user
105 .Op : Ns Fl X Ar cmd Ns \&:
106 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
108 .Nm \*(uA
109 .Bk -words
110 .Op Fl BdEeHiNnRv~#
111 .Op Fl \&: Ar spec
112 .Op Fl A Ar account
113 .Fl f
114 .Op Fl L Ar spec
115 .Op Fl r Ar from-addr
116 .Oo : Ns
117 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
118 .Pf \&: Oc
119 .Op : Ns Fl X Ar cmd Ns \&:
120 .Op Ar file
121 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
124 .\" }}}
127 .Mx -toc -tree html pdf ps xhtml
130 .\" .Sh DESCRIPTION {{{
131 .Sh DESCRIPTION
133 .Bd -filled -compact -offset indent
134 .Sy Compatibility note:
135 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2019).
136 Backward incompatibility has to be expected \(en
137 .Sx COMMANDS
138 will use
139 .Sx "Shell-style argument quoting"
140 rules, for example, and shell metacharacters will become meaningful.
141 New and old behaviour is flagged \*(IN and \*(OU, and setting
142 .Va v15-compat ,
143 one of the many
144 .Sx "INTERNAL VARIABLES" ,
145 will choose new behaviour when applicable.
146 \*(OB flags what will vanish, and enabling
147 .Fl d
149 .Fl v
150 enables obsoletion warnings.
154 \*(UA provides a simple and friendly environment for sending and
155 receiving mail.
156 It is intended to provide the functionality of the POSIX
157 .Xr mailx 1
158 command, but is MIME capable and optionally offers extensions for
159 line editing, S/MIME, SMTP and POP3, among others.
160 \*(UA divides incoming mail into its constituent messages and allows
161 the user to deal with them in any order.
162 It offers many
163 .Sx COMMANDS
165 .Sx "INTERNAL VARIABLES"
166 for manipulating messages and sending mail.
167 It provides the user simple editing capabilities to ease the composition
168 of outgoing messages, and increasingly powerful and reliable
169 non-interactive scripting capabilities.
171 .\" .Ss "Options" {{{
172 .Ss "Options"
174 .Bl -tag -width ".It Fl BaNg"
176 .It Fl \&: Ar spec
177 Explicitly control which of the
178 .Sx "Resource files"
179 shall be loaded: if the letter
180 .Ql s
181 is (case-insensitively) part of the
182 .Ar spec
183 then the system wide
184 .Pa \*(UR
185 is loaded, likewise the letter
186 .Ql u
187 controls loading of the user's personal
188 .Pa \*(ur
189 file, whereas the letters
190 .Ql -
192 .Ql /
193 explicitly forbid loading of any resource files.
194 This option should be used by scripts: to avoid environmental noise they
195 should
196 .Dq detach
197 from any configuration files and create a script-local environment,
198 explicitly setting any of the desired
199 .Sx "INTERNAL VARIABLES"
201 .Fl S .
202 This option overrides
203 .Fl n .
206 .It Fl A Ar account
207 Executes an
208 .Ic account
209 command for the given user email
210 .Ar account
211 after program startup is complete (all resource files are loaded, any
212 .Fl S
213 setting is being established; only
214 .Fl X
215 commands have not been evaluated yet).
216 Being a special incarnation of
217 .Ic define Ns d
218 macros for the purpose of bundling longer-lived
219 .Ic set Ns
220 tings, activating such an email account also switches to the accounts
221 .Mx -sx
222 .Sx "primary system mailbox"
223 (most likely the
224 .Va inbox ) .
227 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
228 Attach
229 .Ar file
230 to the message (for compose mode opportunities refer to
231 .Ic ~@
233 .Ic ~^ ) .
234 .Sx "Filename transformations"
235 (also see
236 .Ic file )
237 will be performed, but shell word expansion is restricted to the tilde
238 .Ql ~ .
239 Shall
240 .Ar file
241 not be accessible but contain a
242 .Ql =
243 character, then anything before the
244 .Ql =
245 will be used as the filename, anything thereafter as a character set
246 specification.
248 If an input character set is specified,
249 .Mx -ix "character set specification"
250 but no output character set, then the given input character set is fixed
251 as-is, and no conversion will be applied;
252 giving the empty string or the special string hyphen-minus
253 .Ql -
254 will be treated as if
255 .Va ttycharset
256 has been specified (the default).
258 If an output character set has also been given then the conversion will
259 be performed exactly as specified and on-the-fly, not considering the
260 file's type and content.
261 As an exception, if the output character set is specified as the empty
262 string or hyphen-minus
263 .Ql - ,
264 then the default conversion algorithm (see
265 .Sx "Character sets" )
266 is applied (therefore no conversion is performed on-the-fly,
267 .Ar file
268 will be MIME-classified and its contents will be inspected first) \(em
269 without support for character set conversions
270 .Pf ( Va features
271 does not include the term
272 .Ql +iconv )
273 only this argument is supported.
275 .It Fl B
276 (\*(OB: \*(UA will always use line-buffered output, to gain
277 line-buffered input even in batch mode enable batch mode via
278 .Fl # . )
281 .It Fl b Ar addr
282 Send a blind carbon copy to
283 .Ar addr Ns
284 ess, if the
285 .Ic set Ns
286 ting of
287 .Va expandaddr ,
288 one of the
289 .Sx "INTERNAL VARIABLES" ,
290 allows.
291 The option may be used multiple times.
292 Also see the section
293 .Sx "On sending mail, and non-interactive mode" .
296 .It Fl c Ar addr
297 Send carbon copies to the given receiver, if so allowed by
298 .Va expandaddr .
299 May be used multiple times.
302 .It Fl d
303 .Ic set
304 the internal variable
305 .Va debug
306 which enables debug messages and disables message delivery,
307 among others; effectively turns almost any operation into a dry-run.
310 .It Fl E
311 .Ic set
312 .Va skipemptybody
313 and thus discard messages with an empty message part body.
314 This command line option is \*(OB.
317 .It Fl e
318 Just check if mail is present (in the system
319 .Va inbox
320 or the one specified via
321 .Fl f ) :
322 if yes, return an exit status of zero, a non-zero value otherwise.
323 To restrict the set of mails to consider in this evaluation a message
324 specification can be added with the option
325 .Fl L .
328 .It Fl F
329 Save the message to send in a file named after the local part of the
330 first recipient's address (instead of in
331 .Va record Ns ).
334 .It Fl f
335 Read in the contents of the user's
336 .Mx -sx
337 .Sx "secondary mailbox"
338 .Ev MBOX
339 (or the specified file) for processing;
340 when \*(UA is quit, it writes undeleted messages back to this file
341 (but be aware of the
342 .Va hold
343 option).
344 The optional
345 .Ar file
346 argument will undergo some special
347 .Sx "Filename transformations"
348 (also see
349 .Ic file ) .
350 Note that
351 .Ar file
352 is not an argument to the flag
353 .Fl \&\&f ,
354 but is instead taken from the command line after option processing has
355 been completed.
356 In order to use a
357 .Ar file
358 that starts with a hyphen-minus, prefix with a relative path, as in
359 .Ql ./-hyphenbox.mbox .
362 .It Fl H
363 Display a summary of
364 .Ic headers
365 and exit; a configurable summary view is available via the
366 .Fl L
367 option.
370 .It Fl h
371 Show a short usage summary.
374 .It Fl i
375 .Ic set
376 .Va ignore
377 to ignore tty interrupt signals.
380 .It Fl L Ar spec
381 Display a summary of
382 .Ic headers
383 of all messages that match the given
384 .Ar spec ,
385 then exit.
386 See the section
387 .Sx "Specifying messages"
388 for the format of
389 .Ar spec .
390 If the
391 .Fl e
392 option has been given in addition no header summary is produced,
393 but \*(UA will instead indicate via its exit status whether
394 .Ar spec
395 matched any messages
396 .Pf ( Ql 0 )
397 or not
398 .Pf ( Ql 1 ) ;
399 note that any verbose output is suppressed in this mode and must instead
400 be enabled explicitly (e.g., by using the option
401 .Fl v ) .
404 .It Fl M Ar type
405 Special send mode that will flag standard input with the MIME
406 .Ql Content-Type:
407 set to the given
408 .Ar type
409 and use it as the main message body.
410 \*(ID Using this option will bypass processing of
411 .Va message-inject-head ,
412 .Va signature
414 .Va message-inject-tail .
415 Also see
416 .Fl q , m , t .
419 .It Fl m Ar file
420 Special send mode that will MIME classify the specified
421 .Ar file
422 and use it as the main message body.
423 \*(ID Using this option will bypass processing of
424 .Va message-inject-head ,
425 .Va signature
427 .Va message-inject-tail .
428 Also see
429 .Fl q , M , t .
432 .It Fl N
433 inhibit the initial display of message headers when reading mail or
434 editing a mailbox
435 .Ic folder
436 by calling
437 .Ic unset
438 for the internal variable
439 .Va header .
442 .It Fl n
443 Standard flag that inhibits reading the system wide
444 .Pa \*(UR
445 upon startup.
446 The option
447 .Fl \&:
448 allows more control over the startup sequence; also see
449 .Sx "Resource files" .
452 .It Fl q Ar file
453 Special send mode that will initialize the message body with the
454 contents of the specified
455 .Ar file ,
456 which may be standard input
457 .Ql -
458 only in non-interactive context.
459 Also see
460 .Fl M , m , t .
463 .It Fl R
464 Any mailbox
465 .Ic folder
466 opened will be in read-only mode.
470 .It Fl r Ar from-addr
471 Whereas the source address that appears in the
472 .Va from
473 header of a message (or in the
474 .Va sender
475 header if the former contains multiple addresses) is honoured by the
476 builtin SMTP transport, it is not used by a file-based
477 .Va mta
478 (Mail-Transfer-Agent) for the RFC 5321 reverse-path used for relaying
479 and delegating a message to its destination(s), for delivery errors
480 etc., but it instead uses the local identity of the initiating user.
483 When this command line option is used the given
484 .Ar from-addr
485 will be assigned to the internal variable
486 .Va from ,
487 but in addition the command line option
488 .Fl \&\&f Ar from-addr
489 will be passed to a file-based
490 .Va mta
491 whenever a message is sent.
492 Shall
493 .Ar from-addr
494 include a user name the address components will be separated and
495 the name part will be passed to a file-based
496 .Va mta
497 individually via
498 .Fl \&\&F Ar name .
501 If an empty string is passed as
502 .Ar from-addr
503 then the content of the variable
504 .Va from
505 (or, if that contains multiple addresses,
506 .Va sender )
507 will be evaluated and used for this purpose whenever the file-based
508 .Va mta
509 is contacted.
510 By default, without
511 .Fl \&\&r
512 that is, neither
513 .Fl \&\&f
515 .Fl \&\&F
516 command line options are used when contacting a file-based MTA, unless
517 this automatic deduction is enforced by
518 .Ic set Ns
519 ing the internal variable
520 .Va r-option-implicit .
523 Remarks: many default installations and sites disallow overriding the
524 local user identity like this unless either the MTA has been configured
525 accordingly or the user is member of a group with special privileges.
529 .It Fl S Ar var Ns Op = Ns value
530 .Ic set
531 the internal
532 .Ar var Ns
533 iable and, in case of a non-boolean variable which has a value, assign
534 .Ar value
535 to it.
536 Even though
537 .Sx "INTERNAL VARIABLES"
538 .Ic \&\&set
540 .Fl \&\&S
541 may be overwritten from within resource files,
542 the command line setting will be reestablished after all resource files
543 have been loaded.
544 (\*(ID In the future such a setting may instead become
545 .Dq frozen
546 until the startup is complete.)
549 .It Fl s Ar subject
550 Specify the subject of the message to be sent.
551 Newline (NL) and carriage-return (CR) bytes are invalid and will be
552 normalized to space (SP) characters.
555 .It Fl t
556 The message given (on standard input) is expected to contain, separated
557 from the message body by an empty line, a message header with
558 .Ql To: ,
559 .Ql Cc: ,
561 .Ql Bcc:
562 fields giving its recipients, which will be added to any recipients
563 specified on the command line.
564 If a message subject is specified via
565 .Ql Subject:
566 then it will be used in favour of one given on the command line.
568 Also understood are
569 .Ql Reply-To:
570 (possibly overriding
571 .Va replyto ) ,
572 .Ql Sender:
573 .Pf ( Va sender ) ,
574 .Ql From:
575 .Pf ( Va from
576 and / or option
577 .Fl r ) .
578 .Ql Message-ID: ,
579 .Ql In-Reply-To: ,
580 .Ql References:
582 .Ql Mail-Followup-To: ,
583 by default created automatically dependent on message context, will
584 be used if specified (a special address massage will however still occur
585 for the latter).
586 Any other custom header field (also see
587 .Va customhdr
589 .Ic ~^ )
590 is passed through entirely
591 unchanged, and in conjunction with the options
592 .Fl ~
594 .Fl #
595 it is possible to embed
596 .Sx "COMMAND ESCAPES" .
597 Also see
598 .Fl M , m , q .
601 .It Fl u Ar user
602 Initially read the
603 .Mx -sx
604 .Sx "primary system mailbox"
606 .Ar user ,
607 appropriate privileges presumed; effectively identical to
608 .Ql Fl \&\&f Ns \0%user .
611 .It Fl V
612 Show \*(UA's
613 .Va version
614 and exit.
615 The command
616 .Ic version
617 will also show the list of
618 .Va features :
619 .Ql $ \*(uA -Xversion -Xx .
622 .It Fl v
623 .Ic set Ns
624 ting the internal variable
625 .Va verbose
626 enables display of some informational context messages.
627 Using it twice increases the level of verbosity.
630 .It Fl X Ar cmd
631 Add the given (or multiple for a multiline argument)
632 .Ar cmd
633 to the list of commands to be executed,
634 as a last step of program startup, before normal operation starts.
635 This is the only possibility to execute commands in non-interactive mode
636 when reading startup files is actively prohibited.
637 The commands will be evaluated as a unit, just as via
638 .Ic source .
639 Correlates with
640 .Fl #
642 .Va errexit .
645 .It Fl ~
646 Enable
647 .Sx "COMMAND ESCAPES"
648 in compose mode even in non-interactive use cases.
649 This can be used to, e.g., automatically format the composed message
650 text before sending the message:
651 .Bd -literal -offset indent
652 $ ( echo 'line    one. Word.     Word2.';\e
653     echo '~| /usr/bin/fmt -tuw66' ) |\e
654   LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
658 .It Fl #
659 Enables batch mode: standard input is made line buffered, the complete
660 set of (interactive) commands is available, processing of
661 .Sx "COMMAND ESCAPES"
662 is enabled in compose mode, and diverse
663 .Sx "INTERNAL VARIABLES"
664 are adjusted for batch necessities, exactly as if done via
665 .Fl S :
666 .Va emptystart ,
667 .Pf no Va errexit ,
668 .Pf no Va header ,
669 .Pf no Va posix ,
670 .Va quiet ,
671 .Va sendwait ,
672 .Va typescript-mode
673 as well as
674 .Ev MAIL ,
675 .Ev MBOX
677 .Va inbox
678 (the latter three to
679 .Pa /dev/null ) .
680 The following prepares an email message in a batched dry run:
681 .Bd -literal -offset indent
682 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
683   LC_ALL=C \*(uA -d#:/ -X'alias bob bob@exam.ple'
687 .It Fl \&.
688 This flag forces termination of option processing in order to prevent
689 .Dq option injection
690 (attacks).
691 It also forcefully puts \*(UA into send mode, see
692 .Sx "On sending mail, and non-interactive mode" .
696 All given
697 .Ar to-addr
698 arguments and all receivers established via
699 .Fl b
701 .Fl c
702 are subject to the checks established by
703 .Va expandaddr ,
704 one of the
705 .Sx "INTERNAL VARIABLES" .
706 If the setting of
707 .Va expandargv
708 allows their recognition all
709 .Ar mta-option
710 arguments given at the end of the command line after a
711 .Ql --
712 separator will be passed through to a file-based
713 .Va mta
714 (Mail-Transfer-Agent) and persist for the entire session.
715 .Va expandargv
716 constraints do not apply to the content of
717 .Va mta-arguments .
718 .\" }}}
720 .\" .Ss "A starter" {{{
721 .Ss "A starter"
723 \*(UA is a direct descendant of
725 Mail, itself a successor of the Research
727 mail which
728 .Dq was there from the start
729 according to
730 .Sx HISTORY .
731 It thus represents the user side of the
733 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
734 traditionally taken by
735 .Xr sendmail 8 ,
736 and most MTAs provide a binary of this name for compatibility purposes.
737 If the \*(OPal SMTP
738 .Va mta
739 is included in the
740 .Va features
741 of \*(UA then the system side is not a mandatory precondition for mail
742 delivery.
745 Because \*(UA strives for compliance with POSIX
746 .Xr mailx 1
747 it is likely that some configuration settings have to be adjusted before
748 using it is a smooth experience.
749 (Rather complete configuration examples can be found in the section
750 .Sx EXAMPLES . )
751 The default global
752 .Pa \*(UR
753 resource file bends those standard imposed settings of the
754 .Sx "INTERNAL VARIABLES"
755 a bit towards more user friendliness and safety already.
758 For example, it
759 .Ic set Ns s
760 .Va hold
762 .Va keepsave
763 in order to suppress the automatic moving of messages to the
764 .Mx -sx
765 .Sx "secondary mailbox"
766 .Ev MBOX
767 that would otherwise occur (see
768 .Sx "Message states" ) ,
770 .Va keep
771 to not remove empty system MBOX mailbox files in order not to mangle
772 file permissions when files eventually get recreated (all empty (MBOX)
773 mailbox files will be removed unless this variable is set whenever
774 .Ev POSIXLY_CORRECT
775 mode has been enabled).
778 It also enables
779 .Va sendwait
780 in order to synchronize \*(UA with the exit status report of the used
781 .Va mta
782 when sending mails.
784 .Ic set Ns
786 .Va emptystart
787 to enter interactive startup even if the initial mailbox is empty,
788 .Va editheaders
789 to allow editing of headers as well as
790 .Va fullnames
791 to not strip down addresses in compose mode, and
792 .Va quote
793 to include the message that is being responded to when
794 .Ic reply Ns
795 ing.
798 It should be remarked that the file mode creation mask can be
799 explicitly managed via the variable
800 .Va umask .
801 \*(UA will not follow symbolic links when opening files for writing,
802 sufficient system support provided.
803 .\" }}}
805 .\" .Ss "On sending mail, and non-interactive mode" {{{
806 .Ss "On sending mail, and non-interactive mode"
808 To send a message to one or more people, using a local or a built-in
809 .Va mta
810 (Mail-Transfer-Agent) transport to actually deliver the generated mail
811 message, \*(UA can be invoked with arguments which are the names of
812 people to whom the mail will be sent, and the command line options
813 .Fl b
815 .Fl c
816 can be used to add (blind) carbon copy receivers:
818 .Bd -literal -offset indent
819 # Via sendmail(1)
820 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
822 # But... try it in an isolated dry-run mode (-d) first
823 $ LC_ALL=C \*(uA -d -:/ -Ssendwait -Sttycharset=utf8 \e
824    -b bcc@exam.ple -c cc@exam.ple \e
825    -. '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
827 # With SMTP
828 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
829     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
830     -S from=scriptreply@exam.ple \e
831     -a /etc/mail.rc \e
832     -. eric@exam.ple
836 If standard input is a terminal rather than the message to be sent,
837 the user is expected to type in the message contents.
838 In this compose mode \*(UA treats lines beginning with the character
839 .Ql ~
840 special \(en these are so-called
841 .Sx "COMMAND ESCAPES" ,
842 which can be used to read in files, process shell commands, add and edit
843 attachments and more; e.g., the command escape
844 .Ic ~e
845 will start the text editor to revise the message in its current state,
846 .Ic ~h
847 allows editing of the most important message headers, with
848 .Ic ~^
849 custom headers can be created (more specifically than with
850 .Va customhdr ) .
851 .Ic ~?
852 gives an overview of most other available command escapes.
853 Typing
854 .Ql control-D
855 .Pf ( Ql ^D )
856 at the beginning of an empty line leaves compose mode and causes the
857 message to be sent, whereas typing
858 .Ql control-C
859 .Pf ( Ql ^C )
860 twice will abort the current letter (saving its contents in the file
861 denoted by
862 .Ev DEAD
863 unless
864 .Pf no Va save
865 is set).
868 A number of
869 .Sx ENVIRONMENT
871 .Sx "INTERNAL VARIABLES"
872 can be used to alter default behavior.
873 E.g., messages are sent asynchronously, without supervision, unless the
874 internal variable
875 .Va sendwait
876 is set, therefore send errors will not be recognizable until then.
877 .Ic set Ns
878 ting (also via
879 .Fl S )
880 .Va editalong
881 will automatically startup a text editor when compose mode is entered,
882 .Va editheaders
883 allows editing of headers additionally to plain body content, whereas
884 .Va askcc
886 .Va askbcc
887 will cause the user to be prompted actively for (blind) carbon-copy
888 recipients, respectively, if the given list is empty.
891 Especially when using public mail provider accounts with the SMTP
892 .Va mta
893 it is often necessary to set
894 .Va from
895 and/or
896 .Va hostname
897 (even finer control via
898 .Va smtp-hostname ) ,
899 which (even if empty) also causes creation of
900 .Ql Message-ID:
902 .Ql Content-ID:
903 header fields unless
904 .Va stealthmua
905 is set.
906 Saving a copy of sent messages in a
907 .Va record
908 mailbox may be desirable \(en as for most mailbox
909 .Ic file
910 targets the value will undergo
911 .Sx "Filename transformations" .
912 Defining user email
913 .Ic account Ns s
914 for the purpose of arranging a complete environment of settings that can
915 be switched to with a single command or command line option may be
916 useful.
917 .Pf ( Sx EXAMPLES
918 has example configurations for some of the well-known public mail
919 providers, and also gives a compact overview on how to setup a secure
920 SSL/TLS environment.)
921 Some introductional
922 .Fl d
924 .Va debug
925 sandbox dry-run tests will prove correctness.
928 The section
929 .Sx "On URL syntax and credential lookup"
930 will spread light on the different ways of how to specify user email
931 account credentials, the
932 .Ql USER@HOST
933 variable chains, and accessing protocol-specific resources,
934 the section
935 .Sx "Character sets"
936 goes into the details of character encodings, and how to use them for
937 interpreting the input data given in
938 .Va ttycharset
939 and representing messages and MIME part contents in
940 .Va sendcharsets ,
941 and reading the section
942 .Sx "The mime.types files"
943 should help to understand how the MIME-type of outgoing attachments are
944 classified, and what can be done for fine-tuning.
945 Over the wire a configurable
946 .Va mime-encoding
947 .Pf ( Ql Content-Transfer-Encoding: )
948 may be applied to the message data.
951 Message recipients (as specified on the command line or defined in
952 .Ql To: ,
953 .Ql Cc:
955 .Ql Bcc: )
956 may not only be email addressees but can also be names of mailboxes and
957 even complete shell command pipe specifications.
958 If the variable
959 .Va expandaddr
960 is not set then only network addresses (see
961 .Xr mailaddr 7
962 for a description of mail addresses) and plain user names (including MTA
963 aliases) may be used, other types will be filtered out, giving a warning
964 message.
965 The command
966 .Ic addrcodec
967 can be used to generate standard compliant network addresses.
969 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
970 .\" grep the latter for the complete picture
972 If the variable
973 .Va expandaddr
974 is set then extended recipient addresses will optionally be accepted:
975 Any name which starts with a vertical bar
976 .Ql |
977 character specifies a command pipe \(en the command string following the
978 .Ql |
979 is executed and the message is sent to its standard input;
980 Likewise, any name that starts with the character solidus
981 .Ql /
982 or the character sequence dot solidus
983 .Ql ./
984 is treated as a file, regardless of the remaining content;
985 likewise a name that solely consists of a hyphen-minus
986 .Ql - .
987 Any other name which contains a commercial at
988 .Ql @
989 character is treated as a network address;
990 Any other name which starts with a plus sign
991 .Ql +
992 character specifies a mailbox name;
993 Any other name which contains a solidus
994 .Ql /
995 character but no exclamation mark
996 .Ql \&!
997 or percent sign
998 .Ql %
999 character before also specifies a mailbox name;
1000 What remains is treated as a network address.
1002 .Bd -literal -offset indent
1003 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1004 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1005 $ echo safe | LC_ALL=C \e
1006     \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1007       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1008       -. bob@exam.ple
1012 It is possible to create personal distribution lists via the
1013 .Ic alias
1014 command, so that, for instance, the user can send mail to
1015 .Ql cohorts
1016 and have it go to a group of people.
1017 These aliases have nothing in common with the system wide aliases that
1018 may be used by the MTA, which are subject to the
1019 .Ql name
1020 constraint of
1021 .Va expandaddr
1022 and are often tracked in a file
1023 .Pa /etc/aliases
1024 (and documented in
1025 .Xr aliases 5
1027 .Xr sendmail 1 ) .
1028 Personal aliases will be expanded by \*(UA before the message is sent,
1029 and are thus a convenient alternative to specifying each addressee by
1030 itself; they correlate with the active set of
1031 .Ic alternates
1032 and are subject to
1033 .Va metoo
1034 filtering.
1037 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
1040 .Va on-compose-enter , on-compose-leave
1042 .Va on-compose-cleanup
1043 hook variables may be set to
1044 .Ic define Ns
1045 d macros to automatically adjust some settings dependent
1046 on receiver, sender or subject contexts, and via the
1047 .Va on-compose-splice
1048 as well as
1049 .Va on-compose-splice-shell
1050 variables, the former also to be set to a
1051 .Ic define Ns
1052 d macro, increasingly powerful mechanisms to perform automated message
1053 adjustments are available.
1054 (\*(ID These hooks work for commands which newly create messages, namely
1055 .Ic forward , mail , reply
1056 and variants;
1057 .Ic resend
1059 .Ic Resend
1060 for now provide only the hooks
1061 .Va on-resend-enter
1063 .Va on-resend-cleanup . )
1066 To avoid environmental noise scripts should
1067 .Dq detach
1068 \*(UA from any configuration files and create a script-local
1069 environment, ideally with the command line options
1070 .Fl \&:
1071 to disable any configuration file in conjunction with repetitions of
1072 .Fl S
1073 to specify variables:
1075 .Bd -literal -offset indent
1076 $ env LC_ALL=C \*(uA -:/ \e
1077     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1078     -Sexpandaddr=fail,-all,failinvaddr \e
1079     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1080     -S from=scriptreply@exam.ple \e
1081     -s 'Subject to go' -a attachment_file \e
1082     -. 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1083     < content_file
1087 As shown, scripts can
1088 .Dq fake
1089 a locale environment, the above specifies the all-compatible 7-bit clean
1090 .Ev LC_ALL
1091 .Dq C ,
1092 but will nonetheless take and send UTF-8 in the message text by using
1093 .Va ttycharset .
1094 In interactive mode, which is introduced in the next section, messages
1095 can be sent by calling the
1096 .Ic mail
1097 command with a list of recipient addresses:
1099 .Bd -literal -offset indent
1100 $ \*(uA -d -Squiet -Semptystart
1101 "/var/spool/mail/user": 0 messages
1102 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1104 ? # Will do the right thing (tm)
1105 ? m rec1@exam.ple rec2@exam.ple
1107 .\" }}}
1109 .\" .Ss "On reading mail, and interactive mode" {{{
1110 .Ss "On reading mail, and interactive mode"
1112 When invoked without addressees \*(UA enters interactive mode in which
1113 mails may be read.
1114 When used like that the user's system
1115 .Va inbox
1116 (for more on mailbox types please see the command
1117 .Ic file )
1118 is read in and a one line header of each message therein is displayed if
1119 the variable
1120 .Va header
1121 is set.
1122 The visual style of this summary of
1123 .Ic headers
1124 can be adjusted through the variable
1125 .Va headline
1126 and the possible sorting criterion via
1127 .Va autosort .
1128 Scrolling through
1129 .Va screen Ns
1130 fuls of
1131 .Ic headers
1132 can be performed with the command
1133 .Ic z .
1134 If the initially opened mailbox is empty \*(UA will instead exit
1135 immediately (after displaying a message) unless the variable
1136 .Va emptystart
1137 is set.
1140 At the
1141 .Va prompt
1142 the command
1143 .Ic list
1144 will give a listing of all available commands and
1145 .Ic help
1146 will give a summary of some common ones.
1147 If the \*(OPal documentation strings are available one can type
1148 .Ql help X
1149 .Pf "(or " Ql ?X )
1150 and see the actual expansion of
1151 .Ql X
1152 and what its purpose is, i.e., commands can be abbreviated
1153 (note that POSIX defines some abbreviations, so that the alphabetical
1154 order of commands does not necessarily relate to the abbreviations; it is
1155 however possible to define overwrites with
1156 .Ic commandalias ) .
1157 These commands can also produce a more
1158 .Va verbose
1159 output.
1162 Messages are given numbers (starting at 1) which uniquely identify
1163 messages; the current message \(en the
1164 .Dq dot
1165 \(en will either be the first new message, or the first unread message,
1166 or the first message of the mailbox; the internal variable
1167 .Va showlast
1168 will instead cause usage of the last message for this purpose.
1169 The command
1170 .Ic headers
1171 will display a
1172 .Va screen Ns
1173 ful of header summaries containing the
1174 .Dq dot ,
1175 whereas
1176 .Ic from
1177 will display only the summaries of the given messages, defaulting to the
1178 .Dq dot .
1181 Message content can be displayed with the command
1182 .Ic type
1183 .Pf ( Ql t ,
1184 alias
1185 .Ic print ) .
1186 Here the variable
1187 .Va crt
1188 controls whether and when \*(UA will use the configured
1189 .Ev PAGER
1190 for display instead of directly writing to the user terminal
1191 .Va screen ,
1192 the sole difference to the command
1193 .Ic more ,
1194 which will always use the
1195 .Ev PAGER .
1196 The command
1197 .Ic top
1198 will instead only show the first
1199 .Va toplines
1200 of a message (maybe even compressed if
1201 .Va topsqueeze
1202 is set).
1203 Message display experience may improve by setting and adjusting
1204 .Va mime-counter-evidence ,
1205 and also see
1206 .Sx "HTML mail and MIME attachments" .
1209 By default the current message
1210 .Pf ( Dq dot )
1211 is displayed, but like with many other commands it is possible to give
1212 a fancy message specification (see
1213 .Sx "Specifying messages" ) ,
1214 e.g.,
1215 .Ql t:u
1216 will display all unread messages,
1217 .Ql t.
1218 will display the
1219 .Dq dot ,
1220 .Ql t 1 5
1221 will type the messages 1 and 5,
1222 .Ql t 1-5
1223 will type the messages 1 through 5, and
1224 .Ql t-
1226 .Ql t+
1227 will display the last and the next message, respectively.
1228 The command
1229 .Ic search
1230 (a more substantial alias for
1231 .Ic from )
1232 will display a header summary of the given message specification list
1233 instead of their content, e.g., the following will search for subjects:
1236 .Dl ? from "'@Some subject to search for'"
1239 In the default setup all header fields of a message will be
1240 .Ic type Ns
1241 d, but fields can be white- or blacklisted for a variety of
1242 applications by using the command
1243 .Ic headerpick ,
1244 e.g., to restrict their display to a very restricted set for
1245 .Ic type :
1246 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1247 In order to display all header fields of a message regardless of
1248 currently active ignore or retain lists, use the commands
1249 .Ic Type
1251 .Ic Top ;
1252 .Ic Show
1253 will show the raw message content.
1254 Note that historically the global
1255 .Pa \*(UR
1256 not only adjusts the list of displayed headers, but also sets
1257 .Va crt .
1260 Dependent upon the configuration a line editor (see the section
1261 .Sx "On terminal control and line editor" )
1262 aims at making the user experience with the many
1263 .Sx COMMANDS
1264 a bit nicer.
1265 When reading the system
1266 .Va inbox
1267 or when
1268 .Fl f
1270 .Ic file )
1271 specified a mailbox explicitly prefixed with the special
1272 .Ql %:
1273 modifier (propagating the mailbox to a
1274 .Mx -sx
1275 .Sx "primary system mailbox" ) ,
1276 then messages which have been read will be automatically moved to a
1277 .Mx -sx
1278 .Sx "secondary mailbox" ,
1279 the users
1280 .Ev MBOX
1281 file, when the mailbox is left, either by changing the
1282 active mailbox or by quitting \*(UA (also see
1283 .Sx "Message states" )
1284 \(en this automatic moving from a system or primary to the secondary
1285 mailbox is not performed when the variable
1286 .Va hold
1287 is set.
1288 Messages can also be explicitly
1289 .Ic move Ns
1290 d to other mailboxes, whereas
1291 .Ic copy
1292 keeps the original message.
1293 .Ic write
1294 can be used to write out data content of specific parts of messages.
1297 After examining a message the user can
1298 .Ic reply Ql r
1299 to the sender and all recipients (which will also be placed in
1300 .Ql To:
1301 unless
1302 .Va recipients-in-cc
1303 is set) or
1304 .Ic Reply Ql R
1305 exclusively to the sender(s).
1306 .Ic forward Ns
1307 ing a message will allow editing the new message: the original message
1308 will be contained in the message body, adjusted according to
1309 .Ic headerpick .
1310 When replying to or forwarding a message recipient addresses will be
1311 stripped from comments and names unless the internal variable
1312 .Va fullnames
1313 is set.
1314 It is possible to
1315 .Ic resend
1317 .Ic Resend
1318 messages: the former will add a series of
1319 .Ql Resent-
1320 headers, whereas the latter will not; different to newly created
1321 messages editing is not possible and no copy will be saved even with
1322 .Va record
1323 unless the additional variable
1324 .Va record-resent
1325 is set.
1326 Of course messages can be
1327 .Ic delete Ql d ,
1328 and they can spring into existence again via
1329 .Ic undelete
1330 or when the \*(UA session is ended via the
1331 .Ic exit Ql x
1332 command.
1335 To end a mail processing session one may either issue
1336 .Ic quit Ql q
1337 to cause a full program exit, which possibly includes
1338 automatic moving of read messages to the
1339 .Mx -sx
1340 .Sx "secondary mailbox"
1341 .Ev MBOX
1342 as well as updating the \*(OPal line editor
1343 .Va history-file ,
1344 or use the command
1345 .Ic exit Ql x
1346 instead in order to prevent any of these actions.
1347 .\" }}}
1349 .\" .Ss "HTML mail and MIME attachments" {{{
1350 .Ss "HTML mail and MIME attachments"
1352 Messages which are HTML-only become more and more common and of course
1353 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1354 Mail Extensions) parts for, e.g., attachments.
1355 To get a notion of MIME types, \*(UA will first read
1356 .Sx "The mime.types files"
1357 (as configured and allowed by
1358 .Va mimetypes-load-control ) ,
1359 and then add onto that types registered directly with
1360 .Ic mimetype .
1361 It (normally) has a default set of types built-in, too.
1362 To improve interaction with faulty MIME part declarations which are
1363 often seen in real-life messages, setting
1364 .Va mime-counter-evidence
1365 will allow \*(UA to verify the given assertion and possibly provide
1366 an alternative MIME type.
1369 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter for
1370 HTML messages, it cannot handle MIME types other than plain text itself.
1371 Instead programs need to become registered to deal with specific MIME
1372 types or file extensions.
1373 These programs may either prepare plain text versions of their input in
1374 order to enable \*(UA to integrate their output neatlessly in its own
1375 message visualization (a mode which is called
1376 .Cd copiousoutput ) ,
1377 or display the content themselves, for example in an external graphical
1378 window: such handlers will only be considered by and for the command
1379 .Ic mimeview .
1382 To install a handler program for a specific MIME type an according
1383 .Va pipe-TYPE/SUBTYPE
1384 variable needs to be set; to instead define a handler for a specific
1385 file extension the respective
1386 .Va pipe-EXTENSION
1387 variable can be used \(en these handlers take precedence.
1388 \*(OPally \*(UA supports mail user agent configuration as defined in
1389 RFC 1524; this mechanism (see
1390 .Sx "The Mailcap files" )
1391 will be queried for display or quote handlers if none of the former two
1392 .\" TODO v15-compat "will be" -> "is"
1393 did; it will be the sole source for handlers of other purpose.
1394 A last source for handlers is the MIME type definition itself, when
1395 a (\*(UA specific) type-marker was registered with the command
1396 .Ic mimetype
1397 (which many built-in MIME types do).
1400 E.g., to display a HTML message inline (that is, converted to a more
1401 fancy plain text representation than the built-in converter is capable to
1402 produce) with either of the text-mode browsers
1403 .Xr lynx 1
1405 .Xr elinks 1 ,
1406 teach \*(UA about MathML documents and make it display them as plain
1407 text, and to open PDF attachments in an external PDF viewer,
1408 asynchronously and with some other magic attached:
1410 .Bd -literal -offset indent
1411 ? if [ "$features" !% +filter-html-tagsoup ]
1412 ?  #set pipe-text/html='@* elinks -force-html -dump 1'
1413 ?  set pipe-text/html='@* lynx -stdin -dump -force_html'
1414 ?  # Display HTML as plain text instead
1415 ?  #set pipe-text/html=@
1416 ? endif
1417 ? mimetype @ application/mathml+xml mathml
1418 ? wysh set pipe-application/pdf='@&=@ \e
1419     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1420     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1421     mupdf "${MAILX_FILENAME_TEMPORARY}"'
1423 .\" }}}
1425 .\" .Ss "Mailing lists" {{{
1426 .Ss "Mailing lists"
1428 \*(UA offers some support to ease handling of mailing lists.
1429 The command
1430 .Ic mlist
1431 promotes all given arguments to known mailing lists, and
1432 .Ic mlsubscribe
1433 sets their subscription attribute, creating them first as necessary.
1434 (On the other hand
1435 .Ic unmlsubscribe
1436 does not
1437 .Ic unmlist
1438 automatically, but only resets the subscription attribute.)
1439 Using the commands without arguments will show (a subset of) all
1440 currently defined mailing lists.
1442 .Va headline
1443 format
1444 .Ql \&%T
1445 can be used to mark out messages with configured list addresses
1446 in the header display.
1449 \*(OPally mailing lists may also be specified as (extended) regular
1450 expressions, which allows matching of many addresses with a single
1451 expression.
1452 However, all fully qualified list addresses are matched via a fast
1453 dictionary, whereas expressions are placed in (a) list(s) which is
1454 (are) matched sequentially.
1456 .Bd -literal -offset indent
1457 ? set followup-to followup-to-honour=ask-yes \e
1458     reply-to-honour=ask-yes
1459 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1460 ? mlsubscribe a4@b4.c4 exact@lists.c3
1464 The variable
1465 .Va followup-to-honour
1466 will ensure that a
1467 .Ql Mail-\:Followup-\:To:
1468 header is honoured when the message is being replied to (via
1469 .Ic reply
1471 .Ic Lreply )
1473 .Va followup-to
1474 controls whether this header is created when sending mails; it will be
1475 created automatically for a couple of reasons, too, like when the
1476 special
1477 .Dq mailing list specific
1478 respond command
1479 .Ic Lreply
1480 is used, when
1481 .Ic reply
1482 is used to respond to a message with its
1483 .Ql Mail-Followup-To:
1484 being honoured etc.
1487 A difference in between the handling of known and subscribed lists is
1488 that the address of the sender is usually not part of a generated
1489 .Ql Mail-Followup-To:
1490 when addressing the latter, whereas it is for the former kind of lists.
1491 Usually because there are exceptions: say, if multiple lists are
1492 addressed and not all of them are subscribed lists.
1494 For convenience \*(UA will, temporarily, automatically add a list
1495 address that is presented in the
1496 .Ql List-Post:
1497 header of a message that is being responded to to the list of known
1498 mailing lists.
1499 Shall that header have existed \*(UA will instead, dependent on the
1500 variable
1501 .Va reply-to-honour ,
1502 use an also set
1503 .Ql Reply-To:
1504 for this purpose in order to accept a list administrators' wish that
1505 is supposed to have been manifested like that (but only if it provides
1506 a single address which resides on the same domain as what is stated in
1507 .Ql List-Post: ) .
1508 .\" }}}
1510 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1511 .Ss "Signed and encrypted messages with S/MIME"
1513 \*(OP S/MIME provides two central mechanisms:
1514 message signing and message encryption.
1515 A signed message contains some data in addition to the regular text.
1516 The data can be used to verify that the message was sent using a valid
1517 certificate, that the sender's address in the message header matches
1518 that in the certificate, and that the message text has not been altered.
1519 Signing a message does not change its regular text;
1520 it can be read regardless of whether the recipient's software is able to
1521 handle S/MIME.
1522 It is thus usually possible to sign all outgoing messages if so desired.
1525 Encryption, in contrast, makes the message text invisible for all people
1526 except those who have access to the secret decryption key.
1527 To encrypt a message, the specific recipient's public encryption key
1528 must be known.
1529 It is therefore not possible to send encrypted mail to people unless their
1530 key has been retrieved from either previous communication or public key
1531 directories.
1532 A message should always be signed before it is encrypted.
1533 Otherwise, it is still possible that the encrypted message text is
1534 altered.
1537 A central concept to S/MIME is that of the certification authority (CA).
1538 A CA is a trusted institution that issues certificates.
1539 For each of these certificates it can be verified that it really
1540 originates from the CA, provided that the CA's own certificate is
1541 previously known.
1542 A set of CA certificates is usually delivered with OpenSSL and installed
1543 on your system.
1544 If you trust the source of your OpenSSL software installation,
1545 this offers reasonable security for S/MIME on the Internet.
1546 Otherwise set
1547 .Va smime-ca-no-defaults
1548 to avoid using the default certificates and point
1549 .Va smime-ca-file
1550 and/or
1551 .Va smime-ca-dir
1552 to a trusted pool of certificates.
1553 In general, a certificate cannot be more secure than the method its CA
1554 certificate has been retrieved with.
1557 This trusted pool of certificates is used by the command
1558 .Ic verify
1559 to ensure that the given S/MIME messages can be trusted.
1560 If so, verified sender certificates that were embedded in signed
1561 messages can be saved locally with the command
1562 .Ic certsave ,
1563 and used by \*(UA to encrypt further communication with these senders:
1565 .Bd -literal -offset indent
1566 ? certsave FILENAME
1567 ? set smime-encrypt-USER@HOST=FILENAME \e
1568     smime-cipher-USER@HOST=AES256
1572 To sign outgoing messages in order to allow receivers to verify the
1573 origin of these messages a personal S/MIME certificate is required.
1574 \*(UA supports password-protected personal certificates (and keys),
1575 for more on this, and its automatization, please see the section
1576 .Sx "On URL syntax and credential lookup" .
1577 The section
1578 .Sx "S/MIME step by step"
1579 shows examplarily how such a private certificate can be obtained.
1580 In general, if such a private key plus certificate
1581 .Dq pair
1582 is available, all that needs to be done is to set some variables:
1584 .Bd -literal -offset indent
1585 ? set smime-sign-cert=ME@HERE.com.paired \e
1586     smime-sign-message-digest=SHA256 \e
1587     smime-sign
1591 Variables of interest for S/MIME in general are
1592 .Va smime-ca-dir ,
1593 .Va smime-ca-file ,
1594 .Va smime-ca-flags ,
1595 .Va smime-ca-no-defaults ,
1596 .Va smime-crl-dir ,
1597 .Va smime-crl-file .
1598 For S/MIME signing of interest are
1599 .Va smime-sign ,
1600 .Va smime-sign-cert ,
1601 .Va smime-sign-include-certs
1603 .Va smime-sign-message-digest .
1604 Additional variables of interest for S/MIME en- and decryption:
1605 .Va smime-cipher
1607 .Va smime-encrypt-USER@HOST .
1610 \*(ID Note that neither S/MIME signing nor encryption applies to
1611 message subjects or other header fields yet.
1612 Thus they may not contain sensitive information for encrypted messages,
1613 and cannot be trusted even if the message content has been verified.
1614 When sending signed messages,
1615 it is recommended to repeat any important header information in the
1616 message text.
1617 .\" }}}
1619 .\" .Ss "On URL syntax and credential lookup" {{{
1620 .Ss "On URL syntax and credential lookup"
1622 \*(IN For accessing protocol-specific resources usage of Uniform
1623 Resource Locators (URL, RFC 1738) has become omnipresent.
1624 \*(UA expects and understands URLs in the following form;
1625 parts in brackets
1626 .Ql []
1627 denote optional parts, optional either because there also exist other
1628 ways to define the information in question or because support of the
1629 part is protocol-specific (e.g.,
1630 .Ql /path
1631 is used by the local maildir and the IMAP protocol, but not by POP3);
1632 If any of
1633 .Ql USER
1635 .Ql PASSWORD
1636 are specified they must be given in URL percent encoded form (RFC 3986;
1637 the command
1638 .Ic urlcodec
1639 may be helpful):
1642 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1645 Note that these \*(UA URLs most often do not conform to any real
1646 standard, but instead represent a normalized variant of RFC 1738 \(en
1647 they are not used in data exchange but only meant as a compact,
1648 easy-to-use way of defining and representing information in
1649 a well-known notation.
1652 Many internal variables of \*(UA exist in multiple versions, called
1653 variable chains for the rest of this document: the plain
1654 .Ql variable
1655 as well as
1656 .Ql variable-HOST
1658 .Ql variable-USER@HOST .
1659 Here
1660 .Ql HOST
1661 indeed means
1662 .Ql server:port
1663 if a
1664 .Ql port
1665 had been specified in the respective URL, otherwise it refers to the plain
1666 .Ql server .
1667 Also,
1668 .Ql USER
1669 is not truly the
1670 .Ql USER
1671 that had been found when doing the user chain lookup as is described
1672 below, i.e., this
1673 .Ql USER
1674 will never be in URL percent encoded form, whether it came from an URL
1675 or not; i.e., variable chain name extensions of
1676 .Sx "INTERNAL VARIABLES"
1677 must not be URL percent encoded.
1680 For example, whether an hypothetical URL
1681 .Ql smtp://hey%3Ayou@our.house
1682 had been given that includes a user, or whether the URL was
1683 .Ql smtp://our.house
1684 and the user had been found differently, to lookup the variable chain
1685 .Va smtp-use-starttls
1686 \*(UA first looks for whether
1687 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1688 is defined, then whether
1689 .Ql smtp-\:use-\:starttls-\:our.house
1690 exists before finally ending up looking at the plain variable itself.
1693 \*(UA obeys the following logic scheme when dealing with the
1694 necessary credential information of an account:
1696 .Bl -bullet
1698 If no
1699 .Ql USER
1700 has been given in the URL the variables
1701 .Va user-HOST
1703 .Va user
1704 are looked up; if no such variable(s) can be found then \*(UA will,
1705 when enforced by the \*(OPal variables
1706 .Va netrc-lookup-HOST
1708 .Va netrc-lookup ,
1709 search the users
1710 .Pa .netrc
1711 file for a
1712 .Ql HOST
1713 specific entry which provides a
1714 .Ql login
1715 name: this lookup will only succeed if unambiguous (one possible matching
1716 entry for
1717 .Ql HOST ) .
1718 It is possible to load encrypted
1719 .Pa .netrc
1720 files via
1721 .Va netrc-pipe .
1723 If there is still no
1724 .Ql USER
1725 then \*(UA will fall back to the user who is supposed to run \*(UA,
1726 the identity of which has been fixated during \*(UA startup and is
1727 known to be a valid user on the current host.
1730 Authentication: unless otherwise noted this will lookup the
1731 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1732 variable chain, falling back to a protocol-specific default should this
1733 have no success.
1736 If no
1737 .Ql PASSWORD
1738 has been given in the URL, then if the
1739 .Ql USER
1740 has been found through the \*(OPal
1741 .Va netrc-lookup
1742 that may have already provided the password, too.
1743 Otherwise the variable chain
1744 .Va password-USER@HOST , password-HOST , password
1745 is looked up and used if existent.
1747 Afterwards the complete \*(OPal variable chain
1748 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1749 is looked up.
1750 If set, the
1751 .Ic netrc
1752 cache is searched for a password only (multiple user accounts for
1753 a single machine may exist as well as a fallback entry without user
1754 but with a password).
1756 If at that point there is still no password available, but the
1757 (protocols') chosen authentication type requires a password, then in
1758 interactive mode the user will be prompted on the terminal.
1762 .Sy Note:
1763 S/MIME verification works relative to the values found in the
1764 .Ql From:
1766 .Ql Sender: )
1767 header field(s), which means that the values of
1768 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1770 .Va smime-sign-message-digest
1771 will not be looked up using the
1772 .Ql USER
1774 .Ql HOST
1775 chains from above but instead use the corresponding values from the
1776 message that is being worked on.
1777 In unusual cases multiple and different
1778 .Ql USER
1780 .Ql HOST
1781 combinations may therefore be involved \(en on the other hand those
1782 unusual cases become possible.
1783 The usual case is as short as:
1786 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1787 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
1790 The section
1791 .Sx EXAMPLES
1792 contains complete example configurations.
1793 .\" }}}
1795 .\" .Ss "Character sets" {{{
1796 .Ss "Character sets"
1798 \*(OP \*(UA detects the character set of the terminal by using
1799 mechanisms that are controlled by the
1800 .Ev LC_CTYPE
1801 environment variable
1802 (in fact
1803 .Ev LC_ALL ,
1804 .Ev \&\&LC_CTYPE ,
1805 .Ev LANG ,
1806 in that order, see there).
1807 The internal variable
1808 .Va ttycharset
1809 will be set to the detected terminal character set accordingly,
1810 and will thus show up in the output of commands like, e.g.,
1811 .Ic set
1813 .Ic varshow .
1816 However, the user may give a value for
1817 .Va ttycharset
1818 during startup, so that it is possible to send mail in a completely
1819 .Dq faked
1820 locale environment, an option which can be used to generate and send,
1821 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
1822 .Ql LC_ALL=C
1823 environment (an example of this can be found in the section
1824 .Sx "On sending mail, and non-interactive mode" ) .
1825 Changing the value does not mean much beside that, because several
1826 aspects of the real character set are implied by the locale environment
1827 of the system, which stays unaffected by
1828 .Va ttycharset .
1831 If the \*(OPal character set conversion capabilities are not available
1832 .Pf ( Va features
1833 does not include the term
1834 .Ql +iconv ) ,
1835 then
1836 .Va ttycharset
1837 will be the only supported character set,
1838 it is simply assumed that it can be used to exchange 8-bit messages
1839 (over the wire an intermediate, configurable
1840 .Va mime-encoding
1841 may be applied),
1842 and the rest of this section does not apply;
1843 it may however still be necessary to explicitly set it if automatic
1844 detection fails, since in that case it defaults to
1845 .\" (Keep in SYNC: ./nail.1:"Character sets", ./config.h:CHARSET_*!)
1846 LATIN1 a.k.a. ISO-8859-1.
1849 \*(OP When reading messages, their text is converted into
1850 .Va ttycharset
1851 as necessary in order to display them on the users terminal.
1852 Unprintable characters and invalid byte sequences are detected
1853 and replaced by proper substitution characters.
1854 Character set mappings for source character sets can be established with
1855 the command
1856 .Ic charsetalias ,
1857 which may be handy to work around faulty character set catalogues (e.g.,
1858 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
1859 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
1860 Also see
1861 .Va charset-unknown-8bit
1862 to deal with another hairy aspect of message interpretation.
1865 When sending messages all their parts and attachments are classified.
1866 Whereas no character set conversion is performed on those parts which
1867 appear to be binary data,
1868 the character set being used must be declared within the MIME header of
1869 an outgoing text part if it contains characters that do not conform to
1870 the set of characters that are allowed by the email standards.
1871 Permissible values for character sets used in outgoing messages can be
1872 declared using the
1873 .Va sendcharsets
1874 variable, and
1875 .Va charset-8bit ,
1876 which defines a catch-all last-resort fallback character set that is
1877 implicitly appended to the list of character sets in
1878 .Va sendcharsets .
1881 When replying to a message and the variable
1882 .Va reply-in-same-charset
1883 is set, then the character set of the message being replied to
1884 is tried first (still being a subject of
1885 .Ic charsetalias ) .
1886 And it is also possible to make \*(UA work even more closely related to
1887 the current locale setting automatically by using the variable
1888 .Va sendcharsets-else-ttycharset ,
1889 please see there for more information.
1892 All the specified character sets are tried in order unless the
1893 conversion of the part or attachment succeeds.
1894 If none of the tried (8-bit) character sets is capable to represent the
1895 content of the part or attachment,
1896 then the message will not be sent and its text will optionally be
1897 .Va save Ns d
1899 .Ev DEAD .
1900 In general, if a message saying
1901 .Dq cannot convert from a to b
1902 appears, either some characters are not appropriate for the currently
1903 selected (terminal) character set,
1904 or the needed conversion is not supported by the system.
1905 In the first case, it is necessary to set an appropriate
1906 .Ev LC_CTYPE
1907 locale and/or the variable
1908 .Va ttycharset .
1911 The best results are usually achieved when \*(UA is run in a UTF-8
1912 locale on an UTF-8 capable terminal, in which case the full Unicode
1913 spectrum of characters is available.
1914 In this setup characters from various countries can be displayed,
1915 while it is still possible to use more simple character sets for sending
1916 to retain maximum compatibility with older mail clients.
1919 On the other hand the POSIX standard defines a locale-independent 7-bit
1920 .Dq portable character set
1921 that should be used when overall portability is an issue, the even more
1922 restricted subset named
1923 .Dq portable filename character set
1924 consists of A-Z, a-z, 0-9, period
1925 .Ql \&. ,
1926 underscore
1927 .Ql _
1928 and hyphen-minus
1929 .Ql - .
1930 .\" }}}
1932 .\" .Ss "Message states" {{{
1933 .Ss "Message states"
1935 \*(UA differentiates in between several different message states;
1936 the current state will be reflected in header summary displays if
1937 .Va headline
1938 is configured to do so (via the internal variable
1939 .Va attrlist ) ,
1940 and messages can also be selected and be acted upon depending on their
1941 state (see
1942 .Sx "Specifying messages" ) .
1943 When operating on the system
1944 .Va inbox ,
1945 or in any other
1946 .Mx -sx
1947 .Sx "primary system mailbox" ,
1948 special actions, like the automatic moving of messages to the
1949 .Mx -sx
1950 .Sx "secondary mailbox"
1951 .Ev MBOX ,
1952 may be applied when the mailbox is left (also implicitly via
1953 a successful exit of \*(UA, but not if the special command
1954 .Ic exit
1955 is used) \(en however, because this may be irritating to users which
1956 are used to
1957 .Dq more modern
1958 mail-user-agents, the default global
1959 .Pa \*(UR
1960 sets the internal
1961 .Va hold
1963 .Va keepsave
1964 variables in order to suppress this behaviour.
1966 .Bl -hang -width ".It Ql new"
1967 .It Ql new
1968 Message has neither been viewed nor moved to any other state.
1969 Such messages are retained even in the
1970 .Mx -sx
1971 .Sx "primary system mailbox" .
1973 .It Ql unread
1974 Message has neither been viewed nor moved to any other state, but the
1975 message was present already when the mailbox has been opened last:
1976 Such messages are retained even in the
1977 .Mx -sx
1978 .Sx "primary system mailbox" .
1980 .It Ql read
1981 The message has been processed by one of the following commands:
1982 .Ic ~f ,
1983 .Ic ~m ,
1984 .Ic ~F ,
1985 .Ic ~M ,
1986 .Ic copy ,
1987 .Ic mbox ,
1988 .Ic next ,
1989 .Ic pipe  ,
1990 .Ic Print ,
1991 .Ic print ,
1992 .Ic top ,
1993 .Ic Type ,
1994 .Ic type ,
1995 .Ic undelete .
1996 The commands
1997 .Ic dp
1999 .Ic dt
2000 will always try to automatically
2001 .Dq step
2003 .Ic type
2005 .Dq next
2006 logical message, and may thus mark multiple messages as read, the
2007 .Ic delete
2008 command will do so if  the internal variable
2009 .Va autoprint
2010 is set.
2011 Except when the
2012 .Ic exit
2013 command is used, messages that are in a
2014 .Mx -sx
2015 .Sx "primary system mailbox"
2016 and are in
2017 .Ql read
2018 state when the mailbox is left will be saved in the
2019 .Mx -sx
2020 .Sx "secondary mailbox"
2021 .Ev MBOX
2022 unless the internal variable
2023 .Va hold
2024 it set.
2026 .It Ql deleted
2027 The message has been processed by one of the following commands:
2028 .Ic delete ,
2029 .Ic dp ,
2030 .Ic dt .
2031 Only
2032 .Ic undelete
2033 can be used to access such messages.
2035 .It Ql preserved
2036 The message has been processed by a
2037 .Ic preserve
2038 command and it will be retained in its current location.
2040 .It Ql saved
2041 The message has been processed by one of the following commands:
2042 .Ic save
2044 .Ic write .
2045 Unless when the
2046 .Ic exit
2047 command is used, messages that are in a
2048 .Mx -sx
2049 .Sx "primary system mailbox"
2050 and are in
2051 .Ql saved
2052 state when the mailbox is left will be deleted; they will be saved in the
2053 .Mx -sx
2054 .Sx "secondary mailbox"
2055 .Ev MBOX
2056 when the internal variable
2057 .Va keepsave
2058 is set.
2062 In addition to these message states, flags which otherwise have no
2063 technical meaning in the mail system except allowing special ways of
2064 addressing them when
2065 .Sx "Specifying messages"
2066 can be set on messages.
2067 These flags are saved with messages and are thus persistent, and are
2068 portable between a set of widely used MUAs.
2070 .Bl -hang -width ".It Ic answered"
2071 .It Ic answered
2072 Mark messages as having been answered.
2073 .It Ic draft
2074 Mark messages as being a draft.
2075 .It Ic flag
2076 Mark messages which need special attention.
2078 .\" }}}
2080 .\" .Ss "Specifying messages" {{{
2081 .Ss "Specifying messages"
2083 Commands such as
2084 .Ic from ,
2085 .Ic type
2087 .Ic delete
2088 can be given a list of message numbers as arguments to apply to a number
2089 of messages at once.
2090 Thus
2091 .Ql delete 1 2
2092 deletes messages 1 and 2,
2093 whereas
2094 .Ql delete 1-5
2095 will delete the messages 1 through 5.
2096 In sorted or threaded mode (see the
2097 .Ic sort
2098 command),
2099 .Ql delete 1-5
2100 will delete the messages that are located between (and including)
2101 messages 1 through 5 in the sorted/threaded order, as shown in the
2102 .Ic headers
2103 summary.
2104 The following special message names exist:
2107 .Bl -tag -width ".It Ar BaNg"
2108 .It Ar \&.
2109 The current message, the so-called
2110 .Dq dot .
2112 .It Ar \&;
2113 The message that was previously the current message.
2115 .It Ar \&,
2116 The parent message of the current message,
2117 that is the message with the Message-ID given in the
2118 .Ql In-Reply-To:
2119 field or the last entry of the
2120 .Ql References:
2121 field of the current message.
2123 .It Ar -
2124 The next previous undeleted message,
2125 or the next previous deleted message for the
2126 .Ic undelete
2127 command.
2128 In sorted/threaded mode,
2129 the next previous such message in the sorted/threaded order.
2131 .It Ar +
2132 The next undeleted message,
2133 or the next deleted message for the
2134 .Ic undelete
2135 command.
2136 In sorted/threaded mode,
2137 the next such message in the sorted/threaded order.
2139 .It Ar ^
2140 The first undeleted message,
2141 or the first deleted message for the
2142 .Ic undelete
2143 command.
2144 In sorted/threaded mode,
2145 the first such message in the sorted/threaded order.
2147 .It Ar $
2148 The last message.
2149 In sorted/threaded mode,
2150 the last message in the sorted/threaded order.
2152 .It Ar & Ns Ar x
2153 In threaded mode,
2154 selects the message addressed with
2155 .Ar x ,
2156 where
2157 .Ar x
2158 is any other message specification,
2159 and all messages from the thread that begins at it.
2160 Otherwise it is identical to
2161 .Ar x .
2163 .Ar x
2164 is omitted,
2165 the thread beginning with the current message is selected.
2167 .It Ar *
2168 All messages.
2169 .It Ar `
2170 All messages that were included in the
2171 .Sx "Message list arguments"
2172 of the previous command.
2174 .It Ar x-y
2175 An inclusive range of message numbers.
2176 Selectors that may also be used as endpoints include any of
2177 .Ar .;-+^$ .
2179 .It Ar address
2180 A case-insensitive
2181 .Dq any substring matches
2182 search against the
2183 .Ql From:
2184 header, which will match addresses (too) even if
2185 .Va showname
2186 is set (and POSIX says
2187 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2188 However, if the
2189 .Va allnet
2190 variable is set, only the local part of the address is evaluated
2191 for the comparison, not ignoring case, and the setting of
2192 .Va showname
2193 is completely ignored.
2194 For finer control and match boundaries use the
2195 .Ql @
2196 search expression.
2198 .It Ar / Ns Ar string
2199 All messages that contain
2200 .Ar string
2201 in the subject field (case ignored).
2202 See also the
2203 .Va searchheaders
2204 variable.
2206 .Ar string
2207 is empty,
2208 the string from the previous specification of that type is used again.
2210 .It Xo Op Ar @ Ns Ar name-list Ns
2211 .Ar @ Ns Ar expr
2213 All messages that contain the given case-insensitive search
2214 .Ar expr Ns
2215 ession; if the \*(OPal regular expression (see
2216 .Xr re_format 7 )
2217 support is available
2218 .Ar expr
2219 will be interpreted as (an extended) one if any of the
2220 .Dq magical
2221 (extended) regular expression characters is seen: in this case this
2222 should match strings correctly which are in the locale
2223 .Ev LC_CTYPE
2224 encoding.
2225 If the optional
2226 .Ar @ Ns Ar name-list
2227 part is missing, the search is restricted to the subject field body,
2228 but otherwise
2229 .Ar name-list
2230 specifies a comma-separated list of header fields to search, as in
2232 .Dl '@to,from,cc@Someone i ought to know'
2234 In order to search for a string that includes a
2235 .Ql @
2236 (commercial at) character the
2237 .Ar name-list
2238 is effectively non-optional, but may be given as the empty string.
2239 Some special header fields may be abbreviated:
2240 .Ql f ,
2241 .Ql t ,
2242 .Ql c ,
2243 .Ql b
2245 .Ql s
2246 will match
2247 .Ql From ,
2248 .Ql To ,
2249 .Ql Cc ,
2250 .Ql Bcc
2252 .Ql Subject ,
2253 respectively and case-insensitively.
2254 The special names
2255 .Ql header
2257 .Ql <
2258 can be used to search in (all of) the header(s) of the message, and the
2259 special names
2260 .Ql body
2262 .Ql >
2264 .Ql text
2266 .Ql =
2267 can be used to perform full text searches \(en whereas the former
2268 searches only the body, the latter also searches the message header.
2270 This message specification performs full text comparison, but even with
2271 regular expression support it is almost impossible to write a search
2272 expression that savely matches only a specific address domain.
2273 To request that the content of the header is treated as a list of
2274 addresses, and to strip those down to the plain email address which the
2275 search expression is to be matched against, prefix the header name
2276 (abbreviation) with a tilde
2277 .Ql ~ :
2279 .Dl @~f@@a\e.safe\e.domain\e.match$
2281 .It Ar :c
2282 All messages of state
2283 .Ql c ,
2284 where
2285 .Ql c
2286 is one or multiple of the following colon modifiers:
2288 .Bl -tag -compact -width ".It Ar :M"
2289 .It Ar n
2290 .Ql new
2291 messages.
2292 .It Ar o
2293 Old messages (any not in state
2294 .Ql read
2296 .Ql new ) .
2297 .It Ar u
2298 .Ql unread
2299 messages.
2300 .It Ar d
2301 .Ql deleted
2302 messages (for the
2303 .Ic undelete
2305 .Ic from
2306 commands only).
2307 .It Ar r
2308 .Ql read
2309 messages.
2310 .It Ar f
2311 .Ic flag Ns
2312 ged messages.
2313 .It Ar a
2314 .Ic answered
2315 messages (cf. the variable
2316 .Va markanswered ) .
2317 .It Ar t
2318 Messages marked as
2319 .Ic draft .
2320 .It Ar s
2321 \*(OP Messages classified as spam (see
2322 .Sx "Handling spam" . )
2323 .It Ar S
2324 \*(OP Messages with unsure spam classification.
2330 \*(OP IMAP-style SEARCH expressions may also be used.
2331 This addressing mode is available with all types of mailbox
2332 .Ic folder Ns
2333 s; \*(UA will perform the search locally as necessary.
2334 Strings must be enclosed by double quotes
2335 .Ql \&"
2336 in their entirety if they contain whitespace or parentheses;
2337 within the quotes, only reverse solidus
2338 .Ql \e
2339 is recognized as an escape character.
2340 All string searches are case-insensitive.
2341 When the description indicates that the
2342 .Dq envelope
2343 representation of an address field is used,
2344 this means that the search string is checked against both a list
2345 constructed as
2347 .Bd -literal -offset indent
2348 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2352 for each address,
2353 and the addresses without real names from the respective header field.
2354 These search expressions can be nested using parentheses, see below for
2355 examples.
2358 .Bl -tag -compact -width ".It Ar _n_u"
2359 .It Ar ( criterion )
2360 All messages that satisfy the given
2361 .Ar criterion .
2362 .It Ar ( criterion1 criterion2 ... criterionN )
2363 All messages that satisfy all of the given criteria.
2365 .It Ar ( or criterion1 criterion2 )
2366 All messages that satisfy either
2367 .Ar criterion1
2369 .Ar criterion2 ,
2370 or both.
2371 To connect more than two criteria using
2372 .Ql or
2373 specifications have to be nested using additional parentheses,
2374 as with
2375 .Ql (or a (or b c)) ,
2376 since
2377 .Ql (or a b c)
2378 really means
2379 .Ql ((a or b) and c) .
2380 For a simple
2381 .Ql or
2382 operation of independent criteria on the lowest nesting level,
2383 it is possible to achieve similar effects by using three separate
2384 criteria, as with
2385 .Ql (a) (b) (c) .
2387 .It Ar ( not criterion )
2388 All messages that do not satisfy
2389 .Ar criterion .
2390 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2391 All messages that contain
2392 .Ar string
2393 in the envelope representation of the
2394 .Ql Bcc:
2395 field.
2396 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2397 All messages that contain
2398 .Ar string
2399 in the envelope representation of the
2400 .Ql Cc:
2401 field.
2402 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2403 All messages that contain
2404 .Ar string
2405 in the envelope representation of the
2406 .Ql From:
2407 field.
2408 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2409 All messages that contain
2410 .Ar string
2411 in the
2412 .Ql Subject:
2413 field.
2414 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2415 All messages that contain
2416 .Ar string
2417 in the envelope representation of the
2418 .Ql To:
2419 field.
2420 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2421 All messages that contain
2422 .Ar string
2423 in the specified
2424 .Ql Name:
2425 field.
2426 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2427 All messages that contain
2428 .Ar string
2429 in their body.
2430 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2431 All messages that contain
2432 .Ar string
2433 in their header or body.
2434 .It Ar ( larger size )
2435 All messages that are larger than
2436 .Ar size
2437 (in bytes).
2438 .It Ar ( smaller size )
2439 All messages that are smaller than
2440 .Ar size
2441 (in bytes).
2443 .It Ar ( before date )
2444 All messages that were received before
2445 .Ar date ,
2446 which must be in the form
2447 .Ql d[d]-mon-yyyy ,
2448 where
2449 .Ql d
2450 denotes the day of the month as one or two digits,
2451 .Ql mon
2452 is the name of the month \(en one of
2453 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2455 .Ql yyyy
2456 is the year as four digits, e.g.,
2457 .Ql 28-Dec-2012 .
2459 .It Ar ( on date )
2460 All messages that were received on the specified date.
2461 .It Ar ( since date )
2462 All messages that were received since the specified date.
2463 .It Ar ( sentbefore date )
2464 All messages that were sent on the specified date.
2465 .It Ar ( senton date )
2466 All messages that were sent on the specified date.
2467 .It Ar ( sentsince date )
2468 All messages that were sent since the specified date.
2469 .It Ar ()
2470 The same criterion as for the previous search.
2471 This specification cannot be used as part of another criterion.
2472 If the previous command line contained more than one independent
2473 criterion then the last of those criteria is used.
2475 .\" }}}
2477 .\" .Ss "On terminal control and line editor" {{{
2478 .Ss "On terminal control and line editor"
2480 \*(OP Terminal control will be realized through one of the standard
2482 libraries, either the
2483 .Lb libtermcap ,
2484 or, alternatively, the
2485 .Lb libterminfo ,
2486 both of which will be initialized to work with the environment variable
2487 .Ev TERM .
2488 Terminal control will enhance or enable interactive usage aspects, e.g.,
2489 .Sx "Coloured display" ,
2490 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2491 byte-sequences of keys like the cursor and function keys.
2494 The internal variable
2495 .Va termcap
2496 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2497 \*(UA may also become a fullscreen application by entering the
2498 so-called ca-mode and switching to an alternative exclusive screen
2499 (content) shall the terminal support it and the internal variable
2500 .Va termcap-ca-mode
2501 has been set explicitly.
2502 Actual interaction with the chosen library can be disabled completely by
2503 setting the internal variable
2504 .Va termcap-disable ;
2505 .Va termcap
2506 will be queried regardless, which is true even if the \*(OPal library
2507 support has not been enabled at configuration time as long as some other
2508 \*(OP which (may) query terminal control sequences has been enabled.
2511 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2512 environments which comply to the ISO C standard
2513 .St -isoC-amd1 ,
2514 and will support wide glyphs if possible (the necessary functionality
2515 had been removed from ISO C, but was included in
2516 .St -xpg4 ) .
2517 Prevent usage of a line editor in interactive mode by setting the
2518 internal variable
2519 .Va line-editor-disable .
2520 Especially if the \*(OPal terminal control support is missing setting
2521 entries in the internal variable
2522 .Va termcap
2523 will help shall the MLE misbehave, see there for more.
2524 The MLE can support a little bit of
2525 .Ic colour .
2528 \*(OP If the
2529 .Ic history
2530 feature is available then input from line editor prompts will be saved
2531 in a history list that can be searched in and be expanded from.
2532 Such saving can be prevented by prefixing input with any amount of
2533 whitespace.
2534 Aspects of history, like allowed content and maximum size, as well as
2535 whether history shall be saved persistently, can be configured with the
2536 internal variables
2537 .Va history-file ,
2538 .Va history-gabby ,
2539 .Va history-gabby-persist
2541 .Va history-size .
2544 The MLE supports a set of editing and control commands.
2545 By default (as) many (as possible) of these will be assigned to a set of
2546 single-letter control codes, which should work on any terminal (and can
2547 be generated by holding the
2548 .Dq control
2549 key while pressing the key of desire, e.g.,
2550 .Ql control-D ) .
2551 If the \*(OPal
2552 .Ic bind
2553 command is available then the MLE commands can also be accessed freely
2554 by assigning the command name, which is shown in parenthesis in the list
2555 below, to any desired key-sequence, and the MLE will instead and also use
2556 .Ic bind
2557 to establish its built-in key bindings
2558 (more of them if the \*(OPal terminal control is available),
2559 an action which can then be suppressed completely by setting
2560 .Va line-editor-no-defaults .
2561 .Sx "Shell-style argument quoting"
2562 notation is used in the following;
2563 combinations not mentioned either cause job control signals or do not
2564 generate a (unique) keycode:
2568 .Bl -tag -compact -width ".It Ql \eBa"
2569 .It Ql \ecA
2570 Go to the start of the line
2572 .Pf ( Cd mle-go-home ) .
2574 .It Ql \ecB
2575 Move the cursor backward one character
2577 .Pf ( Cd mle-go-bwd ) .
2579 .It Ql \ecD
2580 Forward delete the character under the cursor;
2581 quits \*(UA if used on the empty line unless the internal variable
2582 .Va ignoreeof
2583 is set
2585 .Pf ( Cd mle-del-fwd ) .
2587 .It Ql \ecE
2588 Go to the end of the line
2590 .Pf ( Cd mle-go-end ) .
2592 .It Ql \ecF
2593 Move the cursor forward one character
2595 .Pf ( Cd mle-go-fwd ) .
2597 .It Ql \ecG
2598 Cancel current operation, full reset.
2599 If there is an active history search or tabulator expansion then this
2600 command will first reset that, reverting to the former line content;
2601 thus a second reset is needed for a full reset in this case
2603 .Pf ( Cd mle-reset ) .
2605 .It Ql \ecH
2606 Backspace: backward delete one character
2608 .Pf ( Cd mle-del-bwd ) .
2610 .It Ql \ecI
2611 \*(NQ
2612 Horizontal tabulator:
2613 try to expand the word before the cursor, supporting the usual
2614 .Sx "Filename transformations"
2616 .Pf ( Cd mle-complete ) .
2617 This is affected by
2618 .Cd mle-quote-rndtrip .
2620 .It Ql \ecJ
2621 Newline:
2622 commit the current line
2624 .Pf ( Cd mle-commit ) .
2626 .It Ql \ecK
2627 Cut all characters from the cursor to the end of the line
2629 .Pf ( Cd mle-snarf-end ) .
2631 .It Ql \ecL
2632 Repaint the line
2634 .Pf ( Cd mle-repaint ) .
2636 .It Ql \ecN
2637 \*(OP Go to the next history entry
2639 .Pf ( Cd mle-hist-fwd ) .
2641 .It Ql \ecO
2642 (\*(OPally context-dependent) Invokes the command
2643 .Ic dt .
2645 .It Ql \ecP
2646 \*(OP Go to the previous history entry
2648 .Pf ( Cd mle-hist-bwd ) .
2650 .It Ql \ecQ
2651 Toggle roundtrip mode shell quotes, where produced,
2652 on and off
2654 .Pf ( Cd mle-quote-rndtrip ) .
2655 This setting is temporary, and will be forgotten once the command line
2656 is committed; also see
2657 .Ic shcodec .
2659 .It Ql \ecR
2660 \*(OP Complete the current line from (the remaining) older history entries
2662 .Pf ( Cd mle-hist-srch-bwd ) .
2664 .It Ql \ecS
2665 \*(OP Complete the current line from (the remaining) newer history entries
2667 .Pf ( Cd mle-hist-srch-fwd ) .
2669 .It Ql \ecT
2670 Paste the snarf buffer
2672 .Pf ( Cd mle-paste ) .
2674 .It Ql \ecU
2675 The same as
2676 .Ql \ecA
2677 followed by
2678 .Ql \ecK
2680 .Pf ( Cd mle-snarf-line ) .
2682 .It Ql \ecV
2683 Prompts for a Unicode character (its hexadecimal number) to be inserted
2685 .Pf ( Cd mle-prompt-char ) .
2686 Note this command needs to be assigned to a single-letter control code
2687 in order to become recognized and executed during input of
2688 a key-sequence (only three single-letter control codes can be used for
2689 that shortcut purpose); this control code is special-treated and cannot
2690 be part of any other sequence, because any occurrence will perform the
2691 .Cd mle-prompt-char
2692 function immediately.
2694 .It Ql \ecW
2695 Cut the characters from the one preceding the cursor to the preceding
2696 word boundary
2698 .Pf ( Cd mle-snarf-word-bwd ) .
2700 .It Ql \ecX
2701 Move the cursor forward one word boundary
2703 .Pf ( Cd mle-go-word-fwd ) .
2705 .It Ql \ecY
2706 Move the cursor backward one word boundary
2708 .Pf ( Cd mle-go-word-bwd ) .
2710 .It Ql \ec[
2711 Escape: reset a possibly used multibyte character input state machine
2712 and \*(OPally a lingering, incomplete key binding
2714 .Pf ( Cd mle-cancel ) .
2715 This command needs to be assigned to a single-letter control code in
2716 order to become recognized and executed during input of a key-sequence
2717 (only three single-letter control codes can be used for that shortcut
2718 purpose).
2719 This control code may also be part of a multi-byte sequence, but if
2720 a sequence is active and the very control code is currently also an
2721 expected input, then it will first be consumed by the active sequence.
2723 .It Ql \ec\e
2724 (\*(OPally context-dependent) Invokes the command
2725 .Ql Ic z Ns + .
2727 .It Ql \ec]
2728 (\*(OPally context-dependent) Invokes the command
2729 .Ql Ic z Ns $ .
2731 .It Ql \ec^
2732 (\*(OPally context-dependent) Invokes the command
2733 .Ql Ic z Ns 0 .
2735 .It Ql \ec_
2736 Cut the characters from the one after the cursor to the succeeding word
2737 boundary
2739 .Pf ( Cd mle-snarf-word-fwd ) .
2741 .It Ql \ec?
2742 Backspace:
2743 .Cd mle-del-bwd .
2745 .It \(en
2747 .Cd mle-fullreset :
2748 different to
2749 .Cd mle-reset
2750 this will immediately reset a possibly active search etc.
2752 .It \(en
2754 .Cd mle-bell :
2755 ring the audible bell.
2757 .\" }}}
2759 .\" .Ss "Coloured display" {{{
2760 .Ss "Coloured display"
2762 \*(OP \*(UA can be configured to support a coloured display and font
2763 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
2764 rendition) escape sequences.
2765 Usage of colours and font attributes solely depends upon the
2766 capability of the detected terminal type that is defined by the
2767 environment variable
2768 .Ev TERM
2769 and which can be fine-tuned by the user via the internal variable
2770 .Va termcap .
2773 On top of what \*(UA knows about the terminal the boolean variable
2774 .Va colour-pager
2775 defines whether the actually applicable colour and font attribute
2776 sequences should also be generated when output is going to be paged
2777 through the external program defined by the environment variable
2778 .Ev PAGER
2779 (also see
2780 .Va crt Ns
2782 This is not enabled by default because different pager programs need
2783 different command line switches or other configuration in order to
2784 support those sequences.
2785 \*(UA however knows about some widely used pagers and in a clean
2786 environment it is often enough to simply set
2787 .Va colour-pager ;
2788 please refer to that variable for more on this topic.
2791 If the variable
2792 .Va colour-disable
2793 is set then any active usage of colour and font attribute sequences
2794 is suppressed, but without affecting possibly established
2795 .Ic colour
2796 mappings.
2799 To define and control colours and font attributes a single multiplexer
2800 command family exists:
2801 .Ic colour
2802 shows or defines colour mappings for the given colour type (e.g.,
2803 monochrome) and
2804 .Ic uncolour
2805 can be used to remove mappings of a given colour type.
2806 Since colours are only available in interactive mode, it may make
2807 sense to conditionalize the colour setup by encapsulating it with
2808 .Ic if :
2810 .Bd -literal -offset indent
2811 if terminal && [ "$features" =% +colour ]
2812   colour iso view-msginfo ft=bold,fg=green
2813   colour iso view-header ft=bold,fg=red from,subject
2814   colour iso view-header fg=red
2816   uncolour iso view-header from,subject
2817   colour iso view-header ft=bold,fg=magenta,bg=cyan
2818   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
2819   colour mono view-header ft=bold
2820   colour mono view-header ft=bold,ft=reverse subject,from
2821 endif
2823 .\" }}}
2825 .\" .Ss "Handling spam" {{{
2826 .Ss "Handling spam"
2828 \*(OP \*(UA can make use of several spam interfaces for the purpose of
2829 identification of, and, in general, dealing with spam messages.
2830 A precondition of most commands in order to function is that the
2831 .Va spam-interface
2832 variable is set to one of the supported interfaces.
2833 Once messages have been identified as spam their (volatile)
2834 .Ql is-spam
2835 state can be prompted: the
2836 .Ql Ar :s
2838 .Ql Ar :S
2839 message specifications will address respective messages and their
2840 .Va attrlist
2841 entries will be used when displaying the
2842 .Va headline
2843 in the header display.
2845 .Bl -bullet
2847 .Ic spamrate
2848 rates the given messages and sets their
2849 .Ql is-spam
2850 flag accordingly.
2851 If the spam interface offers spam scores those can also be displayed in
2852 the header display by including the
2853 .Ql %$
2854 format in the
2855 .Va headline
2856 variable.
2858 .Ic spamham ,
2859 .Ic spamspam
2861 .Ic spamforget
2862 will interact with the Bayesian filter of the chosen interface and learn
2863 the given messages as
2864 .Dq ham
2866 .Dq spam ,
2867 respectively; the last command can be used to cause
2868 .Dq unlearning
2869 of messages; it adheres to their current
2870 .Ql is-spam
2871 state and thus reverts previous teachings.
2873 .Ic spamclear
2875 .Ic spamset
2876 will simply set and clear, respectively, the mentioned volatile
2877 .Ql is-spam
2878 message flag, without any interface interaction.
2883 .Xr spamassassin 1
2884 based
2885 .Va spam-interface
2886 .Ql spamc
2887 requires a running instance of the
2888 .Xr spamd 1
2889 server in order to function, started with the option
2890 .Fl -allow-tell
2891 shall Bayesian filter learning be possible.
2893 .Bd -literal -offset indent
2894 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
2895 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
2896     --daemonize [--local] [--allow-tell]
2900 Thereafter \*(UA can make use of these interfaces:
2902 .Bd -literal -offset indent
2903 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
2904     -Sspamc-command=/usr/local/bin/spamc \e
2905     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
2907 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
2908     -Sspamc-command=/usr/local/bin/spamc \e
2909     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
2913 Using the generic filter approach allows usage of programs like
2914 .Xr bogofilter 1 .
2915 Here is an example, requiring it to be accessible via
2916 .Ev PATH :
2918 .Bd -literal -offset indent
2919 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
2920     -Sspamfilter-ham="bogofilter -n" \e
2921     -Sspamfilter-noham="bogofilter -N" \e
2922     -Sspamfilter-nospam="bogofilter -S" \e
2923     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
2924     -Sspamfilter-spam="bogofilter -s" \e
2925     -Sspamfilter-rate-scanscore="1;^(.+)$"
2929 Because messages must exist on local storage in order to be scored (or
2930 used for Bayesian filter training), it is possibly a good idea to
2931 perform the local spam check last:
2933 .Bd -literal -offset indent
2934 define spamdelhook {
2935   # Server side DCC
2936   spamset (header x-dcc-brand-metrics "bulk")
2937   # Server-side spamassassin(1)
2938   spamset (header x-spam-flag "YES")
2939   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
2940   move :S +maybe-spam
2941   spamrate :u
2942   del :s
2943   move :S +maybe-spam
2945 set folder-hook-FOLDER=spamdelhook
2949 See also the documentation for the variables
2950 .Va spam-interface , spam-maxsize ,
2951 .Va spamc-command , spamc-arguments , spamc-user ,
2952 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
2953   spamfilter-rate
2955 .Va spamfilter-rate-scanscore .
2956 .\" }}}
2958 .\" }}} (DESCRIPTION)
2961 .\" .Sh COMMANDS {{{
2962 .Sh COMMANDS
2964 \*(UA reads input in lines.
2965 An unquoted reverse solidus
2966 .Ql \e
2967 at the end of a command line
2968 .Dq escapes
2969 the newline character: it is discarded and the next line of input is
2970 used as a follow-up line, with all leading whitespace removed;
2971 once an entire line is completed, the whitespace characters
2972 .Cm space , tabulator , newline
2973 as well as those defined by the variable
2974 .Va ifs
2975 are removed from the beginning and end.
2976 Placing any whitespace characters at the beginning of a line will
2977 prevent a possible addition of the command line to the \*(OPal
2978 .Ic history .
2981 The beginning of such input lines is then scanned for the name of
2982 a known command: command names may be abbreviated, in which case the
2983 first command that matches the given prefix will be used.
2984 .Sx "Command modifiers"
2985 may prefix a command in order to modify its behaviour.
2986 A name may also be a
2987 .Ic commandalias ,
2988 which will become expanded until no more expansion is possible.
2989 Once the command that shall be executed is known, the remains of the
2990 input line will be interpreted according to command-specific rules:
2991 (\*(ID) some commands use
2992 .Sx "Shell-style argument quoting" ,
2993 so that a single input line may actually consist of multiple commands,
2994 but others pass it unchanged as
2995 .Sx "Raw data arguments for codec commands" .
2998 The command
2999 .Ic list
3000 can be used to show the list of all commands, either alphabetically
3001 sorted or in prefix search order (these do not match, also because the
3002 POSIX standard prescribes a set of abbreviations).
3003 \*(OPally the command
3004 .Ic help
3006 .Ic \&? ) ,
3007 when given an argument, will show a documentation string for the
3008 command matching the expanded argument, as in
3009 .Ql ?t ,
3010 which should be a shorthand of
3011 .Ql ?type ;
3012 with these documentation strings both commands support a more
3013 .Va verbose
3014 listing mode which includes the argument type of the command and other
3015 information which applies; a handy suggestion might thus be:
3017 .Bd -literal -offset indent
3018 ? define __xv {
3019   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3020   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
3022 ? commandalias xv '\ecall __xv'
3023 ? xv help set
3026 .\" .Ss "Command modifiers" {{{
3027 .Ss "Command modifiers"
3029 Commands may be prefixed by one or multiple command modifiers.
3031 .Bl -bullet
3033 The modifier reverse solidus
3035 .Cm \e ,
3036 to be placed first, prevents
3037 .Ic commandalias
3038 expansions on the remains of the line, e.g.,
3039 .Ql \eecho
3040 will always evaluate the command
3041 .Ic echo ,
3042 even if an (command)alias of the same name exists.
3043 .Ic commandalias
3044 content may itself contain further command modifiers, including
3045 an initial reverse solidus to prevent further expansions.
3048 The modifier
3050 .Cm ignerr
3051 indicates that any error generated by the following command should be
3052 ignored by the state machine and not cause a program exit with enabled
3053 .Va errexit
3054 or for the standardized exit cases in
3055 .Ev POSIXLY_CORRECT
3056 mode.
3057 .Va \&? ,
3058 one of the
3059 .Sx "INTERNAL VARIABLES" ,
3060 will be set to the real exit status of the command regardless.
3063 Some commands support the
3065 .Cm vput
3066 modifier: if used, they expect the name of a variable, which can itself
3067 be a variable, i.e., shell expansion is applied, as their first
3068 argument, and will place their computation result in it instead of the
3069 default location (it is usually written to standard output).
3071 The given name will be tested for being a valid
3072 .Xr sh 1
3073 variable name, and may therefore only consist of upper- and lowercase
3074 characters, digits, and the underscore; the hyphen-minus may be used as
3075 a non-portable extension; digits may not be used as first, hyphen-minus
3076 may not be used as last characters.
3077 In addition the name may either not be one of the known
3078 .Sx "INTERNAL VARIABLES" ,
3079 or must otherwise refer to a writable (non-boolean) value variable.
3080 The actual put operation may fail nonetheless, e.g., if the variable
3081 expects a number argument only a number will be accepted.
3082 Any error during these operations causes the command as such to fail,
3083 and the error number
3084 .Va \&!
3085 will be set to
3086 .Va ^ERR Ns -NOTSUP ,
3087 the exit status
3088 .Va \&?
3089 should be set to
3090 .Ql -1 .
3093 Last, but not least, the modifier
3095 .Cm wysh
3096 can be used for some old and established commands to choose the new
3097 .Sx "Shell-style argument quoting"
3098 rules over the traditional
3099 .Sx "Old-style argument quoting" .
3101 .\" }}}
3103 .\" .Ss "Message list arguments" {{{
3104 .Ss "Message list arguments"
3106 Some commands expect arguments that represent messages (actually
3107 their symbolic message numbers), as has been documented above under
3108 .Sx "Specifying messages"
3109 already.
3110 If no explicit message list has been specified, the next message
3111 forward that satisfies the command's requirements will be used,
3112 and if there are no messages forward of the current message,
3113 the search proceeds backwards;
3114 if there are no good messages at all to be found, an error message is
3115 shown and the command is aborted.
3116 .\" }}}
3118 .\" .Ss "Old-style argument quoting" {{{
3119 .Ss "Old-style argument quoting"
3121 \*(ID This section documents the old, traditional style of quoting
3122 non-message-list arguments to commands which expect this type of
3123 arguments: whereas still used by the majority of such commands, the new
3124 .Sx "Shell-style argument quoting"
3125 may be available even for those via
3126 .Cm wysh ,
3127 one of the
3128 .Sx "Command modifiers" .
3129 Nonetheless care must be taken, because only new commands have been
3130 designed with all the capabilities of the new quoting rules in mind,
3131 which can, e.g., generate control characters.
3134 .Bl -bullet -offset indent
3136 An argument can be enclosed between paired double-quotes
3137 .Ql """argument"""
3139 single-quotes
3140 .Ql 'argument' ;
3141 any whitespace, shell word expansion, or reverse solidus characters
3142 (except as described next) within the quotes are treated literally as
3143 part of the argument.
3144 A double-quote will be treated literally within single-quotes and vice
3145 versa.
3146 Inside such a quoted string the actually used quote character can be
3147 used nonetheless by escaping it with a reverse solidus
3148 .Ql \e ,
3149 as in
3150 .Ql """y\e""ou""" .
3153 An argument that is not enclosed in quotes, as above, can usually still
3154 contain space characters if those spaces are reverse solidus escaped, as in
3155 .Ql you\e are .
3158 A reverse solidus outside of the enclosing quotes is discarded
3159 and the following character is treated literally as part of the argument.
3161 .\" }}}
3163 .\" .Ss "Shell-style argument quoting" {{{
3164 .Ss "Shell-style argument quoting"
3166 Commands which don't expect message-list arguments use
3167 .Xr sh 1 Ns
3168 ell-style, and therefore POSIX standardized, argument parsing and
3169 quoting rules.
3170 \*(ID Most new commands only support these new rules and are flagged
3171 \*(NQ, some elder ones can use them with the command modifier
3172 .Cm wysh ;
3173 in the future only this type of argument quoting will remain.
3176 A command line is parsed from left to right and an input token is
3177 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3178 Metacharacters are vertical bar
3179 .Cm \&| ,
3180 ampersand
3181 .Cm & ,
3182 semicolon
3183 .Cm \&; ,
3184 as well as all characters from the variable
3185 .Va ifs ,
3186 and / or
3187 .Cm space , tabulator , newline .
3188 The additional metacharacters left and right parenthesis
3189 .Cm \&( , \&)
3190 and less-than and greater-than signs
3191 .Cm < , >
3192 that the
3193 .Xr sh 1
3194 supports are not used, and are treated as ordinary characters: for one
3195 these characters are a vivid part of email addresses, and it seems
3196 highly unlikely that their function will become meaningful to \*(UA.
3198 .Bd -filled -offset indent
3199 .Sy Compatibility note:
3200 \*(ID Please note that even many new-style commands do not yet honour
3201 .Va ifs
3202 to parse their arguments: whereas the
3203 .Xr sh 1 Ns
3204 ell is a language with syntactic elements of clearly defined semantics,
3205 \*(UA parses entire input lines and decides on a per-command base what
3206 to do with the rest of the line.
3207 This also means that whenever an unknown command is seen all that \*(UA
3208 can do is cancellation of the processing of the remains of the line.
3210 It also often depends on an actual subcommand of a multiplexer command
3211 how the rest of the line should be treated, and until v15 we are not
3212 capable to perform this deep inspection of arguments.
3213 Nonetheless, at least the following commands which work with positional
3214 parameters fully support
3215 .Va ifs
3216 for an almost shell-compatible field splitting:
3217 .Ic call , call_if , read , vpospar , xcall .
3221 Any unquoted number sign
3222 .Ql #
3223 at the beginning of a new token starts a comment that extends to the end
3224 of the line, and therefore ends argument processing.
3225 An unquoted dollar sign
3226 .Ql $
3227 will cause variable expansion of the given name, which must be a valid
3228 .Xr sh 1 Ns
3229 ell-style variable name (see
3230 .Cm vput ) :
3231 .Sx "INTERNAL VARIABLES"
3232 as well as
3233 .Sx ENVIRONMENT
3234 (shell) variables can be accessed through this mechanism, brace
3235 enclosing the name is supported (i.e., to subdivide a token).
3238 Whereas the metacharacters
3239 .Cm space , tabulator , newline
3240 only complete an input token, vertical bar
3241 .Cm \&| ,
3242 ampersand
3243 .Cm &
3244 and semicolon
3245 .Cm \&;
3246 also act as control operators and perform control functions.
3247 For now supported is semicolon
3248 .Cm \&; ,
3249 which terminates a single command, therefore sequencing the command line
3250 and making the remainder of the line a subject to reevaluation.
3251 With sequencing, multiple command argument types and quoting rules may
3252 therefore apply to a single line, which can become problematic before
3253 v15: e.g., the first of the following will cause surprising results.
3256 .Dl ? echo one; set verbose; echo verbose=$verbose.
3257 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3260 Quoting is a mechanism that will remove the special meaning of
3261 metacharacters and reserved words, and will prevent expansion.
3262 There are four quoting mechanisms: the escape character, single-quotes,
3263 double-quotes and dollar-single-quotes:
3266 .Bl -bullet -offset indent
3268 The literal value of any character can be preserved by preceding it
3269 with the escape character reverse solidus
3270 .Ql \e .
3273 Arguments which are enclosed in
3274 .Ql 'single-\:quotes'
3275 retain their literal value.
3276 A single-quote cannot occur within single-quotes.
3279 The literal value of all characters enclosed in
3280 .Ql \(dqdouble-\:quotes\(dq
3281 is retained, with the exception of dollar sign
3282 .Ql $ ,
3283 which will cause variable expansion, as above, backquote (grave accent)
3284 .Ql ` ,
3285 (which not yet means anything special), reverse solidus
3286 .Ql \e ,
3287 which will escape any of the characters dollar sign
3288 .Ql $
3289 (to prevent variable expansion), backquote (grave accent)
3290 .Ql ` ,
3291 double-quote
3292 .Ql \(dq
3293 (to prevent ending the quote) and reverse solidus
3294 .Ql \e
3295 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3296 but has no special meaning otherwise.
3299 Arguments enclosed in
3300 .Ql $'dollar-\:single-\:quotes'
3301 extend normal single quotes in that reverse solidus escape sequences are
3302 expanded as follows:
3304 .Bl -tag -compact -width "Ql \eNNN"
3305 .It Ql \ea
3306 bell control character (ASCII and ISO-10646 BEL).
3307 .It Ql \eb
3308 backspace control characer (ASCII and ISO-10646 BS).
3309 .It Ql \eE
3310 escape control character (ASCII and ISO-10646 ESC).
3311 .It Ql \ee
3312 the same.
3313 .It Ql \ef
3314 form feed control character (ASCII and ISO-10646 FF).
3315 .It Ql \en
3316 line feed control character (ASCII and ISO-10646 LF).
3317 .It Ql \er
3318 carriage return control character (ASCII and ISO-10646 CR).
3319 .It Ql \et
3320 horizontal tabulator control character (ASCII and ISO-10646 HT).
3321 .It Ql \ev
3322 vertical tabulator control character (ASCII and ISO-10646 VT).
3323 .It Ql \e\e
3324 emits a reverse solidus character.
3325 .It Ql \e'
3326 single quote.
3327 .It Ql \e"
3328 double quote (escaping is optional).
3329 .It Ql \eNNN
3330 eight-bit byte with the octal value
3331 .Ql NNN
3332 (one to three octal digits), optionally prefixed by an additional
3333 .Ql 0 .
3334 A 0 byte will suppress further output for the quoted argument.
3335 .It Ql \exHH
3336 eight-bit byte with the hexadecimal value
3337 .Ql HH
3338 (one or two hexadecimal characters).
3339 A 0 byte will suppress further output for the quoted argument.
3340 .It Ql \eUHHHHHHHH
3341 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3342 .Ql HHHHHHHH
3343 (one to eight hexadecimal digits) \(em note that Unicode defines the
3344 maximum codepoint ever to be supported as
3345 .Ql 0x10FFFF
3346 (in planes of
3347 .Ql 0xFFFF
3348 characters each).
3349 This escape is only supported in locales that support Unicode (see
3350 .Sx "Character sets" ) ,
3351 in other cases the sequence will remain unexpanded unless the given code
3352 point is ASCII compatible or (if the \*(OPal character set conversion is
3353 available) can be represented in the current locale.
3354 The character NUL will suppress further output for the quoted argument.
3355 .It Ql \euHHHH
3356 Identical to
3357 .Ql \eUHHHHHHHH
3358 except it takes only one to four hexadecimal digits.
3359 .It Ql \ecX
3360 Emits the non-printable (ASCII and compatible) C0 control codes
3361 0 (NUL) to 31 (US), and 127 (DEL).
3362 Printable representations of ASCII control codes can be created by
3363 mapping them to a different part of the ASCII character set, which is
3364 possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is
3365 .Ql 7 + 64 = 71 = G .
3366 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3367 .Ic vexpr ) ,
3368 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3369 .Ql ? vexpr ^ 127 64 .
3371 Whereas historically circumflex notation has often been used for
3372 visualization purposes of control codes, e.g.,
3373 .Ql ^G ,
3374 the reverse solidus notation has been standardized:
3375 .Ql \ecG .
3376 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3377 as shown above (e.g.,
3378 .Ql \ea ,
3379 .Ql \en ,
3380 .Ql \et ) :
3381 whenever such an alias exists it will be used for display purposes.
3382 The control code NUL
3383 .Pf ( Ql \ec@ ,
3384 a non-standard extension) will suppress further output for the remains
3385 of the token (which may extend beyond the current quote), or, depending
3386 on the context, the remains of all arguments for the current command.
3387 .It Ql \e$NAME
3388 Non-standard extension: expand the given variable name, as above.
3389 Brace enclosing the name is supported.
3390 .It Ql \e`{command}
3391 Not yet supported, just to raise awareness: Non-standard extension.
3396 Caveats:
3398 .Bd -literal -offset indent
3399 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3400 ? echo Quotes ${HOME} and tokens differ! # comment
3401 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3403 .\" }}}
3405 .\" .Ss "Raw data arguments for codec commands" {{{
3406 .Ss "Raw data arguments for codec commands"
3408 A special set of commands, which all have the string
3409 .Dq codec
3410 in their name, e.g.,
3411 .Ic addrcodec ,
3412 .Ic shcodec ,
3413 .Ic urlcodec ,
3414 take raw string data as input, which means that the content of the
3415 command input line is passed completely unexpanded and otherwise
3416 unchanged: like this the effect of the actual codec is visible without
3417 any noise of possible shell quoting rules etc., i.e., the user can input
3418 one-to-one the desired or questionable data.
3419 To gain a level of expansion, the entire command line can be
3420 .Ic eval Ns
3421 uated first, e.g.,
3423 .Bd -literal -offset indent
3424 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3425 ? echo $res
3426 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3427 ? shcodec d $res
3428 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3429 ? eval shcodec d $res
3430 /usr/Sch\[:o]nes Wetter/heute.txt
3432 .\" }}}
3434 .\" .Ss "Filename transformations" {{{
3435 .Ss "Filename transformations"
3437 Filenames, where expected, and unless documented otherwise, are
3438 subsequently subject to the following filename transformations, in
3439 sequence:
3441 .Bl -bullet -offset indent
3443 If the given name is a registered
3444 .Ic shortcut ,
3445 it will be replaced with the expanded shortcut.
3448 The filename is matched against the following patterns or strings:
3450 .Bl -hang -compact -width ".Ar %user"
3451 .It Ar #
3452 (Number sign) is expanded to the previous file.
3453 .It Ar %
3454 (Percent sign) is replaced by the invoking
3455 .Mx -ix "primary system mailbox"
3456 user's primary system mailbox, which either is the (itself expandable)
3457 .Va inbox
3458 if that is set, the standardized absolute pathname indicated by
3459 .Ev MAIL
3460 if that is set, or a built-in compile-time default otherwise.
3461 .It Ar %user
3462 Expands to the primary system mailbox of
3463 .Ar user
3464 (and never the value of
3465 .Va inbox ,
3466 regardless of its actual setting).
3467 .It Ar &
3468 (Ampersand) is replaced with the invoking users
3469 .Mx -ix "secondary mailbox"
3470 secondary mailbox, the
3471 .Ev MBOX .
3472 .It Ar +file
3473 Refers to a
3474 .Ar file
3475 in the
3476 .Va folder
3477 directory (if that variable is set).
3478 .It Ar %:filespec
3479 Expands to the same value as
3480 .Ar filespec ,
3481 but has special meaning when used with, e.g., the command
3482 .Ic file :
3483 the file will be treated as a primary system mailbox by, e.g., the
3484 .Ic mbox
3486 .Ic save
3487 commands, meaning that messages that have been read in the current
3488 session will be moved to the
3489 .Ev MBOX
3490 mailbox instead of simply being flagged as read.
3494 Meta expansions are applied to the resulting filename, as applicable to
3495 the resulting file access protocol (also see
3496 .Sx "On URL syntax and credential lookup" ) .
3497 If the fully expanded filename results in multiple pathnames and the
3498 command is expecting only one file, an error results.
3500 For the file-protocol, a leading tilde
3501 .Ql ~
3502 character will be replaced by the expansion of
3503 .Ev HOME ,
3504 except when followed by a valid user name, in which case the home
3505 directory of the given user is used instead.
3507 In addition a shell expansion as if specified in double-quotes (see
3508 .Sx "Shell-style argument quoting" )
3509 is applied, so that any occurrence of
3510 .Ql $VARIABLE
3512 .Ql ${VARIABLE} )
3513 will be replaced by the expansion of the variable, if possible;
3514 .Sx "INTERNAL VARIABLES"
3515 as well as
3516 .Sx ENVIRONMENT
3517 (shell) variables can be accessed through this mechanism.
3519 In interactive context, in order to allow simple value acceptance (via
3520 .Dq ENTER ) ,
3521 arguments will usually be displayed in a properly quoted form, e.g., a file
3522 .Ql diet\e is \ecurd.txt
3523 may be displayed as
3524 .Ql 'diet\e is \ecurd.txt' .
3526 .\" }}}
3528 .\" .Ss "Commands" {{{
3529 .Ss "Commands"
3531 The following commands are available:
3533 .Bl -tag -width ".It Ic BaNg"
3537 .It Ic \&!
3538 Executes the
3539 .Ev SHELL
3540 command which follows, replacing unescaped exclamation marks with the
3541 previously executed command if the internal variable
3542 .Va bang
3543 is set.
3544 This command supports
3545 .Cm vput
3546 as documented in
3547 .Sx "Command modifiers" ,
3548 and manages the error number
3549 .Va \&! .
3550 A 0 or positive exit status
3551 .Va \&?
3552 reflects the exit status of the command, negative ones that
3553 an error happened before the command was executed, or that the program
3554 did not exit cleanly, but, e.g., due to a signal: the error number is
3555 .Va ^ERR Ns -CHILD ,
3556 then.
3559 In conjunction with the
3560 .Cm vput
3561 modifier the following special cases exist:
3562 a negative exit status occurs if the collected data could not be stored
3563 in the given variable, which is a
3564 .Va ^ERR Ns -NOTSUP
3565 error that should otherwise not occur.
3566 .Va ^ERR Ns -CANCELED
3567 indicates that no temporary file could be created to collect the command
3568 output at first glance.
3569 In case of catchable out-of-memory situations
3570 .Va ^ERR Ns -NOMEM
3571 will occur and \*(UA will try to store the empty string, just like with
3572 all other detected error conditions.
3576 .It Ic #
3577 The comment-command causes the entire line to be ignored.
3578 .Sy Note:
3579 this really is a normal command which' purpose is to discard its
3580 arguments, not a
3581 .Dq comment-start
3582 indicating special character, which means that, e.g., trailing comments
3583 on a line are not possible.
3586 .It Ic +
3587 Goes to the next message in sequence and types it
3588 (like
3589 .Dq ENTER ) .
3592 .It Ic -
3593 Display the preceding message, or the n'th previous message if given
3594 a numeric argument n.
3597 .It Ic =
3598 Show the current message number (the
3599 .Dq dot ) .
3602 .It Ic \&?
3603 Show a brief summary of commands.
3604 \*(OP Given an argument a synopsis for the command in question is
3605 shown instead; commands can be abbreviated in general and this command
3606 can be used to see the full expansion of an abbreviation including the
3607 synopsis, try, e.g.,
3608 .Ql ?h ,
3609 .Ql ?hel
3611 .Ql ?help
3612 and see how the output changes.
3613 This mode also supports a more
3614 .Va verbose
3615 output, which will provide the informations documented for
3616 .Ic list .
3619 .It Ic \&|
3620 A synonym for the
3621 .Ic pipe
3622 command.
3626 .It Ic account , unaccount
3627 (ac, una) Creates, selects or lists (an) account(s).
3628 Accounts are special incarnations of
3629 .Ic define Ns d
3630 macros and group commands and variable settings which together usually
3631 arrange the environment for the purpose of creating an email account.
3632 Different to normal macros settings which are covered by
3633 .Ic localopts
3634 \(en here by default enabled! \(en will not be reverted before the
3635 .Ic account
3636 is changed again.
3637 The special account
3638 .Ql null
3639 (case-insensitive) always exists, and all but it can be deleted by the
3640 latter command, and in one operation with the special name
3641 .Ql * .
3643 Without arguments a listing of all defined accounts is shown.
3644 With one argument the given account is activated: the system
3645 .Va inbox
3646 of that account will be activated (as via
3647 .Ic file ) ,
3648 a possibly installed
3649 .Va folder-hook
3650 will be run, and the internal variable
3651 .Va account
3652 will be updated.
3653 The two argument form is identical to defining a macro as via
3654 .Ic define :
3655 .Bd -literal -offset indent
3656 account myisp {
3657   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
3658   set from='(My Name) myname@myisp.example'
3659   set mta=smtp://mylogin@smtp.myisp.example
3665 .It Ic addrcodec
3666 Perform email address codec transformations on raw-data argument, rather
3667 according to email standards (RFC 5322; \*(ID will furtherly improve).
3668 Supports
3669 .Cm vput
3670 (see
3671 .Sx "Command modifiers" ) ,
3672 and manages the error number
3673 .Va \&! .
3674 The first argument must be either
3675 .Ar [+[+[+]]]e[ncode] ,
3676 .Ar d[ecode]
3678 .Ar s[kin] ,
3679 and specifies the operation to perform on the rest of the line.
3682 Decoding will show how a standard-compliant MUA will display the given
3683 argument, which should be an email address.
3684 Please be aware that most MUAs have difficulties with the address
3685 standards, and vary wildly when (comments) in parenthesis,
3686 .Dq double-quoted
3687 strings, or quoted-pairs, as below, become involved.
3688 \*(ID \*(UA currently does not perform decoding when displaying addresses.
3691 Skinning is identical to decoding but only outputs the plain address,
3692 without any string, comment etc. components.
3693 Another difference is that it may fail with the error number
3694 .Va \&!
3695 set to
3696 .Va ^ERR Ns -INVAL
3697 if decoding fails to find a(n) (valid) email address, in which case the
3698 unmodified input will be output again.
3701 Encoding supports four different modes, lesser automated versions can be
3702 chosen by prefixing one, two or three plus signs: the standard imposes
3703 a special meaning on some characters, which thus have to be transformed
3704 to so-called quoted-pairs by pairing them with a reverse solidus
3705 .Ql \e
3706 in order to remove the special meaning; this might change interpretation
3707 of the entire argument from what has been desired, however!
3708 Specify one plus sign to remark that parenthesis shall be left alone,
3709 two for not turning double quotation marks into quoted-pairs, and three
3710 for also leaving any user-specified reverse solidus alone.
3711 The result will always be valid, if a successful exit status is reported.
3712 \*(ID Addresses need to be specified in between angle brackets
3713 .Ql < ,
3714 .Ql >
3715 if the construct becomes more difficult, otherwise the current parser
3716 will fail; it is not smart enough to guess right.
3718 .Bd -literal -offset indent
3719 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
3720 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3721 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3722 "Hey, you", \e out\e there <diet@exam.ple>
3723 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3724 diet@exam.ple
3730 .It Ic alias , unalias
3731 (a, una) Aliases are a method of creating personal distribution lists
3732 that map a single alias name to none to multiple real receivers;
3733 these aliases become expanded after message composing is completed.
3734 The latter command removes the given list of aliases, the special name
3735 .Ql *
3736 will discard all existing aliases.
3737 The former command shows all currently defined aliases when used without
3738 arguments, and with one argument the expansion of the given alias.
3739 With more than one argument, creates or appends to the alias name given
3740 as the first argument the remaining arguments.
3741 Alias names are restricted to alphabetic characters, digits, the
3742 underscore, hyphen-minus, the number sign, colon, commercial at and
3743 period, the last character can also be the dollar sign:
3744 .Ql [[:alnum:]_#:@.-]+$? .
3748 .It Ic alternates , unalternates
3749 \*(NQ (alt) Manage a list of alternate addresses or names of the active user,
3750 members of which will be removed from recipient lists.
3751 The latter command removes the given list of alternates, the special name
3752 .Ql *
3753 will discard all existing aliases.
3754 The former command manages the error number
3755 .Va \&!
3756 and shows the current set of alternates when used without arguments; in
3757 this mode it supports
3758 .Cm vput
3759 (see
3760 .Sx "Command modifiers" ) .
3761 Otherwise the given arguments (after being checked for validity) are
3762 appended to the list of alternate names; in
3763 .Va posix
3764 mode they replace that list instead.
3765 There is a set of implicit alternates which is formed of the values of
3766 .Ev LOGNAME ,
3767 .Va from ,
3768 .Va sender
3770 .Va replyto .
3774 .It Ic answered , unanswered
3775 Take a message lists and mark each message as having been answered,
3776 having not been answered, respectively.
3777 Messages will be marked answered when being
3778 .Ic reply Ns d
3779 to automatically if the
3780 .Va markanswered
3781 variable is set.
3782 See the section
3783 .Sx "Message states" .
3788 .It Ic bind , unbind
3789 \*(OP\*(NQ The bind command extends the MLE (see
3790 .Sx "On terminal control and line editor" )
3791 with freely configurable key bindings.
3792 The latter command removes from the given context the given key binding,
3793 both of which may be specified as a wildcard
3794 .Ql * ,
3795 so that, e.g.,
3796 .Ql unbind * *
3797 will remove all bindings of all contexts.
3798 Due to initialization order unbinding will not work for built-in key
3799 bindings upon program startup, however: please use
3800 .Va line-editor-no-defaults
3801 for this purpose instead.
3804 With one argument the former command shows all key bindings for the
3805 given context, specifying an asterisk
3806 .Ql *
3807 will show the bindings of all contexts; a more verbose listing will be
3808 produced if either of
3809 .Va debug
3811 .Va verbose
3812 are set.
3813 With two or more arguments a binding is (re)established:
3814 the first argument is the context to which the binding shall apply,
3815 the second argument is a comma-separated list of the
3816 .Dq keys
3817 which form the binding, and any remaining arguments form the expansion.
3818 To indicate that a binding shall not be auto-committed, but that the
3819 expansion shall instead be furtherly editable by the user, a commercial at
3820 .Ql @
3821 (that will be removed) can be placed last in the expansion, from which
3822 leading and trailing whitespace will finally be removed.
3823 Reverse solidus cannot be used as the last character of expansion.
3826 Contexts define when a binding applies, i.e., a binding will not be seen
3827 unless the context for which it is defined for is currently active.
3828 This is not true for the shared binding
3829 .Ql base ,
3830 which is the foundation for all other bindings and as such always
3831 applies, its bindings, however, only apply secondarily.
3832 The available contexts are the shared
3833 .Ql base ,
3835 .Ql default
3836 context which is used in all not otherwise documented situations, and
3837 .Ql compose ,
3838 which applies to compose mode only.
3841 .Dq Keys
3842 which form the binding are specified as a comma-separated list of
3843 byte-sequences, where each list entry corresponds to one key(press).
3844 A list entry may, indicated by a leading colon character
3845 .Ql \&: ,
3846 also refer to the name of a terminal capability; several dozen names
3847 will be compiled in and may be specified either by their
3848 .Xr terminfo 5 ,
3849 or, if existing, by their
3850 .Xr termcap 5
3851 name, regardless of the actually used \*(OPal terminal control library.
3852 It is possible to use any capability, as long as the name is resolvable
3853 by the \*(OPal control library or was defined via the internal variable
3854 .Va termcap .
3855 Input sequences are not case-normalized, so that an exact match is
3856 required to update or remove a binding.
3857 Examples:
3859 .Bd -literal -offset indent
3860 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
3861 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
3862 ? bind default $'\ecA',:khome,w 'echo An editable binding@'
3863 ? bind default a,b,c rm -irf / @  # Another editable binding
3864 ? bind default :kf1 File %
3865 ? bind compose :kf1 ~e
3869 Note that the entire comma-separated list is first parsed (over) as a
3870 shell-token with whitespace as the field separator, before being parsed
3871 and expanded for real with comma as the field separator, therefore
3872 whitespace needs to be properly quoted, see
3873 .Sx "Shell-style argument quoting" .
3874 Using Unicode reverse solidus escape sequences renders a binding
3875 defunctional if the locale does not support Unicode (see
3876 .Sx "Character sets" ) ,
3877 and using terminal capabilities does so if no (corresponding) terminal
3878 control support is (currently) available.
3881 The following terminal capability names are built-in and can be used in
3882 .Xr terminfo 5
3883 or (if available) the two-letter
3884 .Xr termcap 5
3885 notation.
3886 See the respective manual for a list of capabilities.
3887 The program
3888 .Xr infocmp 1
3889 can be used to show all the capabilities of
3890 .Ev TERM
3891 or the given terminal type;
3892 using the
3893 .Fl \&\&x
3894 flag will also show supported (non-standard) extensions.
3897 .Bl -tag -compact -width kcuuf_or_kcuuf
3898 .It Cd kbs Ns \0or Cd kb
3899 Backspace.
3900 .It Cd kdch1 Ns \0or Cd kD
3901 Delete character.
3902 .It Cd kDC Ns \0or Cd *4
3903 \(em shifted variant.
3904 .It Cd kel Ns \0or Cd kE
3905 Clear to end of line.
3906 .It Cd kext Ns \0or Cd @9
3907 Exit.
3908 .It Cd kich1 Ns \0or Cd kI
3909 Insert character.
3910 .It Cd kIC Ns \0or Cd #3
3911 \(em shifted variant.
3912 .It Cd khome Ns \0or Cd kh
3913 Home.
3914 .It Cd kHOM Ns \0or Cd #2
3915 \(em shifted variant.
3916 .It Cd kend Ns \0or Cd @7
3917 End.
3918 .It Cd knp Ns \0or Cd kN
3919 Next page.
3920 .It Cd kpp Ns \0or Cd kP
3921 Previous page.
3922 .It Cd kcub1 Ns \0or Cd kl
3923 Left cursor (with more modifiers: see below).
3924 .It Cd kLFT Ns \0or Cd #4
3925 \(em shifted variant.
3926 .It Cd kcuf1 Ns \0or Cd kr
3927 Right cursor (ditto).
3928 .It Cd kRIT Ns \0or Cd %i
3929 \(em shifted variant.
3930 .It Cd kcud1 Ns \0or Cd kd
3931 Down cursor (ditto).
3932 .It Cd kDN
3933 \(em shifted variant (only terminfo).
3934 .It Cd kcuu1 Ns \0or Cd ku
3935 Up cursor (ditto).
3936 .It Cd kUP
3937 \(em shifted variant (only terminfo).
3938 .It Cd kf0 Ns \0or Cd k0
3939 Function key 0.
3940 Add one for each function key up to
3941 .Cd kf9
3943 .Cd k9 ,
3944 respectively.
3945 .It Cd kf10 Ns \0or Cd k;
3946 Function key 10.
3947 .It Cd kf11 Ns \0or Cd F1
3948 Function key 11.
3949 Add one for each function key up to
3950 .Cd kf19
3952 .Cd F9 ,
3953 respectively.
3957 Some terminals support key-modifier combination extensions, e.g.,
3958 .Ql Alt+Shift+xy .
3959 For example, the delete key,
3960 .Cd kdch1 :
3961 in its shifted variant, the name is mutated to
3962 .Cd  kDC ,
3963 then a number is appended for the states
3964 .Ql Alt
3965 .Pf ( Cd kDC3 ) ,
3966 .Ql Shift+Alt
3967 .Pf ( Cd kDC4 ) ,
3968 .Ql Control
3969 .Pf ( Cd kDC5 ) ,
3970 .Ql Shift+Control
3971 .Pf ( Cd kDC6 ) ,
3972 .Ql Alt+Control
3973 .Pf ( Cd kDC7 ) ,
3974 finally
3975 .Ql Shift+Alt+Control
3976 .Pf ( Cd kDC8 ) .
3977 The same for the left cursor key,
3978 .Cd kcub1 :
3979 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
3982 It is advisable to use an initial escape or other control character (e.g.,
3983 .Ql \ecA )
3984 for bindings which describe user key combinations (as opposed to purely
3985 terminal capability based ones), in order to avoid ambiguities whether
3986 input belongs to key sequences or not; it also reduces search time.
3987 Adjusting
3988 .Va bind-timeout
3989 may help shall keys and sequences be falsely recognized.
3993 .It Ic call
3994 \*(NQ Calls the given macro, which must have been created via
3995 .Ic define ,
3996 otherwise a
3997 .Va ^ERR Ns -NOENT
3998 error occurs.
3999 Parameters given to macros are implicitly local to the macro's scope, and
4000 may be accessed via special (positional) parameters, e.g.,
4001 .Va 1 ,
4002 .Va * ,
4003 .Va @ ,
4004 .Va # .
4005 The positional parameters may be removed by
4006 .Ic shift Ns
4007 ing them off the stack (exceeding the supported number of arguments
4008 results in a
4009 .Va ^ERR Ns -OVERFLOW ) ,
4010 and are otherwise controllable via
4011 .Ic vpospar .
4012 Changes to other
4013 .Sx ENVIRONMENT
4014 as well as
4015 .Sx "INTERNAL VARIABLES"
4016 can be reverted before the current level regains control by setting
4017 .Ic localopts
4018 for called macro(s) (or in them, of course).
4019 Macro execution can be terminated at any time by calling
4020 .Ic return .
4023 Calling macros recursively will at some time excess the stack size
4024 limit, causing a hard program abortion; if recursively calling a macro
4025 is the last command of the current macro, consider to use the command
4026 .Ic xcall ,
4027 which will first release all resources of the current macro before
4028 replacing the current macro with the called one.
4029 Numeric and string operations can be performed via
4030 .Ic vexpr ,
4032 .Ic eval
4033 may be helpful to recreate argument lists.
4035 .Bd -literal -offset indent
4036 define exmac {
4037   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4038   return 1000 0
4040 call exmac Hello macro exmac!
4045 .It Ic call_if
4046 Identical to
4047 .Ic call
4048 if the given macro has been created via
4049 .Ic define ,
4050 but doesn't fail nor warn if the macro doesn't exist.
4053 .It Ic cd
4054 (ch) Change the working directory to
4055 .Ev HOME
4056 or the given argument.
4057 Synonym for
4058 .Ic chdir .
4061 .It Ic certsave
4062 \*(OP Only applicable to S/MIME signed messages.
4063 Takes a message list and a filename and saves the certificates
4064 contained within the message signatures to the named file in both
4065 human-readable and PEM format.
4066 The certificates can later be used to send encrypted messages to the
4067 respective message senders by setting
4068 .Va smime-encrypt-USER@HOST
4069 variables.
4073 .It Ic charsetalias , uncharsetalias
4074 \*(NQ Manage (character set conversion) character set alias mappings,
4075 as documented in the section
4076 .Sx "Character sets" .
4077 Character set aliases are expanded recursively, but no expansion is
4078 performed on values of the user-settable variables, e.g.,
4079 .Va charset-8bit .
4080 These are effectively no-operations if character set conversion
4081 is not available (i.e., no
4082 .Ql +iconv
4084 .Va features ) .
4085 Without arguments the list of all currently defined aliases is shown,
4086 with one argument the expansion of the given alias.
4087 Otherwise all given arguments are treated as pairs of character sets and
4088 their desired target alias name, creating new or changing already
4089 existing aliases, as necessary.
4091 The latter deletes all aliases given as arguments, the special argument
4092 .Ql *
4093 will remove all aliases.
4096 .It Ic chdir
4097 (ch) Change the working directory to
4098 .Ev HOME
4099 or the given argument.
4100 Synonym for
4101 .Ic cd .
4105 .It Ic collapse , uncollapse
4106 Only applicable to threaded mode.
4107 Takes a message list and makes all replies to these messages invisible
4108 in header summaries, except for
4109 .Ql new
4110 messages and the
4111 .Dq dot .
4112 Also when a message with collapsed replies is displayed,
4113 all of these are automatically uncollapsed.
4114 The latter command undoes collapsing.
4119 .It Ic colour , uncolour
4120 \*(OP\*(NQ Manage colour mappings of and for a
4121 .Sx "Coloured display" .
4122 The type of colour is given as the (case-insensitive) first argument,
4123 which must be one of
4124 .Ql 256
4125 for 256-colour terminals,
4126 .Ql 8 ,
4127 .Ql ansi
4129 .Ql iso
4130 for the standard 8-colour ANSI / ISO 6429 color palette and
4131 .Ql 1
4133 .Ql mono
4134 for monochrome terminals.
4135 Monochrome terminals cannot deal with colours, but only (some) font
4136 attributes.
4139 Without further arguments the list of all currently defined mappings
4140 for the given colour type is shown (as a special case giving
4141 .Ql all
4143 .Ql *
4144 will show the mappings of all types).
4145 Otherwise the second argument defines the mappable slot, and the third
4146 argument a (comma-separated list of) colour and font attribute
4147 specification(s), and the optional fourth argument can be used to
4148 specify a precondition: if conditioned mappings exist they are tested in
4149 (creation) order unless a (case-insensitive) match has been found, and
4150 the default mapping (if any has been established) will only be chosen as
4151 a last resort.
4152 The types of precondition available depend on the mappable slot (see
4153 .Sx "Coloured display"
4154 for some examples), the following of which exist:
4157 Mappings prefixed with
4158 .Ql mle-
4159 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4160 .Sx "On terminal control and line editor" )
4161 and do not support preconditions.
4163 .Bl -tag -compact -width view-partinfo
4164 .It Ar mle-position
4165 This mapping is used for the position indicator that is visible when
4166 a line cannot be fully displayed on the screen.
4167 .It Ar mle-prompt
4168 Used for the
4169 .Va prompt .
4173 Mappings prefixed with
4174 .Ql sum-
4175 are used in header summaries, and they all understand the preconditions
4176 .Ql dot
4177 (the current message) and
4178 .Ql older
4179 for elder messages (only honoured in conjunction with
4180 .Va datefield-markout-older ) .
4182 .Bl -tag -compact -width view-partinfo
4183 .It Ar sum-dotmark
4184 This mapping is used for the
4185 .Dq dotmark
4186 that can be created with the
4187 .Ql %>
4189 .Ql %<
4190 formats of the variable
4191 .Va headline .
4192 .It Ar sum-header
4193 For the complete header summary line except the
4194 .Dq dotmark
4195 and the thread structure.
4196 .It Ar sum-thread
4197 For the thread structure which can be created with the
4198 .Ql %i
4199 format of the variable
4200 .Va headline .
4204 Mappings prefixed with
4205 .Ql view-
4206 are used when displaying messages.
4208 .Bl -tag -compact -width view-partinfo
4209 .It Ar view-from_
4210 This mapping is used for so-called
4211 .Ql From_
4212 lines, which are MBOX file format specific header lines.
4213 .It Ar view-header
4214 For header lines.
4215 A comma-separated list of headers to which the mapping applies may be
4216 given as a precondition; if the \*(OPal regular expression support is
4217 available then if any of the
4218 .Dq magical
4219 (extended) regular expression characters is seen the precondition will
4220 be evaluated as (an extended) one.
4221 .It Ar view-msginfo
4222 For the introductional message info line.
4223 .It Ar view-partinfo
4224 For MIME part info lines.
4228 The following (case-insensitive) colour definitions and font attributes
4229 are understood, multiple of which can be specified in a comma-separated
4230 list:
4232 .Bl -tag -width ft=
4233 .It Ar ft=
4234 a font attribute:
4235 .Ql bold ,
4236 .Ql reverse
4238 .Ql underline .
4239 It is possible (and often applicable) to specify multiple font
4240 attributes for a single mapping.
4242 .It Ar fg=
4243 foreground colour attribute:
4244 .Ql black ,
4245 .Ql blue ,
4246 .Ql green ,
4247 .Ql red ,
4248 .Ql brown ,
4249 .Ql magenta ,
4250 .Ql cyan
4252 .Ql white .
4253 To specify a 256-color mode a decimal number colour specification in
4254 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4256 .Bl -tag -compact -width "999 - 999"
4257 .It 0 - 7
4258 the standard ISO 6429 colors, as above.
4259 .It 8 - 15
4260 high intensity variants of the standard colors.
4261 .It 16 - 231
4262 216 colors in tuples of 6.
4263 .It 232 - 255
4264 grayscale from black to white in 24 steps.
4266 .Bd -literal -offset indent
4267 #!/bin/sh -
4268 fg() { printf "\e033[38;5;${1}m($1)"; }
4269 bg() { printf "\e033[48;5;${1}m($1)"; }
4271 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4272 printf "\e033[0m\en"
4274 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4275 printf "\e033[0m\en"
4278 .It Ar bg=
4279 background colour attribute (see
4280 .Cd fg=
4281 for possible values).
4285 The command
4286 .Ic \&uncolour
4287 will remove for the given colour type (the special type
4288 .Ql *
4289 selects all) the given mapping; if the optional precondition argument is
4290 given only the exact tuple of mapping and precondition is removed.
4291 The special name
4292 .Ql *
4293 will remove all mappings (no precondition allowed), thus
4294 .Ql uncolour * *
4295 will remove all established mappings.
4300 .It Ic commandalias , uncommandalias
4301 \*(NQ Define or list, and remove, respectively, command aliases.
4302 An (command)alias can be used everywhere a normal command can be used,
4303 but always takes precedence: any arguments that are given to the command
4304 alias are joined onto the alias expansion, and the resulting string
4305 forms the command line that is, in effect, executed.
4306 The latter command removes all given aliases, the special name
4307 .Ql *
4308 will remove all existing aliases.
4309 When used without arguments the former shows a list of all currently
4310 known aliases, with one argument only the expansion of the given one.
4312 With two or more arguments a command alias is defined or updated: the
4313 first argument is the name under which the remaining command line should
4314 be accessible, the content of which can be just about anything.
4315 An alias may itself expand to another alias, but to avoid expansion loops
4316 further expansion will be prevented if an alias refers to itself or if
4317 an expansion depth limit is reached.
4318 Explicit expansion prevention is available via reverse solidus
4319 .Cm \e ,
4320 one of the
4321 .Sx "Command modifiers" .
4322 .Bd -literal -offset indent
4323 ? commandalias xx
4324 \*(uA: `commandalias': no such alias: xx
4325 ? commandalias xx echo hello,
4326 ? commandalias xx
4327 commandalias xx 'echo hello,'
4328 ? xx
4329 hello,
4330 ? xx world
4331 hello, world
4335 .It Ic Copy
4336 (C) Copy messages to files whose names are derived from the author of
4337 the respective message and do not mark them as being saved;
4338 otherwise identical to
4339 .Ic Save .
4342 .It Ic copy
4343 (c) Copy messages to the named file and do not mark them as being saved;
4344 otherwise identical to
4345 .Ic save .
4348 .It Ic cwd
4349 Show the name of the current working directory, as reported by
4350 .Xr getcwd 3 .
4351 Supports
4352 .Cm vput
4353 (see
4354 .Sx "Command modifiers" ) .
4355 The return status is tracked via
4356 .Va \&! .
4359 .It Ic Decrypt
4360 \*(OP For unencrypted messages this command is identical to
4361 .Ic Copy ;
4362 Encrypted messages are first decrypted, if possible, and then copied.
4365 .It Ic decrypt
4366 \*(OP For unencrypted messages this command is identical to
4367 .Ic copy ;
4368 Encrypted messages are first decrypted, if possible, and then copied.
4372 .It Ic define , undefine
4373 Without arguments the current list of macros, including their content,
4374 is shown, otherwise a macro is defined, replacing an existing macro of
4375 the same name.
4376 A macro definition is a sequence of commands in the following form:
4377 .Bd -literal -offset indent
4378 define name {
4379   command1
4380   command2
4381   ...
4382   commandN
4386 A defined macro can be invoked explicitly by using the
4387 .Ic call ,
4388 .Ic call_if
4390 .Ic xcall
4391 commands, or implicitly if a macro hook is triggered, e.g., a
4392 .Va folder-hook .
4393 It is possible to localize adjustments, like creation, deletion and
4394 modification of
4395 .Sx "INTERNAL VARIABLES" ,
4396 by using the
4397 .Ic localopts
4398 command; the scope which is localized depends on how (i.e.,
4399 .Dq as what :
4400 normal macro, folder hook, hook,
4401 .Ic account
4402 switch) the macro is invoked.
4403 Execution of a macro body can be stopped from within by calling
4404 .Ic return .
4405 Inside a
4406 .Ic call Ns
4407 ed macro, given positional parameters can be
4408 .Ic shift Ns
4409 ed, or become completely replaced, removed etc. via
4410 .Ic vpospar .
4412 The latter command deletes the given macro, the special name
4413 .Ql *
4414 will discard all existing macros.
4415 Creation and deletion of (a) macro(s) can be performed from within
4416 a running macro.
4420 .It Ic delete , undelete
4421 (d, u) Marks the given message list as being or not being
4422 .Ql deleted ,
4423 respectively; if no argument has been specified then the usual search
4424 for a visible message is performed, as documented for
4425 .Sx "Message list arguments" ,
4426 showing only the next input prompt if the search fails.
4427 Deleted messages will neither be saved in the
4428 .Mx -sx
4429 .Sx "secondary mailbox"
4430 .Ev MBOX
4431 nor will they be available for most other commands.
4432 If the
4433 .Va autoprint
4434 variable is set, the new
4435 .Dq dot
4436 or the last message restored, respectively, is automatically
4437 .Ic type Ns
4438 d; also see
4439 .Ic dp ,
4440 .Ic dt .
4443 .It Ic discard
4444 (di) Identical to
4445 .Ic ignore .
4446 Superseded by the multiplexer
4447 .Ic headerpick .
4451 .It Ic dp , dt
4452 Delete the given messages and automatically
4453 .Ic type
4454 the new
4455 .Dq dot
4456 if one exists, regardless of the setting of
4457 .Va autoprint .
4460 .It Ic dotmove
4461 Move the
4462 .Dq dot
4463 up or down by one message when given
4464 .Ql +
4466 .Ql -
4467 argument, respectively.
4471 .It Ic draft , undraft
4472 Take message lists and mark each given message as being draft, or not
4473 being draft, respectively, as documented in the section
4474 .Sx "Message states" .
4477 .It Ic echo
4478 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4479 newline, whereas the otherwise identical
4480 .Ic echon
4481 does not.
4482 .Sx "Shell-style argument quoting"
4483 is used,
4484 .Sx "Filename transformations"
4485 are applied to the expanded arguments.
4488 .It Ic echoerr
4489 \*(NQ Identical to
4490 .Ic echo
4491 except that is echoes to standard error.
4492 Also see
4493 .Ic echoerrn .
4494 In interactive sessions the \*(OPal message ring queue for
4495 .Ic errors
4496 will be used instead, if available.
4499 .It Ic echon
4500 \*(NQ Identical to
4501 .Ic echo ,
4502 but does not write a trailing newline.
4505 .It Ic echoerrn
4506 \*(NQ Identical to
4507 .Ic echoerr ,
4508 but does not write a trailing newline.
4511 .It Ic edit
4512 (e) Point the text editor (as defined in
4513 .Ev EDITOR )
4514 at each message from the given list in turn.
4515 Modified contents are discarded unless the
4516 .Va writebackedited
4517 variable is set, and are not used unless the mailbox can be written to
4518 and the editor returns a successful exit status.
4521 .It Ic elif
4522 Part of the
4523 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4524 conditional \(em if the condition of a preceding
4525 .Ic if
4526 was false, check the following condition and execute the following block
4527 if it evaluates true.
4530 .It Ic else
4531 (el) Part of the
4532 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4533 conditional \(em if none of the conditions of the preceding
4534 .Ic if
4536 .Ic elif
4537 commands was true, the
4538 .Ic else
4539 block is executed.
4542 .It Ic endif
4543 (en) Marks the end of an
4544 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4545 conditional execution block.
4549 .It Ic environ
4550 \*(NQ \*(UA has a strict notion about which variables are
4551 .Sx "INTERNAL VARIABLES"
4552 and which are managed in the program
4553 .Sx ENVIRONMENT .
4554 Since some of the latter are a vivid part of \*(UAs functioning,
4555 however, they are transparently integrated into the normal handling of
4556 internal variables via
4557 .Ic set
4559 .Ic unset .
4560 To integrate other environment variables of choice into this
4561 transparent handling, and also to export internal variables into the
4562 process environment where they normally are not, a
4563 .Ql link
4564 needs to become established with this command, as in, e.g.,
4567 .Dl environ link PERL5LIB TZ
4570 Afterwards changing such variables with
4571 .Ic set
4572 will cause automatic updates of the program environment, and therefore
4573 be inherited by newly created child processes.
4574 Sufficient system support provided (it was in BSD as early as 1987, and
4575 is standardized since Y2K) removing such variables with
4576 .Ic unset
4577 will remove them also from the program environment, but in any way
4578 the knowledge they ever have been
4579 .Ql link Ns
4580 ed will be lost.
4581 Note that this implies that
4582 .Ic localopts
4583 may cause loss of such links.
4586 The command
4587 .Ql unlink
4588 will remove an existing link, but leaves the variables as such intact.
4589 Additionally the subcommands
4590 .Ql set
4592 .Ql unset
4593 are provided, which work exactly the same as the documented commands
4594 .Ic set
4596 .Ic unset ,
4597 but (additionally un)link the variable(s) with the program environment
4598 and thus immediately export them to, or remove them from (if possible),
4599 respectively, the program environment.
4603 .It Ic errors
4604 \*(OP Since \*(UA uses the console as a user interface it can happen
4605 that messages scroll by too fast to become recognized.
4606 An error message ring queue is available which stores duplicates of any
4607 error message and notifies the user in interactive sessions whenever
4608 a new error has occurred.
4609 The queue is finite: if its maximum size is reached any new message
4610 replaces the eldest.
4611 The command
4612 .Ic errors
4613 can be used to manage this message queue: if given
4614 .Ar show
4615 or no argument the queue will be displayed and cleared,
4616 .Ar clear
4617 will only clear all messages from the queue.
4620 .It Ic eval
4621 \*(NQ Construct a command by concatenating the arguments, separated with
4622 a single space character, and then evaluate the result.
4623 This command passes through the exit status
4624 .Va \&?
4625 and error number
4626 .Va \&!
4627 of the evaluated command; also see
4628 .Ic call .
4629 .Bd -literal -offset indent
4630 define xxx {
4631   echo "xxx arg <$1>"
4632   shift
4633   if [ $# -gt 0 ]
4634     \excall xxx "$@"
4635   endif
4637 define yyy {
4638   eval "$@ ' ball"
4640 call yyy '\ecall xxx' "b\e$'\et'u ' "
4641 call xxx arg <b      u>
4642 call xxx arg <  >
4643 call xxx arg <ball>
4647 .It Ic exit
4648 (ex or x) Exit from \*(UA without changing the active mailbox and skip
4649 any saving of messages in the
4650 .Mx -sx
4651 .Sx "secondary mailbox"
4652 .Ev MBOX ,
4653 as well as a possibly tracked line editor
4654 .Va history-file .
4655 The optional status number argument will be passed through to
4656 .Xr exit 3 .
4657 \*(ID For now it can happen that the given status will be overwritten,
4658 later this will only occur if a later error needs to be reported onto an
4659 otherwise success indicating status.
4662 .It Ic File
4663 (Fi) Like
4664 .Ic file ,
4665 but open the mailbox read-only.
4669 .It Ic file
4670 (fi) The file command switches to a new mailbox.
4671 Without arguments it shows status information of the current mailbox.
4672 If an argument is given, it will write out changes (such as deletions)
4673 the user has made, open a new mailbox, update the internal variables
4674 .Va mailbox-resolved
4676 .Va mailbox-display ,
4677 and optionally display a summary of
4678 .Ic headers
4679 if the variable
4680 .Va header
4681 is set.
4684 .Sx "Filename transformations"
4685 will be applied to the
4686 .Ar name
4687 argument, and
4688 .Ql protocol://
4689 prefixes are, i.e., URL syntax is understood, e.g.,
4690 .Ql maildir:///tmp/mdirbox :
4691 if a protocol prefix is used the mailbox type is fixated and neither
4692 the auto-detection (read on) nor the
4693 .Va newfolders
4694 mechanisms apply.
4695 \*(OPally URLs can also be used to access network resources, and it is
4696 possible to proxy all network traffic over a SOCKS5 server given via
4697 .Va socks-proxy .
4700 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
4701 .Dl \*(OU protocol://[user@]host[:port][/path]
4704 \*(OPally supported network protocols are
4705 .Ar pop3
4706 (POP3) and
4707 .Ar pop3s
4708 (POP3 with SSL/TLS encrypted transport),
4709 .Ar imap
4711 .Ar imaps .
4713 .Ar [/path]
4714 part is valid only for IMAP; there it defaults to
4715 .Ar INBOX .
4716 Network URLs require a special encoding as documented in the section
4717 .Sx "On URL syntax and credential lookup" .
4720 If the resulting file protocol (MBOX database)
4721 .Ar name
4722 is located on a local filesystem then the list of all registered
4723 .Ic filetype Ns
4724 s is traversed in order to see whether a transparent intermediate
4725 conversion step is necessary to handle the given mailbox, in which case
4726 \*(UA will use the found hook to load and save data into and from
4727 a temporary file, respectively.
4728 Changing hooks will not affect already opened mailboxes.
4729 For example, the following creates hooks for the
4730 .Xr gzip 1
4731 compression tool and a combined compressed and encrypted format:
4733 .Bd -literal -offset indent
4734 ? filetype \e
4735     gzip 'gzip -dc' 'gzip -c' \e
4736     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
4740 MBOX database files are generally locked during file operations in order
4741 to avoid inconsistencies due to concurrent modifications.
4742 \*(OPal Mailbox files which \*(UA treats as the system
4743 .Va inbox
4744 .Pf ( Ev MAIL ) ,
4746 .Mx -sx
4747 .Sx "primary system mailbox" Ns
4748 es in general will also be protected by so-called dotlock files, the
4749 traditional way of mail spool file locking: for any file
4750 .Ql a
4751 a lock file
4752 .Ql a.lock
4753 will be created for the duration of the synchronization \(em
4754 as necessary a privilege-separated dotlock child process will be used
4755 to accommodate for necessary privilege adjustments in order to create
4756 the dotlock file in the same directory
4757 and with the same user and group identities as the file of interest.
4760 \*(UA by default uses tolerant POSIX rules when reading MBOX database
4761 files, but it will detect invalid message boundaries in this mode and
4762 complain (even more with
4763 .Va debug )
4764 if any is seen: in this case
4765 .Va mbox-rfc4155
4766 can be used to create a valid MBOX database from the invalid input.
4769 If no protocol has been fixated, and
4770 .Ar name
4771 refers to a directory with the subdirectories
4772 .Ql tmp ,
4773 .Ql new
4775 .Ql cur ,
4776 then it is treated as a folder in
4777 .Dq Maildir
4778 format.
4779 The maildir format stores each message in its own file, and has been
4780 designed so that file locking is not necessary when reading or writing
4781 files.
4784 \*(ID If no protocol has been fixated and no existing file has
4785 been found, the variable
4786 .Va newfolders
4787 controls the format of mailboxes yet to be created.
4792 .It Ic filetype , unfiletype
4793 \*(NQ Define or list, and remove, respectively, file handler hooks,
4794 which provide (shell) commands that enable \*(UA to load and save MBOX
4795 files from and to files with the registered file extensions;
4796 it will use an intermediate temporary file to store the plain data.
4797 The latter command removes the hooks for all given extensions,
4798 .Ql *
4799 will remove all existing handlers.
4801 When used without arguments the former shows a list of all currently
4802 defined file hooks, with one argument the expansion of the given alias.
4803 Otherwise three arguments are expected, the first specifying the file
4804 extension for which the hook is meant, and the second and third defining
4805 the load- and save commands, respectively, to deal with the file type,
4806 both of which must read from standard input and write to standard
4807 output.
4808 Changing hooks will not affect already opened mailboxes (\*(ID except below).
4809 \*(ID For now too much work is done, and files are oftened read in twice
4810 where once would be sufficient: this can cause problems if a filetype is
4811 changed while such a file is opened; this was already so with the
4812 built-in support of .gz etc. in Heirloom, and will vanish in v15.
4813 \*(ID For now all handler strings are passed to the
4814 .Ev SHELL for evaluation purposes; in the future a
4815 .Ql \&!
4816 prefix to load and save commands may mean to bypass this shell instance:
4817 placing a leading space will avoid any possible misinterpretations.
4818 .Bd -literal -offset indent
4819 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
4820     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
4821     zst 'zstd -dc' 'zstd -19 -zc' \e
4822     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
4823 ? set record=+sent.zst.pgp
4828 .It Ic flag , unflag
4829 Take message lists and mark the messages as being flagged, or not being
4830 flagged, respectively, for urgent/special attention.
4831 See the section
4832 .Sx "Message states" .
4835 .It Ic folder
4836 (fold) The same as
4837 .Ic file .
4840 .It Ic folders
4841 With no arguments, list the names of the folders in the folder directory.
4842 With an existing folder as an argument,
4843 lists the names of folders below the named folder.
4846 .It Ic Followup
4847 (F) Similar to
4848 .Ic Respond ,
4849 but saves the message in a file named after the local part of the first
4850 recipient's address (instead of in
4851 .Va record Ns ).
4854 .It Ic followup
4855 (fo) Similar to
4856 .Ic respond ,
4857 but saves the message in a file named after the local part of the first
4858 recipient's address (instead of in
4859 .Va record Ns ).
4862 .It Ic followupall
4863 Similar to
4864 .Ic followup ,
4865 but responds to all recipients regardless of the
4866 .Va flipr
4867 variable.
4870 .It Ic followupsender
4871 Similar to
4872 .Ic Followup ,
4873 but responds to the sender only regardless of the
4874 .Va flipr
4875 variable.
4878 .It Ic Forward
4879 Similar to
4880 .Ic forward ,
4881 but saves the message in a file named after the local part of the
4882 recipient's address (instead of in
4883 .Va record Ns ).
4886 .It Ic forward
4887 Takes a message and the address of a recipient
4888 and forwards the message to him.
4889 The text of the original message is included in the new one,
4890 with the value of the
4891 .Va forward-inject-head
4892 variable preceding it.
4893 To filter the included header fields to the desired subset use the
4894 .Ql forward
4895 slot of the white- and blacklisting command
4896 .Ic headerpick .
4897 Only the first part of a multipart message is included unless
4898 .Va forward-as-attachment ,
4899 and recipient addresses will be stripped from comments, names etc.
4900 unless the internal variable
4901 .Va fullnames
4902 is set.
4904 This may generate the errors
4905 .Va ^ERR Ns -DESTADDRREQ
4906 if no receiver has been specified,
4907 .Va ^ERR Ns -PERM
4908 if some addressees where rejected by
4909 .Va expandaddr ,
4910 .Va ^ERR Ns -NODATA
4911 if no applicable messages have been given,
4912 .Va ^ERR Ns -NOTSUP
4913 if multiple messages have been specified,
4914 .Va ^ERR Ns -IO
4915 if an I/O error occurs,
4916 .Va ^ERR Ns -NOTSUP
4917 if a necessary character set conversion fails, and
4918 .Va ^ERR Ns -INVAL
4919 for other errors.
4922 .It Ic from
4923 (f) Takes a list of message specifications and displays a summary of
4924 their message headers, exactly as via
4925 .Ic headers .
4926 An alias of this command is
4927 .Ic search .
4928 Also see
4929 .Sx "Specifying messages" .
4931 .It Ic Fwd
4932 \*(OB Alias for
4933 .Ic Forward .
4935 .It Ic fwd
4936 \*(OB Alias for
4937 .Ic forward .
4939 .It Ic fwdignore
4940 \*(OB Superseded by the multiplexer
4941 .Ic headerpick .
4943 .It Ic fwdretain
4944 \*(OB Superseded by the multiplexer
4945 .Ic headerpick .
4947 .It Ic ghost , unghost
4948 \*(OB Replaced by
4949 .Ic commandalias ,
4950 .Ic uncommandalias .
4954 .It Ic headerpick , unheaderpick
4955 \*(NQ Multiplexer command to manage white- and blacklisting
4956 selections of header fields for a variety of applications.
4957 Without arguments the set of contexts that have settings is displayed.
4958 When given arguments, the first argument is the context to which the
4959 command applies, one of (case-insensitive)
4960 .Ql type
4961 for display purposes (via, e.g.,
4962 .Ic type ) ,
4963 .Ql save
4964 for selecting which headers shall be stored persistently when
4965 .Ic save ,
4966 .Ic copy ,
4967 .Ic move
4968 or even
4969 .Ic decrypt Ns
4970 ing messages (note that MIME related etc. header fields should not be
4971 ignored in order to not destroy usability of the message in this case),
4972 .Ql forward
4973 for stripping down messages when
4974 .Ic forward Ns
4975 ing message (has no effect if
4976 .Va forward-as-attachment
4977 is set), and
4978 .Ql top
4979 for defining user-defined set of fields for the command
4980 .Ic top .
4982 The current settings of the given context are displayed if it is the
4983 only argument.
4984 A second argument denotes the type of restriction that is to be chosen,
4985 it may be (a case-insensitive prefix of)
4986 .Ql retain
4988 .Ql ignore
4989 for white- and blacklisting purposes, respectively.
4990 Establishing a whitelist suppresses inspection of the corresponding
4991 blacklist.
4993 If no further argument is given the current settings of the given type
4994 will be displayed, otherwise the remaining arguments specify header
4995 fields, which \*(OPally may be given as regular expressions, to be added
4996 to the given type.
4997 The special wildcard field (asterisk,
4998 .Ql * )
4999 will establish a (fast) shorthand setting which covers all fields.
5001 The latter command always takes three or more arguments and can be used
5002 to remove selections, i.e., from the given context, the given type of
5003 list, all the given headers will be removed, the special argument
5004 .Ql *
5005 will remove all headers.
5008 .It Ic headers
5009 (h) Show the current group of headers, the size of which depends on
5010 the variable
5011 .Va screen ,
5012 and the style of which can be adjusted with the variable
5013 .Va headline .
5014 If a message-specification is given the group of headers containing the
5015 first message therein is shown and the message at the top of the screen
5016 becomes the new
5017 .Dq dot .
5020 .It Ic help
5021 (hel) A synonym for
5022 .Ic \&? .
5025 .It Ic history
5026 \*(OP Either
5027 .Ar show
5028 (this mode also supports a more
5029 .Va verbose
5030 output) or
5031 .Ar clear
5032 the list of history entries;
5033 a decimal
5034 .Ar NUMBER
5035 argument selects and evaluates the respective history entry,
5036 which will become the new history top; a negative number is used as an
5037 offset to the current command, e.g.,
5038 .Ql -1
5039 will select the last command, the history top.
5040 The default mode if no arguments are given is
5041 .Ar show .
5042 Please see
5043 .Sx "On terminal control and line editor"
5044 for more on this topic.
5047 .It Ic hold
5048 (ho, also
5049 .Ic preserve )
5050 Takes a message list and marks each message therein to be saved in the
5051 user's system
5052 .Va inbox
5053 instead of in the
5054 .Mx -sx
5055 .Sx "secondary mailbox"
5056 .Ev MBOX .
5057 Does not override the
5058 .Ic delete
5059 command.
5060 \*(UA deviates from the POSIX standard with this command, because a
5061 .Ic next
5062 command issued after
5063 .Ic hold
5064 will display the following message, not the current one.
5068 .It Ic if
5069 (i) Part of the nestable
5070 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5071 conditional execution construct \(em if the given condition is true then
5072 the encapsulated block is executed.
5073 The POSIX standards supports the (case-insensitive) conditions
5074 .Ql r Ns
5075 eceive
5077 .Ql s Ns
5078 end, all remaining conditions are non-portable extensions.
5079 \*(ID These commands do not yet use
5080 .Sx "Shell-style argument quoting"
5081 and therefore do not know about input tokens, so that syntax
5082 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5083 all conditions bracket group wise and consider the tokens, representing
5084 values and operators, therein, which also means that variables will
5085 already have been expanded at that time (just like in the shell).
5087 .Bd -literal -offset indent
5088 if receive
5089   commands ...
5090 else
5091   commands ...
5092 endif
5096 The (case-insensitive) condition
5097 .Ql t Ns
5098 erminal will evaluate to true if the standard input is a terminal, i.e.,
5099 in interactive sessions.
5100 Another condition can be any boolean value (see the section
5101 .Sx "INTERNAL VARIABLES"
5102 for textual boolean representations) to mark an enwrapped block as
5103 .Dq never execute
5105 .Dq always execute .
5106 (It shall be remarked that a faulty condition skips all branches until
5107 .Ic endif . )
5110 (\*(ID In v15
5111 .Sx "Shell-style argument quoting"
5112 will be used, and this command will simply interpret expanded tokens.)
5113 It is possible to check
5114 .Sx "INTERNAL VARIABLES"
5115 as well as
5116 .Sx ENVIRONMENT
5117 variables for existence or compare their expansion against a user given
5118 value or another variable by using the
5119 .Ql $
5120 .Pf ( Dq variable next )
5121 conditional trigger character;
5122 a variable on the right hand side may be signalled using the same
5123 mechanism.
5124 Variable names may be enclosed in a pair of matching braces.
5125 When this mode has been triggered, several operators are available:
5128 Integer operators treat the arguments on the left and right hand side of
5129 the operator as integral numbers and compare them arithmetically.
5130 It is an error if any of the operands is not a valid integer, an empty
5131 argument (which implies it had been quoted) is treated as if it were 0.
5132 Available operators are
5133 .Ql -lt
5134 (less than),
5135 .Ql -le
5136 (less than or equal to),
5137 .Ql -eq
5138 (equal),
5139 .Ql -ne
5140 (not equal),
5141 .Ql -ge
5142 (greater than or equal to), and
5143 .Ql -gt
5144 (greater than).
5147 String data operators compare the left and right hand side according to
5148 their textual content.
5149 Unset variables are treated as the empty string.
5150 The behaviour of string operators can be adjusted by prefixing the
5151 operator with the modifier trigger commercial at
5152 .Ql @ ,
5153 followed by none to multiple modifiers: for now supported is
5154 .Ql i ,
5155 which turns the comparison into a case-insensitive one: this is
5156 implied if no modifier follows the trigger.
5159 Available string operators are
5160 .Ql <
5161 (less than),
5162 .Ql <=
5163 (less than or equal to),
5164 .Ql ==
5165 (equal),
5166 .Ql !=
5167 (not equal),
5168 .Ql >=
5169 (greater than or equal to),
5170 .Ql >
5171 (greater than),
5172 .Ql =%
5173 (is substring of) and
5174 .Ql !%
5175 (is not substring of).
5176 By default these operators work on bytes and (therefore) do not take
5177 into account character set specifics.
5178 If the case-insensitivity modifier has been used, case is ignored
5179 according to the rules of the US-ASCII encoding, i.e., bytes are
5180 still compared.
5183 When the \*(OPal regular expression support is available, the additional
5184 string operators
5185 .Ql =~
5187 .Ql !~
5188 can be used.
5189 They treat the right hand side as an extended regular expression that is
5190 matched according to the active locale (see
5191 .Sx "Character sets" ) ,
5192 i.e., character sets should be honoured correctly.
5195 Conditions can be joined via AND-OR lists (where the AND operator is
5196 .Ql &&
5197 and the OR operator is
5198 .Ql || ) ,
5199 which have equal precedence and will be evaluated with left
5200 associativity, thus using the same syntax that is known for the
5201 .Xr sh 1 .
5202 It is also possible to form groups of conditions and lists by enclosing
5203 them in pairs of brackets
5204 .Ql [\ \&.\&.\&.\ ] ,
5205 which may be interlocked within each other, and also be joined via
5206 AND-OR lists.
5209 The results of individual conditions and entire groups may be modified
5210 via unary operators: the unary operator
5211 .Ql \&!
5212 will reverse the result.
5214 .Bd -literal -offset indent
5215 # (This not in v15, there [ -n "$debug"]!)
5216 if $debug
5217   echo *debug* is set
5218 endif
5219 if [ "$ttycharset" == UTF-8 ] || [ "$ttycharset" @i== UTF8 ]
5220   echo *ttycharset* is UTF-8, the former case-sensitive!
5221 endif
5222 set t1=one t2=one
5223 if [ "${t1}" == "${t2}" ]
5224   echo These two variables are equal
5225 endif
5226 if [ "$features" =% +regex ] && [ "$TERM" @i=~ "^xterm\&.*" ]
5227   echo ..in an X terminal
5228 endif
5229 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5230     [ "$verbose" != '' ] ] ]
5231   echo Noisy, noisy
5232 endif
5233 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5234   echo Left associativity, as is known from the shell
5235 endif
5240 .It Ic ignore
5241 (ig) Identical to
5242 .Ic discard .
5243 Superseded by the multiplexer
5244 .Ic headerpick .
5247 .It Ic list
5248 Shows the names of all available commands, alphabetically sorted.
5249 If given any non-whitespace argument the list will be shown in the order
5250 in which command prefixes are searched.
5251 \*(OP In conjunction with a set variable
5252 .Va verbose
5253 additional information will be provided for each command: the argument
5254 type will be indicated, the documentation string will be shown,
5255 and the set of command flags will show up:
5257 .Bl -tag -compact -width ".It Ql BaNg"
5258 .It Ql "vput modifier"
5259 command supports the command modifier
5260 .Cm vput .
5261 .It Ql "errno in *!*"
5262 the error number is tracked in
5263 .Va \&! .
5264 .It Ql "needs box"
5265 commands needs an active mailbox, a
5266 .Ic file .
5267 .It Ql "ok: batch or interactive"
5268 command may only be used in interactive or
5269 .Fl #
5270 batch mode.
5271 .It Ql "ok: send mode"
5272 command can be used in send mode.
5273 .It Ql "not ok: compose mode"
5274 command is not available when in compose mode.
5275 .It Ql "not ok: during startup"
5276 command cannot be used during program startup, e.g., while loading
5277 .Sx "Resource files" .
5278 .It Ql "ok: in subprocess"
5279 command is allowed to be used when running in a subprocess instance,
5280 e.g., from within a macro that is called via
5281 .Va on-compose-splice .
5286 .It Ic localopts
5287 This command can be used to localize changes to (linked)
5288 .Sx ENVIRONMENT
5289 as well as
5290 .Sx "INTERNAL VARIABLES" ,
5291 meaning that their state will be reverted to the former one once the
5292 .Dq covered scope
5293 is left.
5294 It can only be used inside of macro definition blocks introduced by
5295 .Ic account
5297 .Ic define .
5298 The covered scope of an
5299 .Ic account
5300 is left once a different account is activated, and some macros, notably
5301 .Va folder-hook Ns s ,
5302 use their own specific notion of covered scope, here it will be extended
5303 until the folder is left again.
5306 This setting stacks up: i.e., if
5307 .Ql macro1
5308 enables change localization and calls
5309 .Ql macro2 ,
5310 which explicitly resets localization, then any value changes within
5311 .Ql macro2
5312 will still be reverted when the scope of
5313 .Ql macro1
5314 is left.
5315 (Caveats: if in this example
5316 .Ql macro2
5317 changes to a different
5318 .Ic account
5319 which sets some variables that are already covered by localizations,
5320 their scope will be extended, and in fact leaving the
5321 .Ic account
5322 will (thus) restore settings in (likely) global scope which actually
5323 were defined in a local, macro private context!)
5326 This command takes one or two arguments, the optional first one
5327 specifies an attribute that may be one of
5328 .Cm scope ,
5329 which refers to the current scope and is thus the default,
5330 .Cm call ,
5331 which causes any macro that is being
5332 .Ic call Ns
5333 ed to be started with localization enabled by default, as well as
5334 .Cm call-fixate ,
5335 which (if enabled) disallows any called macro to turn off localization:
5336 like this it can be ensured that once the current scope regains control,
5337 any changes made in deeper levels have been reverted.
5338 The latter two are mutually exclusive.
5339 The (second) argument is interpreted as a boolean (string, see
5340 .Sx "INTERNAL VARIABLES" )
5341 and states whether the given attribute shall be turned on or off.
5343 .Bd -literal -offset indent
5344 define temporary_settings {
5345   set possibly_global_option1
5346   localopts on
5347   set local_option1
5348   set local_option2
5349   localopts scope off
5350   set possibly_global_option2
5356 .It Ic Lreply
5357 Reply to messages that come in via known
5358 .Pf ( Ic mlist )
5359 or subscribed
5360 .Pf ( Ic mlsubscribe )
5361 mailing lists, or pretend to do so (see
5362 .Sx "Mailing lists" ) :
5363 on top of the usual
5364 .Ic reply
5365 functionality this will actively resort and even remove message
5366 recipients in order to generate a message that is supposed to be sent to
5367 a mailing list.
5368 For example it will also implicitly generate a
5369 .Ql Mail-Followup-To:
5370 header if that seems useful, regardless of the setting of the variable
5371 .Va followup-to .
5372 For more documentation please refer to
5373 .Sx "On sending mail, and non-interactive mode" .
5375 This may generate the errors
5376 .Va ^ERR Ns -DESTADDRREQ
5377 if no receiver has been specified,
5378 .Va ^ERR Ns -PERM
5379 if some addressees where rejected by
5380 .Va expandaddr ,
5381 .Va ^ERR Ns -NODATA
5382 if no applicable messages have been given,
5383 .Va ^ERR Ns -IO
5384 if an I/O error occurs,
5385 .Va ^ERR Ns -NOTSUP
5386 if a necessary character set conversion fails, and
5387 .Va ^ERR Ns -INVAL
5388 for other errors.
5389 Any error stops processing of further messages.
5392 .It Ic Mail
5393 Similar to
5394 .Ic mail ,
5395 but saves the message in a file named after the local part of the first
5396 recipient's address (instead of in
5397 .Va record Ns ).
5400 .It Ic mail
5401 (m) Takes a (list of) recipient address(es) as (an) argument(s),
5402 or asks on standard input if none were given;
5403 then collects the remaining mail content and sends it out.
5404 For more documentation please refer to
5405 .Sx "On sending mail, and non-interactive mode" .
5407 This may generate the errors
5408 .Va ^ERR Ns -DESTADDRREQ
5409 if no receiver has been specified,
5410 .Va ^ERR Ns -PERM
5411 if some addressees where rejected by
5412 .Va expandaddr ,
5413 .Va ^ERR Ns -NODATA
5414 if no applicable messages have been given,
5415 .Va ^ERR Ns -NOTSUP
5416 if multiple messages have been specified,
5417 .Va ^ERR Ns -IO
5418 if an I/O error occurs,
5419 .Va ^ERR Ns -NOTSUP
5420 if a necessary character set conversion fails, and
5421 .Va ^ERR Ns -INVAL
5422 for other errors.
5425 .It Ic mbox
5426 (mb) The given message list is to be sent to the
5427 .Mx -sx
5428 .Sx "secondary mailbox"
5429 .Ev MBOX
5430 when \*(UA is quit; this is the default action unless the variable
5431 .Va hold
5432 is set.
5433 \*(ID This command can only be used in a
5434 .Mx -sx
5435 .Sx "primary system mailbox" .
5439 .It Ic mimetype , unmimetype
5440 Without arguments the content of the MIME type cache will displayed;
5441 a more verbose listing will be produced if either of
5442 .Va debug
5444 .Va verbose
5445 are set.
5446 When given arguments they will be joined, interpreted as shown in
5447 .Sx "The mime.types files"
5448 (also see
5449 .Sx "HTML mail and MIME attachments" ) ,
5450 and the resulting entry will be added (prepended) to the cache.
5451 In any event MIME type sources are loaded first as necessary \(en
5452 .Va mimetypes-load-control
5453 can be used to fine-tune which sources are actually loaded.
5455 The latter command deletes all specifications of the given MIME type, thus
5456 .Ql ? unmimetype text/plain
5457 will remove all registered specifications for the MIME type
5458 .Ql text/plain .
5459 The special name
5460 .Ql *
5461 will discard all existing MIME types, just as will
5462 .Ql reset ,
5463 but which also reenables cache initialization via
5464 .Va mimetypes-load-control .
5468 .It Ic mlist , unmlist
5469 The latter command removes all given mailing-lists, the special name
5470 .Ql *
5471 can be used to remove all registered lists.
5472 The former will list all currently defined mailing lists (and their
5473 attributes, if any) when used without arguments; a more verbose listing
5474 will be produced if either of
5475 .Va debug
5477 .Va verbose
5478 are set.
5479 Otherwise all given arguments will be added and henceforth be recognized
5480 as mailing lists.
5481 If the \*(OPal regular expression support is available then mailing
5482 lists may also be specified as (extended) regular expressions (see
5483 .Xr re_format 7
5484 for more on those).
5487 .It Ic mimeview
5488 \*(ID Only available in interactive mode, this command allows to display
5489 MIME parts which require external MIME handler programs to run which do
5490 not integrate in \*(UAs normal
5491 .Ic type
5492 output (see
5493 .Sx "HTML mail and MIME attachments" ) .
5494 (\*(ID No syntax to directly address parts, this restriction may vanish.)
5495 The user will be asked for each non-text part of the given message in
5496 turn whether the registered handler shall be used to display the part.
5500 .It Ic mlsubscribe , unmlsubscribe
5501 The latter command removes the subscription attribute from all given
5502 mailing-lists, the special name
5503 .Ql *
5504 can be used to do so for any registered list.
5505 The former will list all currently defined mailing lists which have
5506 a subscription attribute when used without arguments; a more verbose
5507 listing will be produced if either of
5508 .Va debug
5510 .Va verbose
5511 are set.
5512 Otherwise this attribute will be set for all given mailing lists,
5513 newly creating them as necessary (as via
5514 .Ic mlist ) .
5515 Also see
5516 .Va followup-to .
5519 .It Ic Move
5520 Similar to
5521 .Ic move ,
5522 but moves the messages to a file named after the local part of the
5523 sender address of the first message (instead of in
5524 .Va record Ns ).
5527 .It Ic move
5528 Acts like
5529 .Ic copy
5530 but marks the messages for deletion if they were transferred
5531 successfully.
5534 .It Ic More
5535 Like
5536 .Ic more ,
5537 but also displays header fields which would not pass the
5538 .Ic headerpick
5539 selection, and all MIME parts.
5540 Identical to
5541 .Ic Page .
5544 .It Ic more
5545 Invokes the
5546 .Ev PAGER
5547 on the given messages, even in non-interactive mode and as long as the
5548 standard output is a terminal.
5549 Identical to
5550 .Ic page .
5553 .It Ic netrc
5554 \*(OP When used without arguments or if
5555 .Ar show
5556 has been given the content of the
5557 .Pa .netrc
5558 cache is shown, loading it first as necessary.
5559 If the argument is
5560 .Ar load
5561 then the cache will only be initialized and
5562 .Ar clear
5563 will remove its contents.
5564 Note that \*(UA will try to load the file only once, use
5565 .Ql Ic \&\&netrc Ns \:\0\:clear
5566 to unlock further attempts.
5568 .Va netrc-lookup ,
5569 .Va netrc-pipe
5570 and the section
5571 .Sx "On URL syntax and credential lookup" ;
5572 the section
5573 .Sx "The .netrc file"
5574 documents the file format in detail.
5577 .It Ic newmail
5578 Checks for new mail in the current folder without committing any changes
5579 before.
5580 If new mail is present, a message is shown.
5581 If the
5582 .Va header
5583 variable is set,
5584 the headers of each new message are also shown.
5585 This command is not available for all mailbox types.
5588 .It Ic next
5589 (n) (like
5590 .Ql +
5592 .Dq ENTER )
5593 Goes to the next message in sequence and types it.
5594 With an argument list, types the next matching message.
5597 .It Ic New
5598 Same as
5599 .Ic Unread .
5602 .It Ic new
5603 Same as
5604 .Ic unread .
5607 .It Ic noop
5608 If the current folder is accessed via a network connection, a
5609 .Dq NOOP
5610 command is sent, otherwise no operation is performed.
5613 .It Ic Page
5614 Like
5615 .Ic page ,
5616 but also displays header fields which would not pass the
5617 .Ic headerpick
5618 selection, and all MIME parts.
5619 Identical to
5620 .Ic More .
5623 .It Ic page
5624 Invokes the
5625 .Ev PAGER
5626 on the given messages, even in non-interactive mode and as long as the
5627 standard output is a terminal.
5628 Identical to
5629 .Ic more .
5632 .It Ic Pipe
5633 Like
5634 .Ic pipe
5635 but also pipes header fields which would not pass the
5636 .Ic headerpick
5637 selection, and all parts of MIME
5638 .Ql multipart/alternative
5639 messages.
5642 .It Ic pipe
5643 (pi) Takes a message list and a shell command
5644 and pipes the messages through the command.
5645 Without an argument the current message is piped through the command
5646 given by the
5647 .Va cmd
5648 variable.
5649 If the
5650 .Va page
5651 variable is set,
5652 every message is followed by a formfeed character.
5655 .It Ic preserve
5656 (pre) A synonym for
5657 .Ic hold .
5660 .It Ic Print
5661 (P) Alias for
5662 .Ic Type .
5665 .It Ic print
5666 (p) Research
5668 equivalent of
5669 .Ic type .
5672 .It Ic quit
5673 (q) Terminates the session, saving all undeleted, unsaved messages in
5674 the current
5675 .Mx -sx
5676 .Sx "secondary mailbox"
5677 .Ev MBOX ,
5678 preserving all messages marked with
5679 .Ic hold
5681 .Ic preserve
5682 or never referenced in the system
5683 .Va inbox ,
5684 and removing all other messages from the
5685 .Mx -sx
5686 .Sx "primary system mailbox" .
5687 If new mail has arrived during the session,
5688 the message
5689 .Dq You have new mail
5690 will be shown.
5691 If given while editing a mailbox file with the command line option
5692 .Fl f ,
5693 then the edit file is rewritten.
5694 A return to the shell is effected,
5695 unless the rewrite of edit file fails,
5696 in which case the user can escape with the exit command.
5697 The optional status number argument will be passed through to
5698 .Xr exit 3 .
5699 \*(ID For now it can happen that the given status will be overwritten,
5700 later this will only occur if a later error needs to be reported onto an
5701 otherwise success indicating status.
5704 .It Ic read
5705 \*(NQ Read a line from standard input, or the channel set active via
5706 .Ic readctl ,
5707 and assign the data, which will be splitted as indicated by
5708 .Va ifs ,
5709 to the given variables.
5710 The variable names are checked by the same rules as documented for
5711 .Cm vput ,
5712 and the same error codes will be seen in
5713 .Va \&! ;
5714 the exit status
5715 .Va \&?
5716 indicates the number of bytes read, it will be
5717 .Ql -1
5718 with the error number
5719 .Va \&!
5720 set to
5721 .Va ^ERR Ns -BADF
5722 in case of I/O errors, or
5723 .Va ^ERR Ns -NONE
5724 upon End-Of-File.
5725 If there are more fields than variables, assigns successive fields to the
5726 last given variable.
5727 If there are less fields than variables, assigns the empty string to the
5728 remains.
5729 .Bd -literal -offset indent
5730 ? read a b c
5731    H  e  l  l  o
5732 ? echo "<$a> <$b> <$c>"
5733 <H> <e> <l  l  o>
5734 ? wysh set ifs=:; read a b c;unset ifs
5735 hey2.0,:"'you    ",:world!:mars.:
5736 ? echo $?/$^ERRNAME / <$a><$b><$c>
5737 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
5741 .It Ic readctl
5742 \*(NQ Manages input channels for
5743 .Ic read ,
5744 to be used to avoid complicated or impracticable code, like calling
5745 .Ic \&\&read
5746 from within a macro in non-interactive mode.
5747 Without arguments, or when the first argument is
5748 .Cm show ,
5749 a listing of all known channels is printed.
5750 Channels can otherwise be
5751 .Cm create Ns
5752 d, and existing channels can be
5753 .Cm set
5754 active and
5755 .Cm remove Ns
5756 d by giving the string used for creation.
5758 The channel name is expected to be a file descriptor number, or,
5759 if parsing the numeric fails, an input file name that undergoes
5760 .Sx "Filename transformations" .
5761 E.g. (this example requires a modern shell):
5762 .Bd -literal -offset indent
5763 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
5764   LC_ALL=C \*(uA -R#
5765 hey, you
5766 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
5767   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
5768 hey, you
5771 .It Ic redirect
5772 \*(OB Same as
5773 .Ic resend .
5775 .It Ic Redirect
5776 \*(OB Same as
5777 .Ic Resend .
5780 .It Ic remove
5781 Removes the named files or directories.
5782 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
5783 type specific removal will be performed, deleting the complete mailbox.
5784 The user is asked for confirmation in interactive mode.
5787 .It Ic rename
5788 Takes the name of an existing folder
5789 and the name for the new folder
5790 and renames the first to the second one.
5791 Both folders must be of the same type.
5794 .It Ic Reply
5795 (R) Replies to only the sender of each message of the given message
5796 list, by using the first message as the template to quote, for the
5797 .Ql Subject:
5798 etc.
5799 .Va flipr
5800 will exchange this command with
5801 .Ic reply .
5802 Unless the internal variable
5803 .Va fullnames
5804 is set the recipient address will be stripped from comments, names etc.
5805 .Ql Reply-To:
5806 headers will be inspected if
5807 .Va reply-to-honour
5808 is set.
5810 This may generate the errors
5811 .Va ^ERR Ns -DESTADDRREQ
5812 if no receiver has been specified,
5813 .Va ^ERR Ns -PERM
5814 if some addressees where rejected by
5815 .Va expandaddr ,
5816 .Va ^ERR Ns -NODATA
5817 if no applicable messages have been given,
5818 .Va ^ERR Ns -IO
5819 if an I/O error occurs,
5820 .Va ^ERR Ns -NOTSUP
5821 if a necessary character set conversion fails, and
5822 .Va ^ERR Ns -INVAL
5823 for other errors.
5826 .It Ic reply
5827 (r) Take a message and group-responds to it by addressing the sender
5828 and all recipients, subject to
5829 .Ic alternates
5830 processing.
5831 .Va followup-to ,
5832 .Va followup-to-honour ,
5833 .Va reply-to-honour
5834 as well as
5835 .Va recipients-in-cc
5836 influence response behaviour.
5837 Unless the internal variable
5838 .Va fullnames
5839 is set recipient addresses will be stripped from comments, names etc.
5841 .Va flipr
5842 is set the commands
5843 .Ic Reply
5845 .Ic reply
5846 are exchanged.
5847 The command
5848 .Ic Lreply
5849 offers special support for replying to mailing lists.
5850 For more documentation please refer to
5851 .Sx "On sending mail, and non-interactive mode" .
5853 This may generate the errors
5854 .Va ^ERR Ns -DESTADDRREQ
5855 if no receiver has been specified,
5856 .Va ^ERR Ns -PERM
5857 if some addressees where rejected by
5858 .Va expandaddr ,
5859 .Va ^ERR Ns -NODATA
5860 if no applicable messages have been given,
5861 .Va ^ERR Ns -IO
5862 if an I/O error occurs,
5863 .Va ^ERR Ns -NOTSUP
5864 if a necessary character set conversion fails, and
5865 .Va ^ERR Ns -INVAL
5866 for other errors.
5867 Any error stops processing of further messages.
5870 .It Ic replyall
5871 Similar to
5872 .Ic reply ,
5873 but initiates a group-reply regardless of the value of
5874 .Va flipr .
5877 .It Ic replysender
5878 Similar to
5879 .Ic Reply ,
5880 but responds to the sender only regardless of the value of
5881 .Va flipr .
5884 .It Ic Resend
5885 Like
5886 .Ic resend ,
5887 but does not add any header lines.
5888 This is not a way to hide the sender's identity,
5889 but useful for sending a message again to the same recipients.
5892 .It Ic resend
5893 Takes a list of messages and a user name
5894 and sends each message to the named user.
5895 .Ql Resent-From:
5896 and related header fields are prepended to the new copy of the message.
5897 Saving in
5898 .Va record
5899 is only performed if
5900 .Va record-resent
5901 is set.
5903 This may generate the errors
5904 .Va ^ERR Ns -DESTADDRREQ
5905 if no receiver has been specified,
5906 .Va ^ERR Ns -PERM
5907 if some addressees where rejected by
5908 .Va expandaddr ,
5909 .Va ^ERR Ns -NODATA
5910 if no applicable messages have been given,
5911 .Va ^ERR Ns -IO
5912 if an I/O error occurs,
5913 .Va ^ERR Ns -NOTSUP
5914 if a necessary character set conversion fails, and
5915 .Va ^ERR Ns -INVAL
5916 for other errors.
5917 Any error stops processing of further messages.
5920 .It Ic Respond
5921 Same as
5922 .Ic Reply .
5925 .It Ic respond
5926 Same as
5927 .Ic reply .
5930 .It Ic respondall
5931 Same as
5932 .Ic replyall .
5935 .It Ic respondsender
5936 Same as
5937 .Ic replysender .
5940 .It Ic retain
5941 (ret) Superseded by the multiplexer
5942 .Ic headerpick .
5945 .It Ic return
5946 Only available inside the scope of a
5947 .Ic define Ns
5948 d macro or an
5949 .Ic account ,
5950 this will stop evaluation of any further macro content, and return
5951 execution control to the caller.
5952 The two optional parameters must be specified as positive decimal
5953 numbers and default to the value 0:
5954 the first argument specifies the signed 32-bit return value (stored in
5955 .Va \&?
5956 \*(ID and later extended to signed 64-bit),
5957 the second the signed 32-bit error number (stored in
5958 .Va \&! ) .
5959 As documented for
5960 .Va \&?
5961 a non-0 exit status may cause the program to exit.
5964 .It Ic Save
5965 (S) Similar to
5966 .Ic save,
5967 but saves the messages in a file named after the local part of the
5968 sender of the first message instead of (in
5969 .Va record
5970 and) taking a filename argument; the variable
5971 .Va outfolder
5972 is inspected to decide on the actual storage location.
5975 .It Ic save
5976 (s) Takes a message list and a filename and appends each message in turn
5977 to the end of the file.
5978 If no filename is given, the
5979 .Mx -sx
5980 .Sx "secondary mailbox"
5981 .Ev MBOX
5982 is used.
5983 The filename in quotes, followed by the generated character count
5984 is echoed on the user's terminal.
5985 If editing a
5986 .Mx -sx
5987 .Sx "primary system mailbox"
5988 the messages are marked for deletion.
5989 .Sx "Filename transformations"
5990 will be applied.
5992 .It Ic savediscard
5993 \*(OB Superseded by the multiplexer
5994 .Ic headerpick .
5996 .It Ic saveignore
5997 \*(OB Superseded by the multiplexer
5998 .Ic headerpick .
6000 .It Ic saveretain
6001 \*(OB Superseded by the multiplexer
6002 .Ic headerpick .
6005 .It Ic search
6006 Takes a message specification (list) and displays a header summary of
6007 all matching messages, as via
6008 .Ic headers .
6009 This command is an alias of
6010 .Ic from .
6011 Also see
6012 .Sx "Specifying messages" .
6015 .It Ic seen
6016 Takes a message list and marks all messages as having been read.
6021 .It Ic set , unset
6022 (se, \*(NQ uns) The latter command will delete all given variables,
6023 the former, when used without arguments, will show all variables which
6024 are currently known to \*(UA.
6025 A more verbose listing will be produced if
6026 either of
6027 .Va debug
6029 .Va verbose
6030 are set.
6031 Remarks: the list mode will not automatically link-in known
6032 .Sx ENVIRONMENT
6033 variables, but only explicit addressing will, e.g., via
6034 .Ic varshow ,
6035 using a variable in an
6036 .Ic if
6037 condition or a string passed to
6038 .Ic echo ,
6039 explicit
6040 .Ic set Ns
6041 ting, as well as some program-internal use cases.
6044 Otherwise the given variables (and arguments) are set or adjusted.
6045 Arguments are of the form
6046 .Ql name=value
6047 (no space before or after
6048 .Ql = ) ,
6049 or plain
6050 .Ql name
6051 if there is no value, i.e., a boolean variable.
6052 \*(ID In conjunction with the
6053 .Cm wysh
6054 command prefix
6055 .Sx "Shell-style argument quoting"
6056 can be used to quote arguments as necessary.
6057 \*(ID Otherwise quotation marks may be placed around any part of the
6058 assignment statement to quote blanks or tabs.
6061 .Dl ? wysh set indentprefix=' -> '
6064 If an argument begins with
6065 .Ql no ,
6066 as in
6067 .Ql set nosave ,
6068 the effect is the same as invoking the
6069 .Ic unset
6070 command with the remaining part of the variable
6071 .Pf ( Ql unset save ) .
6075 .Ql name
6076 that is known to map to an environment variable will automatically cause
6077 updates in the program environment (unsetting a variable in the
6078 environment requires corresponding system support) \(em use the command
6079 .Ic environ
6080 for further environmental control.
6081 Also see
6082 .Ic varedit ,
6083 .Ic varshow
6084 and the sections
6085 .Sx "INTERNAL VARIABLES"
6087 .Sx ENVIRONMENT .
6091 .It Ic shcodec
6092 Apply shell quoting rules to the given raw-data arguments.
6093 Supports
6094 .Cm vput
6095 (see
6096 .Sx "Command modifiers" ) .
6097 The first argument specifies the operation:
6098 .Ar [+]e[ncode]
6100 .Ar d[ecode]
6101 cause shell quoting to be applied to the remains of the line, and
6102 expanded away thereof, respectively.
6103 If the former is prefixed with a plus-sign, the quoted result will not
6104 be roundtrip enabled, and thus can be decoded only in the very same
6105 environment that was used to perform the encode; also see
6106 .Cd mle-quote-rndtrip .
6107 If the coding operation fails the error number
6108 .Va \&!
6109 is set to
6110 .Va ^ERR Ns -CANCELED ,
6111 and the unmodified input is used as the result; the error number may
6112 change again due to output or result storage errors.
6115 .It Ic shell
6116 \*(NQ (sh) Invokes an interactive version of the shell,
6117 and returns its exit status.
6121 .It Ic shortcut , unshortcut
6122 Without arguments the list of all currently defined shortcuts is
6123 shown, with one argument the expansion of the given shortcut.
6124 Otherwise all given arguments are treated as pairs of shortcuts and
6125 their expansions, creating new or changing already existing shortcuts,
6126 as necessary.
6127 The latter command will remove all given shortcuts, the special name
6128 .Ql *
6129 will remove all registered shortcuts.
6132 .It Ic shift
6133 \*(NQ Shift the positional parameter stack (starting at
6134 .Va 1 )
6135 by the given number (which must be a positive decimal),
6136 or 1 if no argument has been given.
6137 It is an error if the value exceeds the number of positional parameters.
6138 If the given number is 0, no action is performed, successfully.
6139 The stack as such can be managed via
6140 .Ic vpospar .
6141 Note this command will fail in
6142 .Ic account
6143 and hook macros unless the positional parameter stack has been
6144 explicitly created in the current context via
6145 .Ic vpospar .
6148 .It Ic show
6149 Like
6150 .Ic type ,
6151 but performs neither MIME decoding nor decryption, so that the raw
6152 message text is shown.
6155 .It Ic size
6156 (si) Shows the size in characters of each message of the given
6157 message-list.
6160 .It Ic sleep
6161 \*(NQ Sleep for the specified number of seconds (and optionally
6162 milliseconds), by default interruptably.
6163 If a third argument is given the sleep will be uninterruptible,
6164 otherwise the error number
6165 .Va \&!
6166 will be set to
6167 .Va ^ERR Ns -INTR
6168 if the sleep has been interrupted.
6169 The command will fail and the error number will be
6170 .Va ^ERR Ns -OVERFLOW
6171 if the given duration(s) overflow the time datatype, and
6172 .Va ^ERR Ns -INVAL
6173 if the given durations are no valid integers.
6178 .It Ic sort , unsort
6179 The latter command disables sorted or threaded mode, returns to normal
6180 message order and, if the
6181 .Va header
6182 variable is set,
6183 displays a header summary.
6184 The former command shows the current sorting criterion when used without
6185 an argument, but creates a sorted representation of the current folder
6186 otherwise, and changes the
6187 .Ic next
6188 command and the addressing modes such that they refer to messages in
6189 the sorted order.
6190 Message numbers are the same as in regular mode.
6191 If the
6192 .Va header
6193 variable is set,
6194 a header summary in the new order is also displayed.
6195 Automatic folder sorting can be enabled by setting the
6196 .Va autosort
6197 variable, as in, e.g.,
6198 .Ql set autosort=thread .
6199 Possible sorting criterions are:
6202 .Bl -tag -compact -width "subject"
6203 .It Ar date
6204 Sort the messages by their
6205 .Ql Date:
6206 field, that is by the time they were sent.
6207 .It Ar from
6208 Sort messages by the value of their
6209 .Ql From:
6210 field, that is by the address of the sender.
6211 If the
6212 .Va showname
6213 variable is set, the sender's real name (if any) is used.
6214 .It Ar size
6215 Sort the messages by their size.
6216 .It spam
6217 \*(OP Sort the message by their spam score, as has been classified by
6218 .Ic spamrate .
6219 .It Ar status
6220 Sort the messages by their message status.
6221 .It Ar subject
6222 Sort the messages by their subject.
6223 .It Ar thread
6224 Create a threaded display.
6225 .It Ar to
6226 Sort messages by the value of their
6227 .Ql To:
6228 field, that is by the address of the recipient.
6229 If the
6230 .Va showname
6231 variable is set, the recipient's real name (if any) is used.
6236 .It Ic source
6237 \*(NQ (so) The source command reads commands from the given file.
6238 .Sx "Filename transformations"
6239 will be applied.
6240 If the given expanded argument ends with a vertical bar
6241 .Ql |
6242 then the argument will instead be interpreted as a shell command and
6243 \*(UA will read the output generated by it.
6244 Interpretation of commands read is stopped when an error is encountered.
6245 \*(ID Note that
6246 .Ic \&\&source
6247 cannot be used from within macros that execute as
6248 .Va folder-hook Ns s
6250 .Ic account Ns s ,
6251 i.e., it can only be called from macros that were
6252 .Ic call Ns ed .
6255 .It Ic source_if
6256 \*(NQ The difference to
6257 .Ic source
6258 (beside not supporting pipe syntax aka shell command input) is that
6259 this command will not generate an error nor warn if the given file
6260 argument cannot be opened successfully.
6263 .It Ic spamclear
6264 \*(OP Takes a list of messages and clears their
6265 .Ql is-spam
6266 flag.
6269 .It Ic spamforget
6270 \*(OP Takes a list of messages and causes the
6271 .Va spam-interface
6272 to forget it has ever used them to train its Bayesian filter.
6273 Unless otherwise noted the
6274 .Ql is-spam
6275 flag of the message is inspected to chose whether a message shall be
6276 forgotten to be
6277 .Dq ham
6279 .Dq spam .
6282 .It Ic spamham
6283 \*(OP Takes a list of messages and informs the Bayesian filter of the
6284 .Va spam-interface
6285 that they are
6286 .Dq ham .
6287 This also clears the
6288 .Ql is-spam
6289 flag of the messages in question.
6292 .It Ic spamrate
6293 \*(OP Takes a list of messages and rates them using the configured
6294 .Va spam-interface ,
6295 without modifying the messages, but setting their
6296 .Ql is-spam
6297 flag as appropriate; because the spam rating headers are lost the rate
6298 will be forgotten once the mailbox is left.
6299 Refer to the manual section
6300 .Sx "Handling spam"
6301 for the complete picture of spam handling in \*(UA.
6304 .It Ic spamset
6305 \*(OP Takes a list of messages and sets their
6306 .Ql is-spam
6307 flag.
6310 .It Ic spamspam
6311 \*(OP Takes a list of messages and informs the Bayesian filter of the
6312 .Va spam-interface
6313 that they are
6314 .Dq spam .
6315 This also sets the
6316 .Ql is-spam
6317 flag of the messages in question.
6319 .It Ic thread
6320 \*(OB The same as
6321 .Ql sort thread
6322 (consider using a
6323 .Ql commandalias
6324 as necessary).
6327 .It Ic Top
6328 Like
6329 .Ic top
6330 but always uses the
6331 .Ic headerpick
6332 .Ql type
6333 slot for white- and blacklisting header fields.
6336 .It Ic top
6337 (to) Takes a message list and types out the first
6338 .Va toplines
6339 lines of each message on the users' terminal.
6340 Unless a special selection has been established for the
6341 .Ql top
6342 slot of the
6343 .Ic headerpick
6344 command, the only header fields that are displayed are
6345 .Ql From: ,
6346 .Ql To: ,
6347 .Ql CC: ,
6349 .Ql Subject: .
6350 .Ic Top
6351 will always use the
6352 .Ql type
6353 .Ic headerpick
6354 selection instead.
6355 It is possible to apply compression to what is displayed by setting
6356 .Va topsqueeze .
6357 Messages are decrypted and converted to the terminal character set
6358 if necessary.
6361 .It Ic touch
6362 (tou) Takes a message list and marks the messages for saving in the
6363 .Mx -sx
6364 .Sx "secondary mailbox"
6365 .Ev MBOX .
6366 \*(UA deviates from the POSIX standard with this command,
6367 as a following
6368 .Ic next
6369 command will display the following message instead of the current one.
6372 .It Ic Type
6373 (T) Like
6374 .Ic type
6375 but also displays header fields which would not pass the
6376 .Ic headerpick
6377 selection, and all visualizable parts of MIME
6378 .Ql multipart/alternative
6379 messages.
6382 .It Ic type
6383 (t) Takes a message list and types out each message on the users terminal.
6384 The display of message headers is selectable via
6385 .Ic headerpick .
6386 For MIME multipart messages, all parts with a content type of
6387 .Ql text ,
6388 all parts which have a registered MIME type handler (see
6389 .Sx "HTML mail and MIME attachments" )
6390 which produces plain text output, and all
6391 .Ql message
6392 parts are shown, others are hidden except for their headers.
6393 Messages are decrypted and converted to the terminal character set
6394 if necessary.
6395 The command
6396 .Ic mimeview
6397 can be used to display parts which are not displayable as plain text.
6399 .It Ic unaccount
6401 .Ic account .
6403 .It Ic unalias
6404 (una) See
6405 .Ic alias .
6407 .It Ic unanswered
6409 .Ic answered .
6411 .It Ic unbind
6413 .Ic bind .
6415 .It Ic uncollapse
6417 .Ic collapse .
6419 .It Ic uncolour
6421 .Ic colour .
6423 .It Ic undefine
6425 .Ic define .
6427 .It Ic undelete
6429 .Ic delete .
6431 .It Ic undraft
6433 .Ic draft .
6435 .It Ic unflag
6437 .Ic flag .
6439 .It Ic unfwdignore
6440 \*(OB Superseded by the multiplexer
6441 .Ic headerpick .
6443 .It Ic unfwdretain
6444 \*(OB Superseded by the multiplexer
6445 .Ic headerpick .
6448 .It Ic unignore
6449 Superseded by the multiplexer
6450 .Ic headerpick .
6452 .It Ic unmimetype
6454 .Ic mimetype .
6456 .It Ic unmlist
6458 .Ic mlist .
6460 .It Ic unmlsubscribe
6462 .Ic mlsubscribe .
6465 .It Ic Unread
6466 Same as
6467 .Ic unread .
6470 .It Ic unread
6471 Takes a message list and marks each message as not having been read.
6474 .It Ic unretain
6475 Superseded by the multiplexer
6476 .Ic headerpick .
6478 .It Ic unsaveignore
6479 \*(OB Superseded by the multiplexer
6480 .Ic headerpick .
6482 .It Ic unsaveretain
6483 \*(OB Superseded by the multiplexer
6484 .Ic headerpick .
6486 .It Ic unset
6487 \*(NQ (uns) See
6488 .Ic set .
6490 .It Ic unshortcut
6492 .Ic shortcut .
6494 .It Ic unsort
6496 .Ic short .
6498 .It Ic unthread
6499 \*(OB
6500 Same as
6501 .Ic unsort .
6504 .It Ic urlcodec
6505 Perform URL percent codec operations on the raw-data argument, rather
6506 according to RFC 3986.
6507 Supports
6508 .Cm vput
6509 (see
6510 .Sx "Command modifiers" ) ,
6511 and manages the error number
6512 .Va \&! .
6513 This is a character set agnostic and thus locale dependent operation,
6514 and it may decode bytes which are invalid in the current
6515 .Va ttycharset .
6516 \*(ID This command does not know about URLs beside that.
6518 The first argument specifies the operation:
6519 .Ar e[ncode]
6521 .Ar d[ecode]
6522 perform plain URL percent en- and decoding, respectively.
6523 .Ar p[ath]enc[ode]
6525 .Ar p[ath]dec[ode]
6526 perform a slightly modified operation which should be better for
6527 pathnames: it does not allow a tilde
6528 .Ql ~ ,
6529 and will neither accept hyphen-minus
6530 .Ql -
6531 nor dot
6532 .Ql .
6533 as an initial character.
6534 The remains of the line form the URL data which is to be converted.
6535 If the coding operation fails the error number
6536 .Va \&!
6537 is set to
6538 .Va ^ERR Ns -CANCELED ,
6539 and the unmodified input is used as the result; the error number may
6540 change again due to output or result storage errors.
6543 .It Ic varedit
6544 \*(NQ Edit the values of or create the given variable(s) in the
6545 .Ev EDITOR .
6546 Boolean variables cannot be edited, and variables can also not be
6547 .Ic unset
6548 with this command.
6551 .It Ic varshow
6552 \*(NQ This command produces the same output as the listing mode of
6553 .Ic set ,
6554 including
6555 .Va verbose Ns
6556 ity adjustments, but only for the given variables.
6559 .It Ic verify
6560 \*(OP Takes a message list and verifies each message.
6561 If a message is not a S/MIME signed message,
6562 verification will fail for it.
6563 The verification process checks if the message was signed using a valid
6564 certificate,
6565 if the message sender's email address matches one of those contained
6566 within the certificate,
6567 and if the message content has been altered.
6570 .It Ic version
6571 Shows the
6572 .Va version
6574 .Va features
6575 of \*(UA.
6579 .It Ic vexpr
6580 \*(NQ Evaluate arguments according to a given operator.
6581 This is a multiplexer command which can be used to perform signed 64-bit
6582 numeric calculations as well as byte string and string operations.
6583 It uses polish notation, i.e., the operator is the first argument and
6584 defines the number and type, and the meaning of the remaining arguments.
6585 An empty argument is replaced with a 0 if a number is expected.
6586 Supports
6587 .Cm vput
6588 (see
6589 .Sx "Command modifiers" ) .
6592 The result that is shown in case of errors is always
6593 .Ql -1
6594 for usage errors and numeric operations, and the empty string for byte
6595 string and string operations;
6596 if the latter two fail to provide result data for
6597 .Dq soft
6598 errors, e.g., when a search operation failed, they also set the
6599 .Va \&!
6600 error number to
6601 .Va ^ERR Ns -NODATA .
6602 Except when otherwise noted numeric arguments are parsed as signed 64-bit
6603 numbers, and errors will be reported in the error number
6604 .Va \&!
6605 as the numeric error
6606 .Va ^ERR Ns -RANGE .
6609 Numeric operations work on one or two signed 64-bit integers.
6610 One integer is expected by assignment (equals sign
6611 .Ql = ) ,
6612 which does nothing but parsing the argument, thus detecting validity and
6613 possible overflow conditions, and unary not (tilde
6614 .Ql ~ ) ,
6615 which creates the bitwise complement.
6616 Two integers are used by addition (plus sign
6617 .Ql + ) ,
6618 subtraction (hyphen-minus
6619 .Ql - ) ,
6620 multiplication (asterisk
6621 .Ql * ) ,
6622 division (solidus
6623 .Ql / )
6624 and modulo (percent sign
6625 .Ql % ) ,
6626 as well as for the bitwise operators logical or (vertical bar
6627 .Ql | ,
6628 to be quoted) ,
6629 bitwise and (ampersand
6630 .Ql \&& ,
6631 to be quoted) ,
6632 bitwise xor (circumflex
6633 .Ql ^ ) ,
6634 the bitwise signed left- and right shifts
6635 .Pf ( Ql << ,
6636 .Ql >> ) ,
6637 as well as for the unsigned right shift
6638 .Ql >>> .
6641 All numeric operators can be suffixed with a commercial at
6642 .Ql @ ,
6643 e.g.,
6644 .Ql *@ :
6645 this will turn the operation into a saturated one, which means that
6646 overflow errors and division and modulo by zero are no longer reported
6647 via the exit status, but the result will linger at the minimum or
6648 maximum possible value, instead of overflowing (or trapping).
6649 This is true also for the argument parse step.
6650 For the bitwise shifts, the saturated maximum is 63.
6651 Any catched overflow will be reported via the error number
6652 .Va \&!
6654 .Va ^ERR Ns -OVERFLOW .
6657 Character set agnostic string functions have no notion of locale
6658 settings and character sets.
6659 There is
6660 .Ql file-expand ,
6661 which performs the usual
6662 .Sx "Filename transformations"
6663 on its argument, and
6664 .Ql random ,
6665 which generates a random string of the given length, or of
6666 .Dv \&\&PATH_MAX
6667 bytes (a constant from
6668 .Pa /usr/include )
6669 if the value 0 is given; the random string will be base64url encoded
6670 according to RFC 4648, and thus be usable as a (portable) filename.
6673 Byte string operations work on 8-bit bytes and have no notion of locale
6674 settings and character sets, effectively assuming ASCII data.
6675 Operations that take one argument are
6676 .Ql length ,
6677 which queries the length of the given argument, and
6678 .Ql hash ,
6679 which calculates the Chris Torek hash of the given argument.
6682 Byte string operations with two or more arguments are
6683 .Ql find ,
6684 which byte-searches in the first for the second argument, and shows the
6685 resulting 0-based offset shall it have been found,
6686 .Ql ifind ,
6687 which is identical to
6688 .Ql find ,
6689 but works case-insensitively according to the rules of the ASCII
6690 character set.
6691 .Ql substring
6692 will show a substring of its first argument:
6693 the second argument is the 0-based starting offset, the optional third
6694 argument can be used to specify the length of the desired substring,
6695 by default the entire string is used;
6696 this operation tries to work around faulty arguments (set
6697 .Va verbose
6698 for error logs), but reports them via the error number
6699 .Va \&!
6701 .Va ^ERR Ns -OVERFLOW .
6704 String operations work, sufficient support provided, according to the
6705 active user's locale encoding and character set (see
6706 .Sx "Character sets" ) .
6707 There is the one argument operation
6708 .Ql makeprint ,
6709 which (one-way) converts the argument to something safely printable on
6710 the terminal.
6713 \*(OP
6714 .Ql regex
6715 is a string operation that will try to match the first argument with the
6716 regular expression given as the second argument, as does
6717 .Ql iregex ,
6718 but which is case-insensitive.
6719 If the optional third argument has been given then instead of showing
6720 the match offset a replacement operation is performed:
6721 the third argument is treated as if specified via dollar-single-quote
6722 (see
6723 .Sx "Shell-style argument quoting" ) ,
6724 and any occurrence of a positional parameter, e.g.,
6725 .Va 1 ,
6726 is replaced by the corresponding match group of the regular expression.
6728 .Bd -literal -offset indent
6729 ? vexpr -@ +1 -9223372036854775808
6730 ? vput vexpr res ir bananarama (.*)NanA(.*) '\e${1}au\e$2'
6731 ? echo $0 $res
6736 .It Ic vpospar
6737 \*(NQ Manage the positional parameter stack (see
6738 .Va 1 , # , * , @
6739 as well as
6740 .Ic shift ) .
6741 If the first argument is
6742 .Ql clear ,
6743 then the positional parameter stack of the current context, or the
6744 global one, if there is none, is cleared.
6745 If it is
6746 .Ql set ,
6747 then the remaining arguments will be used to (re)create the stack,
6748 if the parameter stack size limit is excessed an
6749 .Va ^ERR Ns -OVERFLOW
6750 error will occur.
6753 If the first argument is
6754 .Ql quote ,
6755 a round-trip capable representation of the stack contents is created,
6756 with each quoted parameter separated from each other with the first
6757 character of
6758 .Va ifs ,
6759 and followed by the first character of
6760 .Va if-ws ,
6761 if that is not empty and not identical to the first.
6762 If that results in no separation at all a
6763 .Cm space
6764 character is used.
6765 This mode supports
6766 .Cm vput
6767 (see
6768 .Sx "Command modifiers" ) .
6769 I.e., the subcommands
6770 .Ql set
6772 .Ql quote
6773 can be used (in conjunction with
6774 .Ic eval )
6775 to (re)create an argument stack from and to a single variable losslessly.
6777 .Bd -literal -offset indent
6778 ? vpospar set hey, "'you    ", world!
6779 ? echo $#: <${1}><${2}><${3}>
6780 ? vput vpospar x quote
6781 ? vpospar clear
6782 ? echo $#: <${1}><${2}><${3}>
6783 ? eval vpospar set ${x}
6784 ? echo $#: <${1}><${2}><${3}>
6789 .It Ic visual
6790 (v) Takes a message list and invokes the display editor on each message.
6791 Modified contents are discarded unless the
6792 .Va writebackedited
6793 variable is set, and are not used unless the mailbox can be written to
6794 and the editor returns a successful exit status.
6797 .It Ic write
6798 (w) For conventional messages the body without all headers is written.
6799 The original message is never marked for deletion in the originating
6800 mail folder.
6801 The output is decrypted and converted to its native format as necessary.
6802 If the output file exists, the text is appended.
6803 If a message is in MIME multipart format its first part is written to
6804 the specified file as for conventional messages, handling of the remains
6805 depends on the execution mode.
6806 No special handling of compressed files is performed.
6808 In interactive mode the user is consecutively asked for the filenames of
6809 the processed parts.
6810 For convience saving of each part may be skipped by giving an empty
6811 value, the same result as writing it to
6812 .Pa /dev/null .
6813 Shell piping the part content by specifying a leading vertical bar
6814 .Ql |
6815 character for the filename is supported.
6816 Other user input undergoes the usual
6817 .Sx "Filename transformations" ,
6818 and contents of the destination file are overwritten if the file
6819 previously existed.
6821 \*(ID In non-interactive mode any part which does not specify a filename
6822 is ignored, and suspicious parts of filenames of the remaining parts are
6823 URL percent encoded (as via
6824 .Ic urlcodec )
6825 to prevent injection of malicious character sequences, resulting in
6826 a filename that will be written into the current directory.
6827 Existing files will not be overwritten, instead the part number or
6828 a dot are appended after a number sign
6829 .Ql #
6830 to the name until file creation succeeds (or fails due to other
6831 reasons).
6834 .It Ic xcall
6835 \*(NQ The sole difference to
6836 .Ic call
6837 is that the new macro is executed in place of the current one, which
6838 will not regain control: all resources of the current macro will be
6839 released first.
6840 This implies that any setting covered by
6841 .Ic localopts
6842 will be forgotten and covered variables will become cleaned up.
6843 If this command is not used from within a
6844 .Ic call Ns
6845 ed macro it will silently be (a more expensive variant of)
6846 .Ic call .
6849 .It Ic xit
6850 (x) A synonym for
6851 .Ic exit .
6854 .It Ic z
6855 \*(NQ \*(UA presents message headers in
6856 .Va screen Ns
6857 fuls as described under the
6858 .Ic headers
6859 command.
6860 Without arguments this command scrolls to the next window of messages,
6861 likewise if the argument is
6862 .Ql + .
6863 An argument of
6864 .Ql -
6865 scrolls to the last,
6866 .Ql ^
6867 scrolls to the first, and
6868 .Ql $
6869 to the last
6870 .Va \&\&screen
6871 of messages.
6872 A number argument prefixed by
6873 .Ql +
6875 .Ql \-
6876 indicates that the window is calculated in relation to the current
6877 position, and a number without a prefix specifies an absolute position.
6880 .It Ic Z
6881 \*(NQ Similar to
6882 .Ic z ,
6883 but scrolls to the next or previous window that contains at least one
6884 .Ql new
6886 .Ic flag Ns
6887 ged message.
6889 .\" }}}
6891 .\" }}}
6894 .\" .Sh COMMAND ESCAPES {{{
6895 .Sh "COMMAND ESCAPES"
6897 Here is a summary of the command escapes available in compose mode,
6898 which are used to perform special functions when composing messages.
6899 Command escapes are only recognized at the beginning of lines, and
6900 consist of a trigger (escape) and a command character.
6901 The actual escape character can be set via the internal variable
6902 .Va escape ,
6903 it defaults to the tilde
6904 .Ql ~ .
6905 Otherwise ignored whitespace characters following the escape character
6906 will prevent a possible addition of the command line to the \*(OPal
6907 history.
6910 Unless otherwise noted all compose mode command escapes ensure proper
6911 updates of the variables which represent the error number
6912 .Va \&!
6913 and the exit status
6914 .Va \&? .
6915 If the variable
6916 .Va errexit
6917 is set they will, unless stated otherwise, error out message compose
6918 mode if an operation fails.
6919 It is however possible to place the character hyphen-minus
6920 .Ql -
6921 after (possible whitespace following) the escape character, which has an
6922 effect equivalent to the command modifier
6923 .Cm ignerr .
6924 If the \*(OPal key bindings are available it is possible to create
6925 .Ic bind Ns
6926 ings specifically for the compose mode.
6929 .Bl -tag -width ".It Ic BaNg"
6931 .It Ic ~~ Ar string
6932 Insert the string of text in the message prefaced by a single
6933 .Ql ~ .
6934 (If the escape character has been changed,
6935 that character must be doubled instead.)
6938 .It Ic ~! Ar command
6939 Execute the indicated shell
6940 .Ar command
6941 which follows, replacing unescaped exclamation marks with the previously
6942 executed command if the internal variable
6943 .Va bang
6944 is set, then return to the message.
6947 .It Ic ~.
6948 Same effect as typing the end-of-file character.
6951 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
6952 Execute the given \*(UA command.
6953 Not all commands, however, are allowed.
6956 .It Ic ~?
6957 Write a summary of command escapes.
6960 .It Ic ~< Ar filename
6961 Identical to
6962 .Ic ~r .
6965 .It Ic ~<! Ar command
6966 .Ar command
6967 is executed using the shell.
6968 Its standard output is inserted into the message.
6971 .It Ic ~@ Op Ar filename...
6972 Append or edit the list of attachments.
6973 Does not manage the error number
6974 .Va \&!
6975 and the exit status
6976 .Va \&? ,
6977 (please use
6978 .Ic ~^
6979 instead if this is a concern).
6980 A list of
6981 .Ar filename
6982 arguments is expected as shell tokens (see
6983 .Sx "Shell-style argument quoting" ;
6984 token-separating commas are ignored, too), to be
6985 interpreted as documented for the command line option
6986 .Fl a ,
6987 with the message number exception as below.
6989 Without
6990 .Ar filename
6991 arguments the attachment list is edited, entry by entry;
6992 if a filename is left empty, that attachment is deleted from the list;
6993 once the end of the list is reached either new attachments may be
6994 entered or the session can be quit by committing an empty
6995 .Dq new
6996 attachment.
6998 For all mode, if a given filename solely consists of the number sign
6999 .Ql #
7000 followed by a valid message number of the currently active mailbox, then
7001 the given message is attached as a
7002 .Ql message/rfc822
7003 MIME message part.
7004 As the shell comment character the number sign must be quoted.
7007 .It Ic ~A
7008 Inserts the string contained in the
7009 .Va Sign
7010 variable (same as
7011 .Ql Ic ~i Ns \0Sign ) .
7012 \*(OB The escape sequences tabulator
7013 .Ql \et
7014 and newline
7015 .Ql \en
7016 are understood (use the
7017 .Cm wysh
7018 prefix when
7019 .Ic set Ns
7020 ting the variable(s) instead).
7023 .It Ic ~a
7024 Inserts the string contained in the
7025 .Va sign
7026 variable (same as
7027 .Ql Ic ~i Ns \0sign ) .
7028 \*(OB The escape sequences tabulator
7029 .Ql \et
7030 and newline
7031 .Ql \en
7032 are understood (use the
7033 .Cm wysh
7034 prefix when
7035 .Ic set Ns
7036 ting the variable(s) instead).
7039 .It Ic ~b Ar name ...
7040 Add the given names to the list of blind carbon copy recipients.
7043 .It Ic ~c Ar name ...
7044 Add the given names to the list of carbon copy recipients.
7047 .It Ic ~d
7048 Read the file specified by the
7049 .Ev DEAD
7050 variable into the message.
7053 .It Ic ~e
7054 Invoke the text editor on the message collected so far.
7055 After the editing session is finished,
7056 the user may continue appending text to the message.
7059 .It Ic ~F Ar messages
7060 Read the named messages into the message being sent, including all
7061 message headers and MIME parts.
7062 If no messages are specified, read in the current message, the
7063 .Dq dot .
7066 .It Ic ~f Ar messages
7067 Read the named messages into the message being sent.
7068 If no messages are specified, read in the current message, the
7069 .Dq dot .
7070 Strips down the list of header fields according to the
7071 .Ql type
7072 white- and blacklist selection of
7073 .Ic headerpick .
7074 For MIME multipart messages,
7075 only the first displayable part is included.
7078 .It Ic ~H
7079 Edit the message header fields
7080 .Ql From: ,
7081 .Ql Reply-To:
7083 .Ql Sender:
7084 by typing each one in turn and allowing the user to edit the field.
7085 The default values for these fields originate from the
7086 .Va from , replyto
7088 .Va sender
7089 variables.
7092 .It Ic ~h
7093 Edit the message header fields
7094 .Ql To: ,
7095 .Ql Cc: ,
7096 .Ql Bcc:
7098 .Ql Subject:
7099 by typing each one in turn and allowing the user to edit the field.
7102 .It Ic ~I Ar variable
7103 Insert the value of the specified variable into the message.
7104 The message remains unaltered if the variable is unset or empty.
7105 \*(OB The escape sequences tabulator
7106 .Ql \et
7107 and newline
7108 .Ql \en
7109 are understood (use the
7110 .Cm wysh
7111 prefix when
7112 .Ic set Ns
7113 ting the variable(s) instead).
7116 .It Ic ~i Ar variable
7117 Identical to
7118 .Ic ~I ,
7119 but adds a newline character at the end of a successful insertion.
7122 .It Ic ~M Ar messages
7123 Read the named messages into the message being sent,
7124 indented by
7125 .Va indentprefix .
7126 If no messages are specified, read the current message, the
7127 .Dq dot .
7130 .It Ic ~m Ar messages
7131 Read the named messages into the message being sent,
7132 indented by
7133 .Va indentprefix .
7134 If no messages are specified, read the current message, the
7135 .Dq dot .
7136 Strips down the list of header fields according to the
7137 .Ql type
7138 white- and blacklist selection of
7139 .Ic headerpick .
7140 For MIME multipart messages,
7141 only the first displayable part is included.
7144 .It Ic ~p
7145 Display the message collected so far,
7146 prefaced by the message header fields
7147 and followed by the attachment list, if any.
7150 .It Ic ~q
7151 Abort the message being sent,
7152 copying it to the file specified by the
7153 .Ev DEAD
7154 variable if
7155 .Va save
7156 is set.
7159 .It Ic ~R Ar filename
7160 Identical to
7161 .Ic ~r ,
7162 but indent each line that has been read by
7163 .Va indentprefix .
7166 .It Ic ~r Ar filename Op Ar HERE-delimiter
7167 Read the named file, object to the usual
7168 .Sx "Filename transformations" ,
7169 into the message; if (the expanded)
7170 .Ar filename
7171 is the hyphen-minus
7172 .Ql -
7173 then standard input is used, e.g., for pasting purposes.
7174 Only in this latter mode
7175 .Ar HERE-delimiter
7176 may be given: if it is data will be read in until the given
7177 .Ar HERE-delimiter
7178 is seen on a line by itself, and encountering EOF is an error; the
7179 .Ar HERE-delimiter
7180 is a required argument in non-interactive mode; if it is single-quote
7181 quoted then the pasted content will not be expanded, \*(ID otherwise
7182 a future version of \*(UA may perform shell-style expansion on the content.
7185 .It Ic ~s Ar string
7186 Cause the named string to become the current subject field.
7187 Newline (NL) and carriage-return (CR) bytes are invalid and will be
7188 normalized to space (SP) characters.
7191 .It Ic ~t Ar name ...
7192 Add the given name(s) to the direct recipient list.
7195 .It Ic ~U Ar messages
7196 Read in the given / current message(s) excluding all headers, indented by
7197 .Va indentprefix .
7200 .It Ic ~u Ar messages
7201 Read in the given / current message(s), excluding all headers.
7204 .It Ic ~v
7205 Invoke an alternate editor (defined by the
7206 .Ev VISUAL
7207 environment variable) on the message collected so far.
7208 Usually, the alternate editor will be a screen editor.
7209 After the editor is quit,
7210 the user may resume appending text to the end of the message.
7213 .It Ic ~w Ar filename
7214 Write the message onto the named file, which is object to the usual
7215 .Sx "Filename transformations" .
7216 If the file exists,
7217 the message is appended to it.
7220 .It Ic ~x
7221 Same as
7222 .Ic ~q ,
7223 except that the message is not saved at all.
7226 .It Ic ~| Ar command
7227 Pipe the message through the specified filter command.
7228 If the command gives no output or terminates abnormally,
7229 retain the original text of the message.
7230 E.g., the command
7231 .Xr fmt 1
7232 is often used as a rejustifying filter.
7236 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7237 Low-level command meant for scripted message access, i.e., for
7238 .Va on-compose-splice
7240 .Va on-compose-splice-shell .
7241 The used protocol is likely subject to changes, and therefore the
7242 mentioned hooks receive the used protocol version as an initial line.
7243 In general the first field of a response line represents a status code
7244 which specifies whether a command was successful or not, whether result
7245 data is to be expected, and if, the format of the result data.
7246 Does not manage the error number
7247 .Va \&!
7248 and the exit status
7249 .Va \&? ,
7250 because errors are reported via the protocol
7251 (hard errors like I/O failures cannot be handled).
7252 This command has read-only access to several virtual pseudo headers in
7253 the \*(UA private namespace, which may not exist (except for the first):
7257 .Bl -tag -compact -width ".It Va BaNg"
7258 .It Ql Mailx-Command:
7259 The name of the command that generates the message, one of
7260 .Ql forward ,
7261 .Ql Lreply ,
7262 .Ql mail ,
7263 .Ql Reply ,
7264 .Ql reply ,
7265 .Ql resend .
7267 .It Ql Mailx-Raw-To:
7268 .It Ql Mailx-Raw-Cc:
7269 .It Ql Mailx-Raw-Bcc:
7270 Represent the frozen initial state of these headers before any
7271 transformation (e.g.,
7272 .Ic alias ,
7273 .Ic alternates ,
7274 .Va recipients-in-cc
7275 etc.) took place.
7277 .It Ql Mailx-Orig-From:
7278 .It Ql Mailx-Orig-To:
7279 .It Ql Mailx-Orig-Cc:
7280 .It Ql Mailx-Orig-Bcc:
7281 The values of said headers of the original message which has been
7282 addressed by any of
7283 .Ic reply , forward , resend .
7287 The status codes are:
7291 .Bl -tag -compact -width ".It Ql 210"
7292 .It Ql 210
7293 Status ok; the remains of the line are the result.
7295 .It Ql 211
7296 Status ok; the rest of the line is optionally used for more status.
7297 What follows are lines of result addresses, terminated by an empty line.
7298 The address lines consist of two fields, the first of which is the
7299 plain address, e.g.,
7300 .Ql bob@exam.ple ,
7301 separated by a single ASCII SP space from the second which contains the
7302 unstripped address, even if that is identical to the first field, e.g.,
7303 .Ql (Lovely) Bob <bob@exam.ple> .
7304 All the input, including the empty line, must be consumed before further
7305 commands can be issued.
7307 .It Ql 212
7308 Status ok; the rest of the line is optionally used for more status.
7309 What follows are lines of furtherly unspecified string content,
7310 terminated by an empty line.
7311 All the input, including the empty line, must be consumed before further
7312 commands can be issued.
7314 .It Ql 500
7315 Syntax error; invalid command.
7317 .It Ql 501
7318 Syntax error in parameters or arguments.
7320 .It Ql 505
7321 Error: an argument fails verification.
7322 For example an invalid address has been specified, or an attempt was
7323 made to modify anything in \*(UA's own namespace.
7325 .It Ql 506
7326 Error: an otherwise valid argument is rendered invalid due to context.
7327 For example, a second address is added to a header which may consist of
7328 a single address only.
7333 If a command indicates failure then the message will have remained
7334 unmodified.
7335 Most commands can fail with
7336 .Ql 500
7337 if required arguments are missing (false command usage).
7338 The following (case-insensitive) commands are supported:
7341 .Bl -hang -width ".It Cm header"
7342 .It Cm header
7343 This command allows listing, inspection, and editing of message headers.
7344 Header name case is not normalized, and case-insensitive comparison
7345 should be used when matching names.
7346 The second argument specifies the subcommand to apply, one of:
7348 .Bl -hang -width ".It Cm remove"
7349 .It Cm list
7350 Without a third argument a list of all yet existing headers is given via
7351 .Ql 210 ;
7352 this command is the default command of
7353 .Cm header
7354 if no second argument has been given.
7355 A third argument restricts output to the given header only, which may
7356 fail with
7357 .Ql 501
7358 if no such field is defined.
7360 .It Cm show
7361 Shows the content of the header given as the third argument.
7362 Dependent on the header type this may respond with
7363 .Ql 211
7365 .Ql 212 ;
7366 any failure results in
7367 .Ql 501 .
7369 .It Cm remove
7370 This will remove all instances of the header given as the third
7371 argument, reporting
7372 .Ql 210
7373 upon success,
7374 .Ql 501
7375 if no such header can be found, and
7376 Ql 505
7377 on \*(UA namespace violations.
7379 .It Cm remove-at
7380 This will remove from the header given as the third argument the
7381 instance at the list position (counting from one!) given with the fourth
7382 argument, reporting
7383 .Ql 210
7384 upon success or
7385 .Ql 505
7386 if the list position argument is not a number or on \*(UA namespace
7387 violations, and
7388 .Ql 501
7389 if no such header instance exists.
7391 .It Cm insert
7392 Create a new or an additional instance of the header given in the third
7393 argument, with the header body content as given in the fourth argument
7394 (the remains of the line).
7395 It may return
7396 .Ql 501
7397 if the third argument specifies a free-form header field name that is
7398 invalid, or if body content extraction fails to succeed,
7399 .Ql 505
7400 if any extracted address does not pass syntax and/or security checks or
7401 on \*(UA namespace violations, and
7402 .Ql 506
7403 to indicate prevention of excessing a single-instance header \(em note that
7404 .Ql Subject:
7405 can be appended to (a space separator will be added automatically first).
7407 .Ql 210
7408 is returned upon success, followed by the name of the header and the list
7409 position of the newly inserted instance.
7410 The list position is always 1 for single-instance header fields.
7411 All free-form header fields are managed in a single list.
7415 .It Cm attachment
7416 This command allows listing, removal and addition of message attachments.
7417 The second argument specifies the subcommand to apply, one of:
7419 .Bl -hang -width ".It Cm remove"
7420 .It Cm list
7421 List all attachments via
7422 .Ql 212 ,
7423 or report
7424 .Ql 501
7425 if no attachments exist.
7426 This command is the default command of
7427 .Cm attachment
7428 if no second argument has been given.
7430 .It Cm remove
7431 This will remove the attachment given as the third argument, and report
7432 .Ql 210
7433 upon success or
7434 .Ql 501
7435 if no such attachment can be found.
7436 If there exists any path component in the given argument, then an exact
7437 match of the path which has been used to create the attachment is used
7438 directly, but if only the basename of that path matches then all
7439 attachments are traversed to find an exact match first, and the removal
7440 occurs afterwards; if multiple basenames match, a
7441 .Ql 506
7442 error occurs.
7443 Message attachments are treated as absolute pathnames.
7445 If no path component exists in the given argument, then all attachments
7446 will be searched for
7447 .Ql filename=
7448 parameter matches as well as for matches of the basename of the path
7449 which has been used when the attachment has been created; multiple
7450 matches result in a
7451 .Ql 506 .
7453 .It Cm remove-at
7454 This will interpret the third argument as a number and remove the
7455 attachment at that list position (counting from one!), reporting
7456 .Ql 210
7457 upon success or
7458 .Ql 505
7459 if the argument is not a number or
7460 .Ql 501
7461 if no such attachment exists.
7463 .It Cm insert
7464 Adds the attachment given as the third argument, specified exactly as
7465 documented for the command line option
7466 .Fl a ,
7467 and supporting the message number extension as documented for
7468 .Ic ~@ .
7469 This reports
7470 .Ql 210
7471 upon success, with the index of the new attachment following,
7472 .Ql 505
7473 if the given file cannot be opened,
7474 .Ql 506
7475 if an on-the-fly performed character set conversion fails, otherwise
7476 .Ql 501
7477 is reported; this is also reported if character set conversion is
7478 requested but not available.
7480 .It Cm attribute
7481 This uses the same search mechanism as described for
7482 .Cm remove
7483 and prints any known attributes of the first found attachment via
7484 .Ql 212
7485 upon success or
7486 .Ql 501
7487 if no such attachment can be found.
7488 The attributes are written as lines of keyword and value tuples, the
7489 keyword being separated from the rest of the line with an ASCII SP space
7490 character.
7492 .It Cm attribute-at
7493 This uses the same search mechanism as described for
7494 .Cm remove-at
7495 and is otherwise identical to
7496 .Cm attribute .
7498 .It Cm attribute-set
7499 This uses the same search mechanism as described for
7500 .Cm remove ,
7501 and will assign the attribute given as the fourth argument, which is
7502 expected to be a value tuple of keyword and other data, separated by
7503 a ASCII SP space or TAB tabulator character.
7504 If the value part is empty, then the given attribute is removed, or
7505 reset to a default value if existence of the attribute is crucial.
7507 It returns via
7508 .Ql 210
7509 upon success, with the index of the found attachment following,
7510 .Ql 505
7511 for message attachments or if the given keyword is invalid, and
7512 .Ql 501
7513 if no such attachment can be found.
7514 The following keywords may be used (case-insensitively):
7516 .Bl -hang -compact -width ".It Ql filename"
7517 .It Ql filename
7518 Sets the filename of the MIME part, i.e., the name that is used for
7519 display and when (suggesting a name for) saving (purposes).
7520 .It Ql content-description
7521 Associate some descriptive information to the attachment's content, used
7522 in favour of the plain filename by some MUAs.
7523 .It Ql content-id
7524 May be used for uniquely identifying MIME entities in several contexts;
7525 this expects a special reference address format as defined in RFC 2045
7526 and generates a
7527 .Ql 505
7528 upon address content verification failure.
7529 .It Ql content-type
7530 Defines the media type/subtype of the part, which is managed
7531 automatically, but can be overwritten.
7532 .It Ql content-disposition
7533 Automatically set to the string
7534 .Ql attachment .
7537 .It Cm attribute-set-at
7538 This uses the same search mechanism as described for
7539 .Cm remove-at
7540 and is otherwise identical to
7541 .Cm attribute-set .
7548 .\" }}}
7551 .\" .Sh INTERNAL VARIABLES {{{
7552 .Sh "INTERNAL VARIABLES"
7554 Internal \*(UA variables are controlled via the
7555 .Ic set
7557 .Ic unset
7558 commands; prefixing a variable name with the string
7559 .Ql no
7560 and calling
7561 .Ic set
7562 has the same effect as using
7563 .Ic unset :
7564 .Ql unset crt
7566 .Ql set nocrt
7567 do the same thing.
7568 Creation or editing of variables can be performed in the
7569 .Ev EDITOR
7570 with the command
7571 .Ic varedit .
7572 .Ic varshow
7573 will give more insight on the given variable(s), and
7574 .Ic set ,
7575 when called without arguments, will show a listing of all variables.
7576 Both commands support a more
7577 .Va verbose
7578 listing mode.
7579 Some well-known variables will also become inherited from the
7580 program
7581 .Sx ENVIRONMENT
7582 implicitly, others can be imported explicitly with the command
7583 .Ic environ
7584 and henceforth share said properties.
7587 Two different kinds of internal variables exist.
7588 There are boolean variables, which can only be in one of the two states
7589 .Dq set
7591 .Dq unset ,
7592 and value variables with a(n optional) string value.
7593 For the latter proper quoting is necessary upon assignment time, the
7594 introduction of the section
7595 .Sx COMMANDS
7596 documents the supported quoting rules.
7598 .Bd -literal -offset indent
7599 ? wysh set one=val\e 1 two="val 2" \e
7600     three='val "3"' four=$'val \e'4\e''; \e
7601     varshow one two three four; \e
7602     unset one two three four
7606 Dependent upon the actual option the string values will be interpreted
7607 as numbers, colour names, normal text etc., but there also exists
7608 a special kind of string value, the
7609 .Dq boolean string ,
7610 which must either be a decimal integer (in which case
7611 .Ql 0
7612 is false and
7613 .Ql 1
7614 and any other value is true) or any of the (case-insensitive) strings
7615 .Ql off ,
7616 .Ql no ,
7617 .Ql n
7619 .Ql false
7620 for a false boolean and
7621 .Ql on ,
7622 .Ql yes ,
7623 .Ql y
7625 .Ql true
7626 for a true boolean; a special kind of boolean string is the
7627 .Dq quadoption ,
7628 which is a boolean string that can optionally be prefixed with the
7629 (case-insensitive) term
7630 .Ql ask- ,
7631 as in
7632 .Ql ask-yes ,
7633 which causes prompting of the user in interactive mode, with the given
7634 boolean as the default value.
7636 .\" .Ss "Initial settings" {{{
7637 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
7638 .Ss "Initial settings"
7640 The standard POSIX 2008/Cor 2-2016 mandates the following initial
7641 variable settings:
7642 .Pf no Va allnet ,
7643 .Pf no Va append ,
7644 .Va asksub ,
7645 .Pf no Va askbcc ,
7646 .Pf no Va autoprint ,
7647 .Pf no Va bang ,
7648 .Pf no Va cmd ,
7649 .Pf no Va crt ,
7650 .Pf no Va debug ,
7651 .Pf no Va dot ,
7652 .Va escape
7653 set to
7654 .Ql ~ ,
7655 .Pf no Va flipr ,
7656 .Pf no Va folder ,
7657 .Va header ,
7658 .Pf no Va hold ,
7659 .Pf no Va ignore ,
7660 .Pf no Va ignoreeof ,
7661 .Pf no Va keep ,
7662 .Pf no Va keepsave ,
7663 .Pf no Va metoo ,
7664 .Pf no Va outfolder ,
7665 .Pf no Va page ,
7666 .Va prompt
7667 set to
7668 .Ql ?\0 ,
7669 .Pf no Va quiet ,
7670 .Pf no Va record ,
7671 .Va save ,
7672 .Pf no Va sendwait ,
7673 .Pf no Va showto ,
7674 .Pf no Va Sign ,
7675 .Pf no Va sign ,
7676 .Va toplines
7677 set to
7678 .Ql 5 .
7681 Notes: \*(UA does not support the
7682 .Pf no Va onehop
7683 variable \(en use command line options or
7684 .Va mta-arguments
7685 to pass options through to a
7686 .Va mta .
7687 And the default global
7688 .Pa \*(UR
7689 file, which is loaded unless the
7690 .Fl \&:
7691 (with according argument) or
7692 .Fl n
7693 command line options have been used, or the
7694 .Ev MAILX_NO_SYSTEM_RC
7695 environment variable is set (see
7696 .Sx "Resource files" )
7697 bends those initial settings a bit, e.g., it sets the variables
7698 .Va hold ,
7699 .Va keepsave
7701 .Va keep ,
7702 to name a few, establishes a default
7703 .Ic headerpick
7704 selection etc., and should thus be taken into account.
7705 .\" }}}
7707 .\" .Ss "Variables" {{{
7708 .Ss "Variables"
7710 .Bl -tag -width ".It Va BaNg"
7713 .It Va \&?
7714 \*(RO The exit status of the last command, or the
7715 .Ic return
7716 value of the macro
7717 .Ic call Ns
7718 ed last.
7719 This status has a meaning in the state machine: in conjunction with
7720 .Va errexit
7721 any non-0 exit status will cause a program exit, and in
7722 .Ev POSIXLY_CORRECT
7723 mode any error while loading (any of the) resource files will have the
7724 same effect.
7725 .Cm ignerr ,
7726 one of the
7727 .Sx "Command modifiers" ,
7728 can be used to instruct the state machine to ignore errors.
7731 .It Va \&!
7732 \*(RO The current error number
7733 .Pf ( Xr errno 3 ) ,
7734 which is set after an error occurred; it is also available via
7735 .Va ^ERR ,
7736 and the error name and documentation string can be queried via
7737 .Va ^ERRNAME
7739 .Va ^ERRDOC .
7740 \*(ID This machinery is new and the error number is only really usable
7741 if a command explicitly states that it manages the variable
7742 .Va \&! ,
7743 for others errno will be used in case of errors, or
7744 .Va ^ERR Ns -INVAL
7745 if that is 0: it thus may or may not reflect the real error.
7746 The error number may be set with the command
7747 .Ic return .
7751 .It Va ^
7752 \*(RO This is a multiplexer variable which performs dynamic expansion of
7753 the requested state or condition, of which there are:
7756 .Bl -tag -compact -width ".It Va BaNg"
7760 .It Va ^ERR , ^ERRDOC , ^ERRNAME
7761 The number, documentation, and name of the current
7762 .Xr errno 3 ,
7763 respectively, which is usually set after an error occurred.
7764 \*(ID This machinery is new and is usually reliable only if a command
7765 explicitly states that it manages the variable
7766 .Va \&! ,
7767 which is effectively identical to
7768 .Va \&\&^ERR .
7769 Each of those variables can be suffixed with a hyphen minus followed by
7770 a name or number, in which case the expansion refers to the given error.
7771 Note this is a direct mapping of (a subset of) the system error values:
7772 .Bd -literal -offset indent
7773 define work {
7774   eval echo \e$1: \e$^ERR-$1: \e$^ERRNAME-$1: \e$^ERRDOC-$1
7775   vput vexpr i + "$1" 1
7776   if [ $i -lt 16 ]
7777     \excall work $i
7778   end
7780 call work 0
7786 .It Va *
7787 \*(RO Expands all positional parameters (see
7788 .Va 1 ) ,
7789 separated by a space character.
7790 \*(ID The special semantics of the equally named special parameter of the
7791 .Xr sh 1
7792 are not yet supported.
7795 .It Va @
7796 \*(RO Expands all positional parameters (see
7797 .Va 1 ) ,
7798 separated by a space character.
7799 If placed in double quotation marks, each positional parameter is
7800 properly quoted to expand to a single parameter again.
7803 .It Va #
7804 \*(RO Expands to the number of positional parameters, i.e., the size of
7805 the positional parameter stack in decimal.
7808 .It Va \&0
7809 \*(RO Inside the scope of a
7810 .Ic define Ns
7811 d and
7812 .Ic call Ns
7813 ed macro this expands to the name of the calling macro, or to the empty
7814 string if the macro is running from top-level.
7815 For the \*(OPal regular expression search and replace operator of
7816 .Ic vexpr
7817 this expands to the entire matching expression.
7818 It represents the program name in global context.
7821 .It Va 1
7822 \*(RO Access of the positional parameter stack.
7823 All further parameters can be accessed with this syntax, too, e.g.,
7824 .Ql 2 ,
7825 .Ql 3
7826 etc.; positional parameters can be shifted off the stack by calling
7827 .Ic shift .
7828 The parameter stack contains, e.g., the arguments of a
7829 .Ic call Ns
7831 .Ic define Ns
7832 d macro, the matching groups of the \*(OPal regular expression search
7833 and replace expression of
7834 .Ic vexpr ,
7835 and can be explicitly created or overwritten with the command
7836 .Ic vpospar .
7839 .It Va account
7840 \*(RO Is set to the active
7841 .Ic account .
7844 .It Va add-file-recipients
7845 \*(BO When file or pipe recipients have been specified,
7846 mention them in the corresponding address fields of the message instead
7847 of silently stripping them from their recipient list.
7848 By default such addressees are not mentioned.
7851 .It Va allnet
7852 \*(BO Causes only the local part to be evaluated
7853 when comparing addresses.
7856 .It Va append
7857 \*(BO Causes messages saved in the
7858 .Mx -sx
7859 .Sx "secondary mailbox"
7860 .Ev MBOX
7861 to be appended to the end rather than prepended.
7862 This should always be set.
7865 .It Va ask
7866 \*(BO Causes \*(UA to prompt for the subject of each message sent.
7867 If the user responds with simply a newline,
7868 no subject field will be sent.
7871 .It Va askatend
7872 \*(BO Causes the prompts for
7873 .Ql Cc:
7875 .Ql Bcc:
7876 lists to appear after the message has been edited.
7879 .It Va askattach
7880 \*(BO If set, \*(UA asks for files to attach at the end of each message,
7881 shall the list be found empty at that time.
7882 An empty line finalizes the list.
7885 .It Va askcc
7886 \*(BO Causes the user to be prompted for carbon copy recipients
7887 (at the end of each message if
7888 .Va askatend
7890 .Va bsdcompat
7891 are set) shall the list be found empty (at that time).
7892 An empty line finalizes the list.
7895 .It Va askbcc
7896 \*(BO Causes the user to be prompted for blind carbon copy
7897 recipients (at the end of each message if
7898 .Va askatend
7900 .Va bsdcompat
7901 are set) shall the list be found empty (at that time).
7902 An empty line finalizes the list.
7905 .It Va asksign
7906 \*(BO\*(OP Causes the user to be prompted if the message is to be
7907 signed at the end of each message.
7909 .Va smime-sign
7910 variable is ignored when this variable is set.
7913 .It Va asksub
7914 \*(BO Alternative name for
7915 .Va ask .
7918 .It Va attrlist
7919 A sequence of characters to display in the
7920 .Ql attribute
7921 column of the
7922 .Va headline
7923 as shown in the display of
7924 .Ic headers ;
7925 each for one type of messages (see
7926 .Sx "Message states" ) ,
7927 with the default being
7928 .Ql NUROSPMFAT+\-$~
7930 .Ql NU\ \ *HMFAT+\-$~
7931 if the
7932 .Va bsdflags
7933 variable is set, in the following order:
7935 .Bl -tag -compact -width ".It Ql _"
7936 .It Ql N
7937 new.
7938 .It Ql U
7939 unread but old.
7940 .It Ql R
7941 new but read.
7942 .It Ql O
7943 read and old.
7944 .It Ql S
7945 saved.
7946 .It Ql P
7947 preserved.
7948 .It Ql M
7949 mboxed.
7950 .It Ql F
7951 flagged.
7952 .It Ql A
7953 answered.
7954 .It Ql T
7955 draft.
7956 .It Ql +
7957 start of a collapsed thread.
7958 .It Ql -
7959 an uncollapsed thread (TODO ignored for now).
7960 .It Ql $
7961 classified as spam.
7962 .It Ql ~
7963 classified as possible spam.
7968 .It Va autobcc
7969 Specifies a list of recipients to which a blind carbon copy of each
7970 outgoing message will be sent automatically.
7973 .It Va autocc
7974 Specifies a list of recipients to which a carbon copy of each outgoing
7975 message will be sent automatically.
7978 .It Va autocollapse
7979 \*(BO Causes threads to be collapsed automatically when threaded mode
7980 is entered (see the
7981 .Ic collapse
7982 command).
7985 .It Va autoprint
7986 \*(BO Enable automatic
7987 .Ic type Ns
7988 ing of a(n existing)
7989 .Dq successive
7990 message after
7991 .Ic delete
7993 .Ic undelete
7994 commands, e.g., the message that becomes the new
7995 .Dq dot
7996 is shown automatically, as via
7997 .Ic dp
7999 .Ic dt .
8002 .It Va autosort
8003 Causes sorted mode (see the
8004 .Ic sort
8005 command) to be entered automatically with the value of this variable as
8006 sorting method when a folder is opened, e.g.,
8007 .Ql set autosort=thread .
8010 .It Va bang
8011 \*(BO Enables the substitution of all not (reverse-solidus) escaped
8012 exclamation mark
8013 .Ql \&!
8014 characters by the contents of the last executed command for the
8015 .Ic \&!
8016 shell escape command and
8017 .Ic ~! ,
8018 one of the compose mode
8019 .Sx "COMMAND ESCAPES" .
8020 If this variable is not set no reverse solidus stripping is performed.
8023 .It Va bind-timeout
8024 \*(OP Terminals generate multi-byte sequences for certain forms of
8025 input, for example for function and other special keys.
8026 Some terminals however do not write these multi-byte sequences as
8027 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
8028 This variable specifies the timeout in milliseconds that the MLE (see
8029 .Sx "On terminal control and line editor" )
8030 waits for more bytes to arrive unless it considers a sequence
8031 .Dq complete .
8032 The default is 200.
8035 .It Va bsdcompat
8036 \*(BO Sets some cosmetical features to traditional BSD style;
8037 has the same affect as setting
8038 .Va askatend
8039 and all other variables prefixed with
8040 .Ql bsd ;
8041 it also changes the behaviour of
8042 .Va emptystart
8043 (which does not exist in BSD).
8046 .It Va bsdflags
8047 \*(BO Changes the letters shown in the first column of a header
8048 summary to traditional BSD style.
8051 .It Va bsdheadline
8052 \*(BO Changes the display of columns in a header summary to traditional
8053 BSD style.
8056 .It Va bsdmsgs
8057 \*(BO Changes some informational messages to traditional BSD style.
8060 .It Va bsdorder
8061 \*(BO Causes the
8062 .Ql Subject:
8063 field to appear immediately after the
8064 .Ql To:
8065 field in message headers and with the
8066 .Ic ~h
8067 .Sx "COMMAND ESCAPES" .
8071 .It Va build-os , build-osenv
8072 \*(RO The operating system \*(UA has been build for, usually taken from
8073 .Xr uname 1
8075 .Ql uname -s
8077 .Ql uname -srm ,
8078 respectively, the former being lowercased.
8081 .It Va charset-7bit
8082 The value that should appear in the
8083 .Ql charset=
8084 parameter of
8085 .Ql Content-Type:
8086 MIME header fields when no character set conversion of the message data
8087 was performed.
8088 This defaults to US-ASCII, and the chosen character set should be
8089 US-ASCII compatible.
8092 .It Va charset-8bit
8093 \*(OP The default 8-bit character set that is used as an implicit last
8094 member of the variable
8095 .Va sendcharsets .
8096 This defaults to UTF-8 if character set conversion capabilities are
8097 available, and to ISO-8859-1 otherwise, in which case the only supported
8098 character set is
8099 .Va ttycharset
8100 and this variable is effectively ignored.
8101 Refer to the section
8102 .Sx "Character sets"
8103 for the complete picture of character set conversion in \*(UA.
8106 .It Va charset-unknown-8bit
8107 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
8108 .Dq upgrade
8109 the content of a mail message by using a character set with the name
8110 .Ql unknown-8bit .
8111 Because of the unclassified nature of this character set \*(UA will not
8112 be capable to convert this character set to any other character set.
8113 If this variable is set any message part which uses the character set
8114 .Ql unknown-8bit
8115 is assumed to really be in the character set given in the value,
8116 otherwise the (final) value of
8117 .Va charset-8bit
8118 is used for this purpose.
8120 This variable will also be taken into account if a MIME type (see
8121 .Sx "The mime.types files" )
8122 of a MIME message part that uses the
8123 .Ql binary
8124 character set is forcefully treated as text.
8127 .It Va cmd
8128 The default value for the
8129 .Ic pipe
8130 command.
8133 .It Va colour-disable
8134 \*(BO\*(OP Forcefully disable usage of colours.
8135 Also see the section
8136 .Sx "Coloured display" .
8139 .It Va colour-pager
8140 \*(BO\*(OP Whether colour shall be used for output that is paged through
8141 .Ev PAGER .
8142 Note that pagers may need special command line options, e.g.,
8143 .Xr less 1
8144 requires the option
8145 .Fl \&\&R
8147 .Xr lv 1
8148 the option
8149 .Fl \&\&c
8150 in order to support colours.
8151 Often doing manual adjustments is unnecessary since \*(UA may perform
8152 adjustments dependent on the value of the environment variable
8153 .Ev PAGER
8154 (see there for more).
8158 .It Va contact-mail , contact-web
8159 \*(RO Addresses for contact per email and web, respectively, e.g., for
8160 bug reports, suggestions, or help regarding \*(UA.
8161 The former can be used directly:
8162 .Ql ? eval mail $contact-mail .
8165 .It Va crt
8166 In a(n interactive) terminal session, then if this valued variable is
8167 set it will be used as a threshold to determine how many lines the given
8168 output has to span before it will be displayed via the configured
8169 .Ev PAGER ;
8170 Usage of the
8171 .Ev PAGER
8172 can be forced by setting this to the value
8173 .Ql 0 ,
8174 setting it without a value will deduce the current height of the
8175 terminal screen to compute the treshold (see
8176 .Ev LINES ,
8177 .Va screen
8179 .Xr stty 1 ) .
8180 \*(ID At the moment this uses the count of lines of the message in wire
8181 format, which, dependent on the
8182 .Va mime-encoding
8183 of the message, is unrelated to the number of display lines.
8184 (The software is old and historically the relation was a given thing.)
8187 .It Va customhdr
8188 Define a set of custom headers to be injected into newly composed or
8189 forwarded messages; it is also possible to create custom headers in
8190 compose mode with
8191 .Ic ~^ ,
8192 which can be automated by setting one of the hooks
8193 .Va on-compose-splice
8195 .Va on-compose-splice-shell .
8196 The value is interpreted as a comma-separated list of custom headers to
8197 be injected, to include commas in the header bodies escape them with
8198 reverse solidus.
8199 \*(ID Overwriting of automatically managed headers is neither supported
8200 nor prevented.
8202 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
8205 .It Va datefield
8206 Controls the appearance of the
8207 .Ql %d
8208 date and time format specification of the
8209 .Va headline
8210 variable, that is used, for example, when viewing the summary of
8211 .Ic headers .
8212 If unset, then the local receiving date is used and displayed
8213 unformatted, otherwise the message sending
8214 .Ql Date: .
8215 It is possible to assign a
8216 .Xr strftime 3
8217 format string and control formatting, but embedding newlines via the
8218 .Ql %n
8219 format is not supported, and will result in display errors.
8220 The default is
8221 .Ql %Y-%m-%d %H:%M ,
8222 and also see
8223 .Va datefield-markout-older .
8226 .It Va datefield-markout-older
8227 Only used in conjunction with
8228 .Va datefield .
8229 Can be used to create a visible distinction of messages dated more than
8230 a day in the future, or older than six months, a concept comparable to the
8231 .Fl \&\&l
8232 option of the POSIX utility
8233 .Xr ls 1 .
8234 If set to the empty string, then the plain month, day and year of the
8235 .Ql Date:
8236 will be displayed, but a
8237 .Xr strftime 3
8238 format string to control formatting can be assigned.
8239 The default is
8240 .Ql %Y-%m-%d .
8243 .It Va debug
8244 \*(BO Enables debug messages and obsoletion warnings, disables the
8245 actual delivery of messages and also implies
8246 .Pf no Va record
8247 as well as
8248 .Pf no Va save .
8251 .It Va disposition-notification-send
8252 \*(BO\*(OP Emit a
8253 .Ql Disposition-Notification-To:
8254 header (RFC 3798) with the message.
8255 This requires the
8256 .Va from
8257 variable to be set.
8258 .\" TODO .It Va disposition-notification-send-HOST
8259 .\"Overrides
8260 .\".Va disposition-notification-send
8261 .\" for SMTP accounts on a specific host.
8262 .\" TODO .It Va disposition-notification-send-USER@HOST
8263 .\"Overrides
8264 .\".Va disposition-notification-send
8265 .\"for a specific account.
8268 .It Va dot
8269 \*(BO When dot is set, a period
8270 .Ql \&.
8271 on a line by itself during message input in (interactive or batch
8272 .Fl # )
8273 compose mode will be treated as end-of-message (in addition to the
8274 normal end-of-file condition).
8275 This behaviour is implied in
8276 .Va posix
8277 mode with a set
8278 .Va ignoreeof .
8281 .It Va dotlock-ignore-error
8282 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as
8283 .Mx -sx
8284 .Sx "primary system mailbox" Ns
8285 es (see, e.g., the notes on
8286 .Sx "Filename transformations" ,
8287 as well as the documentation of
8288 .Ic file )
8289 will be protected with so-called dotlock files\(emthe traditional mail
8290 spool file locking method\(emin addition to system file locking.
8291 Because \*(UA ships with a privilege-separated dotlock creation program
8292 that should always be able to create such a dotlock file there is no
8293 good reason to ignore dotlock file creation errors, and thus these are
8294 fatal unless this variable is set.
8297 .It Va editalong
8298 \*(BO If this variable is set then the editor is started automatically
8299 when a message is composed in interactive mode, as if the
8300 .Ic ~e
8301 .Sx "COMMAND ESCAPES"
8302 had been specified.
8304 .Va editheaders
8305 variable is implied for this automatically spawned editor session.
8308 .It Va editheaders
8309 \*(BO When a message is edited while being composed,
8310 its header is included in the editable text.
8313 .It Va emptystart
8314 \*(BO When entering interactive mode \*(UA normally writes
8315 .Dq \&No mail for user
8316 and exits immediately if a mailbox is empty or does not exist.
8317 If this variable is set \*(UA starts even with an empty or non-existent
8318 mailbox (the latter behaviour furtherly depends upon
8319 .Va bsdcompat ,
8320 though).
8323 .It Va errexit
8324 \*(BO Let each command with a non-0 exit status, including every
8325 .Ic call Ns
8326 ed macro which
8327 .Ic return Ns
8328 s a non-0 status, cause a program exit unless prefixed by
8329 .Cm ignerr
8330 (see
8331 .Sx "Command modifiers" ) .
8332 This also affects
8333 .Sx "COMMAND ESCAPES" ,
8334 but which use a different modifier for ignoring the error.
8335 Please refer to the variable
8336 .Va \&?
8337 for more on this topic.
8340 .It Va escape
8341 The first character of this value defines the escape character for
8342 .Sx "COMMAND ESCAPES"
8343 in compose mode.
8344 The default value is the character tilde
8345 .Ql ~ .
8346 If set to the empty string, command escapes are disabled.
8349 .It Va expandaddr
8350 If not set then file and command pipeline targets are not allowed,
8351 and any such address will be filtered out, giving a warning message.
8352 If set without a value then all possible recipient address
8353 specifications will be accepted \(en see the section
8354 .Sx "On sending mail, and non-interactive mode"
8355 for more on this.
8356 To accept them, but only in interactive mode, or when tilde commands
8357 were enabled explicitly by using one of the command line options
8358 .Fl ~
8360 .Fl # ,
8361 set this to the (case-insensitive) value
8362 .Ql restrict
8363 (it actually acts like
8364 .Ql restrict,-all,+name,+addr ,
8365 so that care for ordering issues must be taken) .
8367 In fact the value is interpreted as a comma-separated list of values.
8368 If it contains
8369 .Ql fail
8370 then the existence of disallowed specifications is treated as a hard
8371 send error instead of only filtering them out.
8372 The remaining values specify whether a specific type of recipient
8373 address specification is allowed (optionally indicated by a plus sign
8374 .Ql +
8375 prefix) or disallowed (prefixed with a hyphen-minus
8376 .Ql - ) .
8377 The value
8378 .Ql all
8379 addresses all possible address specifications,
8380 .Ql file
8381 file targets,
8382 .Ql pipe
8383 command pipeline targets,
8384 .Ql name
8385 plain user names and (MTA) aliases and
8386 .Ql addr
8387 network addresses.
8388 These kind of values are interpreted in the given order, so that
8389 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
8390 will cause hard errors for any non-network address recipient address
8391 unless \*(UA is in interactive mode or has been started with the
8392 .Fl ~
8394 .Fl #
8395 command line option; in the latter case(s) any address may be used, then.
8397 Historically invalid network addressees are silently stripped off.
8398 To change this so that any encountered invalid email address causes
8399 a hard error it must be ensured that
8400 .Ql failinvaddr
8401 is an entry in the above list.
8402 Setting this automatically enables network addressees
8403 (it actually acts like
8404 .Ql failinvaddr,+addr ,
8405 so that care for ordering issues must be taken) .
8408 .It Va expandargv
8409 Unless this variable is set additional
8410 .Va mta
8411 (Mail-Transfer-Agent)
8412 arguments from the command line, as can be given after a
8413 .Fl \&\&-
8414 separator, are ignored due to safety reasons.
8415 However, if set to the special (case-insensitive) value
8416 .Ql fail ,
8417 then the presence of additional MTA arguments is treated as a hard
8418 error that causes \*(UA to exit with failure status.
8419 A lesser strict variant is the otherwise identical
8420 .Ql restrict ,
8421 which does accept such arguments in interactive mode, or if tilde
8422 commands were enabled explicitly by using one of the command line options
8423 .Fl ~
8425 .Fl # .
8428 .It Va features
8429 \*(RO String giving a list of features \*(UA, preceded with a plus sign
8430 .Ql +
8431 if the feature is available, and a hyphen-minus
8432 .Ql -
8433 otherwise.
8434 The output of the command
8435 .Ic version
8436 will include this information in a more pleasant output.
8439 .It Va flipr
8440 \*(BO This setting reverses the meanings of a set of reply commands,
8441 turning the lowercase variants, which by default address all recipients
8442 included in the header of a message
8443 .Pf ( Ic reply , respond , followup )
8444 into the uppercase variants, which by default address the sender only
8445 .Pf ( Ic Reply , Respond , Followup )
8446 and vice versa.
8447 The commands
8448 .Ic replysender , respondsender , followupsender
8449 as well as
8450 .Ic replyall , respondall , followupall
8451 are not affected by the current setting of
8452 .Va flipr .
8455 .It Va folder
8456 The default path under which mailboxes are to be saved:
8457 filenames that begin with the plus sign
8458 .Ql +
8459 will have the plus sign replaced with the value of this variable if set,
8460 otherwise the plus sign will remain unchanged when doing
8461 .Sx "Filename transformations" ;
8462 also see
8463 .Ic file
8464 for more on this topic.
8465 The value supports a subset of transformations itself, and if the
8466 non-empty value does not start with a solidus
8467 .Ql / ,
8468 then the value of
8469 .Ev HOME
8470 will be prefixed automatically.
8471 Once the actual value is evaluated first, the internal variable
8472 .Va folder-resolved
8473 will be updated for caching purposes.
8476 .It Va folder-hook
8477 This variable can be set to the name of a
8478 .Ic define Ns d
8479 macro which will be called whenever a
8480 .Ic file
8481 is opened.
8482 The macro will also be invoked when new mail arrives,
8483 but message lists for commands executed from the macro
8484 only include newly arrived messages then.
8485 .Ic localopts
8486 are activated by default in a folder hook, causing the covered settings
8487 to be reverted once the folder is left again.
8490 .It Va folder-hook-FOLDER
8491 Overrides
8492 .Va folder-hook
8493 for a folder named
8494 .Ql FOLDER .
8495 Unlike other folder specifications, the fully expanded name of a folder,
8496 without metacharacters, is used to avoid ambiguities.
8497 However, if the mailbox resides under
8498 .Va folder
8499 then the usual
8500 .Ql +
8501 specification is tried in addition, e.g., if
8502 .Va \&\&folder
8504 .Dq mail
8505 (and thus relative to the user's home directory) then
8506 .Pa /home/usr1/mail/sent
8507 will be tried as
8508 .Ql folder-hook-/home/usr1/mail/sent
8509 first, but then followed by
8510 .Ql folder-hook-+sent .
8513 .It Va folder-resolved
8514 \*(RO Set to the fully resolved path of
8515 .Va folder
8516 once that evaluation has occurred; rather internal.
8519 .It Va followup-to
8520 \*(BO Controls whether a
8521 .Ql Mail-Followup-To:
8522 header is generated when sending messages to known mailing lists.
8523 Also see
8524 .Va followup-to-honour
8525 and the commands
8526 .Ic mlist , mlsubscribe , reply
8528 .Ic Lreply .
8531 .It Va followup-to-honour
8532 Controls whether a
8533 .Ql Mail-Followup-To:
8534 header is honoured when group-replying to a message via
8535 .Ic reply
8537 .Ic Lreply .
8538 This is a quadoption; if set without a value it defaults to
8539 .Dq yes .
8540 Also see
8541 .Va followup-to
8542 and the commands
8543 .Ic mlist
8545 .Ic mlsubscribe .
8548 .It Va forward-as-attachment
8549 \*(BO Original messages are normally sent as inline text with the
8550 .Ic forward
8551 command,
8552 and only the first part of a multipart message is included.
8553 With this setting enabled messages are sent as unmodified MIME
8554 .Ql message/rfc822
8555 attachments with all of their parts included.
8558 .It Va forward-inject-head
8559 The string to put before the text of a message with the
8560 .Ic forward
8561 command instead of the default
8562 .Dq -------- Original Message -------- .
8563 No heading is put if it is set to the empty string.
8564 This variable is ignored if the
8565 .Va forward-as-attachment
8566 variable is set.
8569 .It Va from
8570 The address (or a list of addresses) to put into the
8571 .Ql From:
8572 field of the message header, quoting RFC 5322:
8573 the author(s) of the message, that is, the mailbox(es) of the person(s)
8574 or system(s) responsible for the writing of the message.
8575 When
8576 .Ic reply Ns
8577 ing to messages these addresses are handled as if they were in the
8578 .Ic alternates
8579 list.
8581 If the machine's hostname is not valid at the Internet (for example at
8582 a dialup machine) then either this variable or
8583 .Va hostname
8584 (\*(IN and with a defined SMTP protocol in
8585 .Va mta
8586 .Va smtp-hostname
8587 adds even more fine-tuning capabilities),
8588 have to be set.
8590 .Va \&\&from
8591 contains more than one address,
8592 setting the
8593 .Va sender
8594 variable is required (according to the standard RFC 5322).
8596 If a file-based MTA is used, then
8597 .Va from
8598 (or, if that contains multiple addresses,
8599 .Va sender )
8600 can nonetheless be enforced to appear as the envelope sender address at
8601 the MTA protocol level (the RFC 5321 reverse-path), either by using the
8602 .Fl r
8603 command line option (with an empty argument; see there for the complete
8604 picture on this topic), or by setting the internal variable
8605 .Va r-option-implicit .
8608 .It Va fullnames
8609 \*(BO When replying to or forwarding a message \*(UA normally removes
8610 the comment and name parts of email addresses.
8611 If this variable is set such stripping is not performed,
8612 and comments, names etc. are retained.
8614 .It Va fwdheading
8615 \*(OB Predecessor of
8616 .Va forward-inject-head .
8619 .It Va header
8620 \*(BO Causes the header summary to be written at startup and after
8621 commands that affect the number of messages or the order of messages in
8622 the current
8623 .Ic folder .
8624 Unless in
8625 .Ev POSIXLY_CORRECT
8626 mode a header summary will also be displayed on folder changes.
8627 The command line option
8628 .Fl N
8629 can be used to set
8630 .Pf no Va header .
8634 .It Va headline
8635 A format string to use for the summary of
8636 .Ic headers ,
8637 similar to the ones used for
8638 .Xr printf 3
8639 formats.
8640 Format specifiers in the given string start with a percent sign
8641 .Ql %
8642 and may be followed by an optional decimal number indicating the field
8643 width \(em if that is negative, the field is to be left-aligned.
8644 Valid format specifiers are:
8647 .Bl -tag -compact -width ".It Ql _%%_"
8648 .It Ql %%
8649 A plain percent sign.
8650 .It Ql %>
8651 .Dq Dotmark :
8652 a space character but for the current message
8653 .Pf ( Dq dot ) ,
8654 for which it expands to
8655 .Ql > .
8656 .It Ql %<
8657 .Dq Dotmark :
8658 a space character but for the current message
8659 .Pf ( Dq dot ) ,
8660 for which it expands to
8661 .Ql < .
8662 .It Ql %$
8663 \*(OP The spam score of the message, as has been classified via the
8664 command
8665 .Ic spamrate .
8666 Shows only a replacement character if there is no spam support.
8667 .It Ql %a
8668 Message attribute character (status flag); the actual content can be
8669 adjusted by setting
8670 .Va attrlist .
8671 .It Ql %d
8672 The date found in the
8673 .Ql From:
8674 header of the message when
8675 .Va datefield
8676 is set (the default), otherwise the date when the message was received.
8677 Formatting can be controlled by assigning a
8678 .Xr strftime 3
8679 format string to
8680 .Va datefield .
8681 .It Ql %e
8682 The indenting level in threaded mode.
8683 .It Ql %f
8684 The address of the message sender.
8685 .It Ql %i
8686 The message thread tree structure.
8687 (Note that this format does not support a field width.)
8688 .It Ql %l
8689 The number of lines of the message, if available.
8690 .It Ql %m
8691 Message number.
8692 .It Ql %o
8693 The number of octets (bytes) in the message, if available.
8694 .It Ql %s
8695 Message subject (if any).
8696 .It Ql %S
8697 Message subject (if any) in double quotes.
8698 .It Ql \&%T
8699 Message recipient flags: is the addressee of the message a known or
8700 subscribed mailing list \(en see
8701 .Ic mlist
8703 .Ic mlsubscribe .
8704 .It Ql %t
8705 The position in threaded/sorted order.
8708 The default is
8709 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
8711 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
8713 .Va bsdcompat
8714 is set.
8715 Also see
8716 .Va attrlist
8718 .Va headline-bidi .
8722 .It Va headline-bidi
8723 Bidirectional text requires special treatment when displaying headers,
8724 because numbers (in dates or for file sizes etc.) will not affect the
8725 current text direction, in effect resulting in ugly line layouts when
8726 arabic or other right-to-left text is to be displayed.
8727 On the other hand only a minority of terminals is capable to correctly
8728 handle direction changes, so that user interaction is necessary for
8729 acceptable results.
8730 Note that extended host system support is required nonetheless, e.g.,
8731 detection of the terminal character set is one precondition;
8732 and this feature only works in an Unicode (i.e., UTF-8) locale.
8734 In general setting this variable will cause \*(UA to encapsulate text
8735 fields that may occur when displaying
8736 .Va headline
8737 (and some other fields, like dynamic expansions in
8738 .Va prompt )
8739 with special Unicode control sequences;
8740 it is possible to fine-tune the terminal support level by assigning
8741 a value:
8742 no value (or any value other than
8743 .Ql 1 ,
8744 .Ql 2
8746 .Ql 3 )
8747 will make \*(UA assume that the terminal is capable to properly deal
8748 with Unicode version 6.3, in which case text is embedded in a pair of
8749 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
8750 characters.
8751 In addition no space on the line is reserved for these characters.
8753 Weaker support is chosen by using the value
8754 .Ql 1
8755 (Unicode 6.3, but reserve the room of two spaces for writing the control
8756 sequences onto the line).
8757 The values
8758 .Ql 2
8760 .Ql 3
8761 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
8762 again reserves room for two spaces in addition.
8765 .It Va history-file
8766 \*(OP If a line editor is available then this can be set to
8767 name the (expandable) path of the location of a permanent history file.
8768 Also see
8769 .Va history-size .
8772 .It Va history-gabby
8773 \*(BO\*(OP Add more entries to the history as is normally done.
8776 .It Va history-gabby-persist
8777 \*(BO\*(OP \*(UA's own MLE will not save the additional
8778 .Va history-gabby
8779 entries in persistent storage unless this variable is set.
8780 On the other hand it will not loose the knowledge of whether
8781 a persistent entry was gabby or not.
8782 Also see
8783 .Va history-file .
8786 .It Va history-size
8787 \*(OP Setting this variable imposes a limit on the number of concurrent
8788 history entries.
8789 If set to the value 0 then no further history entries will be added, and
8790 loading and incorporation of the
8791 .Va history-file
8792 upon program startup can also be suppressed by doing this.
8793 Runtime changes will not be reflected, but will affect the number of
8794 entries saved to permanent storage.
8797 .It Va hold
8798 \*(BO This setting controls whether messages are held in the system
8799 .Va inbox ,
8800 and it is set by default.
8803 .It Va hostname
8804 Use this string as hostname when expanding local addresses instead of
8805 the value obtained from
8806 .Xr uname 3
8808 .Xr getaddrinfo 3 .
8809 It is used, e.g., in
8810 .Ql Message-ID:
8812 .Ql From:
8813 fields, as well as when generating
8814 .Ql Content-ID:
8815 MIME part related unique ID fields.
8816 Setting it to the empty string will cause the normal hostname to be
8817 used, but nonetheless enables creation of said ID fields.
8818 \*(IN in conjunction with the built-in SMTP
8819 .Va mta
8820 .Va smtp-hostname
8821 also influences the results:
8822 one should produce some test messages with the desired combination of
8823 .Va \&\&hostname ,
8824 and/or
8825 .Va from ,
8826 .Va sender
8827 etc. first.
8830 .It Va idna-disable
8831 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
8832 names according to the rules of IDNA (internationalized domain names
8833 for applications).
8834 Since the IDNA code assumes that domain names are specified with the
8835 .Va ttycharset
8836 character set, an UTF-8 locale charset is required to represent all
8837 possible international domain names (before conversion, that is).
8840 .It Va ifs
8841 The input field separator that is used (\*(ID by some functions) to
8842 determine where to split input data.
8844 .Bl -tag -compact -width ".It MMM"
8845 .It 1.
8846 Unsetting is treated as assigning the default value,
8847 .Ql \& \et\en .
8848 .It 2.
8849 If set to the empty value, no field splitting will be performed.
8850 .It 3.
8851 If set to a non-empty value, all whitespace characters are extracted
8852 and assigned to the variable
8853 .Va ifs-ws .
8856 .Bl -tag -compact -width ".It MMM"
8857 .It a.
8858 .Va \&\&ifs-ws
8859 will be ignored at the beginning and end of input.
8860 Diverging from POSIX shells default whitespace is removed in addition,
8861 which is owed to the entirely different line content extraction rules.
8862 .It b.
8863 Each occurrence of a character of
8864 .Va \&\&ifs
8865 will cause field-splitting, any adjacent
8866 .Va \&\&ifs-ws
8867 characters will be skipped.
8871 .It Va ifs-ws
8872 \*(RO Automatically deduced from the whitespace characters in
8873 .Va ifs .
8876 .It Va ignore
8877 \*(BO Ignore interrupt signals from the terminal while entering
8878 messages; instead echo them as
8879 .Ql @
8880 characters and discard the current line.
8883 .It Va ignoreeof
8884 \*(BO Ignore end-of-file conditions
8885 .Pf ( Ql control-D )
8886 in compose mode on message input and in interactive command input.
8887 If set an interactive command input session can only be left by
8888 explicitly using one of the commands
8889 .Ic exit
8891 .Ic quit ,
8892 and message input in compose mode can only be terminated by entering
8893 a period
8894 .Ql \&.
8895 on a line by itself or by using the
8896 .Ic ~.
8897 .Sx "COMMAND ESCAPES" ;
8898 Setting this implies the behaviour that
8899 .Va dot
8900 describes in
8901 .Va posix
8902 mode.
8905 .It Va inbox
8906 If this is set to a non-empty string it will specify the users
8907 .Mx -sx
8908 .Sx "primary system mailbox" ,
8909 overriding
8910 .Ev MAIL
8911 and the system-dependent default, and (thus) be used to replace
8912 .Ql %
8913 when doing
8914 .Sx "Filename transformations" ;
8915 also see
8916 .Ic file
8917 for more on this topic.
8918 The value supports a subset of transformations itself.
8921 .It Va indentprefix
8922 String used by the
8923 .Ic ~m , ~M
8925 .Ic ~R
8926 .Sx "COMMAND ESCAPES"
8927 and by the
8928 .Va quote
8929 option for indenting messages,
8930 in place of the normal tabulator character
8931 .Ql ^I ,
8932 which is the default.
8933 Be sure to quote the value if it contains spaces or tabs.
8936 .It Va keep
8937 \*(BO If set, an empty
8938 .Mx -sx
8939 .Sx "primary system mailbox"
8940 file is not removed.
8941 Note that, in conjunction with
8942 .Ev POSIXLY_CORRECT
8943 any empty file will be removed unless this variable is set.
8944 This may improve the interoperability with other mail user agents
8945 when using a common folder directory, and prevents malicious users
8946 from creating fake mailboxes in a world-writable spool directory.
8947 \*(ID Only local regular (MBOX) files are covered, Maildir or other
8948 mailbox types will never be removed, even if empty.
8951 .It Va keep-content-length
8952 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
8953 be told to keep the
8954 .Ql Content-Length:
8956 .Ql Lines:
8957 header fields that some MUAs generate by setting this variable.
8958 Since \*(UA does neither use nor update these non-standardized header
8959 fields (which in itself shows one of their conceptual problems),
8960 stripping them should increase interoperability in between MUAs that
8961 work with with same mailbox files.
8962 Note that, if this is not set but
8963 .Va writebackedited ,
8964 as below, is, a possibly performed automatic stripping of these header
8965 fields already marks the message as being modified.
8966 \*(ID At some future time \*(UA will be capable to rewrite and apply an
8967 .Va mime-encoding
8968 to modified messages, and then those fields will be stripped silently.
8971 .It Va keepsave
8972 \*(BO When a message is saved it is usually discarded from the
8973 originating folder when \*(UA is quit.
8974 This setting causes all saved message to be retained.
8977 .It Va line-editor-disable
8978 \*(BO Turn off any enhanced line editing capabilities (see
8979 .Sx "On terminal control and line editor"
8980 for more).
8983 .It Va line-editor-no-defaults
8984 \*(BO\*(OP Do not establish any default key binding.
8987 .It Va log-prefix
8988 Error log message prefix string
8989 .Pf ( Ql "\*(uA: " ) .
8992 .It Va mailbox-display
8993 \*(RO The name of the current mailbox
8994 .Pf ( Ic file ) ,
8995 possibly abbreviated for display purposes.
8998 .It Va mailbox-resolved
8999 \*(RO The fully resolved path of the current mailbox.
9002 .It Va mailx-extra-rc
9003 An additional startup file that is loaded as the last of the
9004 .Sx "Resource files" .
9005 Use this file for commands that are not understood by other POSIX
9006 .Xr mailx 1
9007 implementations, i.e., mostly anything which is not covered by
9008 .Sx "Initial settings" .
9011 .It Va markanswered
9012 \*(BO When a message is replied to and this variable is set,
9013 it is marked as having been
9014 .Ic answered .
9015 See the section
9016 .Sx "Message states" .
9019 .It Va mbox-rfc4155
9020 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
9021 POSIX rules for detecting message boundaries (so-called
9022 .Ql From_
9023 lines) due to compatibility reasons, instead of the stricter rules that
9024 have been standardized in RFC 4155.
9025 This behaviour can be switched to the stricter RFC 4155 rules by
9026 setting this variable.
9027 (This is never necessary for any message newly generated by \*(UA,
9028 it only applies to messages generated by buggy or malicious MUAs, or may
9029 occur in old MBOX databases: \*(UA itself will choose a proper
9030 .Va mime-encoding
9031 to avoid false interpretation of
9032 .Ql From_
9033 content lines in the MBOX database.)
9035 This may temporarily be handy when \*(UA complains about invalid
9036 .Ql From_
9037 lines when opening a MBOX: in this case setting this variable and
9038 re-opening the mailbox in question may correct the result.
9039 If so, copying the entire mailbox to some other file, as in
9040 .Ql copy * SOME-FILE ,
9041 will perform proper, all-compatible
9042 .Ql From_
9043 quoting for all detected messages, resulting in a valid MBOX mailbox.
9044 Finally the variable can be unset again:
9045 .Bd -literal -offset indent
9046 define mboxfix {
9047   localopts yes; wysh set mbox-rfc4155;\e
9048     wysh File "${1}"; eval copy * "${2}"
9050 call mboxfix /tmp/bad.mbox /tmp/good.mbox
9054 .It Va memdebug
9055 \*(BO Internal development variable.
9058 .It Va message-id-disable
9059 \*(BO By setting this variable the generation of
9060 .Ql Message-ID:
9061 can be completely suppressed, effectively leaving this task up to the
9062 .Va mta
9063 (Mail-Transfer-Agent) or the SMTP server.
9064 (According to RFC 5321 a SMTP server is not required to add this
9065 field by itself, so it should be ensured that it accepts messages without
9066 .Ql Message-ID . )
9067 This variable also affects automatic generation of
9068 .Va Content-ID:
9069 MIME header fields.
9072 .It Va message-inject-head
9073 A string to put at the beginning of each new message.
9074 The escape sequences tabulator
9075 .Ql \et
9076 and newline
9077 .Ql \en
9078 are understood.
9081 .It Va message-inject-tail
9082 A string to put at the end of each new message.
9083 The escape sequences tabulator
9084 .Ql \et
9085 and newline
9086 .Ql \en
9087 are understood.
9090 .It Va metoo
9091 \*(BO Usually, when an
9092 .Ic alias
9093 expansion contains the sender, the sender is removed from the expansion.
9094 Setting this option suppresses these removals.
9095 Note that a set
9096 .Va metoo
9097 also causes a
9098 .Ql -m
9099 option to be passed through to the
9100 .Va mta
9101 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
9102 this flag, no MTA is known which does not support it (for historical
9103 compatibility).
9106 .It Va mime-allow-text-controls
9107 \*(BO When sending messages, each part of the message is MIME-inspected
9108 in order to classify the
9109 .Ql Content-Type:
9111 .Ql Content-Transfer-Encoding:
9112 (see
9113 .Va mime-encoding )
9114 that is required to send this part over mail transport, i.e.,
9115 a computation rather similar to what the
9116 .Xr file 1
9117 command produces when used with the
9118 .Ql --mime
9119 option.
9121 This classification however treats text files which are encoded in
9122 UTF-16 (seen for HTML files) and similar character sets as binary
9123 octet-streams, forcefully changing any
9124 .Ql text/plain
9126 .Ql text/html
9127 specification to
9128 .Ql application/octet-stream :
9129 If that actually happens a yet unset charset MIME parameter is set to
9130 .Ql binary ,
9131 effectively making it impossible for the receiving MUA to automatically
9132 interpret the contents of the part.
9134 If this variable is set, and the data was unambiguously identified as
9135 text data at first glance (by a
9136 .Ql .txt
9138 .Ql .html
9139 file extension), then the original
9140 .Ql Content-Type:
9141 will not be overwritten.
9144 .It Va mime-alternative-favour-rich
9145 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
9146 HTML) will be preferred in favour of included plain text versions when
9147 displaying messages, provided that a handler exists which produces
9148 output that can be (re)integrated into \*(UA's normal visual display.
9149 (E.g., at the time of this writing some newsletters ship their full
9150 content only in the rich HTML part, whereas the plain text part only
9151 contains topic subjects.)
9154 .It Va mime-counter-evidence
9155 Normally the
9156 .Ql Content-Type:
9157 field is used to decide how to handle MIME parts.
9158 Some MUAs, however, do not use
9159 .Sx "The mime.types files"
9160 (also see
9161 .Sx "HTML mail and MIME attachments" )
9162 or a similar mechanism to correctly classify content, but specify an
9163 unspecific MIME type
9164 .Pf ( Ql application/octet-stream )
9165 even for plain text attachments.
9166 If this variable is set then \*(UA will try to re-classify such MIME
9167 message parts, if possible, for example via a possibly existing
9168 attachment filename.
9169 A non-empty value may also be given, in which case a number is expected,
9170 actually a carrier of bits.
9171 Creating the bit-carrying number is a simple addition:
9172 .Bd -literal -offset indent
9173 ? !echo Value should be set to $((2 + 4 + 8))
9174 Value should be set to 14
9177 .Bl -bullet -compact
9179 If bit two is set (2) then the detected
9180 .Ic mimetype
9181 will be carried along with the message and be used for deciding which
9182 MIME handler is to be used, for example;
9183 when displaying such a MIME part the part-info will indicate the
9184 overridden content-type by showing a plus sign
9185 .Ql + .
9187 If bit three is set (4) then the counter-evidence is always produced
9188 and a positive result will be used as the MIME type, even forcefully
9189 overriding the parts given MIME type.
9191 If bit four is set (8) then as a last resort the actual content of
9192 .Ql application/octet-stream
9193 parts will be inspected, so that data which looks like plain text can be
9194 treated as such.
9198 .It Va mime-encoding
9199 The MIME
9200 .Ql Content-Transfer-Encoding
9201 to use in outgoing text messages and message parts, where applicable.
9202 (7-bit clean text messages are sent as-is, without a transfer encoding.)
9203 Valid values are:
9205 .Bl -tag -compact -width ".It Ql _%%_"
9206 .It Ql 8bit
9207 .Pf (Or\0 Ql 8b . )
9208 8-bit transport effectively causes the raw data be passed through
9209 unchanged, but may cause problems when transferring mail messages over
9210 channels that are not ESMTP (RFC 1869) compliant.
9211 Also, several input data constructs are not allowed by the
9212 specifications and may cause a different transfer-encoding to be used.
9213 .It Ql quoted-printable
9214 .Pf (Or\0 Ql qp . )
9215 Quoted-printable encoding is 7-bit clean and has the property that ASCII
9216 characters are passed through unchanged, so that an english message can
9217 be read as-is; it is also acceptible for other single-byte locales that
9218 share many characters with ASCII, like, e.g., ISO-8859-1.
9219 The encoding will cause a large overhead for messages in other character
9220 sets: e.g., it will require up to twelve (12) bytes to encode a single
9221 UTF-8 character of four (4) bytes.
9222 .It Ql base64
9223 .Pf (Or\0 Ql b64 . )
9224 The default encoding, it is 7-bit clean and will always be used for
9225 binary data.
9226 This encoding has a constant input:output ratio of 3:4, regardless of
9227 the character set of the input data it will encode three bytes of input
9228 to four bytes of output.
9229 This transfer-encoding is not human readable without performing
9230 a decoding step.
9234 .It Va mimetypes-load-control
9235 Can be used to control which of
9236 .Sx "The mime.types files"
9237 are loaded: if the letter
9238 .Ql u
9239 is part of the option value, then the user's personal
9240 .Pa ~/.mime.types
9241 file will be loaded (if it exists); likewise the letter
9242 .Ql s
9243 controls loading of the system wide
9244 .Pa /etc/mime.types ;
9245 directives found in the user file take precedence, letter matching is
9246 case-insensitive.
9247 If this variable is not set \*(UA will try to load both files.
9248 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
9249 but they will be matched last (the order can be listed via
9250 .Ic mimetype ) .
9252 More sources can be specified by using a different syntax: if the
9253 value string contains an equals sign
9254 .Ql =
9255 then it is instead parsed as a comma-separated list of the described
9256 letters plus
9257 .Ql f=FILENAME
9258 pairs; the given filenames will be expanded and loaded, and their
9259 content may use the extended syntax that is described in the section
9260 .Sx "The mime.types files" .
9261 Directives found in such files always take precedence (are prepended to
9262 the MIME type cache).
9266 .It Va mta
9267 To choose an alternate Mail-Transfer-Agent, set this option to either
9268 the full pathname of an executable (optionally prefixed with a
9269 .Ql file://
9270 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
9272 .Dl smtps?://[user[:password]@]server[:port]
9274 (\*(OU:
9275 .Ql [smtp://]server[:port] . )
9276 The default has been chosen at compile time.
9277 All supported data transfers are executed in child processes, which
9278 run asynchronously and without supervision unless either the
9279 .Va sendwait
9280 or the
9281 .Va verbose
9282 variable is set.
9283 If such a child receives a TERM signal, it will abort and
9284 .Va save
9285 the message to
9286 .Ev DEAD ,
9287 if so configured.
9290 For a file-based MTA it may be necessary to set
9291 .Va mta-argv0
9292 in in order to choose the right target of a modern
9293 .Xr mailwrapper 8
9294 environment.
9295 It will be passed command line arguments from several possible sources:
9296 from the variable
9297 .Va mta-arguments
9298 if set, from the command line if given and the variable
9299 .Va expandargv
9300 allows their use.
9301 Argument processing of the MTA will be terminated with a
9302 .Fl \&\&-
9303 separator.
9306 The otherwise occurring implicit usage of the following MTA command
9307 line arguments can be disabled by setting the boolean variable
9308 .Va mta-no-default-arguments
9309 (which will also disable passing
9310 .Fl \&\&-
9311 to the MTA):
9312 .Fl \&\&i
9313 (for not treating a line with only a dot
9314 .Ql \&.
9315 character as the end of input),
9316 .Fl \&\&m
9317 (shall the variable
9318 .Va metoo
9319 be set) and
9320 .Fl \&\&v
9321 (if the
9322 .Va verbose
9323 variable is set); in conjunction with the
9324 .Fl r
9325 command line option \*(UA will also (not) pass
9326 .Fl \&\&f
9327 as well as possibly
9328 .Fl \&\&F .
9331 \*(OPally \*(UA can send mail over SMTP network connections to a single
9332 defined SMTP smart host by specifying a SMTP URL as the value (see
9333 .Sx "On URL syntax and credential lookup" ) .
9334 Note that with some mail providers it may be necessary to set the
9335 .Va smtp-hostname
9336 variable in order to use a specific combination of
9337 .Va from ,
9338 .Va hostname
9340 .Va mta .
9341 \*(UA also supports forwarding of all network traffic over a specified
9342 .Va socks-proxy .
9343 The following SMTP variants may be used:
9345 .Bl -bullet
9347 The plain SMTP protocol (RFC 5321) that normally lives on the
9348 server port 25 and requires setting the
9349 .Va smtp-use-starttls
9350 variable to enter a SSL/TLS encrypted session state.
9351 Assign a value like \*(IN
9352 .Ql smtp://[user[:password]@]server[:port]
9353 (\*(OU
9354 .Ql smtp://server[:port] )
9355 to choose this protocol.
9357 The so-called SMTPS which is supposed to live on server port 465
9358 and is automatically SSL/TLS secured.
9359 Unfortunately it never became a standardized protocol and may thus not
9360 be supported by your hosts network service database
9361 \(en in fact the port number has already been reassigned to other
9362 protocols!
9364 SMTPS is nonetheless a commonly offered protocol and thus can be
9365 chosen by assigning a value like \*(IN
9366 .Ql smtps://[user[:password]@]server[:port]
9367 (\*(OU
9368 .Ql smtps://server[:port] ) ;
9369 due to the mentioned problems it is usually necessary to explicitly
9370 specify the port as
9371 .Ql :465 ,
9372 however.
9374 Finally there is the SUBMISSION protocol (RFC 6409), which usually
9375 lives on server port 587 and is practically identically to the SMTP
9376 protocol from \*(UA's point of view beside that; it requires setting the
9377 .Va smtp-use-starttls
9378 variable to enter a SSL/TLS secured session state.
9379 Assign a value like \*(IN
9380 .Ql submission://[user[:password]@]server[:port]
9381 (\*(OU
9382 .Ql submission://server[:port] ) .
9387 .It Va mta-arguments
9388 Arguments to pass through to a file-based
9389 .Va mta
9390 can be given via this variable, which is parsed according to
9391 .Sx "Shell-style argument quoting"
9392 into an array of arguments, and which will be joined onto MTA options
9393 from other sources, and then passed individually to the MTA:
9394 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
9397 .It Va mta-no-default-arguments
9398 \*(BO Unless this variable is set \*(UA will pass some well known
9399 standard command line options to a file-based
9400 .Va mta
9401 (Mail-Transfer-Agent), see there for more.
9404 .It Va mta-argv0
9405 Many systems use a so-called
9406 .Xr mailwrapper 8
9407 environment to ensure compatibility with
9408 .Xr sendmail 1 .
9409 This works by inspecting the name that was used to invoke the mail
9410 delivery system.
9411 If this variable is set then the mailwrapper (the program that is
9412 actually executed when calling the file-based
9413 .Va mta )
9414 will treat its contents as that name.
9416 .Mx Va netrc-lookup
9417 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
9418 \*(BO\*(IN\*(OP Used to control usage of the users
9419 .Pa .netrc
9420 file for lookup of account credentials, as documented in the section
9421 .Sx "On URL syntax and credential lookup"
9422 and for the command
9423 .Ic netrc ;
9424 the section
9425 .Sx "The .netrc file"
9426 documents the file format.
9427 Also see
9428 .Va netrc-pipe .
9431 .It Va netrc-pipe
9432 \*(IN\*(OP When
9433 .Pa .netrc
9434 is loaded (see
9435 .Ic netrc
9437 .Va netrc-lookup )
9438 then \*(UA will read the output of a shell pipe instead of the users
9439 .Pa .netrc
9440 file if this variable is set (to the desired shell command).
9441 This can be used to, e.g., store
9442 .Pa .netrc
9443 in encrypted form:
9444 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
9447 .It Va newfolders
9448 If this variable has the value
9449 .Ql maildir ,
9450 newly created local folders will be in Maildir instead of MBOX format.
9453 .It Va newmail
9454 Checks for new mail in the current folder each time the prompt is shown.
9455 A Maildir folder must be re-scanned to determine if new mail has arrived.
9456 If this variable is set to the special value
9457 .Ql nopoll
9458 then a Maildir folder will not be rescanned completely, but only
9459 timestamp changes are detected.
9462 .It Va outfolder
9463 \*(BO Causes the filename given in the
9464 .Va record
9465 variable
9466 and the sender-based filenames for the
9467 .Ic Copy
9469 .Ic Save
9470 commands to be interpreted relative to the directory given in the
9471 .Va folder
9472 variable rather than to the current directory,
9473 unless it is set to an absolute pathname.
9476 .It Va on-compose-cleanup
9477 Macro hook which will be called after the message has been sent (or not,
9478 in case of failures), as the very last step before unrolling compose mode
9479 .Ic localopts .
9480 This hook is run even in case of fatal errors, and it is advisable to
9481 perform only absolutely necessary actions, like cleaning up
9482 .Ic alternates ,
9483 for example.
9484 For compose mode hooks that may affect the message content please see
9485 .Va on-compose-enter , on-compose-leave , on-compose-splice .
9486 \*(ID This hook exists only because
9487 .Ic alias , alternates , commandalias , shortcut ,
9488 to name a few, are currently not covered by
9489 .Ic localopts
9490 or a similar mechanism: any changes applied in compose mode will
9491 continue to be in effect thereafter.
9495 .It Va on-compose-enter , on-compose-leave
9496 Macro hooks which will be called before compose mode is entered,
9497 and after composing has been finished (but before the
9498 .Va signature
9499 is injected, etc.), respectively.
9500 .Ic localopts
9501 are enabled for these hooks, causing any setting to be forgotten after
9502 the message has been sent;
9503 .Va on-compose-cleanup
9504 can be used to perform any other necessary cleanup.
9505 The following (read-only) variables will be set temporarily during
9506 execution of the macros to represent the according message headers, or
9507 the empty string for non-existent; they correspond to accoding virtual
9508 temporary message headers that can be accessed via
9509 .Ic ~^ ,
9510 one of the
9511 .Sx "COMMAND ESCAPES" :
9513 .Bl -tag -compact -width ".It Va mailx_subject"
9514 .It Va mailx-command
9515 The command that generates the message.
9516 .It Va mailx-subject
9517 The subject.
9518 .It Va mailx-from
9519 .Va from .
9520 .It Va mailx-sender
9521 .Va sender .
9522 .It Va mailx-to , mailx-cc , mailx-bcc
9523 The list of receiver addresses as a space-separated list.
9524 .It Va mailx-raw-to , mailx-raw-cc , mailx-raw-bcc
9525 The list of receiver addresses before any mangling (due to, e.g.,
9526 .Ic alternates ,
9527 .Ic alias
9528 .Va recipients-in-cc )
9529 as a space-separated list.
9530 .It Va mailx-orig-from
9531 When replying, forwarding or resending, this will be set to the
9532 .Ql From:
9533 of the given message.
9534 .It Va mailx-orig-to , mailx-orig-cc , mailx-orig-bcc
9535 When replying, forwarding or resending, this will be set to the
9536 receivers of the given message.
9542 .It Va on-compose-splice , on-compose-splice-shell
9543 These hooks run once the normal compose mode is finished, but before the
9544 .Va on-compose-leave
9545 macro hook is called, the
9546 .Va signature
9547 is injected etc.
9548 Both hooks will be executed in a subprocess, with their input and output
9549 connected to \*(UA such that they can act as if they would be an
9550 interactive user.
9551 The difference in between them is that the latter is a
9552 .Ev SHELL
9553 command, whereas the former is a normal \*(UA macro, but which is
9554 restricted to a small set of commands (the
9555 .Va verbose
9556 output of, e.g.,
9557 .Ic list
9558 will indicate said capability).
9559 .Ic localopts
9560 are enabled for these hooks (in the parent process), causing any setting
9561 to be forgotten after the message has been sent;
9562 .Va on-compose-cleanup
9563 can be used to perform other cleanup as necessary.
9566 During execution of these hooks \*(UA will temporarily forget whether it
9567 has been started in interactive mode, (a restricted set of)
9568 .Sx "COMMAND ESCAPES"
9569 will always be available, and for guaranteed reproducibilities sake
9570 .Va escape
9572 .Va ifs
9573 will be set to their defaults.
9574 The compose mode command
9575 .Ic ~^
9576 has been especially designed for scriptability (via these hooks).
9577 The first line the hook will read on its standard input is the protocol
9578 version of said command escape, currently
9579 .Dq 0 0 1 :
9580 backward incompatible protocol changes have to be expected.
9583 Care must be taken to avoid deadlocks and other false control flow:
9584 if both involved processes wait for more input to happen at the
9585 same time, or one does not expect more input but the other is stuck
9586 waiting for consumption of its output, etc.
9587 There is no automatic synchronization of the hook: it will not be
9588 stopped automatically just because it, e.g., emits
9589 .Ql ~x .
9590 The hooks will however receive a termination signal if the parent enters
9591 an error condition.
9592 \*(ID Protection against and interaction with signals is not yet given;
9593 it is likely that in the future these scripts will be placed in an
9594 isolated session, which is signalled in its entirety as necessary.
9596 .Bd -literal -offset indent
9597 wysh set on-compose-splice-shell=$'\e
9598   read version;\e
9599   printf "hello $version!  Headers: ";\e
9600   echo \e'~^header list\e';\e
9601   read status result;\e
9602   echo "status=$status result=$result";\e
9603   '
9605 set on-compose-splice=ocsm
9606 define ocsm {
9607   read ver
9608   echo Splice protocol version is $ver
9609   echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
9610   if [ "$es" != 2 ]
9611     echoerr 'Cannot read header list'; echo '~x'; xit
9612   endif
9613   if [ "$hl" @i!% ' cc' ]
9614     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
9615       vput vexpr es substring "${es}" 0 1
9616     if [ "$es" != 2 ]
9617       echoerr 'Cannot insert Cc: header'; echo '~x'
9618     endif
9619   endif
9625 .It Va on-resend-cleanup
9626 \*(ID Identical to
9627 .Va on-compose-cleanup ,
9628 but is only triggered by
9629 .Ic resend .
9632 .It Va on-resend-enter
9633 \*(ID Identical to
9634 .Va on-compose-enter ,
9635 but is only triggered by
9636 .Ic resend .
9639 .It Va page
9640 \*(BO If set, each message feed through the command given for
9641 .Ic pipe
9642 is followed by a formfeed character
9643 .Ql \ef .
9645 .Mx Va password
9646 .It Va password-USER@HOST , password-HOST , password
9647 \*(IN Variable chain that sets a password, which is used in case none has
9648 been given in the protocol and account-specific URL;
9649 as a last resort \*(UA will ask for a password on the user's terminal if
9650 the authentication method requires a password.
9651 Specifying passwords in a startup file is generally a security risk;
9652 the file should be readable by the invoking user only.
9654 .It Va password-USER@HOST
9655 \*(OU (see the chain above for \*(IN)
9656 Set the password for
9657 .Ql USER
9658 when connecting to
9659 .Ql HOST .
9660 If no such variable is defined for a host,
9661 the user will be asked for a password on standard input.
9662 Specifying passwords in a startup file is generally a security risk;
9663 the file should be readable by the invoking user only.
9666 .It Va piperaw
9667 \*(BO Send messages to the
9668 .Ic pipe
9669 command without performing MIME and character set conversions.
9673 .It Va pipe-TYPE/SUBTYPE
9674 When a MIME message part of type
9675 .Ql TYPE/SUBTYPE
9676 (case-insensitive) is displayed or quoted,
9677 its text is filtered through the value of this variable interpreted as
9678 a shell command.
9679 Note that only parts which can be displayed inline as plain text (see
9680 .Cd copiousoutput )
9681 are displayed unless otherwise noted, other MIME parts will only be
9682 considered by and for the command
9683 .Ic mimeview .
9686 The special value commercial at
9687 .Ql @
9688 forces interpretation of the message part as plain text, e.g.,
9689 .Ql set pipe-application/xml=@
9690 will henceforth display XML
9691 .Dq as is .
9692 (The same could also be achieved by adding a MIME type marker with the
9693 .Ic mimetype
9694 command.
9695 And \*(OPally MIME type handlers may be defined via
9696 .Sx "The Mailcap files"
9697 \(em these directives,
9698 .Cd copiousoutput
9699 has already been used, should be referred to for further documentation.
9702 The commercial at
9703 .Ql @
9704 can in fact be used as a trigger character to adjust usage and behaviour
9705 of a following shell command specification more thoroughly by appending
9706 more special characters which refer to further mailcap directives, e.g.,
9707 the following hypothetical command specification could be used:
9709 .Bd -literal -offset indent
9710 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
9714 .Bl -tag -compact -width ".It Ql __"
9715 .It Ql *
9716 The command produces plain text to be integrated in \*(UAs output:
9717 .Cd copiousoutput .
9719 .It Ql #
9720 If set the handler will not be invoked when a message is to be quoted,
9721 but only when it will be displayed:
9722 .Cd x-mailx-noquote .
9724 .It Ql &
9725 Run the command asynchronously, i.e., without blocking \*(UA:
9726 .Cd x-mailx-async .
9728 .It Ql \&!
9729 The command must be run on an interactive terminal, \*(UA will
9730 temporarily release the terminal to it:
9731 .Cd needsterminal .
9733 .It Ql +
9734 Request creation of a zero-sized temporary file, the absolute pathname
9735 of which will be made accessible via the environment variable
9736 .Ev MAILX_FILENAME_TEMPORARY :
9737 .Cd x-mailx-tmpfile .
9738 If given twice then the file will be unlinked automatically by \*(UA
9739 when the command loop is entered again at latest:
9740 .Cd x-mailx-tmpfile-unlink .
9742 .It Ql =
9743 Normally the MIME part content is passed to the handler via standard
9744 input; if this flag is set then the data will instead be written into
9745 .Ev MAILX_FILENAME_TEMPORARY
9746 .Pf ( Cd x-mailx-tmpfile-fill ) ,
9747 the creation of which is implied; note however that in order to cause
9748 deletion of the temporary file you still have to use two plus signs
9749 .Ql ++
9750 explicitly!
9752 .It Ql @
9753 To avoid ambiguities with normal shell command content you can use
9754 another commercial at to forcefully terminate interpretation of
9755 remaining characters.
9756 (Any character not in this list will have the same effect.)
9760 Some information about the MIME part to be displayed is embedded into
9761 the environment of the shell command:
9764 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
9766 .It Ev MAILX_CONTENT
9767 The MIME content-type of the part, if known, the empty string otherwise.
9770 .It Ev MAILX_CONTENT_EVIDENCE
9772 .Va mime-counter-evidence
9773 includes the carry-around-bit (2), then this will be set to the detected
9774 MIME content-type; not only then identical to
9775 .Ev \&\&MAILX_CONTENT
9776 otherwise.
9779 .It Ev MAILX_FILENAME
9780 The filename, if any is set, the empty string otherwise.
9783 .It Ev MAILX_FILENAME_GENERATED
9784 A random string.
9787 .It Ev MAILX_FILENAME_TEMPORARY
9788 If temporary file creation has been requested through the command prefix
9789 this variable will be set and contain the absolute pathname of the
9790 temporary file.
9795 .It Va pipe-EXTENSION
9796 This is identical to
9797 .Va pipe-TYPE/SUBTYPE
9798 except that
9799 .Ql EXTENSION
9800 (normalized to lowercase using character mappings of the ASCII charset)
9801 names a file extension, e.g.,
9802 .Ql xhtml .
9803 Handlers registered using this method take precedence.
9805 .Mx Va pop3-auth
9806 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
9807 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
9808 The only possible value as of now is
9809 .Ql plain ,
9810 which is thus the default.
9813 .Mx Va pop3-bulk-load
9814 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
9815 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
9816 the messages, and only requests the message bodies on user request.
9817 For the POP3 protocol this means that the message headers will be
9818 downloaded twice.
9819 If this variable is set then \*(UA will download only complete messages
9820 from the given POP3 server(s) instead.
9822 .Mx Va pop3-keepalive
9823 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
9824 \*(OP POP3 servers close the connection after a period of inactivity;
9825 the standard requires this to be at least 10 minutes,
9826 but practical experience may vary.
9827 Setting this variable to a numeric value greater than
9828 .Ql 0
9829 causes a
9830 .Ql NOOP
9831 command to be sent each value seconds if no other operation is performed.
9833 .Mx Va pop3-no-apop
9834 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
9835 \*(BO\*(OP Unless this variable is set the
9836 .Ql APOP
9837 authentication method will be used when connecting to a POP3 server that
9838 advertises support.
9839 The advantage of
9840 .Ql APOP
9841 is that the password is not sent in clear text over the wire and that
9842 only a single packet is sent for the user/password tuple.
9843 Note that
9844 .Va pop3-no-apop-HOST
9845 requires \*(IN.
9847 .Mx Va pop3-use-starttls
9848 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
9849 \*(BO\*(OP Causes \*(UA to issue a
9850 .Ql STLS
9851 command to make an unencrypted POP3 session SSL/TLS encrypted.
9852 This functionality is not supported by all servers,
9853 and is not used if the session is already encrypted by the POP3S method.
9854 Note that
9855 .Va pop3-use-starttls-HOST
9856 requires \*(IN.
9860 .It Va posix
9861 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
9862 where that deviates from standardized behaviour.
9863 It will be set implicitly before the
9864 .Sx "Resource files"
9865 are loaded if the environment variable
9866 .Ev POSIXLY_CORRECT
9867 is set, and adjusting any of those two will be reflected by the other
9868 one implicitly.
9869 The following behaviour is covered and enforced by this mechanism:
9872 .Bl -bullet -compact
9874 In non-interactive mode, any error encountered while loading resource
9875 files during program startup will cause a program exit, whereas in
9876 interactive mode such errors will stop loading of the currently loaded
9877 (stack of) file(s, i.e., recursively).
9878 These exits can be circumvented on a per-command base by using
9879 .Cm ignerr ,
9880 one of the
9881 .Sx "Command modifiers" ,
9882 for each command which shall be allowed to fail.
9885 .Ic alternates
9886 will replace the list of alternate addresses instead of appending to it.
9889 Upon changing the active
9890 .Ic file
9891 no summary of
9892 .Ic headers
9893 will be displayed even if
9894 .Va header
9895 is set.
9898 Setting
9899 .Va ignoreeof
9900 implies the behaviour described by
9901 .Va dot .
9904 The variable
9905 .Va keep
9906 is extended to cover any empty mailbox, not only empty
9907 .Mx -sx
9908 .Sx "primary system mailbox" Ns
9909 es: they will be removed when they are left in empty state otherwise.
9914 .It Va print-alternatives
9915 \*(BO When a MIME message part of type
9916 .Ql multipart/alternative
9917 is displayed and it contains a subpart of type
9918 .Ql text/plain ,
9919 other parts are normally discarded.
9920 Setting this variable causes all subparts to be displayed,
9921 just as if the surrounding part was of type
9922 .Ql multipart/mixed .
9925 .It Va prompt
9926 The string used as a prompt in interactive mode.
9927 Whenever the variable is evaluated the value is expanded as via
9928 dollar-single-quote expansion (see
9929 .Sx "Shell-style argument quoting" ) .
9930 This (post-assignment, i.e., second) expansion can be used to embed
9931 status information, for example
9932 .Va \&? ,
9933 .Va \&! ,
9934 .Va account
9936 .Va mailbox-display .
9938 In order to embed characters which should not be counted when
9939 calculating the visual width of the resulting string, enclose the
9940 characters of interest in a pair of reverse solidus escaped brackets:
9941 .Ql \e[\eE[0m\e] ;
9942 a slot for coloured prompts is also available with the \*(OPal command
9943 .Ic colour .
9944 Prompting may be prevented by setting this to the null string
9945 (a.k.a.\|
9946 .Ql set noprompt ) .
9949 .It Va prompt2
9950 This string is used for secondary prompts, but is otherwise identical to
9951 .Va prompt .
9952 The default is
9953 .Ql ..\0 .
9956 .It Va quiet
9957 \*(BO Suppresses the printing of the version when first invoked.
9960 .It Va quote
9961 If set, \*(UA starts a replying message with the original message
9962 prefixed by the value of the variable
9963 .Va indentprefix .
9964 Normally, a heading consisting of
9965 .Dq Fromheaderfield wrote:
9966 is put before the quotation.
9967 If the string
9968 .Ql noheading
9969 is assigned to the
9970 .Va \&\&quote
9971 variable, this heading is omitted.
9972 If the string
9973 .Ql headers
9974 is assigned, only the headers selected by the
9975 .Ql type
9976 .Ic headerpick
9977 selection are put above the message body,
9978 thus
9979 .Va \&\&quote
9980 acts like an automatic
9981 .Pf ` Ic ~m Ns '
9982 .Sx "COMMAND ESCAPES"
9983 command, then.
9984 If the string
9985 .Ql allheaders
9986 is assigned, all headers are put above the message body and all MIME
9987 parts are included, making
9988 .Va \&\&quote
9989 act like an automatic
9990 .Pf ` Ic ~M Ns '
9991 command; also see
9992 .Va quote-as-attachment .
9995 .It Va quote-as-attachment
9996 \*(BO Add the original message in its entirety as a
9997 .Ql message/rfc822
9998 MIME attachment when replying to a message.
9999 Note this works regardless of the setting of
10000 .Va quote .
10003 .It Va quote-fold
10004 \*(OP Can be set in addition to
10005 .Va indentprefix .
10006 Setting this turns on a more fancy quotation algorithm in that leading
10007 quotation characters are compressed and overlong lines are folded.
10008 .Va \&\&quote-fold
10009 can be set to either one or two (space separated) numeric values,
10010 which are interpreted as the maximum (goal) and the minimum line length,
10011 respectively, in a spirit rather equal to the
10012 .Xr fmt 1
10013 program, but line-, not paragraph-based.
10014 If not set explicitly the minimum will reflect the goal algorithmically.
10015 The goal cannot be smaller than the length of
10016 .Va indentprefix
10017 plus some additional pad.
10018 Necessary adjustments take place silently.
10021 .It Va r-option-implicit
10022 \*(BO Setting this option evaluates the contents of
10023 .Va from
10024 (or, if that contains multiple addresses,
10025 .Va sender )
10026 and passes the results onto the used (file-based) MTA as described for the
10027 .Fl r
10028 option (empty argument case).
10031 .It Va recipients-in-cc
10032 \*(BO When doing a
10033 .Ic reply ,
10034 the original
10035 .Ql From:
10037 .Ql To:
10038 are by default merged into the new
10039 .Ql To: .
10040 If this variable is set, only the original
10041 .Ql From:
10042 ends in the new
10043 .Ql To: ,
10044 the rest is merged into
10045 .Ql Cc: .
10048 .It Va record
10049 Unless this variable is defined, no copies of outgoing mail will be saved.
10050 If defined it gives the pathname, subject to the usual
10051 .Sx "Filename transformations" ,
10052 of a folder where all new, replied-to or forwarded messages are saved:
10053 when saving to this folder fails the message is not sent, but instead
10054 .Va save Ns
10055 d to
10056 .Ev DEAD .
10057 The standard defines that relative (fully expanded) paths are to be
10058 interpreted relative to the current directory
10059 .Pf ( Ic cwd ) ,
10060 to force interpretation relative to
10061 .Va folder
10062 .Va outfolder
10063 needs to be set in addition.
10066 .It Va record-files
10067 \*(BO If this variable is set the meaning of
10068 .Va record
10069 will be extended to cover messages which target only file and pipe
10070 recipients (see
10071 .Va expandaddr ) .
10072 These address types will not appear in recipient lists unless
10073 .Va add-file-recipients
10074 is also set.
10077 .It Va record-resent
10078 \*(BO If this variable is set the meaning of
10079 .Va record
10080 will be extended to also cover the
10081 .Ic resend
10083 .Ic Resend
10084 commands.
10087 .It Va reply-in-same-charset
10088 \*(BO If this variable is set \*(UA first tries to use the same
10089 character set of the original message for replies.
10090 If this fails, the mechanism described in
10091 .Sx "Character sets"
10092 is evaluated as usual.
10095 .It Va reply-strings
10096 Can be set to a comma-separated list of (case-insensitive according to
10097 ASCII rules) strings which shall be recognized in addition to the
10098 built-in strings as
10099 .Ql Subject:
10100 reply message indicators \(en built-in are
10101 .Ql Re: ,
10102 which is mandated by RFC 5322, as well as the german
10103 .Ql Aw: ,
10104 .Ql Antw: ,
10105 and the
10106 .Ql Wg:
10107 which often has been seen in the wild;
10108 I.e., the separating colon has to be specified explicitly.
10111 .It Va replyto
10112 A list of addresses to put into the
10113 .Ql Reply-To:
10114 field of the message header.
10115 Members of this list are handled as if they were in the
10116 .Ic alternates
10117 list.
10120 .It Va reply-to-honour
10121 Controls whether a
10122 .Ql Reply-To:
10123 header is honoured when replying to a message via
10124 .Ic reply
10126 .Ic Lreply .
10127 This is a quadoption; if set without a value it defaults to
10128 .Dq yes .
10131 .It Va rfc822-body-from_
10132 \*(BO This variable can be used to force displaying a so-called
10133 .Ql From_
10134 line for messages that are embedded into an envelope mail via the
10135 .Ql message/rfc822
10136 MIME mechanism, for more visual convenience.
10139 .It Va save
10140 \*(BO Enable saving of (partial) messages in
10141 .Ev DEAD
10142 upon interrupt or delivery error.
10145 .It Va screen
10146 The number of lines that represents a
10147 .Dq screenful
10148 of lines, used in
10149 .Ic headers
10150 summary display,
10151 .Ic from
10152 .Ic search Ns
10153 ing, message
10154 .Ic top Ns
10155 line display and scrolling via
10156 .Ic z .
10157 If this variable is not set \*(UA falls back to a calculation based upon
10158 the detected terminal window size and the baud rate: the faster the
10159 terminal, the more will be shown.
10160 Overall screen dimensions and pager usage is influenced by the
10161 environment variables
10162 .Ev COLUMNS
10164 .Ev LINES
10165 and the variable
10166 .Va crt .
10169 .It Va searchheaders
10170 \*(BO Expand message-list specifiers in the form
10171 .Ql /x:y
10172 to all messages containing the substring
10173 .Dq y
10174 in the header field
10175 .Ql x .
10176 The string search is case insensitive.
10179 .It Va sendcharsets
10180 \*(OP A comma-separated list of character set names that can be used in
10181 outgoing internet mail.
10182 The value of the variable
10183 .Va charset-8bit
10184 is automatically appended to this list of character sets.
10185 If no character set conversion capabilities are compiled into \*(UA then
10186 the only supported charset is
10187 .Va ttycharset .
10188 Also see
10189 .Va sendcharsets-else-ttycharset
10190 and refer to the section
10191 .Sx "Character sets"
10192 for the complete picture of character set conversion in \*(UA.
10195 .It Va sendcharsets-else-ttycharset
10196 \*(BO\*(OP If this variable is set, but
10197 .Va sendcharsets
10198 is not, then \*(UA acts as if
10199 .Va sendcharsets
10200 had been set to the value of the variable
10201 .Va ttycharset .
10202 In effect this combination passes through the message data in the
10203 character set of the current locale encoding:
10204 therefore mail message text will be (assumed to be) in ISO-8859-1
10205 encoding when send from within a ISO-8859-1 locale, and in UTF-8
10206 encoding when send from within an UTF-8 locale.
10208 The 8-bit fallback
10209 .Va charset-8bit
10210 never comes into play as
10211 .Va ttycharset
10212 is implicitly assumed to be 8-bit and capable to represent all files the
10213 user may specify (as is the case when no character set conversion
10214 support is available in \*(UA and the only supported character set is
10215 .Va ttycharset :
10216 .Sx "Character sets" ) .
10217 This might be a problem for scripts which use the suggested
10218 .Ql LC_ALL=C
10219 setting, since in this case the character set is US-ASCII by definition,
10220 so that it is better to also override
10221 .Va ttycharset ,
10222 then.
10225 .It Va sender
10226 An address that is put into the
10227 .Ql Sender:
10228 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
10229 responsible for the actual transmission of the message.
10230 This field should normally not be used unless the
10231 .Va from
10232 field contains more than one address, on which case it is required.
10234 .Va \&\&sender
10235 address is handled as if it were in the
10236 .Ic alternates
10237 list; also see
10238 .Fl r ,
10239 .Va r-option-implicit .
10241 .It Va sendmail
10242 \*(OB Predecessor of
10243 .Va mta .
10245 .It Va sendmail-arguments
10246 \*(OB Predecessor of
10247 .Va mta-arguments .
10249 .It Va sendmail-no-default-arguments
10250 \*(OB\*(BO Predecessor of
10251 .Va mta-no-default-arguments .
10253 .It Va sendmail-progname
10254 \*(OB Predecessor of
10255 .Va mta-argv0 .
10258 .It Va sendwait
10259 \*(BO When sending a message wait until the
10260 .Va mta
10261 (including the built-in SMTP one) exits before accepting further commands.
10262 .Sy Only
10263 with this variable set errors reported by the MTA will be recognizable!
10264 If the MTA returns a non-zero exit status,
10265 the exit status of \*(UA will also be non-zero.
10268 .It Va showlast
10269 \*(BO This setting causes \*(UA to start at the last message
10270 instead of the first one when opening a mail folder.
10273 .It Va showname
10274 \*(BO Causes \*(UA to use the sender's real name instead of the plain
10275 address in the header field summary and in message specifications.
10278 .It Va showto
10279 \*(BO Causes the recipient of the message to be shown in the header
10280 summary if the message was sent by the user.
10283 .It Va Sign
10284 The string to expand
10285 .Ic ~A
10286 to (see
10287 .Sx "COMMAND ESCAPES" ) .
10290 .It Va sign
10291 The string to expand
10292 .Ic ~a
10293 to (see
10294 .Sx "COMMAND ESCAPES" ) .
10297 .It Va signature
10298 Must correspond to the name of a readable file if set.
10299 The file's content is then appended to each singlepart message
10300 and to the first part of each multipart message.
10301 Be warned that there is no possibility to edit the signature for an
10302 individual message.
10305 .It Va skipemptybody
10306 \*(BO If an outgoing message does not contain any text in its first or
10307 only message part, do not send it but discard it silently (see also the
10308 command line option
10309 .Fl E ) .
10313 .It Va smime-ca-dir , smime-ca-file
10314 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10315 Enhanced Mail) format as a directory and a file, respectively, for the
10316 purpose of verification of S/MIME signed messages.
10317 It is possible to set both, the file will be loaded immediately, the
10318 directory will be searched whenever no match has yet been found.
10319 The set of CA certificates which are built into the SSL/TLS library can
10320 be explicitly turned off by setting
10321 .Va smime-ca-no-defaults ,
10322 and further fine-tuning is possible via
10323 .Va smime-ca-flags .
10326 .It Va smime-ca-flags
10327 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10328 storage, and the certificate verification that is used.
10329 The actual values and their meanings are documented for
10330 .Va ssl-ca-flags .
10333 .It Va smime-ca-no-defaults
10334 \*(BO\*(OP Do not load the default CA locations that are built into the
10335 used to SSL/TLS library to verify S/MIME signed messages.
10337 .Mx Va smime-cipher
10338 .It Va smime-cipher-USER@HOST , smime-cipher
10339 \*(OP Specifies the cipher to use when generating S/MIME encrypted
10340 messages (for the specified account).
10341 RFC 5751 mandates a default of
10342 .Ql aes128
10343 (AES-128 CBC).
10344 Possible values are (case-insensitive and) in decreasing cipher strength:
10345 .Ql aes256
10346 (AES-256 CBC),
10347 .Ql aes192
10348 (AES-192 CBC),
10349 .Ql aes128
10350 (AES-128 CBC),
10351 .Ql des3
10352 (DES EDE3 CBC, 168 bits; default if
10353 .Ql aes128
10354 is not available) and
10355 .Ql des
10356 (DES CBC, 56 bits).
10358 The actually available cipher algorithms depend on the cryptographic
10359 library that \*(UA uses.
10360 \*(OP Support for more cipher algorithms may be available through
10361 dynamic loading via, e.g.,
10362 .Xr EVP_get_cipherbyname 3
10363 (OpenSSL) if \*(UA has been compiled to support this.
10366 .It Va smime-crl-dir
10367 \*(OP Specifies a directory that contains files with CRLs in PEM format
10368 to use when verifying S/MIME messages.
10371 .It Va smime-crl-file
10372 \*(OP Specifies a file that contains a CRL in PEM format to use when
10373 verifying S/MIME messages.
10376 .It Va smime-encrypt-USER@HOST
10377 \*(OP If this variable is set, messages send to the given receiver are
10378 encrypted before sending.
10379 The value of the variable must be set to the name of a file that
10380 contains a certificate in PEM format.
10382 If a message is sent to multiple recipients,
10383 each of them for whom a corresponding variable is set will receive an
10384 individually encrypted message;
10385 other recipients will continue to receive the message in plain text
10386 unless the
10387 .Va smime-force-encryption
10388 variable is set.
10389 It is recommended to sign encrypted messages, i.e., to also set the
10390 .Va smime-sign
10391 variable.
10394 .It Va smime-force-encryption
10395 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
10398 .It Va smime-sign
10399 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
10400 and include the user's certificate as a MIME attachment.
10401 Signing a message enables a recipient to verify that the sender used
10402 a valid certificate,
10403 that the email addresses in the certificate match those in the message
10404 header and that the message content has not been altered.
10405 It does not change the message text,
10406 and people will be able to read the message as usual.
10407 Also see
10408 .Va smime-sign-cert , smime-sign-include-certs
10410 .Va smime-sign-message-digest .
10412 .Mx Va smime-sign-cert
10413 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
10414 \*(OP Points to a file in PEM format.
10415 For the purpose of signing and decryption this file needs to contain the
10416 user's private key, followed by his certificate.
10418 For message signing
10419 .Ql USER@HOST
10420 is always derived from the value of
10421 .Va from
10422 (or, if that contains multiple addresses,
10423 .Va sender ) .
10424 For the purpose of encryption the recipient's public encryption key
10425 (certificate) is expected; the command
10426 .Ic certsave
10427 can be used to save certificates of signed messages (the section
10428 .Sx "Signed and encrypted messages with S/MIME"
10429 gives some details).
10430 This mode of operation is usually driven by the specialized form.
10432 When decrypting messages the account is derived from the recipient
10433 fields
10434 .Pf ( Ql To:
10436 .Ql Cc: )
10437 of the message, which are searched for addresses for which such
10438 a variable is set.
10439 \*(UA always uses the first address that matches,
10440 so if the same message is sent to more than one of the user's addresses
10441 using different encryption keys, decryption might fail.
10443 For signing and decryption purposes it is possible to use encrypted
10444 keys, and the pseudo-host(s)
10445 .Ql USER@HOST.smime-cert-key
10446 for the private key
10447 (and
10448 .Ql USER@HOST.smime-cert-cert
10449 for the certificate stored in the same file)
10450 will be used for performing any necessary password lookup,
10451 therefore the lookup can be automatized via the mechanisms described in
10452 .Sx "On URL syntax and credential lookup" .
10453 For example, the hypothetical address
10454 .Ql bob@exam.ple
10455 could be driven with a private key / certificate pair path defined in
10456 .Va \&\&smime-sign-cert-bob@exam.ple ,
10457 and needed passwords would then be looked up via the pseudo hosts
10458 .Ql bob@exam.ple.smime-cert-key
10459 (and
10460 .Ql bob@exam.ple.smime-cert-cert ) .
10461 To include intermediate certificates, use
10462 .Va smime-sign-include-certs .
10464 .Mx Va smime-sign-include-certs
10465 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
10466 \*(OP If used, this is supposed to a consist of a comma-separated list
10467 of files, each of which containing a single certificate in PEM format to
10468 be included in the S/MIME message in addition to the
10469 .Va smime-sign-cert
10470 certificate.
10471 This can be used to include intermediate certificates of the certificate
10472 authority, in order to allow the receiver's S/MIME implementation to
10473 perform a verification of the entire certificate chain, starting from
10474 a local root certificate, over the intermediate certificates, down to the
10475 .Va smime-sign-cert .
10476 Even though top level certificates may also be included in the chain,
10477 they won't be used for the verification on the receiver's side.
10479 For the purpose of the mechanisms involved here,
10480 .Ql USER@HOST
10481 refers to the content of the internal variable
10482 .Va from
10483 (or, if that contains multiple addresses,
10484 .Va sender ) .
10485 The pseudo-host
10486 .Ql USER@HOST.smime-include-certs
10487 will be used for performing password lookups for these certificates,
10488 shall they have been given one, therefore the lookup can be automatized
10489 via the mechanisms described in
10490 .Sx "On URL syntax and credential lookup" .
10492 .Mx Va smime-sign-message-digest
10493 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
10494 \*(OP Specifies the message digest to use when signing S/MIME messages.
10495 RFC 5751 mandates a default of
10496 .Ql sha1 .
10497 Possible values are (case-insensitive and) in decreasing cipher strength:
10498 .Ql sha512 ,
10499 .Ql sha384 ,
10500 .Ql sha256 ,
10501 .Ql sha224
10503 .Ql md5 .
10505 The actually available message digest algorithms depend on the
10506 cryptographic library that \*(UA uses.
10507 \*(OP Support for more message digest algorithms may be available
10508 through dynamic loading via, e.g.,
10509 .Xr EVP_get_digestbyname 3
10510 (OpenSSL) if \*(UA has been compiled to support this.
10511 Remember that for this
10512 .Ql USER@HOST
10513 refers to the variable
10514 .Va from
10515 (or, if that contains multiple addresses,
10516 .Va sender ) .
10518 .It Va smtp
10519 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
10520 .Va mta .
10521 \*(ID For compatibility reasons a set
10522 .Va smtp
10523 is used in preference of
10524 .Va mta .
10526 .Mx Va smtp-auth
10527 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
10528 \*(OP Variable chain that controls the SMTP
10529 .Va mta
10530 authentication method, possible values are
10531 .Ql none
10532 (\*(OU default),
10533 .Ql plain
10534 (\*(IN default),
10535 .Ql login
10536 as well as the \*(OPal methods
10537 .Ql cram-md5
10539 .Ql gssapi .
10541 .Ql none
10542 method does not need any user credentials,
10543 .Ql gssapi
10544 requires a user name and all other methods require a user name and
10545 a password.
10546 See \*(IN
10547 .Va mta ,
10548 .Va user
10550 .Va password
10551 (\*(OU
10552 .Va smtp-auth-password
10554 .Va smtp-auth-user ) .
10555 Note that
10556 .Va smtp-auth-HOST
10557 is \*(IN.
10558 \*(OU: Note for
10559 .Va smtp-auth-USER@HOST :
10560 may override dependent on sender address in the variable
10561 .Va from .
10563 .It Va smtp-auth-password
10564 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
10565 If the authentication method requires a password, but neither
10566 .Va smtp-auth-password
10567 nor a matching
10568 .Va smtp-auth-password-USER@HOST
10569 can be found,
10570 \*(UA will ask for a password on the user's terminal.
10572 .It Va smtp-auth-password-USER@HOST
10573 \*(OU Overrides
10574 .Va smtp-auth-password
10575 for specific values of sender addresses, dependent upon the variable
10576 .Va from .
10578 .It Va smtp-auth-user
10579 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
10580 If the authentication method requires a user name, but neither
10581 .Va smtp-auth-user
10582 nor a matching
10583 .Va smtp-auth-user-USER@HOST
10584 can be found,
10585 \*(UA will ask for a user name on the user's terminal.
10587 .It Va smtp-auth-user-USER@HOST
10588 \*(OU Overrides
10589 .Va smtp-auth-user
10590 for specific values of sender addresses, dependent upon the variable
10591 .Va from .
10594 .It Va smtp-hostname
10595 \*(OP\*(IN Normally \*(UA uses the variable
10596 .Va from
10597 to derive the necessary
10598 .Ql USER@HOST
10599 information in order to issue a
10600 .Ql MAIL FROM:<>
10601 SMTP
10602 .Va mta
10603 command.
10604 Setting
10605 .Va smtp-hostname
10606 can be used to use the
10607 .Ql USER
10608 from the SMTP account
10609 .Pf ( Va mta
10610 or the
10611 .Va user
10612 variable chain)
10613 and the
10614 .Ql HOST
10615 from the content of this variable (or, if that is the empty string,
10616 .Va hostname
10617 or the local hostname as a last resort).
10618 This often allows using an address that is itself valid but hosted by
10619 a provider other than which (in
10620 .Va from )
10621 is about to send the message.
10622 Setting this variable also influences generated
10623 .Ql Message-ID:
10625 .Ql Content-ID:
10626 header fields.
10628 .Mx Va smtp-use-starttls
10629 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
10630 \*(BO\*(OP Causes \*(UA to issue a
10631 .Ql STARTTLS
10632 command to make an SMTP
10633 .Va mta
10634 session SSL/TLS encrypted, i.e., to enable transport layer security.
10636 .Mx Va socks-proxy
10637 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
10638 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
10639 \*(UA will proxy all of its network activities through it.
10640 This can be used to proxy SMTP, POP3 etc. network traffic through the
10641 Tor anonymizer, for example.
10642 The following would create a local SOCKS proxy on port 10000 that
10643 forwards to the machine
10644 .Ql HOST ,
10645 and from which the network traffic is actually instantiated:
10646 .Bd -literal -offset indent
10647 # Create local proxy server in terminal 1 forwarding to HOST
10648 $ ssh -D 10000 USER@HOST
10649 # Then, start a client that uses it in terminal 2
10650 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
10654 .It Va spam-interface
10655 \*(OP In order to use any of the spam-related commands (like, e.g.,
10656 .Ic spamrate )
10657 the desired spam interface must be defined by setting this variable.
10658 Please refer to the manual section
10659 .Sx "Handling spam"
10660 for the complete picture of spam handling in \*(UA.
10661 All or none of the following interfaces may be available:
10663 .Bl -tag -width ".It Ql _ilte_"
10664 .It Ql spamc
10665 Interaction with
10666 .Xr spamc 1
10667 from the
10668 .Xr spamassassin 1
10669 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
10670 suite.
10671 Different to the generic filter interface \*(UA will automatically add
10672 the correct arguments for a given command and has the necessary
10673 knowledge to parse the program's output.
10674 A default value for
10675 .Va spamc-command
10676 will have been compiled into the \*(UA binary if
10677 .Xr spamc 1
10678 has been found in
10679 .Ev PATH
10680 during compilation.
10681 Shall it be necessary to define a specific connection type (rather than
10682 using a configuration file for that), the variable
10683 .Va spamc-arguments
10684 can be used as in, e.g.,
10685 .Ql -d server.example.com -p 783 .
10686 It is also possible to specify a per-user configuration via
10687 .Va spamc-user .
10688 Note that this interface does not inspect the
10689 .Ql is-spam
10690 flag of a message for the command
10691 .Ic spamforget .
10693 .It Ql filter
10694 generic spam filter support via freely configurable hooks.
10695 This interface is meant for programs like
10696 .Xr bogofilter 1
10697 and requires according behaviour in respect to the hooks' exit
10698 status for at least the command
10699 .Ic spamrate
10700 .Pf ( Ql 0
10701 meaning a message is spam,
10702 .Ql 1
10703 for non-spam,
10704 .Ql 2
10705 for unsure and any other return value indicating a hard error);
10706 since the hooks can include shell code snippets diverting behaviour
10707 can be intercepted as necessary.
10708 The hooks are
10709 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
10710   spamfilter-rate
10712 .Va spamfilter-spam ;
10713 the manual section
10714 .Sx "Handling spam"
10715 contains examples for some programs.
10716 The process environment of the hooks will have the variable
10717 .Ev MAILX_FILENAME_GENERATED
10718 set.
10719 Note that spam score support for
10720 .Ic spamrate
10721 is not supported unless the \*(OPtional regular expression support is
10722 available and the
10723 .Va spamfilter-rate-scanscore
10724 variable is set.
10729 .It Va spam-maxsize
10730 \*(OP Messages that exceed this size will not be passed through to the
10731 configured
10732 .Va spam-interface .
10733 If unset or 0, the default of 420000 bytes is used.
10736 .It Va spamc-command
10737 \*(OP The path to the
10738 .Xr spamc 1
10739 program for the
10740 .Ql spamc
10741 .Va spam-interface .
10742 Note that the path is not expanded, but used
10743 .Dq as is .
10744 A fallback path will have been compiled into the \*(UA binary if the
10745 executable had been found during compilation.
10748 .It Va spamc-arguments
10749 \*(OP Even though \*(UA deals with most arguments for the
10750 .Ql spamc
10751 .Va spam-interface
10752 automatically, it may at least sometimes be desirable to specify
10753 connection-related ones via this variable, e.g.,
10754 .Ql -d server.example.com -p 783 .
10757 .It Va spamc-user
10758 \*(OP Specify a username for per-user configuration files for the
10759 .Ql spamc
10760 .Va spam-interface .
10761 If this is set to the empty string then \*(UA will use the name of the
10762 current
10763 .Va user .
10770 .It Va spamfilter-ham , spamfilter-noham , \
10771   spamfilter-nospam , spamfilter-rate , spamfilter-spam
10772 \*(OP Command and argument hooks for the
10773 .Ql filter
10774 .Va spam-interface .
10775 The manual section
10776 .Sx "Handling spam"
10777 contains examples for some programs.
10780 .It Va spamfilter-rate-scanscore
10781 \*(OP Because of the generic nature of the
10782 .Ql filter
10783 .Va spam-interface
10784 spam scores are not supported for it by default, but if the \*(OPnal
10785 regular expression support is available then setting this variable can
10786 be used to overcome this restriction.
10787 It is interpreted as follows: first a number (digits) is parsed that
10788 must be followed by a semicolon
10789 .Ql \&;
10790 and an extended regular expression.
10791 Then the latter is used to parse the first output line of the
10792 .Va spamfilter-rate
10793 hook, and, in case the evaluation is successful, the group that has been
10794 specified via the number is interpreted as a floating point scan score.
10798 .It Va ssl-ca-dir , ssl-ca-file
10799 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10800 Enhanced Mail) format as a directory and a file, respectively, for the
10801 purpose of verification of SSL/TLS server certificates.
10802 It is possible to set both, the file will be loaded immediately, the
10803 directory will be searched whenever no match has yet been found.
10804 The set of CA certificates which are built into the SSL/TLS library can
10805 be explicitly turned off by setting
10806 .Va ssl-ca-no-defaults ,
10807 and further fine-tuning is possible via
10808 .Va ssl-ca-flags ;
10809 also see
10810 .Xr SSL_CTX_load_verify_locations 3
10811 for more information.
10812 \*(UA will try to use the TLS/SNI (ServerNameIndication) extension when
10813 establishing TLS connections to servers identified with hostnames.
10817 .It Va ssl-ca-flags
10818 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10819 storage, and the certificate verification that is used (also see
10820 .Va ssl-verify ) .
10821 The value is expected to consist of a comma-separated list of
10822 configuration directives, with any intervening whitespace being ignored.
10823 The directives directly map to flags that can be passed to
10824 .Xr X509_STORE_set_flags 3 ,
10825 which are usually defined in a file
10826 .Pa openssl/x509_vfy.h ,
10827 and the availability of which depends on the used SSL/TLS library
10828 version: a directive without mapping is ignored (error log subject to
10829 .Va debug ) .
10830 Directives currently understood (case-insensitively) include:
10833 .Bl -tag -compact -width ".It Cd BaNg"
10834 .It Cd no-alt-chains
10835 If the initial chain is not trusted, do not attempt to build an
10836 alternative chain.
10837 Setting this flag will make OpenSSL certificate verification match that
10838 of older OpenSSL versions, before automatic building and checking of
10839 alternative chains has been implemented; also see
10840 .Cd trusted-first .
10841 .It Cd no-check-time
10842 Do not check certificate/CRL validity against current time.
10843 .It Cd partial-chain
10844 By default partial, incomplete chains which cannot be verified up to the
10845 chain top, a self-signed root certificate, will not verify.
10846 With this flag set, a chain succeeds to verify if at least one signing
10847 certificate of the chain is in any of the configured trusted stores of
10848 CA certificates.
10849 The OpenSSL manual page
10850 .Xr SSL_CTX_load_verify_locations 3
10851 gives some advise how to manage your own trusted store of CA certificates.
10852 .It Cd strict
10853 Disable workarounds for broken certificates.
10854 .It Cd trusted-first
10855 Try building a chain using issuers in the trusted store first to avoid
10856 problems with server-sent legacy intermediate certificates.
10857 Newer versions of OpenSSL support alternative chain checking and enable
10858 it by default, resulting in the same behaviour; also see
10859 .Cd no-alt-chains .
10864 .It Va ssl-ca-no-defaults
10865 \*(BO\*(OP Do not load the default CA locations that are built into the
10866 used to SSL/TLS library to verify SSL/TLS server certificates.
10868 .Mx Va ssl-cert
10869 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
10870 \*(OP Variable chain that sets the filename for a SSL/TLS client
10871 certificate required by some servers.
10872 This is a direct interface to the
10873 .Ql Certificate
10874 slot of the
10875 .Xr SSL_CONF_cmd 3
10876 function of the OpenSSL library, if available.
10878 .Mx Va ssl-cipher-list
10879 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
10880 \*(OP Specifies a list of ciphers for SSL/TLS connections.
10881 This is a direct interface to the
10882 .Ql CipherString
10883 slot of the
10884 .Xr SSL_CONF_cmd 3
10885 function of the OpenSSL library, if available; see
10886 .Xr ciphers 1
10888 .Xr SSL_CTX_set_cipher_list 3
10889 for more information.
10890 By default \*(UA does not set a list of ciphers, in effect using a
10891 .Va ssl-protocol
10892 specific cipher (protocol standards ship with a list of acceptable
10893 ciphers), possibly cramped to what the actually used SSL/TLS library
10894 supports \(en the manual section
10895 .Sx "An example configuration"
10896 also contains a SSL/TLS use case.
10899 .It Va ssl-config-file
10900 \*(OP If this variable is set \*(UA will call
10901 .Xr CONF_modules_load_file 3
10902 to allow OpenSSL to be configured according to the host system wide
10903 security settings.
10904 If a non-empty value is given then this will be used to specify the
10905 configuration file to be used instead of the global OpenSSL default;
10906 note that in this case it is an error if the file cannot be loaded.
10907 The application name will always be passed as
10908 .Dq \*(uA .
10910 .Mx Va ssl-curves
10911 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
10912 \*(OP Specifies a list of supported curves for SSL/TLS connections.
10913 This is a direct interface to the
10914 .Ql Curves
10915 slot of the
10916 .Xr SSL_CONF_cmd 3
10917 function of the OpenSSL library, if available; see
10918 .Xr SSL_CTX_set1_curves_list 3
10919 for more information.
10920 By default \*(UA does not set a list of curves.
10924 .It Va ssl-crl-dir , ssl-crl-file
10925 \*(OP Specify a directory / a file, respectively that contains a CRL in
10926 PEM format to use when verifying SSL/TLS server certificates.
10928 .Mx Va ssl-key
10929 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
10930 \*(OP Variable chain that sets the filename for the private key of
10931 a SSL/TLS client certificate.
10932 If unset, the name of the certificate file is used.
10933 The file is expected to be in PEM format.
10934 This is a direct interface to the
10935 .Ql PrivateKey
10936 slot of the
10937 .Xr SSL_CONF_cmd 3
10938 function of the OpenSSL library, if available.
10940 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
10941 \*(OB\*(OP Please use the newer and more flexible
10942 .Va ssl-protocol
10943 instead: if both values are set,
10944 .Va ssl-protocol
10945 will take precedence!
10946 Can be set to the following values, the actually used
10947 .Va ssl-protocol
10948 specification to which it is mapped is shown in parenthesis:
10949 .Ql tls1.2
10950 .Pf ( Ql -ALL, TLSv1.2 ) ,
10951 .Ql tls1.1
10952 .Pf ( Ql -ALL, TLSv1.1 ) ,
10953 .Ql tls1
10954 .Pf ( Ql -ALL, TLSv1 )
10956 .Ql ssl3
10957 .Pf ( Ql -ALL, SSLv3 ) ;
10958 the special value
10959 .Ql auto
10960 is mapped to
10961 .Ql ALL, -SSLv2
10962 and thus includes the SSLv3 protocol.
10963 Note that SSLv2 is no longer supported at all.
10965 .Mx Va ssl-protocol
10966 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
10967 \*(OP Specify the used SSL/TLS protocol.
10968 This is a direct interface to the
10969 .Ql Protocol
10970 slot of the
10971 .Xr SSL_CONF_cmd 3
10972 function of the OpenSSL library, if available;
10973 otherwise an \*(UA internal parser is used which understands the
10974 following subset of (case-insensitive) command strings:
10975 .Ql SSLv3 ,
10976 .Ql TLSv1 ,
10977 .Ql TLSv1.1
10979 .Ql TLSv1.2 ,
10980 as well as the special value
10981 .Ql ALL .
10982 Multiple specifications may be given via a comma-separated list which
10983 ignores any whitespace.
10984 An optional
10985 .Ql +
10986 plus sign prefix will enable a protocol, a
10987 .Ql -
10988 hyphen-minus prefix will disable it, so that
10989 .Ql -ALL, TLSv1.2
10990 will enable only the TLSv1.2 protocol.
10992 It depends upon the used TLS/SSL library which protocols are actually
10993 supported and which protocols are used if
10994 .Va ssl-protocol
10995 is not set, but note that SSLv2 is no longer supported at all and
10996 actively disabled.
10997 Especially for older protocols explicitly securing
10998 .Va ssl-cipher-list
10999 may be worthwile, see
11000 .Sx "An example configuration" .
11003 .It Va ssl-rand-egd
11004 \*(OP Gives the pathname to an entropy daemon socket, see
11005 .Xr RAND_egd 3 .
11006 Not all SSL/TLS libraries support this.
11009 .It Va ssl-rand-file
11010 \*(OP Gives the filename to a file with random entropy data, see
11011 .Xr RAND_load_file 3 .
11012 If this variable is not set, or set to the empty string, or if the
11013 .Sx "Filename transformations"
11014 fail, then
11015 .Xr RAND_file_name 3
11016 will be used to create the filename if, and only if,
11017 .Xr RAND_status 3
11018 documents that the SSL PRNG is not yet sufficiently seeded.
11019 If \*(UA successfully seeded the SSL PRNG then it will update the file
11020 .Pf ( Xr RAND_write_file 3 ) .
11021 This variable is only used if
11022 .Va ssl-rand-egd
11023 is not set (or not supported by the SSL/TLS library).
11025 .Mx Va ssl-verify
11026 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
11027 \*(OP Variable chain that sets the action to be performed if an error
11028 occurs during SSL/TLS server certificate validation against the
11029 specified or default trust stores
11030 .Va ssl-ca-dir ,
11031 .Va ssl-ca-file ,
11032 or the SSL/TLS library built-in defaults (unless usage disallowed via
11033 .Va ssl-ca-no-defaults ) ,
11034 and as fine-tuned via
11035 .Va ssl-ca-flags .
11036 Valid (case-insensitive) values are
11037 .Ql strict
11038 (fail and close connection immediately),
11039 .Ql ask
11040 (ask whether to continue on standard input),
11041 .Ql warn
11042 (show a warning and continue),
11043 .Ql ignore
11044 (do not perform validation).
11045 The default is
11046 .Ql ask .
11049 .It Va stealthmua
11050 If only set without an assigned value, then this setting inhibits the
11051 generation of the
11052 .Ql Message-ID: ,
11053 .Ql Content-ID:
11055 .Ql User-Agent:
11056 header fields that include obvious references to \*(UA.
11057 There are two pitfalls associated with this:
11058 First, the message id of outgoing messages is not known anymore.
11059 Second, an expert may still use the remaining information in the header
11060 to track down the originating mail user agent.
11061 If set to the value
11062 .Ql noagent ,
11063 then the mentioned
11064 .Ql Message-ID:
11066 .Ql Content-ID:
11067 suppression does not occur.
11071 .It Va termcap
11072 (\*(OP) This specifies a comma-separated list of
11073 .Lb libterminfo
11074 and/or
11075 .Lb libtermcap
11076 capabilities (see
11077 .Sx "On terminal control and line editor" ,
11078 escape commas with reverse solidus) to be used to overwrite or define
11079 entries.
11080 .Sy Note
11081 this variable will only be queried once at program startup and can
11082 thus only be specified in resource files or on the command line.
11085 String capabilities form
11086 .Ql cap=value
11087 pairs and are expected unless noted otherwise.
11088 Numerics have to be notated as
11089 .Ql cap#number
11090 where the number is expected in normal decimal notation.
11091 Finally, booleans do not have any value but indicate a true or false
11092 state simply by being defined or not; this indeed means that \*(UA
11093 does not support undefining an existing boolean.
11094 String capability values will undergo some expansions before use:
11095 for one notations like
11096 .Ql ^LETTER
11097 stand for
11098 .Ql control-LETTER ,
11099 and for clarification purposes
11100 .Ql \eE
11101 can be used to specify
11102 .Ql escape
11103 (the control notation
11104 .Ql ^[
11105 could lead to misreadings when a left bracket follows, which it does for
11106 the standard CSI sequence);
11107 finally three letter octal sequences, as in
11108 .Ql \e061 ,
11109 are supported.
11110 To specify that a terminal supports 256-colours, and to define sequences
11111 that home the cursor and produce an audible bell, one might write:
11113 .Bd -literal -offset indent
11114 ? set termcap='Co#256,home=\eE[H,bel=^G'
11118 The following terminal capabilities are or may be meaningful for the
11119 operation of the built-in line editor or \*(UA in general:
11122 .Bl -tag -compact -width ".It Cd yay"
11123 .\" HAVE_COLOUR
11124 .It Cd colors Ns \0or Cd Co
11125 .Cd max_colors :
11126 numeric capability specifying the maximum number of colours.
11127 Note that \*(UA does not actually care about the terminal beside that,
11128 but always emits ANSI / ISO 6429 escape sequences.
11130 .\" HAVE_TERMCAP
11131 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
11132 .Cd exit_ca_mode
11134 .Cd enter_ca_mode ,
11135 respectively: exit and enter the alternative screen ca-mode,
11136 effectively turning \*(UA into a fullscreen application.
11137 This must be enabled explicitly by setting
11138 .Va termcap-ca-mode .
11140 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
11141 .Cd keypad_xmit
11143 .Cd keypad_local ,
11144 respectively: enable and disable the keypad.
11145 This is always enabled if available, because it seems even keyboards
11146 without keypads generate other key codes for, e.g., cursor keys in that
11147 case, and only if enabled we see the codes that we are interested in.
11149 .It Cd ed Ns \0or Cd cd
11150 .Cd clr_eos :
11151 clear the screen.
11153 .It Cd clear Ns \0or Cd cl
11154 .Cd clear_screen :
11155 clear the screen and home cursor.
11156 (Will be simulated via
11157 .Cd ho
11158 plus
11159 .Cd cd . )
11161 .It Cd home Ns \0or Cd ho
11162 .Cd cursor_home :
11163 home cursor.
11165 .\" HAVE_MLE
11166 .It Cd el Ns \0or Cd ce
11167 .Cd clr_eol :
11168 clear to the end of line.
11169 (Will be simulated via
11170 .Cd ch
11171 plus repetitions of space characters.)
11173 .It Cd hpa Ns \0or Cd ch
11174 .Cd column_address :
11175 move the cursor (to the given column parameter) in the current row.
11176 (Will be simulated via
11177 .Cd cr
11178 plus
11179 .Cd nd . )
11181 .It Cd cr
11182 .Cd carriage_return :
11183 move to the first column in the current row.
11184 The default built-in fallback is
11185 .Ql \er .
11187 .It Cd cub1 Ns \0or Cd le
11188 .Cd cursor_left :
11189 move the cursor left one space (non-destructively).
11190 The default built-in fallback is
11191 .Ql \eb .
11193 .It Cd cuf1 Ns \0or Cd nd
11194 .Cd cursor_right :
11195 move the cursor right one space (non-destructively).
11196 The default built-in fallback is
11197 .Ql \eE[C ,
11198 which is used by most terminals.
11199 Less often occur
11200 .Ql \eEC
11202 .Ql \eEOC .
11206 Many more capabilities which describe key-sequences are documented for
11207 .Ic bind .
11211 .It Va termcap-ca-mode
11212 \*(OP Allow usage of the
11213 .Cd exit_ca_mode
11215 .Cd enter_ca_mode
11216 terminal capabilities, effectively turning \*(UA into a fullscreen
11217 application, as documented for
11218 .Va termcap .
11219 .Sy Note
11220 this variable will only be queried once at program startup and can
11221 thus only be specified in resource files or on the command line.
11224 .It Va termcap-disable
11225 \*(OP Disable any interaction with a terminal control library.
11226 If set only some generic fallback built-ins and possibly the content of
11227 .Va termcap
11228 describe the terminal to \*(UA.
11229 .Sy Note
11230 this variable will only be queried once at program startup and can
11231 thus only be specified in resource files or on the command line.
11234 .It Va toplines
11235 If defined, gives the number of lines of a message to be displayed
11236 with the command
11237 .Ic top ;
11238 if unset, the first five lines are printed, if set to 0 the variable
11239 .Va screen
11240 is inspected.
11241 If the value is negative then its absolute value will be used for
11242 unsigned right shifting (see
11243 .Ic vexpr )
11245 .Va screen
11246 height.
11249 .It Va topsqueeze
11250 \*(BO If set then the
11251 .Ic top
11252 command series will strip adjacent empty lines and quotations.
11255 .It Va ttycharset
11256 The character set of the terminal \*(UA operates on,
11257 and the one and only supported character set that \*(UA can use if no
11258 character set conversion capabilities have been compiled into it,
11259 in which case it defaults to ISO-8859-1 unless it can deduce a value
11260 from the locale specified in the
11261 .Ev LC_CTYPE
11262 environment variable (if supported, see there for more).
11263 It defaults to UTF-8 if conversion is available.
11264 Refer to the section
11265 .Sx "Character sets"
11266 for the complete picture about character sets.
11269 .It Va typescript-mode
11270 \*(BO A special multiplex variable that disables all variables and
11271 settings which result in behaviour that interferes with running \*(UA in
11272 .Xr script 1 ,
11273 e.g., it sets
11274 .Va colour-disable ,
11275 .Va line-editor-disable
11276 and (before startup completed only)
11277 .Va termcap-disable .
11278 Unsetting it does not restore the former state of the covered settings.
11281 .It Va umask
11282 For a safety-by-default policy \*(UA sets its process
11283 .Xr umask 2
11285 .Ql 0077 ,
11286 but this variable can be used to override that:
11287 set it to an empty value to do not change the (current) setting (on
11288 startup), otherwise the process file mode creation mask is updated to
11289 the new value.
11290 Child processes inherit the process file mode creation mask.
11292 .Mx Va user
11293 .It Va user-HOST , user
11294 \*(IN Variable chain that sets a global fallback user name, which is
11295 used in case none has been given in the protocol and account-specific
11296 URL.
11297 This variable defaults to the name of the user who runs \*(UA.
11300 .It Va v15-compat
11301 \*(BO Setting this enables upward compatibility with \*(UA
11302 version 15.0 in respect to which configuration options are available and
11303 how they are handled.
11304 This manual uses \*(IN and \*(OU to refer to the new and the old way of
11305 doing things, respectively.
11308 .It Va verbose
11309 \*(BO This setting, also controllable via the command line option
11310 .Fl v ,
11311 causes \*(UA to be more verbose, e.g., it will display obsoletion
11312 warnings and SSL/TLS certificate chains.
11313 Even though marked \*(BO this option may be set twice in order to
11314 increase the level of verbosity even more, in which case even details of
11315 the actual message delivery and protocol conversations are shown.
11316 A single
11317 .Pf no Va verbose
11318 is sufficient to disable verbosity as such.
11325 .It Va version , version-date , version-major , version-minor , version-update
11326 \*(RO \*(UA version information: the first variable contains a string
11327 containing the complete version identification, the latter three contain
11328 only digits: the major, minor and update version numbers.
11329 The date is in ISO 8601 notation.
11330 The output of the command
11331 .Ic version
11332 will include this information.
11335 .It Va writebackedited
11336 If this variable is set messages modified using the
11337 .Ic edit
11339 .Ic visual
11340 commands are written back to the current folder when it is quit;
11341 it is only honoured for writable folders in MBOX format, though.
11342 Note that the editor will be pointed to the raw message content in that
11343 case, i.e., neither MIME decoding nor decryption will have been
11344 performed, and proper RFC 4155
11345 .Ql From_
11346 quoting of newly added or edited content is also left as an excercise to
11347 the user.
11349 .\" }}} (Variables)
11351 .\" }}} (INTERNAL VARIABLES)
11354 .\" .Sh ENVIRONMENT {{{
11355 .Sh ENVIRONMENT
11357 The term
11358 .Dq environment variable
11359 should be considered an indication that these variables are either
11360 standardized as vivid parts of process environments, or that they are
11361 commonly found in there.
11362 The process environment is inherited from the
11363 .Xr sh 1
11364 once \*(UA is started, and unless otherwise explicitly noted handling of
11365 the following variables transparently integrates into that of the
11366 .Sx "INTERNAL VARIABLES"
11367 from \*(UA's point of view.
11368 This means that, e.g., they can be managed via
11369 .Ic set
11371 .Ic unset ,
11372 causing automatic program environment updates (to be inherited by
11373 newly created child processes).
11376 In order to transparently integrate other environment variables equally
11377 they need to be imported (linked) with the command
11378 .Ic environ .
11379 This command can also be used to set and unset non-integrated
11380 environment variables from scratch, sufficient system support provided.
11381 The following example, applicable to a POSIX shell, sets the
11382 .Ev COLUMNS
11383 environment variable for \*(UA only, and beforehand exports the
11384 .Ev EDITOR
11385 in order to affect any further processing in the running shell:
11387 .Bd -literal -offset indent
11388 $ EDITOR="vim -u ${HOME}/.vimrc"
11389 $ export EDITOR
11390 $ COLUMNS=80 \*(uA -R
11393 .Bl -tag -width ".It Ev BaNg"
11395 .It Ev COLUMNS
11396 The user's preferred width in column positions for the terminal screen
11397 or window.
11398 Queried and used once on program startup, actively managed for child
11399 processes and the MLE (see
11400 .Sx "On terminal control and line editor" )
11401 in interactive mode thereafter.
11402 Ignored in non-interactive mode, which always uses 80 columns, unless in
11403 .fl #
11404 batch mode.
11407 .It Ev DEAD
11408 The name of the (mailbox)
11409 .Ic file
11410 to use for saving aborted messages if
11411 .Va save
11412 is set; this defaults to
11413 .Pa dead.letter
11414 in the user's
11415 .Ev HOME
11416 directory.
11417 If the variable
11418 .Va debug
11419 is set no output will be generated, otherwise the contents of the file
11420 will be replaced.
11423 .It Ev EDITOR
11424 Pathname of the text editor to use in the
11425 .Ic edit
11426 command and
11427 .Ic ~e
11428 .Sx "COMMAND ESCAPES" .
11429 A default editor is used if this value is not defined.
11432 .It Ev HOME
11433 The user's home directory.
11434 This variable is only used when it resides in the process environment.
11435 The calling user's home directory will be used instead if this directory
11436 does not exist, is not accessible or cannot be read.
11437 (No test for being writable is performed to allow usage by
11438 non-privileged users within read-only jails, but dependent on the
11439 variable settings this directory is a default write target, e.g. for
11440 .Ev DEAD ,
11441 .Ev MBOX
11442 and more.)
11447 .It Ev LC_ALL , LC_CTYPE , LANG
11448 \*(OP The (names in lookup order of the)
11449 .Xr locale 7
11450 (and / or see
11451 .Xr setlocale 3 )
11452 which indicates the used
11453 .Sx "Character sets" .
11454 Runtime changes trigger automatic updates of the entire locale system,
11455 updating and overwriting also a
11456 .Va ttycharset
11457 set by the user.
11460 .It Ev LINES
11461 The user's preferred number of lines on a page or the vertical screen
11462 or window size in lines.
11463 Queried and used once on program startup, actively managed for child
11464 processes in interactive mode thereafter.
11465 Ignored in non-interactive mode, which always uses 24 lines, unless in
11466 .fl #
11467 batch mode.
11470 .It Ev LISTER
11471 Pathname of the directory lister to use in the
11472 .Ic folders
11473 command when operating on local mailboxes.
11474 Default is
11475 .Xr ls 1
11476 (path search through
11477 .Ev SHELL ) .
11480 .It Ev LOGNAME
11481 Upon startup \*(UA will actively ensure that this variable refers to the
11482 name of the user who runs \*(UA, in order to be able to pass a verified
11483 name to any newly created child process.
11486 .It Ev MAIL
11487 Is used as the users
11488 .Mx -sx
11489 .Sx "primary system mailbox"
11490 unless
11491 .Va inbox
11492 is set.
11493 This is assumed to be an absolute pathname.
11496 .It Ev MAILCAPS
11497 \*(OP Overrides the default path search for
11498 .Sx "The Mailcap files" ,
11499 which is defined in the standard RFC 1524 as
11500 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
11501 .\" TODO we should have a mailcaps-default virtual RDONLY option!
11502 (\*(UA makes it a configuration option, however.)
11503 Note this is not a search path, but a path search.
11506 .It Ev MAILRC
11507 Is used as a startup file instead of
11508 .Pa \*(ur
11509 if set.
11510 When \*(UA scripts are invoked on behalf of other users,
11511 either this variable should be set to
11512 .Pa /dev/null
11513 or the
11514 .Fl \&:
11515 command line option should be used in order to avoid side-effects from
11516 reading their configuration files.
11517 This variable is only used when it resides in the process environment.
11520 .It Ev MAILX_NO_SYSTEM_RC
11521 If this variable is set then reading of
11522 .Pa \*(UR
11523 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
11524 had been started up with the option
11525 .Fl \&:
11526 (and according argument) or
11527 .Fl n .
11528 This variable is only used when it resides in the process environment.
11531 .It Ev MBOX
11532 The name of the users
11533 .Mx -sx
11534 .Sx "secondary mailbox"
11535 file.
11536 A logical subset of the special
11537 .Sx "Filename transformations"
11538 (also see
11539 .Ic file )
11540 are supported.
11541 The default is
11542 .Pa ~/mbox .
11543 Traditionally this MBOX is used as the file to save messages from the
11544 .Mx -sx
11545 .Sx "primary system mailbox"
11546 that have been read.
11547 Also see
11548 .Sx "Message states" .
11551 .It Ev NETRC
11552 \*(IN\*(OP This variable overrides the default location of the user's
11553 .Pa ~/.netrc
11554 file.
11557 .It Ev PAGER
11558 Pathname of the program to use for backing the command
11559 .Ic more ,
11560 and when the
11561 .Va crt
11562 variable enforces usage of a pager for output.
11563 The default paginator is
11564 .Xr more 1
11565 (path search through
11566 .Ev SHELL ) .
11568 \*(UA inspects the contents of this variable: if its contains the string
11569 .Dq less
11570 then a non-existing environment variable
11571 .Va LESS
11572 will be set to
11573 .Ql FRXi ,
11574 .Ql FRi
11576 .Ql Ri ,
11577 dependent on whether terminal control support is available and whether
11578 that supports full (alternative) screen mode or not (also see
11579 .Sx "On terminal control and line editor" ) .
11580 Likewise for
11581 .Dq lv
11582 .Va LV
11583 will optionally be set to
11584 .Dq -c .
11585 Alse see
11586 .Va colour-pager .
11589 .It Ev PATH
11590 A colon-separated list of directories that is searched by the shell when
11591 looking for commands, e.g.,
11592 .Ql /bin:/usr/bin:/usr/local/bin .
11595 .It Ev POSIXLY_CORRECT
11596 This variable is automatically looked for upon startup, see
11597 .Va posix
11598 for more.
11601 .It Ev SHELL
11602 The shell to use for the commands
11603 .Ic \&! ,
11604 .Ic shell ,
11606 .Ic ~!
11607 .Sx "COMMAND ESCAPES"
11608 and when starting subprocesses.
11609 A default shell is used if this environment variable is not defined.
11612 .It Ev SOURCE_DATE_EPOCH
11613 This specifies a time in seconds since the Unix epoch (1970-01-01) to be
11614 used in place of the current time.
11615 This variable is looked up upon program startup, and its existence will
11616 switch \*(UA to a completely reproducible mode which causes
11617 deterministic random numbers, a special fixed (non-existent?)
11618 .Ev LOGNAME
11619 and more to be used and set.
11620 It is to be used during development or by software packagers.
11621 \*(ID Currently an invalid setting is only ignored, rather than causing
11622 a program abortion.
11624 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
11627 .It Ev TERM
11628 \*(OP The terminal type for which output is to be prepared.
11629 For extended colour and font control please refer to
11630 .Sx "Coloured display" ,
11631 and for terminal management in general to
11632 .Sx "On terminal control and line editor" .
11635 .It Ev TMPDIR
11636 Used as directory for temporary files instead of
11637 .Pa /tmp ,
11638 if set, existent, accessible as well as read- and writable.
11639 This variable is only used when it resides in the process environment,
11640 but \*(UA will ensure at startup that this environment variable is
11641 updated to contain a usable temporary directory.
11644 .It Ev USER
11645 Identical to
11646 .Ev LOGNAME
11647 (see there), but this variable is not standardized, should therefore not
11648 be used, and is only corrected if already set.
11651 .It Ev VISUAL
11652 Pathname of the text editor to use in the
11653 .Ic visual
11654 command and
11655 .Ic ~v
11656 .Sx "COMMAND ESCAPES" .
11659 .\" }}}
11662 .\" .Sh FILES {{{
11663 .Sh FILES
11665 .\" file list {{{
11666 .Bl -tag -width ".It Pa BaNg"
11667 .It Pa \*(ur
11668 File giving initial commands, one of the
11669 .Sx "Resource files" .
11671 .It Pa \*(UR
11672 System wide initialization file, one of the
11673 .Sx "Resource files" .
11676 .It Pa ~/.mailcap
11677 \*(OP Personal MIME type handler definition file, see
11678 .Sx "The Mailcap files" .
11679 This location is part of the RFC 1524 standard search path, which is
11680 a configuration option and can be overridden via
11681 .Ev MAILCAPS .
11684 .It Pa /etc/mailcap
11685 \*(OP System wide MIME type handler definition file, see
11686 .Sx "The Mailcap files" .
11687 This location is part of the RFC 1524 standard search path, which is
11688 a configuration option and can be overridden via
11691 .It Pa ~/mbox
11692 The default value for
11693 .Ev MBOX .
11694 The actually used path is a configuration option.
11697 .It Pa ~/.mime.types
11698 Personal MIME types, see
11699 .Sx "The mime.types files" .
11700 The actually used path is a configuration option.
11703 .It Pa /etc/mime.types
11704 System wide MIME types, see
11705 .Sx "The mime.types files" .
11706 The actually used path is a configuration option.
11709 .It Pa ~/.netrc
11710 \*(IN\*(OP The default location of the users
11711 .Pa .netrc
11712 file \(en the section
11713 .Sx "The .netrc file"
11714 documents the file format.
11715 The actually used path is a configuration option and can be overridden via
11716 .Ev NETRC .
11719 .It Pa /dev/null
11720 The data sink
11721 .Xr null 4 .
11722 The actually used path is a compile-time constant.
11724 .\" }}}
11726 .\" .Ss "Resource files" {{{
11727 .Ss "Resource files"
11729 Upon startup \*(UA reads in several resource files:
11731 .Bl -tag -width ".It Pa BaNg"
11733 .It Pa \*(UR
11734 System wide initialization file.
11735 Reading of this file can be suppressed, either by using the
11736 .Fl \&:
11737 (and according argument) or
11738 .Fl n
11739 command line options, or by setting the
11740 .Sx ENVIRONMENT
11741 variable
11742 .Ev MAILX_NO_SYSTEM_RC .
11745 .It Pa \*(ur
11746 File giving initial commands.
11747 A different file can be chosen by setting the
11748 .Sx ENVIRONMENT
11749 variable
11750 .Ev MAILRC .
11751 Reading of this file can be suppressed with the
11752 .Fl \&:
11753 command line option.
11755 .It Va mailx-extra-rc
11756 Defines a startup file to be read after all other resource files.
11757 It can be used to specify settings that are not understood by other
11758 .Xr mailx 1
11759 implementations, for example.
11760 This variable is only honoured when defined in a resource file, e.g.,
11761 it is one of the
11762 .Sx "INTERNAL VARIABLES" .
11766 The content of these files is interpreted as follows:
11769 .Bl -bullet -compact
11771 The whitespace characters space, tabulator and newline,
11772 as well as those defined by the variable
11773 .Va ifs ,
11774 are removed from the beginning and end of input lines.
11776 Empty lines are ignored.
11778 Any other line is interpreted as a command.
11779 It may be spread over multiple input lines if the newline character is
11780 .Dq escaped
11781 by placing a reverse solidus character
11782 .Ql \e
11783 as the last character of the line; whereas any leading whitespace of
11784 follow lines is ignored, trailing whitespace before a escaped newline
11785 remains in the input.
11787 If the line (content) starts with the number sign
11788 .Ql #
11789 then it is a comment-command and also ignored.
11790 (The comment-command is a real command, which does nothing, and
11791 therefore the usual follow lines mechanism applies!)
11795 Unless \*(UA is about to enter interactive mode syntax errors that occur
11796 while loading these files are treated as errors and cause program exit.
11797 More files with syntactically equal content can be
11798 .Ic source Ns ed .
11799 The following, saved in a file, would be an examplary content:
11801 .Bd -literal -offset indent
11802  # This line is a comment command.  And y\e
11803     es, it is really continued here.
11804 set debug \e
11805     verbose
11806     set editheaders
11808 .\" }}}
11810 .\" .Ss "The mime.types files" {{{
11811 .Ss "The mime.types files"
11813 As stated in
11814 .Sx "HTML mail and MIME attachments"
11815 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
11816 media types in order to classify message and attachment content.
11817 One source for them are
11818 .Pa mime.types
11819 files, the loading of which can be controlled by setting the variable
11820 .Va mimetypes-load-control .
11821 Another is the command
11822 .Ic mimetype ,
11823 which also offers access to \*(UAs MIME type cache.
11824 .Pa mime.types
11825 files have the following syntax:
11827 .Bd -literal -offset indent
11828 type/subtype extension [extension ...]
11829 # E.g., text/html html htm
11833 where
11834 .Ql type/subtype
11835 define the MIME media type, as standardized in RFC 2046:
11836 .Ql type
11837 is used to declare the general type of data, while the
11838 .Ql subtype
11839 specifies a specific format for that type of data.
11840 One or multiple filename
11841 .Ql extension Ns
11842 s, separated by whitespace, can be bound to the media type format.
11843 Comments may be introduced anywhere on a line with a number sign
11844 .Ql # ,
11845 causing the remaining line to be discarded.
11847 \*(UA also supports an extended, non-portable syntax in especially
11848 crafted files, which can be loaded via the alternative value syntax of
11849 .Va mimetypes-load-control ,
11850 and prepends an optional
11851 .Ql type-marker :
11854 .Dl [type-marker ]type/subtype extension [extension ...]
11857 The following type markers are supported:
11860 .Bl -tag -compact -width ".It Ar _n_u"
11861 .It Ar @
11862 Treat message parts with this content as plain text.
11863 .It Ar @t
11864 The same as plain
11865 .Ar @ .
11866 .It Ar @h
11867 Treat message parts with this content as HTML tagsoup.
11868 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
11869 the content as plain text instead.
11870 .It Ar @H
11871 Likewise
11872 .Ar @h ,
11873 but instead of falling back to plain text require an explicit content
11874 handler to be defined.
11878 Further reading:
11879 for sending messages:
11880 .Ic mimetype ,
11881 .Va mime-allow-text-controls ,
11882 .Va mimetypes-load-control .
11883 For reading etc. messages:
11884 .Sx "HTML mail and MIME attachments" ,
11885 .Sx "The Mailcap files" ,
11886 .Ic mimetype ,
11887 .Va mime-counter-evidence ,
11888 .Va mimetypes-load-control ,
11889 .Va pipe-TYPE/SUBTYPE ,
11890 .Va pipe-EXTENSION .
11891 .\" }}}
11893 .\" .Ss "The Mailcap files" {{{
11894 .Ss "The Mailcap files"
11896 .\" TODO MAILCAP DISABLED
11897 .Sy This feature is not available in v14.9.0, sorry!
11898 RFC 1524 defines a
11899 .Dq User Agent Configuration Mechanism
11900 which \*(UA \*(OPally supports (see
11901 .Sx "HTML mail and MIME attachments" ) .
11902 It defines a file format to be used to inform mail user agent programs
11903 about the locally-installed facilities for handling various data
11904 formats, i.e., about commands and how they can be used to display, edit
11905 et cetera MIME part contents, as well as a default path search that
11906 includes multiple possible locations of
11907 .Dq mailcap
11908 files and the
11909 .Ev MAILCAPS
11910 environment variable that can be used to overwrite that (repeating here
11911 that it is not a search path, but instead a path search specification).
11912 Any existing files will be loaded in sequence, appending any content to
11913 the list of MIME type handler directives.
11916 .Dq Mailcap
11917 files consist of a set of newline separated entries.
11918 Comment lines start with a number sign
11919 .Ql #
11920 (in the first column!) and are ignored.
11921 Empty lines are also ignored.
11922 All other lines form individual entries that must adhere to the syntax
11923 described below.
11924 To extend a single entry (not comment) its line can be continued on
11925 follow lines if newline characters are
11926 .Dq escaped
11927 by preceding them with the reverse solidus character
11928 .Ql \e .
11929 The standard does not specify how leading whitespace of follow lines
11930 is to be treated, therefore \*(UA retains it.
11933 .Dq Mailcap
11934 entries consist of a number of semicolon
11935 .Ql \&;
11936 separated fields, and the reverse solidus
11937 .Ql \e
11938 character can be used to escape any following character including
11939 semicolon and itself.
11940 The first two fields are mandatory and must occur in the specified
11941 order, the remaining fields are optional and may appear in any order.
11942 Leading and trailing whitespace of content is ignored (removed).
11945 The first field defines the MIME
11946 .Ql TYPE/SUBTYPE
11947 the entry is about to handle (case-insensitively, and no reverse solidus
11948 escaping is possible in this field).
11949 If the subtype is specified as an asterisk
11950 .Ql *
11951 the entry is meant to match all subtypes of the named type, e.g.,
11952 .Ql audio/*
11953 would match any audio type.
11954 The second field defines the shell command which shall be used to
11955 .Dq display
11956 MIME parts of the given type; it is implicitly called the
11957 .Cd view
11958 command.
11961 For data
11962 .Dq consuming
11963 shell commands message (MIME part) data is passed via standard input
11964 unless the given shell command includes one or more instances of the
11965 (unquoted) string
11966 .Ql %s ,
11967 in which case these instances will be replaced with a temporary filename
11968 and the data will have been stored in the file that is being pointed to.
11969 Likewise, for data
11970 .Dq producing
11971 shell commands data is assumed to be generated on standard output unless
11972 the given command includes (one ore multiple)
11973 .Ql %s .
11974 In any case any given
11975 .Ql %s
11976 format is replaced with a(n already) properly quoted filename.
11977 Note that when a command makes use of a temporary file via
11978 .Ql %s
11979 then \*(UA will remove it again, as if the
11980 .Cd x-mailx-tmpfile ,
11981 .Cd x-mailx-tmpfile-fill
11983 .Cd x-mailx-tmpfile-unlink
11984 flags had been set; see below for more.
11987 The optional fields either define a shell command or an attribute (flag)
11988 value, the latter being a single word and the former being a keyword
11989 naming the field followed by an equals sign
11990 .Ql =
11991 succeeded by a shell command, and as usual for any
11992 .Dq Mailcap
11993 content any whitespace surrounding the equals sign will be removed, too.
11994 Optional fields include the following:
11997 .Bl -tag -width ".It Cd BaNg"
11998 .It Cd compose
11999 A program that can be used to compose a new body or body part in the
12000 given format.
12001 (Currently unused.)
12003 .It Cd composetyped
12004 Similar to the
12005 .Cd compose
12006 field, but is to be used when the composing program needs to specify the
12007 .Ql Content-type:
12008 header field to be applied to the composed data.
12009 (Currently unused.)
12011 .It Cd edit
12012 A program that can be used to edit a body or body part in the given
12013 format.
12014 (Currently unused.)
12016 .It Cd print
12017 A program that can be used to print a message or body part in the given
12018 format.
12019 (Currently unused.)
12021 .It Cd test
12022 Specifies a program to be run to test some condition, e.g., the machine
12023 architecture, or the window system in use, to determine whether or not
12024 this mailcap entry applies.
12025 If the test fails, a subsequent mailcap entry should be sought; also see
12026 .Cd x-mailx-test-once .
12029 .It Cd needsterminal
12030 This flag field indicates that the given shell command must be run on
12031 an interactive terminal.
12032 \*(UA will temporarily release the terminal to the given command in
12033 interactive mode, in non-interactive mode this entry will be entirely
12034 ignored; this flag implies
12035 .Cd x-mailx-noquote .
12038 .It Cd copiousoutput
12039 A flag field which indicates that the output of the
12040 .Cd view
12041 command will be an extended stream of textual output that can be
12042 (re)integrated into \*(UA's normal visual display.
12043 It is mutually exclusive with
12044 .Cd needsterminal .
12046 .It Cd textualnewlines
12047 A flag field which indicates that this type of data is line-oriented and
12048 that, if encoded in
12049 .Ql base64 ,
12050 all newlines should be converted to canonical form (CRLF) before
12051 encoding, and will be in that form after decoding.
12052 (Currently unused.)
12054 .It Cd nametemplate
12055 This field gives a filename format, in which
12056 .Ql %s
12057 will be replaced by a random string, the joined combination of which
12058 will be used as the filename denoted by
12059 .Ev MAILX_FILENAME_TEMPORARY .
12060 One could specify that a GIF file being passed to an image viewer should
12061 have a name ending in
12062 .Ql .gif
12063 by using
12064 .Ql nametemplate=%s.gif .
12065 Note that \*(UA ignores the name template unless that solely specifies
12066 a filename suffix that consists of (ASCII) alphabetic and numeric
12067 characters, the underscore and dot only.
12069 .It Cd x11-bitmap
12070 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
12071 icon to be used to visually denote the presence of this kind of data.
12072 This field is not used by \*(UA.
12074 .It Cd description
12075 A textual description that describes this type of data.
12078 .It Cd x-mailx-even-if-not-interactive
12079 An extension flag test field \(em by default handlers without
12080 .Cd copiousoutput
12081 are entirely ignored in non-interactive mode, but if this flag is set
12082 then their use will be considered.
12083 It is an error if this flag is set for commands that use the flag
12084 .Cd needsterminal .
12087 .It Cd x-mailx-noquote
12088 An extension flag field that indicates that even a
12089 .Cd copiousoutput
12090 .Cd view
12091 command shall not be used to generate message quotes
12092 (as it would be by default).
12095 .It Cd x-mailx-async
12096 Extension flag field that denotes that the given
12097 .Cd view
12098 command shall be executed asynchronously, without blocking \*(UA.
12099 Cannot be used in conjunction with
12100 .Cd needsterminal .
12103 .It Cd x-mailx-test-once
12104 Extension flag which denotes whether the given
12105 .Cd test
12106 command shall be evaluated once only and the (boolean) result be cached.
12107 This is handy if some global unchanging condition is to be queried, like
12108 .Dq running under the X Window System .
12111 .It Cd x-mailx-tmpfile
12112 Extension flag field that requests creation of a zero-sized temporary
12113 file, the name of which is to be placed in the environment variable
12114 .Ev MAILX_FILENAME_TEMPORARY .
12115 It is an error to use this flag with commands that include a
12116 .Ql %s
12117 format.
12120 .It Cd x-mailx-tmpfile-fill
12121 Normally the MIME part content is passed to the handler via standard
12122 input; if this flag is set then the data will instead be written into
12123 the implied
12124 .Cd x-mailx-tmpfile .
12125 In order to cause deletion of the temporary file you will have to set
12126 .Cd x-mailx-tmpfile-unlink
12127 explicitly!
12128 It is an error to use this flag with commands that include a
12129 .Ql %s
12130 format.
12133 .It Cd x-mailx-tmpfile-unlink
12134 Extension flag field that requests that the temporary file shall be
12135 deleted automatically when the command loop is entered again at latest.
12136 (Do not use this for asynchronous handlers.)
12137 It is an error to use this flag with commands that include a
12138 .Ql %s
12139 format, or in conjunction with
12140 .Cd x-mailx-async ,
12141 or without also setting
12142 .Cd x-mailx-tmpfile
12144 .Cd x-mailx-tmpfile-fill .
12147 .It Cd x-mailx-tmpfile-keep
12148 Using the string
12149 .Ql %s
12150 implies the three tmpfile related flags above, but if you want, e.g.,
12151 .Cd x-mailx-async
12152 and deal with the temporary file yourself, you can add in this flag to
12153 forcefully ignore
12154 .Cd x-mailx-tmpfile-unlink .
12159 The standard includes the possibility to define any number of additional
12160 entry fields, prefixed by
12161 .Ql x- .
12162 Flag fields apply to the entire
12163 .Dq Mailcap
12164 entry \(em in some unusual cases, this may not be desirable, but
12165 differentiation can be accomplished via separate entries, taking
12166 advantage of the fact that subsequent entries are searched if an earlier
12167 one does not provide enough information.
12168 E.g., if a
12169 .Cd view
12170 command needs to specify the
12171 .Cd needsterminal
12172 flag, but the
12173 .Cd compose
12174 command shall not, the following will help out the latter (with enabled
12175 .Va debug
12176 or an increased
12177 .Va verbose
12178 level \*(UA will show information about handler evaluation):
12180 .Bd -literal -offset indent
12181 application/postscript; ps-to-terminal %s; needsterminal
12182 application/postscript; ps-to-terminal %s; compose=idraw %s
12186 In fields any occurrence of the format string
12187 .Ql %t
12188 will be replaced by the
12189 .Ql TYPE/SUBTYPE
12190 specification.
12191 Named parameters from the
12192 .Ql Content-type:
12193 field may be placed in the command execution line using
12194 .Ql %{
12195 followed by the parameter name and a closing
12196 .Ql }
12197 character.
12198 The entire parameter should appear as a single command line argument,
12199 regardless of embedded spaces; thus:
12201 .Bd -literal -offset indent
12202 # Message
12203 Content-type:  multipart/mixed; boundary=42
12205 # Mailcap file
12206 multipart/*; /usr/local/bin/showmulti \e
12207   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
12209 # Executed shell command
12210 /usr/local/bin/showmulti multipart/mixed 42
12214 .\" TODO v15: Mailcap: %n,%F
12215 Note that \*(UA does not support handlers for multipart MIME parts as
12216 shown in this example (as of today).
12217 \*(UA does not support the additional formats
12218 .Ql %n
12220 .Ql %F .
12221 An example file, also showing how to properly deal with the expansion of
12222 .Ql %s ,
12223 which includes any quotes that are necessary to make it a valid shell
12224 argument by itself and thus will cause undesired behaviour when placed
12225 in additional user-provided quotes:
12227 .Bd -literal -offset indent
12228 # Comment line
12229 text/richtext; richtext %s; copiousoutput
12231 text/x-perl; perl -cWT %s
12233 application/pdf; \e
12234   infile=%s\e; \e
12235     trap "rm -f ${infile}" EXIT\e; \e
12236     trap "exit 75" INT QUIT TERM\e; \e
12237     mupdf %s; \e
12238   x-mailx-async; x-mailx-tmpfile-keep
12240 application/*; echo "This is \e"%t\e" but \e
12241     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
12242   copiousoutput; x-mailx-noquote
12246 Further reading:
12247 .Sx "HTML mail and MIME attachments" ,
12248 .Sx "The mime.types files" ,
12249 .Ic mimetype ,
12250 .Ev MAILCAPS ,
12251 .Va mime-counter-evidence ,
12252 .Va pipe-TYPE/SUBTYPE ,
12253 .Va pipe-EXTENSION .
12254 .\" }}}
12256 .\" .Ss "The .netrc file" {{{
12257 .Ss "The .netrc file"
12260 .Pa .netrc
12261 file contains user credentials for machine accounts.
12262 The default location in the user's
12263 .Ev HOME
12264 directory may be overridden by the
12265 .Ev NETRC
12266 environment variable.
12267 The file consists of space, tabulator or newline separated tokens.
12268 \*(UA implements a parser that supports a superset of the original BSD
12269 syntax, but users should nonetheless be aware of portability glitches
12270 of that file format, shall their
12271 .Pa .netrc
12272 be usable across multiple programs and platforms:
12275 .Bl -bullet -compact
12277 BSD does not support single, but only double quotation marks, e.g.,
12278 .Ql password="pass with spaces" .
12280 BSD (only?) supports escaping of single characters via a reverse solidus
12281 (e.g., a space can be escaped via
12282 .Ql \e\0 ) ,
12283 in- as well as outside of a quoted string.
12285 BSD does not require a final quotation mark of the last user input token.
12287 The original BSD (Berknet) parser also supported a format which allowed
12288 tokens to be separated with commas \(en whereas at least Hewlett-Packard
12289 still seems to support this syntax, \*(UA does not!
12291 As a non-portable extension some widely-used programs support
12292 shell-style comments: if an input line starts, after any amount of
12293 whitespace, with a number sign
12294 .Ql # ,
12295 then the rest of the line is ignored.
12297 Whereas other programs may require that the
12298 .Pa .netrc
12299 file is accessible by only the user if it contains a
12300 .Cd password
12301 token for any other
12302 .Cd login
12303 than
12304 .Dq anonymous ,
12305 \*(UA will always require these strict permissions.
12309 Of the following list of supported tokens \*(UA only uses (and caches)
12310 .Cd machine ,
12311 .Cd login
12313 .Cd password .
12314 At runtime the command
12315 .Ic netrc
12316 can be used to control \*(UA's
12317 .Pa .netrc
12318 cache.
12320 .Bl -tag -width ".It Cd BaNg"
12321 .It Cd machine Ar name
12322 The hostname of the entries' machine, lowercase-normalized by \*(UA
12323 before use.
12324 Any further file content, until either end-of-file or the occurrence
12325 of another
12326 .Cd machine
12327 or a
12328 .Cd default
12329 first-class token is bound (only related) to the machine
12330 .Ar name .
12332 As an extension that should not be the cause of any worries
12333 \*(UA supports a single wildcard prefix for
12334 .Ar name :
12335 .Bd -literal -offset indent
12336 machine *.example.com login USER password PASS
12337 machine pop3.example.com login USER password PASS
12338 machine smtp.example.com login USER password PASS
12341 which would match
12342 .Ql xy.example.com
12343 as well as
12344 .Ql pop3.example.com ,
12345 but neither
12346 .Ql example.com
12348 .Ql local.smtp.example.com .
12349 Note that in the example neither
12350 .Ql pop3.example.com
12352 .Ql smtp.example.com
12353 will be matched by the wildcard, since the exact matches take
12354 precedence (it is however faster to specify it the other way around).
12356 .It Cd default
12357 This is the same as
12358 .Cd machine
12359 except that it is a fallback entry that is used shall none of the
12360 specified machines match; only one default token may be specified,
12361 and it must be the last first-class token.
12363 .It Cd login Ar name
12364 The user name on the remote machine.
12366 .It Cd password Ar string
12367 The user's password on the remote machine.
12369 .It Cd account Ar string
12370 Supply an additional account password.
12371 This is merely for FTP purposes.
12373 .It Cd macdef Ar name
12374 Define a macro.
12375 A macro is defined with the specified
12376 .Ar name ;
12377 it is formed from all lines beginning with the next line and continuing
12378 until a blank line is (consecutive newline characters are) encountered.
12379 (Note that
12380 .Cd macdef
12381 entries cannot be utilized by multiple machines, too, but must be
12382 defined following the
12383 .Ic machine
12384 they are intended to be used with.)
12385 If a macro named
12386 .Ar init
12387 exists, it is automatically run as the last step of the login process.
12388 This is merely for FTP purposes.
12390 .\" }}}
12392 .\" }}}
12395 .\" .Sh EXAMPLES {{{
12396 .Sh EXAMPLES
12398 .\" .Ss "An example configuration" {{{
12399 .Ss "An example configuration"
12401 .Bd -literal -offset indent
12402 # This example assumes v15.0 compatibility mode
12403 set v15-compat
12405 # Request strict transport security checks!
12406 set ssl-verify=strict
12408 # Where are the up-to-date SSL certificates?
12409 # (Since we manage up-to-date ones explicitly, do not use any,
12410 # possibly outdated, default certificates shipped with OpenSSL)
12411 #set ssl-ca-dir=/etc/ssl/certs
12412 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
12413 set ssl-ca-no-defaults
12414 #set ssl-ca-flags=partial-chain
12415 wysh set smime-ca-file="${ssl-ca-file}" \e
12416   smime-ca-no-defaults #smime-ca-flags="${ssl-ca-flags}"
12418 # Do not use protocols older than TLS v1.2.
12419 # Change this only when the remote server does not support it:
12420 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
12421 # such explicit exceptions, then, e.g.
12422 #   set ssl-protocol-exam.ple='-ALL,+TLSv1.1'
12423 set ssl-protocol='-ALL,+TLSv1.2'
12425 # Explicitly define the list of ciphers, which may improve security,
12426 # especially with protocols older than TLS v1.2.  See ciphers(1).
12427 # Including "@STRENGTH" will sort the final list by algorithm strength.
12428 # In reality it is possibly best to only use ssl-cipher-list-HOST
12429 # (or -USER@HOST), as necessary, again..
12430 set ssl-cipher-list=TLSv1.2:!aNULL:!eNULL:@STRENGTH
12432 # - TLSv1.2:!aNULL:!eNULL:\e
12433 #     ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
12434 #     DHE-RSA-AES256-SHA:@STRENGTH
12435 # -ALL:!aNULL:!eNULL:!MEDIUM:!LOW:!MD5:!RC4:!EXPORT:@STRENGTH
12436 # Especially with TLSv1.3 curves selection may be desired:
12437 #set ssl-curves=P-521:P-384:P-256
12439 # Essential setting: select allowed character sets
12440 set sendcharsets=utf-8,iso-8859-1
12442 # A very kind option: when replying to a message, first try to
12443 # use the same encoding that the original poster used herself!
12444 set reply-in-same-charset
12446 # When replying, do not merge From: and To: of the original message
12447 # into To:.  Instead old From: -> new To:, old To: -> merge Cc:.
12448 set recipients-in-cc
12450 # When sending messages, wait until the Mail-Transfer-Agent finishs.
12451 # Only like this you will be able to see errors reported through the
12452 # exit status of the MTA (including the built-in SMTP one)!
12453 set sendwait
12455 # Only use built-in MIME types, no mime.types(5) files
12456 set mimetypes-load-control
12458 # Default directory where we act in (relative to $HOME)
12459 set folder=mail
12460 # A leading "+" (often) means: under *folder*
12461 # *record* is used to save copies of sent messages
12462 set MBOX=+mbox.mbox DEAD=+dead.txt \e
12463   record=+sent.mbox record-files record-resent
12465 # Make "file mymbox" and "file myrec" go to..
12466 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
12468 # Not really optional, e.g., for S/MIME
12469 set from='Your Name <address@exam.ple>'
12471 # It may be necessary to set hostname and/or smtp-hostname
12472 # if the "SERVER" of mta and "domain" of from do not match.
12473 # The `urlencode' command can be used to encode USER and PASS
12474 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
12475   smtp-auth=login/plain... \e
12476   smtp-use-starttls
12478 # Never refuse to start into interactive mode, and more
12479 set emptystart \e
12480   colour-pager crt= \e
12481   followup-to followup-to-honour=ask-yes \e
12482   history-file=+.\*(uAhist history-size=-1 history-gabby \e
12483   mime-counter-evidence=0xE \e
12484   prompt='?\e?!\e![\e${account}#\e${mailbox-display}]? ' \e
12485   reply-to-honour=ask-yes \e
12486   umask=
12488 # Only include the selected header fields when typing messages
12489 headerpick type retain from_ date from to cc subject \e
12490   message-id mail-followup-to reply-to
12491 # ...when forwarding messages
12492 headerpick forward retain subject date from to cc
12493 # ...when saving message, etc.
12494 #headerpick save ignore ^Original-.*$ ^X-.*$
12496 # Some mailing lists
12497 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
12498 mlsubscribe '^xfans@xfans\e.xyz$'
12500 # Handle a few file extensions (to store MBOX databases)
12501 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
12502   gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
12503   zst 'zstd -dc' 'zstd -19 -zc' \e
12504   zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
12506 # A real life example of a very huge free mail provider
12507 # Instead of directly placing content inside `account',
12508 # we `define' a macro: like that we can switch "accounts"
12509 # from within *on-compose-splice*, for example!
12510 define XooglX {
12511   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
12512   set from='Your Name <address@examp.ple>'
12513   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
12515 account XooglX {
12516   \ecall XooglX
12519 # Here is a pretty large one which does not allow sending mails
12520 # if there is a domain name mismatch on the SMTP protocol level,
12521 # which would bite us if the value of from does not match, e.g.,
12522 # for people who have a sXXXXeforge project and want to speak
12523 # with the mailing list under their project account (in from),
12524 # still sending the message through their normal mail provider
12525 define XandeX {
12526   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
12527   set from='Your Name <address@exam.ple>'
12528   set mta=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
12529     hostname=yaXXex.com smtp-hostname=
12531 account XandeX {
12532   \ecall Xandex
12535 # Create some new commands so that, e.g., `ls /tmp' will..
12536 commandalias lls '!ls ${LS_COLOR_FLAG} -aFlrS'
12537 commandalias llS '!ls ${LS_COLOR_FLAG} -aFlS'
12539 # We do not support gpg(1) directly yet.  But simple --clearsign'd
12540 # message parts can be dealt with as follows:
12541 define V {
12542   localopts yes
12543   wysh set pipe-text/plain=$'@*#++=@\e
12544     < "${MAILX_FILENAME_TEMPORARY}" awk \e
12545         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
12546       BEGIN{done=0}\e
12547       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
12548         if(done++ != 0)\e
12549           next;\e
12550         print "--- GPG --verify ---";\e
12551         system("gpg --verify " TMPFILE " 2>&1");\e
12552         print "--- GPG --verify ---";\e
12553         print "";\e
12554         next;\e
12555       }\e
12556       /^-----BEGIN PGP SIGNATURE-----/,\e
12557           /^-----END PGP SIGNATURE-----/{\e
12558         next;\e
12559       }\e
12560       {print}\e
12561     \e''
12562     print
12564 commandalias V '\e'call V
12568 When storing passwords in
12569 .Pa \*(ur
12570 appropriate permissions should be set on this file with
12571 .Ql $ chmod 0600 \*(ur .
12572 If the \*(OPal
12573 .Va netrc-lookup
12574 is available user credentials can be stored in the central
12575 .Pa .netrc
12576 file instead; e.g., here is a different version of the example account
12577 that sets up SMTP and POP3:
12579 .Bd -literal -offset indent
12580 define XandeX {
12581   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
12582   set from='Your Name <address@exam.ple>'
12583   set netrc-lookup
12584   # Load an encrypted ~/.netrc by uncommenting the next line
12585   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
12587   set mta=smtps://smtp.yXXXXx.ru:465 \e
12588       smtp-hostname= hostname=yXXXXx.com
12589   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
12590   commandalias xp fi pop3s://pop.yXXXXx.ru
12592 account XandeX {
12593   \ecall XandeX
12598 and, in the
12599 .Pa .netrc
12600 file:
12602 .Bd -literal -offset indent
12603 machine *.yXXXXx.ru login USER password PASS
12607 This configuration should now work just fine:
12610 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
12611 .\" }}}
12613 .\" .Ss "S/MIME step by step" {{{
12614 .Ss "S/MIME step by step"
12616 \*(OP The first thing you need for participating in S/MIME message
12617 exchange is your personal certificate, including a private key.
12618 The certificate contains public information, in particular your name and
12619 your email address(es), and the public key that is used by others to
12620 encrypt messages for you,
12621 and to verify signed messages they supposedly received from you.
12622 The certificate is included in each signed message you send.
12623 The private key must be kept secret.
12624 It is used to decrypt messages that were previously encrypted with your
12625 public key, and to sign messages.
12628 For personal use it is recommended that you get a S/MIME certificate
12629 from one of the major CAs on the Internet using your WWW browser.
12630 Many CAs offer such certificates for free.
12631 There is also
12632 .Lk https://www.CAcert.org
12633 which issues client and server certificates to members of their
12634 community for free; their root certificate
12635 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
12636 is often not in the default set of trusted CA root certificates, though,
12637 which means you will have to download their root certificate separately
12638 and ensure it is part of our S/MIME certificate validation chain by
12639 including it in
12640 .Va smime-ca-dir
12641 or as a vivid member of the
12642 .Va smime-ca-file .
12643 But let us take a step-by-step tour on how to setup S/MIME with
12644 a certificate from CAcert.org despite this situation!
12647 First of all you will have to become a member of the CAcert.org
12648 community, simply by registrating yourself via the web interface.
12649 Once you are, create and verify all email addresses you want to be able
12650 to create signed and encrypted messages for/with using the corresponding
12651 entries of the web interface.
12652 Now ready to create S/MIME certificates, so let us create a new
12653 .Dq client certificate ,
12654 ensure to include all email addresses that should be covered by the
12655 certificate in the following web form, and also to use your name as the
12656 .Dq common name .
12659 Create a private key and a certificate request on your local computer
12660 (please see the manual pages of the used commands for more in-depth
12661 knowledge on what the used arguments etc. do):
12664 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
12667 Afterwards copy-and-paste the content of
12668 .Dq creq.pem
12669 into the certificate-request (CSR) field of the web form on the
12670 CAcert.org website (you may need to unfold some
12671 .Dq advanced options
12672 to see the corresponding text field).
12673 This last step will ensure that your private key (which never left your
12674 box) and the certificate belong together (through the public key that
12675 will find its way into the certificate via the certificate-request).
12676 You are now ready and can create your CAcert certified certificate.
12677 Download and store or copy-and-paste it as
12678 .Dq pub.crt .
12681 Yay.
12682 In order to use your new S/MIME setup a combined private key/public key
12683 (certificate) file has to be created:
12686 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
12689 This is the file \*(UA will work with.
12690 If you have created your private key with a passphrase then \*(UA will
12691 ask you for it whenever a message is signed or decrypted.
12692 Set the following variables to henceforth use S/MIME (setting
12693 .Va smime-ca-file
12694 is of interest for verification only):
12696 .Bd -literal -offset indent
12697 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
12698     smime-sign-cert=ME@HERE.com.paired \e
12699     smime-sign-message-digest=SHA256 \e
12700     smime-sign
12703 .\" }}}
12705 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
12706 .Ss "Using CRLs with S/MIME or SSL/TLS"
12708 \*(OP Certification authorities (CAs) issue certificate revocation
12709 lists (CRLs) on a regular basis.
12710 These lists contain the serial numbers of certificates that have been
12711 declared invalid after they have been issued.
12712 Such usually happens because the private key for the certificate has
12713 been compromised,
12714 because the owner of the certificate has left the organization that is
12715 mentioned in the certificate, etc.
12716 To seriously use S/MIME or SSL/TLS verification,
12717 an up-to-date CRL is required for each trusted CA.
12718 There is otherwise no method to distinguish between valid and
12719 invalidated certificates.
12720 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
12721 the Internet, so they have to be retrieved by some external mechanism.
12724 \*(UA accepts CRLs in PEM format only;
12725 CRLs in DER format must be converted, like, e.\|g.:
12728 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
12731 To tell \*(UA about the CRLs, a directory that contains all CRL files
12732 (and no other files) must be created.
12734 .Va smime-crl-dir
12736 .Va ssl-crl-dir
12737 variables, respectively, must then be set to point to that directory.
12738 After that, \*(UA requires a CRL to be present for each CA that is used
12739 to verify a certificate.
12740 .\" }}}
12742 .\" }}} (Examples)
12745 .\" .Sh "FAQ" {{{
12746 .Sh "FAQ"
12748 In general it is a good idea to turn on
12749 .Va debug
12750 .Pf ( Fl d )
12751 and / or
12752 .Va verbose
12753 .Pf ( Fl v ,
12754 twice) if something does not work well.
12755 Very often a diagnostic message can be produced that leads to the
12756 problems' solution.
12758 .\" .Ss "\*(UA shortly hangs on startup" {{{
12759 .Ss "\*(UA shortly hangs on startup"
12761 This can have two reasons, one is the necessity to wait for a file lock
12762 and cannot be helped, the other being that \*(UA calls the function
12763 .Xr uname 2
12764 in order to query the nodename of the box (sometimes the real one is
12765 needed instead of the one represented by the internal variable
12766 .Va hostname ) .
12767 One may have varying success by ensuring that the real hostname and
12768 .Ql localhost
12769 have entries in
12770 .Pa /etc/hosts ,
12771 or, more generally, that the name service is properly setup \(en
12772 and does
12773 .Xr hostname 1
12774 return the expected value?
12775 Does this local hostname have a domain suffix?
12776 RFC 6762 standardized the link-local top-level domain
12777 .Ql .local ,
12778 try again after adding an (additional) entry with this extension.
12779 .\" }}}
12781 .\" .Ss "I cannot login to Google mail aka GMail" {{{
12782 .Ss "I cannot login to Google mail aka GMail"
12784 Since 2014 some free service providers classify programs as
12785 .Dq less secure
12786 unless they use a special authentification method (OAuth 2.0) which
12787 was not standardized for non-HTTP protocol authentication token query
12788 until August 2015 (RFC 7628).
12791 Different to Kerberos / GSSAPI, which is developed since the mid of the
12792 1980s, where a user can easily create a local authentication ticket for
12793 her- and himself with the locally installed
12794 .Xr kinit 1
12795 program, that protocol has no such local part but instead requires
12796 a world-wide-web query to create or fetch a token; since there is no
12797 local cache this query would have to be performed whenever \*(UA is
12798 invoked (in interactive sessions situation may differ).
12801 \*(UA does not support OAuth.
12802 Because of this it is necessary to declare \*(UA a
12803 .Dq less secure app
12804 (on the providers account web page) in order to read and send mail.
12805 However, it also seems possible to take the following steps instead:
12808 .Bl -enum -compact
12810 give the provider the number of a mobile phone,
12812 enable
12813 .Dq 2-Step Verification ,
12815 create an application specific password (16 characters), and
12817 use that special password instead of the real Google account password in
12818 \*(UA (for more on that see the section
12819 .Sx "On URL syntax and credential lookup" ) .
12821 .\" }}}
12823 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
12824 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
12826 It can happen that the terminal library (see
12827 .Sx "On terminal control and line editor",
12828 .Ic bind ,
12829 .Va termcap )
12830 reports different codes than the terminal really sends, in which case
12831 \*(UA will tell that a key binding is functional, but will not be able to
12832 recognize it because the received data does not match anything expected.
12833 Especially without the \*(OPal terminal capability library support one
12834 reason for this may be that the (possibly even non-existing) keypad
12835 is not turned on and the resulting layout reports the keypad control
12836 codes for the normal keyboard keys.
12838 .Va verbose
12839 listing of
12840 .Ic bind Ns
12841 ings will show the byte sequences that are expected.
12844 To overcome the situation, use, e.g., the program
12845 .Xr cat 1 ,
12846 in conjunction with the command line option
12847 .Fl \&\&v ,
12848 if available, to see the byte sequences which are actually produced
12849 by keypresses, and use the variable
12850 .Va termcap
12851 to make \*(UA aware of them.
12852 E.g., the terminal this is typed on produces some false sequences, here
12853 an example showing the shifted home key:
12855 .Bd -literal -offset indent
12856 ? set verbose
12857 ? bind*
12858 # 1B 5B=[ 31=1 3B=; 32=2 48=H
12859   bind base :kHOM z0
12860 ? x
12861 $ cat -v
12862 ^[[H
12863 ? \*(uA -v -Stermcap='kHOM=\eE[H'
12864 ? bind*
12865 # 1B 5B=[ 48=H
12866   bind base :kHOM z0
12868 .\" }}}
12870 .\" }}}
12873 .\" .Sh "IMAP CLIENT" {{{
12874 .Sh "IMAP CLIENT"
12876 \*(OPally there is IMAP client support available.
12877 This part of the program is obsolete and will vanish in v15 with the
12878 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
12879 and makes excessive use of signal based long code jumps.
12880 Support can hopefully be readded later based on a new-style I/O, with
12881 SysV signal handling.
12882 In fact the IMAP support had already been removed from the codebase, but
12883 was reinstantiated on user demand: in effect the IMAP code is at the
12884 level of \*(UA v14.8.16 (with
12885 .Ic imapcodec
12886 being the sole exception), and should be treated with some care.
12889 IMAP uses the
12890 .Ql imap://
12892 .Ql imaps://
12893 protocol prefixes, and an IMAP-based
12894 .Va folder
12895 may be used.
12896 IMAP URLs (paths) undergo inspections and possible transformations
12897 before use (and the command
12898 .Ic imapcodec
12899 can be used to manually apply them to any given argument).
12900 Hierarchy delimiters are normalized, a step which is configurable via the
12901 .Va imap-delim
12902 variable chain, but defaults to the first seen delimiter otherwise.
12903 \*(UA supports internationalised IMAP names, and en- and decodes the
12904 names from and to the
12905 .Va ttycharset
12906 as necessary and possible.
12907 If a mailbox name is expanded (see
12908 .Sx "Filename transformations" )
12909 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
12910 mailboxes below the
12911 .Va folder
12912 target box, while folder names prefixed by `@' refer to folders below
12913 the hierarchy base.
12916 Note: some IMAP servers do not accept the creation of mailboxes in
12917 the hierarchy base, but require that they are created as subfolders of
12918 `INBOX' \(en with such servers a folder name of the form
12920 .Dl imaps://mylogin@imap.myisp.example/INBOX.
12922 should be used (the last character is the server's hierarchy
12923 delimiter).
12924 The following IMAP-specific commands exist:
12927 .Bl -tag -width ".It Ic BaNg"
12929 .It Ic cache
12930 Only applicable to cached IMAP mailboxes;
12931 takes a message list and reads the specified messages into the IMAP
12932 cache.
12935 .It Ic connect
12936 If operating in disconnected mode on an IMAP mailbox,
12937 switch to online mode and connect to the mail server while retaining
12938 the mailbox status.
12939 See the description of the
12940 .Va disconnected
12941 variable for more information.
12944 .It Ic disconnect
12945 If operating in online mode on an IMAP mailbox,
12946 switch to disconnected mode while retaining the mailbox status.
12947 See the description of the
12948 .Va disconnected
12949 variable for more.
12950 A list of messages may optionally be given as argument;
12951 the respective messages are then read into the cache before the
12952 connection is closed, thus
12953 .Ql disco *
12954 makes the entire mailbox available for disconnected use.
12957 .It Ic imap
12958 Sends command strings directly to the current IMAP server.
12959 \*(UA operates always in IMAP `selected state' on the current mailbox;
12960 commands that change this will produce undesirable results and should be
12961 avoided.
12962 Useful IMAP commands are:
12963 .Bl -tag -offset indent -width ".Ic getquotearoot"
12964 .It create
12965 Takes the name of an IMAP mailbox as an argument and creates it.
12966 .It getquotaroot
12967 (RFC 2087) Takes the name of an IMAP mailbox as an argument
12968 and prints the quotas that apply to the mailbox.
12969 Not all IMAP servers support this command.
12970 .It namespace
12971 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
12972 the Other User's Namespaces and the Shared Namespaces.
12973 Each namespace type is printed in parentheses;
12974 if there are multiple namespaces of the same type,
12975 inner parentheses separate them.
12976 For each namespace a prefix and a hierarchy separator is listed.
12977 Not all IMAP servers support this command.
12981 .It Ic imapcodec
12982 Perform IMAP path transformations.
12983 Supports
12984 .Cm vput
12985 (see
12986 .Sx "Command modifiers" ) ,
12987 and manages the error number
12988 .Va \&! .
12989 The first argument specifies the operation:
12990 .Ar e[ncode]
12991 normalizes hierarchy delimiters (see
12992 .Va imap-delim )
12993 and converts the strings from the locale
12994 .Va ttycharset
12995 to the internationalized variant used by IMAP,
12996 .Ar d[ecode]
12997 performs the reverse operation.
13002 The following IMAP-specific internal variables exist:
13005 .Bl -tag -width ".It Va BaNg"
13007 .It Va disconnected
13008 \*(BO When an IMAP mailbox is selected and this variable is set,
13009 no connection to the server is initiated.
13010 Instead, data is obtained from the local cache (see
13011 .Va imap-cache Ns
13013 Mailboxes that are not present in the cache
13014 and messages that have not yet entirely been fetched from the server
13015 are not available;
13016 to fetch all messages in a mailbox at once,
13017 the command
13018 .No ` Ns Li copy * /dev/null Ns '
13019 can be used while still in connected mode.
13020 Changes that are made to IMAP mailboxes in disconnected mode are queued
13021 and committed later when a connection to that server is made.
13022 This procedure is not completely reliable since it cannot be guaranteed
13023 that the IMAP unique identifiers (UIDs) on the server still match the
13024 ones in the cache at that time.
13025 Data is saved to
13026 .Ev DEAD
13027 when this problem occurs.
13029 .It Va disconnected-USER@HOST
13030 The specified account is handled as described for the
13031 .Va disconnected
13032 variable above,
13033 but other accounts are not affected.
13035 .Mx Va imap-auth
13036 .It Va imap-auth-USER@HOST , imap-auth
13037 Sets the IMAP authentication method.
13038 Valid values are `login' for the usual password-based authentication
13039 (the default),
13040 `cram-md5', which is a password-based authentication that does not send
13041 the password over the network in clear text,
13042 and `gssapi' for GSS-API based authentication.
13045 .It Va imap-cache
13046 Enables caching of IMAP mailboxes.
13047 The value of this variable must point to a directory that is either
13048 existent or can be created by \*(UA.
13049 All contents of the cache can be deleted by \*(UA at any time;
13050 it is not safe to make assumptions about them.
13052 .Mx Va imap-delim
13053 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
13054 The hierarchy separator used by the IMAP server.
13055 Whenever an IMAP path is specified it will undergo normalization.
13056 One of the normalization steps is the squeezing and adjustment of
13057 hierarchy separators.
13058 If this variable is set, any occurrence of any character of the given
13059 value that exists in the path will be replaced by the first member of
13060 the value; an empty value will cause the default to be used, it is
13061 .Ql /. .
13062 If not set, we will reuse the first hierarchy separator character that
13063 is discovered in a user-given mailbox name.
13065 .Mx Va imap-keepalive
13066 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
13067 IMAP servers may close the connection after a period of
13068 inactivity; the standard requires this to be at least 30 minutes,
13069 but practical experience may vary.
13070 Setting this variable to a numeric `value' greater than 0 causes
13071 a `NOOP' command to be sent each `value' seconds if no other operation
13072 is performed.
13075 .It Va imap-list-depth
13076 When retrieving the list of folders on an IMAP server, the
13077 .Ic folders
13078 command stops after it has reached a certain depth to avoid possible
13079 infinite loops.
13080 The value of this variable sets the maximum depth allowed.
13081 The default is 2.
13082 If the folder separator on the current IMAP server is a slash `/',
13083 this variable has no effect and the
13084 .Ic folders
13085 command does not descend to subfolders.
13087 .Mx Va imap-use-starttls
13088 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
13089 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
13090 IMAP session SSL/TLS encrypted.
13091 This functionality is not supported by all servers,
13092 and is not used if the session is already encrypted by the IMAPS method.
13095 .\" }}}
13098 .\" .Sh "SEE ALSO" {{{
13099 .Sh "SEE ALSO"
13101 .Xr bogofilter 1 ,
13102 .Xr gpg 1 ,
13103 .Xr more 1 ,
13104 .Xr newaliases 1 ,
13105 .Xr openssl 1 ,
13106 .Xr sendmail 1 ,
13107 .Xr sh 1 ,
13108 .Xr spamassassin 1 ,
13109 .Xr iconv 3 ,
13110 .Xr setlocale 3 ,
13111 .Xr aliases 5 ,
13112 .Xr termcap 5 ,
13113 .Xr terminfo 5 ,
13114 .Xr locale 7 ,
13115 .Xr mailaddr 7 ,
13116 .Xr re_format 7 ,
13117 .Xr mailwrapper 8 ,
13118 .Xr sendmail 8
13120 .\" }}}
13123 .\" .Sh HISTORY {{{
13124 .Sh HISTORY
13126 M. Douglas McIlroy writes in his article
13127 .Dq A Research UNIX Reader: Annotated Excerpts \
13128 from the Programmer's Manual, 1971-1986
13129 that a
13130 .Xr mail 1
13131 command already appeared in First Edition
13133 in 1971:
13135 .Bd -ragged -offset indent
13136 Electronic mail was there from the start.
13137 Never satisfied with its exact behavior, everybody touched it at one
13138 time or another: to assure the safety of simultaneous access, to improve
13139 privacy, to survive crashes, to exploit uucp, to screen out foreign
13140 freeloaders, or whatever.
13141 Not until v7 did the interface change (Thompson).
13142 Later, as mail became global in its reach, Dave Presotto took charge and
13143 brought order to communications with a grab-bag of external networks
13144 (v8).
13149 Mail was written in 1978 by Kurt Shoens and developed as part of the
13152 distribution until 1995.
13153 Mail has then seen further development in open source
13155 variants, noticeably by Christos Zoulas in
13156 .Pf Net Bx .
13157 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
13158 Ritter in the years 2000 until 2008.
13159 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
13160 This man page is derived from
13161 .Dq The Mail Reference Manual
13162 that was originally written by Kurt Shoens.
13164 .\" }}}
13167 .Sh AUTHORS
13169 .An "Kurt Shoens" ,
13170 .An "Edward Wang" ,
13171 .An "Keith Bostic" ,
13172 .An "Christos Zoulas" ,
13173 .An "Gunnar Ritter" ,
13174 .An "Steffen Nurpmeso" .
13177 The variables
13178 .Va contact-mail
13180 .Va contact-web
13181 provide contact addresses:
13183 .\" v15-compat: drop eval as `mail' will expand variable?
13184 .Dl ? echo $contact-web; eval mail $contact-mail
13187 .\" .Sh CAVEATS {{{
13188 .Sh CAVEATS
13190 \*(ID Interrupting an operation via
13191 .Dv \&\&SIGINT
13193 .Ql control-C
13194 from anywhere else but a command prompt is very problematic and likely
13195 to leave the program in an undefined state: many library functions
13196 cannot deal with the
13197 .Fn siglongjmp 3
13198 that this software (still) performs; even though efforts have been taken
13199 to address this, no sooner but in v15 it will have been worked out:
13200 interruptions have not been disabled in order to allow forceful breakage
13201 of hanging network connections, for example (all this is unrelated to
13202 .Va ignore ) .
13205 The SMTP and POP3 protocol support of \*(UA is very basic.
13206 Also, if it fails to contact its upstream SMTP server, it will not make
13207 further attempts to transfer the message at a later time (setting
13208 .Va save
13210 .Va sendwait
13211 may be useful).
13212 If this is a concern, it might be better to set up a local SMTP server
13213 that is capable of message queuing.
13215 .\" }}}
13218 .Sh BUGS
13220 After deleting some message of a POP3 mailbox the header summary falsely
13221 claims that there are no messages to display, one needs to perform
13222 a scroll or dot movement to restore proper state.
13224 In threaded display a power user may encounter crashes very
13225 occasionally (this is may and very).
13227 The file
13228 .Pa TODO
13229 in the source repository lists future directions.
13231 .\" s-ts-mode