a_nag_elide_qsort(): FIX false sorting, II (Michael Dressel)[..]
[s-mailx.git] / nail.1
blob46f6121f3d6281e6ed769d001d43958b8aab5392
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2018 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.10 / 2018-03-25
35 .Dd March 25, 2018
36 .ds VV \\%v14.9.10
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 .ds ur \\%~/.mailrc
44 .ds VD \\%~/dead.letter
45 .ds VM \\%~/mbox
46 .ds VN \\%~/.netrc
47 .ds VT \\%/tmp
48 .ds vS /etc/mime.types
49 .ds vU ~/.mime.types
50 .\"--MKMAN-END--
51 .\" --BEGINSTRIP--
52 .\"
53 .ds OB [Obsolete]
54 .ds OP [Option]
55 .ds IN [v15-compat]
56 .ds OU [no v15-compat]
57 .ds ID [v15 behaviour may differ]
58 .ds NQ [Only new quoting rules]
59 .ds BO (Boolean)
60 .ds RO (Read-only)
61 .\"
62 .if !d str-Lb-libterminfo \
63   .ds str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo)
65 .Dt "\*(UU" 1
66 .Os
67 .Mx -enable
70 .Sh NAME
71 .Nm \*(UA \%[\*(VV]
72 .Nd send and receive Internet mail
75 .\" .Sh SYNOPSIS {{{
76 .Sh SYNOPSIS
78 .\" Keep in SYNC: ./nail.1:"SYNOPSIS, main()
79 .Nm \*(uA
80 .Bk -words
81 .Op Fl BDdEFinv~#
82 .Op Fl \&: Ar spec
83 .Op Fl A Ar account
84 .Op : Ns Fl a Ar attachment Ns \&:
85 .Op : Ns Fl b Ar bcc-addr Ns \&:
86 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
87 .Op : Ns Fl c Ar cc-addr Ns \&:
88 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
89 .Op Fl r Ar from-addr
90 .Oo : Ns
91 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
92 .Pf \&: Oc
93 .Op Fl s Ar subject
94 .Op : Ns Fl X Ar cmd Ns \&:
95 .Op Fl \&.
96 .Pf : Ar to-addr Ns \&:
97 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
98 .Ek
99 .Pp
100 .Nm \*(uA
101 .Bk -words
102 .Op Fl BDdEeHiNnRv~#
103 .Op Fl \&: Ar spec
104 .Op Fl A Ar account
105 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
106 .Op Fl L Ar spec
107 .Op Fl r Ar from-addr
108 .Oo : Ns
109 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
110 .Pf \&: Oc
111 .Op Fl u Ar user
112 .Op : Ns Fl X Ar cmd Ns \&:
113 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
115 .Nm \*(uA
116 .Bk -words
117 .Op Fl BDdEeHiNnRv~#
118 .Op Fl \&: Ar spec
119 .Op Fl A Ar account
120 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
121 .Fl f
122 .Op Fl L Ar spec
123 .Op Fl r Ar from-addr
124 .Oo : Ns
125 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
126 .Pf \&: Oc
127 .Op : Ns Fl X Ar cmd Ns \&:
128 .Op Ar file
129 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
132 .Nm \*(uA
133 .Fl h | Fl Fl help
134 .Nm \*(uA
135 .Fl V | Fl Fl version
137 .\" }}}
140 .Mx -toc -tree html pdf ps xhtml
143 .\" .Sh DESCRIPTION {{{
144 .Sh DESCRIPTION
146 .Bd -filled -compact -offset indent
147 .Sy Compatibility note:
148 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2020).
149 Backward incompatibility has to be expected \(en
150 .Sx COMMANDS
151 will use
152 .Sx "Shell-style argument quoting"
153 rules, for example, and shell metacharacters will become meaningful.
154 New and old behaviour is flagged \*(IN and \*(OU, and setting
155 .Va v15-compat ,
156 one of the many
157 .Sx "INTERNAL VARIABLES" ,
158 will choose new behaviour when applicable.
159 \*(OB flags what will vanish, and enabling
160 .Fl d
162 .Fl v
163 enables obsoletion warnings.
167 \*(UA provides a simple and friendly environment for sending and
168 receiving mail.
169 It is intended to provide the functionality of the POSIX
170 .Xr mailx 1
171 command, but is MIME capable and optionally offers extensions for
172 line editing, S/MIME, SMTP and POP3, among others.
173 \*(UA divides incoming mail into its constituent messages and allows
174 the user to deal with them in any order.
175 It offers many
176 .Sx COMMANDS
178 .Sx "INTERNAL VARIABLES"
179 for manipulating messages and sending mail.
180 It provides the user simple editing capabilities to ease the composition
181 of outgoing messages, and increasingly powerful and reliable
182 non-interactive scripting capabilities.
184 .\" .Ss "Options" {{{
185 .Ss "Options"
187 .Bl -tag -width ".It Fl BaNg"
189 .It Fl \&: Ar spec
190 Explicitly control which of the
191 .Sx "Resource files"
192 shall be
193 .Ic source Ns
194 d (loaded): if the letter
195 .Ql s
196 is (case-insensitively) part of the
197 .Ar spec
198 then the system wide
199 .Pa \*(UR
200 is sourced, likewise the letter
201 .Ql u
202 controls sourcing of the user's personal
203 .Pa \*(ur
204 file, whereas the letters
205 .Ql -
207 .Ql /
208 explicitly forbid sourcing of any resource files.
209 Scripts should use this option: to avoid environmental noise they should
210 .Dq detach
211 from any configuration and create a script-specific environment, setting
212 any of the desired
213 .Sx "INTERNAL VARIABLES"
215 .Fl S
216 and running configurating commands via
217 .Fl X .
218 This option overrides
219 .Fl n .
222 .It Fl A Ar account
223 Executes an
224 .Ic account
225 command for the given user email
226 .Ar account
227 after program startup is complete (all resource files are loaded, any
228 .Fl S
229 setting is being established; only
230 .Fl X
231 commands have not been evaluated yet).
232 Being a special incarnation of
233 .Ic define Ns d
234 macros for the purpose of bundling longer-lived
235 .Ic set Ns
236 tings, activating such an email account also switches to the accounts
237 .Mx -sx
238 .Sx "primary system mailbox"
239 (most likely the
240 .Va inbox ) .
241 If the operation fails the program will exit if it is used
242 non-interactively, or if any of
243 .Va errexit
245 .Va posix
246 are set.
249 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
250 Attach
251 .Ar file
252 to the message (for compose mode opportunities refer to
253 .Ic ~@
255 .Ic ~^ ) .
256 .Sx "Filename transformations"
257 (also see
258 .Ic file )
259 will be performed, except that shell variables are not expanded.
260 Shall
261 .Ar file
262 not be accessible but contain a
263 .Ql =
264 character, then anything before the last
265 .Ql =
266 will be used as the filename, anything thereafter as a character set
267 specification.
269 If an input character set is specified,
270 .Mx -ix "character set specification"
271 but no output character set, then the given input character set is fixed
272 as-is, and no conversion will be applied;
273 giving the empty string or the special string hyphen-minus
274 .Ql -
275 will be treated as if
276 .Va ttycharset
277 has been specified (the default).
279 If an output character set has also been given then the conversion will
280 be performed exactly as specified and on-the-fly, not considering the
281 file type and content.
282 As an exception, if the output character set is specified as the empty
283 string or hyphen-minus
284 .Ql - ,
285 then the default conversion algorithm (see
286 .Sx "Character sets" )
287 is applied (therefore no conversion is performed on-the-fly,
288 .Ar file
289 will be MIME-classified and its contents will be inspected first) \(em
290 without support for character set conversions
291 .Pf ( Va features
292 does not include the term
293 .Ql +iconv )
294 only this argument is supported.
296 .It Fl B
297 (\*(OB: \*(UA will always use line-buffered output, to gain
298 line-buffered input even in batch mode enable batch mode via
299 .Fl # . )
302 .It Fl b Ar addr
303 Send a blind carbon copy to
304 .Ar addr Ns
305 ess, if the
306 .Ic set Ns
307 ting of
308 .Va expandaddr ,
309 one of the
310 .Sx "INTERNAL VARIABLES" ,
311 allows.
312 The option may be used multiple times.
313 Also see the section
314 .Sx "On sending mail, and non-interactive mode" .
317 .It Fl C Ar """field: body"""
318 Create a custom header which persists for an entire session.
319 A custom header consists of the field name followed by a colon
320 .Ql \&:
321 and the field content body, e.g.,
322 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" .
323 Standard header field names cannot be overwritten by custom headers.
324 Runtime adjustable custom headers are available via the variable
325 .Va customhdr ,
326 and in compose mode
327 .Ic ~^ ,
328 one of the
329 .Sx "COMMAND ESCAPES" ,
330 is the most flexible and powerful option to manage message headers.
331 This option may be used multiple times.
334 .It Fl c Ar addr
335 Send carbon copies to the given receiver, if so allowed by
336 .Va expandaddr .
337 May be used multiple times.
340 .It Fl D
341 (\*(OP) Startup with
342 .Va disconnected
343 .Ic set .
346 .It Fl d
347 Almost enable a sandbox mode with the internal variable
348 .Va debug ;
349 the same can be achieved via
350 .Ql Fl S Va \&\&debug
352 .Ql Ic set Va \&\&debug .
355 .It Fl E
356 .Ic set
357 .Va skipemptybody
358 and thus discard messages with an empty message part body.
361 .It Fl e
362 Just check if mail is present (in the system
363 .Va inbox
364 or the one specified via
365 .Fl f ) :
366 if yes, return an exit status of zero, a non-zero value otherwise.
367 To restrict the set of mails to consider in this evaluation a message
368 specification can be added with the option
369 .Fl L .
372 .It Fl F
373 Save the message to send in a file named after the local part of the
374 first recipient's address (instead of in
375 .Va record Ns ).
378 .It Fl f
379 Read in the contents of the user's
380 .Mx -sx
381 .Sx "secondary mailbox"
382 .Ev MBOX
383 (or the specified file) for processing;
384 when \*(UA is quit, it writes undeleted messages back to this file
385 (but be aware of the
386 .Va hold
387 option).
388 The optional
389 .Ar file
390 argument will undergo some special
391 .Sx "Filename transformations"
392 (also see
393 .Ic file ) .
394 Note that
395 .Ar file
396 is not an argument to the flag
397 .Fl \&\&f ,
398 but is instead taken from the command line after option processing has
399 been completed.
400 In order to use a
401 .Ar file
402 that starts with a hyphen-minus, prefix with a relative path, as in
403 .Ql ./-hyphenbox.mbox .
406 .It Fl H
407 Display a summary of
408 .Ic headers
409 and exit; a configurable summary view is available via the
410 .Fl L
411 option.
414 .It Fl h
415 Show a short usage summary.
418 .It Fl i
419 .Ic set
420 .Va ignore
421 to ignore tty interrupt signals.
424 .It Fl L Ar spec
425 Display a summary of
426 .Ic headers
427 of all messages that match the given
428 .Ar spec ,
429 then exit.
430 See the section
431 .Sx "Specifying messages"
432 for the format of
433 .Ar spec .
434 If the
435 .Fl e
436 option has been given in addition no header summary is produced,
437 but \*(UA will instead indicate via its exit status whether
438 .Ar spec
439 matched any messages
440 .Pf ( Ql 0 )
441 or not
442 .Pf ( Ql 1 ) ;
443 note that any verbose output is suppressed in this mode and must instead
444 be enabled explicitly (e.g., by using the option
445 .Fl v ) .
448 .It Fl M Ar type
449 Special send mode that will flag standard input with the MIME
450 .Ql Content-Type:
451 set to the given
452 .Ar type
453 and use it as the main message body.
454 \*(ID Using this option will bypass processing of
455 .Va message-inject-head
457 .Va message-inject-tail .
458 Also see
459 .Fl q , m , t .
462 .It Fl m Ar file
463 Special send mode that will MIME classify the specified
464 .Ar file
465 and use it as the main message body.
466 \*(ID Using this option will bypass processing of
467 .Va message-inject-head
469 .Va message-inject-tail .
470 Also see
471 .Fl q , M , t .
474 .It Fl N
475 inhibit the initial display of message headers when reading mail or
476 editing a mailbox
477 .Ic folder
478 by calling
479 .Ic unset
480 for the internal variable
481 .Va header .
484 .It Fl n
485 Standard flag that inhibits reading the system wide
486 .Pa \*(UR
487 upon startup.
488 The option
489 .Fl \&:
490 allows more control over the startup sequence; also see
491 .Sx "Resource files" .
494 .It Fl q Ar file
495 Special send mode that will initialize the message body with the
496 contents of the specified
497 .Ar file ,
498 which may be standard input
499 .Ql -
500 only in non-interactive context.
501 Also see
502 .Fl M , m , t .
505 .It Fl R
506 Any mailbox
507 .Ic folder
508 a.k.a.\&
509 .Ic file
510 opened will be in read-only mode.
514 .It Fl r Ar from-addr
515 Whereas the source address that appears in the
516 .Va from
517 header of a message (or in the
518 .Va sender
519 header if the former contains multiple addresses) is honoured by the
520 builtin SMTP transport, it is not used by a file-based
521 .Va mta
522 (Mail-Transfer-Agent) for the RFC 5321 reverse-path used for relaying
523 and delegating a message to its destination(s), for delivery errors
524 etc., but it instead uses the local identity of the initiating user.
527 When this command line option is used the given
528 .Ar from-addr
529 will be assigned to the internal variable
530 .Va from ,
531 but in addition the command line option
532 .Fl \&\&f Ar from-addr
533 will be passed to a file-based
534 .Va mta
535 whenever a message is sent.
536 Shall
537 .Ar from-addr
538 include a user name the address components will be separated and
539 the name part will be passed to a file-based
540 .Va mta
541 individually via
542 .Fl \&\&F Ar name .
545 If an empty string is passed as
546 .Ar from-addr
547 then the content of the variable
548 .Va from
549 (or, if that contains multiple addresses,
550 .Va sender )
551 will be evaluated and used for this purpose whenever the file-based
552 .Va mta
553 is contacted.
554 By default, without
555 .Fl \&\&r
556 that is, neither
557 .Fl \&\&f
559 .Fl \&\&F
560 command line options are used when contacting a file-based MTA, unless
561 this automatic deduction is enforced by
562 .Ic set Ns
563 ing the internal variable
564 .Va r-option-implicit .
567 Remarks: many default installations and sites disallow overriding the
568 local user identity like this unless either the MTA has been configured
569 accordingly or the user is member of a group with special privileges.
570 Passing an invalid address will cause an error.
574 .It Fl S Ar var Ns Op = Ns value
575 .Ic set
576 (or, with a prefix string
577 .Ql no ,
578 as documented in
579 .Sx "INTERNAL VARIABLES" ,
580 .Ic unset )
581 .Ar var Ns
582 iable and optionally assign
583 .Ar value ,
584 if supported; \*(ID the entire expression is evaluated as if specified
585 within dollar-single-quotes (see
586 .Sx "Shell-style argument quoting" )
587 if the internal variable
588 .Va v15-compat
589 is set.
590 If the operation fails the program will exit if any of
591 .Va errexit
593 .Va posix
594 are set.
595 Settings established via
596 .Fl \&\&S
597 cannot be changed from within
598 .Sx "Resource files"
599 or an account switch initiated by
600 .Fl A .
601 They will become mutable again before commands registered via
602 .Fl X
603 are executed.
606 .It Fl s Ar subject
607 Specify the subject of the message to be sent.
608 Newline (NL) and carriage-return (CR) bytes are invalid and will be
609 normalized to space (SP) characters.
612 .It Fl t
613 The message given (on standard input) is expected to contain, separated
614 from the message body by an empty line, one or multiple message headers.
615 Headers can span multiple consecutive lines if follow lines start with
616 any amount of whitespace.
617 A line starting with the number sign
618 .Ql #
619 in the first column is ignored.
620 The message headers
621 .Ql To: ,
622 .Ql Cc: ,
624 .Ql Bcc:
625 fields give the message recipients, which will be added to any
626 recipients specified on the command line.
627 If a message subject is specified via
628 .Ql Subject:
629 then it will be used in favour of one given on the command line.
631 More optional headers are
632 .Ql Reply-To:
633 (possibly overriding
634 .Va reply-to ) ,
635 .Ql Sender:
636 .Pf ( Va sender ) ,
637 .Ql From:
638 .Pf ( Va from
639 and / or option
640 .Fl r ) .
641 .Ql Message-ID: ,
642 .Ql In-Reply-To: ,
643 .Ql References:
645 .Ql Mail-Followup-To: ,
646 by default created automatically dependent on message context, will
647 be used if specified (a special address massage will however still occur
648 for the latter).
649 Any other custom header field (also see
650 .Fl C ,
651 .Va customhdr
653 .Ic ~^ )
654 is passed through entirely
655 unchanged, and in conjunction with the options
656 .Fl ~
658 .Fl #
659 it is possible to embed
660 .Sx "COMMAND ESCAPES" .
661 Also see
662 .Fl M , m , q .
665 .It Fl u Ar user
666 Initially read the
667 .Mx -sx
668 .Sx "primary system mailbox"
670 .Ar user ,
671 appropriate privileges presumed; effectively identical to
672 .Ql Fl \&\&f Ns \0%user .
675 .It Fl V
676 Show \*(UAs
677 .Va version
678 and exit.
679 The command
680 .Ic version
681 will also show the list of
682 .Va features :
683 .Ql $ \*(uA -Xversion -Xx .
686 .It Fl v
687 .Ic set Ns
688 ting the internal variable
689 .Va verbose
690 enables display of some informational context messages.
691 Using it twice increases the level of verbosity.
694 .It Fl X Ar cmd
695 Add the given (or multiple for a multiline argument)
696 .Ar cmd
697 to the list of commands to be executed,
698 as a last step of program startup, before normal operation starts.
699 This is the only possibility to execute commands in non-interactive mode
700 when reading startup files has been disabled.
701 The commands will be evaluated as a unit, just as via
702 .Ic source .
703 Correlates with
704 .Fl #
706 .Va errexit .
709 .It Fl ~
710 Enable
711 .Sx "COMMAND ESCAPES"
712 in compose mode even in non-interactive use cases.
713 This can be used to, e.g., automatically format the composed message
714 text before sending the message:
715 .Bd -literal -offset indent
716 $ ( echo 'line    one. Word.     Word2.';\e
717     echo '~| /usr/bin/fmt -tuw66' ) |\e
718   LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
722 .It Fl #
723 Enables batch mode: standard input is made line buffered, the complete
724 set of (interactive) commands is available, processing of
725 .Sx "COMMAND ESCAPES"
726 is enabled in compose mode, and diverse
727 .Sx "INTERNAL VARIABLES"
728 are adjusted for batch necessities, exactly as if done via
729 .Ic set :
730 .Va emptystart ,
731 .Pf no Va errexit ,
732 .Pf no Va header ,
733 .Pf no Va posix ,
734 .Va quiet ,
735 .Va sendwait ,
736 .Va typescript-mode
737 as well as
738 .Ev MAIL ,
739 .Ev MBOX
741 .Va inbox
742 (the latter three to
743 .Pa /dev/null ) .
744 The following prepares an email message in a batched dry run:
745 .Bd -literal -offset indent
746 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
747   LC_ALL=C \*(uA -d#:/ -X'alias bob bob@exam.ple'
751 .It Fl \&.
752 This flag forces termination of option processing in order to prevent
753 .Dq option injection
754 (attacks).
755 It also forcefully puts \*(UA into send mode, see
756 .Sx "On sending mail, and non-interactive mode" .
760 All given
761 .Ar to-addr
762 arguments and all receivers established via
763 .Fl b
765 .Fl c
766 are subject to the checks established by
767 .Va expandaddr ,
768 one of the
769 .Sx "INTERNAL VARIABLES" .
770 If the setting of
771 .Va expandargv
772 allows their recognition all
773 .Ar mta-option
774 arguments given at the end of the command line after a
775 .Ql --
776 separator will be passed through to a file-based
777 .Va mta
778 (Mail-Transfer-Agent) and persist for the entire session.
779 .Va expandargv
780 constraints do not apply to the content of
781 .Va mta-arguments .
782 .\" }}}
784 .\" .Ss "A starter" {{{
785 .Ss "A starter"
787 \*(UA is a direct descendant of
789 Mail, itself a successor of the Research
791 mail which
792 .Dq was there from the start
793 according to
794 .Sx HISTORY .
795 It thus represents the user side of the
797 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
798 traditionally taken by
799 .Xr sendmail 8 ,
800 and most MTAs provide a binary of this name for compatibility purposes.
801 If the \*(OPal SMTP
802 .Va mta
803 is included in the
804 .Va features
805 of \*(UA then the system side is not a mandatory precondition for mail
806 delivery.
809 Because \*(UA strives for compliance with POSIX
810 .Xr mailx 1
811 it is likely that some configuration settings have to be adjusted before
812 using it is a smooth experience.
813 (Rather complete configuration examples can be found in the section
814 .Sx EXAMPLES . )
815 The provided global
816 .Pa \*(UR
817 (one of the
818 .Sx "Resource files" )
819 template bends those standard imposed settings of the
820 .Sx "INTERNAL VARIABLES"
821 a bit towards more user friendliness and safety, however.
824 For example, it
825 .Ic set Ns s
826 .Va hold
828 .Va keepsave
829 in order to suppress the automatic moving of messages to the
830 .Mx -sx
831 .Sx "secondary mailbox"
832 .Ev MBOX
833 that would otherwise occur (see
834 .Sx "Message states" ) ,
836 .Va keep
837 to not remove empty system MBOX mailbox files (or all empty such files if
838 .Va posix
839 .Pf a.k.a.\0 Ev POSIXLY_CORRECT
840 mode has been enabled) to avoid mangling of file permissions when files
841 eventually get recreated.
843 It also enables
844 .Va sendwait
845 in order to synchronize \*(UA with the exit status report of the used
846 .Va mta
847 when sending mails.
849 .Ic set Ns
851 .Va emptystart
852 to enter interactive startup even if the initial mailbox is empty,
853 .Va editheaders
854 to allow editing of headers as well as
855 .Va fullnames
856 to not strip down addresses in compose mode, and
857 .Va quote
858 to include the message that is being responded to when
859 .Ic reply Ns
860 ing, which is indented by an
861 .Va indentprefix
862 that also deviates from standard imposed settings.
863 .Va mime-counter-evidence
864 is fully enabled, too.
867 Some random remarks.
868 The file mode creation mask can be managed explicitly via the variable
869 .Va umask .
870 Sufficient system support provided symbolic links will not be followed
871 when files are opened for writing.
872 Files and shell pipe output can be
873 .Ic source Ns
874 d for evaluation, also during startup from within the
875 .Sx "Resource files" .
876 .\" }}}
878 .\" .Ss "On sending mail, and non-interactive mode" {{{
879 .Ss "On sending mail, and non-interactive mode"
881 To send a message to one or more people, using a local or built-in
882 .Va mta
883 (Mail-Transfer-Agent) transport to actually deliver the generated mail
884 message, \*(UA can be invoked with arguments which are the names of
885 people to whom the mail will be sent, and the command line options
886 .Fl b
888 .Fl c
889 can be used to add (blind) carbon copy receivers:
891 .Bd -literal -offset indent
892 # Via sendmail(1)
893 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
895 # But... try it in an isolated dry-run mode (-d) first
896 $ LC_ALL=C \*(uA -d -:/ -Ssendwait -Sttycharset=utf8 \e
897    -b bcc@exam.ple -c cc@exam.ple \e
898    -Sfullnames -. \e
899    '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
901 # With SMTP
902 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
903     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
904     -S from=scriptreply@exam.ple \e
905     -a /etc/mail.rc \e
906     -. eric@exam.ple
910 If standard input is a terminal rather than the message to be sent,
911 the user is expected to type in the message contents.
912 In this compose mode \*(UA treats lines beginning with the character
913 .Ql ~
914 special \(en these are so-called
915 .Sx "COMMAND ESCAPES" ,
916 which can be used to read in files, process shell commands, add and edit
917 attachments and more; e.g.,
918 .Ic ~v
920 .Ic ~e
921 will start the
922 .Ev VISUAL
923 text
924 .Ev EDITOR ,
925 respectively, to revise the message in its current state,
926 .Ic ~h
927 allows editing of the most important message headers, with the potent
928 .Ic ~^
929 custom headers can be created, for example (more specifically than with
930 .Fl C
932 .Va customhdr ) .
933 .Ic ~?
934 \*(OPally gives an overview of most other available command escapes.
935 The command escape
936 .Ic ~.
937 will leave compose mode and send the message once it is completed.
938 Aborting letter composition is possible with either of
939 .Ic ~x
941 .Ic ~q ,
942 the latter of which will save the message in the file denoted by
943 .Ev DEAD
944 unless
945 .Pf no Va save
946 is set.
947 Unless
948 .Va ignoreeof
949 is set the effect of
950 .Ic ~.
951 can also be achieved by typing end-of-transmission (EOT) via
952 .Ql control-D
953 .Pf ( Ql ^D )
954 at the beginning of an empty line, and
955 .Ic ~q
956 is always reachable by typing end-of-text (ETX) twice via
957 .Ql control-C
958 .Pf ( Ql ^C ) .
961 A number of
962 .Sx ENVIRONMENT
964 .Sx "INTERNAL VARIABLES"
965 can be used to alter default behavior.
966 E.g., messages are sent asynchronously, without supervision, unless the
967 internal variable
968 .Va sendwait
969 is set, therefore send errors will not be recognizable until then.
970 .Ic set Ns
971 ting (also via
972 .Fl S )
973 .Va editalong
974 will automatically startup an editor when compose mode is entered,
975 .Va editheaders
976 allows editing of headers additionally to plain body content,
977 .Va askcc
979 .Va askbcc
980 will cause the user to be prompted actively for (blind) carbon-copy
981 recipients, respectively, and (the default)
982 .Va asksend
983 will request confirmation whether the message shall be sent.
986 The envelope sender address is defined by
987 .Va from ,
988 explicitly defining an originating
989 .Va hostname
990 may be desirable, especially with the builtin SMTP Mail-Transfer-Agent
991 .Va mta .
992 .Sx "Character sets"
993 for outgoing message and MIME part content are configurable via
994 .Va sendcharsets ,
995 whereas input data is assumed to be in
996 .Va ttycharset .
997 Message data will be passed over the wire in a
998 .Va mime-encoding .
999 MIME parts a.k.a. attachments need to be assigned a
1000 .Ic mimetype ,
1001 usually taken out of
1002 .Sx "The mime.types files" .
1003 Saving a copy of sent messages in a
1004 .Va record
1005 mailbox may be desirable \(en as for most mailbox
1006 .Ic file
1007 targets the value will undergo
1008 .Sx "Filename transformations" .
1009 Some introductional
1010 .Fl d
1012 .Va debug
1013 sandbox dry-run tests will prove correctness.
1016 Message recipients (as specified on the command line or defined in
1017 .Ql To: ,
1018 .Ql Cc:
1020 .Ql Bcc: )
1021 are subject to
1022 .Ic alternates
1023 filtering, and may not only be email addressees but can also be names of
1024 mailboxes and even complete shell command pipe specifications.
1025 If the variable
1026 .Va expandaddr
1027 is not set then only network addresses (see
1028 .Xr mailaddr 7
1029 for a description of mail addresses) and plain user names (including MTA
1030 aliases) may be used, other types will be filtered out, giving a warning
1031 message.
1032 A network address that contains no domain-, but only a valid local user
1033 .Ql <name>
1034 in angle brackets will be automatically expanded to a valid address when
1035 .Va hostname
1036 is set to a non-empty value; setting it to the empty value instructs
1037 \*(UA that the used
1038 .Va mta
1039 will perform the necessary expansion.
1040 The command
1041 .Ic addrcodec
1042 may help to generate standard compliant network addresses.
1044 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
1045 .\" grep the latter for the complete picture
1047 If the variable
1048 .Va expandaddr
1049 is set then an extended set of recipient addresses will be accepted:
1050 Any name that starts with a vertical bar
1051 .Ql |
1052 character specifies a command pipe \(en the command string following the
1053 .Ql |
1054 is executed and the message is sent to its standard input;
1055 Likewise, any name that starts with the character solidus
1056 .Ql /
1057 or the character sequence dot solidus
1058 .Ql ./
1059 is treated as a file, regardless of the remaining content;
1060 likewise a name that solely consists of a hyphen-minus
1061 .Ql - .
1062 Any other name which contains a commercial at
1063 .Ql @
1064 character is treated as a network address;
1065 Any other name which starts with a plus sign
1066 .Ql +
1067 character specifies a mailbox name;
1068 Any other name which contains a solidus
1069 .Ql /
1070 character but no exclamation mark
1071 .Ql \&!
1072 or percent sign
1073 .Ql %
1074 character before also specifies a mailbox name;
1075 What remains is treated as a network address.
1077 .Bd -literal -offset indent
1078 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1079 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1080 $ echo safe | LC_ALL=C \e
1081     \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1082       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1083       -. bob@exam.ple
1087 It is possible to create personal distribution lists via the
1088 .Ic alias
1089 command, so that, for instance, the user can send mail to
1090 .Ql cohorts
1091 and have it go to a group of people.
1092 Different to the alias mechanism of a local
1093 .Va mta ,
1094 which is often tracked in a file
1095 .Pa /etc/aliases ,
1096 documented in
1097 .Xr aliases 5 ,
1098 and the names of which are subject to the
1099 .Ql name
1100 constraint of
1101 .Va expandaddr ,
1102 personal aliases will be expanded by \*(UA before the message is sent.
1103 They are thus a convenient alternative to specifying each addressee by
1104 itself, correlate with the active set of
1105 .Ic alternates ,
1106 and are subject to
1107 .Va metoo
1108 filtering.
1110 .Bd -literal -offset indent
1111 ? alias  cohorts  bill jkf mark kridle@ucbcory ~/cohorts.mbox
1112 ? alias  mark  mark@exam.ple
1116 .Va on-compose-enter , on-compose-leave
1118 .Va on-compose-cleanup
1119 hook variables may be set to
1120 .Ic define Ns
1121 d macros to automatically adjust some settings dependent
1122 on receiver, sender or subject contexts, and via the
1123 .Va on-compose-splice
1124 as well as
1125 .Va on-compose-splice-shell
1126 variables, the former also to be set to a
1127 .Ic define Ns
1128 d macro, increasingly powerful mechanisms to perform automated message
1129 adjustments, including signature creation, are available.
1130 (\*(ID These hooks work for commands which newly create messages, namely
1131 .Ic forward , mail , reply
1132 and variants;
1133 .Ic resend
1135 .Ic Resend
1136 for now provide only the hooks
1137 .Va on-resend-enter
1139 .Va on-resend-cleanup . )
1142 For the purpose of arranging a complete environment of settings that can
1143 be switched to with a single command or command line option there are
1144 .Ic account Ns s .
1145 Alternatively it is also possible to use a flat configuration, making use
1146 of so-called variable chains which automatically pick
1147 .Ql USER@HOST
1149 .Ql HOST
1150 context-dependent variable variants: for example addressing
1151 .Ql Ic File Ns \& pop3://yaa@exam.ple
1152 would find
1153 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1154 .Va \&\&pop3-no-apop-exam.ple
1156 .Va pop3-no-apop
1157 in order.
1159 .Sx "On URL syntax and credential lookup"
1161 .Sx "INTERNAL VARIABLES" .
1164 To avoid environmental noise scripts should
1165 .Dq detach
1166 \*(UA from any configuration files and create a script-local
1167 environment, ideally with the command line options
1168 .Fl \&:
1169 to disable any configuration file in conjunction with repetitions of
1170 .Fl S
1171 to specify variables:
1173 .Bd -literal -offset indent
1174 $ env LC_ALL=C \*(uA -:/ \e
1175     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1176     -Sexpandaddr=fail,-all,failinvaddr \e
1177     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1178     -S from=scriptreply@exam.ple \e
1179     -s 'Subject to go' -a attachment_file \e
1180     -Sfullnames -. \e
1181     'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1182     < content_file
1186 As shown, scripts can
1187 .Dq fake
1188 a locale environment, the above specifies the all-compatible 7-bit clean
1189 .Ev LC_ALL
1190 .Dq C ,
1191 but will nonetheless take and send UTF-8 in the message text by using
1192 .Va ttycharset .
1193 In interactive mode, which is introduced in the next section, messages
1194 can be sent by calling the
1195 .Ic mail
1196 command with a list of recipient addresses:
1198 .Bd -literal -offset indent
1199 $ \*(uA -d -Squiet -Semptystart
1200 "/var/spool/mail/user": 0 messages
1201 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1202 \&...
1203 ? # Will do the right thing (tm)
1204 ? m rec1@exam.ple rec2@exam.ple
1206 .\" }}}
1208 .\" .Ss "On reading mail, and interactive mode" {{{
1209 .Ss "On reading mail, and interactive mode"
1211 When invoked without addressees \*(UA enters interactive mode in which
1212 mails may be read.
1213 When used like that the user's system
1214 .Va inbox
1215 (for more on mailbox types please see the command
1216 .Ic file )
1217 is read in and a one line header of each message therein is displayed if
1218 the variable
1219 .Va header
1220 is set.
1221 The visual style of this summary of
1222 .Ic headers
1223 can be adjusted through the variable
1224 .Va headline
1225 and the possible sorting criterion via
1226 .Va autosort .
1227 Scrolling through
1228 .Va screen Ns
1229 fuls of
1230 .Ic headers
1231 can be performed with the command
1232 .Ic z .
1233 If the initially opened mailbox is empty \*(UA will instead exit
1234 immediately (after displaying a message) unless the variable
1235 .Va emptystart
1236 is set.
1239 At the
1240 .Va prompt
1241 the command
1242 .Ic list
1243 will give a listing of all available commands and
1244 .Ic help
1245 will \*(OPally give a summary of some common ones.
1246 If the \*(OPal documentation strings are available (see
1247 .Va features )
1248 one can type
1249 .Ql help X
1250 .Pf "(or " Ql ?X )
1251 and see the actual expansion of
1252 .Ql X
1253 and what its purpose is, i.e., commands can be abbreviated
1254 (note that POSIX defines some abbreviations, so that the alphabetical
1255 order of commands does not necessarily relate to the abbreviations; it is
1256 however possible to define overwrites with
1257 .Ic commandalias ) .
1258 These commands can also produce a more
1259 .Va verbose
1260 output.
1263 Messages are given numbers (starting at 1) which uniquely identify
1264 messages; the current message \(en the
1265 .Dq dot
1266 \(en will either be the first new message, or the first unread message,
1267 or the first message of the mailbox; the internal variable
1268 .Va showlast
1269 will instead cause usage of the last message for this purpose.
1270 The command
1271 .Ic headers
1272 will display a
1273 .Va screen Ns
1274 ful of header summaries containing the
1275 .Dq dot ,
1276 whereas
1277 .Ic from
1278 will display only the summaries of the given messages, defaulting to the
1279 .Dq dot .
1282 Message content can be displayed with the command
1283 .Ic type
1284 .Pf ( Ql t ,
1285 alias
1286 .Ic print ) .
1287 Here the variable
1288 .Va crt
1289 controls whether and when \*(UA will use the configured
1290 .Ev PAGER
1291 for display instead of directly writing to the user terminal
1292 .Va screen ,
1293 the sole difference to the command
1294 .Ic more ,
1295 which will always use the
1296 .Ev PAGER .
1297 The command
1298 .Ic top
1299 will instead only show the first
1300 .Va toplines
1301 of a message (maybe even compressed if
1302 .Va topsqueeze
1303 is set).
1304 Message display experience may improve by setting and adjusting
1305 .Va mime-counter-evidence ,
1306 and also see
1307 .Sx "HTML mail and MIME attachments" .
1310 By default the current message
1311 .Pf ( Dq dot )
1312 is displayed, but like with many other commands it is possible to give
1313 a fancy message specification (see
1314 .Sx "Specifying messages" ) ,
1315 e.g.,
1316 .Ql t:u
1317 will display all unread messages,
1318 .Ql t.
1319 will display the
1320 .Dq dot ,
1321 .Ql t 1 5
1322 will type the messages 1 and 5,
1323 .Ql t 1-5
1324 will type the messages 1 through 5, and
1325 .Ql t-
1327 .Ql t+
1328 will display the previous and the next message, respectively.
1329 The command
1330 .Ic search
1331 (a more substantial alias for
1332 .Ic from )
1333 will display a header summary of the given message specification list
1334 instead of their content, e.g., the following will search for subjects:
1337 .Dl ? from "'@Some subject to search for'"
1340 In the default setup all header fields of a message will be
1341 .Ic type Ns
1342 d, but fields can be white- or blacklisted for a variety of
1343 applications by using the command
1344 .Ic headerpick ,
1345 e.g., to restrict their display to a very restricted set for
1346 .Ic type :
1347 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1348 In order to display all header fields of a message regardless of
1349 currently active ignore or retain lists, use the commands
1350 .Ic Type
1352 .Ic Top ;
1353 .Ic Show
1354 will show the raw message content.
1355 Note that historically the global
1356 .Pa \*(UR
1357 not only adjusts the list of displayed headers, but also sets
1358 .Va crt .
1361 Dependent upon the configuration a line editor (see the section
1362 .Sx "On terminal control and line editor" )
1363 aims at making the user experience with the many
1364 .Sx COMMANDS
1365 a bit nicer.
1366 When reading the system
1367 .Va inbox ,
1368 or when
1369 .Fl f
1371 .Ic file )
1372 specified a mailbox explicitly prefixed with the special
1373 .Ql %:
1374 modifier (to propagate it to a
1375 .Mx -sx
1376 .Sx "primary system mailbox" ) ,
1377 then messages which have been read
1378 .Pf (see\0 Sx "Message states" )
1379 will be automatically moved to a
1380 .Mx -sx
1381 .Sx "secondary mailbox" ,
1382 the user's
1383 .Ev MBOX
1384 file, when the mailbox is left, either by changing the active mailbox or
1385 by quitting \*(UA \(en this automatic moving from a system- or primary-
1386 to the secondary mailbox is not performed when the variable
1387 .Va hold
1388 is set.
1389 Messages can also be explicitly
1390 .Ic move Ns
1391 d to other mailboxes, whereas
1392 .Ic copy
1393 keeps the original message.
1394 .Ic write
1395 can be used to write out data content of specific parts of messages.
1398 After examining a message the user can
1399 .Ic reply Ql r
1400 to the sender and all recipients (which will also be placed in
1401 .Ql To:
1402 unless
1403 .Va recipients-in-cc
1404 is set), or
1405 .Ic Reply Ql R
1406 exclusively to the sender(s).
1407 The command
1408 .Ic Lreply
1409 knows how to apply a special addressee massage, see
1410 .Sx "Mailing lists" .
1411 .Ic forward Ns
1412 ing a message will allow editing the new message: the original message
1413 will be contained in the message body, adjusted according to
1414 .Ic headerpick .
1415 It is possible to
1416 .Ic resend
1418 .Ic Resend
1419 messages: the former will add a series of
1420 .Ql Resent-
1421 headers, whereas the latter will not; different to newly created
1422 messages editing is not possible and no copy will be saved even with
1423 .Va record
1424 unless the additional variable
1425 .Va record-resent
1426 is set.
1427 When sending, replying or forwarding messages comments and full names
1428 will be stripped from recipient addresses unless the internal variable
1429 .Va fullnames
1430 is set.
1433 Of course messages can be
1434 .Ic delete Ql d ,
1435 and they can spring into existence again via
1436 .Ic undelete ,
1437 or when the \*(UA session is ended via the
1438 .Ic exit
1440 .Ic xit
1441 commands to perform a quick program termation.
1442 To end a mail processing session regulary and perform a full program
1443 exit one may issue the command
1444 .Ic quit .
1445 It will, among others, move read messages to the
1446 .Mx -sx
1447 .Sx "secondary mailbox"
1448 .Ev MBOX
1449 as necessary, discard deleted messages in the current mailbox,
1450 and update the \*(OPal (see
1451 .Va features )
1452 line editor
1453 .Va history-file .
1454 .\" }}}
1456 .\" .Ss "HTML mail and MIME attachments" {{{
1457 .Ss "HTML mail and MIME attachments"
1459 Messages which are HTML-only become more and more common, and of course
1460 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1461 Mail Extensions) parts.
1462 To get a notion of MIME types \*(UA has a default set of types built-in,
1463 onto which the content of
1464 .Sx "The mime.types files"
1465 will be added (as configured and allowed by
1466 .Va mimetypes-load-control ) .
1467 Types can also become registered with the command
1468 .Ic mimetype .
1469 To improve interaction with faulty MIME part declarations which are
1470 often seen in real-life messages, setting
1471 .Va mime-counter-evidence
1472 will allow verification of the given assertion, and possible provision
1473 of an alternative, better MIME type.
1476 Whereas \*(UA \*(OPally supports a simple HTML-to-text filter for
1477 displaying HTML messages, it cannot handle MIME types other than plain
1478 text itself.
1479 Instead programs need to become registered to deal with specific MIME
1480 types or file extensions.
1481 These programs may either prepare plain text versions of their input in
1482 order to enable \*(UA to integrate their output neatlessly in its own
1483 message visualization (a mode which is called
1484 .Cd copiousoutput ) ,
1485 or display the content themselves, for example in an external graphical
1486 window: such handlers will only be considered by and for the command
1487 .Ic mimeview .
1490 To install a handler program for a specific MIME type an according
1491 .Va pipe-TYPE/SUBTYPE
1492 variable needs to be set; to instead define a handler for a specific
1493 file extension the respective
1494 .Va pipe-EXTENSION
1495 variable can be used \(en these handlers take precedence.
1496 \*(OPally \*(UA supports mail user agent configuration as defined in
1497 RFC 1524; this mechanism (see
1498 .Sx "The Mailcap files" )
1499 will be queried for display or quote handlers if none of the former two
1500 .\" TODO v15-compat "will be" -> "is"
1501 did; it will be the sole source for handlers of other purpose.
1502 A last source for handlers is the MIME type definition itself, if
1503 a type-marker has been registered with the command
1504 .Ic mimetype ,
1505 which many of the built-in MIME types do.
1508 For example, to display a HTML message inline (converted to a more fancy
1509 plain text representation than the built-in filter is capable to produce)
1510 with either of the text-mode browsers
1511 .Xr lynx 1
1513 .Xr elinks 1 ,
1514 teach \*(UA about MathML documents and make it display them as plain
1515 text, and to open PDF attachments in an external PDF viewer,
1516 asynchronously and with some other magic attached:
1518 .Bd -literal -offset indent
1519 ? if [ "$features" !% +filter-html-tagsoup ]
1520 ?   #set pipe-text/html='@* elinks -force-html -dump 1'
1521 ?   set pipe-text/html='@* lynx -stdin -dump -force_html'
1522 ?   # Display HTML as plain text instead
1523 ?   #set pipe-text/html=@
1524 ? endif
1525 ? mimetype @ application/mathml+xml mathml
1526 ? wysh set pipe-application/pdf='@&=@ \e
1527     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1528     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1529     mupdf "${MAILX_FILENAME_TEMPORARY}"'
1531 .\" }}}
1533 .\" .Ss "Mailing lists" {{{
1534 .Ss "Mailing lists"
1536 \*(UA offers some support to ease handling of mailing lists.
1537 The command
1538 .Ic mlist
1539 promotes all given arguments to known mailing lists, and
1540 .Ic mlsubscribe
1541 sets their subscription attribute, creating them first as necessary.
1542 (On the other hand
1543 .Ic unmlsubscribe
1544 does not
1545 .Ic unmlist
1546 automatically, but only resets the subscription attribute.)
1547 Using the commands without arguments will show (a subset of) all
1548 currently defined mailing lists.
1550 .Va headline
1551 format
1552 .Ql \&%T
1553 can be used to mark out messages with configured list addresses
1554 in the display of
1555 .Ic headers .
1558 If the \*(OPal regular expression support is available a mailing list
1559 specification that contains any of the
1560 .Dq magical
1561 regular expression characters
1562 .Ql ^[]*+?|$
1563 (see
1564 .Xr re_format 7 )
1565 will be interpreted as one, which allows matching of many addresses with
1566 a single expression.
1567 However, all fully qualified list addresses are matched via a fast
1568 dictionary, whereas expressions are placed in (a) list(s) which is
1569 (are) matched sequentially.
1571 .Bd -literal -offset indent
1572 ? set followup-to followup-to-honour=ask-yes \e
1573     reply-to-honour=ask-yes
1574 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1575 ? mlsubscribe a4@b4.c4 exact@lists.c3
1579 The variable
1580 .Va followup-to-honour
1581 will ensure that a
1582 .Ql Mail-\:Followup-\:To:
1583 header is honoured when the message is being replied to (via
1584 .Ic reply
1586 .Ic Lreply )
1588 .Va followup-to
1589 controls whether this header is created when sending mails; it will be
1590 created automatically for a couple of reasons, too, like when the
1591 special
1592 .Dq mailing list specific
1593 respond command
1594 .Ic Lreply
1595 is used, when
1596 .Ic reply
1597 is used to respond to a message with its
1598 .Ql Mail-Followup-To:
1599 being honoured etc.
1602 A difference in between the handling of known and subscribed lists is
1603 that the address of the user is usually not part of a generated
1604 .Ql Mail-Followup-To:
1605 when addressing the latter, whereas it is for the former kind of lists.
1606 Usually because there are exceptions: say, if multiple lists are
1607 addressed and not all of them are subscribed lists.
1609 For convenience \*(UA will, temporarily, automatically add a list
1610 address that is presented in the
1611 .Ql List-Post:
1612 header of a message that is being responded to to the list of known
1613 mailing lists.
1614 Shall that header have existed \*(UA will instead, dependent on the
1615 variable
1616 .Va reply-to-honour ,
1617 use an also set
1618 .Ql Reply-To:
1619 for this purpose (if it provides a single address which resides on the
1620   same domain as what is stated in
1621 .Ql List-Post: )
1622 in order to accept a list administrator's wish that is supposed to have
1623 been manifested like that.
1624 .\" }}}
1626 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1627 .Ss "Signed and encrypted messages with S/MIME"
1629 \*(OP S/MIME provides two central mechanisms:
1630 message signing and message encryption.
1631 A signed message contains some data in addition to the regular text.
1632 The data can be used to verify that the message has been sent using
1633 a valid certificate, that the sender address matches that in the
1634 certificate, and that the message text has not been altered.
1635 Signing a message does not change its regular text;
1636 it can be read regardless of whether the recipients software is able to
1637 handle S/MIME.
1638 It is thus usually possible to sign all outgoing messages if so desired.
1641 Encryption, in contrast, makes the message text invisible for all people
1642 except those who have access to the secret decryption key.
1643 To encrypt a message, the specific recipients public encryption key
1644 must be known.
1645 It is therefore not possible to send encrypted mail to people unless their
1646 key has been retrieved from either previous communication or public key
1647 directories.
1648 A message should always be signed before it is encrypted.
1651 A central concept to S/MIME is that of the certification authority (CA).
1652 A CA is a trusted institution that issues certificates.
1653 For each of these certificates it can be verified that it really
1654 originates from the CA, provided that the CA's own certificate is
1655 previously known.
1656 A set of CA certificates is usually delivered and installed together
1657 with the cryptographical library that is used on the local system.
1658 Therefore reasonable security for S/MIME on the Internet is provided if
1659 the source that provides that library installation is trusted.
1660 It is also possible to use a specific pool of trusted certificates.
1661 If this is desired,
1662 .Va smime-ca-no-defaults
1663 should be set to avoid using the default certificate pool, and
1664 .Va smime-ca-file
1665 and/or
1666 .Va smime-ca-dir
1667 should be pointed to a trusted pool of certificates.
1668 A certificate cannot be more secure than the method its CA certificate
1669 has been retrieved with.
1672 This trusted pool of certificates is used by the command
1673 .Ic verify
1674 to ensure that the given S/MIME messages can be trusted.
1675 If so, verified sender certificates that were embedded in signed
1676 messages can be saved locally with the command
1677 .Ic certsave ,
1678 and used by \*(UA to encrypt further communication with these senders:
1680 .Bd -literal -offset indent
1681 ? certsave FILENAME
1682 ? set smime-encrypt-USER@HOST=FILENAME \e
1683     smime-cipher-USER@HOST=AES256
1687 To sign outgoing messages, in order to allow receivers to verify the
1688 origin of these messages, a personal S/MIME certificate is required.
1689 \*(UA supports password-protected personal certificates (and keys),
1690 for more on this, and its automatization, please see the section
1691 .Sx "On URL syntax and credential lookup" .
1692 The section
1693 .Sx "S/MIME step by step"
1694 shows examplarily how such a private certificate can be obtained.
1695 In general, if such a private key plus certificate
1696 .Dq pair
1697 is available, all that needs to be done is to set some variables:
1699 .Bd -literal -offset indent
1700 ? set smime-sign-cert=ME@exam.ple.paired \e
1701     smime-sign-message-digest=SHA512 \e
1702     smime-sign
1706 Variables of interest for S/MIME in general are
1707 .Va smime-ca-dir ,
1708 .Va smime-ca-file ,
1709 .Va smime-ca-flags ,
1710 .Va smime-ca-no-defaults ,
1711 .Va smime-crl-dir ,
1712 .Va smime-crl-file .
1713 For S/MIME signing of interest are
1714 .Va smime-sign ,
1715 .Va smime-sign-cert ,
1716 .Va smime-sign-include-certs
1718 .Va smime-sign-message-digest .
1719 Additional variables of interest for S/MIME en- and decryption:
1720 .Va smime-cipher
1722 .Va smime-encrypt-USER@HOST .
1725 \*(ID Note that neither S/MIME signing nor encryption applies to
1726 message subjects or other header fields yet.
1727 Thus they may not contain sensitive information for encrypted messages,
1728 and cannot be trusted even if the message content has been verified.
1729 When sending signed messages,
1730 it is recommended to repeat any important header information in the
1731 message text.
1732 .\" }}}
1734 .\" .Ss "On URL syntax and credential lookup" {{{
1735 .Ss "On URL syntax and credential lookup"
1737 \*(IN For accessing protocol-specific resources usage of Uniform
1738 Resource Locators (URL, RFC 1738) has become omnipresent.
1739 \*(UA expects and understands URLs in the following form;
1740 parts in brackets
1741 .Ql []
1742 denote optional parts, optional either because there also exist other
1743 ways to define the information in question or because support of the
1744 part is protocol-specific, e.g.,
1745 .Ql /path
1746 is used by the \*(OPal Maildir directory and the IMAP protocol, but not
1747 by POP3; If any of
1748 .Ql USER
1750 .Ql PASSWORD
1751 are specified they must be given in URL percent encoded form (RFC 3986;
1752 the command
1753 .Ic urlcodec
1754 may be helpful):
1757 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1760 Note that these \*(UA URLs most often do not conform to any real
1761 standard, but instead represent a normalized variant of RFC 1738 \(en
1762 they are not used in data exchange but only meant as a compact,
1763 easy-to-use way of defining and representing information in
1764 a well-known notation.
1767 Many internal variables of \*(UA exist in multiple versions, called
1768 variable chains for the rest of this document: the plain
1769 .Ql variable
1770 as well as
1771 .Ql variable-HOST
1773 .Ql variable-USER@HOST .
1774 Here
1775 .Ql HOST
1776 indeed means
1777 .Ql server:port
1778 if a
1779 .Ql port
1780 had been specified in the respective URL, otherwise it refers to the plain
1781 .Ql server .
1782 Also,
1783 .Ql USER
1784 is not truly the
1785 .Ql USER
1786 that had been found when doing the user chain lookup as is described
1787 below, i.e., this
1788 .Ql USER
1789 will never be in URL percent encoded form, whether it came from an URL
1790 or not; i.e., variable chain name extensions of
1791 .Sx "INTERNAL VARIABLES"
1792 must not be URL percent encoded.
1795 For example, whether an hypothetical URL
1796 .Ql smtp://hey%3Ayou@our.house
1797 had been given that includes a user, or whether the URL was
1798 .Ql smtp://our.house
1799 and the user had been found differently, to lookup the variable chain
1800 .Va smtp-use-starttls
1801 \*(UA first looks for whether
1802 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1803 is defined, then whether
1804 .Ql smtp-\:use-\:starttls-\:our.house
1805 exists before finally ending up looking at the plain variable itself.
1808 \*(UA obeys the following logic scheme when dealing with the
1809 necessary credential information of an account:
1811 .Bl -bullet
1813 If no
1814 .Ql USER
1815 has been given in the URL the variables
1816 .Va user-HOST
1818 .Va user
1819 are looked up.
1820 If no such variable(s) can be found then \*(UA will,
1821 when enforced by the \*(OPal variables
1822 .Va netrc-lookup-HOST
1824 .Va netrc-lookup ,
1825 search
1826 .Sx "The .netrc file"
1827 of the user for a
1828 .Ql HOST
1829 specific entry which provides a
1830 .Ql login
1831 name: this lookup will only succeed if unambiguous (one possible matching
1832 entry for
1833 .Ql HOST ) .
1835 If there is still no
1836 .Ql USER
1837 then \*(UA will fall back to the user who is supposed to run \*(UA,
1838 the identity of which has been fixated during \*(UA startup and is
1839 known to be a valid user on the current host.
1842 Authentication: unless otherwise noted this will lookup the
1843 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1844 variable chain, falling back to a protocol-specific default should this
1845 have no success.
1848 If no
1849 .Ql PASSWORD
1850 has been given in the URL, then if the
1851 .Ql USER
1852 has been found through the \*(OPal
1853 .Va netrc-lookup
1854 that may have already provided the password, too.
1855 Otherwise the variable chain
1856 .Va password-USER@HOST , password-HOST , password
1857 is looked up and used if existent.
1859 Afterwards the complete \*(OPal variable chain
1860 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1861 is looked up.
1862 If set, the
1863 .Ic netrc
1864 cache is searched for a password only (multiple user accounts for
1865 a single machine may exist as well as a fallback entry without user
1866 but with a password).
1868 If at that point there is still no password available, but the
1869 (protocols') chosen authentication type requires a password, then in
1870 interactive mode the user will be prompted on the terminal.
1874 .Sy Note:
1875 S/MIME verification works relative to the values found in the
1876 .Ql From:
1878 .Ql Sender: )
1879 header field(s), which means that the values of
1880 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1882 .Va smime-sign-message-digest
1883 will not be looked up using the
1884 .Ql USER
1886 .Ql HOST
1887 chains from above but instead use the corresponding values from the
1888 message that is being worked on.
1889 In unusual cases multiple and different
1890 .Ql USER
1892 .Ql HOST
1893 combinations may therefore be involved \(en on the other hand those
1894 unusual cases become possible.
1895 The usual case is as short as:
1897 .Bd -literal -offset indent
1898 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1899     smime-sign smime-sign-cert=+smime.pair
1903 The section
1904 .Sx EXAMPLES
1905 contains complete example configurations.
1906 .\" }}}
1908 .\" .Ss "Encrypted network communication" {{{
1909 .Ss "Encrypted network communication"
1911 SSL (Secure Sockets Layer) a.k.a. its successor TLS (Transport Layer
1912 Security) are protocols which aid in securing communication by providing
1913 a safely initiated and encrypted network connection.
1914 A central concept of SSL/TLS is that of certificates: as part of each
1915 network connection setup a (set of) certificates will be exchanged, and
1916 by using those the identity of the network peer can be cryptographically
1917 verified; if possible the TLS/SNI (ServerNameIndication) extension will
1918 be enabled in order to allow servers fine-grained control over the
1919 certificates being used.
1920 SSL/TLS works by using a locally installed pool of trusted certificates,
1921 and verifying the connection peer succeeds if that provides
1922 a certificate which has been issued or is trusted by any certificate in
1923 the trusted local pool.
1926 The local pool of trusted so-called CA (Certification Authority)
1927 certificates is usually delivered with the used SSL/TLS library, and
1928 will be selected automatically.
1929 It is also possible to use a specific pool of trusted certificates.
1930 If this is desired,
1931 .Va ssl-ca-no-defaults
1932 should be set to avoid using the default certificate pool, and
1933 .Va ssl-ca-file
1934 and/or (with special preparation)
1935 .Va ssl-ca-dir
1936 should be pointed to a trusted pool of certificates.
1937 A certificate cannot be more secure than the method its CA certificate
1938 has been retrieved with.
1939 For inspection or other purposes, the certificate of a server (as seen
1940 when connecting to it) can be fetched like this:
1942 .Bd -literal -offset indent
1943 $ </dev/null openssl s_client -showcerts -connect \e
1944     the-server.example:pop3s 2>&1 | tee log.txt
1948 It depends on the used protocol whether encrypted communication is
1949 possible, and which configuration steps have to be taken to enable it.
1950 Some protocols, e.g., POP3S, are implicitly encrypted, others, like
1951 POP3, can upgrade a plain text connection if so requested.
1952 For example, to use the
1953 .Ql STLS
1954 that POP3 offers (a member of) the variable (chain)
1955 .Va pop3-use-starttls
1956 needs to be set:
1958 .Bd -literal -offset indent
1959 shortcut encpop1 pop3s://pop1.exam.ple
1961 shortcut encpop2 pop3://pop2.exam.ple
1962 set pop3-use-starttls-pop2.exam.ple
1964 set mta=smtps://smtp.exam.ple:465
1965 set mta=smtp://smtp.exam.ple smtp-use-starttls
1969 Normally that is all there is to do, given that SSL/TLS libraries try to
1970 provide safe defaults, plenty of knobs however exist to adjust settings.
1971 For example certificate verification settings can be fine-tuned via
1972 .Va ssl-ca-flags ,
1973 and the SSL/TLS configuration basics are accessible via
1974 .Va ssl-config-pairs ,
1975 for example to specify the allowed protocols or cipher lists that
1976 a communication channel may use.
1977 In the past hints on how to restrict the set of protocols to highly
1978 secure ones were indicated, but as of the time of this writing the list
1979 of protocols or ciphers may need to become relaxed in order to be able
1980 to connect to some servers; the following example allows connecting to a
1981 .Dq Lion
1982 that uses OpenSSL 0.9.8za from June 2014 (refer to
1983 .Sx "INTERNAL VARIABLES"
1984 for more on variable chains):
1986 .Bd -literal -offset indent
1987 wysh set ssl-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
1988     CipherString=TLSv1.2:!aNULL:!eNULL:\e
1989       ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
1990       DHE-RSA-AES256-SHA:@STRENGTH'
1994 The OpenSSL program
1995 .Xr ciphers 1
1996 can be used and should be referred to when creating a custom cipher list.
1997 Variables of interest for SSL/TLS in general are
1998 .Va ssl-ca-dir ,
1999 .Va ssl-ca-file ,
2000 .Va ssl-ca-flags ,
2001 .Va ssl-ca-no-defaults ,
2002 .Va ssl-config-file ,
2003 .Va ssl-config-module ,
2004 .Va ssl-config-pairs ,
2005 .Va ssl-crl-dir ,
2006 .Va ssl-crl-file ,
2007 .Va ssl-rand-file
2008 as well as
2009 .Va ssl-verify .
2010 .\" }}}
2012 .\" .Ss "Character sets" {{{
2013 .Ss "Character sets"
2015 \*(OP \*(UA detects the character set of the terminal by using
2016 mechanisms that are controlled by the
2017 .Ev LC_CTYPE
2018 environment variable
2019 (in fact
2020 .Ev LC_ALL ,
2021 .Ev \&\&LC_CTYPE ,
2022 .Ev LANG ,
2023 in that order, see there).
2024 The internal variable
2025 .Va ttycharset
2026 will be set to the detected terminal character set accordingly,
2027 and will thus show up in the output of commands like, e.g.,
2028 .Ic set
2030 .Ic varshow .
2033 However, the user may give
2034 .Va ttycharset
2035 a value during startup, making it possible to send mail in a completely
2036 .Dq faked
2037 locale environment, an option which can be used to generate and send,
2038 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2039 .Ql LC_ALL=C
2040 environment (an example of this can be found in the section
2041 .Sx "On sending mail, and non-interactive mode" ) .
2042 Changing the value does not mean much beside that, because several
2043 aspects of the real character set are implied by the locale environment
2044 of the system, which stays unaffected by
2045 .Va ttycharset .
2048 Messages and attachments which consist of 7-bit clean data will be
2049 classified as consisting of
2050 .Va charset-7bit
2051 character data.
2052 This is a problem if the
2053 .Va ttycharset
2054 character set is a multibyte character set that is also 7-bit clean.
2055 For example, the Japanese character set ISO-2022-JP is 7-bit clean but
2056 capable to encode the rich set of Japanese Kanji, Hiragana and Katakana
2057 characters: in order to notify receivers of this character set the mail
2058 message must be MIME encoded so that the character set ISO-2022-JP can
2059 be advertised!
2060 To achieve this, the variable
2061 .Va charset-7bit
2062 must be set to ISO-2022-JP.
2063 (Today a better approach regarding email is the usage of UTF-8, which
2064 uses 8-bit bytes for non-US-ASCII data.)
2067 If the \*(OPal character set conversion capabilities are not available
2068 .Pf ( Va features
2069 does not include the term
2070 .Ql +iconv ) ,
2071 then
2072 .Va ttycharset
2073 will be the only supported character set,
2074 it is simply assumed that it can be used to exchange 8-bit messages
2075 (over the wire an intermediate, configurable
2076 .Va mime-encoding
2077 may be applied),
2078 and the rest of this section does not apply;
2079 it may however still be necessary to explicitly set it if automatic
2080 detection fails, since in that case it defaults to
2081 .\" (Keep in SYNC: ./nail.1:"Character sets", ./config.h:CHARSET_*!)
2082 LATIN1 a.k.a. ISO-8859-1 unless the operating system environment is
2083 known to always and exclusively support UTF-8 locales.
2086 \*(OP When reading messages, their text is converted into
2087 .Va ttycharset
2088 as necessary in order to display them on the user's terminal.
2089 Unprintable characters and invalid byte sequences are detected
2090 and replaced by proper substitution characters.
2091 Character set mappings for source character sets can be established with
2092 the command
2093 .Ic charsetalias ,
2094 which may be handy to work around faulty character set catalogues (e.g.,
2095 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
2096 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
2097 Also see
2098 .Va charset-unknown-8bit
2099 to deal with another hairy aspect of message interpretation.
2102 When sending messages their parts and attachments are classified.
2103 Whereas no character set conversion is performed on those parts which
2104 appear to be binary data,
2105 the character set being used must be declared within the MIME header of
2106 an outgoing text part if it contains characters that do not conform to
2107 the set of characters that are allowed by the email standards.
2108 Permissible values for character sets used in outgoing messages can be
2109 declared using the
2110 .Va sendcharsets
2111 variable, and
2112 .Va charset-8bit ,
2113 which defines a catch-all last-resort fallback character set that is
2114 implicitly appended to the list of character sets in
2115 .Va sendcharsets .
2118 When replying to a message and the variable
2119 .Va reply-in-same-charset
2120 is set, then the character set of the message being replied to
2121 is tried first (still being a subject of
2122 .Ic charsetalias ) .
2123 And it is also possible to make \*(UA work even more closely related to
2124 the current locale setting automatically by using the variable
2125 .Va sendcharsets-else-ttycharset ,
2126 please see there for more information.
2129 All the specified character sets are tried in order unless the
2130 conversion of the part or attachment succeeds.
2131 If none of the tried (8-bit) character sets is capable to represent the
2132 content of the part or attachment,
2133 then the message will not be send and its text will optionally be
2134 .Va save Ns d
2136 .Ev DEAD .
2137 In general, if a message saying
2138 .Dq cannot convert from a to b
2139 appears, either some characters are not appropriate for the currently
2140 selected (terminal) character set,
2141 or the needed conversion is not supported by the system.
2142 In the first case, it is necessary to set an appropriate
2143 .Ev LC_CTYPE
2144 locale and/or the variable
2145 .Va ttycharset .
2148 The best results are usually achieved when \*(UA is run in a UTF-8
2149 locale on an UTF-8 capable terminal, in which case the full Unicode
2150 spectrum of characters is available.
2151 In this setup characters from various countries can be displayed,
2152 while it is still possible to use more simple character sets for sending
2153 to retain maximum compatibility with older mail clients.
2156 On the other hand the POSIX standard defines a locale-independent 7-bit
2157 .Dq portable character set
2158 that should be used when overall portability is an issue, the even more
2159 restricted subset named
2160 .Dq portable filename character set
2161 consists of A-Z, a-z, 0-9, period
2162 .Ql \&. ,
2163 underscore
2164 .Ql _
2165 and hyphen-minus
2166 .Ql - .
2167 .\" }}}
2169 .\" .Ss "Message states" {{{
2170 .Ss "Message states"
2172 \*(UA differentiates in between several message states; the current
2173 state will be reflected in the summary of
2174 .Ic headers
2175 if the
2176 .Va attrlist
2177 of the configured
2178 .Va headline
2179 allows, and
2180 .Sx "Specifying messages"
2181 dependent on their state is possible.
2182 When operating on the system
2183 .Va inbox ,
2184 or in any other
2185 .Mx -sx
2186 .Sx "primary system mailbox" ,
2187 special actions, like the automatic moving of messages to the
2188 .Mx -sx
2189 .Sx "secondary mailbox"
2190 .Ev MBOX ,
2191 may be applied when the mailbox is left (also implicitly by program
2192 termination, unless the command
2193 .Ic exit
2194 was used) \(en however, because this may be irritating to users which
2195 are used to
2196 .Dq more modern
2197 mail-user-agents, the provided global
2198 .Pa \*(UR
2199 template sets the internal
2200 .Va hold
2202 .Va keepsave
2203 variables in order to suppress this behaviour.
2205 .Bl -hang -width ".It Ql new"
2206 .It Ql new
2207 Message has neither been viewed nor moved to any other state.
2208 Such messages are retained even in the
2209 .Mx -sx
2210 .Sx "primary system mailbox" .
2212 .It Ql unread
2213 Message has neither been viewed nor moved to any other state, but the
2214 message was present already when the mailbox has been opened last:
2215 Such messages are retained even in the
2216 .Mx -sx
2217 .Sx "primary system mailbox" .
2219 .It Ql read
2220 The message has been processed by one of the following commands:
2221 .Ic ~f ,
2222 .Ic ~m ,
2223 .Ic ~F ,
2224 .Ic ~M ,
2225 .Ic copy ,
2226 .Ic mbox ,
2227 .Ic next ,
2228 .Ic pipe  ,
2229 .Ic Print ,
2230 .Ic print ,
2231 .Ic top ,
2232 .Ic Type ,
2233 .Ic type ,
2234 .Ic undelete .
2235 The commands
2236 .Ic dp
2238 .Ic dt
2239 will always try to automatically
2240 .Dq step
2242 .Ic type
2244 .Dq next
2245 logical message, and may thus mark multiple messages as read, the
2246 .Ic delete
2247 command will do so if the internal variable
2248 .Va autoprint
2249 is set.
2251 Except when the
2252 .Ic exit
2253 command is used, messages that are in a
2254 .Mx -sx
2255 .Sx "primary system mailbox"
2256 and are in
2257 .Ql read
2258 state when the mailbox is left will be saved in the
2259 .Mx -sx
2260 .Sx "secondary mailbox"
2261 .Ev MBOX
2262 unless the internal variable
2263 .Va hold
2264 it set.
2266 .It Ql deleted
2267 The message has been processed by one of the following commands:
2268 .Ic delete ,
2269 .Ic dp ,
2270 .Ic dt .
2271 Only
2272 .Ic undelete
2273 can be used to access such messages.
2275 .It Ql preserved
2276 The message has been processed by a
2277 .Ic preserve
2278 command and it will be retained in its current location.
2280 .It Ql saved
2281 The message has been processed by one of the following commands:
2282 .Ic save
2284 .Ic write .
2285 Unless when the
2286 .Ic exit
2287 command is used, messages that are in a
2288 .Mx -sx
2289 .Sx "primary system mailbox"
2290 and are in
2291 .Ql saved
2292 state when the mailbox is left will be deleted; they will be saved in the
2293 .Mx -sx
2294 .Sx "secondary mailbox"
2295 .Ev MBOX
2296 when the internal variable
2297 .Va keepsave
2298 is set.
2302 In addition to these message states, flags which otherwise have no
2303 technical meaning in the mail system except allowing special ways of
2304 addressing them when
2305 .Sx "Specifying messages"
2306 can be set on messages.
2307 These flags are saved with messages and are thus persistent, and are
2308 portable between a set of widely used MUAs.
2310 .Bl -hang -width ".It Ic answered"
2311 .It Ic answered
2312 Mark messages as having been answered.
2313 .It Ic draft
2314 Mark messages as being a draft.
2315 .It Ic flag
2316 Mark messages which need special attention.
2318 .\" }}}
2320 .\" .Ss "Specifying messages" {{{
2321 .Ss "Specifying messages"
2323 Commands which take
2324 .Sx "Message list arguments" ,
2325 such as
2326 .Ic from
2327 a.k.a.\&
2328 .Ic search ,
2329 .Ic type
2331 .Ic delete ,
2332 can be given a list of message numbers as arguments to apply to a number
2333 of messages at once.
2334 Thus
2335 .Ql delete 1 2
2336 deletes messages 1 and 2,
2337 whereas
2338 .Ql delete 1-5
2339 will delete the messages 1 through 5.
2340 In sorted or threaded mode (see the
2341 .Ic sort
2342 command),
2343 .Ql delete 1-5
2344 will delete the messages that are located between (and including)
2345 messages 1 through 5 in the sorted/threaded order, as shown in the
2346 .Ic headers
2347 summary.
2348 The following special message names exist:
2351 .Bl -tag -width ".It Ar BaNg"
2352 .It Ar \&.
2353 The current message, the so-called
2354 .Dq dot .
2356 .It Ar \&;
2357 The message that was previously the current message.
2359 .It Ar \&,
2360 The parent message of the current message,
2361 that is the message with the Message-ID given in the
2362 .Ql In-Reply-To:
2363 field or the last entry of the
2364 .Ql References:
2365 field of the current message.
2367 .It Ar -
2368 The previous undeleted message, or the previous deleted message for the
2369 .Ic undelete
2370 command; In
2371 .Ic sort Ns
2372 ed or
2373 .Ql thread Ns
2374 ed mode, the previous such message in the according order.
2376 .It Ar +
2377 The next undeleted message, or the next deleted message for the
2378 .Ic undelete
2379 command; In
2380 .Ic sort Ns
2381 ed or
2382 .Ql thread Ns
2383 ed mode, the next such message in the according order.
2385 .It Ar ^
2386 The first undeleted message,
2387 or the first deleted message for the
2388 .Ic undelete
2389 command; In
2390 .Ic sort Ns
2391 ed or
2392 .Ql thread Ns
2393 ed mode, the first such message in the according order.
2395 .It Ar $
2396 The last message; In
2397 .Ic sort Ns
2398 ed or
2399 .Ql thread Ns
2400 ed mode, the last such message in the according order.
2402 .It Ar & Ns Ar x
2404 .Ql thread Ns
2406 .Ic sort
2407 mode, selects the message addressed with
2408 .Ar x ,
2409 where
2410 .Ar x
2411 is any other message specification,
2412 and all messages from the thread that begins at it.
2413 Otherwise it is identical to
2414 .Ar x .
2416 .Ar x
2417 is omitted,
2418 the thread beginning with the current message is selected.
2420 .It Ar *
2421 All messages.
2422 .It Ar `
2423 All messages that were included in the
2424 .Sx "Message list arguments"
2425 of the previous command.
2427 .It Ar x-y
2428 An inclusive range of message numbers.
2429 Selectors that may also be used as endpoints include any of
2430 .Ar .;-+^$ .
2432 .It Ar address
2433 A case-insensitive
2434 .Dq any substring matches
2435 search against the
2436 .Ql From:
2437 header, which will match addresses (too) even if
2438 .Va showname
2439 is set (and POSIX says
2440 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2441 However, if the
2442 .Va allnet
2443 variable is set, only the local part of the address is evaluated
2444 for the comparison, not ignoring case, and the setting of
2445 .Va showname
2446 is completely ignored.
2447 For finer control and match boundaries use the
2448 .Ql @
2449 search expression.
2451 .It Ar / Ns Ar string
2452 All messages that contain
2453 .Ar string
2454 in the subject field (case ignored according to locale).
2455 See also the
2456 .Va searchheaders
2457 variable.
2459 .Ar string
2460 is empty,
2461 the string from the previous specification of that type is used again.
2464 .It Xo Op Ar @ Ns Ar name-list Ns
2465 .Ar @ Ns Ar expr
2467 All messages that contain the given case-insensitive search
2468 .Ar expr Ns
2469 ession;  If the \*(OPal regular expression support is available
2470 .Ar expr
2471 will be interpreted as (an extended) one if any of the
2472 .Dq magical
2473 regular expression characters
2474 .Ql ^[]*+?|$
2475 is seen (see
2476 .Xr re_format 7 ) .
2477 If the optional
2478 .Ar @ Ns Ar name-list
2479 part is missing the search is restricted to the subject field body,
2480 but otherwise
2481 .Ar name-list
2482 specifies a comma-separated list of header fields to search, e.g.,
2485 .Dl '@to,from,cc@Someone i ought to know'
2488 In order to search for a string that includes a
2489 .Ql @
2490 (commercial at) character the
2491 .Ar name-list
2492 is effectively non-optional, but may be given as the empty string.
2493 Also, specifying an empty search
2494 .Ar expr Ns
2495 ession will effectively test for existence of the given header fields.
2496 Some special header fields may be abbreviated:
2497 .Ql f ,
2498 .Ql t ,
2499 .Ql c ,
2500 .Ql b
2502 .Ql s
2503 will match
2504 .Ql From ,
2505 .Ql To ,
2506 .Ql Cc ,
2507 .Ql Bcc
2509 .Ql Subject ,
2510 respectively and case-insensitively.
2511 \*(OPally, and just like
2512 .Ar expr ,
2513 .Ar name-list
2514 will be interpreted as (an extended) regular expression if any of the
2515 .Dq magical
2516 regular expression characters is seen.
2519 The special names
2520 .Ql header
2522 .Ql <
2523 can be used to search in (all of) the header(s) of the message, and the
2524 special names
2525 .Ql body
2527 .Ql >
2529 .Ql text
2531 .Ql =
2532 will perform full text searches \(en whereas the former searches only
2533 the body, the latter also searches the message header (\*(ID this mode
2534 yet brute force searches over the entire decoded content of messages,
2535 including administrativa strings).
2538 This specification performs full text comparison, but even with
2539 regular expression support it is almost impossible to write a search
2540 expression that safely matches only a specific address domain.
2541 To request that the body content of the header is treated as a list of
2542 addresses, and to strip those down to the plain email address which the
2543 search expression is to be matched against, prefix the effective
2544 .Ar name-list
2545 with a tilde
2546 .Ql ~ :
2549 .Dl @~f@@a\e.safe\e.domain\e.match$
2552 .It Ar :c
2553 All messages of state or with matching condition
2554 .Ql c ,
2555 where
2556 .Ql c
2557 is one or multiple of the following colon modifiers:
2559 .Bl -tag -compact -width ".It Ar :M"
2560 .It Ar a
2561 .Ic answered
2562 messages (cf. the variable
2563 .Va markanswered ) .
2564 .It Ar d
2565 .Ql deleted
2566 messages (for the
2567 .Ic undelete
2569 .Ic from
2570 commands only).
2571 .It Ar f
2572 .Ic flag Ns
2573 ged messages.
2574 .It Ar L
2575 Messages with receivers that match
2576 .Ic mlsubscribe Ns
2577 d addresses.
2578 .It Ar l
2579 Messages with receivers that match
2580 .Ic mlist Ns
2581 ed addresses.
2582 .It Ar n
2583 .Ql new
2584 messages.
2585 .It Ar o
2586 Old messages (any not in state
2587 .Ql read
2589 .Ql new ) .
2590 .It Ar r
2591 .Ql read
2592 messages.
2593 .It Ar S
2594 \*(OP Messages with unsure spam classification (see
2595 .Sx "Handling spam" ) .
2596 .It Ar s
2597 \*(OP Messages classified as spam.
2598 .It Ar t
2599 Messages marked as
2600 .Ic draft .
2601 .It Ar u
2602 .Ql unread
2603 messages.
2609 \*(OP IMAP-style SEARCH expressions may also be used.
2610 This addressing mode is available with all types of mailbox
2611 .Ic folder Ns
2612 s; \*(UA will perform the search locally as necessary.
2613 Strings must be enclosed by double quotes
2614 .Ql \&"
2615 in their entirety if they contain whitespace or parentheses;
2616 within the quotes, only reverse solidus
2617 .Ql \e
2618 is recognized as an escape character.
2619 All string searches are case-insensitive.
2620 When the description indicates that the
2621 .Dq envelope
2622 representation of an address field is used,
2623 this means that the search string is checked against both a list
2624 constructed as
2626 .Bd -literal -offset indent
2627 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2631 for each address,
2632 and the addresses without real names from the respective header field.
2633 These search expressions can be nested using parentheses, see below for
2634 examples.
2637 .Bl -tag -compact -width ".It Ar _n_u"
2638 .It Ar ( criterion )
2639 All messages that satisfy the given
2640 .Ar criterion .
2641 .It Ar ( criterion1 criterion2 ... criterionN )
2642 All messages that satisfy all of the given criteria.
2644 .It Ar ( or criterion1 criterion2 )
2645 All messages that satisfy either
2646 .Ar criterion1
2648 .Ar criterion2 ,
2649 or both.
2650 To connect more than two criteria using
2651 .Ql or
2652 specifications have to be nested using additional parentheses,
2653 as with
2654 .Ql (or a (or b c)) ,
2655 since
2656 .Ql (or a b c)
2657 really means
2658 .Ql ((a or b) and c) .
2659 For a simple
2660 .Ql or
2661 operation of independent criteria on the lowest nesting level,
2662 it is possible to achieve similar effects by using three separate
2663 criteria, as with
2664 .Ql (a) (b) (c) .
2666 .It Ar ( not criterion )
2667 All messages that do not satisfy
2668 .Ar criterion .
2669 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2670 All messages that contain
2671 .Ar string
2672 in the envelope representation of the
2673 .Ql Bcc:
2674 field.
2675 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2676 All messages that contain
2677 .Ar string
2678 in the envelope representation of the
2679 .Ql Cc:
2680 field.
2681 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2682 All messages that contain
2683 .Ar string
2684 in the envelope representation of the
2685 .Ql From:
2686 field.
2687 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2688 All messages that contain
2689 .Ar string
2690 in the
2691 .Ql Subject:
2692 field.
2693 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2694 All messages that contain
2695 .Ar string
2696 in the envelope representation of the
2697 .Ql To:
2698 field.
2699 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2700 All messages that contain
2701 .Ar string
2702 in the specified
2703 .Ql Name:
2704 field.
2705 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2706 All messages that contain
2707 .Ar string
2708 in their body.
2709 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2710 All messages that contain
2711 .Ar string
2712 in their header or body.
2713 .It Ar ( larger size )
2714 All messages that are larger than
2715 .Ar size
2716 (in bytes).
2717 .It Ar ( smaller size )
2718 All messages that are smaller than
2719 .Ar size
2720 (in bytes).
2722 .It Ar ( before date )
2723 All messages that were received before
2724 .Ar date ,
2725 which must be in the form
2726 .Ql d[d]-mon-yyyy ,
2727 where
2728 .Ql d
2729 denotes the day of the month as one or two digits,
2730 .Ql mon
2731 is the name of the month \(en one of
2732 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2734 .Ql yyyy
2735 is the year as four digits, e.g.,
2736 .Ql 28-Dec-2012 .
2738 .It Ar ( on date )
2739 All messages that were received on the specified date.
2740 .It Ar ( since date )
2741 All messages that were received since the specified date.
2742 .It Ar ( sentbefore date )
2743 All messages that were sent on the specified date.
2744 .It Ar ( senton date )
2745 All messages that were sent on the specified date.
2746 .It Ar ( sentsince date )
2747 All messages that were sent since the specified date.
2748 .It Ar ()
2749 The same criterion as for the previous search.
2750 This specification cannot be used as part of another criterion.
2751 If the previous command line contained more than one independent
2752 criterion then the last of those criteria is used.
2754 .\" }}}
2756 .\" .Ss "On terminal control and line editor" {{{
2757 .Ss "On terminal control and line editor"
2759 \*(OP Terminal control will be realized through one of the standard
2761 libraries, either the
2762 .Lb libtermcap ,
2763 or, alternatively, the
2764 .Lb libterminfo ,
2765 both of which will be initialized to work with the environment variable
2766 .Ev TERM .
2767 Terminal control will enhance or enable interactive usage aspects, e.g.,
2768 .Sx "Coloured display" ,
2769 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2770 byte-sequences of keys like the cursor- and function-keys.
2773 The internal variable
2774 .Va termcap
2775 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2776 Actual library interaction can be disabled completely by setting
2777 .Va termcap-disable ;
2778 .Va termcap
2779 will be queried regardless, which is true even if the \*(OPal library
2780 support has not been enabled at configuration time as long as some other
2781 \*(OP which (may) query terminal control sequences has been enabled.
2782 \*(UA can be told to enter an alternative exclusive screen, the
2783 so-called ca-mode, by setting
2784 .Va termcap-ca-mode ;
2785 this requires sufficient terminal support, and the used
2786 .Ev PAGER
2787 may also need special configuration, dependent on the value of
2788 .Va crt .
2791 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2792 environments which comply to the ISO C standard
2793 .St -isoC-amd1 ,
2794 and will support wide glyphs if possible (the necessary functionality
2795 had been removed from ISO C, but was included in
2796 .St -xpg4 ) .
2797 Usage of a line editor in interactive mode can be prevented by setting
2798 .Va line-editor-disable .
2799 Especially if the \*(OPal terminal control support is missing setting
2800 entries in the internal variable
2801 .Va termcap
2802 will help shall the MLE misbehave, see there for more.
2803 The MLE can support a little bit of
2804 .Ic colour .
2807 \*(OP If the
2808 .Ic history
2809 feature is available then input from line editor prompts will be saved
2810 in a history list that can be searched in and be expanded from.
2811 Such saving can be prevented by prefixing input with any amount of
2812 whitespace.
2813 Aspects of history, like allowed content and maximum size, as well as
2814 whether history shall be saved persistently, can be configured with the
2815 internal variables
2816 .Va history-file ,
2817 .Va history-gabby ,
2818 .Va history-gabby-persist
2820 .Va history-size .
2823 The MLE supports a set of editing and control commands.
2824 By default (as) many (as possible) of these will be assigned to a set of
2825 single-letter control codes, which should work on any terminal (and can
2826 be generated by holding the
2827 .Dq control
2828 key while pressing the key of desire, e.g.,
2829 .Ql control-D ) .
2830 If the \*(OPal
2831 .Ic bind
2832 command is available then the MLE commands can also be accessed freely
2833 by assigning the command name, which is shown in parenthesis in the list
2834 below, to any desired key-sequence, and the MLE will instead and also use
2835 .Ic bind
2836 to establish its built-in key bindings
2837 (more of them if the \*(OPal terminal control is available),
2838 an action which can then be suppressed completely by setting
2839 .Va line-editor-no-defaults .
2840 .Sx "Shell-style argument quoting"
2841 notation is used in the following;
2842 combinations not mentioned either cause job control signals or do not
2843 generate a (unique) keycode:
2847 .Bl -tag -compact -width ".It Ql \eBa"
2848 .It Ql \ecA
2849 Go to the start of the line
2851 .Pf ( Cd mle-go-home ) .
2853 .It Ql \ecB
2854 Move the cursor backward one character
2856 .Pf ( Cd mle-go-bwd ) .
2858 .It Ql \ecD
2859 Forward delete the character under the cursor;
2860 quits \*(UA if used on the empty line unless the internal variable
2861 .Va ignoreeof
2862 is set
2864 .Pf ( Cd mle-del-fwd ) .
2866 .It Ql \ecE
2867 Go to the end of the line
2869 .Pf ( Cd mle-go-end ) .
2871 .It Ql \ecF
2872 Move the cursor forward one character
2874 .Pf ( Cd mle-go-fwd ) .
2876 .It Ql \ecG
2877 Cancel current operation, full reset.
2878 If there is an active history search or tabulator expansion then this
2879 command will first reset that, reverting to the former line content;
2880 thus a second reset is needed for a full reset in this case
2882 .Pf ( Cd mle-reset ) .
2884 .It Ql \ecH
2885 Backspace: backward delete one character
2887 .Pf ( Cd mle-del-bwd ) .
2889 .It Ql \ecI
2890 \*(NQ
2891 Horizontal tabulator:
2892 try to expand the word before the cursor, supporting the usual
2893 .Sx "Filename transformations"
2895 .Pf ( Cd mle-complete ;
2896 this is affected by
2897 .Cd mle-quote-rndtrip ) .
2899 .It Ql \ecJ
2900 Newline:
2901 commit the current line
2903 .Pf ( Cd mle-commit ) .
2905 .It Ql \ecK
2906 Cut all characters from the cursor to the end of the line
2908 .Pf ( Cd mle-snarf-end ) .
2910 .It Ql \ecL
2911 Repaint the line
2913 .Pf ( Cd mle-repaint ) .
2915 .It Ql \ecN
2916 \*(OP Go to the next history entry
2918 .Pf ( Cd mle-hist-fwd ) .
2920 .It Ql \ecO
2921 (\*(OPally context-dependent) Invokes the command
2922 .Ic dt .
2924 .It Ql \ecP
2925 \*(OP Go to the previous history entry
2927 .Pf ( Cd mle-hist-bwd ) .
2929 .It Ql \ecQ
2930 Toggle roundtrip mode shell quotes, where produced,
2931 on and off
2933 .Pf ( Cd mle-quote-rndtrip ) .
2934 This setting is temporary, and will be forgotten once the command line
2935 is committed; also see
2936 .Ic shcodec .
2938 .It Ql \ecR
2939 \*(OP Complete the current line from (the remaining) older history entries
2941 .Pf ( Cd mle-hist-srch-bwd ) .
2943 .It Ql \ecS
2944 \*(OP Complete the current line from (the remaining) newer history entries
2946 .Pf ( Cd mle-hist-srch-fwd ) .
2948 .It Ql \ecT
2949 Paste the snarf buffer
2951 .Pf ( Cd mle-paste ) .
2953 .It Ql \ecU
2954 The same as
2955 .Ql \ecA
2956 followed by
2957 .Ql \ecK
2959 .Pf ( Cd mle-snarf-line ) .
2961 .It Ql \ecV
2962 Prompts for a Unicode character (hexadecimal number without prefix, see
2963 .Ic vexpr )
2964 to be inserted
2966 .Pf ( Cd mle-prompt-char ) .
2967 Note this command needs to be assigned to a single-letter control code
2968 in order to become recognized and executed during input of
2969 a key-sequence (only three single-letter control codes can be used for
2970 that shortcut purpose); this control code is then special-treated and
2971 thus cannot be part of any other sequence (because it will trigger the
2972 .Cd mle-prompt-char
2973 function immediately).
2975 .It Ql \ecW
2976 Cut the characters from the one preceding the cursor to the preceding
2977 word boundary
2979 .Pf ( Cd mle-snarf-word-bwd ) .
2981 .It Ql \ecX
2982 Move the cursor forward one word boundary
2984 .Pf ( Cd mle-go-word-fwd ) .
2986 .It Ql \ecY
2987 Move the cursor backward one word boundary
2989 .Pf ( Cd mle-go-word-bwd ) .
2991 .It Ql \ec[
2992 Escape: reset a possibly used multibyte character input state machine
2993 and \*(OPally a lingering, incomplete key binding
2995 .Pf ( Cd mle-cancel ) .
2996 This command needs to be assigned to a single-letter control code in
2997 order to become recognized and executed during input of a key-sequence
2998 (only three single-letter control codes can be used for that shortcut
2999 purpose).
3000 This control code may also be part of a multi-byte sequence, but if
3001 a sequence is active and the very control code is currently also an
3002 expected input, then the active sequence takes precedence and will
3003 consume the control code.
3005 .It Ql \ec\e
3006 (\*(OPally context-dependent) Invokes the command
3007 .Ql Ic z Ns + .
3009 .It Ql \ec]
3010 (\*(OPally context-dependent) Invokes the command
3011 .Ql Ic z Ns $ .
3013 .It Ql \ec^
3014 (\*(OPally context-dependent) Invokes the command
3015 .Ql Ic z Ns 0 .
3017 .It Ql \ec_
3018 Cut the characters from the one after the cursor to the succeeding word
3019 boundary
3021 .Pf ( Cd mle-snarf-word-fwd ) .
3023 .It Ql \ec?
3024 Backspace:
3025 .Cd mle-del-bwd .
3027 .It \(en
3029 .Cd mle-fullreset :
3030 different to
3031 .Cd mle-reset
3032 this will immediately reset a possibly active search etc.
3034 .It \(en
3036 .Cd mle-bell :
3037 ring the audible bell.
3039 .\" }}}
3041 .\" .Ss "Coloured display" {{{
3042 .Ss "Coloured display"
3044 \*(OP \*(UA can be configured to support a coloured display and font
3045 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
3046 rendition) escape sequences.
3047 Usage of colours and font attributes solely depends upon the
3048 capability of the detected terminal type that is defined by the
3049 environment variable
3050 .Ev TERM
3051 and which can be fine-tuned by the user via the internal variable
3052 .Va termcap .
3055 On top of what \*(UA knows about the terminal the boolean variable
3056 .Va colour-pager
3057 defines whether the actually applicable colour and font attribute
3058 sequences should also be generated when output is going to be paged
3059 through the external program defined by the environment variable
3060 .Ev PAGER
3061 (also see
3062 .Va crt Ns
3064 This is not enabled by default because different pager programs need
3065 different command line switches or other configuration in order to
3066 support those sequences.
3067 \*(UA however knows about some widely used pagers and in a clean
3068 environment it is often enough to simply set
3069 .Va colour-pager ;
3070 please refer to that variable for more on this topic.
3073 Colours and font attributes can be managed with the multiplexer command
3074 .Ic colour ,
3076 .Ic uncolour
3077 can be used to remove mappings of a given colour type.
3078 If the variable
3079 .Va colour-disable
3080 is set then any active usage of colour and font attribute sequences
3081 is suppressed without affecting possibly established
3082 .Ic colour
3083 mappings.
3084 Since colours are only available in interactive mode, it may make
3085 sense to conditionalize the colour setup by encapsulating it with
3086 .Ic if :
3088 .Bd -literal -offset indent
3089 if terminal && [ "$features" =% +colour ]
3090   colour iso view-msginfo ft=bold,fg=green
3091   colour iso view-header ft=bold,fg=red from,subject
3092   colour iso view-header fg=red
3094   uncolour iso view-header from,subject
3095   colour iso view-header ft=bold,fg=magenta,bg=cyan
3096   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3097   colour mono view-header ft=bold
3098   colour mono view-header ft=bold,ft=reverse subject,from
3099 endif
3101 .\" }}}
3103 .\" .Ss "Handling spam" {{{
3104 .Ss "Handling spam"
3106 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3107 identification of, and, in general, dealing with spam messages.
3108 A precondition of most commands in order to function is that the
3109 .Va spam-interface
3110 variable is set to one of the supported interfaces.
3111 .Sx "Specifying messages"
3112 that have been identified as spam is possible via their (volatile)
3113 .Ql is-spam
3114 state by using the
3115 .Ql Ar :s
3117 .Ql Ar :S
3118 specifications, and their
3119 .Va attrlist
3120 entries will be used when displaying the
3121 .Va headline
3122 in the summary of
3123 .Ic headers .
3125 .Bl -bullet
3127 .Ic spamrate
3128 rates the given messages and sets their
3129 .Ql is-spam
3130 flag accordingly.
3131 If the spam interface offers spam scores these can be shown in
3132 .Va headline
3133 by using the format
3134 .Ql %$ .
3136 .Ic spamham ,
3137 .Ic spamspam
3139 .Ic spamforget
3140 will interact with the Bayesian filter of the chosen interface and learn
3141 the given messages as
3142 .Dq ham
3144 .Dq spam ,
3145 respectively; the last command can be used to cause
3146 .Dq unlearning
3147 of messages; it adheres to their current
3148 .Ql is-spam
3149 state and thus reverts previous teachings.
3151 .Ic spamclear
3153 .Ic spamset
3154 will simply set and clear, respectively, the mentioned volatile
3155 .Ql is-spam
3156 message flag, without any interface interaction.
3161 .Xr spamassassin 1
3162 based
3163 .Va spam-interface
3164 .Ql spamc
3165 requires a running instance of the
3166 .Xr spamd 1
3167 server in order to function, started with the option
3168 .Fl -allow-tell
3169 shall Bayesian filter learning be possible.
3171 .Bd -literal -offset indent
3172 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3173 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3174     --daemonize [--local] [--allow-tell]
3178 Thereafter \*(UA can make use of these interfaces:
3180 .Bd -literal -offset indent
3181 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3182     -Sspamc-command=/usr/local/bin/spamc \e
3183     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3185 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3186     -Sspamc-command=/usr/local/bin/spamc \e
3187     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3191 Using the generic filter approach allows usage of programs like
3192 .Xr bogofilter 1 .
3193 Here is an example, requiring it to be accessible via
3194 .Ev PATH :
3196 .Bd -literal -offset indent
3197 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3198     -Sspamfilter-ham="bogofilter -n" \e
3199     -Sspamfilter-noham="bogofilter -N" \e
3200     -Sspamfilter-nospam="bogofilter -S" \e
3201     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3202     -Sspamfilter-spam="bogofilter -s" \e
3203     -Sspamfilter-rate-scanscore="1;^(.+)$"
3207 Because messages must exist on local storage in order to be scored (or
3208 used for Bayesian filter training), it is possibly a good idea to
3209 perform the local spam check last.
3210 Spam can be checked automatically when opening specific folders by
3211 setting a specialized form of the internal variable
3212 .Va folder-hook .
3214 .Bd -literal -offset indent
3215 define spamdelhook {
3216   # Server side DCC
3217   spamset (header x-dcc-brand-metrics "bulk")
3218   # Server-side spamassassin(1)
3219   spamset (header x-spam-flag "YES")
3220   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3221   move :S +maybe-spam
3222   spamrate :u
3223   del :s
3224   move :S +maybe-spam
3226 set folder-hook-SOMEFOLDER=spamdelhook
3230 See also the documentation for the variables
3231 .Va spam-interface , spam-maxsize ,
3232 .Va spamc-command , spamc-arguments , spamc-user ,
3233 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3234   spamfilter-rate
3236 .Va spamfilter-rate-scanscore .
3237 .\" }}}
3239 .\" }}} (DESCRIPTION)
3242 .\" .Sh COMMANDS {{{
3243 .Sh COMMANDS
3245 \*(UA reads input in lines.
3246 An unquoted reverse solidus
3247 .Ql \e
3248 at the end of a command line
3249 .Dq escapes
3250 the newline character: it is discarded and the next line of input is
3251 used as a follow-up line, with all leading whitespace removed;
3252 once an entire line is completed, the whitespace characters
3253 .Cm space , tabulator , newline
3254 as well as those defined by the variable
3255 .Va ifs
3256 are removed from the beginning and end.
3257 Placing any whitespace characters at the beginning of a line will
3258 prevent a possible addition of the command line to the \*(OPal
3259 .Ic history .
3262 The beginning of such input lines is then scanned for the name of
3263 a known command: command names may be abbreviated, in which case the
3264 first command that matches the given prefix will be used.
3265 .Sx "Command modifiers"
3266 may prefix a command in order to modify its behaviour.
3267 A name may also be a
3268 .Ic commandalias ,
3269 which will become expanded until no more expansion is possible.
3270 Once the command that shall be executed is known, the remains of the
3271 input line will be interpreted according to command-specific rules,
3272 documented in the following.
3275 This behaviour is different to the
3276 .Xr sh 1 Ns
3277 ell, which is a programming language with syntactic elements of clearly
3278 defined semantics, and therefore capable to sequentially expand and
3279 evaluate individual elements of a line.
3280 \*(UA will never be able to handle
3281 .Ql ? set one=value two=$one
3282 in a single statement, because the variable assignment is performed by
3283 the command
3284 .Pf ( Ic set ) ,
3285 not the language.
3288 The command
3289 .Ic list
3290 can be used to show the list of all commands, either alphabetically
3291 sorted or in prefix search order (these do not match, also because the
3292 POSIX standard prescribes a set of abbreviations).
3293 \*(OPally the command
3294 .Ic help
3296 .Ic \&? ) ,
3297 when given an argument, will show a documentation string for the
3298 command matching the expanded argument, as in
3299 .Ql ?t ,
3300 which should be a shorthand of
3301 .Ql ?type ;
3302 with these documentation strings both commands support a more
3303 .Va verbose
3304 listing mode which includes the argument type of the command and other
3305 information which applies; a handy suggestion might thus be:
3307 .Bd -literal -offset indent
3308 ? define __xv {
3309   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3310   localopts yes;wysh set verbose;ignerr eval "${@}";return ${?}
3312 ? commandalias xv '\ecall __xv'
3313 ? xv help set
3316 .\" .Ss "Command modifiers" {{{
3317 .Ss "Command modifiers"
3319 Commands may be prefixed by one or multiple command modifiers.
3320 Some command modifiers can be used with a restricted set of commands
3321 only, the
3322 .Va verbose
3323 version of
3324 .Ic list
3325 will (\*(OPally) show which modifiers apply.
3327 .Bl -bullet
3329 The modifier reverse solidus
3331 .Cm \e ,
3332 to be placed first, prevents
3333 .Ic commandalias
3334 expansions on the remains of the line, e.g.,
3335 .Ql \eecho
3336 will always evaluate the command
3337 .Ic echo ,
3338 even if an (command)alias of the same name exists.
3339 .Ic commandalias
3340 content may itself contain further command modifiers, including
3341 an initial reverse solidus to prevent further expansions.
3344 The modifier
3346 .Cm ignerr
3347 indicates that any error generated by the following command should be
3348 ignored by the state machine and not cause a program exit with enabled
3349 .Va errexit
3350 or for the standardized exit cases in
3351 .Va posix
3352 mode.
3353 .Va \&? ,
3354 one of the
3355 .Sx "INTERNAL VARIABLES" ,
3356 will be set to the real exit status of the command regardless.
3360 .Cm local
3361 will alter the called command to apply changes only temporarily,
3362 local to block-scope, and can thus only be used inside of a
3363 .Ic define Ns
3364 d macro or an
3365 .Ic account
3366 definition.
3367 Specifying it implies the modifier
3368 .Cm wysh .
3369 Block-scope settings will not be inherited by macros deeper in the
3370 .Ic call
3371 chain, and will be garbage collected once the current block is left.
3372 To record and unroll changes in the global scope use the command
3373 .Ic localopts .
3377 .Cm scope
3378 does yet not implement any functionality.
3382 .Cm u
3383 does yet not implement any functionality.
3386 Some commands support the
3388 .Cm vput
3389 modifier: if used, they expect the name of a variable, which can itself
3390 be a variable, i.e., shell expansion is applied, as their first
3391 argument, and will place their computation result in it instead of the
3392 default location (it is usually written to standard output).
3394 The given name will be tested for being a valid
3395 .Xr sh 1
3396 variable name, and may therefore only consist of upper- and lowercase
3397 characters, digits, and the underscore; the hyphen-minus may be used as
3398 a non-portable extension; digits may not be used as first, hyphen-minus
3399 may not be used as last characters.
3400 In addition the name may either not be one of the known
3401 .Sx "INTERNAL VARIABLES" ,
3402 or must otherwise refer to a writable (non-boolean) value variable.
3403 The actual put operation may fail nonetheless, e.g., if the variable
3404 expects a number argument only a number will be accepted.
3405 Any error during these operations causes the command as such to fail,
3406 and the error number
3407 .Va \&!
3408 will be set to
3409 .Va ^ERR Ns -NOTSUP ,
3410 the exit status
3411 .Va \&?
3412 should be set to
3413 .Ql -1 ,
3414 but some commands deviate from the latter, which is documented.
3417 Last, but not least, the modifier
3419 .Cm wysh
3420 can be used for some old and established commands to choose the new
3421 .Sx "Shell-style argument quoting"
3422 rules over the traditional
3423 .Sx "Old-style argument quoting" .
3425 .\" }}}
3427 .\" .Ss "Message list arguments" {{{
3428 .Ss "Message list arguments"
3430 Some commands expect arguments that represent messages (actually
3431 their symbolic message numbers), as has been documented above under
3432 .Sx "Specifying messages"
3433 already.
3434 If no explicit message list has been specified, the next message
3435 forward that satisfies the commands requirements will be used,
3436 and if there are no messages forward of the current message,
3437 the search proceeds backwards;
3438 if there are no good messages at all to be found, an error message is
3439 shown and the command is aborted.
3440 .\" }}}
3442 .\" .Ss "Old-style argument quoting" {{{
3443 .Ss "Old-style argument quoting"
3445 \*(ID This section documents the old, traditional style of quoting
3446 non-message-list arguments to commands which expect this type of
3447 arguments: whereas still used by the majority of such commands, the new
3448 .Sx "Shell-style argument quoting"
3449 may be available even for those via
3450 .Cm wysh ,
3451 one of the
3452 .Sx "Command modifiers" .
3453 Nonetheless care must be taken, because only new commands have been
3454 designed with all the capabilities of the new quoting rules in mind,
3455 which can, e.g., generate control characters.
3458 .Bl -bullet -offset indent
3460 An argument can be enclosed between paired double-quotes
3461 .Ql """argument"""
3463 single-quotes
3464 .Ql 'argument' ;
3465 any whitespace, shell word expansion, or reverse solidus characters
3466 (except as described next) within the quotes are treated literally as
3467 part of the argument.
3468 A double-quote will be treated literally within single-quotes and vice
3469 versa.
3470 Inside such a quoted string the actually used quote character can be
3471 used nonetheless by escaping it with a reverse solidus
3472 .Ql \e ,
3473 as in
3474 .Ql """y\e""ou""" .
3477 An argument that is not enclosed in quotes, as above, can usually still
3478 contain space characters if those spaces are reverse solidus escaped, as in
3479 .Ql you\e are .
3482 A reverse solidus outside of the enclosing quotes is discarded
3483 and the following character is treated literally as part of the argument.
3485 .\" }}}
3487 .\" .Ss "Shell-style argument quoting" {{{
3488 .Ss "Shell-style argument quoting"
3490 Commands which do not expect message-list arguments use
3491 .Xr sh 1 Ns
3492 ell-style, and therefore POSIX standardized, argument parsing and
3493 quoting rules.
3494 \*(ID Most new commands only support these new rules and are flagged
3495 \*(NQ, some elder ones can use them with the command modifier
3496 .Cm wysh ;
3497 in the future only this type of argument quoting will remain.
3500 A command line is parsed from left to right and an input token is
3501 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3502 Metacharacters are vertical bar
3503 .Cm \&| ,
3504 ampersand
3505 .Cm & ,
3506 semicolon
3507 .Cm \&; ,
3508 as well as all characters from the variable
3509 .Va ifs ,
3510 and / or
3511 .Cm space , tabulator , newline .
3512 The additional metacharacters left and right parenthesis
3513 .Cm \&( , \&)
3514 and less-than and greater-than signs
3515 .Cm < , >
3516 that the
3517 .Xr sh 1
3518 supports are not used, and are treated as ordinary characters: for one
3519 these characters are a vivid part of email addresses, and it seems
3520 highly unlikely that their function will become meaningful to \*(UA.
3522 .Bd -filled -offset indent
3523 .Sy Compatibility note:
3524 \*(ID Please note that even many new-style commands do not yet honour
3525 .Va ifs
3526 to parse their arguments: whereas the
3527 .Xr sh 1 Ns
3528 ell is a language with syntactic elements of clearly defined semantics,
3529 \*(UA parses entire input lines and decides on a per-command base what
3530 to do with the rest of the line.
3531 This also means that whenever an unknown command is seen all that \*(UA
3532 can do is cancellation of the processing of the remains of the line.
3534 It also often depends on an actual subcommand of a multiplexer command
3535 how the rest of the line should be treated, and until v15 we are not
3536 capable to perform this deep inspection of arguments.
3537 Nonetheless, at least the following commands which work with positional
3538 parameters fully support
3539 .Va ifs
3540 for an almost shell-compatible field splitting:
3541 .Ic call , call_if , read , vpospar , xcall .
3545 Any unquoted number sign
3546 .Ql #
3547 at the beginning of a new token starts a comment that extends to the end
3548 of the line, and therefore ends argument processing.
3549 An unquoted dollar sign
3550 .Ql $
3551 will cause variable expansion of the given name, which must be a valid
3552 .Xr sh 1 Ns
3553 ell-style variable name (see
3554 .Cm vput ) :
3555 .Sx "INTERNAL VARIABLES"
3556 as well as
3557 .Sx ENVIRONMENT
3558 (shell) variables can be accessed through this mechanism, brace
3559 enclosing the name is supported (i.e., to subdivide a token).
3562 Whereas the metacharacters
3563 .Cm space , tabulator , newline
3564 only complete an input token, vertical bar
3565 .Cm \&| ,
3566 ampersand
3567 .Cm &
3568 and semicolon
3569 .Cm \&;
3570 also act as control operators and perform control functions.
3571 For now supported is semicolon
3572 .Cm \&; ,
3573 which terminates a single command, therefore sequencing the command line
3574 and making the remainder of the line a subject to reevaluation.
3575 With sequencing, multiple command argument types and quoting rules may
3576 therefore apply to a single line, which can become problematic before
3577 v15: e.g., the first of the following will cause surprising results.
3580 .Dl ? echo one; set verbose; echo verbose=$verbose.
3581 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3584 Quoting is a mechanism that will remove the special meaning of
3585 metacharacters and reserved words, and will prevent expansion.
3586 There are four quoting mechanisms: the escape character, single-quotes,
3587 double-quotes and dollar-single-quotes:
3590 .Bl -bullet -offset indent
3592 The literal value of any character can be preserved by preceding it
3593 with the escape character reverse solidus
3594 .Ql \e .
3597 Arguments which are enclosed in
3598 .Ql 'single-\:quotes'
3599 retain their literal value.
3600 A single-quote cannot occur within single-quotes.
3603 The literal value of all characters enclosed in
3604 .Ql \(dqdouble-\:quotes\(dq
3605 is retained, with the exception of dollar sign
3606 .Ql $ ,
3607 which will cause variable expansion, as above, backquote (grave accent)
3608 .Ql ` ,
3609 (which not yet means anything special), reverse solidus
3610 .Ql \e ,
3611 which will escape any of the characters dollar sign
3612 .Ql $
3613 (to prevent variable expansion), backquote (grave accent)
3614 .Ql ` ,
3615 double-quote
3616 .Ql \(dq
3617 (to prevent ending the quote) and reverse solidus
3618 .Ql \e
3619 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3620 but has no special meaning otherwise.
3623 Arguments enclosed in
3624 .Ql $'dollar-\:single-\:quotes'
3625 extend normal single quotes in that reverse solidus escape sequences are
3626 expanded as follows:
3628 .Bl -tag -compact -width ".Ql \eNNN"
3629 .It Ql \ea
3630 bell control character (ASCII and ISO-10646 BEL).
3631 .It Ql \eb
3632 backspace control character (ASCII and ISO-10646 BS).
3633 .It Ql \eE
3634 escape control character (ASCII and ISO-10646 ESC).
3635 .It Ql \ee
3636 the same.
3637 .It Ql \ef
3638 form feed control character (ASCII and ISO-10646 FF).
3639 .It Ql \en
3640 line feed control character (ASCII and ISO-10646 LF).
3641 .It Ql \er
3642 carriage return control character (ASCII and ISO-10646 CR).
3643 .It Ql \et
3644 horizontal tabulator control character (ASCII and ISO-10646 HT).
3645 .It Ql \ev
3646 vertical tabulator control character (ASCII and ISO-10646 VT).
3647 .It Ql \e\e
3648 emits a reverse solidus character.
3649 .It Ql \e'
3650 single quote.
3651 .It Ql \e"
3652 double quote (escaping is optional).
3653 .It Ql \eNNN
3654 eight-bit byte with the octal value
3655 .Ql NNN
3656 (one to three octal digits), optionally prefixed by an additional
3657 .Ql 0 .
3658 A 0 byte will suppress further output for the quoted argument.
3659 .It Ql \exHH
3660 eight-bit byte with the hexadecimal value
3661 .Ql HH
3662 (one or two hexadecimal characters, no prefix, see
3663 .Ic vexpr ) .
3664 A 0 byte will suppress further output for the quoted argument.
3665 .It Ql \eUHHHHHHHH
3666 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3667 .Ql HHHHHHHH
3668 (one to eight hexadecimal characters) \(em note that Unicode defines the
3669 maximum codepoint ever to be supported as
3670 .Ql 0x10FFFF
3671 (in planes of
3672 .Ql 0xFFFF
3673 characters each).
3674 This escape is only supported in locales that support Unicode (see
3675 .Sx "Character sets" ) ,
3676 in other cases the sequence will remain unexpanded unless the given code
3677 point is ASCII compatible or (if the \*(OPal character set conversion is
3678 available) can be represented in the current locale.
3679 The character NUL will suppress further output for the quoted argument.
3680 .It Ql \euHHHH
3681 Identical to
3682 .Ql \eUHHHHHHHH
3683 except it takes only one to four hexadecimal characters.
3684 .It Ql \ecX
3685 Emits the non-printable (ASCII and compatible) C0 control codes
3686 0 (NUL) to 31 (US), and 127 (DEL).
3687 Printable representations of ASCII control codes can be created by
3688 mapping them to a different, visible part of the ASCII character set.
3689 Adding the number 64 achieves this for the codes 0 to 31, e.g., 7 (BEL):
3690 .Ql 7 + 64 = 71 = G .
3691 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3692 .Ic vexpr ) ,
3693 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3694 .Ql ? vexpr ^ 127 64 .
3696 Whereas historically circumflex notation has often been used for
3697 visualization purposes of control codes, e.g.,
3698 .Ql ^G ,
3699 the reverse solidus notation has been standardized:
3700 .Ql \ecG .
3701 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3702 as shown above (e.g.,
3703 .Ql \ea ,
3704 .Ql \en ,
3705 .Ql \et ) :
3706 whenever such an alias exists it will be used for display purposes.
3707 The control code NUL
3708 .Pf ( Ql \ec@ ,
3709 a non-standard extension) will suppress further output for the remains
3710 of the token (which may extend beyond the current quote), or, depending
3711 on the context, the remains of all arguments for the current command.
3712 .It Ql \e$NAME
3713 Non-standard extension: expand the given variable name, as above.
3714 Brace enclosing the name is supported.
3715 .It Ql \e`{command}
3716 Not yet supported, just to raise awareness: Non-standard extension.
3721 Caveats:
3723 .Bd -literal -offset indent
3724 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3725 ? echo Quotes ${HOME} and tokens differ! # comment
3726 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3728 .\" }}}
3730 .\" .Ss "Raw data arguments for codec commands" {{{
3731 .Ss "Raw data arguments for codec commands"
3733 A special set of commands, which all have the string
3734 .Dq codec
3735 in their name, e.g.,
3736 .Ic addrcodec ,
3737 .Ic shcodec ,
3738 .Ic urlcodec ,
3739 take raw string data as input, which means that the content of the
3740 command input line is passed completely unexpanded and otherwise
3741 unchanged: like this the effect of the actual codec is visible without
3742 any noise of possible shell quoting rules etc., i.e., the user can input
3743 one-to-one the desired or questionable data.
3744 To gain a level of expansion, the entire command line can be
3745 .Ic eval Ns
3746 uated first, e.g.,
3748 .Bd -literal -offset indent
3749 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3750 ? echo $res
3751 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3752 ? shcodec d $res
3753 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3754 ? eval shcodec d $res
3755 /usr/Sch\[:o]nes Wetter/heute.txt
3757 .\" }}}
3759 .\" .Ss "Filename transformations" {{{
3760 .Ss "Filename transformations"
3762 Filenames, where expected, and unless documented otherwise, are
3763 subsequently subject to the following filename transformations, in
3764 sequence:
3766 .Bl -bullet -offset indent
3768 If the given name is a registered
3769 .Ic shortcut ,
3770 it will be replaced with the expanded shortcut.
3773 The filename is matched against the following patterns or strings:
3775 .Bl -hang -compact -width ".Ar %user"
3776 .It Ar #
3777 (Number sign) is expanded to the previous file.
3778 .It Ar %
3779 (Percent sign) is replaced by the invoking
3780 .Mx -ix "primary system mailbox"
3781 user's primary system mailbox, which either is the (itself expandable)
3782 .Va inbox
3783 if that is set, the standardized absolute pathname indicated by
3784 .Ev MAIL
3785 if that is set, or a built-in compile-time default otherwise.
3786 .It Ar %user
3787 Expands to the primary system mailbox of
3788 .Ar user
3789 (and never the value of
3790 .Va inbox ,
3791 regardless of its actual setting).
3792 .It Ar &
3793 (Ampersand) is replaced with the invoking user's
3794 .Mx -ix "secondary mailbox"
3795 secondary mailbox, the
3796 .Ev MBOX .
3797 .It Ar +file
3798 Refers to a
3799 .Ar file
3800 in the
3801 .Va folder
3802 directory (if that variable is set).
3803 .It Ar %:filespec
3804 Expands to the same value as
3805 .Ar filespec ,
3806 but has special meaning when used with, e.g., the command
3807 .Ic file :
3808 the file will be treated as a primary system mailbox by, e.g., the
3809 .Ic mbox
3811 .Ic save
3812 commands, meaning that messages that have been read in the current
3813 session will be moved to the
3814 .Ev MBOX
3815 mailbox instead of simply being flagged as read.
3819 Meta expansions may be applied to the resulting filename, as allowed by
3820 the operation and applicable to the resulting access protocol (also see
3821 .Sx "On URL syntax and credential lookup" ) .
3822 For the file-protocol, a leading tilde
3823 .Ql ~
3824 character will be replaced by the expansion of
3825 .Ev HOME ,
3826 except when followed by a valid user name, in which case the home
3827 directory of the given user is used instead.
3829 A shell expansion as if specified in double-quotes (see
3830 .Sx "Shell-style argument quoting" )
3831 may be applied, so that any occurrence of
3832 .Ql $VARIABLE
3834 .Ql ${VARIABLE} )
3835 will be replaced by the expansion of the variable, if possible;
3836 .Sx "INTERNAL VARIABLES"
3837 as well as
3838 .Sx ENVIRONMENT
3839 (shell) variables can be accessed through this mechanism.
3841 Shell pathname wildcard pattern expansions
3842 .Pf ( Xr glob 7 )
3843 may be applied as documented.
3844 If the fully expanded filename results in multiple pathnames and the
3845 command is expecting only one file, an error results.
3847 In interactive context, in order to allow simple value acceptance (via
3848 .Dq ENTER ) ,
3849 arguments will usually be displayed in a properly quoted form, e.g., a file
3850 .Ql diet\e is \ecurd.txt
3851 may be displayed as
3852 .Ql 'diet\e is \ecurd.txt' .
3854 .\" }}}
3856 .\" .Ss "Commands" {{{
3857 .Ss "Commands"
3859 The following commands are available:
3861 .Bl -tag -width ".It Ic BaNg"
3865 .It Ic \&!
3866 Executes the
3867 .Ev SHELL
3868 command which follows, replacing unescaped exclamation marks with the
3869 previously executed command if the internal variable
3870 .Va bang
3871 is set.
3872 This command supports
3873 .Cm vput
3874 as documented in
3875 .Sx "Command modifiers" ,
3876 and manages the error number
3877 .Va \&! .
3878 A 0 or positive exit status
3879 .Va \&?
3880 reflects the exit status of the command, negative ones that
3881 an error happened before the command was executed, or that the program
3882 did not exit cleanly, but, e.g., due to a signal: the error number is
3883 .Va ^ERR Ns -CHILD ,
3884 then.
3887 In conjunction with the
3888 .Cm vput
3889 modifier the following special cases exist:
3890 a negative exit status occurs if the collected data could not be stored
3891 in the given variable, which is a
3892 .Va ^ERR Ns -NOTSUP
3893 error that should otherwise not occur.
3894 .Va ^ERR Ns -CANCELED
3895 indicates that no temporary file could be created to collect the command
3896 output at first glance.
3897 In case of catchable out-of-memory situations
3898 .Va ^ERR Ns -NOMEM
3899 will occur and \*(UA will try to store the empty string, just like with
3900 all other detected error conditions.
3904 .It Ic #
3905 The comment-command causes the entire line to be ignored.
3906 .Sy Note:
3907 this really is a normal command which' purpose is to discard its
3908 arguments, not a
3909 .Dq comment-start
3910 indicating special character, which means that, e.g., trailing comments
3911 on a line are not possible (except for commands which use
3912 .Sx "Shell-style argument quoting" ) .
3915 .It Ic +
3916 Goes to the next message in sequence and types it
3917 (like
3918 .Dq ENTER ) .
3921 .It Ic -
3922 Display the preceding message, or the n'th previous message if given
3923 a numeric argument n.
3926 .It Ic =
3927 Show the current message number (the
3928 .Dq dot ) .
3931 .It Ic \&?
3932 \*(OP Show a brief summary of commands.
3933 \*(OP Given an argument a synopsis for the command in question is
3934 shown instead; commands can be abbreviated in general and this command
3935 can be used to see the full expansion of an abbreviation including the
3936 synopsis, try, e.g.,
3937 .Ql ?h ,
3938 .Ql ?hel
3940 .Ql ?help
3941 and see how the output changes.
3942 This mode also supports a more
3943 .Va verbose
3944 output, which will provide the information documented for
3945 .Ic list .
3948 .It Ic \&|
3949 A synonym for the
3950 .Ic pipe
3951 command.
3955 .It Ic account , unaccount
3956 (ac, una) Creates, selects or lists (an) account(s).
3957 Accounts are special incarnations of
3958 .Ic define Ns d
3959 macros and group commands and variable settings which together usually
3960 arrange the environment for the purpose of creating an email account.
3961 Different to normal macros settings which are covered by
3962 .Ic localopts
3963 \(en here by default enabled! \(en will not be reverted before the
3964 .Ic account
3965 is changed again.
3966 The special account
3967 .Ql null
3968 (case-insensitive) always exists, and all but it can be deleted by the
3969 latter command, and in one operation with the special name
3970 .Ql * .
3971 Also for all but it a possibly set
3972 .Va on-account-cleanup
3973 hook is called once they are left.
3975 Without arguments a listing of all defined accounts is shown.
3976 With one argument the given account is activated: the system
3977 .Va inbox
3978 of that account will be activated (as via
3979 .Ic file ) ,
3980 a possibly installed
3981 .Va folder-hook
3982 will be run, and the internal variable
3983 .Va account
3984 will be updated.
3985 The two argument form is identical to defining a macro as via
3986 .Ic define :
3987 .Bd -literal -offset indent
3988 account myisp {
3989   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
3990   set from='(My Name) myname@myisp.example'
3991   set mta=smtp://mylogin@smtp.myisp.example
3997 .It Ic addrcodec
3998 Perform email address codec transformations on raw-data argument, rather
3999 according to email standards (RFC 5322; \*(ID will furtherly improve).
4000 Supports
4001 .Cm vput
4002 (see
4003 .Sx "Command modifiers" ) ,
4004 and manages the error number
4005 .Va \&! .
4006 The first argument must be either
4007 .Ar [+[+[+]]]e[ncode] ,
4008 .Ar d[ecode] ,
4009 .Ar s[kin]
4011 .Ar skinl[ist]
4012 and specifies the operation to perform on the rest of the line.
4015 Decoding will show how a standard-compliant MUA will display the given
4016 argument, which should be an email address.
4017 Please be aware that most MUAs have difficulties with the address
4018 standards, and vary wildly when (comments) in parenthesis,
4019 .Dq double-quoted
4020 strings, or quoted-pairs, as below, become involved.
4021 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4024 Skinning is identical to decoding but only outputs the plain address,
4025 without any string, comment etc. components.
4026 Another difference is that it may fail with the error number
4027 .Va \&!
4028 set to
4029 .Va ^ERR Ns -INVAL
4030 if decoding fails to find a(n) (valid) email address, in which case the
4031 unmodified input will be output again.
4034 .Ar skinlist
4035 first performs a skin operation, and thereafter checks a valid
4036 address for whether it is a registered mailing list (see
4037 .Ic mlist
4039 .Ic mlsubscribe ) ,
4040 eventually reporting that state in the error number
4041 .Va \&!
4043 .Va ^ERR Ns -EXIST .
4044 (This state could later become overwritten by an I/O error, though.)
4047 Encoding supports four different modes, lesser automated versions can be
4048 chosen by prefixing one, two or three plus signs: the standard imposes
4049 a special meaning on some characters, which thus have to be transformed
4050 to so-called quoted-pairs by pairing them with a reverse solidus
4051 .Ql \e
4052 in order to remove the special meaning; this might change interpretation
4053 of the entire argument from what has been desired, however!
4054 Specify one plus sign to remark that parenthesis shall be left alone,
4055 two for not turning double quotation marks into quoted-pairs, and three
4056 for also leaving any user-specified reverse solidus alone.
4057 The result will always be valid, if a successful exit status is reported
4058 (\*(ID the current parser fails this assertion for some constructs).
4059 \*(ID Addresses need to be specified in between angle brackets
4060 .Ql < ,
4061 .Ql >
4062 if the construct becomes more difficult, otherwise the current parser
4063 will fail; it is not smart enough to guess right.
4065 .Bd -literal -offset indent
4066 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4067 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4068 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4069 "Hey, you", \e out\e there <diet@exam.ple>
4070 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4071 diet@exam.ple
4077 .It Ic alias , unalias
4078 (a, una) Aliases are a method of creating personal distribution lists
4079 that map a single alias name to none to multiple real receivers;
4080 these aliases become expanded after message composing is completed.
4081 The latter command removes the given list of aliases, the special name
4082 .Ql *
4083 will discard all existing aliases.
4085 The former command shows all currently defined aliases when used without
4086 arguments, and with one argument the expansion of the given alias.
4087 With more than one argument, creates or appends to the alias name given
4088 as the first argument the remaining arguments.
4089 Alias names adhere to the Postfix MTA
4090 .Xr aliases 5
4091 rules and are thus restricted to alphabetic characters, digits, the
4092 underscore, hyphen-minus, the number sign, colon and commercial at,
4093 the last character can also be the dollar sign; the regular expression:
4094 .Ql [[:alnum:]_#:@-]+$? .
4095 .\" ALIASCOLON next sentence
4096 \*(ID Unfortunately the colon is currently not supported, as it
4097 interferes with normal address parsing rules.
4098 As extensions the exclamation mark
4099 .Ql \&! ,
4100 period
4101 .Ql \&.
4102 as well as
4103 .Dq any character that has the high bit set
4104 may be used.
4105 .\" ALIASCOLON next sentence
4106 \*(ID Such high bit characters will likely cause warnings at the moment
4107 for the same reasons why colon is unsupported.
4111 .It Ic alternates , unalternates
4112 \*(NQ (alt) Manage a list of alternate addresses or names of the active
4113 user, members of which will be removed from recipient lists (except one).
4114 There is a set of implicit alternates which is formed of the values of
4115 .Ev LOGNAME ,
4116 .Va from ,
4117 .Va sender
4119 .Va reply-to .
4120 .Va from
4121 will not be used if
4122 .Va sender
4123 is set.
4124 The latter command removes the given list of alternates, the special name
4125 .Ql *
4126 will discard all existing alternate names.
4128 The former command manages the error number
4129 .Va \&! .
4130 It shows the current set of alternates when used without arguments; in
4131 this mode only it also supports
4132 .Cm vput
4133 (see
4134 .Sx "Command modifiers" ) .
4135 Otherwise the given arguments (after being checked for validity) are
4136 appended to the list of alternate names; in
4137 .Va posix
4138 mode they replace that list instead.
4142 .It Ic answered , unanswered
4143 Take a message lists and mark each message as (not) having been answered.
4144 Messages will be marked answered when being
4145 .Ic reply Ns d
4146 to automatically if the
4147 .Va markanswered
4148 variable is set.
4149 See the section
4150 .Sx "Message states" .
4155 .It Ic bind , unbind
4156 \*(OP\*(NQ The bind command extends the MLE (see
4157 .Sx "On terminal control and line editor" )
4158 with freely configurable key bindings.
4159 The latter command removes from the given context the given key binding,
4160 both of which may be specified as a wildcard
4161 .Ql * ,
4162 so that, e.g.,
4163 .Ql unbind * *
4164 will remove all bindings of all contexts.
4165 Due to initialization order unbinding will not work for built-in key
4166 bindings upon program startup, however: please use
4167 .Va line-editor-no-defaults
4168 for this purpose instead.
4171 With one argument the former command shows all key bindings for the
4172 given context, specifying an asterisk
4173 .Ql *
4174 will show the bindings of all contexts; a more verbose listing will be
4175 produced if either of
4176 .Va debug
4178 .Va verbose
4179 are set.
4180 With two or more arguments a binding is (re)established:
4181 the first argument is the context to which the binding shall apply,
4182 the second argument is a comma-separated list of the
4183 .Dq keys
4184 which form the binding, and any remaining arguments form the expansion.
4185 To indicate that a binding shall not be auto-committed, but that the
4186 expansion shall instead be furtherly editable by the user, a commercial at
4187 .Ql @
4188 (that will be removed) can be placed last in the expansion, from which
4189 leading and trailing whitespace will finally be removed.
4190 Reverse solidus cannot be used as the last character of expansion.
4193 Contexts define when a binding applies, i.e., a binding will not be seen
4194 unless the context for which it is defined for is currently active.
4195 This is not true for the shared binding
4196 .Ql base ,
4197 which is the foundation for all other bindings and as such always
4198 applies, its bindings, however, only apply secondarily.
4199 The available contexts are the shared
4200 .Ql base ,
4202 .Ql default
4203 context which is used in all not otherwise documented situations, and
4204 .Ql compose ,
4205 which applies to compose mode only.
4208 .Dq Keys
4209 which form the binding are specified as a comma-separated list of
4210 byte-sequences, where each list entry corresponds to one key(press).
4211 A list entry may, indicated by a leading colon character
4212 .Ql \&: ,
4213 also refer to the name of a terminal capability; several dozen names
4214 will be compiled in and may be specified either by their
4215 .Xr terminfo 5 ,
4216 or, if existing, by their
4217 .Xr termcap 5
4218 name, regardless of the actually used \*(OPal terminal control library.
4219 It is possible to use any capability, as long as the name is resolvable
4220 by the \*(OPal control library or was defined via the internal variable
4221 .Va termcap .
4222 Input sequences are not case-normalized, so that an exact match is
4223 required to update or remove a binding.
4224 Examples:
4226 .Bd -literal -offset indent
4227 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4228 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc,Delete
4229 ? bind default $'\ecA',:khome,w 'echo Editable binding@'
4230 ? bind default a,b,c rm -irf / @  # Also editable
4231 ? bind default :kf1 File %
4232 ? bind compose :kf1 ~v
4236 Note that the entire comma-separated list is first parsed (over) as a
4237 shell-token with whitespace as the field separator, before being parsed
4238 and expanded for real with comma as the field separator, therefore
4239 whitespace needs to be properly quoted, see
4240 .Sx "Shell-style argument quoting" .
4241 Using Unicode reverse solidus escape sequences renders a binding
4242 defunctional if the locale does not support Unicode (see
4243 .Sx "Character sets" ) ,
4244 and using terminal capabilities does so if no (corresponding) terminal
4245 control support is (currently) available.
4248 The following terminal capability names are built-in and can be used in
4249 .Xr terminfo 5
4250 or (if available) the two-letter
4251 .Xr termcap 5
4252 notation.
4253 See the respective manual for a list of capabilities.
4254 The program
4255 .Xr infocmp 1
4256 can be used to show all the capabilities of
4257 .Ev TERM
4258 or the given terminal type;
4259 using the
4260 .Fl \&\&x
4261 flag will also show supported (non-standard) extensions.
4264 .Bl -tag -compact -width kcuuf_or_kcuuf
4265 .It Cd kbs Ns \0or Cd kb
4266 Backspace.
4267 .It Cd kdch1 Ns \0or Cd kD
4268 Delete character.
4269 .It Cd kDC Ns \0or Cd *4
4270 \(em shifted variant.
4271 .It Cd kel Ns \0or Cd kE
4272 Clear to end of line.
4273 .It Cd kext Ns \0or Cd @9
4274 Exit.
4275 .It Cd kich1 Ns \0or Cd kI
4276 Insert character.
4277 .It Cd kIC Ns \0or Cd #3
4278 \(em shifted variant.
4279 .It Cd khome Ns \0or Cd kh
4280 Home.
4281 .It Cd kHOM Ns \0or Cd #2
4282 \(em shifted variant.
4283 .It Cd kend Ns \0or Cd @7
4284 End.
4285 .It Cd knp Ns \0or Cd kN
4286 Next page.
4287 .It Cd kpp Ns \0or Cd kP
4288 Previous page.
4289 .It Cd kcub1 Ns \0or Cd kl
4290 Left cursor (with more modifiers: see below).
4291 .It Cd kLFT Ns \0or Cd #4
4292 \(em shifted variant.
4293 .It Cd kcuf1 Ns \0or Cd kr
4294 Right cursor (ditto).
4295 .It Cd kRIT Ns \0or Cd %i
4296 \(em shifted variant.
4297 .It Cd kcud1 Ns \0or Cd kd
4298 Down cursor (ditto).
4299 .It Cd kDN
4300 \(em shifted variant (only terminfo).
4301 .It Cd kcuu1 Ns \0or Cd ku
4302 Up cursor (ditto).
4303 .It Cd kUP
4304 \(em shifted variant (only terminfo).
4305 .It Cd kf0 Ns \0or Cd k0
4306 Function key 0.
4307 Add one for each function key up to
4308 .Cd kf9
4310 .Cd k9 ,
4311 respectively.
4312 .It Cd kf10 Ns \0or Cd k;
4313 Function key 10.
4314 .It Cd kf11 Ns \0or Cd F1
4315 Function key 11.
4316 Add one for each function key up to
4317 .Cd kf19
4319 .Cd F9 ,
4320 respectively.
4324 Some terminals support key-modifier combination extensions, e.g.,
4325 .Ql Alt+Shift+xy .
4326 For example, the delete key,
4327 .Cd kdch1 :
4328 in its shifted variant, the name is mutated to
4329 .Cd  kDC ,
4330 then a number is appended for the states
4331 .Ql Alt
4332 .Pf ( Cd kDC3 ) ,
4333 .Ql Shift+Alt
4334 .Pf ( Cd kDC4 ) ,
4335 .Ql Control
4336 .Pf ( Cd kDC5 ) ,
4337 .Ql Shift+Control
4338 .Pf ( Cd kDC6 ) ,
4339 .Ql Alt+Control
4340 .Pf ( Cd kDC7 ) ,
4341 finally
4342 .Ql Shift+Alt+Control
4343 .Pf ( Cd kDC8 ) .
4344 The same for the left cursor key,
4345 .Cd kcub1 :
4346 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4349 It is advisable to use an initial escape or other control character (e.g.,
4350 .Ql \ecA )
4351 for bindings which describe user key combinations (as opposed to purely
4352 terminal capability based ones), in order to avoid ambiguities whether
4353 input belongs to key sequences or not; it also reduces search time.
4354 Adjusting
4355 .Va bind-timeout
4356 may help shall keys and sequences be falsely recognized.
4360 .It Ic call
4361 \*(NQ Calls the given macro, which must have been created via
4362 .Ic define ,
4363 otherwise an
4364 .Va ^ERR Ns -NOENT
4365 error occurs.
4366 Calling macros recursively will at some time excess the stack size
4367 limit, causing a hard program abortion; if recursively calling a macro
4368 is the last command of the current macro, consider to use the command
4369 .Ic xcall ,
4370 which will first release all resources of the current macro before
4371 replacing the current macro with the called one.
4372 Numeric and string operations can be performed via
4373 .Ic vexpr ,
4375 .Ic eval
4376 may be helpful to recreate argument lists.
4380 .It Ic call_if
4381 Identical to
4382 .Ic call
4383 if the given macro has been created via
4384 .Ic define ,
4385 but does not fail nor warn if the macro does not exist.
4388 .It Ic cd
4389 (ch) Change the working directory to
4390 .Ev HOME
4391 or the given argument.
4392 Synonym for
4393 .Ic chdir .
4396 .It Ic certsave
4397 \*(OP Only applicable to S/MIME signed messages.
4398 Takes a message list and a filename and saves the certificates
4399 contained within the message signatures to the named file in both
4400 human-readable and PEM format.
4401 The certificates can later be used to send encrypted messages to the
4402 respective message senders by setting
4403 .Va smime-encrypt-USER@HOST
4404 variables.
4408 .It Ic charsetalias , uncharsetalias
4409 \*(NQ Manage alias mappings for (conversion of)
4410 .Sx "Character sets" .
4411 Mappings are ineffective if character set conversion is not available
4412 .Pf ( Va features
4413 does not announce
4414 .Ql +iconv ) .
4415 Expansion happens recursively, but expansion is not performed for
4416 .Sx "INTERNAL VARIABLES" ,
4417 e.g.,
4418 .Va charset-8bit .
4420 The latter command deletes all aliases given as arguments,
4421 all aliases can be deleted at once with the special argument
4422 .Ql * .
4423 The former shows the list of all currently defined aliases if used
4424 without arguments, the expansion of the given alias with one argument.
4425 Otherwise all given arguments are treated as pairs of character sets and
4426 their desired target alias name, creating new or changing already
4427 existing aliases, as necessary.
4430 .It Ic chdir
4431 (ch) Change the working directory to
4432 .Ev HOME
4433 or the given argument.
4434 Synonym for
4435 .Ic cd .
4439 .It Ic collapse , uncollapse
4440 Only applicable to
4441 .Ql thread Ns
4443 .Ic sort
4444 mode.
4445 Takes a message list and makes all replies to these messages invisible
4446 in header summaries, except for
4447 .Ql new
4448 messages and the
4449 .Dq dot .
4450 Also when a message with collapsed replies is displayed,
4451 all of these are automatically uncollapsed.
4452 The latter command undoes collapsing.
4455 .\" FIXME review until this point
4458 .It Ic colour , uncolour
4459 \*(OP\*(NQ Manage colour mappings of and for a
4460 .Sx "Coloured display" .
4461 The type of colour is given as the (case-insensitive) first argument,
4462 which must be one of
4463 .Ql 256
4464 for 256-colour terminals,
4465 .Ql 8 ,
4466 .Ql ansi
4468 .Ql iso
4469 for the standard 8-colour ANSI / ISO 6429 colour palette and
4470 .Ql 1
4472 .Ql mono
4473 for monochrome terminals.
4474 Monochrome terminals cannot deal with colours, but only (some) font
4475 attributes.
4478 Without further arguments the list of all currently defined mappings
4479 for the given colour type is shown (as a special case giving
4480 .Ql all
4482 .Ql *
4483 will show the mappings of all types).
4484 Otherwise the second argument defines the mappable slot, and the third
4485 argument a (comma-separated list of) colour and font attribute
4486 specification(s), and the optional fourth argument can be used to
4487 specify a precondition: if conditioned mappings exist they are tested in
4488 (creation) order unless a (case-insensitive) match has been found, and
4489 the default mapping (if any has been established) will only be chosen as
4490 a last resort.
4491 The types of precondition available depend on the mappable slot (see
4492 .Sx "Coloured display"
4493 for some examples), the following of which exist:
4496 Mappings prefixed with
4497 .Ql mle-
4498 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4499 .Sx "On terminal control and line editor" )
4500 and do not support preconditions.
4502 .Bl -tag -compact -width view-partinfo
4503 .It Ar mle-position
4504 This mapping is used for the position indicator that is visible when
4505 a line cannot be fully displayed on the screen.
4506 .It Ar mle-prompt
4507 Used for the
4508 .Va prompt .
4512 Mappings prefixed with
4513 .Ql sum-
4514 are used in header summaries, and they all understand the preconditions
4515 .Ql dot
4516 (the current message) and
4517 .Ql older
4518 for elder messages (only honoured in conjunction with
4519 .Va datefield-markout-older ) .
4521 .Bl -tag -compact -width view-partinfo
4522 .It Ar sum-dotmark
4523 This mapping is used for the
4524 .Dq dotmark
4525 that can be created with the
4526 .Ql %>
4528 .Ql %<
4529 formats of the variable
4530 .Va headline .
4531 .It Ar sum-header
4532 For the complete header summary line except the
4533 .Dq dotmark
4534 and the thread structure.
4535 .It Ar sum-thread
4536 For the thread structure which can be created with the
4537 .Ql %i
4538 format of the variable
4539 .Va headline .
4543 Mappings prefixed with
4544 .Ql view-
4545 are used when displaying messages.
4547 .Bl -tag -compact -width view-partinfo
4548 .It Ar view-from_
4549 This mapping is used for so-called
4550 .Ql From_
4551 lines, which are MBOX file format specific header lines.
4552 .It Ar view-header
4553 For header lines.
4554 A comma-separated list of headers to which the mapping applies may be
4555 given as a precondition; if the \*(OPal regular expression support is
4556 available then if any of the
4557 .Dq magical
4558 (extended) regular expression characters is seen the precondition will
4559 be evaluated as (an extended) one.
4560 .It Ar view-msginfo
4561 For the introductional message info line.
4562 .It Ar view-partinfo
4563 For MIME part info lines.
4567 The following (case-insensitive) colour definitions and font attributes
4568 are understood, multiple of which can be specified in a comma-separated
4569 list:
4571 .Bl -tag -width ft=
4572 .It Ar ft=
4573 a font attribute:
4574 .Ql bold ,
4575 .Ql reverse
4577 .Ql underline .
4578 It is possible (and often applicable) to specify multiple font
4579 attributes for a single mapping.
4581 .It Ar fg=
4582 foreground colour attribute:
4583 .Ql black ,
4584 .Ql blue ,
4585 .Ql green ,
4586 .Ql red ,
4587 .Ql brown ,
4588 .Ql magenta ,
4589 .Ql cyan
4591 .Ql white .
4592 To specify a 256-colour mode a decimal number colour specification in
4593 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4595 .Bl -tag -compact -width "999 - 999"
4596 .It 0 - 7
4597 the standard ISO 6429 colours, as above.
4598 .It 8 - 15
4599 high intensity variants of the standard colours.
4600 .It 16 - 231
4601 216 colours in tuples of 6.
4602 .It 232 - 255
4603 grayscale from black to white in 24 steps.
4605 .Bd -literal -offset indent
4606 #!/bin/sh -
4607 fg() { printf "\e033[38;5;${1}m($1)"; }
4608 bg() { printf "\e033[48;5;${1}m($1)"; }
4610 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4611 printf "\e033[0m\en"
4613 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4614 printf "\e033[0m\en"
4617 .It Ar bg=
4618 background colour attribute (see
4619 .Cd fg=
4620 for possible values).
4624 The command
4625 .Ic \&uncolour
4626 will remove for the given colour type (the special type
4627 .Ql *
4628 selects all) the given mapping; if the optional precondition argument is
4629 given only the exact tuple of mapping and precondition is removed.
4630 The special name
4631 .Ql *
4632 will remove all mappings (no precondition allowed), thus
4633 .Ql uncolour * *
4634 will remove all established mappings.
4639 .It Ic commandalias , uncommandalias
4640 \*(NQ Define or list, and remove, respectively, command aliases.
4641 An (command)alias can be used everywhere a normal command can be used,
4642 but always takes precedence: any arguments that are given to the command
4643 alias are joined onto the alias expansion, and the resulting string
4644 forms the command line that is, in effect, executed.
4645 The latter command removes all given aliases, the special name
4646 .Ql *
4647 will remove all existing aliases.
4648 When used without arguments the former shows a list of all currently
4649 known aliases, with one argument only the expansion of the given one.
4651 With two or more arguments a command alias is defined or updated: the
4652 first argument is the name under which the remaining command line should
4653 be accessible, the content of which can be just about anything.
4654 An alias may itself expand to another alias, but to avoid expansion loops
4655 further expansion will be prevented if an alias refers to itself or if
4656 an expansion depth limit is reached.
4657 Explicit expansion prevention is available via reverse solidus
4658 .Cm \e ,
4659 one of the
4660 .Sx "Command modifiers" .
4661 .Bd -literal -offset indent
4662 ? commandalias xx
4663 \*(uA: `commandalias': no such alias: xx
4664 ? commandalias xx echo hello,
4665 ? commandalias xx
4666 commandalias xx 'echo hello,'
4667 ? xx
4668 hello,
4669 ? xx world
4670 hello, world
4674 .It Ic Copy
4675 (C) Copy messages to files whose names are derived from the author of
4676 the respective message and do not mark them as being saved;
4677 otherwise identical to
4678 .Ic Save .
4681 .It Ic copy
4682 (c) Copy messages to the named file and do not mark them as being saved;
4683 otherwise identical to
4684 .Ic save .
4687 .It Ic cwd
4688 Show the name of the current working directory, as reported by
4689 .Xr getcwd 3 .
4690 Supports
4691 .Cm vput
4692 (see
4693 .Sx "Command modifiers" ) .
4694 The return status is tracked via
4695 .Va \&? .
4698 .It Ic Decrypt
4699 \*(OP For unencrypted messages this command is identical to
4700 .Ic Copy ;
4701 Encrypted messages are first decrypted, if possible, and then copied.
4704 .It Ic decrypt
4705 \*(OP For unencrypted messages this command is identical to
4706 .Ic copy ;
4707 Encrypted messages are first decrypted, if possible, and then copied.
4712 .It Ic define , undefine
4713 The latter command deletes the given macro, the special name
4714 .Ql *
4715 will discard all existing macros.
4716 Deletion of (a) macro(s) can be performed from within running (a)
4717 macro(s), including self-deletion.
4718 Without arguments the former command prints the current list of macros,
4719 including their content, otherwise it it defines a macro, replacing an
4720 existing one of the same name as applicable.
4723 A defined macro can be invoked explicitly by using the
4724 .Ic call ,
4725 .Ic call_if
4727 .Ic xcall
4728 commands, or implicitly if a macro hook is triggered, e.g., a
4729 .Va folder-hook .
4730 Execution of a macro body can be stopped from within by calling
4731 .Ic return .
4734 Temporary macro block-scope variables can be created or deleted with the
4735 .Cm local
4736 command modifier in conjunction with the commands
4737 .Ic set
4739 .Ic unset ,
4740 respectively.
4741 To enforce unrolling of changes made to (global)
4742 .Sx "INTERNAL VARIABLES"
4743 the command
4744 .Ic localopts
4745 can be used instead; its covered scope depends on how (i.e.,
4746 .Dq as what :
4747 normal macro, folder hook, hook,
4748 .Ic account
4749 switch) the macro is invoked.
4752 Inside a
4753 .Ic call Ns
4754 ed macro, the given positional parameters are implicitly local
4755 to the macro's scope, and may be accessed via the variables
4756 .Va * ,
4757 .Va @ ,
4758 .Va #
4760 .Va 1
4761 and any other positive unsigned decimal number less than or equal to
4762 .Va # .
4763 Positional parameters can be
4764 .Ic shift Ns
4765 ed, or become completely replaced, removed etc. via
4766 .Ic vpospar .
4768 .Bd -literal -offset indent
4769 define name {
4770   command1
4771   command2
4772   ...
4773   commandN
4776 # E.g.
4777 define exmac {
4778   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4779   return 1000 0
4781 call exmac Hello macro exmac!
4782 echo ${?}/${!}/${^ERRNAME}
4788 .It Ic delete , undelete
4789 (d, u) Marks the given message list as being or not being
4790 .Ql deleted ,
4791 respectively; if no argument has been specified then the usual search
4792 for a visible message is performed, as documented for
4793 .Sx "Message list arguments" ,
4794 showing only the next input prompt if the search fails.
4795 Deleted messages will neither be saved in the
4796 .Mx -sx
4797 .Sx "secondary mailbox"
4798 .Ev MBOX
4799 nor will they be available for most other commands.
4800 If the
4801 .Va autoprint
4802 variable is set, the new
4803 .Dq dot
4804 or the last message restored, respectively, is automatically
4805 .Ic type Ns
4806 d; also see
4807 .Ic dp ,
4808 .Ic dt .
4811 .It Ic discard
4812 (di) Identical to
4813 .Ic ignore .
4814 Superseded by the multiplexer
4815 .Ic headerpick .
4819 .It Ic dp , dt
4820 Delete the given messages and automatically
4821 .Ic type
4822 the new
4823 .Dq dot
4824 if one exists, regardless of the setting of
4825 .Va autoprint .
4828 .It Ic dotmove
4829 Move the
4830 .Dq dot
4831 up or down by one message when given
4832 .Ql +
4834 .Ql -
4835 argument, respectively.
4839 .It Ic draft , undraft
4840 Take message lists and mark each given message as being draft, or not
4841 being draft, respectively, as documented in the section
4842 .Sx "Message states" .
4845 .It Ic echo
4846 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4847 newline, whereas the otherwise identical
4848 .Ic echon
4849 does not.
4850 .Sx "Shell-style argument quoting"
4851 is used,
4852 .Sx "Filename transformations"
4853 are applied to the expanded arguments.
4854 This command also supports
4855 .Cm vput
4856 as documented in
4857 .Sx "Command modifiers" ,
4858 and manages the error number
4859 .Va \&! :
4860 if data is stored in a variable then the return value reflects the
4861 length of the result string in case of success and is
4862 .Ql -1
4863 on error.
4866 .It Ic echoerr
4867 \*(NQ Identical to
4868 .Ic echo
4869 except that is echoes to standard error.
4870 Also see
4871 .Ic echoerrn .
4872 In interactive sessions the \*(OPal message ring queue for
4873 .Ic errors
4874 will be used instead, if available and
4875 .Cm vput
4876 was not used.
4879 .It Ic echon
4880 \*(NQ Identical to
4881 .Ic echo ,
4882 but does not write or store a trailing newline.
4885 .It Ic echoerrn
4886 \*(NQ Identical to
4887 .Ic echoerr ,
4888 but does not write or store a trailing newline.
4891 .It Ic edit
4892 (e) Point the text
4893 .Ev EDITOR
4894 at each message from the given list in turn.
4895 Modified contents are discarded unless the
4896 .Va writebackedited
4897 variable is set, and are not used unless the mailbox can be written to
4898 and the editor returns a successful exit status.
4899 .Ic visual
4900 can be used instead for a more display oriented editor.
4903 .It Ic elif
4904 Part of the
4905 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4906 conditional \(em if the condition of a preceding
4907 .Ic if
4908 was false, check the following condition and execute the following block
4909 if it evaluates true.
4912 .It Ic else
4913 (el) Part of the
4914 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4915 conditional \(em if none of the conditions of the preceding
4916 .Ic if
4918 .Ic elif
4919 commands was true, the
4920 .Ic else
4921 block is executed.
4924 .It Ic endif
4925 (en) Marks the end of an
4926 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4927 conditional execution block.
4931 .It Ic environ
4932 \*(NQ \*(UA has a strict notion about which variables are
4933 .Sx "INTERNAL VARIABLES"
4934 and which are managed in the program
4935 .Sx ENVIRONMENT .
4936 Since some of the latter are a vivid part of \*(UAs functioning,
4937 however, they are transparently integrated into the normal handling of
4938 internal variables via
4939 .Ic set
4941 .Ic unset .
4942 To integrate other environment variables of choice into this
4943 transparent handling, and also to export internal variables into the
4944 process environment where they normally are not, a
4945 .Ql link
4946 needs to become established with this command, as in, e.g.,
4949 .Dl environ link PERL5LIB TZ
4952 Afterwards changing such variables with
4953 .Ic set
4954 will cause automatic updates of the program environment, and therefore
4955 be inherited by newly created child processes.
4956 Sufficient system support provided (it was in BSD as early as 1987, and
4957 is standardized since Y2K) removing such variables with
4958 .Ic unset
4959 will remove them also from the program environment, but in any way
4960 the knowledge they ever have been
4961 .Ql link Ns
4962 ed will be lost.
4963 Note that this implies that
4964 .Ic localopts
4965 may cause loss of such links.
4968 The command
4969 .Ql unlink
4970 will remove an existing link, but leaves the variables as such intact.
4971 Additionally the subcommands
4972 .Ql set
4974 .Ql unset
4975 are provided, which work exactly the same as the documented commands
4976 .Ic set
4978 .Ic unset ,
4979 but (additionally un)link the variable(s) with the program environment
4980 and thus immediately export them to, or remove them from (if possible),
4981 respectively, the program environment.
4985 .It Ic errors
4986 \*(OP Since \*(UA uses the console as a user interface it can happen
4987 that messages scroll by too fast to become recognized.
4988 An error message ring queue is available which stores duplicates of any
4989 error message and notifies the user in interactive sessions whenever
4990 a new error has occurred.
4991 The queue is finite: if its maximum size is reached any new message
4992 replaces the eldest.
4993 The command
4994 .Ic errors
4995 can be used to manage this message queue: if given
4996 .Ar show
4997 or no argument the queue will be displayed and cleared,
4998 .Ar clear
4999 will only clear all messages from the queue.
5002 .It Ic eval
5003 \*(NQ Construct a command by concatenating the arguments, separated with
5004 a single space character, and then evaluate the result.
5005 This command passes through the exit status
5006 .Va \&?
5007 and error number
5008 .Va \&!
5009 of the evaluated command; also see
5010 .Ic call .
5011 .Bd -literal -offset indent
5012 define xxx {
5013   echo "xxx arg <$1>"
5014   shift
5015   if [ $# -gt 0 ]
5016     \excall xxx "$@"
5017   endif
5019 define yyy {
5020   eval "$@ ' ball"
5022 call yyy '\ecall xxx' "b\e$'\et'u ' "
5023 call xxx arg <b      u>
5024 call xxx arg <  >
5025 call xxx arg <ball>
5029 .It Ic exit
5030 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5031 any saving of messages in the
5032 .Mx -sx
5033 .Sx "secondary mailbox"
5034 .Ev MBOX ,
5035 as well as a possibly tracked line editor
5036 .Va history-file .
5037 The optional status number argument will be passed through to
5038 .Xr exit 3 .
5039 \*(ID For now it can happen that the given status will be overwritten,
5040 later this will only occur if a later error needs to be reported onto an
5041 otherwise success indicating status.
5044 .It Ic File
5045 (Fi) Like
5046 .Ic file ,
5047 but open the mailbox read-only.
5051 .It Ic file
5052 (fi) The file command switches to a new mailbox.
5053 Without arguments it shows status information of the current mailbox.
5054 If an argument is given, it will write out changes (such as deletions)
5055 the user has made, open a new mailbox, update the internal variables
5056 .Va mailbox-resolved
5058 .Va mailbox-display ,
5059 and optionally display a summary of
5060 .Ic headers
5061 if the variable
5062 .Va header
5063 is set.
5066 .Sx "Filename transformations"
5067 will be applied to the
5068 .Ar name
5069 argument, and
5070 .Ql protocol://
5071 prefixes are, i.e., URL syntax is understood, e.g.,
5072 .Ql mbox:///tmp/mdirbox :
5073 if a protocol prefix is used the mailbox type is fixated and neither
5074 the auto-detection (read on) nor the
5075 .Va newfolders
5076 mechanisms apply.
5077 \*(OPally URLs can also be used to access network resources, which may
5078 be accessed securely via
5079 .Sx "Encrypted network communication"
5080 if so supported, and it is possible to proxy all network traffic over
5081 a SOCKS5 server given via
5082 .Va socks-proxy .
5085 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5086 .Dl \*(OU protocol://[user@]host[:port][/path]
5089 \*(OPally supported network protocols are
5090 .Ar pop3
5091 (POP3) and
5092 .Ar pop3s
5093 (POP3 with SSL/TLS encrypted transport),
5094 .Ar imap
5096 .Ar imaps .
5098 .Ar [/path]
5099 part is valid only for IMAP; there it defaults to
5100 .Ar INBOX .
5101 Network URLs require a special encoding as documented in the section
5102 .Sx "On URL syntax and credential lookup" .
5105 If the resulting file protocol (MBOX database)
5106 .Ar name
5107 is located on a local filesystem then the list of all registered
5108 .Ic filetype Ns
5109 s is traversed in order to see whether a transparent intermediate
5110 conversion step is necessary to handle the given mailbox, in which case
5111 \*(UA will use the found hook to load and save data into and from
5112 a temporary file, respectively.
5113 Changing hooks will not affect already opened mailboxes.
5114 For example, the following creates hooks for the
5115 .Xr gzip 1
5116 compression tool and a combined compressed and encrypted format:
5118 .Bd -literal -offset indent
5119 ? filetype \e
5120     gzip 'gzip -dc' 'gzip -c' \e
5121     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5125 MBOX databases will always be protected via file-region locks
5126 .Pf ( Xr fcntl 2 )
5127 during file operations in order to avoid inconsistencies due to
5128 concurrent modifications.
5129 .Mx -ix "dotlock files"
5130 \*(OP In addition mailbox files treated as the system
5131 .Va inbox
5132 .Pf ( Ev MAIL ) ,
5133 as well as
5134 .Mx -sx
5135 .Sx "primary system mailbox" Ns
5136 es in general will also be protected by so-called dotlock files,
5137 the traditional way of mail spool file locking: for any file
5138 .Ql x
5139 a lock file
5140 .Ql x.lock
5141 will be created for the duration of the synchronization \(em
5142 as necessary an external privileged dotlock helper will be used
5143 to create the dotlock file in the same directory and with the same user
5144 and group identities as the file of interest.
5145 .Va dotlock-disable
5146 can be used to turn off additional dotlock files, shall the need arise.
5149 \*(UA by default uses tolerant POSIX rules when reading MBOX database
5150 files, but it will detect invalid message boundaries in this mode and
5151 complain (even more with
5152 .Va debug )
5153 if any is seen: in this case
5154 .Va mbox-rfc4155
5155 can be used to create a valid MBOX database from the invalid input.
5158 \*(OP If no protocol has been fixated, and
5159 .Ar name
5160 refers to a directory with the subdirectories
5161 .Ql tmp ,
5162 .Ql new
5164 .Ql cur ,
5165 then it is treated as a folder in
5166 .Dq Maildir
5167 format.
5168 The maildir format stores each message in its own file, and has been
5169 designed so that file locking is not necessary when reading or writing
5170 files.
5173 \*(ID If no protocol has been fixated and no existing file has
5174 been found, the variable
5175 .Va newfolders
5176 controls the format of mailboxes yet to be created.
5181 .It Ic filetype , unfiletype
5182 \*(NQ Define or list, and remove, respectively, file handler hooks,
5183 which provide (shell) commands that enable \*(UA to load and save MBOX
5184 files from and to files with the registered file extensions;
5185 it will use an intermediate temporary file to store the plain data.
5186 The latter command removes the hooks for all given extensions,
5187 .Ql *
5188 will remove all existing handlers.
5190 When used without arguments the former shows a list of all currently
5191 defined file hooks, with one argument the expansion of the given alias.
5192 Otherwise three arguments are expected, the first specifying the file
5193 extension for which the hook is meant, and the second and third defining
5194 the load- and save commands, respectively, to deal with the file type,
5195 both of which must read from standard input and write to standard
5196 output.
5197 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5198 \*(ID For now too much work is done, and files are oftened read in twice
5199 where once would be sufficient: this can cause problems if a filetype is
5200 changed while such a file is opened; this was already so with the
5201 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5202 \*(ID For now all handler strings are passed to the
5203 .Ev SHELL for evaluation purposes; in the future a
5204 .Ql \&!
5205 prefix to load and save commands may mean to bypass this shell instance:
5206 placing a leading space will avoid any possible misinterpretations.
5207 .Bd -literal -offset indent
5208 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5209     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
5210     zst 'zstd -dc' 'zstd -19 -zc' \e
5211     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5212 ? set record=+sent.zst.pgp
5217 .It Ic flag , unflag
5218 Take message lists and mark the messages as being flagged, or not being
5219 flagged, respectively, for urgent/special attention.
5220 See the section
5221 .Sx "Message states" .
5224 .It Ic folder
5225 (fold) The same as
5226 .Ic file .
5229 .It Ic folders
5230 With no arguments, list the names of the folders in the folder directory.
5231 With an existing folder as an argument,
5232 lists the names of folders below the named folder.
5235 .It Ic Followup
5236 (F) Similar to
5237 .Ic Respond ,
5238 but saves the message in a file named after the local part of the first
5239 recipient's address (instead of in
5240 .Va record Ns ).
5243 .It Ic followup
5244 (fo) Similar to
5245 .Ic respond ,
5246 but saves the message in a file named after the local part of the first
5247 recipient's address (instead of in
5248 .Va record Ns ).
5251 .It Ic followupall
5252 Similar to
5253 .Ic followup ,
5254 but responds to all recipients regardless of the
5255 .Va flipr
5256 variable.
5259 .It Ic followupsender
5260 Similar to
5261 .Ic Followup ,
5262 but responds to the sender only regardless of the
5263 .Va flipr
5264 variable.
5267 .It Ic Forward
5268 Similar to
5269 .Ic forward ,
5270 but saves the message in a file named after the local part of the
5271 recipient's address (instead of in
5272 .Va record Ns ).
5275 .It Ic forward
5276 Takes a message and the address of a recipient
5277 and forwards the message to him.
5278 The text of the original message is included in the new one,
5279 with the value of the
5280 .Va forward-inject-head
5281 variable preceding, and the value of
5282 .Va forward-inject-tail
5283 succeeding it.
5284 To filter the included header fields to the desired subset use the
5285 .Ql forward
5286 slot of the white- and blacklisting command
5287 .Ic headerpick .
5288 Only the first part of a multipart message is included unless
5289 .Va forward-as-attachment ,
5290 and recipient addresses will be stripped from comments, names
5291 etc. unless the internal variable
5292 .Va fullnames
5293 is set.
5295 This may generate the errors
5296 .Va ^ERR Ns -DESTADDRREQ
5297 if no receiver has been specified,
5298 .Va ^ERR Ns -PERM
5299 if some addressees where rejected by
5300 .Va expandaddr ,
5301 .Va ^ERR Ns -NODATA
5302 if no applicable messages have been given,
5303 .Va ^ERR Ns -NOTSUP
5304 if multiple messages have been specified,
5305 .Va ^ERR Ns -IO
5306 if an I/O error occurs,
5307 .Va ^ERR Ns -NOTSUP
5308 if a necessary character set conversion fails, and
5309 .Va ^ERR Ns -INVAL
5310 for other errors.
5313 .It Ic from
5314 (f) Takes a list of message specifications and displays a summary of
5315 their message headers, exactly as via
5316 .Ic headers ,
5317 making the first message of the result the new
5318 .Dq dot
5319 (the last message if
5320 .Va showlast
5321 is set).
5322 An alias of this command is
5323 .Ic search .
5324 Also see
5325 .Sx "Specifying messages" .
5327 .It Ic Fwd
5328 \*(OB Alias for
5329 .Ic Forward .
5331 .It Ic fwd
5332 \*(OB Alias for
5333 .Ic forward .
5335 .It Ic fwdignore
5336 \*(OB Superseded by the multiplexer
5337 .Ic headerpick .
5339 .It Ic fwdretain
5340 \*(OB Superseded by the multiplexer
5341 .Ic headerpick .
5343 .It Ic ghost , unghost
5344 \*(OB Replaced by
5345 .Ic commandalias ,
5346 .Ic uncommandalias .
5350 .It Ic headerpick , unheaderpick
5351 \*(NQ Multiplexer command to manage white- and blacklisting
5352 selections of header fields for a variety of applications.
5353 Without arguments the set of contexts that have settings is displayed.
5354 When given arguments, the first argument is the context to which the
5355 command applies, one of (case-insensitive)
5356 .Ql type
5357 for display purposes (via, e.g.,
5358 .Ic type ) ,
5359 .Ql save
5360 for selecting which headers shall be stored persistently when
5361 .Ic save ,
5362 .Ic copy ,
5363 .Ic move
5364 or even
5365 .Ic decrypt Ns
5366 ing messages (note that MIME related etc. header fields should not be
5367 ignored in order to not destroy usability of the message in this case),
5368 .Ql forward
5369 for stripping down messages when
5370 .Ic forward Ns
5371 ing message (has no effect if
5372 .Va forward-as-attachment
5373 is set), and
5374 .Ql top
5375 for defining user-defined set of fields for the command
5376 .Ic top .
5378 The current settings of the given context are displayed if it is the
5379 only argument.
5380 A second argument denotes the type of restriction that is to be chosen,
5381 it may be (a case-insensitive prefix of)
5382 .Ql retain
5384 .Ql ignore
5385 for white- and blacklisting purposes, respectively.
5386 Establishing a whitelist suppresses inspection of the corresponding
5387 blacklist.
5389 If no further argument is given the current settings of the given type
5390 will be displayed, otherwise the remaining arguments specify header
5391 fields, which \*(OPally may be given as regular expressions, to be added
5392 to the given type.
5393 The special wildcard field (asterisk,
5394 .Ql * )
5395 will establish a (fast) shorthand setting which covers all fields.
5397 The latter command always takes three or more arguments and can be used
5398 to remove selections, i.e., from the given context, the given type of
5399 list, all the given headers will be removed, the special argument
5400 .Ql *
5401 will remove all headers.
5404 .It Ic headers
5405 (h) Show the current group of headers, the size of which depends on
5406 the variable
5407 .Va screen ,
5408 and the style of which can be adjusted with the variable
5409 .Va headline .
5410 If a message-specification is given the group of headers containing the
5411 first message therein is shown and the message at the top of the screen
5412 becomes the new
5413 .Dq dot ;
5414 the last message is targeted if
5415 .Va showlast
5416 is set.
5419 .It Ic help
5420 (hel) A synonym for
5421 .Ic \&? .
5424 .It Ic history
5425 \*(OP Without arguments or when given
5426 .Cm show
5427 all history entries are shown (this mode also supports a more
5428 .Va verbose
5429 output).
5430 .Cm load
5431 will replace the list of entries with the content of
5432 .Va history-file ,
5434 .Cm save
5435 will dump the current list to said file, replacing former content.
5436 .Cm clear
5437 will delete all history entries.
5438 The argument can also be a signed decimal
5439 .Ar NUMBER ,
5440 which will select and evaluate the respective history entry, and move it
5441 to the top of the history; a negative number is used as an offset to the
5442 current command, e.g.,
5443 .Ql -1
5444 will select the last command, the history top.
5445 Please see
5446 .Sx "On terminal control and line editor"
5447 for more on this topic.
5450 .It Ic hold
5451 (ho, also
5452 .Ic preserve )
5453 Takes a message list and marks each message therein to be saved in the
5454 user's system
5455 .Va inbox
5456 instead of in the
5457 .Mx -sx
5458 .Sx "secondary mailbox"
5459 .Ev MBOX .
5460 Does not override the
5461 .Ic delete
5462 command.
5463 \*(UA deviates from the POSIX standard with this command, because a
5464 .Ic next
5465 command issued after
5466 .Ic hold
5467 will display the following message, not the current one.
5471 .It Ic if
5472 (i) Part of the nestable
5473 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5474 conditional execution construct \(em if the given condition is true then
5475 the encapsulated block is executed.
5476 The POSIX standards supports the (case-insensitive) conditions
5477 .Ql r Ns
5478 eceive
5480 .Ql s Ns
5481 end, all remaining conditions are non-portable extensions.
5482 \*(ID These commands do not yet use
5483 .Sx "Shell-style argument quoting"
5484 and therefore do not know about input tokens, so that syntax
5485 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5486 all conditions bracket group wise and consider the tokens, representing
5487 values and operators, therein, which also means that variables will
5488 already have been expanded at that time (just like in the shell).
5490 .Bd -literal -offset indent
5491 if receive
5492   commands ...
5493 else
5494   commands ...
5495 endif
5499 The (case-insensitive) condition
5500 .Ql t Ns
5501 erminal will evaluate to true if the standard input is a terminal, i.e.,
5502 in interactive sessions.
5503 Another condition can be any boolean value (see the section
5504 .Sx "INTERNAL VARIABLES"
5505 for textual boolean representations) to mark an enwrapped block as
5506 .Dq never execute
5508 .Dq always execute .
5509 (It shall be remarked that a faulty condition skips all branches until
5510 .Ic endif . )
5513 (\*(ID In v15
5514 .Sx "Shell-style argument quoting"
5515 will be used, and this command will simply interpret expanded tokens.)
5516 It is possible to check
5517 .Sx "INTERNAL VARIABLES"
5518 as well as
5519 .Sx ENVIRONMENT
5520 variables for existence or compare their expansion against a user given
5521 value or another variable by using the
5522 .Ql $
5523 .Pf ( Dq variable next )
5524 conditional trigger character;
5525 a variable on the right hand side may be signalled using the same
5526 mechanism.
5527 Variable names may be enclosed in a pair of matching braces.
5528 When this mode has been triggered, several operators are available:
5531 Integer operators treat the arguments on the left and right hand side of
5532 the operator as integral numbers and compare them arithmetically.
5533 It is an error if any of the operands is not a valid integer, an empty
5534 argument (which implies it had been quoted) is treated as if it were 0.
5535 Available operators are
5536 .Ql -lt
5537 (less than),
5538 .Ql -le
5539 (less than or equal to),
5540 .Ql -eq
5541 (equal),
5542 .Ql -ne
5543 (not equal),
5544 .Ql -ge
5545 (greater than or equal to), and
5546 .Ql -gt
5547 (greater than).
5550 String data operators compare the left and right hand side according to
5551 their textual content.
5552 Unset variables are treated as the empty string.
5553 The behaviour of string operators can be adjusted by prefixing the
5554 operator with the modifier trigger commercial at
5555 .Ql @ ,
5556 followed by none to multiple modifiers: for now supported is
5557 .Ql i ,
5558 which turns the comparison into a case-insensitive one: this is
5559 implied if no modifier follows the trigger.
5562 Available string operators are
5563 .Ql <
5564 (less than),
5565 .Ql <=
5566 (less than or equal to),
5567 .Ql ==
5568 (equal),
5569 .Ql !=
5570 (not equal),
5571 .Ql >=
5572 (greater than or equal to),
5573 .Ql >
5574 (greater than),
5575 .Ql =%
5576 (is substring of) and
5577 .Ql !%
5578 (is not substring of).
5579 By default these operators work on bytes and (therefore) do not take
5580 into account character set specifics.
5581 If the case-insensitivity modifier has been used, case is ignored
5582 according to the rules of the US-ASCII encoding, i.e., bytes are
5583 still compared.
5586 When the \*(OPal regular expression support is available, the additional
5587 string operators
5588 .Ql =~
5590 .Ql !~
5591 can be used.
5592 They treat the right hand side as an extended regular expression that is
5593 matched according to the active locale (see
5594 .Sx "Character sets" ) ,
5595 i.e., character sets should be honoured correctly.
5598 Conditions can be joined via AND-OR lists (where the AND operator is
5599 .Ql &&
5600 and the OR operator is
5601 .Ql || ) ,
5602 which have equal precedence and will be evaluated with left
5603 associativity, thus using the same syntax that is known for the
5604 .Xr sh 1 .
5605 It is also possible to form groups of conditions and lists by enclosing
5606 them in pairs of brackets
5607 .Ql [\ \&.\&.\&.\ ] ,
5608 which may be interlocked within each other, and also be joined via
5609 AND-OR lists.
5612 The results of individual conditions and entire groups may be modified
5613 via unary operators: the unary operator
5614 .Ql \&!
5615 will reverse the result.
5617 .Bd -literal -offset indent
5618 # (This not in v15, there [ -n "$debug"]!)
5619 if $debug
5620   echo *debug* is set
5621 endif
5622 if [ "$ttycharset" == UTF-8 ] || \e
5623     [ "$ttycharset" @i== UTF8 ]
5624   echo *ttycharset* is UTF-8, the former case-sensitive!
5625 endif
5626 set t1=one t2=one
5627 if [ "${t1}" == "${t2}" ]
5628   echo These two variables are equal
5629 endif
5630 if [ "$features" =% +regex ] && \e
5631     [ "$TERM" @i=~ "^xterm\&.*" ]
5632   echo ..in an X terminal
5633 endif
5634 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5635     [ "$verbose" != '' ] ] ]
5636   echo Noisy, noisy
5637 endif
5638 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5639   echo Left associativity, as is known from the shell
5640 endif
5645 .It Ic ignore
5646 (ig) Identical to
5647 .Ic discard .
5648 Superseded by the multiplexer
5649 .Ic headerpick .
5652 .It Ic list
5653 Shows the names of all available commands, alphabetically sorted.
5654 If given any non-whitespace argument the list will be shown in the order
5655 in which command prefixes are searched.
5656 \*(OP In conjunction with a set variable
5657 .Va verbose
5658 additional information will be provided for each command: the argument
5659 type will be indicated, the documentation string will be shown,
5660 and the set of command flags will show up:
5662 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
5663 .It Ql "`local'"
5664 command supports the command modifier
5665 .Cm local .
5666 .It Ql "`vput'"
5667 command supports the command modifier
5668 .Cm vput .
5669 .It Ql "*!*"
5670 the error number is tracked in
5671 .Va \&! .
5672 .It Ql "needs box"
5673 commands needs an active mailbox, a
5674 .Ic file .
5675 .It Ql "ok: batch/interactive"
5676 command may only be used in interactive or
5677 .Fl #
5678 batch mode.
5679 .It Ql "ok: send mode"
5680 command can be used in send mode.
5681 .It Ql "not ok: compose mode"
5682 command is not available when in compose mode.
5683 .It Ql "not ok: startup"
5684 command cannot be used during program startup, e.g., while loading
5685 .Sx "Resource files" .
5686 .It Ql "ok: subprocess"
5687 command is allowed to be used when running in a subprocess instance,
5688 e.g., from within a macro that is called via
5689 .Va on-compose-splice .
5690 .It Ql "gabby"
5691 The command produces
5692 .Va history-gabby
5693 .Ic history
5694 entries.
5699 .It Ic localopts
5700 This command can be used to localize changes to (linked)
5701 .Sx ENVIRONMENT
5702 as well as (global)
5703 .Sx "INTERNAL VARIABLES" ,
5704 meaning that their state will be reverted to the former one once the
5705 .Dq covered scope
5706 is left.
5707 Just like the command modifier
5708 .Cm local ,
5709 which provides block-scope localization for some commands (instead),
5710 it can only be used inside of macro definition blocks introduced by
5711 .Ic account
5713 .Ic define .
5714 The covered scope of an
5715 .Ic account
5716 is left once a different account is activated, and some macros, notably
5717 .Va folder-hook Ns s ,
5718 use their own specific notion of covered scope, here it will be extended
5719 until the folder is left again.
5722 This setting stacks up: i.e., if
5723 .Ql macro1
5724 enables change localization and calls
5725 .Ql macro2 ,
5726 which explicitly resets localization, then any value changes within
5727 .Ql macro2
5728 will still be reverted when the scope of
5729 .Ql macro1
5730 is left.
5731 (Caveats: if in this example
5732 .Ql macro2
5733 changes to a different
5734 .Ic account
5735 which sets some variables that are already covered by localizations,
5736 their scope will be extended, and in fact leaving the
5737 .Ic account
5738 will (thus) restore settings in (likely) global scope which actually
5739 were defined in a local, macro private context!)
5742 This command takes one or two arguments, the optional first one
5743 specifies an attribute that may be one of
5744 .Cm \&\&scope ,
5745 which refers to the current scope and is thus the default,
5746 .Cm call ,
5747 which causes any macro that is being
5748 .Ic call Ns
5749 ed to be started with localization enabled by default, as well as
5750 .Cm call-fixate ,
5751 which (if enabled) disallows any called macro to turn off localization:
5752 like this it can be ensured that once the current scope regains control,
5753 any changes made in deeper levels have been reverted.
5754 The latter two are mutually exclusive, and neither affects
5755 .Ic xcall .
5756 The (second) argument is interpreted as a boolean (string, see
5757 .Sx "INTERNAL VARIABLES" )
5758 and states whether the given attribute shall be turned on or off.
5760 .Bd -literal -offset indent
5761 define temporary_settings {
5762   set possibly_global_option1
5763   localopts on
5764   set localized_option1
5765   set localized_option2
5766   localopts scope off
5767   set possibly_global_option2
5773 .It Ic Lreply
5774 Reply to messages that come in via known
5775 .Pf ( Ic mlist )
5776 or subscribed
5777 .Pf ( Ic mlsubscribe )
5778 mailing lists, or pretend to do so (see
5779 .Sx "Mailing lists" ) :
5780 on top of the usual
5781 .Ic reply
5782 functionality this will actively resort and even remove message
5783 recipients in order to generate a message that is supposed to be sent to
5784 a mailing list.
5785 For example it will also implicitly generate a
5786 .Ql Mail-Followup-To:
5787 header if that seems useful, regardless of the setting of the variable
5788 .Va followup-to .
5789 For more documentation please refer to
5790 .Sx "On sending mail, and non-interactive mode" .
5792 This may generate the errors
5793 .Va ^ERR Ns -DESTADDRREQ
5794 if no receiver has been specified,
5795 .Va ^ERR Ns -PERM
5796 if some addressees where rejected by
5797 .Va expandaddr ,
5798 .Va ^ERR Ns -NODATA
5799 if no applicable messages have been given,
5800 .Va ^ERR Ns -IO
5801 if an I/O error occurs,
5802 .Va ^ERR Ns -NOTSUP
5803 if a necessary character set conversion fails, and
5804 .Va ^ERR Ns -INVAL
5805 for other errors.
5806 Any error stops processing of further messages.
5809 .It Ic Mail
5810 Similar to
5811 .Ic mail ,
5812 but saves the message in a file named after the local part of the first
5813 recipient's address (instead of in
5814 .Va record Ns ).
5817 .It Ic mail
5818 (m) Takes a (list of) recipient address(es) as (an) argument(s),
5819 or asks on standard input if none were given;
5820 then collects the remaining mail content and sends it out.
5821 Unless the internal variable
5822 .Va fullnames
5823 is set recipient addresses will be stripped from comments, names etc.
5824 For more documentation please refer to
5825 .Sx "On sending mail, and non-interactive mode" .
5827 This may generate the errors
5828 .Va ^ERR Ns -DESTADDRREQ
5829 if no receiver has been specified,
5830 .Va ^ERR Ns -PERM
5831 if some addressees where rejected by
5832 .Va expandaddr ,
5833 .Va ^ERR Ns -NODATA
5834 if no applicable messages have been given,
5835 .Va ^ERR Ns -NOTSUP
5836 if multiple messages have been specified,
5837 .Va ^ERR Ns -IO
5838 if an I/O error occurs,
5839 .Va ^ERR Ns -NOTSUP
5840 if a necessary character set conversion fails, and
5841 .Va ^ERR Ns -INVAL
5842 for other errors.
5845 .It Ic mbox
5846 (mb) The given message list is to be sent to the
5847 .Mx -sx
5848 .Sx "secondary mailbox"
5849 .Ev MBOX
5850 when \*(UA is quit; this is the default action unless the variable
5851 .Va hold
5852 is set.
5853 \*(ID This command can only be used in a
5854 .Mx -sx
5855 .Sx "primary system mailbox" .
5859 .It Ic mimetype , unmimetype
5860 Without arguments the content of the MIME type cache will displayed;
5861 a more verbose listing will be produced if either of
5862 .Va debug
5864 .Va verbose
5865 are set.
5866 When given arguments they will be joined, interpreted as shown in
5867 .Sx "The mime.types files"
5868 (also see
5869 .Sx "HTML mail and MIME attachments" ) ,
5870 and the resulting entry will be added (prepended) to the cache.
5871 In any event MIME type sources are loaded first as necessary \(en
5872 .Va mimetypes-load-control
5873 can be used to fine-tune which sources are actually loaded.
5875 The latter command deletes all specifications of the given MIME type, thus
5876 .Ql ? unmimetype text/plain
5877 will remove all registered specifications for the MIME type
5878 .Ql text/plain .
5879 The special name
5880 .Ql *
5881 will discard all existing MIME types, just as will
5882 .Ql reset ,
5883 but which also reenables cache initialization via
5884 .Va mimetypes-load-control .
5888 .It Ic mlist , unmlist
5889 The latter command removes all given mailing lists, the special name
5890 .Ql *
5891 can be used to remove all registered lists.
5892 The former will list all currently defined mailing lists (and their
5893 attributes, if any) when used without arguments; a more verbose listing
5894 will be produced if either of
5895 .Va debug
5897 .Va verbose
5898 are set.
5899 Otherwise all given arguments will be added and henceforth be recognized
5900 as mailing lists.
5901 If the \*(OPal regular expression support is available then any argument
5902 which contains any of the
5903 .Dq magical
5904 regular expression characters
5905 .Ql ^[]*+?|$
5906 (see
5907 .Xr re_format 7 )
5908 will be interpreted as one, which allows matching of many addresses with
5909 a single expression.
5911 .Ic mlsubscribe
5912 pair of commands manages subscription attributes of mailing lists.
5915 .It Ic mimeview
5916 \*(ID Only available in interactive mode, this command allows one to
5917 display MIME parts which require external MIME handler programs to run
5918 which do not integrate in \*(UAs normal
5919 .Ic type
5920 output (see
5921 .Sx "HTML mail and MIME attachments" ) .
5922 (\*(ID No syntax to directly address parts, this restriction may vanish.)
5923 The user will be asked for each non-text part of the given message in
5924 turn whether the registered handler shall be used to display the part.
5928 .It Ic mlsubscribe , unmlsubscribe
5929 The latter command removes the subscription attribute from all given
5930 mailing lists, the special name
5931 .Ql *
5932 can be used to do so for any registered list.
5933 The former will list all currently defined mailing lists which have
5934 a subscription attribute when used without arguments; a more verbose
5935 listing will be produced if either of
5936 .Va debug
5938 .Va verbose
5939 are set.
5940 Otherwise this attribute will be set for all given mailing lists,
5941 newly creating them as necessary (as via
5942 .Ic mlist ) .
5943 Also see
5944 .Va followup-to .
5947 .It Ic Move
5948 Similar to
5949 .Ic move ,
5950 but moves the messages to a file named after the local part of the
5951 sender address of the first message (instead of in
5952 .Va record Ns ).
5955 .It Ic move
5956 Acts like
5957 .Ic copy
5958 but marks the messages for deletion if they were transferred
5959 successfully.
5962 .It Ic More
5963 Like
5964 .Ic more ,
5965 but also displays header fields which would not pass the
5966 .Ic headerpick
5967 selection, and all MIME parts.
5968 Identical to
5969 .Ic Page .
5972 .It Ic more
5973 Invokes the
5974 .Ev PAGER
5975 on the given messages, even in non-interactive mode and as long as the
5976 standard output is a terminal.
5977 Identical to
5978 .Ic page .
5981 .It Ic netrc
5982 \*(OP When used without arguments or if
5983 .Ar show
5984 has been given the content of the
5985 .Pa \*(VN
5986 cache is shown, loading it first as necessary.
5987 If the argument is
5988 .Ar load
5989 then the cache will only be initialized and
5990 .Ar clear
5991 will remove its contents.
5992 Note that \*(UA will try to load the file only once, use
5993 .Ql Ic \&\&netrc Ns \:\0\:clear
5994 to unlock further attempts.
5996 .Va netrc-lookup ,
5997 .Va netrc-pipe
5998 and the section
5999 .Sx "On URL syntax and credential lookup" ;
6000 the section
6001 .Sx "The .netrc file"
6002 documents the file format in detail.
6005 .It Ic newmail
6006 Checks for new mail in the current folder without committing any changes
6007 before.
6008 If new mail is present, a message is shown.
6009 If the
6010 .Va header
6011 variable is set,
6012 the headers of each new message are also shown.
6013 This command is not available for all mailbox types.
6016 .It Ic next
6017 (n) (like
6018 .Ql +
6020 .Dq ENTER )
6021 Goes to the next message in sequence and types it.
6022 With an argument list, types the next matching message.
6025 .It Ic New
6026 Same as
6027 .Ic Unread .
6030 .It Ic new
6031 Same as
6032 .Ic unread .
6035 .It Ic noop
6036 If the current folder is accessed via a network connection, a
6037 .Dq NOOP
6038 command is sent, otherwise no operation is performed.
6041 .It Ic Page
6042 Like
6043 .Ic page ,
6044 but also displays header fields which would not pass the
6045 .Ic headerpick
6046 selection, and all MIME parts.
6047 Identical to
6048 .Ic More .
6051 .It Ic page
6052 Invokes the
6053 .Ev PAGER
6054 on the given messages, even in non-interactive mode and as long as the
6055 standard output is a terminal.
6056 Identical to
6057 .Ic more .
6060 .It Ic Pipe
6061 Like
6062 .Ic pipe
6063 but also pipes header fields which would not pass the
6064 .Ic headerpick
6065 selection, and all parts of MIME
6066 .Ql multipart/alternative
6067 messages.
6070 .It Ic pipe
6071 (pi) Takes a message list and a shell command
6072 and pipes the messages through the command.
6073 Without an argument the current message is piped through the command
6074 given by the
6075 .Va cmd
6076 variable.
6077 If the
6078 .Va page
6079 variable is set,
6080 every message is followed by a formfeed character.
6083 .It Ic preserve
6084 (pre) A synonym for
6085 .Ic hold .
6088 .It Ic Print
6089 (P) Alias for
6090 .Ic Type .
6093 .It Ic print
6094 (p) Research
6096 equivalent of
6097 .Ic type .
6100 .It Ic quit
6101 (q) Terminates the session, saving all undeleted, unsaved messages in
6102 the current
6103 .Mx -sx
6104 .Sx "secondary mailbox"
6105 .Ev MBOX ,
6106 preserving all messages marked with
6107 .Ic hold
6109 .Ic preserve
6110 or never referenced in the system
6111 .Va inbox ,
6112 and removing all other messages from the
6113 .Mx -sx
6114 .Sx "primary system mailbox" .
6115 If new mail has arrived during the session,
6116 the message
6117 .Dq You have new mail
6118 will be shown.
6119 If given while editing a mailbox file with the command line option
6120 .Fl f ,
6121 then the edit file is rewritten.
6122 A return to the shell is effected,
6123 unless the rewrite of edit file fails,
6124 in which case the user can escape with the exit command.
6125 The optional status number argument will be passed through to
6126 .Xr exit 3 .
6127 \*(ID For now it can happen that the given status will be overwritten,
6128 later this will only occur if a later error needs to be reported onto an
6129 otherwise success indicating status.
6132 .It Ic read
6133 \*(NQ Read a line from standard input, or the channel set active via
6134 .Ic readctl ,
6135 and assign the data, which will be split as indicated by
6136 .Va ifs ,
6137 to the given variables.
6138 The variable names are checked by the same rules as documented for
6139 .Cm vput ,
6140 and the same error codes will be seen in
6141 .Va \&! ;
6142 the exit status
6143 .Va \&?
6144 indicates the number of bytes read, it will be
6145 .Ql -1
6146 with the error number
6147 .Va \&!
6148 set to
6149 .Va ^ERR Ns -BADF
6150 in case of I/O errors, or
6151 .Va ^ERR Ns -NONE
6152 upon End-Of-File.
6153 If there are more fields than variables, assigns successive fields to the
6154 last given variable.
6155 If there are less fields than variables, assigns the empty string to the
6156 remains.
6157 .Bd -literal -offset indent
6158 ? read a b c
6159    H  e  l  l  o
6160 ? echo "<$a> <$b> <$c>"
6161 <H> <e> <l  l  o>
6162 ? wysh set ifs=:; read a b c;unset ifs
6163 hey2.0,:"'you    ",:world!:mars.:
6164 ? echo $?/$^ERRNAME / <$a><$b><$c>
6165 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
6169 .It Ic readall
6170 \*(NQ Read anything from standard input, or the channel set active via
6171 .Ic readctl ,
6172 and assign the data to the given variable.
6173 The variable name is checked by the same rules as documented for
6174 .Cm vput ,
6175 and the same error codes will be seen in
6176 .Va \&! ;
6177 the exit status
6178 .Va \&?
6179 indicates the number of bytes read, it will be
6180 .Ql -1
6181 with the error number
6182 .Va \&!
6183 set to
6184 .Va ^ERR Ns -BADF
6185 in case of I/O errors, or
6186 .Va ^ERR Ns -NONE
6187 upon End-Of-File.
6188 \*(ID The input data length is restricted to 31-bits.
6191 .It Ic readctl
6192 \*(NQ Manages input channels for
6193 .Ic read
6195 .Ic readall ,
6196 to be used to avoid complicated or impracticable code, like calling
6197 .Ic \&\&read
6198 from within a macro in non-interactive mode.
6199 Without arguments, or when the first argument is
6200 .Cm show ,
6201 a listing of all known channels is printed.
6202 Channels can otherwise be
6203 .Cm create Ns
6204 d, and existing channels can be
6205 .Cm set
6206 active and
6207 .Cm remove Ns
6208 d by giving the string used for creation.
6210 The channel name is expected to be a file descriptor number, or,
6211 if parsing the numeric fails, an input file name that undergoes
6212 .Sx "Filename transformations" .
6213 E.g. (this example requires a modern shell):
6214 .Bd -literal -offset indent
6215 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6216   LC_ALL=C \*(uA -R#
6217 hey, you
6218 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6219   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6220 hey, you
6223 .It Ic redirect
6224 \*(OB Same as
6225 .Ic resend .
6227 .It Ic Redirect
6228 \*(OB Same as
6229 .Ic Resend .
6232 .It Ic remove
6233 Removes the named files or directories.
6234 .Sx "Filename transformations"
6235 including shell pathname wildcard pattern expansions
6236 .Pf ( Xr glob 7 )
6237 are performed on the arguments.
6238 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
6239 type specific removal will be performed, deleting the complete mailbox.
6240 The user is asked for confirmation in interactive mode.
6243 .It Ic rename
6244 Takes the name of an existing folder
6245 and the name for the new folder
6246 and renames the first to the second one.
6247 .Sx "Filename transformations"
6248 including shell pathname wildcard pattern expansions
6249 .Pf ( Xr glob 7 )
6250 are performed on both arguments.
6251 Both folders must be of the same type.
6254 .It Ic Reply
6255 (R) Replies to only the sender of each message of the given message
6256 list, by using the first message as the template to quote, for the
6257 .Ql Subject:
6258 etc.
6259 .Va flipr
6260 will exchange this command with
6261 .Ic reply .
6262 Unless the internal variable
6263 .Va fullnames
6264 is set the recipient address will be stripped from comments, names etc.
6265 .Ql Reply-To:
6266 headers will be inspected if
6267 .Va reply-to-honour
6268 is set.
6270 This may generate the errors
6271 .Va ^ERR Ns -DESTADDRREQ
6272 if no receiver has been specified,
6273 .Va ^ERR Ns -PERM
6274 if some addressees where rejected by
6275 .Va expandaddr ,
6276 .Va ^ERR Ns -NODATA
6277 if no applicable messages have been given,
6278 .Va ^ERR Ns -IO
6279 if an I/O error occurs,
6280 .Va ^ERR Ns -NOTSUP
6281 if a necessary character set conversion fails, and
6282 .Va ^ERR Ns -INVAL
6283 for other errors.
6286 .It Ic reply
6287 (r) Take a message and group-responds to it by addressing the sender
6288 and all recipients, subject to
6289 .Ic alternates
6290 processing.
6291 .Va followup-to ,
6292 .Va followup-to-honour ,
6293 .Va reply-to-honour
6294 as well as
6295 .Va recipients-in-cc
6296 influence response behaviour.
6297 Unless the internal variable
6298 .Va fullnames
6299 is set recipient addresses will be stripped from comments, names etc.
6301 .Va flipr
6302 is set the commands
6303 .Ic Reply
6305 .Ic reply
6306 are exchanged.
6307 The command
6308 .Ic Lreply
6309 offers special support for replying to mailing lists.
6310 For more documentation please refer to
6311 .Sx "On sending mail, and non-interactive mode" .
6313 This may generate the errors
6314 .Va ^ERR Ns -DESTADDRREQ
6315 if no receiver has been specified,
6316 .Va ^ERR Ns -PERM
6317 if some addressees where rejected by
6318 .Va expandaddr ,
6319 .Va ^ERR Ns -NODATA
6320 if no applicable messages have been given,
6321 .Va ^ERR Ns -IO
6322 if an I/O error occurs,
6323 .Va ^ERR Ns -NOTSUP
6324 if a necessary character set conversion fails, and
6325 .Va ^ERR Ns -INVAL
6326 for other errors.
6327 Any error stops processing of further messages.
6330 .It Ic replyall
6331 Similar to
6332 .Ic reply ,
6333 but initiates a group-reply regardless of the value of
6334 .Va flipr .
6337 .It Ic replysender
6338 Similar to
6339 .Ic Reply ,
6340 but responds to the sender only regardless of the value of
6341 .Va flipr .
6344 .It Ic Resend
6345 Like
6346 .Ic resend ,
6347 but does not add any header lines.
6348 This is not a way to hide the sender's identity,
6349 but useful for sending a message again to the same recipients.
6352 .It Ic resend
6353 Takes a list of messages and a user name
6354 and sends each message to the named user.
6355 .Ql Resent-From:
6356 and related header fields are prepended to the new copy of the message.
6357 Saving in
6358 .Va record
6359 is only performed if
6360 .Va record-resent
6361 is set.
6363 This may generate the errors
6364 .Va ^ERR Ns -DESTADDRREQ
6365 if no receiver has been specified,
6366 .Va ^ERR Ns -PERM
6367 if some addressees where rejected by
6368 .Va expandaddr ,
6369 .Va ^ERR Ns -NODATA
6370 if no applicable messages have been given,
6371 .Va ^ERR Ns -IO
6372 if an I/O error occurs,
6373 .Va ^ERR Ns -NOTSUP
6374 if a necessary character set conversion fails, and
6375 .Va ^ERR Ns -INVAL
6376 for other errors.
6377 Any error stops processing of further messages.
6380 .It Ic Respond
6381 Same as
6382 .Ic Reply .
6385 .It Ic respond
6386 Same as
6387 .Ic reply .
6390 .It Ic respondall
6391 Same as
6392 .Ic replyall .
6395 .It Ic respondsender
6396 Same as
6397 .Ic replysender .
6400 .It Ic retain
6401 (ret) Superseded by the multiplexer
6402 .Ic headerpick .
6405 .It Ic return
6406 Only available inside the scope of a
6407 .Ic define Ns
6408 d macro or an
6409 .Ic account ,
6410 this will stop evaluation of any further macro content, and return
6411 execution control to the caller.
6412 The two optional parameters must be specified as positive decimal
6413 numbers and default to the value 0:
6414 the first argument specifies the signed 32-bit return value (stored in
6415 .Va \&?
6416 \*(ID and later extended to signed 64-bit),
6417 the second the signed 32-bit error number (stored in
6418 .Va \&! ) .
6419 As documented for
6420 .Va \&?
6421 a non-0 exit status may cause the program to exit.
6424 .It Ic Save
6425 (S) Similar to
6426 .Ic save,
6427 but saves the messages in a file named after the local part of the
6428 sender of the first message instead of (in
6429 .Va record
6430 and) taking a filename argument; the variable
6431 .Va outfolder
6432 is inspected to decide on the actual storage location.
6435 .It Ic save
6436 (s) Takes a message list and a filename and appends each message in turn
6437 to the end of the file.
6438 .Sx "Filename transformations"
6439 including shell pathname wildcard pattern expansions
6440 .Pf ( Xr glob 7 )
6441 is performed on the filename.
6442 If no filename is given, the
6443 .Mx -sx
6444 .Sx "secondary mailbox"
6445 .Ev MBOX
6446 is used.
6447 The filename in quotes, followed by the generated character count
6448 is echoed on the user's terminal.
6449 If editing a
6450 .Mx -sx
6451 .Sx "primary system mailbox"
6452 the messages are marked for deletion.
6453 .Sx "Filename transformations"
6454 will be applied.
6455 To filter the saved header fields to the desired subset use the
6456 .Ql save
6457 slot of the white- and blacklisting command
6458 .Ic headerpick .
6460 .It Ic savediscard
6461 \*(OB Superseded by the multiplexer
6462 .Ic headerpick .
6464 .It Ic saveignore
6465 \*(OB Superseded by the multiplexer
6466 .Ic headerpick .
6468 .It Ic saveretain
6469 \*(OB Superseded by the multiplexer
6470 .Ic headerpick .
6473 .It Ic search
6474 Takes a message specification (list) and displays a header summary of
6475 all matching messages, as via
6476 .Ic headers .
6477 This command is an alias of
6478 .Ic from .
6479 Also see
6480 .Sx "Specifying messages" .
6483 .It Ic seen
6484 Takes a message list and marks all messages as having been read.
6489 .It Ic set , unset
6490 (se, \*(NQ uns) The latter command will delete all given global
6491 variables, or only block-scope local ones if the
6492 .Cm local
6493 command modifier has been used.
6494 The former, when used without arguments, will show all
6495 currently known variables, being more verbose if either of
6496 .Va debug
6498 .Va verbose
6499 is set.
6500 Remarks: this list mode will not automatically link-in known
6501 .Sx ENVIRONMENT
6502 variables, but only explicit addressing will, e.g., via
6503 .Ic varshow ,
6504 using a variable in an
6505 .Ic if
6506 condition or a string passed to
6507 .Ic echo ,
6508 explicit
6509 .Ic \&\&set Ns
6510 ting, as well as some program-internal use cases.
6513 Otherwise the given variables (and arguments) are set or adjusted.
6514 Arguments are of the form
6515 .Ql name=value
6516 (no space before or after
6517 .Ql = ) ,
6518 or plain
6519 .Ql name
6520 if there is no value, i.e., a boolean variable.
6521 If a name begins with
6522 .Ql no ,
6523 as in
6524 .Ql set nosave ,
6525 the effect is the same as invoking the
6526 .Ic \&\&unset
6527 command with the remaining part of the variable
6528 .Pf ( Ql unset save ) .
6529 \*(ID In conjunction with the
6530 .Cm wysh
6531 .Pf (or\0 Cm local )
6532 command prefix(es)
6533 .Sx "Shell-style argument quoting"
6534 can be used to quote arguments as necessary.
6535 \*(ID Otherwise quotation marks may be placed around any part of the
6536 assignment statement to quote blanks or tabs.
6539 When operating in global scope any
6540 .Ql name
6541 that is known to map to an environment variable will automatically cause
6542 updates in the program environment (unsetting a variable in the
6543 environment requires corresponding system support) \(em use the command
6544 .Ic environ
6545 for further environmental control.
6546 If the command modifier
6547 .Cm local
6548 has been used to alter the command to work in block-scope all variables
6549 have values (may they be empty), and creation of names which shadow
6550 .Sx "INTERNAL VARIABLES"
6551 is actively prevented (\*(ID shadowing of linked
6552 .Sx ENVIRONMENT
6553 variables and free-form versions of variable chains is not yet detected).
6554 Also see
6555 .Ic varshow
6556 and the sections
6557 .Sx "INTERNAL VARIABLES"
6559 .Sx ENVIRONMENT .
6561 .Bd -literal -offset indent
6562 ? wysh set indentprefix=' -> '
6563 ? wysh set atab=$'\t' aspace=' ' zero=0
6568 .It Ic shcodec
6569 Apply shell quoting rules to the given raw-data arguments.
6570 Supports
6571 .Cm vput
6572 (see
6573 .Sx "Command modifiers" ) .
6574 The first argument specifies the operation:
6575 .Ar [+]e[ncode]
6577 .Ar d[ecode]
6578 cause shell quoting to be applied to the remains of the line, and
6579 expanded away thereof, respectively.
6580 If the former is prefixed with a plus-sign, the quoted result will not
6581 be roundtrip enabled, and thus can be decoded only in the very same
6582 environment that was used to perform the encode; also see
6583 .Cd mle-quote-rndtrip .
6584 If the coding operation fails the error number
6585 .Va \&!
6586 is set to
6587 .Va ^ERR Ns -CANCELED ,
6588 and the unmodified input is used as the result; the error number may
6589 change again due to output or result storage errors.
6592 .It Ic shell
6593 \*(NQ (sh) Invokes an interactive version of the shell,
6594 and returns its exit status.
6598 .It Ic shortcut , unshortcut
6599 Without arguments the list of all currently defined shortcuts is
6600 shown, with one argument the expansion of the given shortcut.
6601 Otherwise all given arguments are treated as pairs of shortcuts and
6602 their expansions, creating new or changing already existing shortcuts,
6603 as necessary.
6604 The latter command will remove all given shortcuts, the special name
6605 .Ql *
6606 will remove all registered shortcuts.
6609 .It Ic shift
6610 \*(NQ Shift the positional parameter stack (starting at
6611 .Va 1 )
6612 by the given number (which must be a positive decimal),
6613 or 1 if no argument has been given.
6614 It is an error if the value exceeds the number of positional parameters.
6615 If the given number is 0, no action is performed, successfully.
6616 The stack as such can be managed via
6617 .Ic vpospar .
6618 Note this command will fail in
6619 .Ic account
6620 and hook macros unless the positional parameter stack has been
6621 explicitly created in the current context via
6622 .Ic vpospar .
6625 .It Ic show
6626 Like
6627 .Ic type ,
6628 but performs neither MIME decoding nor decryption, so that the raw
6629 message text is shown.
6632 .It Ic size
6633 (si) Shows the size in characters of each message of the given
6634 message-list.
6637 .It Ic sleep
6638 \*(NQ Sleep for the specified number of seconds (and optionally
6639 milliseconds), by default interruptably.
6640 If a third argument is given the sleep will be uninterruptible,
6641 otherwise the error number
6642 .Va \&!
6643 will be set to
6644 .Va ^ERR Ns -INTR
6645 if the sleep has been interrupted.
6646 The command will fail and the error number will be
6647 .Va ^ERR Ns -OVERFLOW
6648 if the given duration(s) overflow the time datatype, and
6649 .Va ^ERR Ns -INVAL
6650 if the given durations are no valid integers.
6655 .It Ic sort , unsort
6656 The latter command disables sorted or threaded mode, returns to normal
6657 message order and, if the
6658 .Va header
6659 variable is set,
6660 displays a header summary.
6661 The former command shows the current sorting criterion when used without
6662 an argument, but creates a sorted representation of the current folder
6663 otherwise, and changes the
6664 .Ic next
6665 command and the addressing modes such that they refer to messages in
6666 the sorted order.
6667 Message numbers are the same as in regular mode.
6668 If the
6669 .Va header
6670 variable is set,
6671 a header summary in the new order is also displayed.
6672 Automatic folder sorting can be enabled by setting the
6673 .Va autosort
6674 variable, as in, e.g.,
6675 .Ql set autosort=thread .
6676 Possible sorting criterions are:
6679 .Bl -tag -compact -width "subject"
6680 .It Ar date
6681 Sort the messages by their
6682 .Ql Date:
6683 field, that is by the time they were sent.
6684 .It Ar from
6685 Sort messages by the value of their
6686 .Ql From:
6687 field, that is by the address of the sender.
6688 If the
6689 .Va showname
6690 variable is set, the sender's real name (if any) is used.
6691 .It Ar size
6692 Sort the messages by their size.
6693 .It spam
6694 \*(OP Sort the message by their spam score, as has been classified by
6695 .Ic spamrate .
6696 .It Ar status
6697 Sort the messages by their message status.
6698 .It Ar subject
6699 Sort the messages by their subject.
6700 .It Ar thread
6701 Create a threaded display.
6702 .It Ar to
6703 Sort messages by the value of their
6704 .Ql To:
6705 field, that is by the address of the recipient.
6706 If the
6707 .Va showname
6708 variable is set, the recipient's real name (if any) is used.
6713 .It Ic source
6714 \*(NQ (so) The source command reads commands from the given file.
6715 .Sx "Filename transformations"
6716 will be applied.
6717 If the given expanded argument ends with a vertical bar
6718 .Ql |
6719 then the argument will instead be interpreted as a shell command and
6720 \*(UA will read the output generated by it.
6721 Dependent on the settings of
6722 .Va posix
6724 .Va errexit ,
6725 and also dependent on whether the command modifier
6726 .Cm ignerr
6727 had been used, encountering errors will stop sourcing of the given input.
6728 \*(ID Note that
6729 .Ic \&\&source
6730 cannot be used from within macros that execute as
6731 .Va folder-hook Ns s
6733 .Ic account Ns s ,
6734 i.e., it can only be called from macros that were
6735 .Ic call Ns ed .
6738 .It Ic source_if
6739 \*(NQ The difference to
6740 .Ic source
6741 (beside not supporting pipe syntax aka shell command input) is that
6742 this command will not generate an error nor warn if the given file
6743 argument cannot be opened successfully.
6746 .It Ic spamclear
6747 \*(OP Takes a list of messages and clears their
6748 .Ql is-spam
6749 flag.
6752 .It Ic spamforget
6753 \*(OP Takes a list of messages and causes the
6754 .Va spam-interface
6755 to forget it has ever used them to train its Bayesian filter.
6756 Unless otherwise noted the
6757 .Ql is-spam
6758 flag of the message is inspected to chose whether a message shall be
6759 forgotten to be
6760 .Dq ham
6762 .Dq spam .
6765 .It Ic spamham
6766 \*(OP Takes a list of messages and informs the Bayesian filter of the
6767 .Va spam-interface
6768 that they are
6769 .Dq ham .
6770 This also clears the
6771 .Ql is-spam
6772 flag of the messages in question.
6775 .It Ic spamrate
6776 \*(OP Takes a list of messages and rates them using the configured
6777 .Va spam-interface ,
6778 without modifying the messages, but setting their
6779 .Ql is-spam
6780 flag as appropriate; because the spam rating headers are lost the rate
6781 will be forgotten once the mailbox is left.
6782 Refer to the manual section
6783 .Sx "Handling spam"
6784 for the complete picture of spam handling in \*(UA.
6787 .It Ic spamset
6788 \*(OP Takes a list of messages and sets their
6789 .Ql is-spam
6790 flag.
6793 .It Ic spamspam
6794 \*(OP Takes a list of messages and informs the Bayesian filter of the
6795 .Va spam-interface
6796 that they are
6797 .Dq spam .
6798 This also sets the
6799 .Ql is-spam
6800 flag of the messages in question.
6802 .It Ic thread
6803 \*(OB The same as
6804 .Ql sort thread
6805 (consider using a
6806 .Ql commandalias
6807 as necessary).
6810 .It Ic Top
6811 Like
6812 .Ic top
6813 but always uses the
6814 .Ic headerpick
6815 .Ql type
6816 slot for white- and blacklisting header fields.
6819 .It Ic top
6820 (to) Takes a message list and types out the first
6821 .Va toplines
6822 lines of each message on the user's terminal.
6823 Unless a special selection has been established for the
6824 .Ql top
6825 slot of the
6826 .Ic headerpick
6827 command, the only header fields that are displayed are
6828 .Ql From: ,
6829 .Ql To: ,
6830 .Ql CC: ,
6832 .Ql Subject: .
6833 .Ic Top
6834 will always use the
6835 .Ql type
6836 .Ic headerpick
6837 selection instead.
6838 It is possible to apply compression to what is displayed by setting
6839 .Va topsqueeze .
6840 Messages are decrypted and converted to the terminal character set
6841 if necessary.
6844 .It Ic touch
6845 (tou) Takes a message list and marks the messages for saving in the
6846 .Mx -sx
6847 .Sx "secondary mailbox"
6848 .Ev MBOX .
6849 \*(UA deviates from the POSIX standard with this command,
6850 as a following
6851 .Ic next
6852 command will display the following message instead of the current one.
6855 .It Ic Type
6856 (T) Like
6857 .Ic type
6858 but also displays header fields which would not pass the
6859 .Ic headerpick
6860 selection, and all visualizable parts of MIME
6861 .Ql multipart/alternative
6862 messages.
6865 .It Ic type
6866 (t) Takes a message list and types out each message on the user's terminal.
6867 The display of message headers is selectable via
6868 .Ic headerpick .
6869 For MIME multipart messages, all parts with a content type of
6870 .Ql text ,
6871 all parts which have a registered MIME type handler (see
6872 .Sx "HTML mail and MIME attachments" )
6873 which produces plain text output, and all
6874 .Ql message
6875 parts are shown, others are hidden except for their headers.
6876 Messages are decrypted and converted to the terminal character set
6877 if necessary.
6878 The command
6879 .Ic mimeview
6880 can be used to display parts which are not displayable as plain text.
6882 .It Ic unaccount
6884 .Ic account .
6886 .It Ic unalias
6887 (una) See
6888 .Ic alias .
6890 .It Ic unanswered
6892 .Ic answered .
6894 .It Ic unbind
6896 .Ic bind .
6898 .It Ic uncollapse
6900 .Ic collapse .
6902 .It Ic uncolour
6904 .Ic colour .
6906 .It Ic undefine
6908 .Ic define .
6910 .It Ic undelete
6912 .Ic delete .
6914 .It Ic undraft
6916 .Ic draft .
6918 .It Ic unflag
6920 .Ic flag .
6922 .It Ic unfwdignore
6923 \*(OB Superseded by the multiplexer
6924 .Ic headerpick .
6926 .It Ic unfwdretain
6927 \*(OB Superseded by the multiplexer
6928 .Ic headerpick .
6931 .It Ic unignore
6932 Superseded by the multiplexer
6933 .Ic headerpick .
6935 .It Ic unmimetype
6937 .Ic mimetype .
6939 .It Ic unmlist
6941 .Ic mlist .
6943 .It Ic unmlsubscribe
6945 .Ic mlsubscribe .
6948 .It Ic Unread
6949 Same as
6950 .Ic unread .
6953 .It Ic unread
6954 Takes a message list and marks each message as not having been read.
6957 .It Ic unretain
6958 Superseded by the multiplexer
6959 .Ic headerpick .
6961 .It Ic unsaveignore
6962 \*(OB Superseded by the multiplexer
6963 .Ic headerpick .
6965 .It Ic unsaveretain
6966 \*(OB Superseded by the multiplexer
6967 .Ic headerpick .
6969 .It Ic unset
6970 \*(NQ (uns) See
6971 .Ic set .
6973 .It Ic unshortcut
6975 .Ic shortcut .
6977 .It Ic unsort
6979 .Ic short .
6981 .It Ic unthread
6982 \*(OB
6983 Same as
6984 .Ic unsort .
6987 .It Ic urlcodec
6988 Perform URL percent codec operations on the raw-data argument, rather
6989 according to RFC 3986.
6990 Supports
6991 .Cm vput
6992 (see
6993 .Sx "Command modifiers" ) ,
6994 and manages the error number
6995 .Va \&! .
6996 This is a character set agnostic and thus locale dependent operation,
6997 and it may decode bytes which are invalid in the current
6998 .Va ttycharset .
6999 \*(ID This command does not know about URLs beside that.
7001 The first argument specifies the operation:
7002 .Ar e[ncode]
7004 .Ar d[ecode]
7005 perform plain URL percent en- and decoding, respectively.
7006 .Ar p[ath]enc[ode]
7008 .Ar p[ath]dec[ode]
7009 perform a slightly modified operation which should be better for
7010 pathnames: it does not allow a tilde
7011 .Ql ~ ,
7012 and will neither accept hyphen-minus
7013 .Ql -
7014 nor dot
7015 .Ql .
7016 as an initial character.
7017 The remains of the line form the URL data which is to be converted.
7018 If the coding operation fails the error number
7019 .Va \&!
7020 is set to
7021 .Va ^ERR Ns -CANCELED ,
7022 and the unmodified input is used as the result; the error number may
7023 change again due to output or result storage errors.
7026 .It Ic varshow
7027 \*(NQ This command produces the same output as the listing mode of
7028 .Ic set ,
7029 including
7030 .Va verbose Ns
7031 ity adjustments, but only for the given variables.
7034 .It Ic verify
7035 \*(OP Takes a message list and verifies each message.
7036 If a message is not a S/MIME signed message,
7037 verification will fail for it.
7038 The verification process checks if the message was signed using a valid
7039 certificate,
7040 if the message sender's email address matches one of those contained
7041 within the certificate,
7042 and if the message content has been altered.
7045 .It Ic version
7046 Shows the
7047 .Va version
7049 .Va features
7050 of \*(UA, as well as the build and running system environment.
7051 This command can produce a more
7052 .Va verbose
7053 output, and supports
7054 .Cm vput
7055 (see
7056 .Sx "Command modifiers" ) .
7060 .It Ic vexpr
7061 \*(NQ Evaluate arguments according to a given operator.
7062 This is a multiplexer command which can be used to perform signed 64-bit
7063 numeric calculations as well as byte string and string operations.
7064 It uses polish notation, i.e., the operator is the first argument and
7065 defines the number and type, and the meaning of the remaining arguments.
7066 An empty argument is replaced with a 0 if a number is expected.
7067 Supports
7068 .Cm vput
7069 (see
7070 .Sx "Command modifiers" ) .
7073 The result that is shown in case of errors is always
7074 .Ql -1
7075 for usage errors and numeric operations, and the empty string for byte
7076 string and string operations;
7077 if the latter two fail to provide result data for
7078 .Dq soft
7079 errors, e.g., when a search operation failed, they also set the
7080 .Va \&!
7081 error number to
7082 .Va ^ERR Ns -NODATA .
7083 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7084 numbers, and errors will be reported in the error number
7085 .Va \&!
7086 as the numeric error
7087 .Va ^ERR Ns -RANGE .
7090 Numeric operations work on one or two signed 64-bit integers.
7091 Numbers prefixed with
7092 .Ql 0x
7094 .Ql 0X
7095 are interpreted as hexadecimal (base 16) numbers, whereas
7096 .Ql 0
7097 indicates octal (base 8), and
7098 .Ql 0b
7099 as well as
7100 .Ql 0B
7101 denote binary (base 2) numbers.
7102 It is possible to use any base in between 2 and 36, inclusive, with the
7103 .Ql BASE#number
7104 notation, where the base is given as an unsigned decimal number, e.g.,
7105 .Ql 16#AFFE
7106 is a different way of specifying a hexadecimal number.
7107 Unsigned interpretation of a number can be enforced by prefixing a
7108 .Ql u
7109 (case-insensitively), e.g.,
7110 .Ql u-110 ;
7111 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7112 which will be interpreted as unsigned by default, but it still makes
7113 a difference regarding overflow detection and overflow constant.
7114 It is possible to enforce signed interpretation by (instead) prefixing a
7115 .Ql s
7116 (case-insensitively).
7119 One integer is expected by assignment (equals sign
7120 .Ql = ) ,
7121 which does nothing but parsing the argument, thus detecting validity and
7122 possible overflow conditions, and unary not (tilde
7123 .Ql ~ ) ,
7124 which creates the bitwise complement.
7125 Two integers are used by addition (plus sign
7126 .Ql + ) ,
7127 subtraction (hyphen-minus
7128 .Ql - ) ,
7129 multiplication (asterisk
7130 .Ql * ) ,
7131 division (solidus
7132 .Ql / )
7133 and modulo (percent sign
7134 .Ql % ) ,
7135 as well as for the bitwise operators logical or (vertical bar
7136 .Ql | ,
7137 to be quoted) ,
7138 bitwise and (ampersand
7139 .Ql \&& ,
7140 to be quoted) ,
7141 bitwise xor (circumflex
7142 .Ql ^ ) ,
7143 the bitwise signed left- and right shifts
7144 .Pf ( Ql << ,
7145 .Ql >> ) ,
7146 as well as for the unsigned right shift
7147 .Ql >>> .
7150 Another numeric operation is
7151 .Cm pbase ,
7152 which takes a number base in between 2 and 36, inclusive, and will act
7153 on the second number given just the same as what equals sign
7154 .Ql =
7155 does, but the number result will be formatted in the base given.
7158 All numeric operators can be prefixed with a commercial at
7159 .Ql @ ,
7160 e.g.,
7161 .Ql @* :
7162 this will turn the operation into a saturated one, which means that
7163 overflow errors and division and modulo by zero are no longer reported
7164 via the exit status, but the result will linger at the minimum or
7165 maximum possible value, instead of overflowing (or trapping).
7166 This is true also for the argument parse step.
7167 For the bitwise shifts, the saturated maximum is 63.
7168 Any catched overflow will be reported via the error number
7169 .Va \&!
7171 .Va ^ERR Ns -OVERFLOW .
7172 .Bd -literal -offset indent
7173 ? vexpr @- +1 -9223372036854775808
7174 ? echo $?/$!/$^ERRNAME
7178 Character set agnostic string functions have no notion of locale
7179 settings and character sets.
7181 .Bl -hang -width ".It Cm random"
7182 .It Cm file-expand
7183 Performs the usual
7184 .Sx "Filename transformations"
7185 on its argument.
7186 .It Cm random
7187 Generates a random string of the given length, or of
7188 .Dv \&\&PATH_MAX
7189 bytes (a constant from
7190 .Pa /usr/include )
7191 if the value 0 is given; the random string will be base64url encoded
7192 according to RFC 4648, and thus be usable as a (portable) filename.
7196 Byte string operations work on 8-bit bytes and have no notion of locale
7197 settings and character sets, effectively assuming ASCII data.
7200 .Bl -hang -width ".It Cm length"
7201 .It Cm length
7202 Queries the length of the given argument.
7204 .It Cm hash
7205 Calculates the Chris Torek hash of the given argument.
7207 .It Cm find
7208 Byte-searches in the first for the second argument.
7209 Shows the resulting 0-based offset shall it have been found.
7211 .It Cm ifind
7212 Identical to
7213 .Cm find ,
7214 but works case-insensitively according to the rules of the ASCII
7215 character set.
7217 .It Cm substring
7218 Creates a substring of its first argument.
7219 The second argument is the 0-based starting offset, a negative one
7220 counts from the end;
7221 the optional third argument specifies the length of the desired result,
7222 a negative length leaves off the given number of bytes at the end of the
7223 original string, by default the entire string is used;
7224 this operation tries to work around faulty arguments (set
7225 .Va verbose
7226 for error logs), but reports them via the error number
7227 .Va \&!
7229 .Va ^ERR Ns -OVERFLOW .
7231 .It Cm trim
7232 Trim away whitespace characters from both ends of the argument.
7234 .It Cm trim-front
7235 Trim away whitespace characters from the begin of the argument.
7237 .It Cm trim-end
7238 Trim away whitespace characters from the end of the argument.
7243 String operations work, sufficient support provided, according to the
7244 active user's locale encoding and character set (see
7245 .Sx "Character sets" ) .
7248 .Bl -hang -width ".It Cm regex"
7249 .It Cm makeprint
7250 (One-way) Converts the argument to something safely printable on the
7251 terminal.
7253 .It Cm regex
7254 \*(OP A string operation that will try to match the first argument with
7255 the regular expression given as the second argument.
7256 If the optional third argument has been given then instead of showing
7257 the match offset a replacement operation is performed: the third
7258 argument is treated as if specified within dollar-single-quote (see
7259 .Sx "Shell-style argument quoting" ) ,
7260 and any occurrence of a positional parameter, e.g.,
7261 .Va 1 ,
7262 is replaced by the corresponding match group of the regular expression:
7263 .Bd -literal -offset indent
7264 ? vput vexpr res regex bananarama \e
7265     (.*)NanA(.*) '\e${1}au\e$2'
7266 ? echo $?/$!/$^ERRNAME: $res
7269 .It Cm iregex
7270 On otherwise identical case-insensitive equivalent to
7271 .Cm regex :
7272 .Bd -literal -offset indent
7273 ? vput vexpr res ire bananarama \e
7274     (.*)NanA(.*) '\e${1}au\e$2'
7275 ? echo $?/$!/$^ERRNAME: $res
7281 .It Ic vpospar
7282 \*(NQ Manage the positional parameter stack (see
7283 .Va 1 , # , * , @
7284 as well as
7285 .Ic shift ) .
7286 If the first argument is
7287 .Ql clear ,
7288 then the positional parameter stack of the current context, or the
7289 global one, if there is none, is cleared.
7290 If it is
7291 .Ql set ,
7292 then the remaining arguments will be used to (re)create the stack,
7293 if the parameter stack size limit is excessed an
7294 .Va ^ERR Ns -OVERFLOW
7295 error will occur.
7298 If the first argument is
7299 .Ql quote ,
7300 a round-trip capable representation of the stack contents is created,
7301 with each quoted parameter separated from each other with the first
7302 character of
7303 .Va ifs ,
7304 and followed by the first character of
7305 .Va if-ws ,
7306 if that is not empty and not identical to the first.
7307 If that results in no separation at all a
7308 .Cm space
7309 character is used.
7310 This mode supports
7311 .Cm vput
7312 (see
7313 .Sx "Command modifiers" ) .
7314 I.e., the subcommands
7315 .Ql set
7317 .Ql quote
7318 can be used (in conjunction with
7319 .Ic eval )
7320 to (re)create an argument stack from and to a single variable losslessly.
7322 .Bd -literal -offset indent
7323 ? vpospar set hey, "'you    ", world!
7324 ? echo $#: <${1}><${2}><${3}>
7325 ? vput vpospar x quote
7326 ? vpospar clear
7327 ? echo $#: <${1}><${2}><${3}>
7328 ? eval vpospar set ${x}
7329 ? echo $#: <${1}><${2}><${3}>
7334 .It Ic visual
7335 (v) Takes a message list and invokes the
7336 .Ev VISUAL
7337 display editor on each message.
7338 Modified contents are discarded unless the
7339 .Va writebackedited
7340 variable is set, and are not used unless the mailbox can be written to
7341 and the editor returns a successful exit status.
7342 .Ic edit
7343 can be used instead for a less display oriented editor.
7346 .It Ic write
7347 (w) For conventional messages the body without all headers is written.
7348 The original message is never marked for deletion in the originating
7349 mail folder.
7350 The output is decrypted and converted to its native format as necessary.
7351 If the output file exists, the text is appended.
7352 If a message is in MIME multipart format its first part is written to
7353 the specified file as for conventional messages, handling of the remains
7354 depends on the execution mode.
7355 No special handling of compressed files is performed.
7357 In interactive mode the user is consecutively asked for the filenames of
7358 the processed parts.
7359 For convience saving of each part may be skipped by giving an empty
7360 value, the same result as writing it to
7361 .Pa /dev/null .
7362 Shell piping the part content by specifying a leading vertical bar
7363 .Ql |
7364 character for the filename is supported.
7365 Other user input undergoes the usual
7366 .Sx "Filename transformations" ,
7367 including shell pathname wildcard pattern expansions
7368 .Pf ( Xr glob 7 )
7369 and shell variable expansion for the message as such, not the individual
7370 parts, and contents of the destination file are overwritten if the file
7371 previously existed.
7373 \*(ID In non-interactive mode any part which does not specify a filename
7374 is ignored, and suspicious parts of filenames of the remaining parts are
7375 URL percent encoded (as via
7376 .Ic urlcodec )
7377 to prevent injection of malicious character sequences, resulting in
7378 a filename that will be written into the current directory.
7379 Existing files will not be overwritten, instead the part number or
7380 a dot are appended after a number sign
7381 .Ql #
7382 to the name until file creation succeeds (or fails due to other
7383 reasons).
7386 .It Ic xcall
7387 \*(NQ The sole difference to
7388 .Ic call
7389 is that the new macro is executed in place of the current one, which
7390 will not regain control: all resources of the current macro will be
7391 released first.
7392 This implies that any setting covered by
7393 .Ic localopts
7394 will be forgotten and covered variables will become cleaned up.
7395 If this command is not used from within a
7396 .Ic call Ns
7397 ed macro it will silently be (a more expensive variant of)
7398 .Ic call .
7401 .It Ic xit
7402 (x) A synonym for
7403 .Ic exit .
7406 .It Ic z
7407 \*(NQ \*(UA presents message headers in
7408 .Va screen Ns
7409 fuls as described under the
7410 .Ic headers
7411 command.
7412 Without arguments this command scrolls to the next window of messages,
7413 likewise if the argument is
7414 .Ql + .
7415 An argument of
7416 .Ql -
7417 scrolls to the last,
7418 .Ql ^
7419 scrolls to the first, and
7420 .Ql $
7421 to the last
7422 .Va \&\&screen
7423 of messages.
7424 A number argument prefixed by
7425 .Ql +
7427 .Ql \-
7428 indicates that the window is calculated in relation to the current
7429 position, and a number without a prefix specifies an absolute position.
7432 .It Ic Z
7433 \*(NQ Similar to
7434 .Ic z ,
7435 but scrolls to the next or previous window that contains at least one
7436 .Ql new
7438 .Ic flag Ns
7439 ged message.
7441 .\" }}}
7443 .\" }}}
7446 .\" .Sh COMMAND ESCAPES {{{
7447 .Sh "COMMAND ESCAPES"
7449 Command escapes are available in compose mode, and are used to perform
7450 special functions when composing messages.
7451 Command escapes are only recognized at the beginning of lines, and
7452 consist of a trigger (escape), and a command character.
7453 The actual escape character can be set via the internal variable
7454 .Va escape ,
7455 it defaults to the tilde
7456 .Ql ~ .
7457 Otherwise ignored whitespace characters following the escape character
7458 will prevent a possible addition of the command line to the \*(OPal
7459 history.
7462 Unless otherwise noted all compose mode command escapes ensure proper
7463 updates of the variables which represent the error number
7464 .Va \&!
7465 and the exit status
7466 .Va \&? .
7467 If the variable
7468 .Va errexit
7469 is set they will, unless stated otherwise, error out message compose mode
7470 and cause a program exit if an operation fails;
7471 an effect equivalent to the command modifier
7472 .Cm ignerr
7473 can however be achieved by placing a hyphen-minus
7474 .Ql -
7475 after (possible whitespace following) the escape character.
7476 If the \*(OPal key bindings are available it is possible to create
7477 .Ic bind Ns
7478 ings specifically for the compose mode.
7481 .Bl -tag -width ".It Ic BaNg"
7483 .It Ic ~~ Ar string
7484 Insert the string of text in the message prefaced by a single
7485 .Ql ~ .
7486 (If the escape character has been changed,
7487 that character must be doubled instead.)
7490 .It Ic ~! Ar command
7491 Execute the indicated shell
7492 .Ar command
7493 which follows, replacing unescaped exclamation marks with the previously
7494 executed command if the internal variable
7495 .Va bang
7496 is set, then return to the message.
7499 .It Ic ~.
7500 End compose mode and send the message.
7501 The hooks
7502 .Va on-compose-splice-shell
7504 .Va on-compose-splice ,
7505 in order, will be called when set, after which
7506 .Va askatend
7507 will be checked, a set
7508 .Va on-compose-leave
7509 hook will be called,
7510 .Va autocc
7512 .Va autobcc
7513 will be joined in if set,
7514 .Va asksend
7515 will be honoured in interactive mode, finally a given
7516 .Va message-inject-tail
7517 will be incorporated, after which the compose mode is left.
7520 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
7521 Execute the given \*(UA command.
7522 Not all commands, however, are allowed.
7525 .It Ic ~< Ar filename
7526 Identical to
7527 .Ic ~r .
7530 .It Ic ~<! Ar command
7531 .Ar command
7532 is executed using the shell.
7533 Its standard output is inserted into the message.
7536 .It Ic ~?
7537 \*(OP Write a summary of command escapes.
7540 .It Ic ~@ Op Ar filename...
7541 Append or edit the list of attachments.
7542 Does not manage the error number
7543 .Va \&!
7544 and the exit status
7545 .Va \&?
7546 (please use
7547 .Ic ~^
7548 instead if this is a concern).
7549 The append mode expects a list of
7550 .Ar filename
7551 arguments as shell tokens (see
7552 .Sx "Shell-style argument quoting" ;
7553 token-separating commas are ignored, too), to be
7554 interpreted as documented for the command line option
7555 .Fl a ,
7556 with the message number exception as below.
7558 Without
7559 .Ar filename
7560 arguments the attachment list is edited, entry by entry;
7561 if a filename is left empty, that attachment is deleted from the list;
7562 once the end of the list is reached either new attachments may be
7563 entered or the session can be quit by committing an empty
7564 .Dq new
7565 attachment.
7566 In non-interactive mode or in batch mode
7567 .Pf ( Fl # )
7568 the list of attachments is effectively not edited but instead recreated;
7569 again, an empty input ends list creation.
7571 For all modes, if a given filename solely consists of the number sign
7572 .Ql #
7573 followed by either a valid message number of the currently active
7574 mailbox, or by a period
7575 .Ql \&. ,
7576 referring to the current message of the active mailbox, the so-called
7577 .Dq dot ,
7578 then the given message is attached as a
7579 .Ql message/rfc822
7580 MIME message part.
7581 The number sign must be quoted to avoid misinterpretation with the shell
7582 comment character.
7585 .It Ic ~| Ar command
7586 Pipe the message through the specified filter command.
7587 If the command gives no output or terminates abnormally,
7588 retain the original text of the message.
7589 E.g., the command
7590 .Xr fmt 1
7591 is often used as a rejustifying filter.
7595 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7596 Low-level command meant for scripted message access, i.e., for
7597 .Va on-compose-splice
7599 .Va on-compose-splice-shell .
7600 The used protocol is likely subject to changes, and therefore the
7601 mentioned hooks receive the used protocol version as an initial line.
7602 In general the first field of a response line represents a status code
7603 which specifies whether a command was successful or not, whether result
7604 data is to be expected, and if, the format of the result data.
7605 Does not manage the error number
7606 .Va \&!
7607 and the exit status
7608 .Va \&? ,
7609 because errors are reported via the protocol
7610 (hard errors like I/O failures cannot be handled).
7611 This command has read-only access to several virtual pseudo headers in
7612 the \*(UA private namespace, which may not exist (except for the first):
7616 .Bl -tag -compact -width ".It Va BaNg"
7617 .It Ql Mailx-Command:
7618 The name of the command that generates the message, one of
7619 .Ql forward ,
7620 .Ql Lreply ,
7621 .Ql mail ,
7622 .Ql Reply ,
7623 .Ql reply ,
7624 .Ql resend .
7626 .It Ql Mailx-Raw-To:
7627 .It Ql Mailx-Raw-Cc:
7628 .It Ql Mailx-Raw-Bcc:
7629 Represent the frozen initial state of these headers before any
7630 transformation (e.g.,
7631 .Ic alias ,
7632 .Ic alternates ,
7633 .Va recipients-in-cc
7634 etc.) took place.
7636 .It Ql Mailx-Orig-From:
7637 .It Ql Mailx-Orig-To:
7638 .It Ql Mailx-Orig-Cc:
7639 .It Ql Mailx-Orig-Bcc:
7640 The values of said headers of the original message which has been
7641 addressed by any of
7642 .Ic reply , forward , resend .
7646 The status codes are:
7650 .Bl -tag -compact -width ".It Ql 210"
7651 .It Ql 210
7652 Status ok; the remains of the line are the result.
7654 .It Ql 211
7655 Status ok; the rest of the line is optionally used for more status.
7656 What follows are lines of result addresses, terminated by an empty line.
7657 The address lines consist of two fields, the first of which is the
7658 plain address, e.g.,
7659 .Ql bob@exam.ple ,
7660 separated by a single ASCII SP space from the second which contains the
7661 unstripped address, even if that is identical to the first field, e.g.,
7662 .Ql (Lovely) Bob <bob@exam.ple> .
7663 All the input, including the empty line, must be consumed before further
7664 commands can be issued.
7666 .It Ql 212
7667 Status ok; the rest of the line is optionally used for more status.
7668 What follows are lines of furtherly unspecified string content,
7669 terminated by an empty line.
7670 All the input, including the empty line, must be consumed before further
7671 commands can be issued.
7673 .It Ql 500
7674 Syntax error; invalid command.
7676 .It Ql 501
7677 Syntax error in parameters or arguments.
7679 .It Ql 505
7680 Error: an argument fails verification.
7681 For example an invalid address has been specified, or an attempt was
7682 made to modify anything in \*(UA's own namespace.
7684 .It Ql 506
7685 Error: an otherwise valid argument is rendered invalid due to context.
7686 For example, a second address is added to a header which may consist of
7687 a single address only.
7692 If a command indicates failure then the message will have remained
7693 unmodified.
7694 Most commands can fail with
7695 .Ql 500
7696 if required arguments are missing (false command usage).
7697 The following (case-insensitive) commands are supported:
7700 .Bl -hang -width ".It Cm header"
7701 .It Cm header
7702 This command allows listing, inspection, and editing of message headers.
7703 Header name case is not normalized, and case-insensitive comparison
7704 should be used when matching names.
7705 The second argument specifies the subcommand to apply, one of:
7707 .Bl -hang -width ".It Cm remove"
7708 .It Cm list
7709 Without a third argument a list of all yet existing headers is given via
7710 .Ql 210 ;
7711 this command is the default command of
7712 .Cm header
7713 if no second argument has been given.
7714 A third argument restricts output to the given header only, which may
7715 fail with
7716 .Ql 501
7717 if no such field is defined.
7719 .It Cm show
7720 Shows the content of the header given as the third argument.
7721 Dependent on the header type this may respond with
7722 .Ql 211
7724 .Ql 212 ;
7725 any failure results in
7726 .Ql 501 .
7728 .It Cm remove
7729 This will remove all instances of the header given as the third
7730 argument, reporting
7731 .Ql 210
7732 upon success,
7733 .Ql 501
7734 if no such header can be found, and
7735 Ql 505
7736 on \*(UA namespace violations.
7738 .It Cm remove-at
7739 This will remove from the header given as the third argument the
7740 instance at the list position (counting from one!) given with the fourth
7741 argument, reporting
7742 .Ql 210
7743 upon success or
7744 .Ql 505
7745 if the list position argument is not a number or on \*(UA namespace
7746 violations, and
7747 .Ql 501
7748 if no such header instance exists.
7750 .It Cm insert
7751 Create a new or an additional instance of the header given in the third
7752 argument, with the header body content as given in the fourth argument
7753 (the remains of the line).
7754 It may return
7755 .Ql 501
7756 if the third argument specifies a free-form header field name that is
7757 invalid, or if body content extraction fails to succeed,
7758 .Ql 505
7759 if any extracted address does not pass syntax and/or security checks or
7760 on \*(UA namespace violations, and
7761 .Ql 506
7762 to indicate prevention of excessing a single-instance header \(em note that
7763 .Ql Subject:
7764 can be appended to (a space separator will be added automatically first).
7766 .Ql 210
7767 is returned upon success, followed by the name of the header and the list
7768 position of the newly inserted instance.
7769 The list position is always 1 for single-instance header fields.
7770 All free-form header fields are managed in a single list.
7774 .It Cm attachment
7775 This command allows listing, removal and addition of message attachments.
7776 The second argument specifies the subcommand to apply, one of:
7778 .Bl -hang -width ".It Cm remove"
7779 .It Cm list
7780 List all attachments via
7781 .Ql 212 ,
7782 or report
7783 .Ql 501
7784 if no attachments exist.
7785 This command is the default command of
7786 .Cm attachment
7787 if no second argument has been given.
7789 .It Cm remove
7790 This will remove the attachment given as the third argument, and report
7791 .Ql 210
7792 upon success or
7793 .Ql 501
7794 if no such attachment can be found.
7795 If there exists any path component in the given argument, then an exact
7796 match of the path which has been used to create the attachment is used
7797 directly, but if only the basename of that path matches then all
7798 attachments are traversed to find an exact match first, and the removal
7799 occurs afterwards; if multiple basenames match, a
7800 .Ql 506
7801 error occurs.
7802 Message attachments are treated as absolute pathnames.
7804 If no path component exists in the given argument, then all attachments
7805 will be searched for
7806 .Ql filename=
7807 parameter matches as well as for matches of the basename of the path
7808 which has been used when the attachment has been created; multiple
7809 matches result in a
7810 .Ql 506 .
7812 .It Cm remove-at
7813 This will interpret the third argument as a number and remove the
7814 attachment at that list position (counting from one!), reporting
7815 .Ql 210
7816 upon success or
7817 .Ql 505
7818 if the argument is not a number or
7819 .Ql 501
7820 if no such attachment exists.
7822 .It Cm insert
7823 Adds the attachment given as the third argument, specified exactly as
7824 documented for the command line option
7825 .Fl a ,
7826 and supporting the message number extension as documented for
7827 .Ic ~@ .
7828 This reports
7829 .Ql 210
7830 upon success, with the index of the new attachment following,
7831 .Ql 505
7832 if the given file cannot be opened,
7833 .Ql 506
7834 if an on-the-fly performed character set conversion fails, otherwise
7835 .Ql 501
7836 is reported; this is also reported if character set conversion is
7837 requested but not available.
7839 .It Cm attribute
7840 This uses the same search mechanism as described for
7841 .Cm remove
7842 and prints any known attributes of the first found attachment via
7843 .Ql 212
7844 upon success or
7845 .Ql 501
7846 if no such attachment can be found.
7847 The attributes are written as lines of keyword and value tuples, the
7848 keyword being separated from the rest of the line with an ASCII SP space
7849 character.
7851 .It Cm attribute-at
7852 This uses the same search mechanism as described for
7853 .Cm remove-at
7854 and is otherwise identical to
7855 .Cm attribute .
7857 .It Cm attribute-set
7858 This uses the same search mechanism as described for
7859 .Cm remove ,
7860 and will assign the attribute given as the fourth argument, which is
7861 expected to be a value tuple of keyword and other data, separated by
7862 a ASCII SP space or TAB tabulator character.
7863 If the value part is empty, then the given attribute is removed, or
7864 reset to a default value if existence of the attribute is crucial.
7866 It returns via
7867 .Ql 210
7868 upon success, with the index of the found attachment following,
7869 .Ql 505
7870 for message attachments or if the given keyword is invalid, and
7871 .Ql 501
7872 if no such attachment can be found.
7873 The following keywords may be used (case-insensitively):
7875 .Bl -hang -compact -width ".It Ql filename"
7876 .It Ql filename
7877 Sets the filename of the MIME part, i.e., the name that is used for
7878 display and when (suggesting a name for) saving (purposes).
7879 .It Ql content-description
7880 Associate some descriptive information to the attachment's content, used
7881 in favour of the plain filename by some MUAs.
7882 .It Ql content-id
7883 May be used for uniquely identifying MIME entities in several contexts;
7884 this expects a special reference address format as defined in RFC 2045
7885 and generates a
7886 .Ql 505
7887 upon address content verification failure.
7888 .It Ql content-type
7889 Defines the media type/subtype of the part, which is managed
7890 automatically, but can be overwritten.
7891 .It Ql content-disposition
7892 Automatically set to the string
7893 .Ql attachment .
7896 .It Cm attribute-set-at
7897 This uses the same search mechanism as described for
7898 .Cm remove-at
7899 and is otherwise identical to
7900 .Cm attribute-set .
7906 .It Ic ~A
7907 The same as
7908 .Ql Ic ~i Ns \| Va Sign .
7911 .It Ic ~a
7912 The same as
7913 .Ql Ic ~i Ns \| Va sign .
7916 .It Ic ~b Ar name ...
7917 Add the given names to the list of blind carbon copy recipients.
7920 .It Ic ~c Ar name ...
7921 Add the given names to the list of carbon copy recipients.
7924 .It Ic ~d
7925 Read the file specified by the
7926 .Ev DEAD
7927 variable into the message.
7930 .It Ic ~e
7931 Invoke the text
7932 .Ev EDITOR
7933 on the message collected so far, then return to compose mode.
7934 .Ic ~v
7935 can be used for a more display oriented editor.
7938 .It Ic ~F Ar messages
7939 Read the named messages into the message being sent, including all
7940 message headers and MIME parts.
7941 If no messages are specified, read in the current message, the
7942 .Dq dot .
7945 .It Ic ~f Ar messages
7946 Read the named messages into the message being sent.
7947 If no messages are specified, read in the current message, the
7948 .Dq dot .
7949 Strips down the list of header fields according to the
7950 .Ql type
7951 white- and blacklist selection of
7952 .Ic headerpick .
7953 For MIME multipart messages,
7954 only the first displayable part is included.
7957 .It Ic ~H
7958 Edit the message header fields
7959 .Ql From: ,
7960 .Ql Reply-To:
7962 .Ql Sender:
7963 by typing each one in turn and allowing the user to edit the field.
7964 The default values for these fields originate from the
7965 .Va from , reply-to
7967 .Va sender
7968 variables.
7971 .It Ic ~h
7972 Edit the message header fields
7973 .Ql To: ,
7974 .Ql Cc: ,
7975 .Ql Bcc:
7977 .Ql Subject:
7978 by typing each one in turn and allowing the user to edit the field.
7981 .It Ic ~I Ar variable
7982 Insert the value of the specified variable into the message.
7983 The message remains unaltered if the variable is unset or empty.
7984 Any embedded character sequences
7985 .Ql \et
7986 horizontal tabulator and
7987 .Ql \en
7988 line feed are expanded in
7989 .Va posix
7990 mode; otherwise the expansion should occur at
7991 .Ic set
7992 time (\*(ID by using the command modifier
7993 .Va wysh ) .
7996 .It Ic ~i Ar variable
7997 Like
7998 .Ic ~I ,
7999 but appends a newline character.
8002 .It Ic ~M Ar messages
8003 Read the named messages into the message being sent,
8004 indented by
8005 .Va indentprefix .
8006 If no messages are specified, read the current message, the
8007 .Dq dot .
8010 .It Ic ~m Ar messages
8011 Read the named messages into the message being sent,
8012 indented by
8013 .Va indentprefix .
8014 If no messages are specified, read the current message, the
8015 .Dq dot .
8016 Strips down the list of header fields according to the
8017 .Ql type
8018 white- and blacklist selection of
8019 .Ic headerpick .
8020 For MIME multipart messages,
8021 only the first displayable part is included.
8024 .It Ic ~p
8025 Display the message collected so far,
8026 prefaced by the message header fields
8027 and followed by the attachment list, if any.
8030 .It Ic ~Q
8031 Read in the given / current message(s) according to the algorithm of
8032 .Va quote .
8035 .It Ic ~q
8036 Abort the message being sent,
8037 copying it to the file specified by the
8038 .Ev DEAD
8039 variable if
8040 .Va save
8041 is set.
8044 .It Ic ~R Ar filename
8045 Identical to
8046 .Ic ~r ,
8047 but indent each line that has been read by
8048 .Va indentprefix .
8051 .It Ic ~r Ar filename Op Ar HERE-delimiter
8052 Read the named file, object to the usual
8053 .Sx "Filename transformations" ,
8054 into the message; if (the expanded)
8055 .Ar filename
8056 is the hyphen-minus
8057 .Ql -
8058 then standard input is used, e.g., for pasting purposes.
8059 Only in this latter mode
8060 .Ar HERE-delimiter
8061 may be given: if it is data will be read in until the given
8062 .Ar HERE-delimiter
8063 is seen on a line by itself, and encountering EOF is an error; the
8064 .Ar HERE-delimiter
8065 is a required argument in non-interactive mode; if it is single-quote
8066 quoted then the pasted content will not be expanded, \*(ID otherwise
8067 a future version of \*(UA may perform shell-style expansion on the content.
8070 .It Ic ~s Ar string
8071 Cause the named string to become the current subject field.
8072 Newline (NL) and carriage-return (CR) bytes are invalid and will be
8073 normalized to space (SP) characters.
8076 .It Ic ~t Ar name ...
8077 Add the given name(s) to the direct recipient list.
8080 .It Ic ~U Ar messages
8081 Read in the given / current message(s) excluding all headers, indented by
8082 .Va indentprefix .
8085 .It Ic ~u Ar messages
8086 Read in the given / current message(s), excluding all headers.
8089 .It Ic ~v
8090 Invoke the
8091 .Ev VISUAL
8092 editor on the message collected so far, then return to compose mode.
8093 .Ic ~e
8094 can be used for a less display oriented editor.
8097 .It Ic ~w Ar filename
8098 Write the message onto the named file, which is object to the usual
8099 .Sx "Filename transformations" .
8100 If the file exists,
8101 the message is appended to it.
8104 .It Ic ~x
8105 Same as
8106 .Ic ~q ,
8107 except that the message is not saved at all.
8110 .\" }}}
8113 .\" .Sh INTERNAL VARIABLES {{{
8114 .Sh "INTERNAL VARIABLES"
8116 Internal \*(UA variables are controlled via the
8117 .Ic set
8119 .Ic unset
8120 commands; prefixing a variable name with the string
8121 .Ql no
8122 and calling
8123 .Ic set
8124 has the same effect as using
8125 .Ic unset :
8126 .Ql unset crt
8128 .Ql set nocrt
8129 do the same thing.
8130 .Ic varshow
8131 will give more insight on the given variable(s), and
8132 .Ic set ,
8133 when called without arguments, will show a listing of all variables.
8134 Both commands support a more
8135 .Va verbose
8136 listing mode.
8137 Some well-known variables will also become inherited from the
8138 program
8139 .Sx ENVIRONMENT
8140 implicitly, others can be imported explicitly with the command
8141 .Ic environ
8142 and henceforth share said properties.
8145 Two different kinds of internal variables exist, and both of which can
8146 also form chains.
8147 There are boolean variables, which can only be in one of the two states
8148 .Dq set
8150 .Dq unset ,
8151 and value variables with a(n optional) string value.
8152 For the latter proper quoting is necessary upon assignment time, the
8153 introduction of the section
8154 .Sx COMMANDS
8155 documents the supported quoting rules.
8157 .Bd -literal -offset indent
8158 ? wysh set one=val\e 1 two="val 2" \e
8159     three='val "3"' four=$'val \e'4\e''; \e
8160     varshow one two three four; \e
8161     unset one two three four
8165 Dependent upon the actual option string values may become interpreted as
8166 colour names, command specifications, normal text, etc.
8167 They may be treated as numbers, in which case decimal values are
8168 expected if so documented, but otherwise any numeric format and
8169 base that is valid and understood by the
8170 .Ic vexpr
8171 command may be used, too.
8174 There also exists a special kind of string value, the
8175 .Dq boolean string ,
8176 which must either be a decimal integer (in which case
8177 .Ql 0
8178 is false and
8179 .Ql 1
8180 and any other value is true) or any of the (case-insensitive) strings
8181 .Ql off ,
8182 .Ql no ,
8183 .Ql n
8185 .Ql false
8186 for a false boolean and
8187 .Ql on ,
8188 .Ql yes ,
8189 .Ql y
8191 .Ql true
8192 for a true boolean; a special kind of boolean string is the
8193 .Dq quadoption ,
8194 which is a boolean string that can optionally be prefixed with the
8195 (case-insensitive) term
8196 .Ql ask- ,
8197 as in
8198 .Ql ask-yes ,
8199 which causes prompting of the user in interactive mode, with the given
8200 boolean as the default value.
8203 Variable chains extend a plain
8204 .Ql variable
8205 with
8206 .Ql variable-HOST
8208 .Ql variable-USER@HOST
8209 variants.
8210 Here
8211 .Ql HOST
8212 indeed means
8213 .Ql server:port
8214 if a
8215 .Ql port
8216 had been specified in the contextual Uniform Resource Locator URL, see
8217 .Sx "On URL syntax and credential lookup" .
8218 Even though this mechanism is based on URLs no URL percent encoding may
8219 be applied to neither of
8220 .Ql USER
8222 .Ql HOST ,
8223 variable chains need to be specified using raw data;
8224 the mentioned section contains examples.
8225 Variables which support chains are explicitly documented as such, and
8226 \*(UA treats the base name of any such variable special, meaning that
8227 users should not create custom names like
8228 .Ql variable-xyz
8229 in order to avoid false classifications and treatment of such variables.
8231 .\" .Ss "Initial settings" {{{
8232 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
8233 .Ss "Initial settings"
8235 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8236 variable settings:
8237 .Pf no Va allnet ,
8238 .Pf no Va append ,
8239 .Va asksub ,
8240 .Pf no Va askbcc ,
8241 .Pf no Va autoprint ,
8242 .Pf no Va bang ,
8243 .Pf no Va cmd ,
8244 .Pf no Va crt ,
8245 .Pf no Va debug ,
8246 .Pf no Va dot ,
8247 .Va escape
8248 set to
8249 .Ql ~ ,
8250 .Pf no Va flipr ,
8251 .Pf no Va folder ,
8252 .Va header ,
8253 .Pf no Va hold ,
8254 .Pf no Va ignore ,
8255 .Pf no Va ignoreeof ,
8256 .Pf no Va keep ,
8257 .Pf no Va keepsave ,
8258 .Pf no Va metoo ,
8259 .Pf no Va outfolder ,
8260 .Pf no Va page ,
8261 .Va prompt
8262 set to
8263 .Ql ?\0 ,
8264 .Pf no Va quiet ,
8265 .Pf no Va record ,
8266 .Va save ,
8267 .Pf no Va sendwait ,
8268 .Pf no Va showto ,
8269 .Pf no Va Sign ,
8270 .Pf no Va sign ,
8271 .Va toplines
8272 set to
8273 .Ql 5 .
8276 Notes: \*(UA does not support the
8277 .Pf no Va onehop
8278 variable \(en use command line options or
8279 .Va mta-arguments
8280 to pass options through to a
8281 .Va mta .
8282 And the default global
8283 .Pa \*(UR
8284 file, which is loaded unless the
8285 .Fl \&:
8286 (with according argument) or
8287 .Fl n
8288 command line options have been used, or the
8289 .Ev MAILX_NO_SYSTEM_RC
8290 environment variable is set (see
8291 .Sx "Resource files" )
8292 bends those initial settings a bit, e.g., it sets the variables
8293 .Va hold ,
8294 .Va keepsave
8296 .Va keep ,
8297 to name a few, establishes a default
8298 .Ic headerpick
8299 selection etc., and should thus be taken into account.
8300 .\" }}}
8302 .\" .Ss "Variables" {{{
8303 .Ss "Variables"
8305 .Bl -tag -width ".It Va BaNg"
8308 .It Va \&?
8309 \*(RO The exit status of the last command, or the
8310 .Ic return
8311 value of the macro
8312 .Ic call Ns
8313 ed last.
8314 This status has a meaning in the state machine: in conjunction with
8315 .Va errexit
8316 any non-0 exit status will cause a program exit, and in
8317 .Va posix
8318 mode any error while loading (any of the) resource files will have the
8319 same effect.
8320 .Cm ignerr ,
8321 one of the
8322 .Sx "Command modifiers" ,
8323 can be used to instruct the state machine to ignore errors.
8326 .It Va \&!
8327 \*(RO The current error number
8328 .Pf ( Xr errno 3 ) ,
8329 which is set after an error occurred; it is also available via
8330 .Va ^ERR ,
8331 and the error name and documentation string can be queried via
8332 .Va ^ERRNAME
8334 .Va ^ERRDOC .
8335 \*(ID This machinery is new and the error number is only really usable
8336 if a command explicitly states that it manages the variable
8337 .Va \&! ,
8338 for others errno will be used in case of errors, or
8339 .Va ^ERR Ns -INVAL
8340 if that is 0: it thus may or may not reflect the real error.
8341 The error number may be set with the command
8342 .Ic return .
8346 .It Va ^
8347 \*(RO This is a multiplexer variable which performs dynamic expansion of
8348 the requested state or condition, of which there are:
8351 .Bl -tag -compact -width ".It Va BaNg"
8355 .It Va ^ERR , ^ERRDOC , ^ERRNAME
8356 The number, documentation, and name of the current
8357 .Xr errno 3 ,
8358 respectively, which is usually set after an error occurred.
8359 The documentation is an \*(OP, the name is used if not available.
8360 \*(ID This machinery is new and is usually reliable only if a command
8361 explicitly states that it manages the variable
8362 .Va \&! ,
8363 which is effectively identical to
8364 .Va \&\&^ERR .
8365 Each of those variables can be suffixed with a hyphen minus followed by
8366 a name or number, in which case the expansion refers to the given error.
8367 Note this is a direct mapping of (a subset of) the system error values:
8368 .Bd -literal -offset indent
8369 define work {
8370   eval echo \e$1: \e$^ERR-$1:\e
8371     \e$^ERRNAME-$1: \e$^ERRDOC-$1
8372   vput vexpr i + "$1" 1
8373   if [ $i -lt 16 ]
8374     \excall work $i
8375   end
8377 call work 0
8383 .It Va *
8384 \*(RO Expands all positional parameters (see
8385 .Va 1 ) ,
8386 separated by the first character of the value of
8387 .Va ifs .
8388 \*(ID The special semantics of the equally named special parameter of the
8389 .Xr sh 1
8390 are not yet supported.
8393 .It Va @
8394 \*(RO Expands all positional parameters (see
8395 .Va 1 ) ,
8396 separated by a space character.
8397 If placed in double quotation marks, each positional parameter is
8398 properly quoted to expand to a single parameter again.
8401 .It Va #
8402 \*(RO Expands to the number of positional parameters, i.e., the size of
8403 the positional parameter stack in decimal.
8406 .It Va \&0
8407 \*(RO Inside the scope of a
8408 .Ic define Ns
8409 d and
8410 .Ic call Ns
8411 ed macro this expands to the name of the calling macro, or to the empty
8412 string if the macro is running from top-level.
8413 For the \*(OPal regular expression search and replace operator of
8414 .Ic vexpr
8415 this expands to the entire matching expression.
8416 It represents the program name in global context.
8419 .It Va 1
8420 \*(RO Access of the positional parameter stack.
8421 All further parameters can be accessed with this syntax, too, e.g.,
8422 .Ql 2 ,
8423 .Ql 3
8424 etc.; positional parameters can be shifted off the stack by calling
8425 .Ic shift .
8426 The parameter stack contains, e.g., the arguments of a
8427 .Ic call Ns
8429 .Ic define Ns
8430 d macro, the matching groups of the \*(OPal regular expression search
8431 and replace expression of
8432 .Ic vexpr ,
8433 and can be explicitly created or overwritten with the command
8434 .Ic vpospar .
8437 .It Va account
8438 \*(RO Is set to the active
8439 .Ic account .
8442 .It Va add-file-recipients
8443 \*(BO When file or pipe recipients have been specified,
8444 mention them in the corresponding address fields of the message instead
8445 of silently stripping them from their recipient list.
8446 By default such addressees are not mentioned.
8449 .It Va allnet
8450 \*(BO Causes only the local part to be evaluated
8451 when comparing addresses.
8454 .It Va append
8455 \*(BO Causes messages saved in the
8456 .Mx -sx
8457 .Sx "secondary mailbox"
8458 .Ev MBOX
8459 to be appended to the end rather than prepended.
8460 This should always be set.
8463 .It Va askatend
8464 \*(BO Causes the prompts for
8465 .Ql Cc:
8467 .Ql Bcc:
8468 lists to appear after the message has been edited.
8471 .It Va askattach
8472 \*(BO If set, \*(UA asks for files to attach at the end of each message.
8473 An empty line finalizes the list.
8476 .It Va askcc
8477 \*(BO Causes the user to be prompted for carbon copy recipients
8478 (at the end of each message if
8479 .Va askatend
8481 .Va bsdcompat
8482 are set).
8485 .It Va askbcc
8486 \*(BO Causes the user to be prompted for blind carbon copy
8487 recipients (at the end of each message if
8488 .Va askatend
8490 .Va bsdcompat
8491 are set).
8494 .It Va asksend
8495 \*(BO Causes the user to be prompted for confirmation to send the
8496 message or reenter compose mode after having been shown an envelope
8497 summary.
8498 This is by default enabled.
8501 .It Va asksign
8502 \*(BO\*(OP Causes the user to be prompted if the message is to be
8503 signed at the end of each message.
8505 .Va smime-sign
8506 variable is ignored when this variable is set.
8509 .It Va asksub
8510 .\" The alternative *ask* is not documented on purpose
8511 \*(BO Causes \*(UA to prompt for the subject upon entering compose mode
8512 unless a subject already exists.
8515 .It Va attrlist
8516 A sequence of characters to display in the
8517 .Ql attribute
8518 column of the
8519 .Va headline
8520 as shown in the display of
8521 .Ic headers ;
8522 each for one type of messages (see
8523 .Sx "Message states" ) ,
8524 with the default being
8525 .Ql NUROSPMFAT+\-$~
8527 .Ql NU\ \ *HMFAT+\-$~
8528 if the
8529 .Va bsdflags
8530 variable is set, in the following order:
8532 .Bl -tag -compact -width ".It Ql _"
8533 .It Ql N
8534 new.
8535 .It Ql U
8536 unread but old.
8537 .It Ql R
8538 new but read.
8539 .It Ql O
8540 read and old.
8541 .It Ql S
8542 saved.
8543 .It Ql P
8544 preserved.
8545 .It Ql M
8546 mboxed.
8547 .It Ql F
8548 flagged.
8549 .It Ql A
8550 answered.
8551 .It Ql T
8552 draft.
8553 .It Ql +
8554 start of a collapsed thread.
8555 .It Ql -
8556 an uncollapsed thread (TODO ignored for now).
8557 .It Ql $
8558 classified as spam.
8559 .It Ql ~
8560 classified as possible spam.
8565 .It Va autobcc
8566 Specifies a list of recipients to which a blind carbon copy of each
8567 outgoing message will be sent automatically.
8570 .It Va autocc
8571 Specifies a list of recipients to which a carbon copy of each outgoing
8572 message will be sent automatically.
8575 .It Va autocollapse
8576 \*(BO Causes threads to be collapsed automatically when .Ql thread Ns
8578 .Ic sort
8579 mode is entered (see the
8580 .Ic collapse
8581 command).
8584 .It Va autoprint
8585 \*(BO Enable automatic
8586 .Ic type Ns
8587 ing of a(n existing)
8588 .Dq successive
8589 message after
8590 .Ic delete
8592 .Ic undelete
8593 commands, e.g., the message that becomes the new
8594 .Dq dot
8595 is shown automatically, as via
8596 .Ic dp
8598 .Ic dt .
8601 .It Va autosort
8602 Causes sorted mode (see the
8603 .Ic sort
8604 command) to be entered automatically with the value of this variable as
8605 sorting method when a folder is opened, e.g.,
8606 .Ql set autosort=thread .
8609 .It Va bang
8610 \*(BO Enables the substitution of all not (reverse-solidus) escaped
8611 exclamation mark
8612 .Ql \&!
8613 characters by the contents of the last executed command for the
8614 .Ic \&!
8615 shell escape command and
8616 .Ic ~! ,
8617 one of the compose mode
8618 .Sx "COMMAND ESCAPES" .
8619 If this variable is not set no reverse solidus stripping is performed.
8622 .It Va bind-timeout
8623 \*(OP Terminals generate multi-byte sequences for certain forms of
8624 input, for example for function and other special keys.
8625 Some terminals however do not write these multi-byte sequences as
8626 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
8627 This variable specifies the timeout in milliseconds that the MLE (see
8628 .Sx "On terminal control and line editor" )
8629 waits for more bytes to arrive unless it considers a sequence
8630 .Dq complete .
8631 The default is 200.
8634 .It Va bsdcompat
8635 \*(BO Sets some cosmetical features to traditional BSD style;
8636 has the same affect as setting
8637 .Va askatend
8638 and all other variables prefixed with
8639 .Ql bsd ;
8640 it also changes the behaviour of
8641 .Va emptystart
8642 (which does not exist in BSD).
8645 .It Va bsdflags
8646 \*(BO Changes the letters shown in the first column of a header
8647 summary to traditional BSD style.
8650 .It Va bsdheadline
8651 \*(BO Changes the display of columns in a header summary to traditional
8652 BSD style.
8655 .It Va bsdmsgs
8656 \*(BO Changes some informational messages to traditional BSD style.
8659 .It Va bsdorder
8660 \*(BO Causes the
8661 .Ql Subject:
8662 field to appear immediately after the
8663 .Ql To:
8664 field in message headers and with the
8665 .Ic ~h
8666 .Sx "COMMAND ESCAPES" .
8672 .It Va build-cc , build-ld , build-os , build-rest
8673 \*(RO The build environment, including the compiler, the linker, the
8674 operating system \*(UA has been build for, usually taken from
8675 .Xr uname 1
8677 .Ql uname -s ,
8678 and then lowercased, as well as all the rest that may possibly be useful
8679 to include in a bug report, respectively.
8682 .It Va charset-7bit
8683 The value that should appear in the
8684 .Ql charset=
8685 parameter of
8686 .Ql Content-Type:
8687 MIME header fields when no character set conversion of the message data
8688 was performed.
8689 This defaults to US-ASCII, and the chosen character set should be
8690 US-ASCII compatible.
8693 .It Va charset-8bit
8694 \*(OP The default 8-bit character set that is used as an implicit last
8695 member of the variable
8696 .Va sendcharsets .
8697 This defaults to UTF-8 if character set conversion capabilities are
8698 available, and to ISO-8859-1 otherwise (unless the operating system
8699 environment is known to always and exclusively support UTF-8 locales),
8700 in which case the only supported character set is
8701 .Va ttycharset
8702 and this variable is effectively ignored.
8703 Refer to the section
8704 .Sx "Character sets"
8705 for the complete picture of character set conversion in \*(UA.
8708 .It Va charset-unknown-8bit
8709 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
8710 .Dq upgrade
8711 the content of a mail message by using a character set with the name
8712 .Ql unknown-8bit .
8713 Because of the unclassified nature of this character set \*(UA will not
8714 be capable to convert this character set to any other character set.
8715 If this variable is set any message part which uses the character set
8716 .Ql unknown-8bit
8717 is assumed to really be in the character set given in the value,
8718 otherwise the (final) value of
8719 .Va charset-8bit
8720 is used for this purpose.
8722 This variable will also be taken into account if a MIME type (see
8723 .Sx "The mime.types files" )
8724 of a MIME message part that uses the
8725 .Ql binary
8726 character set is forcefully treated as text.
8729 .It Va cmd
8730 The default value for the
8731 .Ic pipe
8732 command.
8735 .It Va colour-disable
8736 \*(BO\*(OP Forcefully disable usage of colours.
8737 Also see the section
8738 .Sx "Coloured display" .
8741 .It Va colour-pager
8742 \*(BO\*(OP Whether colour shall be used for output that is paged through
8743 .Ev PAGER .
8744 Note that pagers may need special command line options, e.g.,
8745 .Xr less 1
8746 requires the option
8747 .Fl \&\&R
8749 .Xr lv 1
8750 the option
8751 .Fl \&\&c
8752 in order to support colours.
8753 Often doing manual adjustments is unnecessary since \*(UA may perform
8754 adjustments dependent on the value of the environment variable
8755 .Ev PAGER
8756 (see there for more).
8760 .It Va contact-mail , contact-web
8761 \*(RO Addresses for contact per email and web, respectively, e.g., for
8762 bug reports, suggestions, or help regarding \*(UA.
8763 The former can be used directly:
8764 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
8767 .It Va crt
8768 In a(n interactive) terminal session, then if this valued variable is
8769 set it will be used as a threshold to determine how many lines the given
8770 output has to span before it will be displayed via the configured
8771 .Ev PAGER ;
8772 Usage of the
8773 .Ev PAGER
8774 can be forced by setting this to the value
8775 .Ql 0 ,
8776 setting it without a value will deduce the current height of the
8777 terminal screen to compute the threshold (see
8778 .Ev LINES ,
8779 .Va screen
8781 .Xr stty 1 ) .
8782 \*(ID At the moment this uses the count of lines of the message in wire
8783 format, which, dependent on the
8784 .Va mime-encoding
8785 of the message, is unrelated to the number of display lines.
8786 (The software is old and historically the relation was a given thing.)
8789 .It Va customhdr
8790 Define a set of custom headers to be injected into newly composed or
8791 forwarded messages.
8792 A custom header consists of the field name followed by a colon
8793 .Ql \&:
8794 and the field content body.
8795 Standard header field names cannot be overwritten by a custom header.
8796 Different to the command line option
8797 .Fl C
8798 the variable value is interpreted as a comma-separated list of custom
8799 headers: to include commas in header bodies they need to become escaped
8800 with reverse solidus
8801 .Ql \e .
8802 Headers can be managed more freely in compose mode via
8803 .Ic ~^ .
8805 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
8808 .It Va datefield
8809 Controls the appearance of the
8810 .Ql %d
8811 date and time format specification of the
8812 .Va headline
8813 variable, that is used, for example, when viewing the summary of
8814 .Ic headers .
8815 If unset, then the local receiving date is used and displayed
8816 unformatted, otherwise the message sending
8817 .Ql Date: .
8818 It is possible to assign a
8819 .Xr strftime 3
8820 format string and control formatting, but embedding newlines via the
8821 .Ql %n
8822 format is not supported, and will result in display errors.
8823 The default is
8824 .Ql %Y-%m-%d %H:%M ,
8825 and also see
8826 .Va datefield-markout-older .
8829 .It Va datefield-markout-older
8830 Only used in conjunction with
8831 .Va datefield .
8832 Can be used to create a visible distinction of messages dated more than
8833 a day in the future, or older than six months, a concept comparable to the
8834 .Fl \&\&l
8835 option of the POSIX utility
8836 .Xr ls 1 .
8837 If set to the empty string, then the plain month, day and year of the
8838 .Ql Date:
8839 will be displayed, but a
8840 .Xr strftime 3
8841 format string to control formatting can be assigned.
8842 The default is
8843 .Ql %Y-%m-%d .
8846 .It Va debug
8847 \*(BO Enables debug messages and obsoletion warnings, disables the
8848 actual delivery of messages and also implies
8849 .Pf no Va record
8850 as well as
8851 .Pf no Va save .
8854 .It Va disposition-notification-send
8855 \*(BO\*(OP Emit a
8856 .Ql Disposition-Notification-To:
8857 header (RFC 3798) with the message.
8858 This requires the
8859 .Va from
8860 variable to be set.
8861 .\" TODO .It Va disposition-notification-send-HOST
8862 .\"Overrides
8863 .\".Va disposition-notification-send
8864 .\" for SMTP accounts on a specific host.
8865 .\" TODO .It Va disposition-notification-send-USER@HOST
8866 .\"Overrides
8867 .\".Va disposition-notification-send
8868 .\"for a specific account.
8871 .It Va dot
8872 \*(BO When dot is set, a period
8873 .Ql \&.
8874 on a line by itself during message input in (interactive or batch
8875 .Fl # )
8876 compose mode will be treated as end-of-message (in addition to the
8877 normal end-of-file condition).
8878 This behaviour is implied in
8879 .Va posix
8880 mode with a set
8881 .Va ignoreeof .
8884 .It Va dotlock-disable
8885 \*(BO\*(OP Disable creation of
8886 .Mx -sx
8887 .Sx "dotlock files"
8888 for MBOX databases.
8890 .It Va dotlock-ignore-error
8891 \*(OB\*(BO\*(OP Ignore failures when creating
8892 .Mx -sx
8893 .Sx "dotlock files" .
8894 Please use
8895 .Va dotlock-disable
8896 instead.
8899 .It Va editalong
8900 If this variable is set then the editor is started automatically when
8901 a message is composed in interactive mode.
8902 If the value starts with the letter
8903 .Ql v
8904 then this acts as if
8905 .Ic ~v ,
8906 otherwise as if
8907 .Ic ~e
8908 .Pf (see\0 Sx "COMMAND ESCAPES" )
8909 had been specified.
8911 .Va editheaders
8912 variable is implied for this automatically spawned editor session.
8915 .It Va editheaders
8916 \*(BO When a message is edited while being composed,
8917 its header is included in the editable text.
8920 .It Va emptystart
8921 \*(BO When entering interactive mode \*(UA normally writes
8922 .Dq \&No mail for user
8923 and exits immediately if a mailbox is empty or does not exist.
8924 If this variable is set \*(UA starts even with an empty or non-existent
8925 mailbox (the latter behaviour furtherly depends upon
8926 .Va bsdcompat ,
8927 though).
8930 .It Va errexit
8931 \*(BO Let each command with a non-0 exit status, including every
8932 .Ic call Ns
8933 ed macro which
8934 .Ic return Ns
8935 s a non-0 status, cause a program exit unless prefixed by
8936 .Cm ignerr
8937 (see
8938 .Sx "Command modifiers" ) .
8939 This also affects
8940 .Sx "COMMAND ESCAPES" ,
8941 but which use a different modifier for ignoring the error.
8942 Please refer to the variable
8943 .Va \&?
8944 for more on this topic.
8947 .It Va escape
8948 The first character of this value defines the escape character for
8949 .Sx "COMMAND ESCAPES"
8950 in compose mode.
8951 The default value is the character tilde
8952 .Ql ~ .
8953 If set to the empty string, command escapes are disabled.
8956 .It Va expandaddr
8957 If not set then file and command pipeline targets are not allowed,
8958 and any such address will be filtered out, giving a warning message.
8959 If set without a value then all possible recipient address
8960 specifications will be accepted \(en see the section
8961 .Sx "On sending mail, and non-interactive mode"
8962 for more on this.
8963 To accept them, but only in interactive mode, or when tilde commands
8964 were enabled explicitly by using one of the command line options
8965 .Fl ~
8967 .Fl # ,
8968 set this to the (case-insensitive) value
8969 .Ql restrict
8970 (it actually acts like
8971 .Ql restrict,-all,+name,+addr ,
8972 so that care for ordering issues must be taken) .
8974 In fact the value is interpreted as a comma-separated list of values.
8975 If it contains
8976 .Ql fail
8977 then the existence of disallowed specifications is treated as a hard
8978 send error instead of only filtering them out.
8979 The remaining values specify whether a specific type of recipient
8980 address specification is allowed (optionally indicated by a plus sign
8981 .Ql +
8982 prefix) or disallowed (prefixed with a hyphen-minus
8983 .Ql - ) .
8984 The value
8985 .Ql all
8986 addresses all possible address specifications,
8987 .Ql file
8988 file targets,
8989 .Ql pipe
8990 command pipeline targets,
8991 .Ql name
8992 plain user names and (MTA) aliases and
8993 .Ql addr
8994 network addresses.
8995 These kind of values are interpreted in the given order, so that
8996 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
8997 will cause hard errors for any non-network address recipient address
8998 unless \*(UA is in interactive mode or has been started with the
8999 .Fl ~
9001 .Fl #
9002 command line option; in the latter case(s) any address may be used, then.
9004 Historically invalid network addressees are silently stripped off.
9005 To change this so that any encountered invalid email address causes
9006 a hard error it must be ensured that
9007 .Ql failinvaddr
9008 is an entry in the above list.
9009 Setting this automatically enables network addressees
9010 (it actually acts like
9011 .Ql failinvaddr,+addr ,
9012 so that care for ordering issues must be taken) .
9015 .It Va expandargv
9016 Unless this variable is set additional
9017 .Va mta
9018 (Mail-Transfer-Agent)
9019 arguments from the command line, as can be given after a
9020 .Fl \&\&-
9021 separator, results in a program termination with failure status.
9022 The same can be accomplished by using the special (case-insensitive) value
9023 .Ql fail .
9024 A lesser strict variant is the otherwise identical
9025 .Ql restrict ,
9026 which does accept such arguments in interactive mode, or if tilde
9027 commands were enabled explicitly by using one of the command line options
9028 .Fl ~
9030 .Fl # .
9031 The empty value will allow unconditional usage.
9034 .It Va features
9035 \*(RO String giving a list of optional features.
9036 Features are preceded with a plus sign
9037 .Ql +
9038 if they are available, with a hyphen-minus
9039 .Ql -
9040 otherwise.
9041 The output of the command
9042 .Ic version
9043 will include this information in a more pleasant output.
9046 .It Va flipr
9047 \*(BO This setting reverses the meanings of a set of reply commands,
9048 turning the lowercase variants, which by default address all recipients
9049 included in the header of a message
9050 .Pf ( Ic reply , respond , followup )
9051 into the uppercase variants, which by default address the sender only
9052 .Pf ( Ic Reply , Respond , Followup )
9053 and vice versa.
9054 The commands
9055 .Ic replysender , respondsender , followupsender
9056 as well as
9057 .Ic replyall , respondall , followupall
9058 are not affected by the current setting of
9059 .Va flipr .
9062 .It Va folder
9063 The default path under which mailboxes are to be saved:
9064 filenames that begin with the plus sign
9065 .Ql +
9066 will have the plus sign replaced with the value of this variable if set,
9067 otherwise the plus sign will remain unchanged when doing
9068 .Sx "Filename transformations" ;
9069 also see
9070 .Ic file
9071 for more on this topic.
9072 The value supports a subset of transformations itself, and if the
9073 non-empty value does not start with a solidus
9074 .Ql / ,
9075 then the value of
9076 .Ev HOME
9077 will be prefixed automatically.
9078 Once the actual value is evaluated first, the internal variable
9079 .Va folder-resolved
9080 will be updated for caching purposes.
9082 .Mx Va folder-hook
9083 .It Va folder-hook-FOLDER , Va folder-hook
9084 Names a
9085 .Ic define Ns d
9086 macro which will be called whenever a
9087 .Ic file
9088 is opened.
9089 The macro will also be invoked when new mail arrives,
9090 but message lists for commands executed from the macro
9091 only include newly arrived messages then.
9092 .Ic localopts
9093 are activated by default in a folder hook, causing the covered settings
9094 to be reverted once the folder is left again.
9096 The specialized form will override the generic one if
9097 .Ql FOLDER
9098 matches the file that is opened.
9099 Unlike other folder specifications, the fully expanded name of a folder,
9100 without metacharacters, is used to avoid ambiguities.
9101 However, if the mailbox resides under
9102 .Va folder
9103 then the usual
9104 .Ql +
9105 specification is tried in addition, e.g., if
9106 .Va \&\&folder
9108 .Dq mail
9109 (and thus relative to the user's home directory) then
9110 .Pa /home/usr1/mail/sent
9111 will be tried as
9112 .Ql folder-hook-/home/usr1/mail/sent
9113 first, but then followed by
9114 .Ql folder-hook-+sent .
9117 .It Va folder-resolved
9118 \*(RO Set to the fully resolved path of
9119 .Va folder
9120 once that evaluation has occurred; rather internal.
9123 .It Va followup-to
9124 \*(BO Controls whether a
9125 .Ql Mail-Followup-To:
9126 header is generated when sending messages to known mailing lists.
9127 Also see
9128 .Va followup-to-honour
9129 and the commands
9130 .Ic mlist , mlsubscribe , reply
9132 .Ic Lreply .
9135 .It Va followup-to-honour
9136 Controls whether a
9137 .Ql Mail-Followup-To:
9138 header is honoured when group-replying to a message via
9139 .Ic reply
9141 .Ic Lreply .
9142 This is a quadoption; if set without a value it defaults to
9143 .Dq yes .
9144 Also see
9145 .Va followup-to
9146 and the commands
9147 .Ic mlist
9149 .Ic mlsubscribe .
9152 .It Va forward-as-attachment
9153 \*(BO Original messages are normally sent as inline text with the
9154 .Ic forward
9155 command,
9156 and only the first part of a multipart message is included.
9157 With this setting enabled messages are sent as unmodified MIME
9158 .Ql message/rfc822
9159 attachments with all of their parts included.
9163 .It Va forward-inject-head , forward-inject-tail
9164 The strings to put before and after the text of a message with the
9165 .Ic forward
9166 command, respectively.
9167 The former defaults to
9168 .Ql -------- Original Message --------\en .
9169 Special format directives in these strings will be expanded if possible,
9170 and if so configured the output will be folded according to
9171 .Va quote-fold ;
9172 for more please refer to
9173 .Va quote-inject-head .
9174 These variables are ignored if the
9175 .Va forward-as-attachment
9176 variable is set.
9180 .It Va from
9181 The address (or a list of addresses) to put into the
9182 .Ql From:
9183 field of the message header, quoting RFC 5322:
9184 the author(s) of the message, that is, the mailbox(es) of the person(s)
9185 or system(s) responsible for the writing of the message.
9186 According to that RFC setting the
9187 .Va sender
9188 variable is required if
9189 .Va \&\&from
9190 contains more than one address.
9191 Dependent on the context these addresses are handled as if they were in
9192 the list of
9193 .Ic alternates .
9196 If a file-based MTA is used, then
9197 .Va \&\&from
9198 (or, if that contains multiple addresses,
9199 .Va sender )
9200 can nonetheless be enforced to appear as the envelope sender address at
9201 the MTA protocol level (the RFC 5321 reverse-path), either by using the
9202 .Fl r
9203 command line option (with an empty argument; see there for the complete
9204 picture on this topic), or by setting the internal variable
9205 .Va r-option-implicit .
9208 If the machine's hostname is not valid at the Internet (for example at
9209 a dialup machine) then either this variable or
9210 .Va hostname
9211 (\*(IN a SMTP-based
9212 .Va mta
9213 adds even more fine-tuning capabilities with
9214 .Va smtp-hostname )
9215 have to be set: if so the message and MIME part related unique ID fields
9216 .Ql Message-ID:
9218 .Ql Content-ID:
9219 will be created (except when disallowed by
9220 .Va message-id-disable
9222 .Va stealthmua ) .
9226 .It Va fullnames
9227 \*(BO Due to historical reasons comments and name parts of email
9228 addresses are removed by default when sending mail, replying to or
9229 forwarding a message.
9230 If this variable is set such stripping is not performed.
9232 .It Va fwdheading
9233 \*(OB Predecessor of
9234 .Va forward-inject-head .
9237 .It Va header
9238 \*(BO Causes the header summary to be written at startup and after
9239 commands that affect the number of messages or the order of messages in
9240 the current
9241 .Ic folder .
9242 Unless in
9243 .Va posix
9244 mode a header summary will also be displayed on folder changes.
9245 The command line option
9246 .Fl N
9247 can be used to set
9248 .Pf no Va header .
9252 .It Va headline
9253 A format string to use for the summary of
9254 .Ic headers .
9255 Format specifiers in the given string start with a percent sign
9256 .Ql %
9257 and may be followed by an optional decimal number indicating the field
9258 width \(em if that is negative, the field is to be left-aligned.
9259 Names and addresses are subject to modifications according to
9260 .Va showname
9262 .Va showto .
9263 Valid format specifiers are:
9266 .Bl -tag -compact -width ".It Ql _%%_"
9267 .It Ql %%
9268 A plain percent sign.
9269 .It Ql %>
9270 .Dq Dotmark :
9271 a space character but for the current message
9272 .Pf ( Dq dot ) ,
9273 for which it expands to
9274 .Ql >
9275 (dependent on
9276 .Va headline-plain ) .
9277 .It Ql %<
9278 .Dq Dotmark :
9279 a space character but for the current message
9280 .Pf ( Dq dot ) ,
9281 for which it expands to
9282 .Ql <
9283 (dependent on
9284 .Va headline-plain ) .
9285 .It Ql %$
9286 \*(OP The spam score of the message, as has been classified via the
9287 command
9288 .Ic spamrate .
9289 Shows only a replacement character if there is no spam support.
9290 .It Ql %a
9291 Message attribute character (status flag); the actual content can be
9292 adjusted by setting
9293 .Va attrlist .
9294 .It Ql %d
9295 The date found in the
9296 .Ql Date:
9297 header of the message when
9298 .Va datefield
9299 is set (the default), otherwise the date when the message was received.
9300 Formatting can be controlled by assigning a
9301 .Xr strftime 3
9302 format string to
9303 .Va datefield
9304 (and
9305 .Va datefield-markout-older ) .
9306 .It Ql %e
9307 The indenting level in
9308 .Ql thread Ns
9310 .Ic sort
9311 mode.
9312 .It Ql %f
9313 The address of the message sender.
9314 .It Ql %i
9315 The message thread tree structure.
9316 (Note that this format does not support a field width, and honours
9317 .Va headline-plain . )
9318 .It Ql %l
9319 The number of lines of the message, if available.
9320 .It Ql %m
9321 Message number.
9322 .It Ql %o
9323 The number of octets (bytes) in the message, if available.
9324 .It Ql %s
9325 Message subject (if any).
9326 .It Ql %S
9327 Message subject (if any) in double quotes.
9328 .It Ql \&%T
9329 Message recipient flags: is the addressee of the message a known or
9330 subscribed mailing list \(en see
9331 .Ic mlist
9333 .Ic mlsubscribe .
9334 .It Ql %t
9335 The position in threaded/sorted order.
9336 .It Ql \%U
9337 The value 0 except in an IMAP mailbox,
9338 where it expands to the UID of the message.
9341 The default is
9342 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
9344 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
9346 .Va bsdcompat
9347 is set.
9348 Also see
9349 .Va attrlist ,
9350 .Va headline-plain
9352 .Va headline-bidi .
9356 .It Va headline-bidi
9357 Bidirectional text requires special treatment when displaying headers,
9358 because numbers (in dates or for file sizes etc.) will not affect the
9359 current text direction, in effect resulting in ugly line layouts when
9360 arabic or other right-to-left text is to be displayed.
9361 On the other hand only a minority of terminals is capable to correctly
9362 handle direction changes, so that user interaction is necessary for
9363 acceptable results.
9364 Note that extended host system support is required nonetheless, e.g.,
9365 detection of the terminal character set is one precondition;
9366 and this feature only works in an Unicode (i.e., UTF-8) locale.
9368 In general setting this variable will cause \*(UA to encapsulate text
9369 fields that may occur when displaying
9370 .Va headline
9371 (and some other fields, like dynamic expansions in
9372 .Va prompt )
9373 with special Unicode control sequences;
9374 it is possible to fine-tune the terminal support level by assigning
9375 a value:
9376 no value (or any value other than
9377 .Ql 1 ,
9378 .Ql 2
9380 .Ql 3 )
9381 will make \*(UA assume that the terminal is capable to properly deal
9382 with Unicode version 6.3, in which case text is embedded in a pair of
9383 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
9384 characters.
9385 In addition no space on the line is reserved for these characters.
9387 Weaker support is chosen by using the value
9388 .Ql 1
9389 (Unicode 6.3, but reserve the room of two spaces for writing the control
9390 sequences onto the line).
9391 The values
9392 .Ql 2
9394 .Ql 3
9395 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
9396 again reserves room for two spaces in addition.
9399 .It Va headline-plain
9400 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
9401 used by default for certain entries of
9402 .Va headline .
9403 If this variable is set only basic US-ASCII symbols will be used.
9406 .It Va history-file
9407 \*(OP If a line editor is available then this can be set to
9408 name the (expandable) path of the location of a permanent
9409 .Ic history
9410 file; also see
9411 .Va history-size .
9414 .It Va history-gabby
9415 \*(BO\*(OP Add more entries to the
9416 .Ic history
9417 as is normally done.
9420 .It Va history-gabby-persist
9421 \*(BO\*(OP \*(UA's own MLE will not save the additional
9422 .Va history-gabby
9423 entries in persistent storage unless this variable is set.
9424 On the other hand it will not loose the knowledge of whether
9425 a persistent entry was gabby or not.
9426 Also see
9427 .Va history-file .
9430 .It Va history-size
9431 \*(OP Setting this variable imposes a limit on the number of concurrent
9432 .Ic history
9433 entries.
9434 If set to the value 0 then no further history entries will be added,
9435 and loading and incorporation of the
9436 .Va history-file
9437 upon program startup can also be suppressed by doing this.
9438 Runtime changes will not be reflected, but will affect the number of
9439 entries saved to permanent storage.
9442 .It Va hold
9443 \*(BO This setting controls whether messages are held in the system
9444 .Va inbox ,
9445 and it is set by default.
9448 .It Va hostname
9449 Used instead of the value obtained from
9450 .Xr uname 3
9452 .Xr getaddrinfo 3
9453 as the hostname when expanding local addresses, e.g., in
9454 .Ql From:
9455 (also see
9456 .Sx "On sending mail, and non-interactive mode" ,
9457 especially for expansion of network addresses that contain domain-less
9458 valid user names in angle brackets).
9459 If either of
9460 .Va from
9461 or this variable Is set the message and MIME part related unique ID fields
9462 .Ql Message-ID:
9464 .Ql Content-ID:
9465 will be created (except when disallowed by
9466 .Va message-id-disable
9468 .Va stealthmua ) .
9469 If the \*(OPal IDNA support is available (see
9470 .Va idna-disable )
9471 variable assignment is aborted when a necessary conversion fails.
9473 Setting it to the empty string will cause the normal hostname to be
9474 used, but nonetheless enables creation of said ID fields.
9475 \*(IN in conjunction with the built-in SMTP
9476 .Va mta
9477 .Va smtp-hostname
9478 also influences the results:
9479 one should produce some test messages with the desired combination of
9480 .Va \&\&hostname ,
9481 and/or
9482 .Va from ,
9483 .Va sender
9484 etc. first.
9487 .It Va idna-disable
9488 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
9489 names according to the rules of IDNA (internationalized domain names
9490 for applications).
9491 Since the IDNA code assumes that domain names are specified with the
9492 .Va ttycharset
9493 character set, an UTF-8 locale charset is required to represent all
9494 possible international domain names (before conversion, that is).
9497 .It Va ifs
9498 The input field separator that is used (\*(ID by some functions) to
9499 determine where to split input data.
9501 .Bl -tag -compact -width ".It MMM"
9502 .It 1.
9503 Unsetting is treated as assigning the default value,
9504 .Ql \& \et\en .
9505 .It 2.
9506 If set to the empty value, no field splitting will be performed.
9507 .It 3.
9508 If set to a non-empty value, all whitespace characters are extracted
9509 and assigned to the variable
9510 .Va ifs-ws .
9513 .Bl -tag -compact -width ".It MMM"
9514 .It a.
9515 .Va \&\&ifs-ws
9516 will be ignored at the beginning and end of input.
9517 Diverging from POSIX shells default whitespace is removed in addition,
9518 which is owed to the entirely different line content extraction rules.
9519 .It b.
9520 Each occurrence of a character of
9521 .Va \&\&ifs
9522 will cause field-splitting, any adjacent
9523 .Va \&\&ifs-ws
9524 characters will be skipped.
9528 .It Va ifs-ws
9529 \*(RO Automatically deduced from the whitespace characters in
9530 .Va ifs .
9533 .It Va ignore
9534 \*(BO Ignore interrupt signals from the terminal while entering
9535 messages; instead echo them as
9536 .Ql @
9537 characters and discard the current line.
9540 .It Va ignoreeof
9541 \*(BO Ignore end-of-file conditions
9542 .Pf ( Ql control-D )
9543 in compose mode on message input and in interactive command input.
9544 If set an interactive command input session can only be left by
9545 explicitly using one of the commands
9546 .Ic exit
9548 .Ic quit ,
9549 and message input in compose mode can only be terminated by entering
9550 a period
9551 .Ql \&.
9552 on a line by itself or by using the
9553 .Ic ~.
9554 .Sx "COMMAND ESCAPES" ;
9555 Setting this implies the behaviour that
9556 .Va dot
9557 describes in
9558 .Va posix
9559 mode.
9562 .It Va inbox
9563 If this is set to a non-empty string it will specify the user's
9564 .Mx -sx
9565 .Sx "primary system mailbox" ,
9566 overriding
9567 .Ev MAIL
9568 and the system-dependent default, and (thus) be used to replace
9569 .Ql %
9570 when doing
9571 .Sx "Filename transformations" ;
9572 also see
9573 .Ic file
9574 for more on this topic.
9575 The value supports a subset of transformations itself.
9578 .It Va indentprefix
9579 String used by the
9580 .Ic ~m , ~M
9582 .Ic ~R
9583 .Sx "COMMAND ESCAPES"
9584 and by the
9585 .Va quote
9586 option for indenting messages,
9587 in place of the POSIX mandated default tabulator character
9588 .Ql \et .
9589 Also see
9590 .Va quote-chars .
9593 .It Va keep
9594 \*(BO If set, an empty
9595 .Mx -sx
9596 .Sx "primary system mailbox"
9597 file is not removed.
9598 Note that, in conjunction with
9599 .Va posix
9600 mode any empty file will be removed unless this variable is set.
9601 This may improve the interoperability with other mail user agents
9602 when using a common folder directory, and prevents malicious users
9603 from creating fake mailboxes in a world-writable spool directory.
9604 \*(ID Only local regular (MBOX) files are covered, Maildir and other
9605 mailbox types will never be removed, even if empty.
9608 .It Va keep-content-length
9609 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
9610 be told to keep the
9611 .Ql Content-Length:
9613 .Ql Lines:
9614 header fields that some MUAs generate by setting this variable.
9615 Since \*(UA does neither use nor update these non-standardized header
9616 fields (which in itself shows one of their conceptual problems),
9617 stripping them should increase interoperability in between MUAs that
9618 work with with same mailbox files.
9619 Note that, if this is not set but
9620 .Va writebackedited ,
9621 as below, is, a possibly performed automatic stripping of these header
9622 fields already marks the message as being modified.
9623 \*(ID At some future time \*(UA will be capable to rewrite and apply an
9624 .Va mime-encoding
9625 to modified messages, and then those fields will be stripped silently.
9628 .It Va keepsave
9629 \*(BO When a message is saved it is usually discarded from the
9630 originating folder when \*(UA is quit.
9631 This setting causes all saved message to be retained.
9634 .It Va line-editor-disable
9635 \*(BO Turn off any enhanced line editing capabilities (see
9636 .Sx "On terminal control and line editor"
9637 for more).
9640 .It Va line-editor-no-defaults
9641 \*(BO\*(OP Do not establish any default key binding.
9644 .It Va log-prefix
9645 Error log message prefix string
9646 .Pf ( Ql "\*(uA: " ) .
9649 .It Va mailbox-display
9650 \*(RO The name of the current mailbox
9651 .Pf ( Ic file ) ,
9652 possibly abbreviated for display purposes.
9655 .It Va mailbox-resolved
9656 \*(RO The fully resolved path of the current mailbox.
9659 .It Va mailx-extra-rc
9660 An additional startup file that is loaded as the last of the
9661 .Sx "Resource files" .
9662 Use this file for commands that are not understood by other POSIX
9663 .Xr mailx 1
9664 implementations, i.e., mostly anything which is not covered by
9665 .Sx "Initial settings" .
9668 .It Va markanswered
9669 \*(BO When a message is replied to and this variable is set,
9670 it is marked as having been
9671 .Ic answered .
9672 See the section
9673 .Sx "Message states" .
9676 .It Va mbox-rfc4155
9677 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
9678 POSIX rules for detecting message boundaries (so-called
9679 .Ql From_
9680 lines) due to compatibility reasons, instead of the stricter rules that
9681 have been standardized in RFC 4155.
9682 This behaviour can be switched to the stricter RFC 4155 rules by
9683 setting this variable.
9684 (This is never necessary for any message newly generated by \*(UA,
9685 it only applies to messages generated by buggy or malicious MUAs, or may
9686 occur in old MBOX databases: \*(UA itself will choose a proper
9687 .Va mime-encoding
9688 to avoid false interpretation of
9689 .Ql From_
9690 content lines in the MBOX database.)
9692 This may temporarily be handy when \*(UA complains about invalid
9693 .Ql From_
9694 lines when opening a MBOX: in this case setting this variable and
9695 re-opening the mailbox in question may correct the result.
9696 If so, copying the entire mailbox to some other file, as in
9697 .Ql copy * SOME-FILE ,
9698 will perform proper, all-compatible
9699 .Ql From_
9700 quoting for all detected messages, resulting in a valid MBOX mailbox.
9701 Finally the variable can be unset again:
9702 .Bd -literal -offset indent
9703 define mboxfix {
9704   localopts yes; wysh set mbox-rfc4155;\e
9705     wysh File "${1}"; eval copy * "${2}"
9707 call mboxfix /tmp/bad.mbox /tmp/good.mbox
9711 .It Va memdebug
9712 \*(BO Internal development variable.
9715 .It Va message-id-disable
9716 \*(BO By setting this variable the generation of
9717 .Ql Message-ID:
9719 .Ql Content-ID:
9720 message and MIME part headers can be completely suppressed, effectively
9721 leaving this task up to the
9722 .Va mta
9723 (Mail-Transfer-Agent) or the SMTP server.
9724 Note that according to RFC 5321 a SMTP server is not required to add this
9725 field by itself, so it should be ensured that it accepts messages without
9726 .Ql Message-ID .
9729 .It Va message-inject-head
9730 A string to put at the beginning of each new message, followed by a newline.
9731 \*(OB The escape sequences tabulator
9732 .Ql \et
9733 and newline
9734 .Ql \en
9735 are understood (use the
9736 .Cm wysh
9737 prefix when
9738 .Ic set Ns
9739 ting the variable(s) instead).
9742 .It Va message-inject-tail
9743 A string to put at the end of each new message, followed by a newline.
9744 \*(OB The escape sequences tabulator
9745 .Ql \et
9746 and newline
9747 .Ql \en
9748 are understood (use the
9749 .Cm wysh
9750 prefix when
9751 .Ic set Ns
9752 ting the variable(s) instead).
9755 .It Va metoo
9756 \*(BO Usually, when an
9757 .Ic alias
9758 expansion contains the sender, the sender is removed from the expansion.
9759 Setting this option suppresses these removals.
9760 Note that a set
9761 .Va metoo
9762 also causes a
9763 .Ql -m
9764 option to be passed through to the
9765 .Va mta
9766 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
9767 this flag, no MTA is known which does not support it (for historical
9768 compatibility).
9771 .It Va mime-allow-text-controls
9772 \*(BO When sending messages, each part of the message is MIME-inspected
9773 in order to classify the
9774 .Ql Content-Type:
9776 .Ql Content-Transfer-Encoding:
9777 (see
9778 .Va mime-encoding )
9779 that is required to send this part over mail transport, i.e.,
9780 a computation rather similar to what the
9781 .Xr file 1
9782 command produces when used with the
9783 .Ql --mime
9784 option.
9786 This classification however treats text files which are encoded in
9787 UTF-16 (seen for HTML files) and similar character sets as binary
9788 octet-streams, forcefully changing any
9789 .Ql text/plain
9791 .Ql text/html
9792 specification to
9793 .Ql application/octet-stream :
9794 If that actually happens a yet unset charset MIME parameter is set to
9795 .Ql binary ,
9796 effectively making it impossible for the receiving MUA to automatically
9797 interpret the contents of the part.
9799 If this variable is set, and the data was unambiguously identified as
9800 text data at first glance (by a
9801 .Ql .txt
9803 .Ql .html
9804 file extension), then the original
9805 .Ql Content-Type:
9806 will not be overwritten.
9809 .It Va mime-alternative-favour-rich
9810 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
9811 HTML) will be preferred in favour of included plain text versions when
9812 displaying messages, provided that a handler exists which produces
9813 output that can be (re)integrated into \*(UA's normal visual display.
9814 (E.g., at the time of this writing some newsletters ship their full
9815 content only in the rich HTML part, whereas the plain text part only
9816 contains topic subjects.)
9819 .It Va mime-counter-evidence
9820 Normally the
9821 .Ql Content-Type:
9822 field is used to decide how to handle MIME parts.
9823 Some MUAs, however, do not use
9824 .Sx "The mime.types files"
9825 (also see
9826 .Sx "HTML mail and MIME attachments" )
9827 or a similar mechanism to correctly classify content, but specify an
9828 unspecific MIME type
9829 .Pf ( Ql application/octet-stream )
9830 even for plain text attachments.
9831 If this variable is set then \*(UA will try to re-classify such MIME
9832 message parts, if possible, for example via a possibly existing
9833 attachment filename.
9834 A non-empty value may also be given, in which case a number is expected,
9835 actually a carrier of bits, best specified as a binary value, e.g.,
9836 .Ql 0b1111 .
9838 .Bl -bullet -compact
9840 If bit two is set (counting from 1, decimal 2) then the detected
9841 .Ic mimetype
9842 will be carried along with the message and be used for deciding which
9843 MIME handler is to be used, for example;
9844 when displaying such a MIME part the part-info will indicate the
9845 overridden content-type by showing a plus sign
9846 .Ql + .
9848 If bit three is set (decimal 4) then the counter-evidence is always
9849 produced and a positive result will be used as the MIME type, even
9850 forcefully overriding the parts given MIME type.
9852 If bit four is set (decimal 8) as a last resort the actual content of
9853 .Ql application/octet-stream
9854 parts will be inspected, so that data which looks like plain text can be
9855 treated as such.
9856 This mode is even more relaxed when data is to be displayed to the user
9857 or used as a message quote (data consumers which mangle data for display
9858 purposes, which includes masking of control characters, for example).
9862 .It Va mime-encoding
9863 The MIME
9864 .Ql Content-Transfer-Encoding
9865 to use in outgoing text messages and message parts, where applicable.
9866 (7-bit clean text messages are sent as-is, without a transfer encoding.)
9867 Valid values are:
9869 .Bl -tag -compact -width ".It Ql _%%_"
9870 .It Ql 8bit
9871 .Pf (Or\0 Ql 8b . )
9872 8-bit transport effectively causes the raw data be passed through
9873 unchanged, but may cause problems when transferring mail messages over
9874 channels that are not ESMTP (RFC 1869) compliant.
9875 Also, several input data constructs are not allowed by the
9876 specifications and may cause a different transfer-encoding to be used.
9877 .It Ql quoted-printable
9878 .Pf (Or\0 Ql qp . )
9879 Quoted-printable encoding is 7-bit clean and has the property that ASCII
9880 characters are passed through unchanged, so that an english message can
9881 be read as-is; it is also acceptable for other single-byte locales that
9882 share many characters with ASCII, like, e.g., ISO-8859-1.
9883 The encoding will cause a large overhead for messages in other character
9884 sets: e.g., it will require up to twelve (12) bytes to encode a single
9885 UTF-8 character of four (4) bytes.
9886 It is the default encoding.
9887 .It Ql base64
9888 .Pf (Or\0 Ql b64 . )
9889 This encoding is 7-bit clean and will always be used for binary data.
9890 This encoding has a constant input:output ratio of 3:4, regardless of
9891 the character set of the input data it will encode three bytes of input
9892 to four bytes of output.
9893 This transfer-encoding is not human readable without performing
9894 a decoding step.
9898 .It Va mimetypes-load-control
9899 Can be used to control which of
9900 .Sx "The mime.types files"
9901 are loaded: if the letter
9902 .Ql u
9903 is part of the option value, then the user's personal
9904 .Pa \*(vU
9905 file will be loaded (if it exists); likewise the letter
9906 .Ql s
9907 controls loading of the system wide
9908 .Pa \*(vS ;
9909 directives found in the user file take precedence, letter matching is
9910 case-insensitive.
9911 If this variable is not set \*(UA will try to load both files.
9912 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
9913 but they will be matched last (the order can be listed via
9914 .Ic mimetype ) .
9916 More sources can be specified by using a different syntax: if the
9917 value string contains an equals sign
9918 .Ql =
9919 then it is instead parsed as a comma-separated list of the described
9920 letters plus
9921 .Ql f=FILENAME
9922 pairs; the given filenames will be expanded and loaded, and their
9923 content may use the extended syntax that is described in the section
9924 .Sx "The mime.types files" .
9925 Directives found in such files always take precedence (are prepended to
9926 the MIME type cache).
9930 .It Va mta
9931 To choose an alternate Mail-Transfer-Agent, set this option to either
9932 the full pathname of an executable (optionally prefixed with the protocol
9933 .Ql file:// ) ,
9934 or \*(OPally a SMTP a.k.a. SUBMISSION protocol URL, e.g., \*(IN
9936 .Dl smtps?://[user[:password]@]server[:port]
9938 (\*(OU:
9939 .Ql [smtp://]server[:port] . )
9940 The default has been chosen at compile time.
9941 All supported data transfers are executed in child processes, which
9942 run asynchronously and without supervision unless either the
9943 .Va sendwait
9944 or the
9945 .Va verbose
9946 variable is set.
9947 If such a child receives a TERM signal, it will abort and
9948 .Va save
9949 the message to
9950 .Ev DEAD ,
9951 if so configured.
9954 For a file-based MTA it may be necessary to set
9955 .Va mta-argv0
9956 in in order to choose the right target of a modern
9957 .Xr mailwrapper 8
9958 environment.
9959 It will be passed command line arguments from several possible sources:
9960 from the variable
9961 .Va mta-arguments
9962 if set, from the command line if given and the variable
9963 .Va expandargv
9964 allows their use.
9965 Argument processing of the MTA will be terminated with a
9966 .Fl \&\&-
9967 separator.
9970 The otherwise occurring implicit usage of the following MTA command
9971 line arguments can be disabled by setting the boolean variable
9972 .Va mta-no-default-arguments
9973 (which will also disable passing
9974 .Fl \&\&-
9975 to the MTA):
9976 .Fl \&\&i
9977 (for not treating a line with only a dot
9978 .Ql \&.
9979 character as the end of input),
9980 .Fl \&\&m
9981 (shall the variable
9982 .Va metoo
9983 be set) and
9984 .Fl \&\&v
9985 (if the
9986 .Va verbose
9987 variable is set); in conjunction with the
9988 .Fl r
9989 command line option \*(UA will also (not) pass
9990 .Fl \&\&f
9991 as well as possibly
9992 .Fl \&\&F .
9995 \*(OPally \*(UA can send mail over SMTP a.k.a. SUBMISSION network
9996 connections to a single defined smart host by setting this variable to
9997 a SMTP or SUBMISSION URL (see
9998 .Sx "On URL syntax and credential lookup" ) .
9999 An authentication scheme can be specified via the variable chain
10000 .Va smtp-auth .
10001 Encrypted network connections are \*(OPally available, the section
10002 .Sx "Encrypted network communication"
10003 should give an overview and provide links to more information on this.
10004 Note that with some mail providers it may be necessary to set the
10005 .Va smtp-hostname
10006 variable in order to use a specific combination of
10007 .Va from ,
10008 .Va hostname
10010 .Va mta .
10011 \*(UA also supports forwarding of all network traffic over a specified
10012 .Va socks-proxy .
10013 The following SMTP variants may be used:
10015 .Bl -bullet
10017 The plain SMTP protocol (RFC 5321) that normally lives on the
10018 server port 25 and requires setting the
10019 .Va smtp-use-starttls
10020 variable to enter a SSL/TLS encrypted session state.
10021 Assign a value like \*(IN
10022 .Ql smtp://[user[:password]@]server[:port]
10023 (\*(OU
10024 .Ql smtp://server[:port] )
10025 to choose this protocol.
10027 The so-called SMTPS which is supposed to live on server port 465
10028 and is automatically SSL/TLS secured.
10029 Unfortunately it never became a standardized protocol and may thus not
10030 be supported by your hosts network service database
10031 \(en in fact the port number has already been reassigned to other
10032 protocols!
10034 SMTPS is nonetheless a commonly offered protocol and thus can be
10035 chosen by assigning a value like \*(IN
10036 .Ql smtps://[user[:password]@]server[:port]
10037 (\*(OU
10038 .Ql smtps://server[:port] ) ;
10039 due to the mentioned problems it is usually necessary to explicitly
10040 specify the port as
10041 .Ql :465 ,
10042 however.
10044 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
10045 is identically to the SMTP protocol from \*(UA's point of view;
10046 it requires setting
10047 .Va smtp-use-starttls
10048 to enter a SSL/TLS secured session state; e.g., \*(IN
10049 .Ql submission://[user[:password]@]server[:port] .
10051 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
10052 SSL/TLS secured by default.
10053 It can be chosen by assigning a value like \*(IN
10054 .Ql submissions://[user[:password]@]server[:port] .
10055 Due to the problems mentioned for SMTPS above and the fact that
10056 SUBMISSIONS is new and a successor that lives on the same port as the
10057 historical engineering mismanagement named SMTPS, it is usually
10058 necessary to explicitly specify the port as
10059 .Ql :465 .
10064 .It Va mta-arguments
10065 Arguments to pass through to a file-based
10066 .Va mta
10067 can be given via this variable, which is parsed according to
10068 .Sx "Shell-style argument quoting"
10069 into an array of arguments, and which will be joined onto MTA options
10070 from other sources, and then passed individually to the MTA:
10071 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
10074 .It Va mta-no-default-arguments
10075 \*(BO Unless this variable is set \*(UA will pass some well known
10076 standard command line options to a file-based
10077 .Va mta
10078 (Mail-Transfer-Agent), see there for more.
10081 .It Va mta-no-receiver-arguments
10082 \*(BO By default a file-based
10083 .Va mta
10084 will be passed all receiver addresses on the command line.
10085 This variable can be set to suppress any such argument.
10088 .It Va mta-argv0
10089 Many systems use a so-called
10090 .Xr mailwrapper 8
10091 environment to ensure compatibility with
10092 .Xr sendmail 1 .
10093 This works by inspecting the name that was used to invoke the mail
10094 delivery system.
10095 If this variable is set then the mailwrapper (the program that is
10096 actually executed when calling the file-based
10097 .Va mta )
10098 will treat its contents as that name.
10100 .Mx Va netrc-lookup
10101 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
10102 \*(BO\*(IN\*(OP Used to control usage of the user's
10103 .Pa \*(VN
10104 file for lookup of account credentials, as documented in the section
10105 .Sx "On URL syntax and credential lookup"
10106 and for the command
10107 .Ic netrc ;
10108 the section
10109 .Sx "The .netrc file"
10110 documents the file format.
10111 Also see
10112 .Va netrc-pipe .
10115 .It Va netrc-pipe
10116 \*(IN\*(OP When
10117 .Pa \*(VN
10118 is loaded (see
10119 .Ic netrc
10121 .Va netrc-lookup )
10122 then \*(UA will read the output of a shell pipe instead of the user's
10123 .Pa \*(VN
10124 file if this variable is set (to the desired shell command).
10125 This can be used to, e.g., store
10126 .Pa \*(VN
10127 in encrypted form:
10128 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
10131 .It Va newfolders
10132 \*(OP If this variable has the value
10133 .Ql maildir ,
10134 newly created local folders will be in Maildir instead of MBOX format.
10137 .It Va newmail
10138 Checks for new mail in the current folder each time the prompt is shown.
10139 A Maildir folder must be re-scanned to determine if new mail has arrived.
10140 If this variable is set to the special value
10141 .Ql nopoll
10142 then a Maildir folder will not be rescanned completely, but only
10143 timestamp changes are detected.
10144 Maildir folders are \*(OPal.
10147 .It Va outfolder
10148 \*(BO Causes the filename given in the
10149 .Va record
10150 variable
10151 and the sender-based filenames for the
10152 .Ic Copy
10154 .Ic Save
10155 commands to be interpreted relative to the directory given in the
10156 .Va folder
10157 variable rather than to the current directory,
10158 unless it is set to an absolute pathname.
10160 .Mx Va on-account-cleanup
10161 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
10162 Macro hook which will be called once an
10163 .Ic account
10164 is left, as the very last step before unrolling per-account
10165 .Ic localopts .
10166 This hook is run even in case of fatal errors, and it is advisable to
10167 perform only absolutely necessary actions, like cleaning up
10168 .Ic alternates ,
10169 for example.
10170 The specialized form is used in favour of the generic one if found.
10173 .It Va on-compose-cleanup
10174 Macro hook which will be called after the message has been sent (or not,
10175 in case of failures), as the very last step before unrolling compose mode
10176 .Ic localopts .
10177 This hook is run even in case of fatal errors, and it is advisable to
10178 perform only absolutely necessary actions, like cleaning up
10179 .Ic alternates ,
10180 for example.
10182 For compose mode hooks that may affect the message content please see
10183 .Va on-compose-enter , on-compose-leave , on-compose-splice .
10184 \*(ID This hook exists because
10185 .Ic alias , alternates , commandalias , shortcut ,
10186 to name a few, are not covered by
10187 .Ic localopts :
10188 changes applied in compose mode will continue to be in effect thereafter.
10193 .It Va on-compose-enter , on-compose-leave
10194 Macro hooks which will be called once compose mode is entered,
10195 and after composing has been finished, but before a set
10196 .Va message-inject-tail
10197 has been injected etc., respectively.
10198 .Ic localopts
10199 are enabled for these hooks, and changes on variables will be forgotten
10200 after the message has been sent.
10201 .Va on-compose-cleanup
10202 can be used to perform other necessary cleanup steps.
10204 The following (read-only) variables will be set temporarily during
10205 execution of the macros to represent respective message headers, to
10206 the empty string otherwise; most of them correspond to according virtual
10207 message headers that can be accessed via
10208 .Ic ~^ ,
10209 one of the
10210 .Sx "COMMAND ESCAPES"
10211 (also from within
10212 .Va on-compose-splice
10213 hooks):
10216 .Bl -tag -compact -width ".It Va mailx_subject"
10217 .It Va mailx-command
10218 The command that generates the message.
10219 .It Va mailx-subject
10220 The subject.
10221 .It Va mailx-from
10222 .Va from .
10223 .It Va mailx-sender
10224 .Va sender .
10225 .It Va mailx-to , mailx-cc , mailx-bcc
10226 The list of receiver addresses as a space-separated list.
10227 .It Va mailx-raw-to , mailx-raw-cc , mailx-raw-bcc
10228 The list of receiver addresses before any mangling (due to, e.g.,
10229 .Ic alternates ,
10230 .Ic alias
10231 .Va recipients-in-cc )
10232 as a space-separated list.
10233 .It Va mailx-orig-from
10234 When replying, forwarding or resending, this will be set to the
10235 .Ql From:
10236 of the given message.
10237 .It Va mailx-orig-to , mailx-orig-cc , mailx-orig-bcc
10238 When replying, forwarding or resending, this will be set to the
10239 receivers of the given message.
10243 Here is am example that injects a signature via
10244 .Va message-inject-tail ;
10245 instead using
10246 .Va on-compose-splice
10247 to simply inject the file of desire via
10248 .Ic ~<
10250 .Ic ~<!
10251 may be a better approach.
10253 .Bd -literal -offset indent
10254 define t_ocl {
10255   vput ! i cat ~/.mysig
10256   if [ $? -eq 0 ]
10257      vput vexpr message-inject-tail trim-end $i
10258   end
10260   # Alternatively
10261   readctl create ~/.mysig
10262   if [ $? -eq 0 ]
10263     readall i
10264     if [ $? -eq 0 ]
10265       vput vexpr message-inject-tail trim-end $i
10266     end
10267     readctl remove ~/.mysig
10268   end
10270 set on-compose-leave=t_ocl
10276 .It Va on-compose-splice , on-compose-splice-shell
10277 These hooks run once the normal compose mode is finished, but before the
10278 .Va on-compose-leave
10279 macro hook is called, the
10280 .Va message-inject-tail
10281 is injected etc.
10282 Both hooks will be executed in a subprocess, with their input and output
10283 connected to \*(UA such that they can act as if they would be an
10284 interactive user.
10285 The difference in between them is that the latter is a
10286 .Ev SHELL
10287 command, whereas the former is a normal \*(UA macro, but which is
10288 restricted to a small set of commands (the
10289 .Va verbose
10290 output of, e.g.,
10291 .Ic list
10292 will indicate said capability).
10293 .Ic localopts
10294 are enabled for these hooks (in the parent process), causing any setting
10295 to be forgotten after the message has been sent;
10296 .Va on-compose-cleanup
10297 can be used to perform other cleanup as necessary.
10300 During execution of these hooks \*(UA will temporarily forget whether it
10301 has been started in interactive mode, (a restricted set of)
10302 .Sx "COMMAND ESCAPES"
10303 will always be available, and for guaranteed reproducibilities sake
10304 .Va escape
10306 .Va ifs
10307 will be set to their defaults.
10308 The compose mode command
10309 .Ic ~^
10310 has been especially designed for scriptability (via these hooks).
10311 The first line the hook will read on its standard input is the protocol
10312 version of said command escape, currently
10313 .Dq 0 0 1 :
10314 backward incompatible protocol changes have to be expected.
10317 Care must be taken to avoid deadlocks and other false control flow:
10318 if both involved processes wait for more input to happen at the
10319 same time, or one does not expect more input but the other is stuck
10320 waiting for consumption of its output, etc.
10321 There is no automatic synchronization of the hook: it will not be
10322 stopped automatically just because it, e.g., emits
10323 .Ql ~x .
10324 The hooks will however receive a termination signal if the parent enters
10325 an error condition.
10326 \*(ID Protection against and interaction with signals is not yet given;
10327 it is likely that in the future these scripts will be placed in an
10328 isolated session, which is signalled in its entirety as necessary.
10330 .Bd -literal -offset indent
10331 define ocs_signature {
10332   read version
10333   echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
10335 set on-compose-splice=ocs_signature
10337 wysh set on-compose-splice-shell=$'\e
10338   read version;\e
10339   printf "hello $version!  Headers: ";\e
10340   echo \e'~^header list\e';\e
10341   read status result;\e
10342   echo "status=$status result=$result";\e
10343   '
10345 define ocsm {
10346   read version
10347   echo Splice protocol version is $version
10348   echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
10349   if [ "$es" != 2 ]
10350     echoerr 'Cannot read header list'; echo '~x'; xit
10351   endif
10352   if [ "$hl" @i!% ' cc' ]
10353     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
10354       vput vexpr es substring "${es}" 0 1
10355     if [ "$es" != 2 ]
10356       echoerr 'Cannot insert Cc: header'; echo '~x'
10357       # (no xit, macro finishs anyway)
10358     endif
10359   endif
10361 set on-compose-splice=ocsm
10366 .It Va on-resend-cleanup
10367 \*(ID Identical to
10368 .Va on-compose-cleanup ,
10369 but is only triggered by
10370 .Ic resend .
10373 .It Va on-resend-enter
10374 \*(ID Identical to
10375 .Va on-compose-enter ,
10376 but is only triggered by
10377 .Ic resend .
10380 .It Va page
10381 \*(BO If set, each message feed through the command given for
10382 .Ic pipe
10383 is followed by a formfeed character
10384 .Ql \ef .
10386 .Mx Va password
10387 .It Va password-USER@HOST , password-HOST , password
10388 \*(IN Variable chain that sets a password, which is used in case none has
10389 been given in the protocol and account-specific URL;
10390 as a last resort \*(UA will ask for a password on the user's terminal if
10391 the authentication method requires a password.
10392 Specifying passwords in a startup file is generally a security risk;
10393 the file should be readable by the invoking user only.
10395 .It Va password-USER@HOST
10396 \*(OU (see the chain above for \*(IN)
10397 Set the password for
10398 .Ql USER
10399 when connecting to
10400 .Ql HOST .
10401 If no such variable is defined for a host,
10402 the user will be asked for a password on standard input.
10403 Specifying passwords in a startup file is generally a security risk;
10404 the file should be readable by the invoking user only.
10407 .It Va piperaw
10408 \*(BO Send messages to the
10409 .Ic pipe
10410 command without performing MIME and character set conversions.
10414 .It Va pipe-TYPE/SUBTYPE
10415 When a MIME message part of type
10416 .Ql TYPE/SUBTYPE
10417 (case-insensitive) is displayed or quoted,
10418 its text is filtered through the value of this variable interpreted as
10419 a shell command.
10420 Note that only parts which can be displayed inline as plain text (see
10421 .Cd copiousoutput )
10422 are displayed unless otherwise noted, other MIME parts will only be
10423 considered by and for the command
10424 .Ic mimeview .
10427 The special value commercial at
10428 .Ql @
10429 forces interpretation of the message part as plain text, e.g.,
10430 .Ql set pipe-application/xml=@
10431 will henceforth display XML
10432 .Dq as is .
10433 (The same could also be achieved by adding a MIME type marker with the
10434 .Ic mimetype
10435 command.
10436 And \*(OPally MIME type handlers may be defined via
10437 .Sx "The Mailcap files"
10438 \(em these directives,
10439 .Cd copiousoutput
10440 has already been used, should be referred to for further documentation.
10443 The commercial at
10444 .Ql @
10445 can in fact be used as a trigger character to adjust usage and behaviour
10446 of a following shell command specification more thoroughly by appending
10447 more special characters which refer to further mailcap directives, e.g.,
10448 the following hypothetical command specification could be used:
10450 .Bd -literal -offset indent
10451 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
10455 .Bl -tag -compact -width ".It Ql __"
10456 .It Ql *
10457 The command produces plain text to be integrated in \*(UAs output:
10458 .Cd copiousoutput .
10460 .It Ql #
10461 If set the handler will not be invoked when a message is to be quoted,
10462 but only when it will be displayed:
10463 .Cd x-mailx-noquote .
10465 .It Ql &
10466 Run the command asynchronously, i.e., without blocking \*(UA:
10467 .Cd x-mailx-async .
10469 .It Ql \&!
10470 The command must be run on an interactive terminal, \*(UA will
10471 temporarily release the terminal to it:
10472 .Cd needsterminal .
10474 .It Ql +
10475 Request creation of a zero-sized temporary file, the absolute pathname
10476 of which will be made accessible via the environment variable
10477 .Ev MAILX_FILENAME_TEMPORARY :
10478 .Cd x-mailx-tmpfile .
10479 If given twice then the file will be unlinked automatically by \*(UA
10480 when the command loop is entered again at latest:
10481 .Cd x-mailx-tmpfile-unlink .
10483 .It Ql =
10484 Normally the MIME part content is passed to the handler via standard
10485 input; if this flag is set then the data will instead be written into
10486 .Ev MAILX_FILENAME_TEMPORARY
10487 .Pf ( Cd x-mailx-tmpfile-fill ) ,
10488 the creation of which is implied; note however that in order to cause
10489 deletion of the temporary file you still have to use two plus signs
10490 .Ql ++
10491 explicitly!
10493 .It Ql @
10494 To avoid ambiguities with normal shell command content you can use
10495 another commercial at to forcefully terminate interpretation of
10496 remaining characters.
10497 (Any character not in this list will have the same effect.)
10501 Some information about the MIME part to be displayed is embedded into
10502 the environment of the shell command:
10505 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
10507 .It Ev MAILX_CONTENT
10508 The MIME content-type of the part, if known, the empty string otherwise.
10511 .It Ev MAILX_CONTENT_EVIDENCE
10513 .Va mime-counter-evidence
10514 includes the carry-around-bit (2), then this will be set to the detected
10515 MIME content-type; not only then identical to
10516 .Ev \&\&MAILX_CONTENT
10517 otherwise.
10520 .It Ev MAILX_EXTERNAL_BODY_URL
10521 MIME parts of type
10522 .Ql message/external-body access-type=url
10523 will store the access URL in this variable, it is empty otherwise.
10524 URL targets should not be activated automatically, without supervision.
10527 .It Ev MAILX_FILENAME
10528 The filename, if any is set, the empty string otherwise.
10531 .It Ev MAILX_FILENAME_GENERATED
10532 A random string.
10535 .It Ev MAILX_FILENAME_TEMPORARY
10536 If temporary file creation has been requested through the command prefix
10537 this variable will be set and contain the absolute pathname of the
10538 temporary file.
10543 .It Va pipe-EXTENSION
10544 This is identical to
10545 .Va pipe-TYPE/SUBTYPE
10546 except that
10547 .Ql EXTENSION
10548 (normalized to lowercase using character mappings of the ASCII charset)
10549 names a file extension, e.g.,
10550 .Ql xhtml .
10551 Handlers registered using this method take precedence.
10553 .Mx Va pop3-auth
10554 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
10555 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
10556 The only possible value as of now is
10557 .Ql plain ,
10558 which is thus the default.
10560 .Mx Va pop3-bulk-load
10561 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
10562 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
10563 the messages, and only requests the message bodies on user request.
10564 For the POP3 protocol this means that the message headers will be
10565 downloaded twice.
10566 If this variable is set then \*(UA will download only complete messages
10567 from the given POP3 server(s) instead.
10569 .Mx Va pop3-keepalive
10570 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
10571 \*(OP POP3 servers close the connection after a period of inactivity;
10572 the standard requires this to be at least 10 minutes,
10573 but practical experience may vary.
10574 Setting this variable to a numeric value greater than
10575 .Ql 0
10576 causes a
10577 .Ql NOOP
10578 command to be sent each value seconds if no other operation is performed.
10580 .Mx Va pop3-no-apop
10581 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
10582 \*(BO\*(OP Unless this variable is set the
10583 .Ql APOP
10584 authentication method will be used when connecting to a POP3 server that
10585 advertises support.
10586 The advantage of
10587 .Ql APOP
10588 is that the password is not sent in clear text over the wire and that
10589 only a single packet is sent for the user/password tuple.
10590 Note that
10591 .Va pop3-no-apop-HOST
10592 requires \*(IN.
10594 .Mx Va pop3-use-starttls
10595 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
10596 \*(BO\*(OP Causes \*(UA to issue a
10597 .Ql STLS
10598 command to make an unencrypted POP3 session SSL/TLS encrypted.
10599 This functionality is not supported by all servers,
10600 and is not used if the session is already encrypted by the POP3S method.
10601 Note that
10602 .Va pop3-use-starttls-HOST
10603 requires \*(IN.
10607 .It Va posix
10608 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
10609 where that deviates from standardized behaviour.
10610 It will be set implicitly before the
10611 .Sx "Resource files"
10612 are loaded if the environment variable
10613 .Ev POSIXLY_CORRECT
10614 is set, and adjusting any of those two will be reflected by the other
10615 one implicitly.
10616 The following behaviour is covered and enforced by this mechanism:
10619 .Bl -bullet -compact
10621 In non-interactive mode, any error encountered while loading resource
10622 files during program startup will cause a program exit, whereas in
10623 interactive mode such errors will stop loading of the currently loaded
10624 (stack of) file(s, i.e., recursively).
10625 These exits can be circumvented on a per-command base by using
10626 .Cm ignerr ,
10627 one of the
10628 .Sx "Command modifiers" ,
10629 for each command which shall be allowed to fail.
10632 .Ic alternates
10633 will replace the list of alternate addresses instead of appending to it.
10636 The variable inserting
10637 .Sx "COMMAND ESCAPES"
10638 .Ic ~A ,
10639 .Ic ~a ,
10640 .Ic ~I
10642 .Ic ~i
10643 will expand embedded character sequences
10644 .Ql \et
10645 horizontal tabulator and
10646 .Ql \en
10647 line feed.
10648 \*(ID For compatibility reasons this step will always be performed.
10651 Upon changing the active
10652 .Ic file
10653 no summary of
10654 .Ic headers
10655 will be displayed even if
10656 .Va header
10657 is set.
10660 Setting
10661 .Va ignoreeof
10662 implies the behaviour described by
10663 .Va dot .
10666 The variable
10667 .Va keep
10668 is extended to cover any empty mailbox, not only empty
10669 .Mx -sx
10670 .Sx "primary system mailbox" Ns
10671 es: they will be removed when they are left in empty state otherwise.
10676 .It Va print-alternatives
10677 \*(BO When a MIME message part of type
10678 .Ql multipart/alternative
10679 is displayed and it contains a subpart of type
10680 .Ql text/plain ,
10681 other parts are normally discarded.
10682 Setting this variable causes all subparts to be displayed,
10683 just as if the surrounding part was of type
10684 .Ql multipart/mixed .
10687 .It Va prompt
10688 The string used as a prompt in interactive mode.
10689 Whenever the variable is evaluated the value is treated as if specified
10690 within dollar-single-quotes (see
10691 .Sx "Shell-style argument quoting" ) .
10692 This (post-assignment, i.e., second) expansion can be used to embed
10693 status information, for example
10694 .Va \&? ,
10695 .Va \&! ,
10696 .Va account
10698 .Va mailbox-display .
10700 In order to embed characters which should not be counted when
10701 calculating the visual width of the resulting string, enclose the
10702 characters of interest in a pair of reverse solidus escaped brackets:
10703 .Ql \e[\eE[0m\e] ;
10704 a slot for coloured prompts is also available with the \*(OPal command
10705 .Ic colour .
10706 Prompting may be prevented by setting this to the null string
10707 (a.k.a.\|
10708 .Ql set noprompt ) .
10711 .It Va prompt2
10712 This string is used for secondary prompts, but is otherwise identical to
10713 .Va prompt .
10714 The default is
10715 .Ql ..\0 .
10718 .It Va quiet
10719 \*(BO Suppresses the printing of the version when first invoked.
10722 .It Va quote
10723 If set a
10724 .Ic reply
10725 message is started with the quoted original message,
10726 the lines of which are prefixed by the value of the variable
10727 .Va indentprefix ,
10728 taking into account
10729 .Va quote-chars
10731 .Va quote-fold .
10732 If set to the empty value, the quoted message will be preceded and
10733 followed by the expansions of the values of
10734 .Va quote-inject-head
10736 .Va quote-inject-tail ,
10737 respectively.
10738 None of the headers of the quoted message is included in the quote if
10739 the value equals
10740 .Ql noheading ,
10741 and only the headers selected by the
10742 .Ql type
10743 .Ic headerpick
10744 selection are put above the message body for
10745 .Ql headers ,
10746 whereas all headers and all MIME parts are included for
10747 .Ql allheaders .
10748 Also see
10749 .Va quote-as-attachment
10751 .Ic ~Q ,
10752 one of the
10753 .Sx "COMMAND ESCAPES" .
10756 .It Va quote-as-attachment
10757 \*(BO Add the original message in its entirety as a
10758 .Ql message/rfc822
10759 MIME attachment when replying to a message.
10760 Note this works regardless of the setting of
10761 .Va quote .
10764 .It Va quote-chars
10765 Can be set to a string consisting of non-whitespace ASCII characters
10766 which shall be treated as quotation leaders, the default being
10767 .Ql >|}: .
10770 .It Va quote-fold
10771 \*(OP Can be set in addition to
10772 .Va indentprefix ,
10773 and creates a more fancy quotation in that leading quotation characters
10774 .Pf ( Va quote-chars )
10775 are compressed and overlong lines are folded.
10776 .Va \&\&quote-fold
10777 can be set to either one, two or three (space separated) numeric values,
10778 which are interpreted as the maximum (goal) and the minimum line length,
10779 respectively, in a spirit rather equal to the
10780 .Xr fmt 1
10781 program, but line- instead of paragraph-based.
10782 The third value is used as the maximum line length instead of the first
10783 if no better break point can be found; it is ignored unless it is larger
10784 than the minimum and smaller than the maximum.
10785 If not set explicitly the minimum will reflect the goal algorithmically.
10786 The goal cannot be smaller than the length of
10787 .Va indentprefix
10788 plus some additional pad; necessary adjustments take place silently.
10793 .It Va quote-inject-head , quote-inject-tail
10794 The strings to put before and after the text of a
10795 .Va quote Ns
10796 d message, respectively.
10797 The former defaults to
10798 .Ql %f wrote:\en\en .
10799 Special format directives will be expanded if possible, and if so
10800 configured the output will be folded according to
10801 .Va quote-fold .
10802 Format specifiers in the given strings start with a percent sign
10803 .Ql %
10804 and expand values of the original message, unless noted otherwise.
10805 Note that names and addresses are not subject to the setting of
10806 .Va showto .
10807 Valid format specifiers are:
10810 .Bl -tag -compact -width ".It Ql _%%_"
10811 .It Ql %%
10812 A plain percent sign.
10813 .It Ql %a
10814 The address(es) of the sender(s).
10815 .It Ql %d
10816 The date found in the
10817 .Ql Date:
10818 header of the message when
10819 .Va datefield
10820 is set (the default), otherwise the date when the message was received.
10821 Formatting can be controlled by assigning a
10822 .Xr strftime 3
10823 format string to
10824 .Va datefield
10825 (and
10826 .Va datefield-markout-older ) .
10827 .It Ql %f
10828 The full name(s) (name and address, as given) of the sender(s).
10829 .It Ql %i
10831 .Ql Message-ID: .
10832 .It Ql %n
10833 The real name(s) of the sender(s) if there is one and
10834 .Va showname
10835 allows usage, the address(es) otherwise.
10836 .It Ql %r
10837 The senders real name(s) if there is one, the address(es) otherwise.
10842 .It Va r-option-implicit
10843 \*(BO Setting this option evaluates the contents of
10844 .Va from
10845 (or, if that contains multiple addresses,
10846 .Va sender )
10847 and passes the results onto the used (file-based) MTA as described for the
10848 .Fl r
10849 option (empty argument case).
10852 .It Va recipients-in-cc
10853 \*(BO When doing a
10854 .Ic reply ,
10855 the original
10856 .Ql From:
10858 .Ql To:
10859 are by default merged into the new
10860 .Ql To: .
10861 If this variable is set, only the original
10862 .Ql From:
10863 ends in the new
10864 .Ql To: ,
10865 the rest is merged into
10866 .Ql Cc: .
10869 .It Va record
10870 Unless this variable is defined, no copies of outgoing mail will be saved.
10871 If defined it gives the pathname, subject to the usual
10872 .Sx "Filename transformations" ,
10873 of a folder where all new, replied-to or forwarded messages are saved:
10874 when saving to this folder fails the message is not sent, but instead
10875 .Va save Ns
10876 d to
10877 .Ev DEAD .
10878 The standard defines that relative (fully expanded) paths are to be
10879 interpreted relative to the current directory
10880 .Pf ( Ic cwd ) ,
10881 to force interpretation relative to
10882 .Va folder
10883 .Va outfolder
10884 needs to be set in addition.
10887 .It Va record-files
10888 \*(BO If this variable is set the meaning of
10889 .Va record
10890 will be extended to cover messages which target only file and pipe
10891 recipients (see
10892 .Va expandaddr ) .
10893 These address types will not appear in recipient lists unless
10894 .Va add-file-recipients
10895 is also set.
10898 .It Va record-resent
10899 \*(BO If this variable is set the meaning of
10900 .Va record
10901 will be extended to also cover the
10902 .Ic resend
10904 .Ic Resend
10905 commands.
10908 .It Va reply-in-same-charset
10909 \*(BO If this variable is set \*(UA first tries to use the same
10910 character set of the original message for replies.
10911 If this fails, the mechanism described in
10912 .Sx "Character sets"
10913 is evaluated as usual.
10916 .It Va reply-strings
10917 Can be set to a comma-separated list of (case-insensitive according to
10918 ASCII rules) strings which shall be recognized in addition to the
10919 built-in strings as
10920 .Ql Subject:
10921 reply message indicators \(en built-in are
10922 .Ql Re: ,
10923 which is mandated by RFC 5322, as well as the german
10924 .Ql Aw: ,
10925 .Ql Antw: ,
10926 and the
10927 .Ql Wg:
10928 which often has been seen in the wild;
10929 I.e., the separating colon has to be specified explicitly.
10932 .It Va reply-to
10933 A list of addresses to put into the
10934 .Ql Reply-To:
10935 field of the message header.
10936 Members of this list are handled as if they were in the
10937 .Ic alternates
10938 list.
10940 .It Va replyto
10941 \*(OB Variant of
10942 .Va reply-to .
10945 .It Va reply-to-honour
10946 Controls whether a
10947 .Ql Reply-To:
10948 header is honoured when replying to a message via
10949 .Ic reply
10951 .Ic Lreply .
10952 This is a quadoption; if set without a value it defaults to
10953 .Dq yes .
10956 .It Va rfc822-body-from_
10957 \*(BO This variable can be used to force displaying a so-called
10958 .Ql From_
10959 line for messages that are embedded into an envelope mail via the
10960 .Ql message/rfc822
10961 MIME mechanism, for more visual convenience.
10964 .It Va save
10965 \*(BO Enable saving of (partial) messages in
10966 .Ev DEAD
10967 upon interrupt or delivery error.
10970 .It Va screen
10971 The number of lines that represents a
10972 .Dq screenful
10973 of lines, used in
10974 .Ic headers
10975 summary display,
10976 .Ic from
10977 .Ic search Ns
10978 ing, message
10979 .Ic top Ns
10980 line display and scrolling via
10981 .Ic z .
10982 If this variable is not set \*(UA falls back to a calculation based upon
10983 the detected terminal window size and the baud rate: the faster the
10984 terminal, the more will be shown.
10985 Overall screen dimensions and pager usage is influenced by the
10986 environment variables
10987 .Ev COLUMNS
10989 .Ev LINES
10990 and the variable
10991 .Va crt .
10994 .It Va searchheaders
10995 \*(BO Expand message-list specifiers in the form
10996 .Ql /x:y
10997 to all messages containing the substring
10998 .Dq y
10999 in the header field
11000 .Ql x .
11001 The string search is case insensitive.
11004 .It Va sendcharsets
11005 \*(OP A comma-separated list of character set names that can be used in
11006 outgoing internet mail.
11007 The value of the variable
11008 .Va charset-8bit
11009 is automatically appended to this list of character sets.
11010 If no character set conversion capabilities are compiled into \*(UA then
11011 the only supported charset is
11012 .Va ttycharset .
11013 Also see
11014 .Va sendcharsets-else-ttycharset
11015 and refer to the section
11016 .Sx "Character sets"
11017 for the complete picture of character set conversion in \*(UA.
11020 .It Va sendcharsets-else-ttycharset
11021 \*(BO\*(OP If this variable is set, but
11022 .Va sendcharsets
11023 is not, then \*(UA acts as if
11024 .Va sendcharsets
11025 had been set to the value of the variable
11026 .Va ttycharset .
11027 In effect this combination passes through the message data in the
11028 character set of the current locale encoding:
11029 therefore mail message text will be (assumed to be) in ISO-8859-1
11030 encoding when send from within a ISO-8859-1 locale, and in UTF-8
11031 encoding when send from within an UTF-8 locale.
11033 The 8-bit fallback
11034 .Va charset-8bit
11035 never comes into play as
11036 .Va ttycharset
11037 is implicitly assumed to be 8-bit and capable to represent all files the
11038 user may specify (as is the case when no character set conversion
11039 support is available in \*(UA and the only supported character set is
11040 .Va ttycharset :
11041 .Sx "Character sets" ) .
11042 This might be a problem for scripts which use the suggested
11043 .Ql LC_ALL=C
11044 setting, since in this case the character set is US-ASCII by definition,
11045 so that it is better to also override
11046 .Va ttycharset ,
11047 then.
11050 .It Va sender
11051 An address that is put into the
11052 .Ql Sender:
11053 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
11054 responsible for the actual transmission of the message.
11055 This field should normally not be used unless the
11056 .Va from
11057 field contains more than one address, on which case it is required.
11058 Dependent on the context this address is handled as if it were in
11059 the list of
11060 .Ic alternates .
11061 Also see
11062 .Fl r ,
11063 .Va r-option-implicit .
11065 .It Va sendmail
11066 \*(OB Predecessor of
11067 .Va mta .
11069 .It Va sendmail-arguments
11070 \*(OB Predecessor of
11071 .Va mta-arguments .
11073 .It Va sendmail-no-default-arguments
11074 \*(OB\*(BO Predecessor of
11075 .Va mta-no-default-arguments .
11077 .It Va sendmail-progname
11078 \*(OB Predecessor of
11079 .Va mta-argv0 .
11082 .It Va sendwait
11083 \*(BO When sending a message wait until the
11084 .Va mta
11085 (including the built-in SMTP one) exits before accepting further commands.
11086 .Sy Only
11087 with this variable set errors reported by the MTA will be recognizable!
11088 If the MTA returns a non-zero exit status,
11089 the exit status of \*(UA will also be non-zero.
11092 .It Va showlast
11093 \*(BO This setting causes \*(UA to start at the last message
11094 instead of the first one when opening a mail folder, as well as with
11095 .Ic from
11097 .Ic headers .
11100 .It Va showname
11101 \*(BO Causes \*(UA to use the sender's real name instead of the plain
11102 address in the header field summary and in message specifications.
11105 .It Va showto
11106 \*(BO Causes the recipient of the message to be shown in the header
11107 summary if the message was sent by the user.
11110 .It Va Sign
11111 The value backing
11112 .Ic ~A ,
11113 one of the
11114 .Sx "COMMAND ESCAPES" .
11115 Also see
11116 .Va message-inject-tail ,
11117 .Va on-compose-leave
11119 .Va on-compose-splice .
11122 .It Va sign
11123 The value backing
11124 .Ic ~a ,
11125 one of the
11126 .Sx "COMMAND ESCAPES" .
11127 Also see
11128 .Va message-inject-tail ,
11129 .Va on-compose-leave
11131 .Va on-compose-splice .
11134 .It Va signature
11135 \*(OB Please use
11136 .Va on-compose-splice
11138 .Va on-compose-splice-shell
11140 .Va on-compose-leave
11141 and (if necessary)
11142 .Va message-inject-tail
11143 instead!
11146 .It Va skipemptybody
11147 \*(BO If an outgoing message does not contain any text in its first or
11148 only message part, do not send it but discard it silently (see also the
11149 command line option
11150 .Fl E ) .
11154 .It Va smime-ca-dir , smime-ca-file
11155 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
11156 Enhanced Mail) for the purpose of verification of S/MIME signed messages.
11157 .Va ssl-ca-dir
11158 documents the necessary preparation steps to use the former.
11159 The set of CA certificates which are built into the SSL/TLS library can
11160 be explicitly turned off by setting
11161 .Va smime-ca-no-defaults ,
11162 and further fine-tuning is possible via
11163 .Va smime-ca-flags .
11166 .It Va smime-ca-flags
11167 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
11168 storage, and the certificate verification that is used.
11169 The actual values and their meanings are documented for
11170 .Va ssl-ca-flags .
11173 .It Va smime-ca-no-defaults
11174 \*(BO\*(OP Do not load the default CA locations that are built into the
11175 used to SSL/TLS library to verify S/MIME signed messages.
11177 .Mx Va smime-cipher
11178 .It Va smime-cipher-USER@HOST , smime-cipher
11179 \*(OP Specifies the cipher to use when generating S/MIME encrypted
11180 messages (for the specified account).
11181 RFC 5751 mandates a default of
11182 .Ql aes128
11183 (AES-128 CBC).
11184 Possible values are (case-insensitive and) in decreasing cipher strength:
11185 .Ql aes256
11186 (AES-256 CBC),
11187 .Ql aes192
11188 (AES-192 CBC),
11189 .Ql aes128
11190 (AES-128 CBC),
11191 .Ql des3
11192 (DES EDE3 CBC, 168 bits; default if
11193 .Ql aes128
11194 is not available) and
11195 .Ql des
11196 (DES CBC, 56 bits).
11198 The actually available cipher algorithms depend on the cryptographic
11199 library that \*(UA uses.
11200 \*(OP Support for more cipher algorithms may be available through
11201 dynamic loading via, e.g.,
11202 .Xr EVP_get_cipherbyname 3
11203 (OpenSSL) if \*(UA has been compiled to support this.
11206 .It Va smime-crl-dir
11207 \*(OP Specifies a directory that contains files with CRLs in PEM format
11208 to use when verifying S/MIME messages.
11211 .It Va smime-crl-file
11212 \*(OP Specifies a file that contains a CRL in PEM format to use when
11213 verifying S/MIME messages.
11216 .It Va smime-encrypt-USER@HOST
11217 \*(OP If this variable is set, messages send to the given receiver are
11218 encrypted before sending.
11219 The value of the variable must be set to the name of a file that
11220 contains a certificate in PEM format.
11222 If a message is sent to multiple recipients,
11223 each of them for whom a corresponding variable is set will receive an
11224 individually encrypted message;
11225 other recipients will continue to receive the message in plain text
11226 unless the
11227 .Va smime-force-encryption
11228 variable is set.
11229 It is recommended to sign encrypted messages, i.e., to also set the
11230 .Va smime-sign
11231 variable.
11234 .It Va smime-force-encryption
11235 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
11238 .It Va smime-sign
11239 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
11240 and include the user's certificate as a MIME attachment.
11241 Signing a message enables a recipient to verify that the sender used
11242 a valid certificate,
11243 that the email addresses in the certificate match those in the message
11244 header and that the message content has not been altered.
11245 It does not change the message text,
11246 and people will be able to read the message as usual.
11247 Also see
11248 .Va smime-sign-cert , smime-sign-include-certs
11250 .Va smime-sign-message-digest .
11252 .Mx Va smime-sign-cert
11253 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
11254 \*(OP Points to a file in PEM format.
11255 For the purpose of signing and decryption this file needs to contain the
11256 user's private key, followed by his certificate.
11258 For message signing
11259 .Ql USER@HOST
11260 is always derived from the value of
11261 .Va from
11262 (or, if that contains multiple addresses,
11263 .Va sender ) .
11264 For the purpose of encryption the recipient's public encryption key
11265 (certificate) is expected; the command
11266 .Ic certsave
11267 can be used to save certificates of signed messages (the section
11268 .Sx "Signed and encrypted messages with S/MIME"
11269 gives some details).
11270 This mode of operation is usually driven by the specialized form.
11272 When decrypting messages the account is derived from the recipient
11273 fields
11274 .Pf ( Ql To:
11276 .Ql Cc: )
11277 of the message, which are searched for addresses for which such
11278 a variable is set.
11279 \*(UA always uses the first address that matches,
11280 so if the same message is sent to more than one of the user's addresses
11281 using different encryption keys, decryption might fail.
11283 For signing and decryption purposes it is possible to use encrypted
11284 keys, and the pseudo-host(s)
11285 .Ql USER@HOST.smime-cert-key
11286 for the private key
11287 (and
11288 .Ql USER@HOST.smime-cert-cert
11289 for the certificate stored in the same file)
11290 will be used for performing any necessary password lookup,
11291 therefore the lookup can be automated via the mechanisms described in
11292 .Sx "On URL syntax and credential lookup" .
11293 For example, the hypothetical address
11294 .Ql bob@exam.ple
11295 could be driven with a private key / certificate pair path defined in
11296 .Va \&\&smime-sign-cert-bob@exam.ple ,
11297 and needed passwords would then be looked up via the pseudo hosts
11298 .Ql bob@exam.ple.smime-cert-key
11299 (and
11300 .Ql bob@exam.ple.smime-cert-cert ) .
11301 To include intermediate certificates, use
11302 .Va smime-sign-include-certs .
11304 .Mx Va smime-sign-include-certs
11305 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
11306 \*(OP If used, this is supposed to a consist of a comma-separated list
11307 of files, each of which containing a single certificate in PEM format to
11308 be included in the S/MIME message in addition to the
11309 .Va smime-sign-cert
11310 certificate.
11311 This can be used to include intermediate certificates of the certificate
11312 authority, in order to allow the receiver's S/MIME implementation to
11313 perform a verification of the entire certificate chain, starting from
11314 a local root certificate, over the intermediate certificates, down to the
11315 .Va smime-sign-cert .
11316 Even though top level certificates may also be included in the chain,
11317 they won't be used for the verification on the receiver's side.
11319 For the purpose of the mechanisms involved here,
11320 .Ql USER@HOST
11321 refers to the content of the internal variable
11322 .Va from
11323 (or, if that contains multiple addresses,
11324 .Va sender ) .
11325 The pseudo-host
11326 .Ql USER@HOST.smime-include-certs
11327 will be used for performing password lookups for these certificates,
11328 shall they have been given one, therefore the lookup can be automated
11329 via the mechanisms described in
11330 .Sx "On URL syntax and credential lookup" .
11332 .Mx Va smime-sign-message-digest
11333 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
11334 \*(OP Specifies the message digest to use when signing S/MIME messages.
11335 RFC 5751 mandates a default of
11336 .Ql sha1 .
11337 Possible values are (case-insensitive and) in decreasing cipher strength:
11338 .Ql sha512 ,
11339 .Ql sha384 ,
11340 .Ql sha256 ,
11341 .Ql sha224
11343 .Ql md5 .
11345 The actually available message digest algorithms depend on the
11346 cryptographic library that \*(UA uses.
11347 \*(OP Support for more message digest algorithms may be available
11348 through dynamic loading via, e.g.,
11349 .Xr EVP_get_digestbyname 3
11350 (OpenSSL) if \*(UA has been compiled to support this.
11351 Remember that for this
11352 .Ql USER@HOST
11353 refers to the variable
11354 .Va from
11355 (or, if that contains multiple addresses,
11356 .Va sender ) .
11358 .It Va smtp
11359 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
11360 .Va mta .
11361 \*(ID For compatibility reasons a set
11362 .Va smtp
11363 is used in preference of
11364 .Va mta .
11366 .Mx Va smtp-auth
11367 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
11368 \*(OP Variable chain that controls the SMTP
11369 .Va mta
11370 authentication method, possible values are
11371 .Ql none
11372 (\*(OU default),
11373 .Ql plain
11374 (\*(IN default),
11375 .Ql login
11376 as well as the \*(OPal methods
11377 .Ql cram-md5
11379 .Ql gssapi .
11381 .Ql none
11382 method does not need any user credentials,
11383 .Ql gssapi
11384 requires a user name and all other methods require a user name and
11385 a password.
11386 See \*(IN
11387 .Va mta ,
11388 .Va user
11390 .Va password
11391 (\*(OU
11392 .Va smtp-auth-password
11394 .Va smtp-auth-user ) .
11395 Note that
11396 .Va smtp-auth-HOST
11397 is \*(IN.
11398 \*(OU: Note for
11399 .Va smtp-auth-USER@HOST :
11400 may override dependent on sender address in the variable
11401 .Va from .
11403 .It Va smtp-auth-password
11404 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
11405 If the authentication method requires a password, but neither
11406 .Va smtp-auth-password
11407 nor a matching
11408 .Va smtp-auth-password-USER@HOST
11409 can be found,
11410 \*(UA will ask for a password on the user's terminal.
11412 .It Va smtp-auth-password-USER@HOST
11413 \*(OU Overrides
11414 .Va smtp-auth-password
11415 for specific values of sender addresses, dependent upon the variable
11416 .Va from .
11418 .It Va smtp-auth-user
11419 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
11420 If the authentication method requires a user name, but neither
11421 .Va smtp-auth-user
11422 nor a matching
11423 .Va smtp-auth-user-USER@HOST
11424 can be found,
11425 \*(UA will ask for a user name on the user's terminal.
11427 .It Va smtp-auth-user-USER@HOST
11428 \*(OU Overrides
11429 .Va smtp-auth-user
11430 for specific values of sender addresses, dependent upon the variable
11431 .Va from .
11434 .It Va smtp-hostname
11435 \*(OP\*(IN Normally \*(UA uses the variable
11436 .Va from
11437 to derive the necessary
11438 .Ql USER@HOST
11439 information in order to issue a
11440 .Ql MAIL FROM:<>
11441 SMTP
11442 .Va mta
11443 command.
11444 Setting
11445 .Va smtp-hostname
11446 can be used to use the
11447 .Ql USER
11448 from the SMTP account
11449 .Pf ( Va mta
11450 or the
11451 .Va user
11452 variable chain)
11453 and the
11454 .Ql HOST
11455 from the content of this variable (or, if that is the empty string,
11456 .Va hostname
11457 or the local hostname as a last resort).
11458 This often allows using an address that is itself valid but hosted by
11459 a provider other than which (in
11460 .Va from )
11461 is about to send the message.
11462 Setting this variable also influences generated
11463 .Ql Message-ID:
11465 .Ql Content-ID:
11466 header fields.
11467 If the \*(OPal IDNA support is available (see
11468 .Va idna-disable )
11469 variable assignment is aborted when a necessary conversion fails.
11471 .Mx Va smtp-use-starttls
11472 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
11473 \*(BO\*(OP Causes \*(UA to issue a
11474 .Ql STARTTLS
11475 command to make an SMTP
11476 .Va mta
11477 session SSL/TLS encrypted, i.e., to enable transport layer security.
11479 .Mx Va socks-proxy
11480 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
11481 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
11482 \*(UA will proxy all of its network activities through it.
11483 This can be used to proxy SMTP, POP3 etc. network traffic through the
11484 Tor anonymizer, for example.
11485 The following would create a local SOCKS proxy on port 10000 that
11486 forwards to the machine
11487 .Ql HOST ,
11488 and from which the network traffic is actually instantiated:
11489 .Bd -literal -offset indent
11490 # Create local proxy server in terminal 1 forwarding to HOST
11491 $ ssh -D 10000 USER@HOST
11492 # Then, start a client that uses it in terminal 2
11493 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
11497 .It Va spam-interface
11498 \*(OP In order to use any of the spam-related commands (like, e.g.,
11499 .Ic spamrate )
11500 the desired spam interface must be defined by setting this variable.
11501 Please refer to the manual section
11502 .Sx "Handling spam"
11503 for the complete picture of spam handling in \*(UA.
11504 All or none of the following interfaces may be available:
11506 .Bl -tag -width ".It Ql _ilte_"
11507 .It Ql spamc
11508 Interaction with
11509 .Xr spamc 1
11510 from the
11511 .Xr spamassassin 1
11512 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
11513 suite.
11514 Different to the generic filter interface \*(UA will automatically add
11515 the correct arguments for a given command and has the necessary
11516 knowledge to parse the program's output.
11517 A default value for
11518 .Va spamc-command
11519 will have been compiled into the \*(UA binary if
11520 .Xr spamc 1
11521 has been found in
11522 .Ev PATH
11523 during compilation.
11524 Shall it be necessary to define a specific connection type (rather than
11525 using a configuration file for that), the variable
11526 .Va spamc-arguments
11527 can be used as in, e.g.,
11528 .Ql -d server.example.com -p 783 .
11529 It is also possible to specify a per-user configuration via
11530 .Va spamc-user .
11531 Note that this interface does not inspect the
11532 .Ql is-spam
11533 flag of a message for the command
11534 .Ic spamforget .
11536 .It Ql filter
11537 generic spam filter support via freely configurable hooks.
11538 This interface is meant for programs like
11539 .Xr bogofilter 1
11540 and requires according behaviour in respect to the hooks' exit
11541 status for at least the command
11542 .Ic spamrate
11543 .Pf ( Ql 0
11544 meaning a message is spam,
11545 .Ql 1
11546 for non-spam,
11547 .Ql 2
11548 for unsure and any other return value indicating a hard error);
11549 since the hooks can include shell code snippets diverting behaviour
11550 can be intercepted as necessary.
11551 The hooks are
11552 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
11553   spamfilter-rate
11555 .Va spamfilter-spam ;
11556 the manual section
11557 .Sx "Handling spam"
11558 contains examples for some programs.
11559 The process environment of the hooks will have the variable
11560 .Ev MAILX_FILENAME_GENERATED
11561 set.
11562 Note that spam score support for
11563 .Ic spamrate
11564 is not supported unless the \*(OPtional regular expression support is
11565 available and the
11566 .Va spamfilter-rate-scanscore
11567 variable is set.
11572 .It Va spam-maxsize
11573 \*(OP Messages that exceed this size will not be passed through to the
11574 configured
11575 .Va spam-interface .
11576 If unset or 0, the default of 420000 bytes is used.
11579 .It Va spamc-command
11580 \*(OP The path to the
11581 .Xr spamc 1
11582 program for the
11583 .Ql spamc
11584 .Va spam-interface .
11585 Note that the path is not expanded, but used
11586 .Dq as is .
11587 A fallback path will have been compiled into the \*(UA binary if the
11588 executable had been found during compilation.
11591 .It Va spamc-arguments
11592 \*(OP Even though \*(UA deals with most arguments for the
11593 .Ql spamc
11594 .Va spam-interface
11595 automatically, it may at least sometimes be desirable to specify
11596 connection-related ones via this variable, e.g.,
11597 .Ql -d server.example.com -p 783 .
11600 .It Va spamc-user
11601 \*(OP Specify a username for per-user configuration files for the
11602 .Ql spamc
11603 .Va spam-interface .
11604 If this is set to the empty string then \*(UA will use the name of the
11605 current
11606 .Va user .
11613 .It Va spamfilter-ham , spamfilter-noham , \
11614   spamfilter-nospam , spamfilter-rate , spamfilter-spam
11615 \*(OP Command and argument hooks for the
11616 .Ql filter
11617 .Va spam-interface .
11618 The manual section
11619 .Sx "Handling spam"
11620 contains examples for some programs.
11623 .It Va spamfilter-rate-scanscore
11624 \*(OP Because of the generic nature of the
11625 .Ql filter
11626 .Va spam-interface
11627 spam scores are not supported for it by default, but if the \*(OPnal
11628 regular expression support is available then setting this variable can
11629 be used to overcome this restriction.
11630 It is interpreted as follows: first a number (digits) is parsed that
11631 must be followed by a semicolon
11632 .Ql \&;
11633 and an extended regular expression.
11634 Then the latter is used to parse the first output line of the
11635 .Va spamfilter-rate
11636 hook, and, in case the evaluation is successful, the group that has been
11637 specified via the number is interpreted as a floating point scan score.
11639 .Mx Va ssl-ca-file
11640 .Mx Va ssl-ca-dir
11641 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
11642   ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
11643 \*(OP Directory and file, respectively, pools of trusted CA certificates
11644 in PEM (Privacy Enhanced Mail) format, for the purpose of verification
11645 of SSL/TLS server certificates.
11646 Concurrent use is possible, the file is loaded once needed first, the
11647 directory lookup is performed anew as a last resort whenever necessary.
11648 The CA certificate pool built into the SSL/TLS library can be disabled via
11649 .Va ssl-ca-no-defaults ,
11650 further fine-tuning is possible via
11651 .Va ssl-ca-flags .
11652 Note the directory search variant requires the certificate files to
11653 adhere special filename conventions, please see
11654 .Xr SSL_CTX_load_verify_locations 3
11656 .Xr verify 1
11658 .Xr c_rehash 1 ) .
11661 .Mx Va ssl-ca-flags
11662 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
11663 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
11664 storage, and the certificate verification that is used (also see
11665 .Va ssl-verify ) .
11666 The value is expected to consist of a comma-separated list of
11667 configuration directives, with any intervening whitespace being ignored.
11668 The directives directly map to flags that can be passed to
11669 .Xr X509_STORE_set_flags 3 ,
11670 which are usually defined in a file
11671 .Pa openssl/x509_vfy.h ,
11672 and the availability of which depends on the used SSL/TLS library
11673 version: a directive without mapping is ignored (error log subject to
11674 .Va debug ) .
11675 Directives currently understood (case-insensitively) include:
11678 .Bl -tag -compact -width ".It Cd BaNg"
11679 .It Cd no-alt-chains
11680 If the initial chain is not trusted, do not attempt to build an
11681 alternative chain.
11682 Setting this flag will make OpenSSL certificate verification match that
11683 of older OpenSSL versions, before automatic building and checking of
11684 alternative chains has been implemented; also see
11685 .Cd trusted-first .
11686 .It Cd no-check-time
11687 Do not check certificate/CRL validity against current time.
11688 .It Cd partial-chain
11689 By default partial, incomplete chains which cannot be verified up to the
11690 chain top, a self-signed root certificate, will not verify.
11691 With this flag set, a chain succeeds to verify if at least one signing
11692 certificate of the chain is in any of the configured trusted stores of
11693 CA certificates.
11694 The OpenSSL manual page
11695 .Xr SSL_CTX_load_verify_locations 3
11696 gives some advise how to manage your own trusted store of CA certificates.
11697 .It Cd strict
11698 Disable workarounds for broken certificates.
11699 .It Cd trusted-first
11700 Try building a chain using issuers in the trusted store first to avoid
11701 problems with server-sent legacy intermediate certificates.
11702 Newer versions of OpenSSL support alternative chain checking and enable
11703 it by default, resulting in the same behaviour; also see
11704 .Cd no-alt-chains .
11708 .Mx Va ssl-ca-no-defaults
11709 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
11710   ssl-ca-no-defaults
11711 \*(BO\*(OP Do not load the default CA locations that are built into the
11712 used to SSL/TLS library to verify SSL/TLS server certificates.
11714 .Mx Va ssl-cert
11715 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
11716 \*(OB\*(OP Please use the
11717 .Cd Certificate
11718 slot of
11719 .Va ssl-config-pairs .
11721 .Mx Va ssl-cipher-list
11722 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
11723 \*(OB\*(OP Please use the
11724 .Cd CipherString
11725 slot of
11726 .Va ssl-config-pairs .
11729 .It Va ssl-config-file
11730 \*(OP If this variable is set
11731 .Xr CONF_modules_load_file 3
11732 (if announced via
11733 .Ql +modules-load-file
11735 .Va ssl-features )
11736 is used to allow resource file based configuration of the SSL/TLS library.
11737 This happens once the library is used first, which may also be early
11738 during startup (logged with
11739 .Va verbose ) !
11740 If a non-empty value is given then the given file, after performing
11741 .Sx "Filename transformations" ,
11742 will be used instead of the global OpenSSL default, and it is an error
11743 if the file cannot be loaded.
11744 The application name will always be passed as
11745 .Ql \*(uA .
11746 Some SSL/TLS libraries support application-specific configuration via
11747 resource files loaded like this, please see
11748 .Va ssl-config-module .
11750 .Mx Va ssl-config-module
11751 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
11752   ssl-config-module
11753 \*(OP If file based application-specific configuration via
11754 .Va ssl-config-file
11755 is available, announced as
11756 .Ql +ctx-config
11758 .Va ssl-features ,
11759 indicating availability of
11760 .Xr SSL_CTX_config 3 ,
11761 then, it becomes possible to use a central SSL/TLS configuration file
11762 for all programs, including \*(uA, e.g.:
11763 .Bd -literal -offset indent
11764 # Register a configuration section for \*(uA
11765 \*(uA = mailx_master
11766 # The top configuration section creates a relation
11767 # in between dynamic SSL configuration and an actual
11768 # program specific configuration section
11769 [mailx_master]
11770 ssl_conf = mailx_ssl_config
11771 # Well that actual program specific configuration section
11772 # now can map individual ssl-config-module names to sections,
11773 # e.g., ssl-config-module=account_xy
11774 [mailx_ssl_config]
11775 account_xy = mailx_account_xy
11776 account_yz = mailx_account_yz
11777 [mailx_account_xy]
11778 MinProtocol = TLSv1.2
11779 Curves=P-521
11780 [mailx_account_yz]
11781 CipherString = TLSv1.2:!aNULL:!eNULL:
11782 MinProtocol = TLSv1.1
11783 Options = Bugs
11787 .Mx Va ssl-config-pairs
11788 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
11789 \*(OP The value of this variable chain will be interpreted as
11790 a comma-separated list of directive/value pairs.
11791 Directives and values need to be separated by equals signs
11792 .Ql = ,
11793 any whitespace surrounding pair members is removed.
11794 Keys are (usually) case-insensitive.
11795 Different to when placing these pairs in a
11796 .Va ssl-config-module
11797 section of a
11798 .Va ssl-config-file ,
11799 commas
11800 .Ql \&,
11801 need to be escaped with a reverse solidus
11802 .Ql \e
11803 when included in pairs; also different: if the equals sign
11804 .Ql =
11805 is preceded with an asterisk
11806 .Ql *
11807 .Sx "Filename transformations"
11808 will be performed on the value; it is an error if these fail.
11809 Unless proper support is announced by
11810 .Va ssl-features
11811 .Pf ( Ql +conf-ctx )
11812 only the keys below are supported, otherwise the pairs will be used
11813 directly as arguments to the function
11814 .Xr SSL_CONF_cmd 3 .
11817 .Bl -tag -compact -width ".It Cd C_rtificate"
11818 .It Cd Certificate
11819 Filename of a SSL/TLS client certificate (chain) required by some servers.
11820 Fallback support via
11821 .Xr SSL_CTX_use_certificate_chain_file 3 .
11822 .Sx "Filename transformations"
11823 are performed.
11824 .\" v15compat: remove the next sentence
11825 .Sy Note:
11826 if you use this you need to specify the private key via
11827 .Cd PrivateKey ,
11828 .Va ssl-key
11829 will not be used!
11831 .It Cd CipherString
11832 A list of ciphers for SSL/TLS connections, see
11833 .Xr ciphers 1 .
11834 By default no list of ciphers is set, resulting in a
11835 .Cd Protocol Ns - Ns
11836 specific list of ciphers (the protocol standards define lists of
11837 acceptable ciphers; possibly cramped by the used SSL/TLS library).
11838 Fallback support via
11839 .Xr SSL_CTX_set_cipher_list 3 .
11841 .It Cd Ciphersuites
11842 A list of ciphers used for TLSv1.3 connections, see
11843 .Xr ciphers 1 .
11844 These will be joined onto the list of ciphers from
11845 .Cd CipherString .
11846 Available if
11847 .Va ssl-features
11848 announces
11849 .Ql +ctx-set-ciphersuites ,
11850 as necessary via
11851 .Xr SSL_CTX_set_ciphersuites 3 .
11853 .It Cd Curves
11854 A list of supported elliptic curves, if applicable.
11855 By default no curves are set.
11856 Fallback support via
11857 .Xr SSL_CTX_set1_curves_list 3 ,
11858 if available.
11860 .It Cd MaxProtocol , MinProtocol
11861 The maximum and minimum supported SSL/TLS versions, respectively.
11862 Available if
11863 .Va ssl-features
11864 announces
11865 .Ql +ctx-set-maxmin-proto ,
11866 as necessary via
11867 .Xr SSL_CTX_set_max_proto_version 3
11869 .Xr SSL_CTX_set_min_proto_version 3 ;
11870 these fallbacks use an internal parser which understands the strings
11871 .Ql SSLv3 ,
11872 .Ql TLSv1 ,
11873 .Ql TLSv1.1 ,
11874 .Ql TLSv1.2 ,
11875 .Ql TLSv1.3 ,
11876 and the special value
11877 .Ql None ,
11878 which disables the given limit.
11880 .It Cd Options
11881 Various flags to set.
11882 Fallback via
11883 .Xr SSL_CTX_set_options 3 ,
11884 in which case any other value but (exactly)
11885 .Ql Bugs
11886 results in an error.
11888 .It Cd PrivateKey
11889 Filename of the private key in PEM format of a SSL/TLS client certificate.
11890 If unset, the name of the certificate file is used.
11891 .Sx "Filename transformations"
11892 are performed.
11893 Fallback via
11894 .Xr SSL_CTX_use_PrivateKey_file 3 .
11895 .\" v15compat: remove the next sentence
11896 .Sy Note:
11897 if you use this you need to specify the certificate (chain) via
11898 .Cd Certificate ,
11899 .Va ssl-cert
11900 will not be used!
11902 .It Cd Protocol
11903 The used SSL/TLS protocol.
11905 .Va ssl-features
11906 announces
11907 .Ql +conf-ctx
11909 .Ql ctx-set-maxmin-proto
11910 then using
11911 .Cd MaxProtocol
11913 .Cd MinProtocol
11914 is preferable.
11915 Fallback is
11916 .Xr SSL_CTX_set_options 3 ,
11917 driven via an internal parser which understands the strings
11918 .Ql SSLv3 ,
11919 .Ql TLSv1 ,
11920 .Ql TLSv1.1 ,
11921 .Ql TLSv1.2 ,
11922 .Ql TLSv1.3 ,
11923 and the special value
11924 .Ql ALL .
11925 Multiple protocols may be given as a comma-separated list, any
11926 whitespace is ignored, an optional plus sign
11927 .Ql +
11928 prefix enables, a hyphen-minus
11929 .Ql -
11930 prefix disables a protocol, so that
11931 .Ql -ALL, TLSv1.2
11932 enables only the TLSv1.2 protocol.
11938 .It Va ssl-crl-dir , ssl-crl-file
11939 \*(OP Specify a directory / a file, respectively that contains a CRL in
11940 PEM format to use when verifying SSL/TLS server certificates.
11942 .Mx Va ssl-curves
11943 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
11944 \*(OB\*(OP Please use the
11945 .Cd Curves
11946 slot of
11947 .Va ssl-config-pairs .
11950 .It Va ssl-features
11951 \*(OP\*(RO This expands to a comma separated list of the TLS/SSL library
11952 identity and optional TLS/SSL library features.
11953 Currently supported identities are
11954 .Ql libressl
11955 (LibreSSL) ,
11956 .Ql libssl-0x10100
11957 (OpenSSL v1.1.x series)
11959 .Ql libssl-0x10000
11960 (elder OpenSSL series, other clones).
11961 Optional features are preceded with a plus sign
11962 .Ql +
11963 when available, and with a hyphen-minus
11964 .Ql -
11965 otherwise:
11966 .Ql modules-load-file
11967 .Pf ( Va ssl-config-file ) ,
11968 .Ql conf-ctx
11969 .Pf ( Va ssl-config-pairs ) ,
11970 .Ql ctx-config
11971 .Pf ( Va ssl-config-module ) ,
11972 .Ql ctx-set-maxmin-proto
11973 .Pf ( Va ssl-config-pairs )
11975 .Ql rand-egd
11976 .Pf ( Va ssl-rand-egd ) .
11978 .Mx Va ssl-key
11979 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
11980 \*(OB\*(OP Please use the
11981 .Cd PrivateKey
11982 slot of
11983 .Va ssl-config-pairs .
11985 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
11986 \*(OB\*(OP Please use the
11987 .Cd Protocol
11988 slot of
11989 .Va ssl-config-pairs .
11991 .Mx Va ssl-protocol
11992 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
11993 \*(OB\*(OP Please use the
11994 .Cd Protocol
11995 slot of
11996 .Va ssl-config-pairs .
11999 .It Va ssl-rand-egd
12000 \*(OP Gives the pathname to an entropy daemon socket, see
12001 .Xr RAND_egd 3 .
12002 Not all SSL/TLS libraries support this,
12003 .Va ssl-features
12004 announces availability with
12005 .Ql +rand-egd .
12008 .It Va ssl-rand-file
12009 \*(OP Gives the filename to a file with random entropy data, see
12010 .Xr RAND_load_file 3 .
12011 If this variable is not set, or set to the empty string, or if the
12012 .Sx "Filename transformations"
12013 fail, then
12014 .Xr RAND_file_name 3
12015 will be used to create the filename.
12016 If the SSL PRNG was seeded successfully
12017 The file will be updated
12018 .Pf ( Xr RAND_write_file 3 )
12019 if and only if seeding and buffer stirring succeeds.
12020 This variable is only used if
12021 .Va ssl-rand-egd
12022 is not set (or not supported by the SSL/TLS library).
12024 .Mx Va ssl-verify
12025 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
12026 \*(OP Variable chain that sets the action to be performed if an error
12027 occurs during SSL/TLS server certificate validation against the
12028 specified or default trust stores
12029 .Va ssl-ca-dir ,
12030 .Va ssl-ca-file ,
12031 or the SSL/TLS library built-in defaults (unless usage disallowed via
12032 .Va ssl-ca-no-defaults ) ,
12033 and as fine-tuned via
12034 .Va ssl-ca-flags .
12035 Valid (case-insensitive) values are
12036 .Ql strict
12037 (fail and close connection immediately),
12038 .Ql ask
12039 (ask whether to continue on standard input),
12040 .Ql warn
12041 (show a warning and continue),
12042 .Ql ignore
12043 (do not perform validation).
12044 The default is
12045 .Ql ask .
12048 .It Va stealthmua
12049 If only set without an assigned value, then this setting inhibits the
12050 generation of the
12051 .Ql Message-ID: ,
12052 .Ql Content-ID:
12054 .Ql User-Agent:
12055 header fields that include obvious references to \*(UA.
12056 There are two pitfalls associated with this:
12057 First, the message id of outgoing messages is not known anymore.
12058 Second, an expert may still use the remaining information in the header
12059 to track down the originating mail user agent.
12060 If set to the value
12061 .Ql noagent ,
12062 then the mentioned
12063 .Ql Message-ID:
12065 .Ql Content-ID:
12066 suppression does not occur.
12069 .It Va system-mailrc
12070 \*(RO The compiled in path of the system wide initialization file
12071 one of the
12072 .Sx "Resource files" :
12073 .Pa \*(UR .
12077 .It Va termcap
12078 (\*(OP) This specifies a comma-separated list of
12079 .Lb libterminfo
12080 and/or
12081 .Lb libtermcap
12082 capabilities (see
12083 .Sx "On terminal control and line editor" ,
12084 escape commas with reverse solidus) to be used to overwrite or define
12085 entries.
12086 .Sy Note
12087 this variable will only be queried once at program startup and can
12088 thus only be specified in resource files or on the command line.
12091 String capabilities form
12092 .Ql cap=value
12093 pairs and are expected unless noted otherwise.
12094 Numerics have to be notated as
12095 .Ql cap#number
12096 where the number is expected in normal decimal notation.
12097 Finally, booleans do not have any value but indicate a true or false
12098 state simply by being defined or not; this indeed means that \*(UA
12099 does not support undefining an existing boolean.
12100 String capability values will undergo some expansions before use:
12101 for one notations like
12102 .Ql ^LETTER
12103 stand for
12104 .Ql control-LETTER ,
12105 and for clarification purposes
12106 .Ql \eE
12107 can be used to specify
12108 .Ql escape
12109 (the control notation
12110 .Ql ^[
12111 could lead to misreadings when a left bracket follows, which it does for
12112 the standard CSI sequence);
12113 finally three letter octal sequences, as in
12114 .Ql \e061 ,
12115 are supported.
12116 To specify that a terminal supports 256-colours, and to define sequences
12117 that home the cursor and produce an audible bell, one might write:
12119 .Bd -literal -offset indent
12120 ? set termcap='Co#256,home=\eE[H,bel=^G'
12124 The following terminal capabilities are or may be meaningful for the
12125 operation of the built-in line editor or \*(UA in general:
12128 .Bl -tag -compact -width ".It Cd yay"
12129 .\" HAVE_COLOUR
12130 .It Cd colors Ns \0or Cd Co
12131 .Cd max_colors :
12132 numeric capability specifying the maximum number of colours.
12133 Note that \*(UA does not actually care about the terminal beside that,
12134 but always emits ANSI / ISO 6429 escape sequences.
12136 .\" HAVE_TERMCAP
12137 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
12138 .Cd exit_ca_mode
12140 .Cd enter_ca_mode ,
12141 respectively: exit and enter the alternative screen ca-mode,
12142 effectively turning \*(UA into a fullscreen application.
12143 This must be enabled explicitly by setting
12144 .Va termcap-ca-mode .
12146 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
12147 .Cd keypad_xmit
12149 .Cd keypad_local ,
12150 respectively: enable and disable the keypad.
12151 This is always enabled if available, because it seems even keyboards
12152 without keypads generate other key codes for, e.g., cursor keys in that
12153 case, and only if enabled we see the codes that we are interested in.
12155 .It Cd ed Ns \0or Cd cd
12156 .Cd clr_eos :
12157 clear the screen.
12159 .It Cd clear Ns \0or Cd cl
12160 .Cd clear_screen :
12161 clear the screen and home cursor.
12162 (Will be simulated via
12163 .Cd ho
12164 plus
12165 .Cd cd . )
12167 .It Cd home Ns \0or Cd ho
12168 .Cd cursor_home :
12169 home cursor.
12171 .\" HAVE_MLE
12172 .It Cd el Ns \0or Cd ce
12173 .Cd clr_eol :
12174 clear to the end of line.
12175 (Will be simulated via
12176 .Cd ch
12177 plus repetitions of space characters.)
12179 .It Cd hpa Ns \0or Cd ch
12180 .Cd column_address :
12181 move the cursor (to the given column parameter) in the current row.
12182 (Will be simulated via
12183 .Cd cr
12184 plus
12185 .Cd nd . )
12187 .It Cd cr
12188 .Cd carriage_return :
12189 move to the first column in the current row.
12190 The default built-in fallback is
12191 .Ql \er .
12193 .It Cd cub1 Ns \0or Cd le
12194 .Cd cursor_left :
12195 move the cursor left one space (non-destructively).
12196 The default built-in fallback is
12197 .Ql \eb .
12199 .It Cd cuf1 Ns \0or Cd nd
12200 .Cd cursor_right :
12201 move the cursor right one space (non-destructively).
12202 The default built-in fallback is
12203 .Ql \eE[C ,
12204 which is used by most terminals.
12205 Less often occur
12206 .Ql \eEC
12208 .Ql \eEOC .
12212 Many more capabilities which describe key-sequences are documented for
12213 .Ic bind .
12217 .It Va termcap-ca-mode
12218 \*(OP Allow usage of the
12219 .Cd exit_ca_mode
12221 .Cd enter_ca_mode
12222 terminal capabilities, see
12223 .Va termcap .
12224 .Sy Note
12225 this variable will only be queried once at program startup and can
12226 thus only be specified in resource files or on the command line.
12229 .It Va termcap-disable
12230 \*(OP Disable any interaction with a terminal control library.
12231 If set only some generic fallback built-ins and possibly the content of
12232 .Va termcap
12233 describe the terminal to \*(UA.
12234 .Sy Note
12235 this variable will only be queried once at program startup and can
12236 thus only be specified in resource files or on the command line.
12239 .It Va toplines
12240 If defined, gives the number of lines of a message to be displayed
12241 with the command
12242 .Ic top ;
12243 if unset, the first five lines are printed, if set to 0 the variable
12244 .Va screen
12245 is inspected.
12246 If the value is negative then its absolute value will be used for
12247 unsigned right shifting (see
12248 .Ic vexpr )
12250 .Va screen
12251 height.
12254 .It Va topsqueeze
12255 \*(BO If set then the
12256 .Ic top
12257 command series will strip adjacent empty lines and quotations.
12260 .It Va ttycharset
12261 The character set of the terminal \*(UA operates on,
12262 and the one and only supported character set that \*(UA can use if no
12263 character set conversion capabilities have been compiled into it,
12264 in which case it defaults to ISO-8859-1.
12265 Otherwise it defaults to UTF-8.
12266 Sufficient locale support provided the default will be preferably
12267 deduced from the locale environment if that is set (e.g.,
12268 .Ev LC_CTYPE ,
12269 see there for more); runtime locale changes will be reflected by
12270 .Va \&\&ttycharset
12271 except during the program startup phase and if
12272 .Fl S
12273 had been used to freeze the given value.
12274 Refer to the section
12275 .Sx "Character sets"
12276 for the complete picture about character sets.
12279 .It Va typescript-mode
12280 \*(BO A special multiplex variable that disables all variables and
12281 settings which result in behaviour that interferes with running \*(UA in
12282 .Xr script 1 ,
12283 e.g., it sets
12284 .Va colour-disable ,
12285 .Va line-editor-disable
12286 and (before startup completed only)
12287 .Va termcap-disable .
12288 Unsetting it does not restore the former state of the covered settings.
12291 .It Va umask
12292 For a safe-by-default policy the process file mode creation mask
12293 .Xr umask 2
12294 will be set to
12295 .Ql 0077
12296 on program startup by default.
12297 Child processes inherit the file mode creation mask of their parent, and
12298 by setting this variable to an empty value no change will be applied,
12299 and the inherited value will be used.
12300 Otherwise the given value will be made the new file mode creation mask.
12302 .Mx Va user
12303 .It Va user-HOST , user
12304 \*(IN Variable chain that sets a global fallback user name, which is
12305 used in case none has been given in the protocol and account-specific
12306 URL.
12307 This variable defaults to the name of the user who runs \*(UA.
12310 .It Va v15-compat
12311 \*(BO Setting this enables upward compatibility with \*(UA
12312 version 15.0 in respect to which configuration options are available and
12313 how they are handled.
12314 This manual uses \*(IN and \*(OU to refer to the new and the old way of
12315 doing things, respectively.
12318 .It Va verbose
12319 \*(BO This setting, also controllable via the command line option
12320 .Fl v ,
12321 causes \*(UA to be more verbose, e.g., it will display obsoletion
12322 warnings and SSL/TLS certificate chains.
12323 Even though marked \*(BO this option may be set twice in order to
12324 increase the level of verbosity even more, in which case even details of
12325 the actual message delivery and protocol conversations are shown.
12326 A single
12327 .Pf no Va verbose
12328 is sufficient to disable verbosity as such.
12335 .It Va version , version-date , \
12336   version-hexnum , version-major , version-minor , version-update
12337 \*(RO \*(UA version information: the first variable is a string with
12338 the complete version identification, the second the release date in ISO
12339 8601 notation without time.
12340 The third is a 32-bit hexadecimal number with the upper 8 bits storing
12341 the major, followed by the minor and update version numbers which occupy
12342 12 bits each.
12343 The latter three variables contain only decimal digits: the major, minor
12344 and update version numbers.
12345 The output of the command
12346 .Ic version
12347 will include this information.
12350 .It Va writebackedited
12351 If this variable is set messages modified using the
12352 .Ic edit
12354 .Ic visual
12355 commands are written back to the current folder when it is quit;
12356 it is only honoured for writable folders in MBOX format, though.
12357 Note that the editor will be pointed to the raw message content in that
12358 case, i.e., neither MIME decoding nor decryption will have been
12359 performed, and proper RFC 4155
12360 .Ql From_
12361 quoting of newly added or edited content is also left as an exercise to
12362 the user.
12364 .\" }}} (Variables)
12366 .\" }}} (INTERNAL VARIABLES)
12369 .\" .Sh ENVIRONMENT {{{
12370 .Sh ENVIRONMENT
12372 The term
12373 .Dq environment variable
12374 should be considered an indication that these variables are either
12375 standardized as vivid parts of process environments, or that they are
12376 commonly found in there.
12377 The process environment is inherited from the
12378 .Xr sh 1
12379 once \*(UA is started, and unless otherwise explicitly noted handling of
12380 the following variables transparently integrates into that of the
12381 .Sx "INTERNAL VARIABLES"
12382 from \*(UA's point of view.
12383 This means that, e.g., they can be managed via
12384 .Ic set
12386 .Ic unset ,
12387 causing automatic program environment updates (to be inherited by
12388 newly created child processes).
12391 In order to transparently integrate other environment variables equally
12392 they need to be imported (linked) with the command
12393 .Ic environ .
12394 This command can also be used to set and unset non-integrated
12395 environment variables from scratch, sufficient system support provided.
12396 The following example, applicable to a POSIX shell, sets the
12397 .Ev COLUMNS
12398 environment variable for \*(UA only, and beforehand exports the
12399 .Ev EDITOR
12400 in order to affect any further processing in the running shell:
12402 .Bd -literal -offset indent
12403 $ EDITOR="vim -u ${HOME}/.vimrc"
12404 $ export EDITOR
12405 $ COLUMNS=80 \*(uA -R
12408 .Bl -tag -width ".It Ev BaNg"
12410 .It Ev COLUMNS
12411 The user's preferred width in column positions for the terminal screen
12412 or window.
12413 Queried and used once on program startup, actively managed for child
12414 processes and the MLE (see
12415 .Sx "On terminal control and line editor" )
12416 in interactive mode thereafter.
12417 Ignored in non-interactive mode, which always uses 80 columns, unless in
12418 .fl #
12419 batch mode.
12422 .It Ev DEAD
12423 The name of the (mailbox)
12424 .Ic file
12425 to use for saving aborted messages if
12426 .Va save
12427 is set; this defaults to
12428 .Pa \*(VD .
12429 If the variable
12430 .Va debug
12431 is set no output will be generated, otherwise the contents of the file
12432 will be replaced.
12435 .It Ev EDITOR
12436 Pathname of the text editor to use for the
12437 .Ic edit
12438 command and
12439 .Ic ~e
12440 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
12441 .Ev VISUAL
12442 is used for a more display oriented editor.
12445 .It Ev HOME
12446 The user's home directory.
12447 This variable is only used when it resides in the process environment.
12448 The calling user's home directory will be used instead if this directory
12449 does not exist, is not accessible or cannot be read;
12450 it will always be used for the root user.
12451 (No test for being writable is performed to allow usage by
12452 non-privileged users within read-only jails, but dependent on the
12453 variable settings this directory is a default write target, e.g. for
12454 .Ev DEAD ,
12455 .Ev MBOX
12456 and more.)
12461 .It Ev LC_ALL , LC_CTYPE , LANG
12462 \*(OP The (names in lookup order of the)
12463 .Xr locale 7
12464 (and / or see
12465 .Xr setlocale 3 )
12466 which indicates the used
12467 .Sx "Character sets" .
12468 Runtime changes trigger automatic updates of the entire locale system,
12469 which includes updating
12470 .Va ttycharset
12471 (except during startup if the variable has been frozen via
12472 .Fl S ) .
12475 .It Ev LINES
12476 The user's preferred number of lines on a page or the vertical screen
12477 or window size in lines.
12478 Queried and used once on program startup, actively managed for child
12479 processes in interactive mode thereafter.
12480 Ignored in non-interactive mode, which always uses 24 lines, unless in
12481 .fl #
12482 batch mode.
12485 .It Ev LISTER
12486 Pathname of the directory lister to use in the
12487 .Ic folders
12488 command when operating on local mailboxes.
12489 Default is
12490 .Xr ls 1
12491 (path search through
12492 .Ev SHELL ) .
12495 .It Ev LOGNAME
12496 Upon startup \*(UA will actively ensure that this variable refers to the
12497 name of the user who runs \*(UA, in order to be able to pass a verified
12498 name to any newly created child process.
12501 .It Ev MAIL
12502 Is used as the user's
12503 .Mx -sx
12504 .Sx "primary system mailbox"
12505 unless
12506 .Va inbox
12507 is set.
12508 This is assumed to be an absolute pathname.
12511 .It Ev MAILCAPS
12512 \*(OP Overrides the default path search for
12513 .Sx "The Mailcap files" ,
12514 which is defined in the standard RFC 1524 as
12515 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
12516 .\" TODO we should have a mailcaps-default virtual RDONLY option!
12517 (\*(UA makes it a configuration option, however.)
12518 Note this is not a search path, but a path search.
12521 .It Ev MAILRC
12522 Is used as a startup file instead of
12523 .Pa \*(ur
12524 if set.
12525 In order to avoid side-effects from configuration files scripts should
12526 either set this variable to
12527 .Pa /dev/null
12528 or the
12529 .Fl \&:
12530 command line option should be used.
12533 .It Ev MAILX_NO_SYSTEM_RC
12534 If this variable is set then reading of
12535 .Pa \*(UR
12536 (a.k.a.\&
12537 .Va system-mailrc )
12538 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
12539 had been started up with the option
12540 .Fl \&:
12541 (and according argument) or
12542 .Fl n .
12543 This variable is only used when it resides in the process environment.
12546 .It Ev MBOX
12547 The name of the user's
12548 .Mx -sx
12549 .Sx "secondary mailbox"
12550 file.
12551 A logical subset of the special
12552 .Sx "Filename transformations"
12553 (also see
12554 .Ic file )
12555 are supported.
12556 The default is
12557 .Pa \*(VM .
12558 Traditionally this MBOX is used as the file to save messages from the
12559 .Mx -sx
12560 .Sx "primary system mailbox"
12561 that have been read.
12562 Also see
12563 .Sx "Message states" .
12566 .It Ev NETRC
12567 \*(IN\*(OP This variable overrides the default location of the user's
12568 .Pa \*(VN
12569 file.
12572 .It Ev PAGER
12573 Pathname of the program to use for backing the command
12574 .Ic more ,
12575 and when the
12576 .Va crt
12577 variable enforces usage of a pager for output.
12578 The default paginator is
12579 .Xr more 1
12580 (path search through
12581 .Ev SHELL ) .
12583 \*(UA inspects the contents of this variable: if its contains the string
12584 .Dq less
12585 then a non-existing environment variable
12586 .Ev LESS
12587 will be set to
12588 .Ql Ri ,
12589 likewise for
12590 .Dq lv
12591 .Ev LV
12592 will optionally be set to
12593 .Ql -c .
12594 Alse see
12595 .Va colour-pager .
12598 .It Ev PATH
12599 A colon-separated list of directories that is searched by the shell when
12600 looking for commands, e.g.,
12601 .Ql /bin:/usr/bin:/usr/local/bin .
12604 .It Ev POSIXLY_CORRECT
12605 This variable is automatically looked for upon startup, see
12606 .Va posix
12607 for more.
12610 .It Ev SHELL
12611 The shell to use for the commands
12612 .Ic \&! ,
12613 .Ic shell ,
12615 .Ic ~!
12616 .Sx "COMMAND ESCAPES"
12617 and when starting subprocesses.
12618 A default shell is used if this environment variable is not defined.
12621 .It Ev SOURCE_DATE_EPOCH
12622 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
12623 used in place of the current time.
12624 This variable is looked up upon program startup, and its existence will
12625 switch \*(UA to a reproducible mode
12626 .Pf ( Lk https://reproducible-builds.org )
12627 which uses deterministic random numbers, a special fixated pseudo
12628 .Ev LOGNAME
12629 and more.
12630 This operation mode is used for development and by software packagers.
12631 \*(ID Currently an invalid setting is only ignored, rather than causing
12632 a program abortion.
12634 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
12637 .It Ev TERM
12638 \*(OP The terminal type for which output is to be prepared.
12639 For extended colour and font control please refer to
12640 .Sx "Coloured display" ,
12641 and for terminal management in general to
12642 .Sx "On terminal control and line editor" .
12645 .It Ev TMPDIR
12646 Except for the root user this variable defines the directory for
12647 temporary files to be used instead of
12648 .Pa \*(VT
12649 (or the given compile-time constant) if set, existent, accessible as
12650 well as read- and writable.
12651 This variable is only used when it resides in the process environment,
12652 but \*(UA will ensure at startup that this environment variable is
12653 updated to contain a usable temporary directory.
12656 .It Ev USER
12657 Identical to
12658 .Ev LOGNAME
12659 (see there), but this variable is not standardized, should therefore not
12660 be used, and is only corrected if already set.
12663 .It Ev VISUAL
12664 Pathname of the text editor to use for the
12665 .Ic visual
12666 command and
12667 .Ic ~v
12668 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
12669 .Ev EDITOR
12670 is used for a less display oriented editor.
12673 .\" }}}
12676 .\" .Sh FILES {{{
12677 .Sh FILES
12679 .\" file list {{{
12680 .Bl -tag -width ".It Pa BaNg"
12681 .It Pa \*(ur
12682 User-specific file giving initial commands, one of the
12683 .Sx "Resource files" .
12684 The actual value is read from
12685 .Va MAILRC .
12687 .It Pa \*(UR
12688 System wide initialization file, one of the
12689 .Sx "Resource files" .
12690 The actual value is read from
12691 .Va system-mailrc .
12694 .It Pa ~/.mailcap
12695 \*(OP Personal MIME type handler definition file, see
12696 .Sx "The Mailcap files" .
12697 This location is part of the RFC 1524 standard search path, which is
12698 a configuration option and can be overridden via
12699 .Ev MAILCAPS .
12702 .It Pa /etc/mailcap
12703 \*(OP System wide MIME type handler definition file, see
12704 .Sx "The Mailcap files" .
12705 This location is part of the RFC 1524 standard search path, which is
12706 a configuration option and can be overridden via
12709 .It Pa \*(VM
12710 The default value for
12711 .Ev MBOX .
12714 .It Pa \*(vU
12715 Personal MIME types, see
12716 .Sx "The mime.types files" .
12719 .It Pa \*(vS
12720 System wide MIME types, see
12721 .Sx "The mime.types files" .
12724 .It Pa \*(VN
12725 \*(IN\*(OP The default location of the user's
12726 .Pa .netrc
12727 file \(en the section
12728 .Sx "The .netrc file"
12729 documents the file format.
12730 The actually used path can be overridden via
12731 .Ev NETRC .
12734 .It Pa /dev/null
12735 The data sink
12736 .Xr null 4 .
12738 .\" }}}
12740 .\" .Ss "Resource files" {{{
12741 .Ss "Resource files"
12743 Upon startup \*(UA reads in several resource files, in order:
12745 .Bl -tag -width ".It Pa BaNg"
12747 .It Pa \*(UR
12748 System wide initialization file
12749 .Pf ( Va system-mailrc ) .
12750 Reading of this file can be suppressed, either by using the
12751 .Fl \&:
12752 (and according argument) or
12753 .Fl n
12754 command line options, or by setting the
12755 .Sx ENVIRONMENT
12756 variable
12757 .Ev MAILX_NO_SYSTEM_RC .
12760 .It Pa \*(ur
12761 File giving initial commands.
12762 A different file can be chosen by setting the
12763 .Sx ENVIRONMENT
12764 variable
12765 .Ev MAILRC .
12766 Reading of this file can be suppressed with the
12767 .Fl \&:
12768 command line option.
12770 .It Va mailx-extra-rc
12771 Defines a startup file to be read after all other resource files.
12772 It can be used to specify settings that are not understood by other
12773 .Xr mailx 1
12774 implementations, for example.
12775 This variable is only honoured when defined in a resource file, e.g.,
12776 it is one of the
12777 .Sx "INTERNAL VARIABLES" .
12781 The content of these files is interpreted as follows:
12784 .Bl -bullet -compact
12786 The whitespace characters space, tabulator and newline,
12787 as well as those defined by the variable
12788 .Va ifs ,
12789 are removed from the beginning and end of input lines.
12791 Empty lines are ignored.
12793 Any other line is interpreted as a command.
12794 It may be spread over multiple input lines if the newline character is
12795 .Dq escaped
12796 by placing a reverse solidus character
12797 .Ql \e
12798 as the last character of the line; whereas any leading whitespace of
12799 follow lines is ignored, trailing whitespace before a escaped newline
12800 remains in the input.
12802 If the line (content) starts with the number sign
12803 .Ql #
12804 then it is a comment-command and also ignored.
12805 (The comment-command is a real command, which does nothing, and
12806 therefore the usual follow lines mechanism applies!)
12810 Unless \*(UA is about to enter interactive mode syntax errors that occur
12811 while loading these files are treated as errors and cause program exit.
12812 More files with syntactically equal content can be
12813 .Ic source Ns ed .
12814 The following, saved in a file, would be an examplary content:
12816 .Bd -literal -offset indent
12817  # This line is a comment command.  And y\e
12818     es, it is really continued here.
12819 set debug \e
12820     verbose
12821     set editheaders
12823 .\" }}}
12825 .\" .Ss "The mime.types files" {{{
12826 .Ss "The mime.types files"
12828 As stated in
12829 .Sx "HTML mail and MIME attachments"
12830 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
12831 media types in order to classify message and attachment content.
12832 One source for them are
12833 .Pa mime.types
12834 files, the loading of which can be controlled by setting the variable
12835 .Va mimetypes-load-control .
12836 Another is the command
12837 .Ic mimetype ,
12838 which also offers access to \*(UAs MIME type cache.
12839 .Pa mime.types
12840 files have the following syntax:
12842 .Bd -literal -offset indent
12843 type/subtype extension [extension ...]
12844 # E.g., text/html html htm
12848 where
12849 .Ql type/subtype
12850 define the MIME media type, as standardized in RFC 2046:
12851 .Ql type
12852 is used to declare the general type of data, while the
12853 .Ql subtype
12854 specifies a specific format for that type of data.
12855 One or multiple filename
12856 .Ql extension Ns
12857 s, separated by whitespace, can be bound to the media type format.
12858 Comments may be introduced anywhere on a line with a number sign
12859 .Ql # ,
12860 causing the remaining line to be discarded.
12862 \*(UA also supports an extended, non-portable syntax in especially
12863 crafted files, which can be loaded via the alternative value syntax of
12864 .Va mimetypes-load-control ,
12865 and prepends an optional
12866 .Ql type-marker :
12869 .Dl [type-marker ]type/subtype extension [extension ...]
12872 The following type markers are supported:
12875 .Bl -tag -compact -width ".It Ar _n_u"
12876 .It Ar @
12877 Treat message parts with this content as plain text.
12878 .It Ar @t
12879 The same as plain
12880 .Ar @ .
12881 .It Ar @h
12882 Treat message parts with this content as HTML tagsoup.
12883 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
12884 the content as plain text instead.
12885 .It Ar @H
12886 Likewise
12887 .Ar @h ,
12888 but instead of falling back to plain text require an explicit content
12889 handler to be defined.
12890 .It Ar @q
12891 If no handler can be found a text message is displayed which says so.
12892 This can be annoying, for example signatures serve a contextual purpose,
12893 their content is of no use by itself.
12894 This marker will avoid displaying the text message.
12898 Further reading:
12899 for sending messages:
12900 .Ic mimetype ,
12901 .Va mime-allow-text-controls ,
12902 .Va mimetypes-load-control .
12903 For reading etc. messages:
12904 .Sx "HTML mail and MIME attachments" ,
12905 .Sx "The Mailcap files" ,
12906 .Ic mimetype ,
12907 .Va mime-counter-evidence ,
12908 .Va mimetypes-load-control ,
12909 .Va pipe-TYPE/SUBTYPE ,
12910 .Va pipe-EXTENSION .
12911 .\" }}}
12913 .\" .Ss "The Mailcap files" {{{
12914 .Ss "The Mailcap files"
12916 .\" TODO MAILCAP DISABLED
12917 .Sy This feature is not available in v14.9.0, sorry!
12918 RFC 1524 defines a
12919 .Dq User Agent Configuration Mechanism
12920 which \*(UA \*(OPally supports (see
12921 .Sx "HTML mail and MIME attachments" ) .
12922 It defines a file format to be used to inform mail user agent programs
12923 about the locally-installed facilities for handling various data
12924 formats, i.e., about commands and how they can be used to display, edit
12925 et cetera MIME part contents, as well as a default path search that
12926 includes multiple possible locations of
12927 .Dq mailcap
12928 files and the
12929 .Ev MAILCAPS
12930 environment variable that can be used to overwrite that (repeating here
12931 that it is not a search path, but instead a path search specification).
12932 Any existing files will be loaded in sequence, appending any content to
12933 the list of MIME type handler directives.
12936 .Dq Mailcap
12937 files consist of a set of newline separated entries.
12938 Comment lines start with a number sign
12939 .Ql #
12940 (in the first column!) and are ignored.
12941 Empty lines are also ignored.
12942 All other lines form individual entries that must adhere to the syntax
12943 described below.
12944 To extend a single entry (not comment) its line can be continued on
12945 follow lines if newline characters are
12946 .Dq escaped
12947 by preceding them with the reverse solidus character
12948 .Ql \e .
12949 The standard does not specify how leading whitespace of follow lines
12950 is to be treated, therefore \*(UA retains it.
12953 .Dq Mailcap
12954 entries consist of a number of semicolon
12955 .Ql \&;
12956 separated fields, and the reverse solidus
12957 .Ql \e
12958 character can be used to escape any following character including
12959 semicolon and itself.
12960 The first two fields are mandatory and must occur in the specified
12961 order, the remaining fields are optional and may appear in any order.
12962 Leading and trailing whitespace of content is ignored (removed).
12965 The first field defines the MIME
12966 .Ql TYPE/SUBTYPE
12967 the entry is about to handle (case-insensitively, and no reverse solidus
12968 escaping is possible in this field).
12969 If the subtype is specified as an asterisk
12970 .Ql *
12971 the entry is meant to match all subtypes of the named type, e.g.,
12972 .Ql audio/*
12973 would match any audio type.
12974 The second field defines the shell command which shall be used to
12975 .Dq display
12976 MIME parts of the given type; it is implicitly called the
12977 .Cd view
12978 command.
12981 For data
12982 .Dq consuming
12983 shell commands message (MIME part) data is passed via standard input
12984 unless the given shell command includes one or more instances of the
12985 (unquoted) string
12986 .Ql %s ,
12987 in which case these instances will be replaced with a temporary filename
12988 and the data will have been stored in the file that is being pointed to.
12989 Likewise, for data
12990 .Dq producing
12991 shell commands data is assumed to be generated on standard output unless
12992 the given command includes (one ore multiple)
12993 .Ql %s .
12994 In any case any given
12995 .Ql %s
12996 format is replaced with a(n already) properly quoted filename.
12997 Note that when a command makes use of a temporary file via
12998 .Ql %s
12999 then \*(UA will remove it again, as if the
13000 .Cd x-mailx-tmpfile ,
13001 .Cd x-mailx-tmpfile-fill
13003 .Cd x-mailx-tmpfile-unlink
13004 flags had been set; see below for more.
13007 The optional fields either define a shell command or an attribute (flag)
13008 value, the latter being a single word and the former being a keyword
13009 naming the field followed by an equals sign
13010 .Ql =
13011 succeeded by a shell command, and as usual for any
13012 .Dq Mailcap
13013 content any whitespace surrounding the equals sign will be removed, too.
13014 Optional fields include the following:
13017 .Bl -tag -width ".It Cd BaNg"
13018 .It Cd compose
13019 A program that can be used to compose a new body or body part in the
13020 given format.
13021 (Currently unused.)
13023 .It Cd composetyped
13024 Similar to the
13025 .Cd compose
13026 field, but is to be used when the composing program needs to specify the
13027 .Ql Content-type:
13028 header field to be applied to the composed data.
13029 (Currently unused.)
13031 .It Cd edit
13032 A program that can be used to edit a body or body part in the given
13033 format.
13034 (Currently unused.)
13036 .It Cd print
13037 A program that can be used to print a message or body part in the given
13038 format.
13039 (Currently unused.)
13041 .It Cd test
13042 Specifies a program to be run to test some condition, e.g., the machine
13043 architecture, or the window system in use, to determine whether or not
13044 this mailcap entry applies.
13045 If the test fails, a subsequent mailcap entry should be sought; also see
13046 .Cd x-mailx-test-once .
13049 .It Cd needsterminal
13050 This flag field indicates that the given shell command must be run on
13051 an interactive terminal.
13052 \*(UA will temporarily release the terminal to the given command in
13053 interactive mode, in non-interactive mode this entry will be entirely
13054 ignored; this flag implies
13055 .Cd x-mailx-noquote .
13058 .It Cd copiousoutput
13059 A flag field which indicates that the output of the
13060 .Cd view
13061 command will be an extended stream of textual output that can be
13062 (re)integrated into \*(UA's normal visual display.
13063 It is mutually exclusive with
13064 .Cd needsterminal .
13066 .It Cd textualnewlines
13067 A flag field which indicates that this type of data is line-oriented and
13068 that, if encoded in
13069 .Ql base64 ,
13070 all newlines should be converted to canonical form (CRLF) before
13071 encoding, and will be in that form after decoding.
13072 (Currently unused.)
13074 .It Cd nametemplate
13075 This field gives a filename format, in which
13076 .Ql %s
13077 will be replaced by a random string, the joined combination of which
13078 will be used as the filename denoted by
13079 .Ev MAILX_FILENAME_TEMPORARY .
13080 One could specify that a GIF file being passed to an image viewer should
13081 have a name ending in
13082 .Ql .gif
13083 by using
13084 .Ql nametemplate=%s.gif .
13085 Note that \*(UA ignores the name template unless that solely specifies
13086 a filename suffix that consists of (ASCII) alphabetic and numeric
13087 characters, the underscore and dot only.
13089 .It Cd x11-bitmap
13090 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
13091 icon to be used to visually denote the presence of this kind of data.
13092 This field is not used by \*(UA.
13094 .It Cd description
13095 A textual description that describes this type of data.
13098 .It Cd x-mailx-even-if-not-interactive
13099 An extension flag test field \(em by default handlers without
13100 .Cd copiousoutput
13101 are entirely ignored in non-interactive mode, but if this flag is set
13102 then their use will be considered.
13103 It is an error if this flag is set for commands that use the flag
13104 .Cd needsterminal .
13107 .It Cd x-mailx-noquote
13108 An extension flag field that indicates that even a
13109 .Cd copiousoutput
13110 .Cd view
13111 command shall not be used to generate message quotes
13112 (as it would be by default).
13115 .It Cd x-mailx-async
13116 Extension flag field that denotes that the given
13117 .Cd view
13118 command shall be executed asynchronously, without blocking \*(UA.
13119 Cannot be used in conjunction with
13120 .Cd needsterminal .
13123 .It Cd x-mailx-test-once
13124 Extension flag which denotes whether the given
13125 .Cd test
13126 command shall be evaluated once only and the (boolean) result be cached.
13127 This is handy if some global unchanging condition is to be queried, like
13128 .Dq running under the X Window System .
13131 .It Cd x-mailx-tmpfile
13132 Extension flag field that requests creation of a zero-sized temporary
13133 file, the name of which is to be placed in the environment variable
13134 .Ev MAILX_FILENAME_TEMPORARY .
13135 It is an error to use this flag with commands that include a
13136 .Ql %s
13137 format.
13140 .It Cd x-mailx-tmpfile-fill
13141 Normally the MIME part content is passed to the handler via standard
13142 input; if this flag is set then the data will instead be written into
13143 the implied
13144 .Cd x-mailx-tmpfile .
13145 In order to cause deletion of the temporary file you will have to set
13146 .Cd x-mailx-tmpfile-unlink
13147 explicitly!
13148 It is an error to use this flag with commands that include a
13149 .Ql %s
13150 format.
13153 .It Cd x-mailx-tmpfile-unlink
13154 Extension flag field that requests that the temporary file shall be
13155 deleted automatically when the command loop is entered again at latest.
13156 (Do not use this for asynchronous handlers.)
13157 It is an error to use this flag with commands that include a
13158 .Ql %s
13159 format, or in conjunction with
13160 .Cd x-mailx-async ,
13161 or without also setting
13162 .Cd x-mailx-tmpfile
13164 .Cd x-mailx-tmpfile-fill .
13167 .It Cd x-mailx-tmpfile-keep
13168 Using the string
13169 .Ql %s
13170 implies the three tmpfile related flags above, but if you want, e.g.,
13171 .Cd x-mailx-async
13172 and deal with the temporary file yourself, you can add in this flag to
13173 forcefully ignore
13174 .Cd x-mailx-tmpfile-unlink .
13179 The standard includes the possibility to define any number of additional
13180 entry fields, prefixed by
13181 .Ql x- .
13182 Flag fields apply to the entire
13183 .Dq Mailcap
13184 entry \(em in some unusual cases, this may not be desirable, but
13185 differentiation can be accomplished via separate entries, taking
13186 advantage of the fact that subsequent entries are searched if an earlier
13187 one does not provide enough information.
13188 E.g., if a
13189 .Cd view
13190 command needs to specify the
13191 .Cd needsterminal
13192 flag, but the
13193 .Cd compose
13194 command shall not, the following will help out the latter (with enabled
13195 .Va debug
13196 or an increased
13197 .Va verbose
13198 level \*(UA will show information about handler evaluation):
13200 .Bd -literal -offset indent
13201 application/postscript; ps-to-terminal %s; needsterminal
13202 application/postscript; ps-to-terminal %s; compose=idraw %s
13206 In fields any occurrence of the format string
13207 .Ql %t
13208 will be replaced by the
13209 .Ql TYPE/SUBTYPE
13210 specification.
13211 Named parameters from the
13212 .Ql Content-type:
13213 field may be placed in the command execution line using
13214 .Ql %{
13215 followed by the parameter name and a closing
13216 .Ql }
13217 character.
13218 The entire parameter should appear as a single command line argument,
13219 regardless of embedded spaces; thus:
13221 .Bd -literal -offset indent
13222 # Message
13223 Content-type:  multipart/mixed; boundary=42
13225 # Mailcap file
13226 multipart/*; /usr/local/bin/showmulti \e
13227   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
13229 # Executed shell command
13230 /usr/local/bin/showmulti multipart/mixed 42
13234 .\" TODO v15: Mailcap: %n,%F
13235 Note that \*(UA does not support handlers for multipart MIME parts as
13236 shown in this example (as of today).
13237 \*(UA does not support the additional formats
13238 .Ql %n
13240 .Ql %F .
13241 An example file, also showing how to properly deal with the expansion of
13242 .Ql %s ,
13243 which includes any quotes that are necessary to make it a valid shell
13244 argument by itself and thus will cause undesired behaviour when placed
13245 in additional user-provided quotes:
13247 .Bd -literal -offset indent
13248 # Comment line
13249 text/richtext; richtext %s; copiousoutput
13251 text/x-perl; perl -cWT %s
13253 application/pdf; \e
13254   infile=%s\e; \e
13255     trap "rm -f ${infile}" EXIT\e; \e
13256     trap "exit 75" INT QUIT TERM\e; \e
13257     mupdf %s; \e
13258   x-mailx-async; x-mailx-tmpfile-keep
13260 application/*; echo "This is \e"%t\e" but \e
13261     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vet; \e
13262   copiousoutput; x-mailx-noquote
13266 Further reading:
13267 .Sx "HTML mail and MIME attachments" ,
13268 .Sx "The mime.types files" ,
13269 .Ic mimetype ,
13270 .Ev MAILCAPS ,
13271 .Va mime-counter-evidence ,
13272 .Va pipe-TYPE/SUBTYPE ,
13273 .Va pipe-EXTENSION .
13274 .\" }}}
13276 .\" .Ss "The .netrc file" {{{
13277 .Ss "The .netrc file"
13280 .Pa .netrc
13281 file contains user credentials for machine accounts.
13282 The default location
13283 .Pa \*(VN
13284 may be overridden by the
13285 .Ev NETRC
13286 environment variable.
13287 It is possible to load encrypted
13288 .Pa .netrc
13289 files by using an appropriate value in
13290 .Va netrc-pipe .
13293 The file consists of space, tabulator or newline separated tokens.
13294 \*(UA implements a parser that supports a superset of the original BSD
13295 syntax, but users should nonetheless be aware of portability glitches
13296 of that file format, shall their
13297 .Pa .netrc
13298 be usable across multiple programs and platforms:
13301 .Bl -bullet -compact
13303 BSD does not support single, but only double quotation marks, e.g.,
13304 .Ql password="pass with spaces" .
13306 BSD (only?) supports escaping of single characters via a reverse solidus
13307 (e.g., a space can be escaped via
13308 .Ql \e\0 ) ,
13309 in- as well as outside of a quoted string.
13311 BSD does not require a final quotation mark of the last user input token.
13313 The original BSD (Berknet) parser also supported a format which allowed
13314 tokens to be separated with commas \(en whereas at least Hewlett-Packard
13315 still seems to support this syntax, \*(UA does not!
13317 As a non-portable extension some widely-used programs support
13318 shell-style comments: if an input line starts, after any amount of
13319 whitespace, with a number sign
13320 .Ql # ,
13321 then the rest of the line is ignored.
13323 Whereas other programs may require that the
13324 .Pa .netrc
13325 file is accessible by only the user if it contains a
13326 .Cd password
13327 token for any other
13328 .Cd login
13329 than
13330 .Dq anonymous ,
13331 \*(UA will always require these strict permissions.
13335 Of the following list of supported tokens \*(UA only uses (and caches)
13336 .Cd machine ,
13337 .Cd login
13339 .Cd password .
13340 At runtime the command
13341 .Ic netrc
13342 can be used to control \*(UA's
13343 .Pa .netrc
13344 cache.
13346 .Bl -tag -width ".It Cd BaNg"
13347 .It Cd machine Ar name
13348 The hostname of the entries' machine, lowercase-normalized by \*(UA
13349 before use.
13350 Any further file content, until either end-of-file or the occurrence
13351 of another
13352 .Cd machine
13353 or a
13354 .Cd default
13355 first-class token is bound (only related) to the machine
13356 .Ar name .
13358 As an extension that should not be the cause of any worries
13359 \*(UA supports a single wildcard prefix for
13360 .Ar name :
13361 .Bd -literal -offset indent
13362 machine *.example.com login USER password PASS
13363 machine pop3.example.com login USER password PASS
13364 machine smtp.example.com login USER password PASS
13367 which would match
13368 .Ql xy.example.com
13369 as well as
13370 .Ql pop3.example.com ,
13371 but neither
13372 .Ql example.com
13374 .Ql local.smtp.example.com .
13375 Note that in the example neither
13376 .Ql pop3.example.com
13378 .Ql smtp.example.com
13379 will be matched by the wildcard, since the exact matches take
13380 precedence (it is however faster to specify it the other way around).
13382 .It Cd default
13383 This is the same as
13384 .Cd machine
13385 except that it is a fallback entry that is used shall none of the
13386 specified machines match; only one default token may be specified,
13387 and it must be the last first-class token.
13389 .It Cd login Ar name
13390 The user name on the remote machine.
13392 .It Cd password Ar string
13393 The user's password on the remote machine.
13395 .It Cd account Ar string
13396 Supply an additional account password.
13397 This is merely for FTP purposes.
13399 .It Cd macdef Ar name
13400 Define a macro.
13401 A macro is defined with the specified
13402 .Ar name ;
13403 it is formed from all lines beginning with the next line and continuing
13404 until a blank line is (consecutive newline characters are) encountered.
13405 (Note that
13406 .Cd macdef
13407 entries cannot be utilized by multiple machines, too, but must be
13408 defined following the
13409 .Ic machine
13410 they are intended to be used with.)
13411 If a macro named
13412 .Ar init
13413 exists, it is automatically run as the last step of the login process.
13414 This is merely for FTP purposes.
13416 .\" }}}
13418 .\" }}}
13421 .\" .Sh EXAMPLES {{{
13422 .Sh EXAMPLES
13424 .\" .Ss "An example configuration" {{{
13425 .Ss "An example configuration"
13427 .Bd -literal -offset indent
13428 # This example assumes v15.0 compatibility mode
13429 set v15-compat
13431 # Request strict SSL/TLS transport security checks
13432 set ssl-verify=strict
13434 # Where are the up-to-date SSL/TLS certificates?
13435 # (Since we manage up-to-date ones explicitly, do not use any,
13436 # possibly outdated, default certificates shipped with OpenSSL)
13437 #set ssl-ca-dir=/etc/ssl/certs
13438 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
13439 set ssl-ca-no-defaults
13440 #set ssl-ca-flags=partial-chain
13441 wysh set smime-ca-file="${ssl-ca-file}" \e
13442   smime-ca-no-defaults #smime-ca-flags="${ssl-ca-flags}"
13444 # This could be outsourced to a central configuration file via
13445 # ssl-config-file plus ssl-config-module if the used library allows.
13446 # CipherString: explicitly define the list of ciphers, which may
13447 #   improve security, especially with protocols older than TLS v1.2.
13448 #   See ciphers(1).  Possibly best to only use ssl-cipher-list-HOST
13449 #   (or -USER@HOST), as necessary, again..
13450 #   Note that TLSv1.3 uses Ciphersuites= instead, which will join
13451 #   with CipherString (if protocols older than v1.3 are allowed)
13452 # Curves: especially with TLSv1.3 curves selection may be desired.
13453 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
13454 #   Change this only when the remote server does not support it:
13455 #   maybe use chain support via ssl-config-pairs-HOST / -USER@HOST
13456 #   to define such explicit exceptions, then, e.g.
13457 #     MinProtocol=TLSv1.1
13458 if [ "$ssl-features" =% +ctx-set-maxmin-proto ]
13459   wysh set ssl-config-pairs='\e
13460       CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
13461       Curves=P-521:P-384:P-256,\e
13462       MinProtocol=TLSv1.1'
13463 else
13464   wysh set ssl-config-pairs='\e
13465       CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
13466       Curves=P-521:P-384:P-256,\e
13467       Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2\e, +TLSv1.3'
13468 endif
13470 # Essential setting: select allowed character sets
13471 set sendcharsets=utf-8,iso-8859-1
13473 # A very kind option: when replying to a message, first try to
13474 # use the same encoding that the original poster used herself!
13475 set reply-in-same-charset
13477 # When replying, do not merge From: and To: of the original message
13478 # into To:.  Instead old From: -> new To:, old To: -> merge Cc:.
13479 set recipients-in-cc
13481 # When sending messages, wait until the Mail-Transfer-Agent finishs.
13482 # Only like this you will be able to see errors reported through the
13483 # exit status of the MTA (including the built-in SMTP one)!
13484 set sendwait
13486 # Only use built-in MIME types, no mime.types(5) files
13487 set mimetypes-load-control
13489 # Default directory where we act in (relative to $HOME)
13490 set folder=mail
13491 # A leading "+" (often) means: under *folder*
13492 # *record* is used to save copies of sent messages
13493 set MBOX=+mbox.mbox DEAD=+dead.txt \e
13494   record=+sent.mbox record-files record-resent
13496 # Make "file mymbox" and "file myrec" go to..
13497 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
13499 # Not really optional, e.g., for S/MIME
13500 set from='Your Name <address@exam.ple>'
13502 # It may be necessary to set hostname and/or smtp-hostname
13503 # if the "SERVER" of mta and "domain" of from do not match.
13504 # The `urlencode' command can be used to encode USER and PASS
13505 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
13506   smtp-auth=login/plain... \e
13507   smtp-use-starttls
13509 # Never refuse to start into interactive mode, and more
13510 set emptystart \e
13511   colour-pager crt= \e
13512   followup-to followup-to-honour=ask-yes fullnames \e
13513   history-file=+.\*(uAhist history-size=-1 history-gabby \e
13514   mime-counter-evidence=0b1111 \e
13515   prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
13516   reply-to-honour=ask-yes \e
13517   umask=
13519 # Only include the selected header fields when typing messages
13520 headerpick type retain from_ date from to cc subject \e
13521   message-id mail-followup-to reply-to
13522 # ...when forwarding messages
13523 headerpick forward retain subject date from to cc
13524 # ...when saving message, etc.
13525 #headerpick save ignore ^Original-.*$ ^X-.*$
13527 # Some mailing lists
13528 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
13529 mlsubscribe '^xfans@xfans\e.xyz$'
13531 # Handle a few file extensions (to store MBOX databases)
13532 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
13533   gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
13534   zst 'zstd -dc' 'zstd -19 -zc' \e
13535   zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
13537 # A real life example of a very huge free mail provider
13538 # Instead of directly placing content inside `account',
13539 # we `define' a macro: like that we can switch "accounts"
13540 # from within *on-compose-splice*, for example!
13541 define XooglX {
13542   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
13543   set from='Your Name <address@examp.ple>'
13545   set pop3-no-apop-pop.gmXil.com
13546   shortcut pop %:pop3s://pop.gmXil.com
13547   shortcut imap %:imaps://imap.gmXil.com
13548   # Or, entirely IMAP based setup
13549   #set folder=imaps://imap.gmail.com record="+[Gmail]/Sent Mail" \e
13550   #   imap-cache=~/spool/cache
13552   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
13553   # Alternatively:
13554   set mta=smtps://USER:PASS@smtp.gmail.com:465
13556 account XooglX {
13557   \ecall XooglX
13560 # Here is a pretty large one which does not allow sending mails
13561 # if there is a domain name mismatch on the SMTP protocol level,
13562 # which would bite us if the value of from does not match, e.g.,
13563 # for people who have a sXXXXeforge project and want to speak
13564 # with the mailing list under their project account (in from),
13565 # still sending the message through their normal mail provider
13566 define XandeX {
13567   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
13568   set from='Your Name <address@exam.ple>'
13570   shortcut pop %:pop3s://pop.yaXXex.com
13571   shortcut imap %:imaps://imap.yaXXex.com
13573   set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
13574     hostname=yaXXex.com smtp-hostname=
13576 account XandeX {
13577   \ecall Xandex
13580 # Create some new commands so that, e.g., `ls /tmp' will..
13581 commandalias lls '!ls ${LS_COLOUR_FLAG} -aFlrS'
13582 commandalias llS '!ls ${LS_COLOUR_FLAG} -aFlS'
13584 set pipe-message/external-body='@* echo $MAILX_EXTERNAL_BODY_URL'
13586 # We do not support gpg(1) directly yet.  But simple --clearsign'd
13587 # message parts can be dealt with as follows:
13588 define V {
13589   localopts yes
13590   wysh set pipe-text/plain=$'@*#++=@\e
13591     < "${MAILX_FILENAME_TEMPORARY}" awk \e
13592         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
13593       BEGIN{done=0}\e
13594       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
13595         if(done++ != 0)\e
13596           next;\e
13597         print "--- GPG --verify ---";\e
13598         system("gpg --verify " TMPFILE " 2>&1");\e
13599         print "--- GPG --verify ---";\e
13600         print "";\e
13601         next;\e
13602       }\e
13603       /^-----BEGIN PGP SIGNATURE-----/,\e
13604           /^-----END PGP SIGNATURE-----/{\e
13605         next;\e
13606       }\e
13607       {print}\e
13608     \e''
13609     print
13611 commandalias V '\e'call V
13615 When storing passwords in
13616 .Pa \*(ur
13617 appropriate permissions should be set on this file with
13618 .Ql $ chmod 0600 \*(ur .
13619 If the \*(OPal
13620 .Va netrc-lookup
13621 is available user credentials can be stored in the central
13622 .Pa \*(VN
13623 file instead; e.g., here is a different version of the example account
13624 that sets up SMTP and POP3:
13626 .Bd -literal -offset indent
13627 define XandeX {
13628   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
13629   set from='Your Name <address@exam.ple>'
13630   set netrc-lookup
13631   # Load an encrypted ~/.netrc by uncommenting the next line
13632   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
13634   set mta=smtps://smtp.yXXXXx.ru:465 \e
13635       smtp-hostname= hostname=yXXXXx.com
13636   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
13637   commandalias xp fi pop3s://pop.yXXXXx.ru
13639 account XandeX {
13640   \ecall XandeX
13645 and, in the
13646 .Pa \*(VN
13647 file:
13649 .Bd -literal -offset indent
13650 machine *.yXXXXx.ru login USER password PASS
13654 This configuration should now work just fine:
13657 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
13658 .\" }}}
13660 .\" .Ss "S/MIME step by step" {{{
13661 .Ss "S/MIME step by step"
13663 \*(OP The first thing that is needed for
13664 .Sx "Signed and encrypted messages with S/MIME"
13665 is a personal certificate, and a private key.
13666 The certificate contains public information, in particular a name and
13667 email address(es), and the public key that can be used by others to
13668 encrypt messages for the certificate holder (the owner of the private
13669 key), and to
13670 .Ic verify
13671 signed messages generated with that certificate('s private key).
13672 Whereas the certificate is included in each signed message, the private
13673 key must be kept secret.
13674 It is used to decrypt messages that were previously encrypted with the
13675 public key, and to sign messages.
13678 For personal use it is recommended that get a S/MIME certificate from
13679 one of the major CAs on the Internet.
13680 Many CAs offer such certificates for free.
13681 Usually offered is a combined certificate and private key in PKCS#12
13682 format which \*(UA does not accept directly.
13683 To convert it to PEM format, the following shell command can be used;
13684 please read on for how to use these PEM files.
13686 .Bd -literal -offset indent
13687 $ openssl pkcs12 -in cert.p12 -out certpem.pem -clcerts -nodes
13688 $ # Alternatively
13689 $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
13690 $ openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
13694 There is also
13695 .Lk https://www.CAcert.org
13696 which issues client and server certificates to members of their
13697 community for free; their root certificate
13698 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
13699 is often not in the default set of trusted CA root certificates, though,
13700 which means their root certificate has to be downloaded separately,
13701 and needs to be part of the S/MIME certificate validation chain by
13702 including it in
13703 .Va smime-ca-dir
13704 or as a vivid member of the
13705 .Va smime-ca-file .
13706 But let us take a step-by-step tour on how to setup S/MIME with
13707 a certificate from CAcert.org despite this situation!
13710 First of all you will have to become a member of the CAcert.org
13711 community, simply by registrating yourself via the web interface.
13712 Once you are, create and verify all email addresses you want to be able
13713 to create signed and encrypted messages for/with using the corresponding
13714 entries of the web interface.
13715 Now ready to create S/MIME certificates, so let us create a new
13716 .Dq client certificate ,
13717 ensure to include all email addresses that should be covered by the
13718 certificate in the following web form, and also to use your name as the
13719 .Dq common name .
13722 Create a private key and a certificate request on your local computer
13723 (please see the manual pages of the used commands for more in-depth
13724 knowledge on what the used arguments etc. do):
13727 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
13730 Afterwards copy-and-paste the content of
13731 .Dq creq.pem
13732 into the certificate-request (CSR) field of the web form on the
13733 CAcert.org website (you may need to unfold some
13734 .Dq advanced options
13735 to see the corresponding text field).
13736 This last step will ensure that your private key (which never left your
13737 box) and the certificate belong together (through the public key that
13738 will find its way into the certificate via the certificate-request).
13739 You are now ready and can create your CAcert certified certificate.
13740 Download and store or copy-and-paste it as
13741 .Dq pub.crt .
13744 Yay.
13745 In order to use your new S/MIME setup a combined private key/public key
13746 (certificate) file has to be created:
13749 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
13752 This is the file \*(UA will work with.
13753 If you have created your private key with a passphrase then \*(UA will
13754 ask you for it whenever a message is signed or decrypted, unless this
13755 operation has been automatized as described in
13756 .Sx "Signed and encrypted messages with S/MIME" .
13757 Set the following variables to henceforth use S/MIME (setting
13758 .Va smime-ca-file
13759 is of interest for verification only):
13761 .Bd -literal -offset indent
13762 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
13763     smime-sign-cert=ME@HERE.com.paired \e
13764     smime-sign-message-digest=SHA256 \e
13765     smime-sign
13768 .\" }}}
13770 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
13771 .Ss "Using CRLs with S/MIME or SSL/TLS"
13773 \*(OP Certification authorities (CAs) issue certificate revocation
13774 lists (CRLs) on a regular basis.
13775 These lists contain the serial numbers of certificates that have been
13776 declared invalid after they have been issued.
13777 Such usually happens because the private key for the certificate has
13778 been compromised,
13779 because the owner of the certificate has left the organization that is
13780 mentioned in the certificate, etc.
13781 To seriously use S/MIME or SSL/TLS verification,
13782 an up-to-date CRL is required for each trusted CA.
13783 There is otherwise no method to distinguish between valid and
13784 invalidated certificates.
13785 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
13786 the Internet, so they have to be retrieved by some external mechanism.
13789 \*(UA accepts CRLs in PEM format only;
13790 CRLs in DER format must be converted, like, e.\|g.:
13793 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
13796 To tell \*(UA about the CRLs, a directory that contains all CRL files
13797 (and no other files) must be created.
13799 .Va smime-crl-dir
13801 .Va ssl-crl-dir
13802 variables, respectively, must then be set to point to that directory.
13803 After that, \*(UA requires a CRL to be present for each CA that is used
13804 to verify a certificate.
13805 .\" }}}
13807 .\" }}} (Examples)
13810 .\" .Sh "FAQ" {{{
13811 .Sh "FAQ"
13813 In general it is a good idea to turn on
13814 .Va debug
13815 .Pf ( Fl d )
13816 and / or
13817 .Va verbose
13818 .Pf ( Fl v ,
13819 twice) if something does not work well.
13820 Very often a diagnostic message can be produced that leads to the
13821 problems' solution.
13823 .\" .Ss "\*(UA shortly hangs on startup" {{{
13824 .Ss "\*(UA shortly hangs on startup"
13826 This can have two reasons, one is the necessity to wait for a file lock
13827 and cannot be helped, the other being that \*(UA calls the function
13828 .Xr uname 2
13829 in order to query the nodename of the box (sometimes the real one is
13830 needed instead of the one represented by the internal variable
13831 .Va hostname ) .
13832 One may have varying success by ensuring that the real hostname and
13833 .Ql localhost
13834 have entries in
13835 .Pa /etc/hosts ,
13836 or, more generally, that the name service is properly setup \(en
13837 and does
13838 .Xr hostname 1
13839 return the expected value?
13840 Does this local hostname have a domain suffix?
13841 RFC 6762 standardized the link-local top-level domain
13842 .Ql .local ,
13843 try again after adding an (additional) entry with this extension.
13844 .\" }}}
13846 .\" .Ss "I cannot login to Google mail aka GMail" {{{
13847 .Ss "I cannot login to Google mail aka GMail"
13849 Since 2014 some free service providers classify programs as
13850 .Dq less secure
13851 unless they use a special authentication method (OAuth 2.0) which
13852 was not standardized for non-HTTP protocol authentication token query
13853 until August 2015 (RFC 7628).
13856 Different to Kerberos / GSSAPI, which is developed since the mid of the
13857 1980s, where a user can easily create a local authentication ticket for
13858 her- and himself with the locally installed
13859 .Xr kinit 1
13860 program, that protocol has no such local part but instead requires
13861 a world-wide-web query to create or fetch a token; since there is no
13862 local cache this query would have to be performed whenever \*(UA is
13863 invoked (in interactive sessions situation may differ).
13866 \*(UA does not support OAuth.
13867 Because of this it is necessary to declare \*(UA a
13868 .Dq less secure app
13869 (on the providers account web page) in order to read and send mail.
13870 However, it also seems possible to take the following steps instead:
13873 .Bl -enum -compact
13875 give the provider the number of a mobile phone,
13877 enable
13878 .Dq 2-Step Verification ,
13880 create an application specific password (16 characters), and
13882 use that special password instead of the real Google account password in
13883 \*(UA (for more on that see the section
13884 .Sx "On URL syntax and credential lookup" ) .
13886 .\" }}}
13888 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
13889 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
13891 It can happen that the terminal library (see
13892 .Sx "On terminal control and line editor",
13893 .Ic bind ,
13894 .Va termcap )
13895 reports different codes than the terminal really sends, in which case
13896 \*(UA will tell that a key binding is functional, but will not be able to
13897 recognize it because the received data does not match anything expected.
13898 Especially without the \*(OPal terminal capability library support one
13899 reason for this may be that the (possibly even non-existing) keypad
13900 is not turned on and the resulting layout reports the keypad control
13901 codes for the normal keyboard keys.
13903 .Va verbose
13904 listing of
13905 .Ic bind Ns
13906 ings will show the byte sequences that are expected.
13909 To overcome the situation, use, e.g., the program
13910 .Xr cat 1 ,
13911 in conjunction with the command line option
13912 .Fl \&\&v ,
13913 if available, to see the byte sequences which are actually produced
13914 by keypresses, and use the variable
13915 .Va termcap
13916 to make \*(UA aware of them.
13917 E.g., the terminal this is typed on produces some false sequences, here
13918 an example showing the shifted home key:
13920 .Bd -literal -offset indent
13921 ? set verbose
13922 ? bind*
13923 # 1B 5B=[ 31=1 3B=; 32=2 48=H
13924   bind base :kHOM z0
13925 ? x
13926 $ cat -v
13927 ^[[H
13928 ? \*(uA -v -Stermcap='kHOM=\eE[H'
13929 ? bind*
13930 # 1B 5B=[ 48=H
13931   bind base :kHOM z0
13933 .\" }}}
13935 .\" .Ss "Can \*(UA git-send-email?" {{{
13936 .Ss "Can \*(UA git-send-email?"
13938 Yes.
13939 Put (at least parts of) the following in your
13940 .Pa ~/.gitconfig :
13942 .Bd -literal -offset indent
13943 [sendemail]
13944 smtpserver = /usr/bin/s-mailx
13945 smtpserveroption = -t
13946 #smtpserveroption = -Sexpandaddr
13947 smtpserveroption = -Athe-account-you-need
13949 suppresscc = all
13950 suppressfrom = false
13951 assume8bitEncoding = UTF-8
13952 #to = /tmp/OUT
13953 confirm = always
13954 chainreplyto = true
13955 multiedit = false
13956 thread = true
13957 quiet = true
13958 annotate = true
13960 .\" }}}
13962 .\" }}}
13965 .\" .Sh "IMAP CLIENT" {{{
13966 .Sh "IMAP CLIENT"
13968 \*(OPally there is IMAP client support available.
13969 This part of the program is obsolete and will vanish in v15 with the
13970 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
13971 and makes excessive use of signal based long code jumps.
13972 Support can hopefully be readded later based on a new-style I/O, with
13973 SysV signal handling.
13974 In fact the IMAP support had already been removed from the codebase, but
13975 was reinstantiated on user demand: in effect the IMAP code is at the
13976 level of \*(UA v14.8.16 (with
13977 .Ic imapcodec
13978 being the sole exception), and should be treated with some care.
13981 IMAP uses the
13982 .Ql imap://
13984 .Ql imaps://
13985 protocol prefixes, and an IMAP-based
13986 .Va folder
13987 may be used.
13988 IMAP URLs (paths) undergo inspections and possible transformations
13989 before use (and the command
13990 .Ic imapcodec
13991 can be used to manually apply them to any given argument).
13992 Hierarchy delimiters are normalized, a step which is configurable via the
13993 .Va imap-delim
13994 variable chain, but defaults to the first seen delimiter otherwise.
13995 \*(UA supports internationalised IMAP names, and en- and decodes the
13996 names from and to the
13997 .Va ttycharset
13998 as necessary and possible.
13999 If a mailbox name is expanded (see
14000 .Sx "Filename transformations" )
14001 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
14002 mailboxes below the
14003 .Va folder
14004 target box, while folder names prefixed by `@' refer to folders below
14005 the hierarchy base, e.g., the following lists all folders below the
14006 current one when in an IMAP mailbox:
14007 .Ql folders @ .
14010 Note: some IMAP servers do not accept the creation of mailboxes in
14011 the hierarchy base, but require that they are created as subfolders of
14012 `INBOX' \(en with such servers a folder name of the form
14014 .Dl imaps://mylogin@imap.myisp.example/INBOX.
14016 should be used (the last character is the server's hierarchy
14017 delimiter).
14018 The following IMAP-specific commands exist:
14021 .Bl -tag -width ".It Ic BaNg"
14023 .It Ic cache
14024 Only applicable to cached IMAP mailboxes;
14025 takes a message list and reads the specified messages into the IMAP
14026 cache.
14029 .It Ic connect
14030 If operating in disconnected mode on an IMAP mailbox,
14031 switch to online mode and connect to the mail server while retaining
14032 the mailbox status.
14033 See the description of the
14034 .Va disconnected
14035 variable for more information.
14038 .It Ic disconnect
14039 If operating in online mode on an IMAP mailbox,
14040 switch to disconnected mode while retaining the mailbox status.
14041 See the description of the
14042 .Va disconnected
14043 variable for more.
14044 A list of messages may optionally be given as argument;
14045 the respective messages are then read into the cache before the
14046 connection is closed, thus
14047 .Ql disco *
14048 makes the entire mailbox available for disconnected use.
14051 .It Ic imap
14052 Sends command strings directly to the current IMAP server.
14053 \*(UA operates always in IMAP `selected state' on the current mailbox;
14054 commands that change this will produce undesirable results and should be
14055 avoided.
14056 Useful IMAP commands are:
14057 .Bl -tag -offset indent -width ".Ic getquotearoot"
14058 .It create
14059 Takes the name of an IMAP mailbox as an argument and creates it.
14060 .It getquotaroot
14061 (RFC 2087) Takes the name of an IMAP mailbox as an argument
14062 and prints the quotas that apply to the mailbox.
14063 Not all IMAP servers support this command.
14064 .It namespace
14065 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
14066 the Other User's Namespaces and the Shared Namespaces.
14067 Each namespace type is printed in parentheses;
14068 if there are multiple namespaces of the same type,
14069 inner parentheses separate them.
14070 For each namespace a prefix and a hierarchy separator is listed.
14071 Not all IMAP servers support this command.
14075 .It Ic imapcodec
14076 Perform IMAP path transformations.
14077 Supports
14078 .Cm vput
14079 (see
14080 .Sx "Command modifiers" ) ,
14081 and manages the error number
14082 .Va \&! .
14083 The first argument specifies the operation:
14084 .Ar e[ncode]
14085 normalizes hierarchy delimiters (see
14086 .Va imap-delim )
14087 and converts the strings from the locale
14088 .Va ttycharset
14089 to the internationalized variant used by IMAP,
14090 .Ar d[ecode]
14091 performs the reverse operation.
14096 The following IMAP-specific internal variables exist:
14099 .Bl -tag -width ".It Va BaNg"
14101 .It Va disconnected
14102 \*(BO When an IMAP mailbox is selected and this variable is set,
14103 no connection to the server is initiated.
14104 Instead, data is obtained from the local cache (see
14105 .Va imap-cache Ns
14107 Mailboxes that are not present in the cache
14108 and messages that have not yet entirely been fetched from the server
14109 are not available;
14110 to fetch all messages in a mailbox at once,
14111 the command
14112 .No ` Ns Li copy * /dev/null Ns '
14113 can be used while still in connected mode.
14114 Changes that are made to IMAP mailboxes in disconnected mode are queued
14115 and committed later when a connection to that server is made.
14116 This procedure is not completely reliable since it cannot be guaranteed
14117 that the IMAP unique identifiers (UIDs) on the server still match the
14118 ones in the cache at that time.
14119 Data is saved to
14120 .Ev DEAD
14121 when this problem occurs.
14123 .It Va disconnected-USER@HOST
14124 The specified account is handled as described for the
14125 .Va disconnected
14126 variable above,
14127 but other accounts are not affected.
14129 .Mx Va imap-auth
14130 .It Va imap-auth-USER@HOST , imap-auth
14131 Sets the IMAP authentication method.
14132 Valid values are `login' for the usual password-based authentication
14133 (the default),
14134 `cram-md5', which is a password-based authentication that does not send
14135 the password over the network in clear text,
14136 and `gssapi' for GSS-API based authentication.
14139 .It Va imap-cache
14140 Enables caching of IMAP mailboxes.
14141 The value of this variable must point to a directory that is either
14142 existent or can be created by \*(UA.
14143 All contents of the cache can be deleted by \*(UA at any time;
14144 it is not safe to make assumptions about them.
14146 .Mx Va imap-delim
14147 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
14148 The hierarchy separator used by the IMAP server.
14149 Whenever an IMAP path is specified it will undergo normalization.
14150 One of the normalization steps is the squeezing and adjustment of
14151 hierarchy separators.
14152 If this variable is set, any occurrence of any character of the given
14153 value that exists in the path will be replaced by the first member of
14154 the value; an empty value will cause the default to be used, it is
14155 .Ql /. .
14156 If not set, we will reuse the first hierarchy separator character that
14157 is discovered in a user-given mailbox name.
14159 .Mx Va imap-keepalive
14160 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
14161 IMAP servers may close the connection after a period of
14162 inactivity; the standard requires this to be at least 30 minutes,
14163 but practical experience may vary.
14164 Setting this variable to a numeric `value' greater than 0 causes
14165 a `NOOP' command to be sent each `value' seconds if no other operation
14166 is performed.
14169 .It Va imap-list-depth
14170 When retrieving the list of folders on an IMAP server, the
14171 .Ic folders
14172 command stops after it has reached a certain depth to avoid possible
14173 infinite loops.
14174 The value of this variable sets the maximum depth allowed.
14175 The default is 2.
14176 If the folder separator on the current IMAP server is a slash `/',
14177 this variable has no effect and the
14178 .Ic folders
14179 command does not descend to subfolders.
14181 .Mx Va imap-use-starttls
14182 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
14183 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
14184 IMAP session SSL/TLS encrypted.
14185 This functionality is not supported by all servers,
14186 and is not used if the session is already encrypted by the IMAPS method.
14189 .\" }}}
14192 .\" .Sh "SEE ALSO" {{{
14193 .Sh "SEE ALSO"
14195 .Xr bogofilter 1 ,
14196 .Xr gpg 1 ,
14197 .Xr more 1 ,
14198 .Xr newaliases 1 ,
14199 .Xr openssl 1 ,
14200 .Xr sendmail 1 ,
14201 .Xr sh 1 ,
14202 .Xr spamassassin 1 ,
14203 .Xr iconv 3 ,
14204 .Xr setlocale 3 ,
14205 .Xr aliases 5 ,
14206 .Xr termcap 5 ,
14207 .Xr terminfo 5 ,
14208 .Xr locale 7 ,
14209 .Xr mailaddr 7 ,
14210 .Xr re_format 7 ,
14211 .Xr mailwrapper 8 ,
14212 .Xr sendmail 8
14214 .\" }}}
14217 .\" .Sh HISTORY {{{
14218 .Sh HISTORY
14220 M. Douglas McIlroy writes in his article
14221 .Dq A Research UNIX Reader: Annotated Excerpts \
14222 from the Programmer's Manual, 1971-1986
14223 that a
14224 .Xr mail 1
14225 command already appeared in First Edition
14227 in 1971:
14229 .Bd -ragged -offset indent
14230 Electronic mail was there from the start.
14231 Never satisfied with its exact behavior, everybody touched it at one
14232 time or another: to assure the safety of simultaneous access, to improve
14233 privacy, to survive crashes, to exploit uucp, to screen out foreign
14234 freeloaders, or whatever.
14235 Not until v7 did the interface change (Thompson).
14236 Later, as mail became global in its reach, Dave Presotto took charge and
14237 brought order to communications with a grab-bag of external networks
14238 (v8).
14243 Mail was written in 1978 by Kurt Shoens and developed as part of the
14246 distribution until 1995.
14247 Mail has then seen further development in open source
14249 variants, noticeably by Christos Zoulas in
14250 .Pf Net Bx .
14251 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
14252 Ritter in the years 2000 until 2008.
14253 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
14254 This man page is derived from
14255 .Dq The Mail Reference Manual
14256 that was originally written by Kurt Shoens.
14258 .\" }}}
14261 .Sh AUTHORS
14263 .An -nosplit
14264 .An "Kurt Shoens" ,
14265 .An "Edward Wang" ,
14266 .An "Keith Bostic" ,
14267 .An "Christos Zoulas" ,
14268 .An "Gunnar Ritter" .
14269 \*(UA is developed by
14270 .An "Steffen Nurpmeso" Aq steffen@sdaoden.eu .
14273 .\" .Sh CAVEATS {{{
14274 .Sh CAVEATS
14276 \*(ID Interrupting an operation via
14277 .Dv \&\&SIGINT
14279 .Ql control-C
14280 from anywhere else but a command prompt is very problematic and likely
14281 to leave the program in an undefined state: many library functions
14282 cannot deal with the
14283 .Fn siglongjmp 3
14284 that this software (still) performs; even though efforts have been taken
14285 to address this, no sooner but in v15 it will have been worked out:
14286 interruptions have not been disabled in order to allow forceful breakage
14287 of hanging network connections, for example (all this is unrelated to
14288 .Va ignore ) .
14291 The SMTP and POP3 protocol support of \*(UA is very basic.
14292 Also, if it fails to contact its upstream SMTP server, it will not make
14293 further attempts to transfer the message at a later time (setting
14294 .Va save
14296 .Va sendwait
14297 may be useful).
14298 If this is a concern, it might be better to set up a local SMTP server
14299 that is capable of message queuing.
14301 .\" }}}
14304 .Sh BUGS
14306 After deleting some message of a POP3 mailbox the header summary falsely
14307 claims that there are no messages to display, one needs to perform
14308 a scroll or dot movement to restore proper state.
14311 .Ql thread Ns
14313 .Ic sort
14314 mode a power user may encounter crashes very occasionally (this is may
14315 and very).
14317 The file
14318 .Pa TODO
14319 in the source repository lists future directions.
14322 Please report bugs to the
14323 .Va contact-mail
14324 address, e.g., from within \*(uA:
14325 .\" v15-compat: drop eval as `mail' will expand variable?
14326 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
14327 Including the
14328 .Va verbose
14329 output of the command
14330 .Ic version
14331 may be helpful, e.g.,
14333 .Bd -literal -offset indent
14334 ? wysh set escape=! verbose; vput version xy; unset verbose;\e
14335   eval mail $contact-mail
14336 Bug subject
14337 !I xy
14342 Information on the web at
14343 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ' -Xx .
14345 .\" s-ts-mode