make-config.in: complete path (leftover of [807f64e2], 2015-12-26!)
[s-mailx.git] / nail.1
blobc63dfc3733bf4a9ceedc021e0bf49a35c54a4449
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.11 / 2018-08-08
35 .Dd August 08, 2018
36 .ds VV \\%v14.9.11
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 DdEFinv~#
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\0 Ns 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 DdEeHiNnRv~#
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 DdEeHiNnRv~#
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 Many old-style commands accept new syntax via
155 .Cm wysh ,
156 one of the
157 .Sx "Command modifiers" .
158 New and old behaviour is flagged \*(IN and \*(OU, and setting
159 .Va v15-compat ,
160 one of the many
161 .Sx "INTERNAL VARIABLES" ,
162 will choose new behaviour when applicable.
163 \*(OB flags what will vanish, and enabling
164 .Fl d
166 .Fl v
167 enables obsoletion warnings.
171 \*(UA provides a simple and friendly environment for sending and
172 receiving mail.
173 It is intended to provide the functionality of the POSIX
174 .Xr mailx 1
175 command, but is MIME capable and optionally offers extensions for
176 line editing, S/MIME, SMTP and POP3, among others.
177 \*(UA divides incoming mail into its constituent messages and allows
178 the user to deal with them in any order.
179 It offers many
180 .Sx COMMANDS
182 .Sx "INTERNAL VARIABLES"
183 for manipulating messages and sending mail.
184 It provides the user simple editing capabilities to ease the composition
185 of outgoing messages, and increasingly powerful and reliable
186 non-interactive scripting capabilities.
188 .\" .Ss "Options" {{{
189 .Ss "Options"
191 .Bl -tag -width ".It Fl BaNg"
193 .It Fl \&: Ar spec
194 Explicitly control which of the
195 .Sx "Resource files"
196 shall be
197 .Ic source Ns
198 d (loaded): if the letter
199 .Ql s
200 is (case-insensitively) part of the
201 .Ar spec
202 then the system wide
203 .Pa \*(UR
204 is sourced, likewise the letter
205 .Ql u
206 controls sourcing of the user's personal
207 .Pa \*(ur
208 file, whereas the letters
209 .Ql -
211 .Ql /
212 explicitly forbid sourcing of any resource files.
213 Scripts should use this option: to avoid environmental noise they should
214 .Dq detach
215 from any configuration and create a script-specific environment, setting
216 any of the desired
217 .Sx "INTERNAL VARIABLES"
219 .Fl S
220 and running configurating commands via
221 .Fl X .
222 This option overrides
223 .Fl n .
226 .It Fl A Ar account
227 Executes an
228 .Ic account
229 command for the given user email
230 .Ar account
231 after program startup is complete (all resource files are loaded, any
232 .Fl S
233 setting is being established; only
234 .Fl X
235 commands have not been evaluated yet).
236 Being a special incarnation of
237 .Ic define Ns d
238 macros for the purpose of bundling longer-lived
239 .Ic set Ns
240 tings, activating such an email account also switches to the accounts
241 .Mx -sx
242 .Sx "primary system mailbox"
243 (most likely the
244 .Va inbox ) .
245 If the operation fails the program will exit if it is used
246 non-interactively, or if any of
247 .Va errexit
249 .Va posix
250 are set.
253 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
254 Attach
255 .Ar file
256 to the message (for compose mode opportunities refer to
257 .Ic ~@
259 .Ic ~^ ) .
260 .Sx "Filename transformations"
261 (also see
262 .Ic file )
263 will be performed, except that shell variables are not expanded.
264 Shall
265 .Ar file
266 not be accessible but contain a
267 .Ql =
268 character, then anything before the last
269 .Ql =
270 will be used as the filename, anything thereafter as a character set
271 specification.
273 If an input character set is specified,
274 .Mx -ix "character set specification"
275 but no output character set, then the given input character set is fixed
276 as-is, and no conversion will be applied;
277 giving the empty string or the special string hyphen-minus
278 .Ql -
279 will be treated as if
280 .Va ttycharset
281 has been specified (the default).
283 If an output character set has also been given then the conversion will
284 be performed exactly as specified and on-the-fly, not considering the
285 file type and content.
286 As an exception, if the output character set is specified as the empty
287 string or hyphen-minus
288 .Ql - ,
289 then the default conversion algorithm (see
290 .Sx "Character sets" )
291 is applied (therefore no conversion is performed on-the-fly,
292 .Ar file
293 will be MIME-classified and its contents will be inspected first) \(em
294 without support for character set conversions
295 .Pf ( Va features
296 does not include the term
297 .Ql +iconv )
298 only this argument is supported.
300 .It Fl B
301 (\*(OB: \*(UA will always use line-buffered output, to gain
302 line-buffered input even in batch mode enable batch mode via
303 .Fl # . )
306 .It Fl b Ar addr
307 Send a blind carbon copy to
308 .Ar addr Ns
309 ess, if the
310 .Ic set Ns
311 ting of
312 .Va expandaddr ,
313 one of the
314 .Sx "INTERNAL VARIABLES" ,
315 allows; the
316 .Ql shquote
317 .Va expandaddr
318 flag is supported.
319 The option may be used multiple times.
320 Also see the section
321 .Sx "On sending mail, and non-interactive mode" .
324 .It Fl C Ar """field: body"""
325 Create a custom header which persists for an entire session.
326 A custom header consists of the field name followed by a colon
327 .Ql \&:
328 and the field content body, e.g.,
329 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" .
330 Standard header field names cannot be overwritten by custom headers.
331 Runtime adjustable custom headers are available via the variable
332 .Va customhdr ,
333 and in compose mode
334 .Ic ~^ ,
335 one of the
336 .Sx "COMMAND ESCAPES" ,
337 as well as
338 .Ic digmsg
339 are the most flexible and powerful options to manage message headers.
340 This option may be used multiple times.
343 .It Fl c Ar addr
344 Just like
345 .Fl b ,
346 except it places the argument in the list of carbon copies.
349 .It Fl D
350 (\*(OP) Startup with
351 .Va disconnected
352 .Ic set .
355 .It Fl d
356 Almost enable a sandbox mode with the internal variable
357 .Va debug ;
358 the same can be achieved via
359 .Ql Fl S Va \&\&debug
361 .Ql Ic set Va \&\&debug .
364 .It Fl E
365 .Ic set
366 .Va skipemptybody
367 and thus discard messages with an empty message part body.
370 .It Fl e
371 Just check if mail is present (in the system
372 .Va inbox
373 or the one specified via
374 .Fl f ) :
375 if yes, return an exit status of zero, a non-zero value otherwise.
376 To restrict the set of mails to consider in this evaluation a message
377 specification can be added with the option
378 .Fl L .
381 .It Fl F
382 Save the message to send in a file named after the local part of the
383 first recipient's address (instead of in
384 .Va record Ns ).
387 .It Fl f
388 Read in the contents of the user's
389 .Mx -sx
390 .Sx "secondary mailbox"
391 .Ev MBOX
392 (or the specified file) for processing;
393 when \*(UA is quit, it writes undeleted messages back to this file
394 (but be aware of the
395 .Va hold
396 option).
397 The optional
398 .Ar file
399 argument will undergo some special
400 .Sx "Filename transformations"
401 (as via
402 .Ic file ) .
403 Note that
404 .Ar file
405 is not an argument to the flag
406 .Fl \&\&f ,
407 but is instead taken from the command line after option processing has
408 been completed.
409 In order to use a
410 .Ar file
411 that starts with a hyphen-minus, prefix with a relative path, as in
412 .Ql ./-hyphenbox.mbox .
415 .It Fl H
416 Display a summary of
417 .Ic headers
418 for the given
419 .Ic file
420 (depending on
421 .Fl u ,
422 .Va inbox
424 .Ev MAIL ,
425 or as specified via
426 .Fl f ) .
427 A configurable summary view is available via the option
428 .Fl L .
429 This mode does not honour
430 .Va showlast .
433 .It Fl h
434 Show a short usage summary.
437 .It Fl i
438 .Ic set
439 .Va ignore
440 to ignore tty interrupt signals.
443 .It Fl L Ar spec
444 Display a summary of
445 .Ic headers
446 of all messages that match the given
447 .Ar spec
448 in the
449 .Ic file
450 found by the same algorithm used by
451 .Fl H ,
452 then exit.
453 See the section
454 .Sx "Specifying messages"
455 for the format of
456 .Ar spec .
457 This mode does not honour
458 .Va showlast .
460 If the
461 .Fl e
462 option has been given in addition no header summary is produced,
463 but \*(UA will instead indicate via its exit status whether
464 .Ar spec
465 matched any messages
466 .Pf ( Ql 0 )
467 or not
468 .Pf ( Ql 1 ) ;
469 note that any verbose output is suppressed in this mode and must instead
470 be enabled explicitly (e.g., by using the option
471 .Fl v ) .
474 .It Fl M Ar type
475 Special send mode that will flag standard input with the MIME
476 .Ql Content-Type:
477 set to the given
478 .Ar type
479 and use it as the main message body.
480 \*(ID Using this option will bypass processing of
481 .Va message-inject-head
483 .Va message-inject-tail .
484 Also see
485 .Fl q , m , t .
488 .It Fl m Ar file
489 Special send mode that will MIME classify the specified
490 .Ar file
491 and use it as the main message body.
492 \*(ID Using this option will bypass processing of
493 .Va message-inject-head
495 .Va message-inject-tail .
496 Also see
497 .Fl q , M , t .
500 .It Fl N
501 inhibit the initial display of message headers when reading mail or
502 editing a mailbox
503 .Ic folder
504 by calling
505 .Ic unset
506 for the internal variable
507 .Va header .
510 .It Fl n
511 Standard flag that inhibits reading the system wide
512 .Pa \*(UR
513 upon startup.
514 The option
515 .Fl \&:
516 allows more control over the startup sequence; also see
517 .Sx "Resource files" .
520 .It Fl q Ar file
521 Special send mode that will initialize the message body with the
522 contents of the specified
523 .Ar file ,
524 which may be standard input
525 .Ql -
526 only in non-interactive context.
527 Also see
528 .Fl M , m , t .
531 .It Fl R
532 Any mailbox
533 .Ic folder
534 a.k.a.\&
535 .Ic file
536 opened will be in read-only mode.
540 .It Fl r Ar from-addr
541 Whereas the source address that appears in the
542 .Va from
543 header of a message (or in the
544 .Va sender
545 header if the former contains multiple addresses) is honoured by the
546 built-in SMTP transport, it is not used by a file-based
547 .Va mta
548 (Mail-Transfer-Agent) for the RFC 5321 reverse-path used for relaying
549 and delegating a message to its destination(s), for delivery errors
550 etc., but it instead uses the local identity of the initiating user.
553 When this command line option is used the given
554 .Ar from-addr
555 will be assigned to the internal variable
556 .Va from ,
557 but in addition the command line option
558 .Fl \&\&f Ar from-addr
559 will be passed to a file-based
560 .Va mta
561 whenever a message is sent.
562 Shall
563 .Ar from-addr
564 include a user name the address components will be separated and
565 the name part will be passed to a file-based
566 .Va mta
567 individually via
568 .Fl \&\&F Ar name .
571 If an empty string is passed as
572 .Ar from-addr
573 then the content of the variable
574 .Va from
575 (or, if that contains multiple addresses,
576 .Va sender )
577 will be evaluated and used for this purpose whenever the file-based
578 .Va mta
579 is contacted.
580 By default, without
581 .Fl \&\&r
582 that is, neither
583 .Fl \&\&f
585 .Fl \&\&F
586 command line options are used when contacting a file-based MTA, unless
587 this automatic deduction is enforced by
588 .Ic set Ns
589 ing the internal variable
590 .Va r-option-implicit .
593 Remarks: many default installations and sites disallow overriding the
594 local user identity like this unless either the MTA has been configured
595 accordingly or the user is member of a group with special privileges.
596 Passing an invalid address will cause an error.
600 .It Fl S Ar var Ns Op = Ns value
601 .Ic set
602 (or, with a prefix string
603 .Ql no ,
604 as documented in
605 .Sx "INTERNAL VARIABLES" ,
606 .Ic unset )
607 .Ar var Ns
608 iable and optionally assign
609 .Ar value ,
610 if supported; \*(ID the entire expression is evaluated as if specified
611 within dollar-single-quotes (see
612 .Sx "Shell-style argument quoting" )
613 if the internal variable
614 .Va v15-compat
615 is set.
616 If the operation fails the program will exit if any of
617 .Va errexit
619 .Va posix
620 are set.
621 Settings established via
622 .Fl \&\&S
623 cannot be changed from within
624 .Sx "Resource files"
625 or an account switch initiated by
626 .Fl A .
627 They will become mutable again before commands registered via
628 .Fl X
629 are executed.
632 .It Fl s Ar subject
633 Specify the subject of the message to be sent.
634 Newline (NL) and carriage-return (CR) bytes are invalid and will be
635 normalized to space (SP) characters.
638 .It Fl t
639 The message given (on standard input) is expected to contain, separated
640 from the message body by an empty line, one or multiple message headers.
641 Headers can span multiple consecutive lines if follow lines start with
642 any amount of whitespace.
643 A line starting with the number sign
644 .Ql #
645 in the first column is ignored.
646 Message recipients can be given via the message headers
647 .Ql To: ,
648 .Ql Cc: ,
649 .Ql Bcc:
651 .Ql Fcc: ,
652 they will be added to any recipients specified on the command line,
653 and are likewise subject to
654 .Va expandaddr
655 validity checks.
656 If a message subject is specified via
657 .Ql Subject:
658 then it will be used in favour of one given on the command line.
660 More optional headers are
661 .Ql Reply-To:
662 (possibly overriding
663 .Va reply-to ) ,
664 .Ql Sender:
665 .Pf ( Va sender ) ,
666 .Ql From:
667 .Pf ( Va from
668 and / or option
669 .Fl r ) .
670 .Ql Message-ID: ,
671 .Ql In-Reply-To: ,
672 .Ql References:
674 .Ql Mail-Followup-To: ,
675 by default created automatically dependent on message context, will
676 be used if specified (a special address massage will however still occur
677 for the latter).
678 Any other custom header field (also see
679 .Fl C ,
680 .Va customhdr
682 .Ic ~^ )
683 is passed through entirely
684 unchanged, and in conjunction with the options
685 .Fl ~
687 .Fl #
688 it is possible to embed
689 .Sx "COMMAND ESCAPES" .
690 Also see
691 .Fl M , m , q .
694 .It Fl u Ar user
695 Initially read the
696 .Mx -sx
697 .Sx "primary system mailbox"
699 .Ar user ,
700 appropriate privileges presumed; effectively identical to
701 .Ql Fl \&\&f Ns \0%user .
704 .It Fl V
705 Show \*(UAs
706 .Va version
707 and exit.
708 The command
709 .Ic version
710 will also show the list of
711 .Va features :
712 .Ql $ \*(uA -Xversion -Xx .
715 .It Fl v
716 .Ic set Ns
717 ting the internal variable
718 .Va verbose
719 enables display of some informational context messages.
720 Using it twice increases the level of verbosity.
723 .It Fl X Ar cmd
724 Add the given (or multiple for a multiline argument)
725 .Ar cmd
726 to the list of commands to be executed,
727 as a last step of program startup, before normal operation starts.
728 This is the only possibility to execute commands in non-interactive mode
729 when reading startup files has been disabled.
730 The commands will be evaluated as a unit, just as via
731 .Ic source .
732 Correlates with
733 .Fl #
735 .Va errexit .
738 .It Fl ~
739 Enable
740 .Sx "COMMAND ESCAPES"
741 in compose mode even in non-interactive use cases.
742 This can be used to, e.g., automatically format the composed message
743 text before sending the message:
744 .Bd -literal -offset indent
745 $ ( echo 'line    one. Word.     Word2.';\e
746     echo '~| /usr/bin/fmt -tuw66' ) |\e
747   LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
751 .It Fl #
752 Enables batch mode: standard input is made line buffered, the complete
753 set of (interactive) commands is available, processing of
754 .Sx "COMMAND ESCAPES"
755 is enabled in compose mode, and diverse
756 .Sx "INTERNAL VARIABLES"
757 are adjusted for batch necessities, exactly as if done via
758 .Ic set :
759 .Va emptystart ,
760 .Pf no Va errexit ,
761 .Pf no Va header ,
762 .Pf no Va posix ,
763 .Va quiet ,
764 .Va sendwait ,
765 .Va typescript-mode
766 as well as
767 .Ev MAIL ,
768 .Ev MBOX
770 .Va inbox
771 (the latter three to
772 .Pa /dev/null ) .
773 The following prepares an email message in a batched dry run:
774 .Bd -literal -offset indent
775 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
776   LC_ALL=C \*(uA -d#:/ -X'alias bob bob@exam.ple'
780 .It Fl \&.
781 This flag forces termination of option processing in order to prevent
782 .Dq option injection
783 (attacks).
784 It also forcefully puts \*(UA into send mode, see
785 .Sx "On sending mail, and non-interactive mode" .
789 All given
790 .Ar to-addr
791 arguments and all receivers established via
792 .Fl b
794 .Fl c
795 are subject to the checks established by
796 .Va expandaddr ,
797 one of the
798 .Sx "INTERNAL VARIABLES" ;
799 they all support the flag
800 .Ql shquote .
801 If the setting of
802 .Va expandargv
803 allows their recognition all
804 .Ar mta-option
805 arguments given at the end of the command line after a
806 .Ql --
807 separator will be passed through to a file-based
808 .Va mta
809 (Mail-Transfer-Agent) and persist for the entire session.
810 .Va expandargv
811 constraints do not apply to the content of
812 .Va mta-arguments .
813 .\" }}}
815 .\" .Ss "A starter" {{{
816 .Ss "A starter"
818 \*(UA is a direct descendant of
820 Mail, itself a successor to the Research
822 mail which
823 .Dq was there from the start
824 according to
825 .Sx HISTORY .
826 It thus represents the user side of the
828 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
829 traditionally taken by
830 .Xr sendmail 8 ,
831 and most MTAs provide a binary of this name for compatibility purposes.
832 If the \*(OPal SMTP
833 .Va mta
834 is included in the
835 .Va features
836 of \*(UA then the system side is not a mandatory precondition for mail
837 delivery.
840 Because \*(UA strives for compliance with POSIX
841 .Xr mailx 1
842 it is likely that some configuration settings have to be adjusted before
843 using it is a smooth experience.
844 (Rather complete configuration examples can be found in the section
845 .Sx EXAMPLES . )
846 The provided global
847 .Pa \*(UR
848 (one of the
849 .Sx "Resource files" )
850 template bends those standard imposed settings of the
851 .Sx "INTERNAL VARIABLES"
852 a bit towards more user friendliness and safety, however.
855 For example, it
856 .Ic set Ns s
857 .Va hold
859 .Va keepsave
860 in order to suppress the automatic moving of messages to the
861 .Mx -sx
862 .Sx "secondary mailbox"
863 .Ev MBOX
864 that would otherwise occur (see
865 .Sx "Message states" ) ,
867 .Va keep
868 to not remove empty system MBOX mailbox files (or all empty such files if
869 .Va posix
870 .Pf a.k.a.\0 Ev POSIXLY_CORRECT
871 mode has been enabled) to avoid mangling of file permissions when files
872 eventually get recreated.
874 It also enables
875 .Va sendwait
876 in order to synchronize \*(UA with the exit status report of the used
877 .Va mta
878 when sending mails.
880 .Ic set Ns
882 .Va emptystart
883 to enter interactive startup even if the initial mailbox is empty,
884 .Va editheaders
885 to allow editing of headers as well as
886 .Va fullnames
887 to not strip down addresses in compose mode, and
888 .Va quote
889 to include the message that is being responded to when
890 .Ic reply Ns
891 ing, which is indented by an
892 .Va indentprefix
893 that also deviates from standard imposed settings.
894 .Va mime-counter-evidence
895 is fully enabled, too.
898 Some random remarks.
899 The file mode creation mask can be managed explicitly via the variable
900 .Va umask .
901 Sufficient system support provided symbolic links will not be followed
902 when files are opened for writing.
903 Files and shell pipe output can be
904 .Ic source Ns
905 d for evaluation, also during startup from within the
906 .Sx "Resource files" .
907 .\" }}}
909 .\" .Ss "On sending mail, and non-interactive mode" {{{
910 .Ss "On sending mail, and non-interactive mode"
912 To send a message to one or more people, using a local or built-in
913 .Va mta
914 (Mail-Transfer-Agent) transport to actually deliver the generated mail
915 message, \*(UA can be invoked with arguments which are the names of
916 people to whom the mail will be sent, and the command line options
917 .Fl b
919 .Fl c
920 can be used to add (blind) carbon copy receivers:
922 .Bd -literal -offset indent
923 # Via sendmail(1)
924 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
926 # But... try it in an isolated dry-run mode (-d) first
927 $ LC_ALL=C \*(uA -d -:/ -Ssendwait -Sttycharset=utf8 \e
928    -b bcc@exam.ple -c cc@exam.ple \e
929    -Sfullnames -. \e
930    '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
932 # With SMTP
933 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
934     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
935     -S from=scriptreply@exam.ple \e
936     -a /etc/mail.rc \e
937     -. eric@exam.ple < /tmp/letter.txt
941 If standard input is a terminal rather than the message to be sent,
942 the user is expected to type in the message contents.
943 In this compose mode \*(UA treats lines beginning with the character
944 .Ql ~
945 special \(en these are so-called
946 .Sx "COMMAND ESCAPES" ,
947 which can be used to read in files, process shell commands, add and edit
948 attachments and more; e.g.,
949 .Ic ~v
951 .Ic ~e
952 will start the
953 .Ev VISUAL
954 text
955 .Ev EDITOR ,
956 respectively, to revise the message in its current state,
957 .Ic ~h
958 allows editing of the most important message headers, with the potent
959 .Ic ~^
960 custom headers can be created, for example (more specifically than with
961 .Fl C
963 .Va customhdr ) .
964 \*(OPally
965 .Ic ~?
966 gives an overview of most other available command escapes.
969 The command escape
970 .Ic ~.
971 (see there) will call hooks, insert automatic injections and receivers,
972 leave compose mode and send the message once it is completed.
973 Aborting letter composition is possible with either of
974 .Ic ~x
976 .Ic ~q ,
977 the latter of which will save the message in the file denoted by
978 .Ev DEAD
979 unless
980 .Pf no Va save
981 is set.
982 And unless
983 .Va ignoreeof
984 is set the effect of
985 .Ic ~.
986 can also be achieved by typing end-of-transmission (EOT) via
987 .Ql control-D
988 .Pf ( Ql ^D )
989 at the beginning of an empty line, and
990 .Ic ~q
991 is always reachable by typing end-of-text (ETX) twice via
992 .Ql control-C
993 .Pf ( Ql ^C ) .
996 A number of
997 .Sx ENVIRONMENT
999 .Sx "INTERNAL VARIABLES"
1000 can be used to alter default behavior.
1001 E.g., messages are sent asynchronously, without supervision, unless the
1002 internal variable
1003 .Va sendwait
1004 is set, therefore send errors will not be recognizable until then.
1005 .Ic set Ns
1006 ting (also via
1007 .Fl S )
1008 .Va editalong
1009 will automatically startup an editor when compose mode is entered, and
1010 editing of headers additionally to plain body content can be enabled via
1011 .Va editheaders :
1012 \*(ID some, but not all headers can be created, edited or deleted in an
1013 editor, then.
1014 .Va askcc
1016 .Va askbcc
1017 will cause the user to be prompted actively for (blind) carbon-copy
1018 recipients, respectively, and (the default)
1019 .Va asksend
1020 will request confirmation whether the message shall be sent.
1023 The envelope sender address is defined by
1024 .Va from ,
1025 explicitly defining an originating
1026 .Va hostname
1027 may be desirable, especially with the built-in SMTP Mail-Transfer-Agent
1028 .Va mta .
1029 .Sx "Character sets"
1030 for outgoing message and MIME part content are configurable via
1031 .Va sendcharsets ,
1032 whereas input data is assumed to be in
1033 .Va ttycharset .
1034 Message data will be passed over the wire in a
1035 .Va mime-encoding .
1036 MIME parts a.k.a. attachments need to be assigned a
1037 .Ic mimetype ,
1038 usually taken out of
1039 .Sx "The mime.types files" .
1040 Saving a copy of sent messages in a
1041 .Va record
1042 mailbox may be desirable \(en as for most mailbox
1043 .Ic file
1044 targets the value will undergo
1045 .Sx "Filename transformations" .
1046 Some introductional
1047 .Fl d
1049 .Va debug
1050 sandbox dry-run tests will prove correctness.
1053 Message recipients (as specified on the command line or defined in
1054 .Ql To: ,
1055 .Ql Cc:
1057 .Ql Bcc: )
1058 are subject to
1059 .Ic alternates
1060 filtering, and may not only be email addressees but can also be names of
1061 mailboxes and even complete shell command pipe specifications.
1062 If the variable
1063 .Va expandaddr
1064 is not set then only network addresses (see
1065 .Xr mailaddr 7
1066 for a description of mail addresses) and plain user names (including MTA
1067 aliases) may be used, other types will be filtered out, giving a warning
1068 message.
1069 A network address that contains no domain-, but only a valid local user
1070 .Ql <name>
1071 in angle brackets will be automatically expanded to a valid address when
1072 .Va hostname
1073 is set to a non-empty value; setting it to the empty value instructs
1074 \*(UA that the used
1075 .Va mta
1076 will perform the necessary expansion.
1077 The command
1078 .Ic addrcodec
1079 may help to generate standard compliant network addresses.
1081 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
1082 .\" grep the latter for the complete picture
1084 If the variable
1085 .Va expandaddr
1086 is set then an extended set of recipient addresses will be accepted:
1087 Any name that starts with a vertical bar
1088 .Ql |
1089 character specifies a command pipe \(en the command string following the
1090 .Ql |
1091 is executed and the message is sent to its standard input;
1092 Likewise, any name that consists only of hyphen-minus
1093 .Ql -
1094 or starts with the character solidus
1095 .Ql /
1096 or the character sequence dot solidus
1097 .Ql ./
1098 is treated as a file, regardless of the remaining content.
1099 Any other name which contains a commercial at
1100 .Ql @
1101 character is a network address;
1102 Any other name which starts with a plus sign
1103 .Ql +
1104 character is a mailbox name;
1105 Any other name which contains a solidus
1106 .Ql /
1107 character but no exclamation mark
1108 .Ql \&!
1109 or percent sign
1110 .Ql %
1111 character before is also a mailbox name;
1112 What remains is treated as a network address.
1114 .Bd -literal -offset indent
1115 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1116 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1117 $ echo safe | LC_ALL=C \e
1118     \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1119       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1120       -. bob@exam.ple
1124 To create file-carbon-copies the special recipient header
1125 .Ql Fcc:
1126 may be used as often as desired.
1127 Its entire value (or body in standard terms) is interpreted as a
1128 .Ic file
1129 target, after having been subject to
1130 .Sx "Filename transformations" .
1131 Beside using the command escape
1132 .Ic ~^
1133 (to create a
1134 .Ql Fcc
1135 header) this is the only way to create a file-carbon-copy without
1136 introducing an ambiguity regarding the interpretation of the address,
1137 e.g., to use file names with leading vertical bars or commercial ats.
1138 Like all other recipients
1139 .Ql Fcc:
1140 is subject to the checks of
1141 .Va expandaddr .
1144 It is possible to create personal distribution lists via the
1145 .Ic alias
1146 command, so that, for instance, the user can send mail to
1147 .Ql cohorts
1148 and have it go to a group of people.
1149 Different to the alias mechanism of a local
1150 .Va mta ,
1151 which is often tracked in a file
1152 .Pa /etc/aliases ,
1153 documented in
1154 .Xr aliases 5 ,
1155 and the names of which are subject to the
1156 .Ql name
1157 constraint of
1158 .Va expandaddr ,
1159 personal aliases will be expanded by \*(UA before the message is sent.
1160 They are thus a convenient alternative to specifying each addressee by
1161 itself, correlate with the active set of
1162 .Ic alternates ,
1163 and are subject to
1164 .Va metoo
1165 filtering.
1167 .Bd -literal -offset indent
1168 ? alias  cohorts  bill jkf mark kridle@ucbcory ~/cohorts.mbox
1169 ? alias  mark  mark@exam.ple
1173 For the purpose of arranging a complete environment of settings that can
1174 be switched to with a single command or command line option there are
1175 .Ic account Ns s .
1176 Alternatively it is also possible to use a flat configuration, making use
1177 of so-called variable chains which automatically pick
1178 .Ql USER@HOST
1180 .Ql HOST
1181 context-dependent variable variants: for example addressing
1182 .Ql Ic File Ns \& pop3://yaa@exam.ple
1183 would find
1184 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1185 .Va \&\&pop3-no-apop-exam.ple
1187 .Va pop3-no-apop
1188 in order.
1190 .Sx "On URL syntax and credential lookup"
1192 .Sx "INTERNAL VARIABLES" .
1195 The compose mode hooks
1196 .Va on-compose-enter , on-compose-splice , on-compose-leave
1198 .Va on-compose-cleanup
1199 may be set to
1200 .Ic define Ns
1201 d macros and provide reliable and increasingly powerful mechanisms to
1202 perform automated message adjustments dependent on message context,
1203 for example addition of message signatures
1204 .Pf ( Va message-inject-head , message-inject-tail )
1205 or creation of additional receiver lists (also by setting
1206 .Va autocc , autobcc ) .
1207 To achieve that the command
1208 .Ic digmsg
1209 may be used in order to query and adjust status of message(s).
1210 The splice hook can also make use of
1211 .Sx "COMMAND ESCAPES" .
1212 (\*(ID The compose mode hooks work for
1213 .Ic forward , mail , reply
1214 and variants;
1215 .Ic resend
1217 .Ic Resend
1218 only provide the hooks
1219 .Va on-resend-enter
1221 .Va on-resend-cleanup ,
1222 which are pretty restricted due to the nature of the operation.)
1225 To avoid environmental noise scripts should
1226 .Dq detach
1227 \*(UA from any configuration files and create a script-local
1228 environment, ideally with the command line options
1229 .Fl \&:
1230 to disable any configuration file in conjunction with repetitions of
1231 .Fl S
1232 to specify variables:
1234 .Bd -literal -offset indent
1235 $ env LC_ALL=C \*(uA -:/ \e
1236     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1237     -Sexpandaddr=fail,-all,failinvaddr \e
1238     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1239     -S from=scriptreply@exam.ple \e
1240     -s 'Subject to go' -a attachment_file \e
1241     -Sfullnames -. \e
1242     'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1243     < content_file
1247 As shown, scripts can
1248 .Dq fake
1249 a locale environment, the above specifies the all-compatible 7-bit clean
1250 .Ev LC_ALL
1251 .Dq C ,
1252 but will nonetheless take and send UTF-8 in the message text by using
1253 .Va ttycharset .
1254 In interactive mode, which is introduced in the next section, messages
1255 can be sent by calling the
1256 .Ic mail
1257 command with a list of recipient addresses:
1259 .Bd -literal -offset indent
1260 $ \*(uA -d -Squiet -Semptystart
1261 "/var/spool/mail/user": 0 messages
1262 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1263 \&...
1264 ? # Will do the right thing (tm)
1265 ? m rec1@exam.ple rec2@exam.ple
1267 .\" }}}
1269 .\" .Ss "On reading mail, and interactive mode" {{{
1270 .Ss "On reading mail, and interactive mode"
1272 When invoked without addressees \*(UA enters interactive mode in which
1273 mails may be read.
1274 When used like that the user's system
1275 .Va inbox
1276 (for more on mailbox types please see the command
1277 .Ic file )
1278 is read in and a one line header of each message therein is displayed if
1279 the variable
1280 .Va header
1281 is set.
1282 The visual style of this summary of
1283 .Ic headers
1284 can be adjusted through the variable
1285 .Va headline
1286 and the possible sorting criterion via
1287 .Va autosort .
1288 Scrolling through
1289 .Va screen Ns
1290 fuls of
1291 .Ic headers
1292 can be performed with the command
1293 .Ic z .
1294 If the initially opened mailbox is empty \*(UA will instead exit
1295 immediately (after displaying a message) unless the variable
1296 .Va emptystart
1297 is set.
1300 At the
1301 .Va prompt
1302 the command
1303 .Ic list
1304 will give a listing of all available commands and
1305 .Ic help
1306 will \*(OPally give a summary of some common ones.
1307 If the \*(OPal documentation strings are available (see
1308 .Va features )
1309 one can type
1310 .Ql help X
1311 .Pf "(or " Ql ?X )
1312 and see the actual expansion of
1313 .Ql X
1314 and what its purpose is, i.e., commands can be abbreviated
1315 (note that POSIX defines some abbreviations, so that the alphabetical
1316 order of commands does not necessarily relate to the abbreviations; it is
1317 however possible to define overwrites with
1318 .Ic commandalias ) .
1319 These commands can also produce a more
1320 .Va verbose
1321 output.
1324 Messages are given numbers (starting at 1) which uniquely identify
1325 messages; the current message \(en the
1326 .Dq dot
1327 \(en will either be the first new message, or the first unread message,
1328 or the first message of the mailbox; the internal variable
1329 .Va showlast
1330 will instead cause usage of the last message for this purpose.
1331 The command
1332 .Ic headers
1333 will display a
1334 .Va screen Ns
1335 ful of header summaries containing the
1336 .Dq dot ,
1337 whereas
1338 .Ic from
1339 will display only the summaries of the given messages, defaulting to the
1340 .Dq dot .
1343 Message content can be displayed with the command
1344 .Ic type
1345 .Pf ( Ql t ,
1346 alias
1347 .Ic print ) .
1348 Here the variable
1349 .Va crt
1350 controls whether and when \*(UA will use the configured
1351 .Ev PAGER
1352 for display instead of directly writing to the user terminal
1353 .Va screen ,
1354 the sole difference to the command
1355 .Ic more ,
1356 which will always use the
1357 .Ev PAGER .
1358 The command
1359 .Ic top
1360 will instead only show the first
1361 .Va toplines
1362 of a message (maybe even compressed if
1363 .Va topsqueeze
1364 is set).
1365 Message display experience may improve by setting and adjusting
1366 .Va mime-counter-evidence ,
1367 and also see
1368 .Sx "HTML mail and MIME attachments" .
1371 By default the current message
1372 .Pf ( Dq dot )
1373 is displayed, but like with many other commands it is possible to give
1374 a fancy message specification (see
1375 .Sx "Specifying messages" ) ,
1376 e.g.,
1377 .Ql t:u
1378 will display all unread messages,
1379 .Ql t.
1380 will display the
1381 .Dq dot ,
1382 .Ql t 1 5
1383 will type the messages 1 and 5,
1384 .Ql t 1-5
1385 will type the messages 1 through 5, and
1386 .Ql t-
1388 .Ql t+
1389 will display the previous and the next message, respectively.
1390 The command
1391 .Ic search
1392 (a more substantial alias for
1393 .Ic from )
1394 will display a header summary of the given message specification list
1395 instead of their content, e.g., the following will search for subjects:
1398 .Dl ? from "'@Some subject to search for'"
1401 In the default setup all header fields of a message will be
1402 .Ic type Ns
1403 d, but fields can be white- or blacklisted for a variety of
1404 applications by using the command
1405 .Ic headerpick ,
1406 e.g., to restrict their display to a very restricted set for
1407 .Ic type :
1408 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1409 In order to display all header fields of a message regardless of
1410 currently active ignore or retain lists, use the commands
1411 .Ic Type
1413 .Ic Top ;
1414 .Ic Show
1415 will show the raw message content.
1416 Note that historically the global
1417 .Pa \*(UR
1418 not only adjusts the list of displayed headers, but also sets
1419 .Va crt .
1420 (\*(ID A yet somewhat restricted) Reliable scriptable message
1421 inspection is available via
1422 .Ic digmsg .
1425 Dependent upon the configuration a line editor (see the section
1426 .Sx "On terminal control and line editor" )
1427 aims at making the user experience with the many
1428 .Sx COMMANDS
1429 a bit nicer.
1430 When reading the system
1431 .Va inbox ,
1432 or when
1433 .Fl f
1435 .Ic file )
1436 specified a mailbox explicitly prefixed with the special
1437 .Ql %:
1438 modifier (to propagate it to a
1439 .Mx -sx
1440 .Sx "primary system mailbox" ) ,
1441 then messages which have been read
1442 .Pf (see\0 Sx "Message states" )
1443 will be automatically moved to a
1444 .Mx -sx
1445 .Sx "secondary mailbox" ,
1446 the user's
1447 .Ev MBOX
1448 file, when the mailbox is left, either by changing the active mailbox or
1449 by quitting \*(UA \(en this automatic moving from a system- or primary-
1450 to the secondary mailbox is not performed when the variable
1451 .Va hold
1452 is set.
1453 Messages can also be explicitly
1454 .Ic move Ns
1455 d to other mailboxes, whereas
1456 .Ic copy
1457 keeps the original message.
1458 .Ic write
1459 can be used to write out data content of specific parts of messages.
1462 After examining a message the user can
1463 .Ic reply Ql r
1464 to the sender and all recipients (which will also be placed in
1465 .Ql To:
1466 unless
1467 .Va recipients-in-cc
1468 is set), or
1469 .Ic Reply Ql R
1470 exclusively to the sender(s).
1471 The command
1472 .Ic Lreply
1473 knows how to apply a special addressee massage, see
1474 .Sx "Mailing lists" .
1475 Dependent on the presence and value of
1476 .Va quote
1477 the message being replied to will be included in a quoted form.
1478 .Ic forward Ns
1479 ing a message will allow editing the new message: the original message
1480 will be contained in the message body, adjusted according to
1481 .Ic headerpick .
1482 It is possible to
1483 .Ic resend
1485 .Ic Resend
1486 messages: the former will add a series of
1487 .Ql Resent-
1488 headers, whereas the latter will not; different to newly created
1489 messages editing is not possible and no copy will be saved even with
1490 .Va record
1491 unless the additional variable
1492 .Va record-resent
1493 is set.
1494 When sending, replying or forwarding messages comments and full names
1495 will be stripped from recipient addresses unless the internal variable
1496 .Va fullnames
1497 is set.
1500 Of course messages can be
1501 .Ic delete Ql d ,
1502 and they can spring into existence again via
1503 .Ic undelete ,
1504 or when the \*(UA session is ended via the
1505 .Ic exit
1507 .Ic xit
1508 commands to perform a quick program termation.
1509 To end a mail processing session regulary and perform a full program
1510 exit one may issue the command
1511 .Ic quit .
1512 It will, among others, move read messages to the
1513 .Mx -sx
1514 .Sx "secondary mailbox"
1515 .Ev MBOX
1516 as necessary, discard deleted messages in the current mailbox,
1517 and update the \*(OPal (see
1518 .Va features )
1519 line editor
1520 .Va history-file .
1521 .\" }}}
1523 .\" .Ss "HTML mail and MIME attachments" {{{
1524 .Ss "HTML mail and MIME attachments"
1526 Messages which are HTML-only become more and more common, and of course
1527 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1528 Mail Extensions) parts.
1529 To get a notion of MIME types \*(UA has a default set of types built-in,
1530 onto which the content of
1531 .Sx "The mime.types files"
1532 will be added (as configured and allowed by
1533 .Va mimetypes-load-control ) .
1534 Types can also become registered with the command
1535 .Ic mimetype .
1536 To improve interaction with faulty MIME part declarations which are
1537 often seen in real-life messages, setting
1538 .Va mime-counter-evidence
1539 will allow verification of the given assertion, and possible provision
1540 of an alternative, better MIME type.
1543 Whereas \*(UA \*(OPally supports a simple HTML-to-text filter for
1544 displaying HTML messages, it cannot handle MIME types other than plain
1545 text itself.
1546 Instead programs need to become registered to deal with specific MIME
1547 types or file extensions.
1548 These programs may either prepare plain text versions of their input in
1549 order to enable \*(UA to integrate their output neatlessly in its own
1550 message visualization (a mode which is called
1551 .Cd copiousoutput ) ,
1552 or display the content themselves, for example in an external graphical
1553 window: such handlers will only be considered by and for the command
1554 .Ic mimeview .
1557 To install a handler program for a specific MIME type an according
1558 .Va pipe-TYPE/SUBTYPE
1559 variable needs to be set; to instead define a handler for a specific
1560 file extension the respective
1561 .Va pipe-EXTENSION
1562 variable can be used \(en these handlers take precedence.
1563 \*(OPally \*(UA supports mail user agent configuration as defined in
1564 RFC 1524; this mechanism (see
1565 .Sx "The Mailcap files" )
1566 will be queried for display or quote handlers if none of the former two
1567 .\" TODO v15-compat "will be" -> "is"
1568 did; it will be the sole source for handlers of other purpose.
1569 A last source for handlers is the MIME type definition itself, if
1570 a type-marker has been registered with the command
1571 .Ic mimetype ,
1572 which many of the built-in MIME types do.
1575 For example, to display a HTML message inline (converted to a more fancy
1576 plain text representation than the built-in filter is capable to produce)
1577 with either of the text-mode browsers
1578 .Xr lynx 1
1580 .Xr elinks 1 ,
1581 teach \*(UA about MathML documents and make it display them as plain
1582 text, and to open PDF attachments in an external PDF viewer,
1583 asynchronously and with some other magic attached:
1585 .Bd -literal -offset indent
1586 ? if [ "$features" !% +filter-html-tagsoup ]
1587 ?   #set pipe-text/html='@* elinks -force-html -dump 1'
1588 ?   set pipe-text/html='@* lynx -stdin -dump -force_html'
1589 ?   # Display HTML as plain text instead
1590 ?   #set pipe-text/html=@
1591 ? endif
1592 ? mimetype @ application/mathml+xml mathml
1593 ? wysh set pipe-application/pdf='@&=@ \e
1594     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1595     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1596     mupdf "${MAILX_FILENAME_TEMPORARY}"'
1598 .\" }}}
1600 .\" .Ss "Mailing lists" {{{
1601 .Ss "Mailing lists"
1603 \*(UA offers some support to ease handling of mailing lists.
1604 The command
1605 .Ic mlist
1606 promotes all given arguments to known mailing lists, and
1607 .Ic mlsubscribe
1608 sets their subscription attribute, creating them first as necessary.
1609 (On the other hand
1610 .Ic unmlsubscribe
1611 does not
1612 .Ic unmlist
1613 automatically, but only resets the subscription attribute.)
1614 Using the commands without arguments will show (a subset of) all
1615 currently defined mailing lists.
1617 .Va headline
1618 format
1619 .Ql \&%T
1620 can be used to mark out messages with configured list addresses
1621 in the display of
1622 .Ic headers .
1625 If the \*(OPal regular expression support is available a mailing list
1626 specification that contains any of the
1627 .Dq magical
1628 regular expression characters
1629 .Ql ^[]*+?|$
1630 (see
1631 .Xr re_format 7 )
1632 will be interpreted as one, which allows matching of many addresses with
1633 a single expression.
1634 However, all fully qualified list addresses are matched via a fast
1635 dictionary, whereas expressions are placed in (a) list(s) which is
1636 (are) matched sequentially.
1638 .Bd -literal -offset indent
1639 ? set followup-to followup-to-honour=ask-yes \e
1640     reply-to-honour=ask-yes
1641 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1642 ? mlsubscribe a4@b4.c4 exact@lists.c3
1646 The variable
1647 .Va followup-to-honour
1648 will ensure that a
1649 .Ql Mail-\:Followup-\:To:
1650 header is honoured when the message is being replied to (via
1651 .Ic reply
1653 .Ic Lreply )
1655 .Va followup-to
1656 controls whether this header is created when sending mails; it will be
1657 created automatically for a couple of reasons, too, like when the
1658 special
1659 .Dq mailing list specific
1660 respond command
1661 .Ic Lreply
1662 is used, when
1663 .Ic reply
1664 is used to respond to a message with its
1665 .Ql Mail-Followup-To:
1666 being honoured etc.
1669 A difference in between the handling of known and subscribed lists is
1670 that the address of the user is usually not part of a generated
1671 .Ql Mail-Followup-To:
1672 when addressing the latter, whereas it is for the former kind of lists.
1673 Usually because there are exceptions: say, if multiple lists are
1674 addressed and not all of them are subscribed lists.
1676 For convenience \*(UA will, temporarily, automatically add a list
1677 address that is presented in the
1678 .Ql List-Post:
1679 header of a message that is being responded to to the list of known
1680 mailing lists.
1681 Shall that header have existed \*(UA will instead, dependent on the
1682 variable
1683 .Va reply-to-honour ,
1684 use an also set
1685 .Ql Reply-To:
1686 for this purpose (if it provides a single address which resides on the
1687 same domain as what is stated in
1688 .Ql List-Post: )
1689 in order to accept a list administrator's wish that is supposed to have
1690 been manifested like that.
1691 .\" }}}
1693 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1694 .Ss "Signed and encrypted messages with S/MIME"
1696 \*(OP S/MIME provides two central mechanisms:
1697 message signing and message encryption.
1698 A signed message contains some data in addition to the regular text.
1699 The data can be used to verify that the message has been sent using
1700 a valid certificate, that the sender address matches that in the
1701 certificate, and that the message text has not been altered.
1702 Signing a message does not change its regular text;
1703 it can be read regardless of whether the recipients software is able to
1704 handle S/MIME.
1705 It is thus usually possible to sign all outgoing messages if so desired.
1708 Encryption, in contrast, makes the message text invisible for all people
1709 except those who have access to the secret decryption key.
1710 To encrypt a message, the specific recipients public encryption key
1711 must be known.
1712 It is therefore not possible to send encrypted mail to people unless their
1713 key has been retrieved from either previous communication or public key
1714 directories.
1715 Because signing is performed with private keys, and encryption with
1716 public keys, messages should always be signed before becoming encrypted.
1719 A central concept to S/MIME is that of the certification authority (CA).
1720 A CA is a trusted institution that issues certificates.
1721 For each of these certificates it can be verified that it really
1722 originates from the CA, provided that the CA's own certificate is
1723 previously known.
1724 A set of CA certificates is usually delivered and installed together
1725 with the cryptographical library that is used on the local system.
1726 Therefore reasonable security for S/MIME on the Internet is provided if
1727 the source that provides that library installation is trusted.
1728 It is also possible to use a specific pool of trusted certificates.
1729 If this is desired,
1730 .Va smime-ca-no-defaults
1731 should be set to avoid using the default certificate pool, and
1732 .Va smime-ca-file
1733 and/or
1734 .Va smime-ca-dir
1735 should be pointed to a trusted pool of certificates.
1736 A certificate cannot be more secure than the method its CA certificate
1737 has been retrieved with.
1740 This trusted pool of certificates is used by the command
1741 .Ic verify
1742 to ensure that the given S/MIME messages can be trusted.
1743 If so, verified sender certificates that were embedded in signed
1744 messages can be saved locally with the command
1745 .Ic certsave ,
1746 and used by \*(UA to encrypt further communication with these senders:
1748 .Bd -literal -offset indent
1749 ? certsave FILENAME
1750 ? set smime-encrypt-USER@HOST=FILENAME \e
1751     smime-cipher-USER@HOST=AES256
1755 To sign outgoing messages, in order to allow receivers to verify the
1756 origin of these messages, a personal S/MIME certificate is required.
1757 \*(UA supports password-protected personal certificates (and keys), see
1758 .Va smime-sign-cert .
1759 The section
1760 .Sx "On URL syntax and credential lookup"
1761 gives an overview of the possible sources of user credentials, and
1762 .Sx "S/MIME step by step"
1763 shows examplarily how a private S/MIME certificate can be obtained.
1764 In general, if such a private key plus certificate
1765 .Dq pair
1766 is available, all that needs to be done is to set some variables:
1768 .Bd -literal -offset indent
1769 ? set smime-sign-cert=ME@exam.ple.paired \e
1770     smime-sign-digest=SHA512 \e
1771     smime-sign
1775 Variables of interest for S/MIME in general are
1776 .Va smime-ca-dir ,
1777 .Va smime-ca-file ,
1778 .Va smime-ca-flags ,
1779 .Va smime-ca-no-defaults ,
1780 .Va smime-crl-dir ,
1781 .Va smime-crl-file .
1782 For S/MIME signing of interest are
1783 .Va smime-sign ,
1784 .Va smime-sign-cert ,
1785 .Va smime-sign-include-certs
1787 .Va smime-sign-digest .
1788 Additional variables of interest for S/MIME en- and decryption:
1789 .Va smime-cipher
1791 .Va smime-encrypt-USER@HOST .
1794 \*(ID Note that neither S/MIME signing nor encryption applies to
1795 message subjects or other header fields yet.
1796 Thus they may not contain sensitive information for encrypted messages,
1797 and cannot be trusted even if the message content has been verified.
1798 When sending signed messages,
1799 it is recommended to repeat any important header information in the
1800 message text.
1801 .\" }}}
1803 .\" .Ss "On URL syntax and credential lookup" {{{
1804 .Ss "On URL syntax and credential lookup"
1806 \*(IN For accessing protocol-specific resources usage of Uniform
1807 Resource Locators (URL, RFC 1738) has become omnipresent.
1808 \*(UA expects and understands URLs in the following form;
1809 parts in brackets
1810 .Ql []
1811 denote optional parts, optional either because there also exist other
1812 ways to define the information in question or because support of the
1813 part is protocol-specific, e.g.,
1814 .Ql /path
1815 is used by the \*(OPal Maildir directory and the IMAP protocol, but not
1816 by POP3; If any of
1817 .Ql USER
1819 .Ql PASSWORD
1820 are specified they must be given in URL percent encoded form (RFC 3986;
1821 the command
1822 .Ic urlcodec
1823 may be helpful):
1826 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1829 Note that these \*(UA URLs most often do not conform to any real
1830 standard, but instead represent a normalized variant of RFC 1738 \(en
1831 they are not used in data exchange but only meant as a compact,
1832 easy-to-use way of defining and representing information in
1833 a well-known notation.
1836 Many internal variables of \*(UA exist in multiple versions, called
1837 variable chains for the rest of this document: the plain
1838 .Ql variable
1839 as well as
1840 .Ql variable-HOST
1842 .Ql variable-USER@HOST .
1843 Here
1844 .Ql HOST
1845 indeed means
1846 .Ql server:port
1847 if a
1848 .Ql port
1849 had been specified in the respective URL, otherwise it refers to the plain
1850 .Ql server .
1851 Also,
1852 .Ql USER
1853 is not truly the
1854 .Ql USER
1855 that had been found when doing the user chain lookup as is described
1856 below, i.e., this
1857 .Ql USER
1858 will never be in URL percent encoded form, whether it came from an URL
1859 or not; i.e., variable chain name extensions of
1860 .Sx "INTERNAL VARIABLES"
1861 must not be URL percent encoded.
1864 For example, whether an hypothetical URL
1865 .Ql smtp://hey%3Ayou@our.house
1866 had been given that includes a user, or whether the URL was
1867 .Ql smtp://our.house
1868 and the user had been found differently, to lookup the variable chain
1869 .Va smtp-use-starttls
1870 \*(UA first looks for whether
1871 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1872 is defined, then whether
1873 .Ql smtp-\:use-\:starttls-\:our.house
1874 exists before finally ending up looking at the plain variable itself.
1877 \*(UA obeys the following logic scheme when dealing with the
1878 necessary credential information of an account:
1880 .Bl -bullet
1882 If no
1883 .Ql USER
1884 has been given in the URL the variables
1885 .Va user-HOST
1887 .Va user
1888 are looked up.
1889 If no such variable(s) can be found then \*(UA will,
1890 when enforced by the \*(OPal variables
1891 .Va netrc-lookup-HOST
1893 .Va netrc-lookup ,
1894 search
1895 .Sx "The .netrc file"
1896 of the user for a
1897 .Ql HOST
1898 specific entry which provides a
1899 .Ql login
1900 name: this lookup will only succeed if unambiguous (one possible matching
1901 entry for
1902 .Ql HOST ) .
1904 If there is still no
1905 .Ql USER
1906 then \*(UA will fall back to the user who is supposed to run \*(UA,
1907 the identity of which has been fixated during \*(UA startup and is
1908 known to be a valid user on the current host.
1911 Authentication: unless otherwise noted this will lookup the
1912 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1913 variable chain, falling back to a protocol-specific default should this
1914 have no success.
1917 If no
1918 .Ql PASSWORD
1919 has been given in the URL, then if the
1920 .Ql USER
1921 has been found through the \*(OPal
1922 .Va netrc-lookup
1923 that may have already provided the password, too.
1924 Otherwise the variable chain
1925 .Va password-USER@HOST , password-HOST , password
1926 is looked up and used if existent.
1928 Afterwards the complete \*(OPal variable chain
1929 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1930 is looked up.
1931 If set, the
1932 .Ic netrc
1933 cache is searched for a password only (multiple user accounts for
1934 a single machine may exist as well as a fallback entry without user
1935 but with a password).
1937 If at that point there is still no password available, but the
1938 (protocols') chosen authentication type requires a password, then in
1939 interactive mode the user will be prompted on the terminal.
1943 .Sy Note:
1944 S/MIME verification works relative to the values found in the
1945 .Ql From:
1947 .Ql Sender: )
1948 header field(s), which means that the values of
1949 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1951 .Va smime-sign-digest
1952 will not be looked up using the
1953 .Ql USER
1955 .Ql HOST
1956 chains from above but instead use the corresponding values from the
1957 message that is being worked on.
1958 In unusual cases multiple and different
1959 .Ql USER
1961 .Ql HOST
1962 combinations may therefore be involved \(en on the other hand those
1963 unusual cases become possible.
1964 The usual case is as short as:
1966 .Bd -literal -offset indent
1967 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1968     smime-sign smime-sign-cert=+smime.pair
1972 The section
1973 .Sx EXAMPLES
1974 contains complete example configurations.
1975 .\" }}}
1977 .\" .Ss "Encrypted network communication" {{{
1978 .Ss "Encrypted network communication"
1980 SSL (Secure Sockets Layer) a.k.a. its successor TLS (Transport Layer
1981 Security) are protocols which aid in securing communication by providing
1982 a safely initiated and encrypted network connection.
1983 A central concept of TLS is that of certificates: as part of each
1984 network connection setup a (set of) certificates will be exchanged, and
1985 by using those the identity of the network peer can be cryptographically
1986 verified; if possible the TLS/SNI (ServerNameIndication) extension will
1987 be enabled in order to allow servers fine-grained control over the
1988 certificates being used.
1989 TLS works by using a locally installed pool of trusted certificates,
1990 and verifying the connection peer succeeds if that provides
1991 a certificate which has been issued or is trusted by any certificate in
1992 the trusted local pool.
1995 The local pool of trusted so-called CA (Certification Authority)
1996 certificates is usually delivered with the used TLS library, and
1997 will be selected automatically.
1998 It is also possible to use a specific pool of trusted certificates.
1999 If this is desired,
2000 .Va tls-ca-no-defaults
2001 should be set to avoid using the default certificate pool, and
2002 .Va tls-ca-file
2003 and/or (with special preparation)
2004 .Va tls-ca-dir
2005 should be pointed to a trusted pool of certificates.
2006 A certificate cannot be more secure than the method its CA certificate
2007 has been retrieved with.
2008 For inspection or other purposes, the certificate of a server (as seen
2009 when connecting to it) can be fetched like this:
2011 .Bd -literal -offset indent
2012 $ </dev/null openssl s_client -showcerts -connect \e
2013     the-server.example:pop3s 2>&1 | tee log.txt
2017 \*(UA also supports a mode of operation in which certificates are not
2018 at all matched against a local pool of CA certificates.
2019 Instead a message digest will be calculated for the certificate
2020 presented by the connection peer, and be compared against
2021 .Va tls-fingerprint
2022 (a variable chain that picks up
2023 .Ql USER@HOST
2025 .Ql HOST
2026 context-dependent variable variants), and the connection will succeed if
2027 the calculated digest equals the expected one.
2028 The used message digest can be configured via (the chain)
2029 .Va tls-fingerprint-digest .
2030 The command
2031 .Ic tls
2032 may be helpful.
2035 It depends on the used protocol whether encrypted communication is
2036 possible, and which configuration steps have to be taken to enable it.
2037 Some protocols, e.g., POP3S, are implicitly encrypted, others, like
2038 POP3, can upgrade a plain text connection if so requested.
2039 For example, to use the
2040 .Ql STLS
2041 that POP3 offers (a member of) the variable (chain)
2042 .Va pop3-use-starttls
2043 needs to be set:
2045 .Bd -literal -offset indent
2046 shortcut encpop1 pop3s://pop1.exam.ple
2048 shortcut encpop2 pop3://pop2.exam.ple
2049 set pop3-use-starttls-pop2.exam.ple
2051 set mta=smtps://smtp.exam.ple:465
2052 set mta=smtp://smtp.exam.ple smtp-use-starttls
2056 Normally that is all there is to do, given that TLS libraries try to
2057 provide safe defaults, plenty of knobs however exist to adjust settings.
2058 For example certificate verification settings can be fine-tuned via
2059 .Va tls-ca-flags ,
2060 and the TLS configuration basics are accessible via
2061 .Va tls-config-pairs ,
2062 for example to specify the allowed protocols or cipher lists that
2063 a communication channel may use.
2064 In the past hints on how to restrict the set of protocols to highly
2065 secure ones were indicated, but as of the time of this writing the list
2066 of protocols or ciphers may need to become relaxed in order to be able
2067 to connect to some servers; the following example allows connecting to a
2068 .Dq Lion
2069 that uses OpenSSL 0.9.8za from June 2014 (refer to
2070 .Sx "INTERNAL VARIABLES"
2071 for more on variable chains):
2073 .Bd -literal -offset indent
2074 wysh set tls-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
2075     CipherString=TLSv1.2:!aNULL:!eNULL:\e
2076       ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
2077       DHE-RSA-AES256-SHA:@STRENGTH'
2081 The OpenSSL program
2082 .Xr ciphers 1
2083 can be used and should be referred to when creating a custom cipher list.
2084 Variables of interest for TLS in general are
2085 .Va tls-ca-dir ,
2086 .Va tls-ca-file ,
2087 .Va tls-ca-flags ,
2088 .Va tls-ca-no-defaults ,
2089 .Va tls-config-file ,
2090 .Va tls-config-module ,
2091 .Va tls-config-pairs ,
2092 .Va tls-crl-dir ,
2093 .Va tls-crl-file ,
2094 .Va tls-rand-file
2095 as well as
2096 .Va tls-verify .
2097 .\" }}}
2099 .\" .Ss "Character sets" {{{
2100 .Ss "Character sets"
2102 \*(OP \*(UA detects the character set of the terminal by using
2103 mechanisms that are controlled by the
2104 .Ev LC_CTYPE
2105 environment variable
2106 (in fact
2107 .Ev LC_ALL ,
2108 .Ev \&\&LC_CTYPE ,
2109 .Ev LANG ,
2110 in that order, see there).
2111 The internal variable
2112 .Va ttycharset
2113 will be set to the detected terminal character set accordingly,
2114 and will thus show up in the output of commands like, e.g.,
2115 .Ic set
2117 .Ic varshow .
2120 However, the user may give
2121 .Va ttycharset
2122 a value during startup, making it possible to send mail in a completely
2123 .Dq faked
2124 locale environment, an option which can be used to generate and send,
2125 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2126 .Ql LC_ALL=C
2127 environment (an example of this can be found in the section
2128 .Sx "On sending mail, and non-interactive mode" ) .
2129 Changing the value does not mean much beside that, because several
2130 aspects of the real character set are implied by the locale environment
2131 of the system, which stays unaffected by
2132 .Va ttycharset .
2135 Messages and attachments which consist of 7-bit clean data will be
2136 classified as consisting of
2137 .Va charset-7bit
2138 character data.
2139 This is a problem if the
2140 .Va ttycharset
2141 character set is a multibyte character set that is also 7-bit clean.
2142 For example, the Japanese character set ISO-2022-JP is 7-bit clean but
2143 capable to encode the rich set of Japanese Kanji, Hiragana and Katakana
2144 characters: in order to notify receivers of this character set the mail
2145 message must be MIME encoded so that the character set ISO-2022-JP can
2146 be advertised!
2147 To achieve this, the variable
2148 .Va charset-7bit
2149 must be set to ISO-2022-JP.
2150 (Today a better approach regarding email is the usage of UTF-8, which
2151 uses 8-bit bytes for non-US-ASCII data.)
2154 If the \*(OPal character set conversion capabilities are not available
2155 .Pf ( Va features
2156 does not include the term
2157 .Ql +iconv ) ,
2158 then
2159 .Va ttycharset
2160 will be the only supported character set,
2161 it is simply assumed that it can be used to exchange 8-bit messages
2162 (over the wire an intermediate, configurable
2163 .Va mime-encoding
2164 may be applied),
2165 and the rest of this section does not apply;
2166 it may however still be necessary to explicitly set it if automatic
2167 detection fails, since in that case it defaults to
2168 .\" (Keep in SYNC: ./nail.1:"Character sets", ./config.h:CHARSET_*!)
2169 LATIN1 a.k.a. ISO-8859-1 unless the operating system environment is
2170 known to always and exclusively support UTF-8 locales.
2173 \*(OP When reading messages, their text is converted into
2174 .Va ttycharset
2175 as necessary in order to display them on the user's terminal.
2176 Unprintable characters and invalid byte sequences are detected
2177 and replaced by proper substitution characters.
2178 Character set mappings for source character sets can be established with
2179 the command
2180 .Ic charsetalias ,
2181 which may be handy to work around faulty character set catalogues (e.g.,
2182 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
2183 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
2184 Also see
2185 .Va charset-unknown-8bit
2186 to deal with another hairy aspect of message interpretation.
2189 When sending messages their parts and attachments are classified.
2190 Whereas no character set conversion is performed on those parts which
2191 appear to be binary data,
2192 the character set being used must be declared within the MIME header of
2193 an outgoing text part if it contains characters that do not conform to
2194 the set of characters that are allowed by the email standards.
2195 Permissible values for character sets used in outgoing messages can be
2196 declared using the
2197 .Va sendcharsets
2198 variable, and
2199 .Va charset-8bit ,
2200 which defines a catch-all last-resort fallback character set that is
2201 implicitly appended to the list of character sets in
2202 .Va sendcharsets .
2205 When replying to a message and the variable
2206 .Va reply-in-same-charset
2207 is set, then the character set of the message being replied to
2208 is tried first (still being a subject of
2209 .Ic charsetalias ) .
2210 And it is also possible to make \*(UA work even more closely related to
2211 the current locale setting automatically by using the variable
2212 .Va sendcharsets-else-ttycharset ,
2213 please see there for more information.
2216 All the specified character sets are tried in order unless the
2217 conversion of the part or attachment succeeds.
2218 If none of the tried (8-bit) character sets is capable to represent the
2219 content of the part or attachment,
2220 then the message will not be send and its text will optionally be
2221 .Va save Ns d
2223 .Ev DEAD .
2224 In general, if a message saying
2225 .Dq cannot convert from a to b
2226 appears, either some characters are not appropriate for the currently
2227 selected (terminal) character set,
2228 or the needed conversion is not supported by the system.
2229 In the first case, it is necessary to set an appropriate
2230 .Ev LC_CTYPE
2231 locale and/or the variable
2232 .Va ttycharset .
2235 The best results are usually achieved when \*(UA is run in a UTF-8
2236 locale on an UTF-8 capable terminal, in which case the full Unicode
2237 spectrum of characters is available.
2238 In this setup characters from various countries can be displayed,
2239 while it is still possible to use more simple character sets for sending
2240 to retain maximum compatibility with older mail clients.
2243 On the other hand the POSIX standard defines a locale-independent 7-bit
2244 .Dq portable character set
2245 that should be used when overall portability is an issue, the even more
2246 restricted subset named
2247 .Dq portable filename character set
2248 consists of A-Z, a-z, 0-9, period
2249 .Ql \&. ,
2250 underscore
2251 .Ql _
2252 and hyphen-minus
2253 .Ql - .
2254 .\" }}}
2256 .\" .Ss "Message states" {{{
2257 .Ss "Message states"
2259 \*(UA differentiates in between several message states; the current
2260 state will be reflected in the summary of
2261 .Ic headers
2262 if the
2263 .Va attrlist
2264 of the configured
2265 .Va headline
2266 allows, and
2267 .Sx "Specifying messages"
2268 dependent on their state is possible.
2269 When operating on the system
2270 .Va inbox ,
2271 or in any other
2272 .Mx -sx
2273 .Sx "primary system mailbox" ,
2274 special actions, like the automatic moving of messages to the
2275 .Mx -sx
2276 .Sx "secondary mailbox"
2277 .Ev MBOX ,
2278 may be applied when the mailbox is left (also implicitly by program
2279 termination, unless the command
2280 .Ic exit
2281 was used) \(en however, because this may be irritating to users which
2282 are used to
2283 .Dq more modern
2284 mail-user-agents, the provided global
2285 .Pa \*(UR
2286 template sets the internal
2287 .Va hold
2289 .Va keepsave
2290 variables in order to suppress this behaviour.
2292 .Bl -hang -width ".It Ql new"
2293 .It Ql new
2294 Message has neither been viewed nor moved to any other state.
2295 Such messages are retained even in the
2296 .Mx -sx
2297 .Sx "primary system mailbox" .
2299 .It Ql unread
2300 Message has neither been viewed nor moved to any other state, but the
2301 message was present already when the mailbox has been opened last:
2302 Such messages are retained even in the
2303 .Mx -sx
2304 .Sx "primary system mailbox" .
2306 .It Ql read
2307 The message has been processed by one of the following commands:
2308 .Ic ~f ,
2309 .Ic ~m ,
2310 .Ic ~F ,
2311 .Ic ~M ,
2312 .Ic copy ,
2313 .Ic mbox ,
2314 .Ic next ,
2315 .Ic pipe  ,
2316 .Ic Print ,
2317 .Ic print ,
2318 .Ic top ,
2319 .Ic Type ,
2320 .Ic type ,
2321 .Ic undelete .
2322 The commands
2323 .Ic dp
2325 .Ic dt
2326 will always try to automatically
2327 .Dq step
2329 .Ic type
2331 .Dq next
2332 logical message, and may thus mark multiple messages as read, the
2333 .Ic delete
2334 command will do so if the internal variable
2335 .Va autoprint
2336 is set.
2338 Except when the
2339 .Ic exit
2340 command is used, messages that are in a
2341 .Mx -sx
2342 .Sx "primary system mailbox"
2343 and are in
2344 .Ql read
2345 state when the mailbox is left will be saved in the
2346 .Mx -sx
2347 .Sx "secondary mailbox"
2348 .Ev MBOX
2349 unless the internal variable
2350 .Va hold
2351 it set.
2353 .It Ql deleted
2354 The message has been processed by one of the following commands:
2355 .Ic delete ,
2356 .Ic dp ,
2357 .Ic dt .
2358 Only
2359 .Ic undelete
2360 can be used to access such messages.
2362 .It Ql preserved
2363 The message has been processed by a
2364 .Ic preserve
2365 command and it will be retained in its current location.
2367 .It Ql saved
2368 The message has been processed by one of the following commands:
2369 .Ic save
2371 .Ic write .
2372 Unless when the
2373 .Ic exit
2374 command is used, messages that are in a
2375 .Mx -sx
2376 .Sx "primary system mailbox"
2377 and are in
2378 .Ql saved
2379 state when the mailbox is left will be deleted; they will be saved in the
2380 .Mx -sx
2381 .Sx "secondary mailbox"
2382 .Ev MBOX
2383 when the internal variable
2384 .Va keepsave
2385 is set.
2389 In addition to these message states, flags which otherwise have no
2390 technical meaning in the mail system except allowing special ways of
2391 addressing them when
2392 .Sx "Specifying messages"
2393 can be set on messages.
2394 These flags are saved with messages and are thus persistent, and are
2395 portable between a set of widely used MUAs.
2397 .Bl -hang -width ".It Ic answered"
2398 .It Ic answered
2399 Mark messages as having been answered.
2400 .It Ic draft
2401 Mark messages as being a draft.
2402 .It Ic flag
2403 Mark messages which need special attention.
2405 .\" }}}
2407 .\" .Ss "Specifying messages" {{{
2408 .Ss "Specifying messages"
2410 \*(NQ Commands which take
2411 .Sx "Message list arguments" ,
2412 such as
2413 .Ic from
2414 a.k.a.\&
2415 .Ic search ,
2416 .Ic type
2418 .Ic delete ,
2419 can be given a list of message numbers as arguments to apply to a number
2420 of messages at once.
2421 Thus
2422 .Ql delete 1 2
2423 deletes messages 1 and 2,
2424 whereas
2425 .Ql delete 1-5
2426 will delete the messages 1 through 5.
2427 In sorted or threaded mode (see the
2428 .Ic sort
2429 command),
2430 .Ql delete 1-5
2431 will delete the messages that are located between (and including)
2432 messages 1 through 5 in the sorted/threaded order, as shown in the
2433 .Ic headers
2434 summary.
2435 The following special message names exist:
2438 .Bl -tag -width ".It Ar BaNg"
2439 .It Ar \&.
2440 The current message, the so-called
2441 .Dq dot .
2443 .It Ar \&;
2444 The message that was previously the current message; needs to be quoted.
2446 .It Ar \&,
2447 The parent message of the current message,
2448 that is the message with the Message-ID given in the
2449 .Ql In-Reply-To:
2450 field or the last entry of the
2451 .Ql References:
2452 field of the current message.
2454 .It Ar -
2455 The previous undeleted message, or the previous deleted message for the
2456 .Ic undelete
2457 command; In
2458 .Ic sort Ns
2459 ed or
2460 .Ql thread Ns
2461 ed mode, the previous such message in the according order.
2463 .It Ar +
2464 The next undeleted message, or the next deleted message for the
2465 .Ic undelete
2466 command; In
2467 .Ic sort Ns
2468 ed or
2469 .Ql thread Ns
2470 ed mode, the next such message in the according order.
2472 .It Ar ^
2473 The first undeleted message,
2474 or the first deleted message for the
2475 .Ic undelete
2476 command; In
2477 .Ic sort Ns
2478 ed or
2479 .Ql thread Ns
2480 ed mode, the first such message in the according order.
2482 .It Ar $
2483 The last message; In
2484 .Ic sort Ns
2485 ed or
2486 .Ql thread Ns
2487 ed mode, the last such message in the according order.
2488 Needs to be quoted.
2490 .It Ar & Ns Ar x
2492 .Ql thread Ns
2494 .Ic sort
2495 mode, selects the message addressed with
2496 .Ar x ,
2497 where
2498 .Ar x
2499 is any other message specification,
2500 and all messages from the thread that begins at it.
2501 Otherwise it is identical to
2502 .Ar x .
2504 .Ar x
2505 is omitted,
2506 the thread beginning with the current message is selected.
2508 .It Ar *
2509 All messages.
2511 .It Ar `
2512 All messages that were included in the
2513 .Sx "Message list arguments"
2514 of the previous command; needs to be quoted.
2516 .It Ar x-y
2517 An inclusive range of message numbers.
2518 Selectors that may also be used as endpoints include any of
2519 .Ar .;-+^$ .
2521 .It Ar address
2522 A case-insensitive
2523 .Dq any substring matches
2524 search against the
2525 .Ql From:
2526 header, which will match addresses (too) even if
2527 .Va showname
2528 is set (and POSIX says
2529 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2530 However, if the
2531 .Va allnet
2532 variable is set, only the local part of the address is evaluated
2533 for the comparison, not ignoring case, and the setting of
2534 .Va showname
2535 is completely ignored.
2536 For finer control and match boundaries use the
2537 .Ql @
2538 search expression.
2540 .It Ar / Ns Ar string
2541 All messages that contain
2542 .Ar string
2543 in the subject field (case ignored according to locale).
2544 See also the
2545 .Va searchheaders
2546 variable.
2548 .Ar string
2549 is empty,
2550 the string from the previous specification of that type is used again.
2553 .It Xo Op Ar @ Ns Ar name-list Ns
2554 .Ar @ Ns Ar expr
2556 All messages that contain the given case-insensitive search
2557 .Ar expr Ns
2558 ession;  If the \*(OPal regular expression support is available
2559 .Ar expr
2560 will be interpreted as (an extended) one if any of the
2561 .Dq magical
2562 regular expression characters
2563 .Ql ^[]*+?|$
2564 is seen (see
2565 .Xr re_format 7 ) .
2566 If the optional
2567 .Ar @ Ns Ar name-list
2568 part is missing the search is restricted to the subject field body,
2569 but otherwise
2570 .Ar name-list
2571 specifies a comma-separated list of header fields to search, e.g.,
2574 .Dl '@to,from,cc@Someone i ought to know'
2577 In order to search for a string that includes a
2578 .Ql @
2579 (commercial at) character the
2580 .Ar name-list
2581 is effectively non-optional, but may be given as the empty string.
2582 Also, specifying an empty search
2583 .Ar expr Ns
2584 ession will effectively test for existence of the given header fields.
2585 Some special header fields may be abbreviated:
2586 .Ql f ,
2587 .Ql t ,
2588 .Ql c ,
2589 .Ql b
2591 .Ql s
2592 will match
2593 .Ql From ,
2594 .Ql To ,
2595 .Ql Cc ,
2596 .Ql Bcc
2598 .Ql Subject ,
2599 respectively and case-insensitively.
2600 \*(OPally, and just like
2601 .Ar expr ,
2602 .Ar name-list
2603 will be interpreted as (an extended) regular expression if any of the
2604 .Dq magical
2605 regular expression characters is seen.
2608 The special names
2609 .Ql header
2611 .Ql <
2612 can be used to search in (all of) the header(s) of the message, and the
2613 special names
2614 .Ql body
2616 .Ql >
2618 .Ql text
2620 .Ql =
2621 will perform full text searches \(en whereas the former searches only
2622 the body, the latter also searches the message header (\*(ID this mode
2623 yet brute force searches over the entire decoded content of messages,
2624 including administrativa strings).
2627 This specification performs full text comparison, but even with
2628 regular expression support it is almost impossible to write a search
2629 expression that safely matches only a specific address domain.
2630 To request that the body content of the header is treated as a list of
2631 addresses, and to strip those down to the plain email address which the
2632 search expression is to be matched against, prefix the effective
2633 .Ar name-list
2634 with a tilde
2635 .Ql ~ :
2638 .Dl '@~f,c@@a\e.safe\e.domain\e.match$'
2641 .It Ar :c
2642 All messages of state or with matching condition
2643 .Ql c ,
2644 where
2645 .Ql c
2646 is one or multiple of the following colon modifiers:
2648 .Bl -tag -compact -width ".It Ar :M"
2649 .It Ar a
2650 .Ic answered
2651 messages (cf. the variable
2652 .Va markanswered ) .
2653 .It Ar d
2654 .Ql deleted
2655 messages (for the
2656 .Ic undelete
2658 .Ic from
2659 commands only).
2660 .It Ar f
2661 .Ic flag Ns
2662 ged messages.
2663 .It Ar L
2664 Messages with receivers that match
2665 .Ic mlsubscribe Ns
2666 d addresses.
2667 .It Ar l
2668 Messages with receivers that match
2669 .Ic mlist Ns
2670 ed addresses.
2671 .It Ar n
2672 .Ql new
2673 messages.
2674 .It Ar o
2675 Old messages (any not in state
2676 .Ql read
2678 .Ql new ) .
2679 .It Ar r
2680 .Ql read
2681 messages.
2682 .It Ar S
2683 \*(OP Messages with unsure spam classification (see
2684 .Sx "Handling spam" ) .
2685 .It Ar s
2686 \*(OP Messages classified as spam.
2687 .It Ar t
2688 Messages marked as
2689 .Ic draft .
2690 .It Ar u
2691 .Ql unread
2692 messages.
2698 \*(OP IMAP-style SEARCH expressions may also be used.
2699 These consist of keywords and criterions, and because
2700 .Sx "Message list arguments"
2701 are split into tokens according to
2702 .Sx "Shell-style argument quoting"
2703 it is necessary to quote the entire IMAP search expression in order to
2704 ensure that it remains a single token.
2705 This addressing mode is available with all types of mailbox
2706 .Ic folder Ns
2707 s; \*(UA will perform the search locally as necessary.
2708 Strings must be enclosed by double quotes
2709 .Ql \&"
2710 in their entirety if they contain whitespace or parentheses;
2711 within the quotes, only reverse solidus
2712 .Ql \e
2713 is recognized as an escape character.
2714 All string searches are case-insensitive.
2715 When the description indicates that the
2716 .Dq envelope
2717 representation of an address field is used,
2718 this means that the search string is checked against both a list
2719 constructed as
2721 .Bd -literal -offset indent
2722 \&'(\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)'
2726 for each address,
2727 and the addresses without real names from the respective header field.
2728 These search expressions can be nested using parentheses, see below for
2729 examples.
2732 .Bl -tag -compact -width ".It Ar _n_u"
2733 .It Ar ( criterion )
2734 All messages that satisfy the given
2735 .Ar criterion .
2736 .It Ar ( criterion1 criterion2 ... criterionN )
2737 All messages that satisfy all of the given criteria.
2739 .It Ar ( or criterion1 criterion2 )
2740 All messages that satisfy either
2741 .Ar criterion1
2743 .Ar criterion2 ,
2744 or both.
2745 To connect more than two criteria using
2746 .Ql or
2747 specifications have to be nested using additional parentheses,
2748 as with
2749 .Ql (or a (or b c)) ,
2750 since
2751 .Ql (or a b c)
2752 really means
2753 .Ql ((a or b) and c) .
2754 For a simple
2755 .Ql or
2756 operation of independent criteria on the lowest nesting level,
2757 it is possible to achieve similar effects by using three separate
2758 criteria, as with
2759 .Ql (a) (b) (c) .
2761 .It Ar ( not criterion )
2762 All messages that do not satisfy
2763 .Ar criterion .
2764 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2765 All messages that contain
2766 .Ar string
2767 in the envelope representation of the
2768 .Ql Bcc:
2769 field.
2770 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2771 All messages that contain
2772 .Ar string
2773 in the envelope representation of the
2774 .Ql Cc:
2775 field.
2776 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2777 All messages that contain
2778 .Ar string
2779 in the envelope representation of the
2780 .Ql From:
2781 field.
2782 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2783 All messages that contain
2784 .Ar string
2785 in the
2786 .Ql Subject:
2787 field.
2788 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2789 All messages that contain
2790 .Ar string
2791 in the envelope representation of the
2792 .Ql To:
2793 field.
2794 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2795 All messages that contain
2796 .Ar string
2797 in the specified
2798 .Ql Name:
2799 field.
2800 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2801 All messages that contain
2802 .Ar string
2803 in their body.
2804 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2805 All messages that contain
2806 .Ar string
2807 in their header or body.
2808 .It Ar ( larger size )
2809 All messages that are larger than
2810 .Ar size
2811 (in bytes).
2812 .It Ar ( smaller size )
2813 All messages that are smaller than
2814 .Ar size
2815 (in bytes).
2817 .It Ar ( before date )
2818 All messages that were received before
2819 .Ar date ,
2820 which must be in the form
2821 .Ql d[d]-mon-yyyy ,
2822 where
2823 .Ql d
2824 denotes the day of the month as one or two digits,
2825 .Ql mon
2826 is the name of the month \(en one of
2827 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2829 .Ql yyyy
2830 is the year as four digits, e.g.,
2831 .Ql 28-Dec-2012 .
2833 .It Ar ( on date )
2834 All messages that were received on the specified date.
2835 .It Ar ( since date )
2836 All messages that were received since the specified date.
2837 .It Ar ( sentbefore date )
2838 All messages that were sent on the specified date.
2839 .It Ar ( senton date )
2840 All messages that were sent on the specified date.
2841 .It Ar ( sentsince date )
2842 All messages that were sent since the specified date.
2843 .It Ar ()
2844 The same criterion as for the previous search.
2845 This specification cannot be used as part of another criterion.
2846 If the previous command line contained more than one independent
2847 criterion then the last of those criteria is used.
2849 .\" }}}
2851 .\" .Ss "On terminal control and line editor" {{{
2852 .Ss "On terminal control and line editor"
2854 \*(OP Terminal control will be realized through one of the standard
2856 libraries, either the
2857 .Lb libtermcap ,
2858 or, alternatively, the
2859 .Lb libterminfo ,
2860 both of which will be initialized to work with the environment variable
2861 .Ev TERM .
2862 Terminal control will enhance or enable interactive usage aspects, e.g.,
2863 .Sx "Coloured display" ,
2864 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2865 byte-sequences of keys like the cursor- and function-keys.
2868 The internal variable
2869 .Va termcap
2870 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2871 Actual library interaction can be disabled completely by setting
2872 .Va termcap-disable ;
2873 .Va termcap
2874 will be queried regardless, which is true even if the \*(OPal library
2875 support has not been enabled at configuration time as long as some other
2876 \*(OP which (may) query terminal control sequences has been enabled.
2877 \*(UA can be told to enter an alternative exclusive screen, the
2878 so-called ca-mode, by setting
2879 .Va termcap-ca-mode ;
2880 this requires sufficient terminal support, and the used
2881 .Ev PAGER
2882 may also need special configuration, dependent on the value of
2883 .Va crt .
2886 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2887 environments which comply to the ISO C standard
2888 .St -isoC-amd1 ,
2889 and will support wide glyphs if possible (the necessary functionality
2890 had been removed from ISO C, but was included in
2891 .St -xpg4 ) .
2892 Usage of a line editor in interactive mode can be prevented by setting
2893 .Va line-editor-disable .
2894 Especially if the \*(OPal terminal control support is missing setting
2895 entries in the internal variable
2896 .Va termcap
2897 will help shall the MLE misbehave, see there for more.
2898 The MLE can support a little bit of
2899 .Ic colour .
2902 \*(OP If the
2903 .Ic history
2904 feature is available then input from line editor prompts will be saved
2905 in a history list that can be searched in and be expanded from.
2906 Such saving can be prevented by prefixing input with any amount of
2907 whitespace.
2908 Aspects of history, like allowed content and maximum size, as well as
2909 whether history shall be saved persistently, can be configured with the
2910 internal variables
2911 .Va history-file ,
2912 .Va history-gabby ,
2913 .Va history-gabby-persist
2915 .Va history-size .
2918 The MLE supports a set of editing and control commands.
2919 By default (as) many (as possible) of these will be assigned to a set of
2920 single-letter control codes, which should work on any terminal (and can
2921 be generated by holding the
2922 .Dq control
2923 key while pressing the key of desire, e.g.,
2924 .Ql control-D ) .
2925 If the \*(OPal
2926 .Ic bind
2927 command is available then the MLE commands can also be accessed freely
2928 by assigning the command name, which is shown in parenthesis in the list
2929 below, to any desired key-sequence, and the MLE will instead and also use
2930 .Ic bind
2931 to establish its built-in key bindings
2932 (more of them if the \*(OPal terminal control is available),
2933 an action which can then be suppressed completely by setting
2934 .Va line-editor-no-defaults .
2935 .Sx "Shell-style argument quoting"
2936 notation is used in the following;
2937 combinations not mentioned either cause job control signals or do not
2938 generate a (unique) keycode:
2942 .Bl -tag -compact -width ".It Ql \eBa"
2943 .It Ql \ecA
2944 Go to the start of the line
2946 .Pf ( Cd mle-go-home ) .
2948 .It Ql \ecB
2949 Move the cursor backward one character
2951 .Pf ( Cd mle-go-bwd ) .
2953 .It Ql \ecD
2954 Forward delete the character under the cursor;
2955 quits \*(UA if used on the empty line unless the internal variable
2956 .Va ignoreeof
2957 is set
2959 .Pf ( Cd mle-del-fwd ) .
2961 .It Ql \ecE
2962 Go to the end of the line
2964 .Pf ( Cd mle-go-end ) .
2966 .It Ql \ecF
2967 Move the cursor forward one character
2969 .Pf ( Cd mle-go-fwd ) .
2971 .It Ql \ecG
2972 Cancel current operation, full reset.
2973 If there is an active history search or tabulator expansion then this
2974 command will first reset that, reverting to the former line content;
2975 thus a second reset is needed for a full reset in this case
2977 .Pf ( Cd mle-reset ) .
2979 .It Ql \ecH
2980 Backspace: backward delete one character
2982 .Pf ( Cd mle-del-bwd ) .
2984 .It Ql \ecI
2985 \*(NQ
2986 Horizontal tabulator:
2987 try to expand the word before the cursor, supporting the usual
2988 .Sx "Filename transformations"
2990 .Pf ( Cd mle-complete ;
2991 this is affected by
2992 .Cd mle-quote-rndtrip ) .
2994 .It Ql \ecJ
2995 Newline:
2996 commit the current line
2998 .Pf ( Cd mle-commit ) .
3000 .It Ql \ecK
3001 Cut all characters from the cursor to the end of the line
3003 .Pf ( Cd mle-snarf-end ) .
3005 .It Ql \ecL
3006 Repaint the line
3008 .Pf ( Cd mle-repaint ) .
3010 .It Ql \ecN
3011 \*(OP Go to the next history entry
3013 .Pf ( Cd mle-hist-fwd ) .
3015 .It Ql \ecO
3016 (\*(OPally context-dependent) Invokes the command
3017 .Ic dt .
3019 .It Ql \ecP
3020 \*(OP Go to the previous history entry
3022 .Pf ( Cd mle-hist-bwd ) .
3024 .It Ql \ecQ
3025 Toggle roundtrip mode shell quotes, where produced,
3026 on and off
3028 .Pf ( Cd mle-quote-rndtrip ) .
3029 This setting is temporary, and will be forgotten once the command line
3030 is committed; also see
3031 .Ic shcodec .
3033 .It Ql \ecR
3034 \*(OP Complete the current line from (the remaining) older history entries
3036 .Pf ( Cd mle-hist-srch-bwd ) .
3038 .It Ql \ecS
3039 \*(OP Complete the current line from (the remaining) newer history entries
3041 .Pf ( Cd mle-hist-srch-fwd ) .
3043 .It Ql \ecT
3044 Paste the snarf buffer
3046 .Pf ( Cd mle-paste ) .
3048 .It Ql \ecU
3049 The same as
3050 .Ql \ecA
3051 followed by
3052 .Ql \ecK
3054 .Pf ( Cd mle-snarf-line ) .
3056 .It Ql \ecV
3057 Prompts for a Unicode character (hexadecimal number without prefix, see
3058 .Ic vexpr )
3059 to be inserted
3061 .Pf ( Cd mle-prompt-char ) .
3062 Note this command needs to be assigned to a single-letter control code
3063 in order to become recognized and executed during input of
3064 a key-sequence (only three single-letter control codes can be used for
3065 that shortcut purpose); this control code is then special-treated and
3066 thus cannot be part of any other sequence (because it will trigger the
3067 .Cd mle-prompt-char
3068 function immediately).
3070 .It Ql \ecW
3071 Cut the characters from the one preceding the cursor to the preceding
3072 word boundary
3074 .Pf ( Cd mle-snarf-word-bwd ) .
3076 .It Ql \ecX
3077 Move the cursor forward one word boundary
3079 .Pf ( Cd mle-go-word-fwd ) .
3081 .It Ql \ecY
3082 Move the cursor backward one word boundary
3084 .Pf ( Cd mle-go-word-bwd ) .
3086 .It Ql \ec[
3087 Escape: reset a possibly used multibyte character input state machine
3088 and \*(OPally a lingering, incomplete key binding
3090 .Pf ( Cd mle-cancel ) .
3091 This command needs to be assigned to a single-letter control code in
3092 order to become recognized and executed during input of a key-sequence
3093 (only three single-letter control codes can be used for that shortcut
3094 purpose).
3095 This control code may also be part of a multi-byte sequence, but if
3096 a sequence is active and the very control code is currently also an
3097 expected input, then the active sequence takes precedence and will
3098 consume the control code.
3100 .It Ql \ec\e
3101 (\*(OPally context-dependent) Invokes the command
3102 .Ql Ic z Ns + .
3104 .It Ql \ec]
3105 (\*(OPally context-dependent) Invokes the command
3106 .Ql Ic z Ns $ .
3108 .It Ql \ec^
3109 (\*(OPally context-dependent) Invokes the command
3110 .Ql Ic z Ns 0 .
3112 .It Ql \ec_
3113 Cut the characters from the one after the cursor to the succeeding word
3114 boundary
3116 .Pf ( Cd mle-snarf-word-fwd ) .
3118 .It Ql \ec?
3119 Backspace:
3120 .Cd mle-del-bwd .
3122 .It \(en
3123 Move the cursor forward one screen width
3125 .Pf ( Cd mle-go-screen-fwd ) .
3127 .It \(en
3128 Move the cursor backward one screen width
3130 .Pf ( Cd mle-go-screen-bwd ) .
3132 .It \(en
3133 \*(OP Move the cursor home and clear the screen
3135 .Pf ( Cd mle-clear-screen ) .
3137 .It \(en
3139 .Cd mle-fullreset :
3140 different to
3141 .Cd mle-reset
3142 this will immediately reset a possibly active search etc.
3144 .It \(en
3146 .Cd mle-bell :
3147 ring the audible bell.
3149 .\" }}}
3151 .\" .Ss "Coloured display" {{{
3152 .Ss "Coloured display"
3154 \*(OP \*(UA can be configured to support a coloured display and font
3155 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
3156 rendition) escape sequences.
3157 Usage of colours and font attributes solely depends upon the
3158 capability of the detected terminal type that is defined by the
3159 environment variable
3160 .Ev TERM
3161 and which can be fine-tuned by the user via the internal variable
3162 .Va termcap .
3165 On top of what \*(UA knows about the terminal the boolean variable
3166 .Va colour-pager
3167 defines whether the actually applicable colour and font attribute
3168 sequences should also be generated when output is going to be paged
3169 through the external program defined by the environment variable
3170 .Ev PAGER
3171 (also see
3172 .Va crt Ns
3174 This is not enabled by default because different pager programs need
3175 different command line switches or other configuration in order to
3176 support those sequences.
3177 \*(UA however knows about some widely used pagers and in a clean
3178 environment it is often enough to simply set
3179 .Va colour-pager ;
3180 please refer to that variable for more on this topic.
3183 Colours and font attributes can be managed with the multiplexer command
3184 .Ic colour ,
3186 .Ic uncolour
3187 can be used to remove mappings of a given colour type.
3188 If the variable
3189 .Va colour-disable
3190 is set then any active usage of colour and font attribute sequences
3191 is suppressed without affecting possibly established
3192 .Ic colour
3193 mappings.
3194 Since colours are only available in interactive mode, it may make
3195 sense to conditionalize the colour setup by encapsulating it with
3196 .Ic if :
3198 .Bd -literal -offset indent
3199 if terminal && [ "$features" =% +colour ]
3200   colour iso view-msginfo ft=bold,fg=green
3201   colour iso view-header ft=bold,fg=red from,subject
3202   colour iso view-header fg=red
3204   uncolour iso view-header from,subject
3205   colour iso view-header ft=bold,fg=magenta,bg=cyan
3206   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3207   colour mono view-header ft=bold
3208   colour mono view-header ft=bold,ft=reverse subject,from
3209 endif
3211 .\" }}}
3213 .\" .Ss "Handling spam" {{{
3214 .Ss "Handling spam"
3216 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3217 identification of, and, in general, dealing with spam messages.
3218 A precondition of most commands in order to function is that the
3219 .Va spam-interface
3220 variable is set to one of the supported interfaces.
3221 .Sx "Specifying messages"
3222 that have been identified as spam is possible via their (volatile)
3223 .Ql is-spam
3224 state by using the
3225 .Ql Ar :s
3227 .Ql Ar :S
3228 specifications, and their
3229 .Va attrlist
3230 entries will be used when displaying the
3231 .Va headline
3232 in the summary of
3233 .Ic headers .
3235 .Bl -bullet
3237 .Ic spamrate
3238 rates the given messages and sets their
3239 .Ql is-spam
3240 flag accordingly.
3241 If the spam interface offers spam scores these can be shown in
3242 .Va headline
3243 by using the format
3244 .Ql %$ .
3246 .Ic spamham ,
3247 .Ic spamspam
3249 .Ic spamforget
3250 will interact with the Bayesian filter of the chosen interface and learn
3251 the given messages as
3252 .Dq ham
3254 .Dq spam ,
3255 respectively; the last command can be used to cause
3256 .Dq unlearning
3257 of messages; it adheres to their current
3258 .Ql is-spam
3259 state and thus reverts previous teachings.
3261 .Ic spamclear
3263 .Ic spamset
3264 will simply set and clear, respectively, the mentioned volatile
3265 .Ql is-spam
3266 message flag, without any interface interaction.
3271 .Xr spamassassin 1
3272 based
3273 .Va spam-interface
3274 .Ql spamc
3275 requires a running instance of the
3276 .Xr spamd 1
3277 server in order to function, started with the option
3278 .Fl -allow-tell
3279 shall Bayesian filter learning be possible.
3281 .Bd -literal -offset indent
3282 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3283 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3284     --daemonize [--local] [--allow-tell]
3288 Thereafter \*(UA can make use of these interfaces:
3290 .Bd -literal -offset indent
3291 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3292     -Sspamc-command=/usr/local/bin/spamc \e
3293     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3295 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3296     -Sspamc-command=/usr/local/bin/spamc \e
3297     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3301 Using the generic filter approach allows usage of programs like
3302 .Xr bogofilter 1 .
3303 Here is an example, requiring it to be accessible via
3304 .Ev PATH :
3306 .Bd -literal -offset indent
3307 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3308     -Sspamfilter-ham="bogofilter -n" \e
3309     -Sspamfilter-noham="bogofilter -N" \e
3310     -Sspamfilter-nospam="bogofilter -S" \e
3311     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3312     -Sspamfilter-spam="bogofilter -s" \e
3313     -Sspamfilter-rate-scanscore="1;^(.+)$"
3317 Because messages must exist on local storage in order to be scored (or
3318 used for Bayesian filter training), it is possibly a good idea to
3319 perform the local spam check last.
3320 Spam can be checked automatically when opening specific folders by
3321 setting a specialized form of the internal variable
3322 .Va folder-hook .
3324 .Bd -literal -offset indent
3325 define spamdelhook {
3326   # Server side DCC
3327   spamset (header x-dcc-brand-metrics "bulk")
3328   # Server-side spamassassin(1)
3329   spamset (header x-spam-flag "YES")
3330   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3331   move :S +maybe-spam
3332   spamrate :u
3333   del :s
3334   move :S +maybe-spam
3336 set folder-hook-SOMEFOLDER=spamdelhook
3340 See also the documentation for the variables
3341 .Va spam-interface , spam-maxsize ,
3342 .Va spamc-command , spamc-arguments , spamc-user ,
3343 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3344   spamfilter-rate
3346 .Va spamfilter-rate-scanscore .
3347 .\" }}}
3349 .\" }}} (DESCRIPTION)
3352 .\" .Sh COMMANDS {{{
3353 .Sh COMMANDS
3355 \*(UA reads input in lines.
3356 An unquoted reverse solidus
3357 .Ql \e
3358 at the end of a command line
3359 .Dq escapes
3360 the newline character: it is discarded and the next line of input is
3361 used as a follow-up line, with all leading whitespace removed;
3362 once an entire line is completed, the whitespace characters
3363 .Cm space , tabulator , newline
3364 as well as those defined by the variable
3365 .Va ifs
3366 are removed from the beginning and end.
3367 Placing any whitespace characters at the beginning of a line will
3368 prevent a possible addition of the command line to the \*(OPal
3369 .Ic history .
3372 The beginning of such input lines is then scanned for the name of
3373 a known command: command names may be abbreviated, in which case the
3374 first command that matches the given prefix will be used.
3375 .Sx "Command modifiers"
3376 may prefix a command in order to modify its behaviour.
3377 A name may also be a
3378 .Ic commandalias ,
3379 which will become expanded until no more expansion is possible.
3380 Once the command that shall be executed is known, the remains of the
3381 input line will be interpreted according to command-specific rules,
3382 documented in the following.
3385 This behaviour is different to the
3386 .Xr sh 1 Ns
3387 ell, which is a programming language with syntactic elements of clearly
3388 defined semantics, and therefore capable to sequentially expand and
3389 evaluate individual elements of a line.
3390 \*(UA will never be able to handle
3391 .Ql ? set one=value two=$one
3392 in a single statement, because the variable assignment is performed by
3393 the command
3394 .Pf ( Ic set ) ,
3395 not the language.
3398 The command
3399 .Ic list
3400 can be used to show the list of all commands, either alphabetically
3401 sorted or in prefix search order (these do not match, also because the
3402 POSIX standard prescribes a set of abbreviations).
3403 \*(OPally the command
3404 .Ic help
3406 .Ic \&? ) ,
3407 when given an argument, will show a documentation string for the
3408 command matching the expanded argument, as in
3409 .Ql ?t ,
3410 which should be a shorthand of
3411 .Ql ?type ;
3412 with these documentation strings both commands support a more
3413 .Va verbose
3414 listing mode which includes the argument type of the command and other
3415 information which applies; a handy suggestion might thus be:
3417 .Bd -literal -offset indent
3418 ? define __xv {
3419   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3420   localopts yes;wysh set verbose;ignerr eval "${@}";return ${?}
3422 ? commandalias xv '\ecall __xv'
3423 ? xv help set
3426 .\" .Ss "Command modifiers" {{{
3427 .Ss "Command modifiers"
3429 Commands may be prefixed by one or multiple command modifiers.
3430 Some command modifiers can be used with a restricted set of commands
3431 only, the
3432 .Va verbose
3433 version of
3434 .Ic list
3435 will (\*(OPally) show which modifiers apply.
3437 .Bl -bullet
3439 The modifier reverse solidus
3441 .Cm \e ,
3442 to be placed first, prevents
3443 .Ic commandalias
3444 expansions on the remains of the line, e.g.,
3445 .Ql \eecho
3446 will always evaluate the command
3447 .Ic echo ,
3448 even if an (command)alias of the same name exists.
3449 .Ic commandalias
3450 content may itself contain further command modifiers, including
3451 an initial reverse solidus to prevent further expansions.
3454 The modifier
3456 .Cm ignerr
3457 indicates that any error generated by the following command should be
3458 ignored by the state machine and not cause a program exit with enabled
3459 .Va errexit
3460 or for the standardized exit cases in
3461 .Va posix
3462 mode.
3463 .Va \&? ,
3464 one of the
3465 .Sx "INTERNAL VARIABLES" ,
3466 will be set to the real exit status of the command regardless.
3470 .Cm local
3471 will alter the called command to apply changes only temporarily,
3472 local to block-scope, and can thus only be used inside of a
3473 .Ic define Ns
3474 d macro or an
3475 .Ic account
3476 definition.
3477 Specifying it implies the modifier
3478 .Cm wysh .
3479 Block-scope settings will not be inherited by macros deeper in the
3480 .Ic call
3481 chain, and will be garbage collected once the current block is left.
3482 To record and unroll changes in the global scope use the command
3483 .Ic localopts .
3487 .Cm scope
3488 does yet not implement any functionality.
3492 .Cm u
3493 does yet not implement any functionality.
3496 Some commands support the
3498 .Cm vput
3499 modifier: if used, they expect the name of a variable, which can itself
3500 be a variable, i.e., shell expansion is applied, as their first
3501 argument, and will place their computation result in it instead of the
3502 default location (it is usually written to standard output).
3504 The given name will be tested for being a valid
3505 .Xr sh 1
3506 variable name, and may therefore only consist of upper- and lowercase
3507 characters, digits, and the underscore; the hyphen-minus may be used as
3508 a non-portable extension; digits may not be used as first, hyphen-minus
3509 may not be used as last characters.
3510 In addition the name may either not be one of the known
3511 .Sx "INTERNAL VARIABLES" ,
3512 or must otherwise refer to a writable (non-boolean) value variable.
3513 The actual put operation may fail nonetheless, e.g., if the variable
3514 expects a number argument only a number will be accepted.
3515 Any error during these operations causes the command as such to fail,
3516 and the error number
3517 .Va \&!
3518 will be set to
3519 .Va ^ERR Ns -NOTSUP ,
3520 the exit status
3521 .Va \&?
3522 should be set to
3523 .Ql -1 ,
3524 but some commands deviate from the latter, which is documented.
3527 Last, but not least, the modifier
3529 .Cm wysh
3530 can be used for some old and established commands to choose the new
3531 .Sx "Shell-style argument quoting"
3532 rules over the traditional
3533 .Sx "Old-style argument quoting" .
3535 .\" }}}
3537 .\" .Ss "Old-style argument quoting" {{{
3538 .Ss "Old-style argument quoting"
3540 \*(ID This section documents the old, traditional style of quoting
3541 non-message-list arguments to commands which expect this type of
3542 arguments: whereas still used by the majority of such commands, the new
3543 .Sx "Shell-style argument quoting"
3544 may be available even for those via
3545 .Cm wysh ,
3546 one of the
3547 .Sx "Command modifiers" .
3548 Nonetheless care must be taken, because only new commands have been
3549 designed with all the capabilities of the new quoting rules in mind,
3550 which can, e.g., generate control characters.
3553 .Bl -bullet -offset indent
3555 An argument can be enclosed between paired double-quotes
3556 .Ql """argument"""
3558 single-quotes
3559 .Ql 'argument' ;
3560 any whitespace, shell word expansion, or reverse solidus characters
3561 (except as described next) within the quotes are treated literally as
3562 part of the argument.
3563 A double-quote will be treated literally within single-quotes and vice
3564 versa.
3565 Inside such a quoted string the actually used quote character can be
3566 used nonetheless by escaping it with a reverse solidus
3567 .Ql \e ,
3568 as in
3569 .Ql """y\e""ou""" .
3572 An argument that is not enclosed in quotes, as above, can usually still
3573 contain space characters if those spaces are reverse solidus escaped, as in
3574 .Ql you\e are .
3577 A reverse solidus outside of the enclosing quotes is discarded
3578 and the following character is treated literally as part of the argument.
3580 .\" }}}
3582 .\" .Ss "Shell-style argument quoting" {{{
3583 .Ss "Shell-style argument quoting"
3585 .Xr sh 1 Ns
3586 ell-style, and therefore POSIX standardized, argument parsing and
3587 quoting rules are used by most commands.
3588 \*(ID Most new commands only support these new rules and are flagged
3589 \*(NQ, some elder ones can use them with the command modifier
3590 .Cm wysh ;
3591 in the future only this type of argument quoting will remain.
3594 A command line is parsed from left to right and an input token is
3595 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3596 Metacharacters are vertical bar
3597 .Cm \&| ,
3598 ampersand
3599 .Cm & ,
3600 semicolon
3601 .Cm \&; ,
3602 as well as all characters from the variable
3603 .Va ifs ,
3604 and / or
3605 .Cm space , tabulator , newline .
3606 The additional metacharacters left and right parenthesis
3607 .Cm \&( , \&)
3608 and less-than and greater-than signs
3609 .Cm < , >
3610 that the
3611 .Xr sh 1
3612 supports are not used, and are treated as ordinary characters: for one
3613 these characters are a vivid part of email addresses, and it seems
3614 highly unlikely that their function will become meaningful to \*(UA.
3616 .Bd -filled -offset indent
3617 .Sy Compatibility note:
3618 \*(ID Please note that even many new-style commands do not yet honour
3619 .Va ifs
3620 to parse their arguments: whereas the
3621 .Xr sh 1 Ns
3622 ell is a language with syntactic elements of clearly defined semantics,
3623 \*(UA parses entire input lines and decides on a per-command base what
3624 to do with the rest of the line.
3625 This also means that whenever an unknown command is seen all that \*(UA
3626 can do is cancellation of the processing of the remains of the line.
3628 It also often depends on an actual subcommand of a multiplexer command
3629 how the rest of the line should be treated, and until v15 we are not
3630 capable to perform this deep inspection of arguments.
3631 Nonetheless, at least the following commands which work with positional
3632 parameters fully support
3633 .Va ifs
3634 for an almost shell-compatible field splitting:
3635 .Ic call , call_if , read , vpospar , xcall .
3639 Any unquoted number sign
3640 .Ql #
3641 at the beginning of a new token starts a comment that extends to the end
3642 of the line, and therefore ends argument processing.
3643 An unquoted dollar sign
3644 .Ql $
3645 will cause variable expansion of the given name, which must be a valid
3646 .Xr sh 1 Ns
3647 ell-style variable name (see
3648 .Cm vput ) :
3649 .Sx "INTERNAL VARIABLES"
3650 as well as
3651 .Sx ENVIRONMENT
3652 (shell) variables can be accessed through this mechanism, brace
3653 enclosing the name is supported (i.e., to subdivide a token).
3656 Whereas the metacharacters
3657 .Cm space , tabulator , newline
3658 only complete an input token, vertical bar
3659 .Cm \&| ,
3660 ampersand
3661 .Cm &
3662 and semicolon
3663 .Cm \&;
3664 also act as control operators and perform control functions.
3665 For now supported is semicolon
3666 .Cm \&; ,
3667 which terminates a single command, therefore sequencing the command line
3668 and making the remainder of the line a subject to reevaluation.
3669 With sequencing, multiple command argument types and quoting rules may
3670 therefore apply to a single line, which can become problematic before
3671 v15: e.g., the first of the following will cause surprising results.
3674 .Dl ? echo one; set verbose; echo verbose=$verbose.
3675 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3678 Quoting is a mechanism that will remove the special meaning of
3679 metacharacters and reserved words, and will prevent expansion.
3680 There are four quoting mechanisms: the escape character, single-quotes,
3681 double-quotes and dollar-single-quotes:
3684 .Bl -bullet -offset indent
3686 The literal value of any character can be preserved by preceding it
3687 with the escape character reverse solidus
3688 .Ql \e .
3691 Arguments which are enclosed in
3692 .Ql 'single-\:quotes'
3693 retain their literal value.
3694 A single-quote cannot occur within single-quotes.
3697 The literal value of all characters enclosed in
3698 .Ql \(dqdouble-\:quotes\(dq
3699 is retained, with the exception of dollar sign
3700 .Ql $ ,
3701 which will cause variable expansion, as above, backquote (grave accent)
3702 .Ql ` ,
3703 (which not yet means anything special), reverse solidus
3704 .Ql \e ,
3705 which will escape any of the characters dollar sign
3706 .Ql $
3707 (to prevent variable expansion), backquote (grave accent)
3708 .Ql ` ,
3709 double-quote
3710 .Ql \(dq
3711 (to prevent ending the quote) and reverse solidus
3712 .Ql \e
3713 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3714 but has no special meaning otherwise.
3717 Arguments enclosed in
3718 .Ql $'dollar-\:single-\:quotes'
3719 extend normal single quotes in that reverse solidus escape sequences are
3720 expanded as follows:
3722 .Bl -tag -compact -width ".Ql \eNNN"
3723 .It Ql \ea
3724 bell control character (ASCII and ISO-10646 BEL).
3725 .It Ql \eb
3726 backspace control character (ASCII and ISO-10646 BS).
3727 .It Ql \eE
3728 escape control character (ASCII and ISO-10646 ESC).
3729 .It Ql \ee
3730 the same.
3731 .It Ql \ef
3732 form feed control character (ASCII and ISO-10646 FF).
3733 .It Ql \en
3734 line feed control character (ASCII and ISO-10646 LF).
3735 .It Ql \er
3736 carriage return control character (ASCII and ISO-10646 CR).
3737 .It Ql \et
3738 horizontal tabulator control character (ASCII and ISO-10646 HT).
3739 .It Ql \ev
3740 vertical tabulator control character (ASCII and ISO-10646 VT).
3741 .It Ql \e\e
3742 emits a reverse solidus character.
3743 .It Ql \e'
3744 single quote.
3745 .It Ql \e"
3746 double quote (escaping is optional).
3747 .It Ql \eNNN
3748 eight-bit byte with the octal value
3749 .Ql NNN
3750 (one to three octal digits), optionally prefixed by an additional
3751 .Ql 0 .
3752 A 0 byte will suppress further output for the quoted argument.
3753 .It Ql \exHH
3754 eight-bit byte with the hexadecimal value
3755 .Ql HH
3756 (one or two hexadecimal characters, no prefix, see
3757 .Ic vexpr ) .
3758 A 0 byte will suppress further output for the quoted argument.
3759 .It Ql \eUHHHHHHHH
3760 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3761 .Ql HHHHHHHH
3762 (one to eight hexadecimal characters) \(em note that Unicode defines the
3763 maximum codepoint ever to be supported as
3764 .Ql 0x10FFFF
3765 (in planes of
3766 .Ql 0xFFFF
3767 characters each).
3768 This escape is only supported in locales that support Unicode (see
3769 .Sx "Character sets" ) ,
3770 in other cases the sequence will remain unexpanded unless the given code
3771 point is ASCII compatible or (if the \*(OPal character set conversion is
3772 available) can be represented in the current locale.
3773 The character NUL will suppress further output for the quoted argument.
3774 .It Ql \euHHHH
3775 Identical to
3776 .Ql \eUHHHHHHHH
3777 except it takes only one to four hexadecimal characters.
3778 .It Ql \ecX
3779 Emits the non-printable (ASCII and compatible) C0 control codes
3780 0 (NUL) to 31 (US), and 127 (DEL).
3781 Printable representations of ASCII control codes can be created by
3782 mapping them to a different, visible part of the ASCII character set.
3783 Adding the number 64 achieves this for the codes 0 to 31, e.g., 7 (BEL):
3784 .Ql 7 + 64 = 71 = G .
3785 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3786 .Ic vexpr ) ,
3787 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3788 .Ql ? vexpr ^ 127 64 .
3790 Whereas historically circumflex notation has often been used for
3791 visualization purposes of control codes, e.g.,
3792 .Ql ^G ,
3793 the reverse solidus notation has been standardized:
3794 .Ql \ecG .
3795 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3796 as shown above (e.g.,
3797 .Ql \ea ,
3798 .Ql \en ,
3799 .Ql \et ) :
3800 whenever such an alias exists it will be used for display purposes.
3801 The control code NUL
3802 .Pf ( Ql \ec@ ,
3803 a non-standard extension) will suppress further output for the remains
3804 of the token (which may extend beyond the current quote), or, depending
3805 on the context, the remains of all arguments for the current command.
3806 .It Ql \e$NAME
3807 Non-standard extension: expand the given variable name, as above.
3808 Brace enclosing the name is supported.
3809 .It Ql \e`{command}
3810 Not yet supported, just to raise awareness: Non-standard extension.
3815 Caveats:
3817 .Bd -literal -offset indent
3818 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3819 ? echo Quotes ${HOME} and tokens differ! # comment
3820 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3822 .\" }}}
3824 .\" .Ss "Message list arguments" {{{
3825 .Ss "Message list arguments"
3827 Many commands operate on message list specifications, as documented in
3828 .Sx "Specifying messages" .
3829 The argument input is first split into individual tokens via
3830 .Sx "Shell-style argument quoting" ,
3831 which are then interpreted as the mentioned specifications.
3832 If no explicit message list has been specified, many commands will
3833 search for and use the next message forward that satisfies the commands'
3834 requirements, and if there are no messages forward of the current
3835 message, the search proceeds backwards;
3836 if there are no good messages at all to be found, an error message is
3837 shown and the command is aborted.
3839 .Va verbose
3840 output of the command
3841 .Ic list
3842 will indicate whether a command searches for a default message, or not.
3843 .\" }}}
3845 .\" .Ss "Raw data arguments for codec commands" {{{
3846 .Ss "Raw data arguments for codec commands"
3848 A special set of commands, which all have the string
3849 .Dq codec
3850 in their name, e.g.,
3851 .Ic addrcodec ,
3852 .Ic shcodec ,
3853 .Ic urlcodec ,
3854 take raw string data as input, which means that the content of the
3855 command input line is passed completely unexpanded and otherwise
3856 unchanged: like this the effect of the actual codec is visible without
3857 any noise of possible shell quoting rules etc., i.e., the user can input
3858 one-to-one the desired or questionable data.
3859 To gain a level of expansion, the entire command line can be
3860 .Ic eval Ns
3861 uated first, e.g.,
3863 .Bd -literal -offset indent
3864 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3865 ? echo $res
3866 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3867 ? shcodec d $res
3868 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3869 ? eval shcodec d $res
3870 /usr/Sch\[:o]nes Wetter/heute.txt
3872 .\" }}}
3874 .\" .Ss "Filename transformations" {{{
3875 .Ss "Filename transformations"
3877 Filenames, where expected, and unless documented otherwise, are
3878 subsequently subject to the following filename transformations, in
3879 sequence:
3881 .Bl -bullet -offset indent
3883 If the given name is a registered
3884 .Ic shortcut ,
3885 it will be replaced with the expanded shortcut.
3888 The filename is matched against the following patterns or strings:
3890 .Bl -hang -compact -width ".Ar %user"
3891 .It Ar #
3892 (Number sign) is expanded to the previous file.
3893 .It Ar %
3894 (Percent sign) is replaced by the invoking
3895 .Mx -ix "primary system mailbox"
3896 user's primary system mailbox, which either is the (itself expandable)
3897 .Va inbox
3898 if that is set, the standardized absolute pathname indicated by
3899 .Ev MAIL
3900 if that is set, or a built-in compile-time default otherwise.
3901 .It Ar %user
3902 Expands to the primary system mailbox of
3903 .Ar user
3904 (and never the value of
3905 .Va inbox ,
3906 regardless of its actual setting).
3907 .It Ar &
3908 (Ampersand) is replaced with the invoking user's
3909 .Mx -ix "secondary mailbox"
3910 secondary mailbox, the
3911 .Ev MBOX .
3912 .It Ar +file
3913 Refers to a
3914 .Ar file
3915 in the
3916 .Va folder
3917 directory (if that variable is set).
3918 .It Ar %:filespec
3919 Expands to the same value as
3920 .Ar filespec ,
3921 but has special meaning when used with, e.g., the command
3922 .Ic file :
3923 the file will be treated as a primary system mailbox by, e.g., the
3924 .Ic mbox
3926 .Ic save
3927 commands, meaning that messages that have been read in the current
3928 session will be moved to the
3929 .Ev MBOX
3930 mailbox instead of simply being flagged as read.
3934 Meta expansions may be applied to the resulting filename, as allowed by
3935 the operation and applicable to the resulting access protocol (also see
3936 .Sx "On URL syntax and credential lookup" ) .
3937 For the file-protocol, a leading tilde
3938 .Ql ~
3939 character will be replaced by the expansion of
3940 .Ev HOME ,
3941 except when followed by a valid user name, in which case the home
3942 directory of the given user is used instead.
3944 A shell expansion as if specified in double-quotes (see
3945 .Sx "Shell-style argument quoting" )
3946 may be applied, so that any occurrence of
3947 .Ql $VARIABLE
3949 .Ql ${VARIABLE} )
3950 will be replaced by the expansion of the variable, if possible;
3951 .Sx "INTERNAL VARIABLES"
3952 as well as
3953 .Sx ENVIRONMENT
3954 (shell) variables can be accessed through this mechanism.
3956 Shell pathname wildcard pattern expansions
3957 .Pf ( Xr glob 7 )
3958 may be applied as documented.
3959 If the fully expanded filename results in multiple pathnames and the
3960 command is expecting only one file, an error results.
3962 In interactive context, in order to allow simple value acceptance (via
3963 .Dq ENTER ) ,
3964 arguments will usually be displayed in a properly quoted form, e.g., a file
3965 .Ql diet\e is \ecurd.txt
3966 may be displayed as
3967 .Ql 'diet\e is \ecurd.txt' .
3969 .\" }}}
3971 .\" .Ss "Commands" {{{
3972 .Ss "Commands"
3974 The following commands are available:
3976 .Bl -tag -width ".It Ic BaNg"
3980 .It Ic \&!
3981 Executes the
3982 .Ev SHELL
3983 command which follows, replacing unescaped exclamation marks with the
3984 previously executed command if the internal variable
3985 .Va bang
3986 is set.
3987 This command supports
3988 .Cm vput
3989 as documented in
3990 .Sx "Command modifiers" ,
3991 and manages the error number
3992 .Va \&! .
3993 A 0 or positive exit status
3994 .Va \&?
3995 reflects the exit status of the command, negative ones that
3996 an error happened before the command was executed, or that the program
3997 did not exit cleanly, but, e.g., due to a signal: the error number is
3998 .Va ^ERR Ns -CHILD ,
3999 then.
4002 In conjunction with the
4003 .Cm vput
4004 modifier the following special cases exist:
4005 a negative exit status occurs if the collected data could not be stored
4006 in the given variable, which is a
4007 .Va ^ERR Ns -NOTSUP
4008 error that should otherwise not occur.
4009 .Va ^ERR Ns -CANCELED
4010 indicates that no temporary file could be created to collect the command
4011 output at first glance.
4012 In case of catchable out-of-memory situations
4013 .Va ^ERR Ns -NOMEM
4014 will occur and \*(UA will try to store the empty string, just like with
4015 all other detected error conditions.
4019 .It Ic #
4020 The comment-command causes the entire line to be ignored.
4021 .Sy Note:
4022 this really is a normal command which' purpose is to discard its
4023 arguments, not a
4024 .Dq comment-start
4025 indicating special character, which means that, e.g., trailing comments
4026 on a line are not possible (except for commands which use
4027 .Sx "Shell-style argument quoting" ) .
4030 .It Ic +
4031 Goes to the next message in sequence and types it
4032 (like
4033 .Dq ENTER ) .
4036 .It Ic -
4037 Display the preceding message, or the n'th previous message if given
4038 a numeric argument n.
4041 .It Ic =
4042 Shows the message number of the current message (the
4043 .Dq dot )
4044 when used without arguments, that of the given list otherwise.
4045 Output numbers will be separated from each other with the first
4046 character of
4047 .Va ifs ,
4048 and followed by the first character of
4049 .Va if-ws ,
4050 if that is not empty and not identical to the first.
4051 If that results in no separation at all a
4052 .Cm space
4053 character is used.
4054 This command supports
4055 .Cm vput
4056 (see
4057 .Sx "Command modifiers" ) ,
4058 and manages the error number
4059 .Va \&! .
4062 .It Ic \&?
4063 \*(OP Show a brief summary of commands.
4064 \*(OP Given an argument a synopsis for the command in question is
4065 shown instead; commands can be abbreviated in general and this command
4066 can be used to see the full expansion of an abbreviation including the
4067 synopsis, try, e.g.,
4068 .Ql ?h ,
4069 .Ql ?hel
4071 .Ql ?help
4072 and see how the output changes.
4073 This mode also supports a more
4074 .Va verbose
4075 output, which will provide the information documented for
4076 .Ic list .
4079 .It Ic \&|
4080 A synonym for the
4081 .Ic pipe
4082 command.
4086 .It Ic account , unaccount
4087 (ac, una) Creates, selects or lists (an) account(s).
4088 Accounts are special incarnations of
4089 .Ic define Ns d
4090 macros and group commands and variable settings which together usually
4091 arrange the environment for the purpose of creating an email account.
4092 Different to normal macros settings which are covered by
4093 .Ic localopts
4094 \(en here by default enabled! \(en will not be reverted before the
4095 .Ic account
4096 is changed again.
4097 The special account
4098 .Ql null
4099 (case-insensitive) always exists, and all but it can be deleted by the
4100 latter command, and in one operation with the special name
4101 .Ql * .
4102 Also for all but it a possibly set
4103 .Va on-account-cleanup
4104 hook is called once they are left.
4106 Without arguments a listing of all defined accounts is shown.
4107 With one argument the given account is activated: the system
4108 .Va inbox
4109 of that account will be activated (as via
4110 .Ic file ) ,
4111 a possibly installed
4112 .Va folder-hook
4113 will be run, and the internal variable
4114 .Va account
4115 will be updated.
4116 The two argument form is identical to defining a macro as via
4117 .Ic define :
4118 .Bd -literal -offset indent
4119 account myisp {
4120   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
4121   set from='(My Name) myname@myisp.example'
4122   set mta=smtp://mylogin@smtp.myisp.example
4128 .It Ic addrcodec
4129 Perform email address codec transformations on raw-data argument, rather
4130 according to email standards (RFC 5322; \*(ID will furtherly improve).
4131 Supports
4132 .Cm vput
4133 (see
4134 .Sx "Command modifiers" ) ,
4135 and manages the error number
4136 .Va \&! .
4137 The first argument must be either
4138 .Ar [+[+[+]]]e[ncode] ,
4139 .Ar d[ecode] ,
4140 .Ar s[kin]
4142 .Ar skinl[ist]
4143 and specifies the operation to perform on the rest of the line.
4146 Decoding will show how a standard-compliant MUA will display the given
4147 argument, which should be an email address.
4148 Please be aware that most MUAs have difficulties with the address
4149 standards, and vary wildly when (comments) in parenthesis,
4150 .Dq double-quoted
4151 strings, or quoted-pairs, as below, become involved.
4152 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4155 Skinning is identical to decoding but only outputs the plain address,
4156 without any string, comment etc. components.
4157 Another difference is that it may fail with the error number
4158 .Va \&!
4159 set to
4160 .Va ^ERR Ns -INVAL
4161 if decoding fails to find a(n) (valid) email address, in which case the
4162 unmodified input will be output again.
4165 .Ar skinlist
4166 first performs a skin operation, and thereafter checks a valid
4167 address for whether it is a registered mailing list (see
4168 .Ic mlist
4170 .Ic mlsubscribe ) ,
4171 eventually reporting that state in the error number
4172 .Va \&!
4174 .Va ^ERR Ns -EXIST .
4175 (This state could later become overwritten by an I/O error, though.)
4178 Encoding supports four different modes, lesser automated versions can be
4179 chosen by prefixing one, two or three plus signs: the standard imposes
4180 a special meaning on some characters, which thus have to be transformed
4181 to so-called quoted-pairs by pairing them with a reverse solidus
4182 .Ql \e
4183 in order to remove the special meaning; this might change interpretation
4184 of the entire argument from what has been desired, however!
4185 Specify one plus sign to remark that parenthesis shall be left alone,
4186 two for not turning double quotation marks into quoted-pairs, and three
4187 for also leaving any user-specified reverse solidus alone.
4188 The result will always be valid, if a successful exit status is reported
4189 (\*(ID the current parser fails this assertion for some constructs).
4190 \*(ID Addresses need to be specified in between angle brackets
4191 .Ql < ,
4192 .Ql >
4193 if the construct becomes more difficult, otherwise the current parser
4194 will fail; it is not smart enough to guess right.
4196 .Bd -literal -offset indent
4197 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4198 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4199 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4200 "Hey, you", \e out\e there <diet@exam.ple>
4201 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4202 diet@exam.ple
4208 .It Ic alias , unalias
4209 (a, una) Aliases are a method of creating personal distribution lists
4210 that map a single alias name to none to multiple real receivers;
4211 these aliases become expanded after message composing is completed.
4212 The latter command removes the given list of aliases, the special name
4213 .Ql *
4214 will discard all existing aliases.
4216 The former command shows all currently defined aliases when used without
4217 arguments, and with one argument the expansion of the given alias.
4218 With more than one argument, creates or appends to the alias name given
4219 as the first argument the remaining arguments.
4220 Alias names adhere to the Postfix MTA
4221 .Xr aliases 5
4222 rules and are thus restricted to alphabetic characters, digits, the
4223 underscore, hyphen-minus, the number sign, colon and commercial at,
4224 a dollar sign is allowed but in the first position;
4225 As extensions the exclamation mark
4226 .Ql \&! ,
4227 period
4228 .Ql \&.
4229 as well as
4230 .Dq any haracter that has the high bit set
4231 may be used:
4232 .Ql [[:alnum:]_#:@-][[:alnum:]_#:@$;.-]* .
4234 .\" ALIASCOLON next sentence
4235 \*(ID Unfortunately the colon is currently not supported, as it
4236 interferes with normal address parsing rules.
4237 .\" ALIASCOLON next sentence
4238 \*(ID Such high bit characters will likely cause warnings at the moment
4239 for the same reasons why colon is unsupported; also, in the future
4240 locale dependent character set validity checks will be performed.
4244 .It Ic alternates , unalternates
4245 \*(NQ (alt) Manage a list of alternate addresses or names of the active
4246 user, members of which will be removed from recipient lists (except one).
4247 There is a set of implicit alternates which is formed of the values of
4248 .Ev LOGNAME ,
4249 .Va from ,
4250 .Va sender
4252 .Va reply-to .
4253 .Va from
4254 will not be used if
4255 .Va sender
4256 is set.
4257 The latter command removes the given list of alternates, the special name
4258 .Ql *
4259 will discard all existing alternate names.
4261 The former command manages the error number
4262 .Va \&! .
4263 It shows the current set of alternates when used without arguments; in
4264 this mode only it also supports
4265 .Cm vput
4266 (see
4267 .Sx "Command modifiers" ) .
4268 Otherwise the given arguments (after being checked for validity) are
4269 appended to the list of alternate names; in
4270 .Va posix
4271 mode they replace that list instead.
4275 .It Ic answered , unanswered
4276 Take a message lists and mark each message as (not) having been answered.
4277 Messages will be marked answered when being
4278 .Ic reply Ns d
4279 to automatically if the
4280 .Va markanswered
4281 variable is set.
4282 See the section
4283 .Sx "Message states" .
4288 .It Ic bind , unbind
4289 \*(OP\*(NQ The bind command extends the MLE (see
4290 .Sx "On terminal control and line editor" )
4291 with freely configurable key bindings.
4292 The latter command removes from the given context the given key binding,
4293 both of which may be specified as a wildcard
4294 .Ql * ,
4295 so that, e.g.,
4296 .Ql unbind * *
4297 will remove all bindings of all contexts.
4298 Due to initialization order unbinding will not work for built-in key
4299 bindings upon program startup, however: please use
4300 .Va line-editor-no-defaults
4301 for this purpose instead.
4304 With one argument the former command shows all key bindings for the
4305 given context, specifying an asterisk
4306 .Ql *
4307 will show the bindings of all contexts; a more verbose listing will be
4308 produced if either of
4309 .Va debug
4311 .Va verbose
4312 are set.
4313 With two or more arguments a binding is (re)established:
4314 the first argument is the context to which the binding shall apply,
4315 the second argument is a comma-separated list of the
4316 .Dq keys
4317 which form the binding, and any remaining arguments form the expansion.
4318 To indicate that a binding shall not be auto-committed, but that the
4319 expansion shall instead be furtherly editable by the user, a commercial at
4320 .Ql @
4321 (that will be removed) can be placed last in the expansion, from which
4322 leading and trailing whitespace will finally be removed.
4323 Reverse solidus cannot be used as the last character of expansion.
4326 Contexts define when a binding applies, i.e., a binding will not be seen
4327 unless the context for which it is defined for is currently active.
4328 This is not true for the shared binding
4329 .Ql base ,
4330 which is the foundation for all other bindings and as such always
4331 applies, its bindings, however, only apply secondarily.
4332 The available contexts are the shared
4333 .Ql base ,
4335 .Ql default
4336 context which is used in all not otherwise documented situations, and
4337 .Ql compose ,
4338 which applies to compose mode only.
4341 .Dq Keys
4342 which form the binding are specified as a comma-separated list of
4343 byte-sequences, where each list entry corresponds to one key(press).
4344 A list entry may, indicated by a leading colon character
4345 .Ql \&: ,
4346 also refer to the name of a terminal capability; several dozen names
4347 will be compiled in and may be specified either by their
4348 .Xr terminfo 5 ,
4349 or, if existing, by their
4350 .Xr termcap 5
4351 name, regardless of the actually used \*(OPal terminal control library.
4352 It is possible to use any capability, as long as the name is resolvable
4353 by the \*(OPal control library or was defined via the internal variable
4354 .Va termcap .
4355 Input sequences are not case-normalized, so that an exact match is
4356 required to update or remove a binding.
4357 Examples:
4359 .Bd -literal -offset indent
4360 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4361 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc,Delete
4362 ? bind default $'\ecA',:khome,w 'echo Editable binding@'
4363 ? bind default a,b,c rm -irf / @  # Also editable
4364 ? bind default :kf1 File %
4365 ? bind compose :kf1 ~v
4369 Note that the entire comma-separated list is first parsed (over) as a
4370 shell-token with whitespace as the field separator, before being parsed
4371 and expanded for real with comma as the field separator, therefore
4372 whitespace needs to be properly quoted, see
4373 .Sx "Shell-style argument quoting" .
4374 Using Unicode reverse solidus escape sequences renders a binding
4375 defunctional if the locale does not support Unicode (see
4376 .Sx "Character sets" ) ,
4377 and using terminal capabilities does so if no (corresponding) terminal
4378 control support is (currently) available.
4381 The following terminal capability names are built-in and can be used in
4382 .Xr terminfo 5
4383 or (if available) the two-letter
4384 .Xr termcap 5
4385 notation.
4386 See the respective manual for a list of capabilities.
4387 The program
4388 .Xr infocmp 1
4389 can be used to show all the capabilities of
4390 .Ev TERM
4391 or the given terminal type;
4392 using the
4393 .Fl \&\&x
4394 flag will also show supported (non-standard) extensions.
4397 .Bl -tag -compact -width kcuuf_or_kcuuf
4398 .It Cd kbs Ns \0or Cd kb
4399 Backspace.
4400 .It Cd kdch1 Ns \0or Cd kD
4401 Delete character.
4402 .It Cd kDC Ns \0or Cd *4
4403 \(em shifted variant.
4404 .It Cd kel Ns \0or Cd kE
4405 Clear to end of line.
4406 .It Cd kext Ns \0or Cd @9
4407 Exit.
4408 .It Cd kich1 Ns \0or Cd kI
4409 Insert character.
4410 .It Cd kIC Ns \0or Cd #3
4411 \(em shifted variant.
4412 .It Cd khome Ns \0or Cd kh
4413 Home.
4414 .It Cd kHOM Ns \0or Cd #2
4415 \(em shifted variant.
4416 .It Cd kend Ns \0or Cd @7
4417 End.
4418 .It Cd knp Ns \0or Cd kN
4419 Next page.
4420 .It Cd kpp Ns \0or Cd kP
4421 Previous page.
4422 .It Cd kcub1 Ns \0or Cd kl
4423 Left cursor (with more modifiers: see below).
4424 .It Cd kLFT Ns \0or Cd #4
4425 \(em shifted variant.
4426 .It Cd kcuf1 Ns \0or Cd kr
4427 Right cursor (ditto).
4428 .It Cd kRIT Ns \0or Cd %i
4429 \(em shifted variant.
4430 .It Cd kcud1 Ns \0or Cd kd
4431 Down cursor (ditto).
4432 .It Cd kDN
4433 \(em shifted variant (only terminfo).
4434 .It Cd kcuu1 Ns \0or Cd ku
4435 Up cursor (ditto).
4436 .It Cd kUP
4437 \(em shifted variant (only terminfo).
4438 .It Cd kf0 Ns \0or Cd k0
4439 Function key 0.
4440 Add one for each function key up to
4441 .Cd kf9
4443 .Cd k9 ,
4444 respectively.
4445 .It Cd kf10 Ns \0or Cd k;
4446 Function key 10.
4447 .It Cd kf11 Ns \0or Cd F1
4448 Function key 11.
4449 Add one for each function key up to
4450 .Cd kf19
4452 .Cd F9 ,
4453 respectively.
4457 Some terminals support key-modifier combination extensions, e.g.,
4458 .Ql Alt+Shift+xy .
4459 For example, the delete key,
4460 .Cd kdch1 :
4461 in its shifted variant, the name is mutated to
4462 .Cd  kDC ,
4463 then a number is appended for the states
4464 .Ql Alt
4465 .Pf ( Cd kDC3 ) ,
4466 .Ql Shift+Alt
4467 .Pf ( Cd kDC4 ) ,
4468 .Ql Control
4469 .Pf ( Cd kDC5 ) ,
4470 .Ql Shift+Control
4471 .Pf ( Cd kDC6 ) ,
4472 .Ql Alt+Control
4473 .Pf ( Cd kDC7 ) ,
4474 finally
4475 .Ql Shift+Alt+Control
4476 .Pf ( Cd kDC8 ) .
4477 The same for the left cursor key,
4478 .Cd kcub1 :
4479 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4482 It is advisable to use an initial escape or other control character (e.g.,
4483 .Ql \ecA )
4484 for bindings which describe user key combinations (as opposed to purely
4485 terminal capability based ones), in order to avoid ambiguities whether
4486 input belongs to key sequences or not; it also reduces search time.
4487 Adjusting
4488 .Va bind-timeout
4489 may help shall keys and sequences be falsely recognized.
4493 .It Ic call
4494 \*(NQ Calls the given macro, which must have been created via
4495 .Ic define
4496 (see there for more), otherwise an
4497 .Va ^ERR Ns -NOENT
4498 error occurs.
4499 Calling macros recursively will at some time excess the stack size
4500 limit, causing a hard program abortion; if recursively calling a macro
4501 is the last command of the current macro, consider to use the command
4502 .Ic xcall ,
4503 which will first release all resources of the current macro before
4504 replacing the current macro with the called one.
4508 .It Ic call_if
4509 Identical to
4510 .Ic call
4511 if the given macro has been created via
4512 .Ic define ,
4513 but does not fail nor warn if the macro does not exist.
4516 .It Ic cd
4517 (ch) Change the working directory to
4518 .Ev HOME
4519 or the given argument.
4520 Synonym for
4521 .Ic chdir .
4524 .It Ic certsave
4525 \*(OP Only applicable to S/MIME signed messages.
4526 Takes an optional message list and a filename and saves the certificates
4527 contained within the message signatures to the named file in both
4528 human-readable and PEM format.
4529 The certificates can later be used to send encrypted messages to the
4530 respective message senders by setting
4531 .Va smime-encrypt-USER@HOST
4532 variables.
4536 .It Ic charsetalias , uncharsetalias
4537 \*(NQ Manage alias mappings for (conversion of)
4538 .Sx "Character sets" .
4539 Mappings are ineffective if character set conversion is not available
4540 .Pf ( Va features
4541 does not announce
4542 .Ql +iconv ) .
4543 Expansion happens recursively, but expansion is not performed for
4544 .Sx "INTERNAL VARIABLES" ,
4545 e.g.,
4546 .Va charset-8bit .
4548 The latter command deletes all aliases given as arguments,
4549 all aliases can be deleted at once with the special argument
4550 .Ql * .
4551 The former shows the list of all currently defined aliases if used
4552 without arguments, the expansion of the given alias with one argument.
4553 Otherwise all given arguments are treated as pairs of character sets and
4554 their desired target alias name, creating new or changing already
4555 existing aliases, as necessary.
4558 .It Ic chdir
4559 (ch) Change the working directory to
4560 .Ev HOME
4561 or the given argument.
4562 Synonym for
4563 .Ic cd .
4567 .It Ic collapse , uncollapse
4568 Only applicable to
4569 .Ql thread Ns
4571 .Ic sort
4572 mode.
4573 Takes a message list and makes all replies to these messages invisible
4574 in header summaries, except for
4575 .Ql new
4576 messages and the
4577 .Dq dot .
4578 Also when a message with collapsed replies is displayed,
4579 all of these are automatically uncollapsed.
4580 The latter command undoes collapsing.
4583 .\" FIXME review until this point
4586 .It Ic colour , uncolour
4587 \*(OP\*(NQ Manage colour mappings of and for a
4588 .Sx "Coloured display" .
4589 The type of colour is given as the (case-insensitive) first argument,
4590 which must be one of
4591 .Ql 256
4592 for 256-colour terminals,
4593 .Ql 8 ,
4594 .Ql ansi
4596 .Ql iso
4597 for the standard 8-colour ANSI / ISO 6429 colour palette and
4598 .Ql 1
4600 .Ql mono
4601 for monochrome terminals.
4602 Monochrome terminals cannot deal with colours, but only (some) font
4603 attributes.
4606 Without further arguments the list of all currently defined mappings
4607 for the given colour type is shown (as a special case giving
4608 .Ql all
4610 .Ql *
4611 will show the mappings of all types).
4612 Otherwise the second argument defines the mappable slot, and the third
4613 argument a (comma-separated list of) colour and font attribute
4614 specification(s), and the optional fourth argument can be used to
4615 specify a precondition: if conditioned mappings exist they are tested in
4616 (creation) order unless a (case-insensitive) match has been found, and
4617 the default mapping (if any has been established) will only be chosen as
4618 a last resort.
4619 The types of precondition available depend on the mappable slot (see
4620 .Sx "Coloured display"
4621 for some examples), the following of which exist:
4624 Mappings prefixed with
4625 .Ql mle-
4626 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4627 .Sx "On terminal control and line editor" )
4628 and do not support preconditions.
4630 .Bl -tag -compact -width view-partinfo
4631 .It Ar mle-position
4632 This mapping is used for the position indicator that is visible when
4633 a line cannot be fully displayed on the screen.
4634 .It Ar mle-prompt
4635 Used for the
4636 .Va prompt .
4640 Mappings prefixed with
4641 .Ql sum-
4642 are used in header summaries, and they all understand the preconditions
4643 .Ql dot
4644 (the current message) and
4645 .Ql older
4646 for elder messages (only honoured in conjunction with
4647 .Va datefield-markout-older ) .
4649 .Bl -tag -compact -width view-partinfo
4650 .It Ar sum-dotmark
4651 This mapping is used for the
4652 .Dq dotmark
4653 that can be created with the
4654 .Ql %>
4656 .Ql %<
4657 formats of the variable
4658 .Va headline .
4659 .It Ar sum-header
4660 For the complete header summary line except the
4661 .Dq dotmark
4662 and the thread structure.
4663 .It Ar sum-thread
4664 For the thread structure which can be created with the
4665 .Ql %i
4666 format of the variable
4667 .Va headline .
4671 Mappings prefixed with
4672 .Ql view-
4673 are used when displaying messages.
4675 .Bl -tag -compact -width view-partinfo
4676 .It Ar view-from_
4677 This mapping is used for so-called
4678 .Ql From_
4679 lines, which are MBOX file format specific header lines.
4680 .It Ar view-header
4681 For header lines.
4682 A comma-separated list of headers to which the mapping applies may be
4683 given as a precondition; if the \*(OPal regular expression support is
4684 available then if any of the
4685 .Dq magical
4686 (extended) regular expression characters is seen the precondition will
4687 be evaluated as (an extended) one.
4688 .It Ar view-msginfo
4689 For the introductional message info line.
4690 .It Ar view-partinfo
4691 For MIME part info lines.
4695 The following (case-insensitive) colour definitions and font attributes
4696 are understood, multiple of which can be specified in a comma-separated
4697 list:
4699 .Bl -tag -width ft=
4700 .It Ar ft=
4701 a font attribute:
4702 .Ql bold ,
4703 .Ql reverse
4705 .Ql underline .
4706 It is possible (and often applicable) to specify multiple font
4707 attributes for a single mapping.
4709 .It Ar fg=
4710 foreground colour attribute:
4711 .Ql black ,
4712 .Ql blue ,
4713 .Ql green ,
4714 .Ql red ,
4715 .Ql brown ,
4716 .Ql magenta ,
4717 .Ql cyan
4719 .Ql white .
4720 To specify a 256-colour mode a decimal number colour specification in
4721 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4723 .Bl -tag -compact -width "999 - 999"
4724 .It 0 - 7
4725 the standard ISO 6429 colours, as above.
4726 .It 8 - 15
4727 high intensity variants of the standard colours.
4728 .It 16 - 231
4729 216 colours in tuples of 6.
4730 .It 232 - 255
4731 grayscale from black to white in 24 steps.
4733 .Bd -literal -offset indent
4734 #!/bin/sh -
4735 fg() { printf "\e033[38;5;${1}m($1)"; }
4736 bg() { printf "\e033[48;5;${1}m($1)"; }
4738 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4739 printf "\e033[0m\en"
4741 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4742 printf "\e033[0m\en"
4745 .It Ar bg=
4746 background colour attribute (see
4747 .Cd fg=
4748 for possible values).
4752 The command
4753 .Ic \&uncolour
4754 will remove for the given colour type (the special type
4755 .Ql *
4756 selects all) the given mapping; if the optional precondition argument is
4757 given only the exact tuple of mapping and precondition is removed.
4758 The special name
4759 .Ql *
4760 will remove all mappings (no precondition allowed), thus
4761 .Ql uncolour * *
4762 will remove all established mappings.
4767 .It Ic commandalias , uncommandalias
4768 \*(NQ Define or list, and remove, respectively, command aliases.
4769 An (command)alias can be used everywhere a normal command can be used,
4770 but always takes precedence: any arguments that are given to the command
4771 alias are joined onto the alias expansion, and the resulting string
4772 forms the command line that is, in effect, executed.
4773 The latter command removes all given aliases, the special name
4774 .Ql *
4775 will remove all existing aliases.
4776 When used without arguments the former shows a list of all currently
4777 known aliases, with one argument only the expansion of the given one.
4779 With two or more arguments a command alias is defined or updated: the
4780 first argument is the name under which the remaining command line should
4781 be accessible, the content of which can be just about anything.
4782 An alias may itself expand to another alias, but to avoid expansion loops
4783 further expansion will be prevented if an alias refers to itself or if
4784 an expansion depth limit is reached.
4785 Explicit expansion prevention is available via reverse solidus
4786 .Cm \e ,
4787 one of the
4788 .Sx "Command modifiers" .
4789 .Bd -literal -offset indent
4790 ? commandalias xx
4791 \*(uA: `commandalias': no such alias: xx
4792 ? commandalias xx echo hello,
4793 ? commandalias xx
4794 commandalias xx 'echo hello,'
4795 ? xx
4796 hello,
4797 ? xx world
4798 hello, world
4802 .It Ic Copy
4803 (C) Copy messages to files whose names are derived from the author of
4804 the respective message and do not mark them as being saved;
4805 otherwise identical to
4806 .Ic Save .
4809 .It Ic copy
4810 (c) Copy messages to the named file and do not mark them as being saved;
4811 otherwise identical to
4812 .Ic save .
4815 .It Ic cwd
4816 Show the name of the current working directory, as reported by
4817 .Xr getcwd 3 .
4818 Supports
4819 .Cm vput
4820 (see
4821 .Sx "Command modifiers" ) .
4822 The return status is tracked via
4823 .Va \&? .
4826 .It Ic Decrypt
4827 \*(OP For unencrypted messages this command is identical to
4828 .Ic Copy ;
4829 Encrypted messages are first decrypted, if possible, and then copied.
4832 .It Ic decrypt
4833 \*(OP For unencrypted messages this command is identical to
4834 .Ic copy ;
4835 Encrypted messages are first decrypted, if possible, and then copied.
4840 .It Ic define , undefine
4841 The latter command deletes the given macro, the special name
4842 .Ql *
4843 will discard all existing macros.
4844 Deletion of (a) macro(s) can be performed from within running (a)
4845 macro(s), including self-deletion.
4846 Without arguments the former command prints the current list of macros,
4847 including their content, otherwise it defines a macro, replacing an
4848 existing one of the same name as applicable.
4851 A defined macro can be invoked explicitly by using the
4852 .Ic call ,
4853 .Ic call_if
4855 .Ic xcall
4856 commands, or implicitly if a macro hook is triggered, e.g., a
4857 .Va folder-hook .
4858 Execution of a macro body can be stopped from within by calling
4859 .Ic return .
4862 Temporary macro block-scope variables can be created or deleted with the
4863 .Cm local
4864 command modifier in conjunction with the commands
4865 .Ic set
4867 .Ic unset ,
4868 respectively.
4869 To enforce unrolling of changes made to (global)
4870 .Sx "INTERNAL VARIABLES"
4871 the command
4872 .Ic localopts
4873 can be used instead; its covered scope depends on how (i.e.,
4874 .Dq as what :
4875 normal macro, folder hook, hook,
4876 .Ic account
4877 switch) the macro is invoked.
4880 Inside a
4881 .Ic call Ns
4882 ed macro, the given positional parameters are implicitly local
4883 to the macro's scope, and may be accessed via the variables
4884 .Va * ,
4885 .Va @ ,
4886 .Va #
4888 .Va 1
4889 and any other positive unsigned decimal number less than or equal to
4890 .Va # .
4891 Positional parameters can be
4892 .Ic shift Ns
4893 ed, or become completely replaced, removed etc. via
4894 .Ic vpospar .
4895 A helpful command to perform many sorts of number and string evaluations is
4896 .Ic vexpr .
4898 .Bd -literal -offset indent
4899 define name {
4900   command1
4901   command2
4902   ...
4903   commandN
4906 # E.g.
4907 define exmac {
4908   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4909   return 1000 0
4911 call exmac Hello macro exmac!
4912 echo ${?}/${!}/${^ERRNAME}
4918 .It Ic delete , undelete
4919 (d, u) Marks the given message list as being or not being
4920 .Ql deleted ,
4921 respectively; if no argument has been specified then the usual search
4922 for a visible message is performed, as documented for
4923 .Sx "Message list arguments" ,
4924 showing only the next input prompt if the search fails.
4925 Deleted messages will neither be saved in the
4926 .Mx -sx
4927 .Sx "secondary mailbox"
4928 .Ev MBOX
4929 nor will they be available for most other commands.
4930 If the
4931 .Va autoprint
4932 variable is set, the new
4933 .Dq dot
4934 or the last message restored, respectively, is automatically
4935 .Ic type Ns
4936 d; also see
4937 .Ic dp ,
4938 .Ic dt .
4942 .It Ic digmsg
4943 \*(NQ Digging (information out of) messages is possible through
4944 .Ic \&\&digmsg
4945 objects, which can be
4946 .Cm create Ns
4947 d for the given message number; in compose mode the hyphen-minus
4948 .Ql -
4949 will instead open the message that is being composed.
4950 If a hyphen-minus is given as the optional third argument then output
4951 will be generated on the standard output channel instead of being
4952 subject to consumation by the
4953 .Ic read
4955 .Ic readall
4956 commands.
4958 The objects may be
4959 .Cm remove Ns
4960 d again by giving the same identifier used for creation;
4961 this step could be omitted: objects will be automatically closed
4962 when the active mailbox or the compose mode is left, respectively.
4963 In all other cases the second argument is an object identifier,
4964 and the third and all following arguments are interpreted as via
4965 .Ic ~^
4966 (see
4967 .Sx "COMMAND ESCAPES" ) :
4968 .Bd -literal -offset indent
4969 ? vput = msgno; digmsg create $msgno
4970 ? digmsg $msgno header list;   readall x;   echon $x
4971 210 Subject From To Message-ID References In-Reply-To Status
4972 ? digmsg $msgno header show Status;readall x;echon $x
4973 212 Status
4976 ? digmsg remove $msgno
4981 .It Ic discard
4982 (di) Identical to
4983 .Ic ignore .
4984 Superseded by the multiplexer
4985 .Ic headerpick .
4989 .It Ic dp , dt
4990 Delete the given messages and automatically
4991 .Ic type
4992 the new
4993 .Dq dot
4994 if one exists, regardless of the setting of
4995 .Va autoprint .
4998 .It Ic dotmove
4999 Move the
5000 .Dq dot
5001 up or down by one message when given
5002 .Ql +
5004 .Ql -
5005 argument, respectively.
5009 .It Ic draft , undraft
5010 Take message lists and mark each given message as being draft, or not
5011 being draft, respectively, as documented in the section
5012 .Sx "Message states" .
5015 .It Ic echo
5016 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
5017 newline, whereas the otherwise identical
5018 .Ic echon
5019 does not.
5020 .Sx "Shell-style argument quoting"
5021 is used,
5022 .Sx "Filename transformations"
5023 are applied to the expanded arguments.
5024 This command also supports
5025 .Cm vput
5026 as documented in
5027 .Sx "Command modifiers" ,
5028 and manages the error number
5029 .Va \&! :
5030 if data is stored in a variable then the return value reflects the
5031 length of the result string in case of success and is
5032 .Ql -1
5033 on error.
5036 .It Ic echoerr
5037 \*(NQ Identical to
5038 .Ic echo
5039 except that is echoes to standard error.
5040 Also see
5041 .Ic echoerrn .
5042 In interactive sessions the \*(OPal message ring queue for
5043 .Ic errors
5044 will be used instead, if available and
5045 .Cm vput
5046 was not used.
5049 .It Ic echon
5050 \*(NQ Identical to
5051 .Ic echo ,
5052 but does not write or store a trailing newline.
5055 .It Ic echoerrn
5056 \*(NQ Identical to
5057 .Ic echoerr ,
5058 but does not write or store a trailing newline.
5061 .It Ic edit
5062 (e) Point the text
5063 .Ev EDITOR
5064 at each message from the given list in turn.
5065 Modified contents are discarded unless the
5066 .Va writebackedited
5067 variable is set, and are not used unless the mailbox can be written to
5068 and the editor returns a successful exit status.
5069 .Ic visual
5070 can be used instead for a more display oriented editor.
5073 .It Ic elif
5074 Part of the
5075 .Ic if
5076 (see there for more),
5077 .Ic elif , else , endif
5078 conditional \(em if the condition of a preceding
5079 .Ic if
5080 was false, check the following condition and execute the following block
5081 if it evaluates true.
5084 .It Ic else
5085 (el) Part of the
5086 .Ic if
5087 (see there for more),
5088 .Ic elif , else , endif
5089 conditional \(em if none of the conditions of the preceding
5090 .Ic if
5092 .Ic elif
5093 commands was true, the
5094 .Ic else
5095 block is executed.
5098 .It Ic endif
5099 (en) Marks the end of an
5100 .Ic if
5101 (see there for more),
5102 .Ic elif , else , endif
5103 conditional execution block.
5107 .It Ic environ
5108 \*(NQ \*(UA has a strict notion about which variables are
5109 .Sx "INTERNAL VARIABLES"
5110 and which are managed in the program
5111 .Sx ENVIRONMENT .
5112 Since some of the latter are a vivid part of \*(UAs functioning,
5113 however, they are transparently integrated into the normal handling of
5114 internal variables via
5115 .Ic set
5117 .Ic unset .
5118 To integrate other environment variables of choice into this
5119 transparent handling, and also to export internal variables into the
5120 process environment where they normally are not, a
5121 .Ql link
5122 needs to become established with this command, as in, e.g.,
5125 .Dl environ link PERL5LIB TZ
5128 Afterwards changing such variables with
5129 .Ic set
5130 will cause automatic updates of the program environment, and therefore
5131 be inherited by newly created child processes.
5132 Sufficient system support provided (it was in BSD as early as 1987, and
5133 is standardized since Y2K) removing such variables with
5134 .Ic unset
5135 will remove them also from the program environment, but in any way
5136 the knowledge they ever have been
5137 .Ql link Ns
5138 ed will be lost.
5139 Note that this implies that
5140 .Ic localopts
5141 may cause loss of such links.
5144 The command
5145 .Ql unlink
5146 will remove an existing link, but leaves the variables as such intact.
5147 Additionally the subcommands
5148 .Ql set
5150 .Ql unset
5151 are provided, which work exactly the same as the documented commands
5152 .Ic set
5154 .Ic unset ,
5155 but (additionally un)link the variable(s) with the program environment
5156 and thus immediately export them to, or remove them from (if possible),
5157 respectively, the program environment.
5161 .It Ic errors
5162 \*(OP Since \*(UA uses the console as a user interface it can happen
5163 that messages scroll by too fast to become recognized.
5164 An error message ring queue is available which stores duplicates of any
5165 error message and notifies the user in interactive sessions whenever
5166 a new error has occurred.
5167 The queue is finite: if its maximum size is reached any new message
5168 replaces the eldest.
5169 The command
5170 .Ic errors
5171 can be used to manage this message queue: if given
5172 .Ar show
5173 or no argument the queue will be displayed and cleared,
5174 .Ar clear
5175 will only clear all messages from the queue.
5178 .It Ic eval
5179 \*(NQ Construct a command by concatenating the arguments, separated with
5180 a single space character, and then evaluate the result.
5181 This command passes through the exit status
5182 .Va \&?
5183 and error number
5184 .Va \&!
5185 of the evaluated command; also see
5186 .Ic call .
5187 .Bd -literal -offset indent
5188 define xxx {
5189   echo "xxx arg <$1>"
5190   shift
5191   if [ $# -gt 0 ]
5192     \excall xxx "$@"
5193   endif
5195 define yyy {
5196   eval "$@ ' ball"
5198 call yyy '\ecall xxx' "b\e$'\et'u ' "
5199 call xxx arg <b      u>
5200 call xxx arg <  >
5201 call xxx arg <ball>
5205 .It Ic exit
5206 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5207 any saving of messages in the
5208 .Mx -sx
5209 .Sx "secondary mailbox"
5210 .Ev MBOX ,
5211 as well as a possibly tracked line editor
5212 .Va history-file .
5213 The optional status number argument will be passed through to
5214 .Xr exit 3 .
5215 \*(ID For now it can happen that the given status will be overwritten,
5216 later this will only occur if a later error needs to be reported onto an
5217 otherwise success indicating status.
5220 .It Ic File
5221 (Fi) Like
5222 .Ic file ,
5223 but open the mailbox read-only.
5227 .It Ic file
5228 (fi) The file command switches to a new mailbox.
5229 Without arguments it shows status information of the current mailbox.
5230 If an argument is given, it will write out changes (such as deletions)
5231 the user has made, open a new mailbox, update the internal variables
5232 .Va mailbox-resolved
5234 .Va mailbox-display ,
5235 execute an according
5236 .Va folder-hook ,
5237 if one is installed, and optionally display a summary of
5238 .Ic headers
5239 if the variable
5240 .Va header
5241 is set.
5244 .Sx "Filename transformations"
5245 will be applied to the
5246 .Ar name
5247 argument, and
5248 .Ql protocol://
5249 prefixes are, i.e., URL syntax is understood, e.g.,
5250 .Ql mbox:///tmp/mdirbox :
5251 if a protocol prefix is used the mailbox type is fixated and neither
5252 the auto-detection (read on) nor the
5253 .Va newfolders
5254 mechanisms apply.
5255 \*(OPally URLs can also be used to access network resources, which may
5256 be accessed securely via
5257 .Sx "Encrypted network communication"
5258 if so supported, and it is possible to proxy all network traffic over
5259 a SOCKS5 server given via
5260 .Va socks-proxy .
5263 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5264 .Dl \*(OU protocol://[user@]host[:port][/path]
5267 \*(OPally supported network protocols are
5268 .Ar pop3
5269 (POP3) and
5270 .Ar pop3s
5271 (POP3 with TLS encrypted transport),
5272 .Ar imap
5274 .Ar imaps .
5276 .Ar [/path]
5277 part is valid only for IMAP; there it defaults to
5278 .Ar INBOX .
5279 Network URLs require a special encoding as documented in the section
5280 .Sx "On URL syntax and credential lookup" .
5283 If the resulting file protocol (MBOX database)
5284 .Ar name
5285 is located on a local filesystem then the list of all registered
5286 .Ic filetype Ns
5287 s is traversed in order to see whether a transparent intermediate
5288 conversion step is necessary to handle the given mailbox, in which case
5289 \*(UA will use the found hook to load and save data into and from
5290 a temporary file, respectively.
5291 Changing hooks will not affect already opened mailboxes.
5292 For example, the following creates hooks for the
5293 .Xr gzip 1
5294 compression tool and a combined compressed and encrypted format:
5296 .Bd -literal -offset indent
5297 ? filetype \e
5298     gzip 'gzip -dc' 'gzip -c' \e
5299     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5303 MBOX databases will always be protected via file-region locks
5304 .Pf ( Xr fcntl 2 )
5305 during file operations in order to avoid inconsistencies due to
5306 concurrent modifications.
5307 .Mx -ix "dotlock files"
5308 \*(OP In addition mailbox files treated as the system
5309 .Va inbox
5310 .Pf ( Ev MAIL ) ,
5311 as well as
5312 .Mx -sx
5313 .Sx "primary system mailbox" Ns
5314 es in general will also be protected by so-called dotlock files,
5315 the traditional way of mail spool file locking: for any file
5316 .Ql x
5317 a lock file
5318 .Ql x.lock
5319 will be created for the duration of the synchronization \(em
5320 as necessary an external privileged dotlock helper will be used
5321 to create the dotlock file in the same directory and with the same user
5322 and group identities as the file of interest.
5323 .Va dotlock-disable
5324 can be used to turn off additional dotlock files, shall the need arise.
5327 \*(UA by default uses tolerant POSIX rules when reading MBOX database
5328 files, but it will detect invalid message boundaries in this mode and
5329 complain (even more with
5330 .Va debug )
5331 if any is seen: in this case
5332 .Va mbox-rfc4155
5333 can be used to create a valid MBOX database from the invalid input.
5336 \*(OP If no protocol has been fixated, and
5337 .Ar name
5338 refers to a directory with the subdirectories
5339 .Ql tmp ,
5340 .Ql new
5342 .Ql cur ,
5343 then it is treated as a folder in
5344 .Dq Maildir
5345 format.
5346 The maildir format stores each message in its own file, and has been
5347 designed so that file locking is not necessary when reading or writing
5348 files.
5351 \*(ID If no protocol has been fixated and no existing file has
5352 been found, the variable
5353 .Va newfolders
5354 controls the format of mailboxes yet to be created.
5359 .It Ic filetype , unfiletype
5360 \*(NQ Define or list, and remove, respectively, file handler hooks,
5361 which provide (shell) commands that enable \*(UA to load and save MBOX
5362 files from and to files with the registered file extensions;
5363 it will use an intermediate temporary file to store the plain data.
5364 The latter command removes the hooks for all given extensions,
5365 .Ql *
5366 will remove all existing handlers.
5368 When used without arguments the former shows a list of all currently
5369 defined file hooks, with one argument the expansion of the given alias.
5370 Otherwise three arguments are expected, the first specifying the file
5371 extension for which the hook is meant, and the second and third defining
5372 the load- and save commands, respectively, to deal with the file type,
5373 both of which must read from standard input and write to standard
5374 output.
5375 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5376 \*(ID For now too much work is done, and files are oftened read in twice
5377 where once would be sufficient: this can cause problems if a filetype is
5378 changed while such a file is opened; this was already so with the
5379 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5380 \*(ID For now all handler strings are passed to the
5381 .Ev SHELL for evaluation purposes; in the future a
5382 .Ql \&!
5383 prefix to load and save commands may mean to bypass this shell instance:
5384 placing a leading space will avoid any possible misinterpretations.
5385 .Bd -literal -offset indent
5386 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5387     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
5388     zst 'zstd -dc' 'zstd -19 -zc' \e
5389     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5390 ? set record=+sent.zst.pgp
5395 .It Ic flag , unflag
5396 Take message lists and mark the messages as being flagged, or not being
5397 flagged, respectively, for urgent/special attention.
5398 See the section
5399 .Sx "Message states" .
5402 .It Ic folder
5403 (fold) The same as
5404 .Ic file .
5407 .It Ic folders
5408 With no arguments, list the names of the folders in the folder directory.
5409 With an existing folder as an argument,
5410 lists the names of folders below the named folder.
5413 .It Ic Followup
5414 (F) Similar to
5415 .Ic Respond ,
5416 but saves the message in a file named after the local part of the first
5417 recipient's address (instead of in
5418 .Va record Ns ).
5421 .It Ic followup
5422 (fo) Similar to
5423 .Ic respond ,
5424 but saves the message in a file named after the local part of the first
5425 recipient's address (instead of in
5426 .Va record Ns ).
5429 .It Ic followupall
5430 Similar to
5431 .Ic followup ,
5432 but responds to all recipients regardless of the
5433 .Va flipr
5434 variable.
5437 .It Ic followupsender
5438 Similar to
5439 .Ic Followup ,
5440 but responds to the sender only regardless of the
5441 .Va flipr
5442 variable.
5445 .It Ic Forward
5446 Similar to
5447 .Ic forward ,
5448 but saves the message in a file named after the local part of the
5449 recipient's address (instead of in
5450 .Va record Ns ).
5453 .It Ic forward
5454 Takes a message and the address of a recipient
5455 and forwards the message to him.
5456 The text of the original message is included in the new one,
5457 with the value of the
5458 .Va forward-inject-head
5459 variable preceding, and the value of
5460 .Va forward-inject-tail
5461 succeeding it.
5462 To filter the included header fields to the desired subset use the
5463 .Ql forward
5464 slot of the white- and blacklisting command
5465 .Ic headerpick .
5466 Only the first part of a multipart message is included unless
5467 .Va forward-as-attachment ,
5468 and recipient addresses will be stripped from comments, names
5469 etc. unless the internal variable
5470 .Va fullnames
5471 is set.
5473 This may generate the errors
5474 .Va ^ERR Ns -DESTADDRREQ
5475 if no receiver has been specified,
5476 .Va ^ERR Ns -PERM
5477 if some addressees where rejected by
5478 .Va expandaddr ,
5479 .Va ^ERR Ns -NODATA
5480 if no applicable messages have been given,
5481 .Va ^ERR Ns -NOTSUP
5482 if multiple messages have been specified,
5483 .Va ^ERR Ns -IO
5484 if an I/O error occurs,
5485 .Va ^ERR Ns -NOTSUP
5486 if a necessary character set conversion fails, and
5487 .Va ^ERR Ns -INVAL
5488 for other errors.
5491 .It Ic from
5492 (f) Takes a list of message specifications and displays a summary of
5493 their message headers, exactly as via
5494 .Ic headers ,
5495 making the first message of the result the new
5496 .Dq dot
5497 (the last message if
5498 .Va showlast
5499 is set).
5500 An alias of this command is
5501 .Ic search .
5502 Also see
5503 .Sx "Specifying messages" .
5505 .It Ic Fwd
5506 \*(OB Alias for
5507 .Ic Forward .
5509 .It Ic fwd
5510 \*(OB Alias for
5511 .Ic forward .
5513 .It Ic fwdignore
5514 \*(OB Superseded by the multiplexer
5515 .Ic headerpick .
5517 .It Ic fwdretain
5518 \*(OB Superseded by the multiplexer
5519 .Ic headerpick .
5521 .It Ic ghost , unghost
5522 \*(OB Replaced by
5523 .Ic commandalias ,
5524 .Ic uncommandalias .
5528 .It Ic headerpick , unheaderpick
5529 \*(NQ Multiplexer command to manage white- and blacklisting
5530 selections of header fields for a variety of applications.
5531 Without arguments the set of contexts that have settings is displayed.
5532 When given arguments, the first argument is the context to which the
5533 command applies, one of (case-insensitive)
5534 .Ql type
5535 for display purposes (via, e.g.,
5536 .Ic type ) ,
5537 .Ql save
5538 for selecting which headers shall be stored persistently when
5539 .Ic save ,
5540 .Ic copy ,
5541 .Ic move
5542 or even
5543 .Ic decrypt Ns
5544 ing messages (note that MIME related etc. header fields should not be
5545 ignored in order to not destroy usability of the message in this case),
5546 .Ql forward
5547 for stripping down messages when
5548 .Ic forward Ns
5549 ing message (has no effect if
5550 .Va forward-as-attachment
5551 is set), and
5552 .Ql top
5553 for defining user-defined set of fields for the command
5554 .Ic top .
5556 The current settings of the given context are displayed if it is the
5557 only argument.
5558 A second argument denotes the type of restriction that is to be chosen,
5559 it may be (a case-insensitive prefix of)
5560 .Ql retain
5562 .Ql ignore
5563 for white- and blacklisting purposes, respectively.
5564 Establishing a whitelist suppresses inspection of the corresponding
5565 blacklist.
5567 If no further argument is given the current settings of the given type
5568 will be displayed, otherwise the remaining arguments specify header
5569 fields, which \*(OPally may be given as regular expressions, to be added
5570 to the given type.
5571 The special wildcard field (asterisk,
5572 .Ql * )
5573 will establish a (fast) shorthand setting which covers all fields.
5575 The latter command always takes three or more arguments and can be used
5576 to remove selections, i.e., from the given context, the given type of
5577 list, all the given headers will be removed, the special argument
5578 .Ql *
5579 will remove all headers.
5582 .It Ic headers
5583 (h) Show the current group of headers, the size of which depends on
5584 the variable
5585 .Va screen
5586 in interactive mode, and the format of which can be defined with
5587 .Va headline .
5588 If a message-specification is given the group of headers containing the
5589 first message therein is shown and the message at the top of the screen
5590 becomes the new
5591 .Dq dot ;
5592 the last message is targeted if
5593 .Va showlast
5594 is set.
5597 .It Ic help
5598 (hel) A synonym for
5599 .Ic \&? .
5602 .It Ic history
5603 \*(OP Without arguments or when given
5604 .Cm show
5605 all history entries are shown (this mode also supports a more
5606 .Va verbose
5607 output).
5608 .Cm load
5609 will replace the list of entries with the content of
5610 .Va history-file ,
5612 .Cm save
5613 will dump the current list to said file, replacing former content.
5614 .Cm clear
5615 will delete all history entries.
5616 The argument can also be a signed decimal
5617 .Ar NUMBER ,
5618 which will select and evaluate the respective history entry, and move it
5619 to the top of the history; a negative number is used as an offset to the
5620 current command, e.g.,
5621 .Ql -1
5622 will select the last command, the history top.
5623 Please see
5624 .Sx "On terminal control and line editor"
5625 for more on this topic.
5628 .It Ic hold
5629 (ho, also
5630 .Ic preserve )
5631 Takes a message list and marks each message therein to be saved in the
5632 user's system
5633 .Va inbox
5634 instead of in the
5635 .Mx -sx
5636 .Sx "secondary mailbox"
5637 .Ev MBOX .
5638 Does not override the
5639 .Ic delete
5640 command.
5641 \*(UA deviates from the POSIX standard with this command, because a
5642 .Ic next
5643 command issued after
5644 .Ic hold
5645 will display the following message, not the current one.
5649 .It Ic if
5650 (i) Part of the
5651 .Ic \&\&if , Ic elif , else , endif
5652 conditional execution construct \(em if the given condition is true then
5653 the encapsulated block is executed.
5654 The POSIX standard only supports the (case-insensitive) conditions
5655 .Ql r Ns
5656 eceive
5658 .Ql s Ns
5659 end, the remaining are non-portable extensions.
5660 \*(ID These commands do not yet use
5661 .Sx "Shell-style argument quoting"
5662 and therefore do not know about input tokens, so that syntax
5663 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5664 all conditions bracket group wise and consider the tokens, representing
5665 values and operators, therein, which also means that variables will
5666 already have been expanded at that time (just like in the shell).
5668 .Bd -literal -offset indent
5669 if receive
5670   commands ...
5671 else
5672   commands ...
5673 endif
5677 The (case-insensitive) condition
5678 .Ql t Ns
5679 erminal will evaluate to true if the standard input is a terminal, i.e.,
5680 in interactive sessions.
5681 Another condition can be any boolean value (see the section
5682 .Sx "INTERNAL VARIABLES"
5683 for textual boolean representations) to mark an enwrapped block as
5684 .Dq never execute
5686 .Dq always execute .
5687 (It shall be remarked that a faulty condition skips all branches until
5688 .Ic endif . )
5691 (\*(ID In v15
5692 .Sx "Shell-style argument quoting"
5693 will be used, and this command will simply interpret expanded tokens.)
5694 It is possible to check
5695 .Sx "INTERNAL VARIABLES"
5696 as well as
5697 .Sx ENVIRONMENT
5698 variables for existence or compare their expansion against a user given
5699 value or another variable by using the
5700 .Ql $
5701 .Pf ( Dq variable next )
5702 conditional trigger character;
5703 a variable on the right hand side may be signalled using the same
5704 mechanism.
5705 Variable names may be enclosed in a pair of matching braces.
5706 When this mode has been triggered, several operators are available:
5709 Integer operators treat the arguments on the left and right hand side of
5710 the operator as integral numbers and compare them arithmetically.
5711 It is an error if any of the operands is not a valid integer, an empty
5712 argument (which implies it had been quoted) is treated as if it were 0.
5713 Available operators are
5714 .Ql -lt
5715 (less than),
5716 .Ql -le
5717 (less than or equal to),
5718 .Ql -eq
5719 (equal),
5720 .Ql -ne
5721 (not equal),
5722 .Ql -ge
5723 (greater than or equal to), and
5724 .Ql -gt
5725 (greater than).
5728 String data operators compare the left and right hand side according to
5729 their textual content.
5730 Unset variables are treated as the empty string.
5731 The behaviour of string operators can be adjusted by prefixing the
5732 operator with the modifier trigger commercial at
5733 .Ql @ ,
5734 followed by none to multiple modifiers: for now supported is
5735 .Ql i ,
5736 which turns the comparison into a case-insensitive one: this is
5737 implied if no modifier follows the trigger.
5740 Available string operators are
5741 .Ql <
5742 (less than),
5743 .Ql <=
5744 (less than or equal to),
5745 .Ql ==
5746 (equal),
5747 .Ql !=
5748 (not equal),
5749 .Ql >=
5750 (greater than or equal to),
5751 .Ql >
5752 (greater than),
5753 .Ql =%
5754 (is substring of) and
5755 .Ql !%
5756 (is not substring of).
5757 By default these operators work on bytes and (therefore) do not take
5758 into account character set specifics.
5759 If the case-insensitivity modifier has been used, case is ignored
5760 according to the rules of the US-ASCII encoding, i.e., bytes are
5761 still compared.
5764 When the \*(OPal regular expression support is available, the additional
5765 string operators
5766 .Ql =~
5768 .Ql !~
5769 can be used.
5770 They treat the right hand side as an extended regular expression that is
5771 matched according to the active locale (see
5772 .Sx "Character sets" ) ,
5773 i.e., character sets should be honoured correctly.
5776 Conditions can be joined via AND-OR lists (where the AND operator is
5777 .Ql &&
5778 and the OR operator is
5779 .Ql || ) ,
5780 which have equal precedence and will be evaluated with left
5781 associativity, thus using the same syntax that is known for the
5782 .Xr sh 1 .
5783 It is also possible to form groups of conditions and lists by enclosing
5784 them in pairs of brackets
5785 .Ql [\ \&.\&.\&.\ ] ,
5786 which may be interlocked within each other, and also be joined via
5787 AND-OR lists.
5790 The results of individual conditions and entire groups may be modified
5791 via unary operators: the unary operator
5792 .Ql \&!
5793 will reverse the result.
5795 .Bd -literal -offset indent
5796 # (This not in v15, there [ -n "$debug"]!)
5797 if $debug
5798   echo *debug* is set
5799 endif
5800 if [ "$ttycharset" == UTF-8 ] || \e
5801     [ "$ttycharset" @i== UTF8 ]
5802   echo *ttycharset* is UTF-8, the former case-sensitive!
5803 endif
5804 set t1=one t2=one
5805 if [ "${t1}" == "${t2}" ]
5806   echo These two variables are equal
5807 endif
5808 if [ "$features" =% +regex ] && \e
5809     [ "$TERM" @i=~ "^xterm\&.*" ]
5810   echo ..in an X terminal
5811 endif
5812 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5813     [ "$verbose" != '' ] ] ]
5814   echo Noisy, noisy
5815 endif
5816 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5817   echo Left associativity, as is known from the shell
5818 endif
5823 .It Ic ignore
5824 (ig) Identical to
5825 .Ic discard .
5826 Superseded by the multiplexer
5827 .Ic headerpick .
5830 .It Ic list
5831 Shows the names of all available commands, alphabetically sorted.
5832 If given any non-whitespace argument the list will be shown in the order
5833 in which command prefixes are searched.
5834 \*(OP In conjunction with a set variable
5835 .Va verbose
5836 additional information will be provided for each command: the argument
5837 type will be indicated, the documentation string will be shown,
5838 and the set of command flags will show up:
5840 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
5841 .It Ql "`local'"
5842 command supports the command modifier
5843 .Cm local .
5844 .It Ql "`vput'"
5845 command supports the command modifier
5846 .Cm vput .
5847 .It Ql "*!*"
5848 the error number is tracked in
5849 .Va \&! .
5850 .It Ql needs-box
5851 whether the command needs an active mailbox, a
5852 .Ic file .
5853 .It Ql ok:
5854 indicators whether command is \&.\h'.3m'.\h'.3m'.
5855 .Bl -tag -compact -width ".It Ql SUBPROCESS"
5856 .It Ql batch/interactive
5857 usable in interactive or batch mode
5858 .Pf ( Fl # ) .
5859 .It Ql send-mode
5860 usable in send mode.
5861 .It Ql subprocess
5862 allowed to be used when running in a subprocess instance,
5863 e.g., from within a macro that is called via
5864 .Va on-compose-splice .
5866 .It Ql not ok:
5867 indicators whether command is not \&.\h'.3m'.\h'.3m'.
5868 .Bl -tag -compact -width ".It Ql COMPOSE_MODE"
5869 .It Ql compose-mode
5870 available in compose mode.
5871 .It Ql startup
5872 available during program startup, e.g., in
5873 .Sx "Resource files" .
5875 .It Ql "gabby"
5876 The command produces
5877 .Va history-gabby
5878 .Ic history
5879 entries.
5884 .It Ic localopts
5885 This command can be used to localize changes to (linked)
5886 .Sx ENVIRONMENT
5887 as well as (global)
5888 .Sx "INTERNAL VARIABLES" ,
5889 meaning that their state will be reverted to the former one once the
5890 .Dq covered scope
5891 is left.
5892 Just like the command modifier
5893 .Cm local ,
5894 which provides block-scope localization for some commands (instead),
5895 it can only be used inside of macro definition blocks introduced by
5896 .Ic account
5898 .Ic define .
5899 The covered scope of an
5900 .Ic account
5901 is left once a different account is activated, and some macros, notably
5902 .Va folder-hook Ns s ,
5903 use their own specific notion of covered scope, here it will be extended
5904 until the folder is left again.
5907 This setting stacks up: i.e., if
5908 .Ql macro1
5909 enables change localization and calls
5910 .Ql macro2 ,
5911 which explicitly resets localization, then any value changes within
5912 .Ql macro2
5913 will still be reverted when the scope of
5914 .Ql macro1
5915 is left.
5916 (Caveats: if in this example
5917 .Ql macro2
5918 changes to a different
5919 .Ic account
5920 which sets some variables that are already covered by localizations,
5921 their scope will be extended, and in fact leaving the
5922 .Ic account
5923 will (thus) restore settings in (likely) global scope which actually
5924 were defined in a local, macro private context!)
5927 This command takes one or two arguments, the optional first one
5928 specifies an attribute that may be one of
5929 .Cm \&\&scope ,
5930 which refers to the current scope and is thus the default,
5931 .Cm call ,
5932 which causes any macro that is being
5933 .Ic call Ns
5934 ed to be started with localization enabled by default, as well as
5935 .Cm call-fixate ,
5936 which (if enabled) disallows any called macro to turn off localization:
5937 like this it can be ensured that once the current scope regains control,
5938 any changes made in deeper levels have been reverted.
5939 The latter two are mutually exclusive, and neither affects
5940 .Ic xcall .
5941 The (second) argument is interpreted as a boolean (string, see
5942 .Sx "INTERNAL VARIABLES" )
5943 and states whether the given attribute shall be turned on or off.
5945 .Bd -literal -offset indent
5946 define temporary_settings {
5947   set possibly_global_option1
5948   localopts on
5949   set localized_option1
5950   set localized_option2
5951   localopts scope off
5952   set possibly_global_option2
5958 .It Ic Lreply
5959 Reply to messages that come in via known
5960 .Pf ( Ic mlist )
5961 or subscribed
5962 .Pf ( Ic mlsubscribe )
5963 mailing lists, or pretend to do so (see
5964 .Sx "Mailing lists" ) :
5965 on top of the usual
5966 .Ic reply
5967 functionality this will actively resort and even remove message
5968 recipients in order to generate a message that is supposed to be sent to
5969 a mailing list.
5970 For example it will also implicitly generate a
5971 .Ql Mail-Followup-To:
5972 header if that seems useful, regardless of the setting of the variable
5973 .Va followup-to .
5974 For more documentation please refer to
5975 .Sx "On sending mail, and non-interactive mode" .
5977 This may generate the errors
5978 .Va ^ERR Ns -DESTADDRREQ
5979 if no receiver has been specified,
5980 .Va ^ERR Ns -PERM
5981 if some addressees where rejected by
5982 .Va expandaddr ,
5983 .Va ^ERR Ns -NODATA
5984 if no applicable messages have been given,
5985 .Va ^ERR Ns -IO
5986 if an I/O error occurs,
5987 .Va ^ERR Ns -NOTSUP
5988 if a necessary character set conversion fails, and
5989 .Va ^ERR Ns -INVAL
5990 for other errors.
5991 Occurrence of some of the errors depend on the value of
5992 .Va expandaddr .
5993 Any error stops processing of further messages.
5996 .It Ic Mail
5997 Similar to
5998 .Ic mail ,
5999 but saves the message in a file named after the local part of the first
6000 recipient's address (instead of in
6001 .Va record Ns ).
6004 .It Ic mail
6005 (m) Takes a (list of) recipient address(es) as (an) argument(s),
6006 or asks on standard input if none were given;
6007 then collects the remaining mail content and sends it out.
6008 Unless the internal variable
6009 .Va fullnames
6010 is set recipient addresses will be stripped from comments, names etc.
6011 For more documentation please refer to
6012 .Sx "On sending mail, and non-interactive mode" .
6014 This may generate the errors
6015 .Va ^ERR Ns -DESTADDRREQ
6016 if no receiver has been specified,
6017 .Va ^ERR Ns -PERM
6018 if some addressees where rejected by
6019 .Va expandaddr ,
6020 .Va ^ERR Ns -NODATA
6021 if no applicable messages have been given,
6022 .Va ^ERR Ns -NOTSUP
6023 if multiple messages have been specified,
6024 .Va ^ERR Ns -IO
6025 if an I/O error occurs,
6026 .Va ^ERR Ns -NOTSUP
6027 if a necessary character set conversion fails, and
6028 .Va ^ERR Ns -INVAL
6029 for other errors.
6030 Occurrence of some of the errors depend on the value of
6031 .Va expandaddr .
6034 .It Ic mbox
6035 (mb) The given message list is to be sent to the
6036 .Mx -sx
6037 .Sx "secondary mailbox"
6038 .Ev MBOX
6039 when \*(UA is quit; this is the default action unless the variable
6040 .Va hold
6041 is set.
6042 \*(ID This command can only be used in a
6043 .Mx -sx
6044 .Sx "primary system mailbox" .
6048 .It Ic mimetype , unmimetype
6049 Without arguments the content of the MIME type cache will displayed;
6050 a more verbose listing will be produced if either of
6051 .Va debug
6053 .Va verbose
6054 are set.
6055 When given arguments they will be joined, interpreted as shown in
6056 .Sx "The mime.types files"
6057 (also see
6058 .Sx "HTML mail and MIME attachments" ) ,
6059 and the resulting entry will be added (prepended) to the cache.
6060 In any event MIME type sources are loaded first as necessary \(en
6061 .Va mimetypes-load-control
6062 can be used to fine-tune which sources are actually loaded.
6064 The latter command deletes all specifications of the given MIME type, thus
6065 .Ql ? unmimetype text/plain
6066 will remove all registered specifications for the MIME type
6067 .Ql text/plain .
6068 The special name
6069 .Ql *
6070 will discard all existing MIME types, just as will
6071 .Ql reset ,
6072 but which also reenables cache initialization via
6073 .Va mimetypes-load-control .
6077 .It Ic mlist , unmlist
6078 The latter command removes all given mailing lists, the special name
6079 .Ql *
6080 can be used to remove all registered lists.
6081 The former will list all currently defined mailing lists (and their
6082 attributes, if any) when used without arguments; a more verbose listing
6083 will be produced if either of
6084 .Va debug
6086 .Va verbose
6087 are set.
6088 Otherwise all given arguments will be added and henceforth be recognized
6089 as mailing lists.
6090 If the \*(OPal regular expression support is available then any argument
6091 which contains any of the
6092 .Dq magical
6093 regular expression characters
6094 .Ql ^[]*+?|$
6095 (see
6096 .Xr re_format 7 )
6097 will be interpreted as one, which allows matching of many addresses with
6098 a single expression.
6100 .Ic mlsubscribe
6101 pair of commands manages subscription attributes of mailing lists.
6104 .It Ic mimeview
6105 \*(ID Only available in interactive mode, this command allows one to
6106 display MIME parts which require external MIME handler programs to run
6107 which do not integrate in \*(UAs normal
6108 .Ic type
6109 output (see
6110 .Sx "HTML mail and MIME attachments" ) .
6111 (\*(ID No syntax to directly address parts, this restriction may vanish.)
6112 The user will be asked for each non-text part of the given message in
6113 turn whether the registered handler shall be used to display the part.
6117 .It Ic mlsubscribe , unmlsubscribe
6118 The latter command removes the subscription attribute from all given
6119 mailing lists, the special name
6120 .Ql *
6121 can be used to do so for any registered list.
6122 The former will list all currently defined mailing lists which have
6123 a subscription attribute when used without arguments; a more verbose
6124 listing will be produced if either of
6125 .Va debug
6127 .Va verbose
6128 are set.
6129 Otherwise this attribute will be set for all given mailing lists,
6130 newly creating them as necessary (as via
6131 .Ic mlist ) .
6132 Also see
6133 .Va followup-to .
6136 .It Ic Move
6137 Similar to
6138 .Ic move ,
6139 but moves the messages to a file named after the local part of the
6140 sender address of the first message (instead of in
6141 .Va record Ns ).
6144 .It Ic move
6145 Acts like
6146 .Ic copy
6147 but marks the messages for deletion if they were transferred
6148 successfully.
6151 .It Ic More
6152 Like
6153 .Ic more ,
6154 but also displays header fields which would not pass the
6155 .Ic headerpick
6156 selection, and all MIME parts.
6157 Identical to
6158 .Ic Page .
6161 .It Ic more
6162 Invokes the
6163 .Ev PAGER
6164 on the given messages, even in non-interactive mode and as long as the
6165 standard output is a terminal.
6166 Identical to
6167 .Ic page .
6170 .It Ic netrc
6171 \*(OP When used without arguments or if
6172 .Ar show
6173 has been given the content of the
6174 .Pa \*(VN
6175 cache is shown, loading it first as necessary.
6176 If the argument is
6177 .Ar load
6178 then the cache will only be initialized and
6179 .Ar clear
6180 will remove its contents.
6181 Note that \*(UA will try to load the file only once, use
6182 .Ql Ic \&\&netrc Ns \:\0\:clear
6183 to unlock further attempts.
6185 .Va netrc-lookup ,
6186 .Va netrc-pipe
6187 and the section
6188 .Sx "On URL syntax and credential lookup" ;
6189 the section
6190 .Sx "The .netrc file"
6191 documents the file format in detail.
6194 .It Ic newmail
6195 Checks for new mail in the current folder without committing any changes
6196 before.
6197 If new mail is present, a message is shown.
6198 If the
6199 .Va header
6200 variable is set,
6201 the headers of each new message are also shown.
6202 This command is not available for all mailbox types.
6205 .It Ic next
6206 (n) (like
6207 .Ql +
6209 .Dq ENTER )
6210 Goes to the next message in sequence and types it.
6211 With an argument list, types the next matching message.
6214 .It Ic New
6215 Same as
6216 .Ic Unread .
6219 .It Ic new
6220 Same as
6221 .Ic unread .
6224 .It Ic noop
6225 If the current folder is accessed via a network connection, a
6226 .Dq NOOP
6227 command is sent, otherwise no operation is performed.
6230 .It Ic Page
6231 Like
6232 .Ic page ,
6233 but also displays header fields which would not pass the
6234 .Ic headerpick
6235 selection, and all MIME parts.
6236 Identical to
6237 .Ic More .
6240 .It Ic page
6241 Invokes the
6242 .Ev PAGER
6243 on the given messages, even in non-interactive mode and as long as the
6244 standard output is a terminal.
6245 Identical to
6246 .Ic more .
6249 .It Ic Pipe
6250 Like
6251 .Ic pipe
6252 but also pipes header fields which would not pass the
6253 .Ic headerpick
6254 selection, and all parts of MIME
6255 .Ql multipart/alternative
6256 messages.
6259 .It Ic pipe
6260 (pi) Takes an optional message list and shell command (that defaults to
6261 .Va cmd ) ,
6262 and pipes the messages through the command.
6263 If the
6264 .Va page
6265 variable is set,
6266 every message is followed by a formfeed character.
6269 .It Ic preserve
6270 (pre) A synonym for
6271 .Ic hold .
6274 .It Ic Print
6275 (P) Alias for
6276 .Ic Type .
6279 .It Ic print
6280 (p) Research
6282 equivalent of
6283 .Ic type .
6286 .It Ic quit
6287 (q) Terminates the session, saving all undeleted, unsaved messages in
6288 the current
6289 .Mx -sx
6290 .Sx "secondary mailbox"
6291 .Ev MBOX ,
6292 preserving all messages marked with
6293 .Ic hold
6295 .Ic preserve
6296 or never referenced in the system
6297 .Va inbox ,
6298 and removing all other messages from the
6299 .Mx -sx
6300 .Sx "primary system mailbox" .
6301 If new mail has arrived during the session,
6302 the message
6303 .Dq You have new mail
6304 will be shown.
6305 If given while editing a mailbox file with the command line option
6306 .Fl f ,
6307 then the edit file is rewritten.
6308 A return to the shell is effected,
6309 unless the rewrite of edit file fails,
6310 in which case the user can escape with the exit command.
6311 The optional status number argument will be passed through to
6312 .Xr exit 3 .
6313 \*(ID For now it can happen that the given status will be overwritten,
6314 later this will only occur if a later error needs to be reported onto an
6315 otherwise success indicating status.
6318 .It Ic read
6319 \*(NQ Read a line from standard input, or the channel set active via
6320 .Ic readctl ,
6321 and assign the data, which will be split as indicated by
6322 .Va ifs ,
6323 to the given variables.
6324 The variable names are checked by the same rules as documented for
6325 .Cm vput ,
6326 and the same error codes will be seen in
6327 .Va \&! ;
6328 the exit status
6329 .Va \&?
6330 indicates the number of bytes read, it will be
6331 .Ql -1
6332 with the error number
6333 .Va \&!
6334 set to
6335 .Va ^ERR Ns -BADF
6336 in case of I/O errors, or
6337 .Va ^ERR Ns -NONE
6338 upon End-Of-File.
6339 If there are more fields than variables, assigns successive fields to the
6340 last given variable.
6341 If there are less fields than variables, assigns the empty string to the
6342 remains.
6343 .Bd -literal -offset indent
6344 ? read a b c
6345    H  e  l  l  o
6346 ? echo "<$a> <$b> <$c>"
6347 <H> <e> <l  l  o>
6348 ? wysh set ifs=:; read a b c;unset ifs
6349 hey2.0,:"'you    ",:world!:mars.:
6350 ? echo $?/$^ERRNAME / <$a><$b><$c>
6351 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
6355 .It Ic readall
6356 \*(NQ Read anything from standard input, or the channel set active via
6357 .Ic readctl ,
6358 and assign the data to the given variable.
6359 The variable name is checked by the same rules as documented for
6360 .Cm vput ,
6361 and the same error codes will be seen in
6362 .Va \&! ;
6363 the exit status
6364 .Va \&?
6365 indicates the number of bytes read, it will be
6366 .Ql -1
6367 with the error number
6368 .Va \&!
6369 set to
6370 .Va ^ERR Ns -BADF
6371 in case of I/O errors, or
6372 .Va ^ERR Ns -NONE
6373 upon End-Of-File.
6374 \*(ID The input data length is restricted to 31-bits.
6377 .It Ic readctl
6378 \*(NQ Manages input channels for
6379 .Ic read
6381 .Ic readall ,
6382 to be used to avoid complicated or impracticable code, like calling
6383 .Ic \&\&read
6384 from within a macro in non-interactive mode.
6385 Without arguments, or when the first argument is
6386 .Cm show ,
6387 a listing of all known channels is printed.
6388 Channels can otherwise be
6389 .Cm create Ns
6390 d, and existing channels can be
6391 .Cm set
6392 active and
6393 .Cm remove Ns
6394 d by giving the string used for creation.
6396 The channel name is expected to be a file descriptor number, or,
6397 if parsing the numeric fails, an input file name that undergoes
6398 .Sx "Filename transformations" .
6399 E.g. (this example requires a modern shell):
6400 .Bd -literal -offset indent
6401 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6402   LC_ALL=C \*(uA -R#
6403 hey, you
6404 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6405   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6406 hey, you
6410 .It Ic remove
6411 Removes the named files or directories.
6412 .Sx "Filename transformations"
6413 including shell pathname wildcard pattern expansions
6414 .Pf ( Xr glob 7 )
6415 are performed on the arguments.
6416 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
6417 type specific removal will be performed, deleting the complete mailbox.
6418 The user is asked for confirmation in interactive mode.
6421 .It Ic rename
6422 Takes the name of an existing folder
6423 and the name for the new folder
6424 and renames the first to the second one.
6425 .Sx "Filename transformations"
6426 including shell pathname wildcard pattern expansions
6427 .Pf ( Xr glob 7 )
6428 are performed on both arguments.
6429 Both folders must be of the same type.
6432 .It Ic Reply
6433 (R) Identical to
6434 .Ic reply
6435 except that it replies to only the sender of each message of the given
6436 list, by using the first message as the template to quote, for the
6437 .Ql Subject:
6438 etc.; setting
6439 .Va flipr
6440 will exchange this command with
6441 .Ic reply .
6444 .It Ic reply
6445 (r) Take a message and group-responds to it by addressing the sender
6446 and all recipients, subject to
6447 .Ic alternates
6448 processing.
6449 .Va followup-to ,
6450 .Va followup-to-honour ,
6451 .Va reply-to-honour
6452 as well as
6453 .Va recipients-in-cc
6454 influence response behaviour.
6455 Unless the internal variable
6456 .Va fullnames
6457 is set recipient addresses will be stripped from comments, names etc.
6458 .Va quote
6459 as well as
6460 .Va quote-as-attachment
6461 configure whether responded-to message shall be quoted etc.; setting
6462 .Va flipr
6463 will exchange this command with
6464 .Ic Reply .
6465 The command
6466 .Ic Lreply
6467 offers special support for replying to mailing lists.
6468 For more documentation please refer to
6469 .Sx "On sending mail, and non-interactive mode" .
6471 This may generate the errors
6472 .Va ^ERR Ns -DESTADDRREQ
6473 if no receiver has been specified,
6474 .Va ^ERR Ns -PERM
6475 if some addressees where rejected by
6476 .Va expandaddr ,
6477 .Va ^ERR Ns -NODATA
6478 if no applicable messages have been given,
6479 .Va ^ERR Ns -IO
6480 if an I/O error occurs,
6481 .Va ^ERR Ns -NOTSUP
6482 if a necessary character set conversion fails, and
6483 .Va ^ERR Ns -INVAL
6484 for other errors.
6485 Occurrence of some of the errors depend on the value of
6486 .Va expandaddr .
6487 Any error stops processing of further messages.
6490 .It Ic replyall
6491 Similar to
6492 .Ic reply ,
6493 but initiates a group-reply regardless of the value of
6494 .Va flipr .
6497 .It Ic replysender
6498 Similar to
6499 .Ic Reply ,
6500 but responds to the sender only regardless of the value of
6501 .Va flipr .
6504 .It Ic Resend
6505 Like
6506 .Ic resend ,
6507 but does not add any header lines.
6508 This is not a way to hide the sender's identity,
6509 but useful for sending a message again to the same recipients.
6512 .It Ic resend
6513 Takes a list of messages and a user name
6514 and sends each message to the named user.
6515 .Ql Resent-From:
6516 and related header fields are prepended to the new copy of the message.
6517 Saving in
6518 .Va record
6519 is only performed if
6520 .Va record-resent
6521 is set.
6523 This may generate the errors
6524 .Va ^ERR Ns -DESTADDRREQ
6525 if no receiver has been specified,
6526 .Va ^ERR Ns -PERM
6527 if some addressees where rejected by
6528 .Va expandaddr ,
6529 .Va ^ERR Ns -NODATA
6530 if no applicable messages have been given,
6531 .Va ^ERR Ns -IO
6532 if an I/O error occurs,
6533 .Va ^ERR Ns -NOTSUP
6534 if a necessary character set conversion fails, and
6535 .Va ^ERR Ns -INVAL
6536 for other errors.
6537 Occurrence of some of the errors depend on the value of
6538 .Va expandaddr .
6539 Any error stops processing of further messages.
6542 .It Ic Respond
6543 Same as
6544 .Ic Reply .
6547 .It Ic respond
6548 Same as
6549 .Ic reply .
6552 .It Ic respondall
6553 Same as
6554 .Ic replyall .
6557 .It Ic respondsender
6558 Same as
6559 .Ic replysender .
6562 .It Ic retain
6563 (ret) Superseded by the multiplexer
6564 .Ic headerpick .
6567 .It Ic return
6568 Only available inside the scope of a
6569 .Ic define Ns
6570 d macro or an
6571 .Ic account ,
6572 this will stop evaluation of any further macro content, and return
6573 execution control to the caller.
6574 The two optional parameters must be specified as positive decimal
6575 numbers and default to the value 0:
6576 the first argument specifies the signed 32-bit return value (stored in
6577 .Va \&?
6578 \*(ID and later extended to signed 64-bit),
6579 the second the signed 32-bit error number (stored in
6580 .Va \&! ) .
6581 As documented for
6582 .Va \&?
6583 a non-0 exit status may cause the program to exit.
6586 .It Ic Save
6587 (S) Similar to
6588 .Ic save,
6589 but saves the messages in a file named after the local part of the
6590 sender of the first message instead of (in
6591 .Va record
6592 and) taking a filename argument; the variable
6593 .Va outfolder
6594 is inspected to decide on the actual storage location.
6597 .It Ic save
6598 (s) Takes a message list and a filename and appends each message in turn
6599 to the end of the file.
6600 .Sx "Filename transformations"
6601 including shell pathname wildcard pattern expansions
6602 .Pf ( Xr glob 7 )
6603 is performed on the filename.
6604 If no filename is given, the
6605 .Mx -sx
6606 .Sx "secondary mailbox"
6607 .Ev MBOX
6608 is used.
6609 The filename in quotes, followed by the generated character count
6610 is echoed on the user's terminal.
6611 If editing a
6612 .Mx -sx
6613 .Sx "primary system mailbox"
6614 the messages are marked for deletion.
6615 .Sx "Filename transformations"
6616 will be applied.
6617 To filter the saved header fields to the desired subset use the
6618 .Ql save
6619 slot of the white- and blacklisting command
6620 .Ic headerpick .
6622 .It Ic savediscard
6623 \*(OB Superseded by the multiplexer
6624 .Ic headerpick .
6626 .It Ic saveignore
6627 \*(OB Superseded by the multiplexer
6628 .Ic headerpick .
6630 .It Ic saveretain
6631 \*(OB Superseded by the multiplexer
6632 .Ic headerpick .
6635 .It Ic search
6636 Takes a message specification (list) and displays a header summary of
6637 all matching messages, as via
6638 .Ic headers .
6639 This command is an alias of
6640 .Ic from .
6641 Also see
6642 .Sx "Specifying messages" .
6645 .It Ic seen
6646 Takes a message list and marks all messages as having been read.
6651 .It Ic set , unset
6652 (se, \*(NQ uns) The latter command will delete all given global
6653 variables, or only block-scope local ones if the
6654 .Cm local
6655 command modifier has been used.
6656 The former, when used without arguments, will show all
6657 currently known variables, being more verbose if either of
6658 .Va debug
6660 .Va verbose
6661 is set.
6662 Remarks: this list mode will not automatically link-in known
6663 .Sx ENVIRONMENT
6664 variables, but only explicit addressing will, e.g., via
6665 .Ic varshow ,
6666 using a variable in an
6667 .Ic if
6668 condition or a string passed to
6669 .Ic echo ,
6670 explicit
6671 .Ic \&\&set Ns
6672 ting, as well as some program-internal use cases.
6675 Otherwise the given variables (and arguments) are set or adjusted.
6676 Arguments are of the form
6677 .Ql name=value
6678 (no space before or after
6679 .Ql = ) ,
6680 or plain
6681 .Ql name
6682 if there is no value, i.e., a boolean variable.
6683 If a name begins with
6684 .Ql no ,
6685 as in
6686 .Ql set nosave ,
6687 the effect is the same as invoking the
6688 .Ic \&\&unset
6689 command with the remaining part of the variable
6690 .Pf ( Ql unset save ) .
6691 \*(ID In conjunction with the
6692 .Cm wysh
6693 .Pf (or\0 Cm local )
6694 command prefix(es)
6695 .Sx "Shell-style argument quoting"
6696 can be used to quote arguments as necessary.
6697 \*(ID Otherwise quotation marks may be placed around any part of the
6698 assignment statement to quote blanks or tabs.
6701 When operating in global scope any
6702 .Ql name
6703 that is known to map to an environment variable will automatically cause
6704 updates in the program environment (unsetting a variable in the
6705 environment requires corresponding system support) \(em use the command
6706 .Ic environ
6707 for further environmental control.
6708 If the command modifier
6709 .Cm local
6710 has been used to alter the command to work in block-scope all variables
6711 have values (may they be empty), and creation of names which shadow
6712 .Sx "INTERNAL VARIABLES"
6713 is actively prevented (\*(ID shadowing of linked
6714 .Sx ENVIRONMENT
6715 variables and free-form versions of variable chains is not yet detected).
6716 Also see
6717 .Ic varshow
6718 and the sections
6719 .Sx "INTERNAL VARIABLES"
6721 .Sx ENVIRONMENT .
6723 .Bd -literal -offset indent
6724 ? wysh set indentprefix=' -> '
6725 ? wysh set atab=$'\t' aspace=' ' zero=0
6730 .It Ic shcodec
6731 Apply shell quoting rules to the given raw-data arguments.
6732 Supports
6733 .Cm vput
6734 (see
6735 .Sx "Command modifiers" ) .
6736 The first argument specifies the operation:
6737 .Ar [+]e[ncode]
6739 .Ar d[ecode]
6740 cause shell quoting to be applied to the remains of the line, and
6741 expanded away thereof, respectively.
6742 If the former is prefixed with a plus-sign, the quoted result will not
6743 be roundtrip enabled, and thus can be decoded only in the very same
6744 environment that was used to perform the encode; also see
6745 .Cd mle-quote-rndtrip .
6746 If the coding operation fails the error number
6747 .Va \&!
6748 is set to
6749 .Va ^ERR Ns -CANCELED ,
6750 and the unmodified input is used as the result; the error number may
6751 change again due to output or result storage errors.
6754 .It Ic shell
6755 \*(NQ (sh) Invokes an interactive version of the shell,
6756 and returns its exit status.
6760 .It Ic shortcut , unshortcut
6761 Without arguments the list of all currently defined shortcuts is
6762 shown, with one argument the expansion of the given shortcut.
6763 Otherwise all given arguments are treated as pairs of shortcuts and
6764 their expansions, creating new or changing already existing shortcuts,
6765 as necessary.
6766 The latter command will remove all given shortcuts, the special name
6767 .Ql *
6768 will remove all registered shortcuts.
6771 .It Ic shift
6772 \*(NQ Shift the positional parameter stack (starting at
6773 .Va 1 )
6774 by the given number (which must be a positive decimal),
6775 or 1 if no argument has been given.
6776 It is an error if the value exceeds the number of positional parameters.
6777 If the given number is 0, no action is performed, successfully.
6778 The stack as such can be managed via
6779 .Ic vpospar .
6780 Note this command will fail in
6781 .Ic account
6782 and hook macros unless the positional parameter stack has been
6783 explicitly created in the current context via
6784 .Ic vpospar .
6787 .It Ic show
6788 Like
6789 .Ic type ,
6790 but performs neither MIME decoding nor decryption, so that the raw
6791 message text is shown.
6794 .It Ic size
6795 (si) Shows the size in characters of each message of the given
6796 message-list.
6799 .It Ic sleep
6800 \*(NQ Sleep for the specified number of seconds (and optionally
6801 milliseconds), by default interruptable.
6802 If a third argument is given the sleep will be uninterruptible,
6803 otherwise the error number
6804 .Va \&!
6805 will be set to
6806 .Va ^ERR Ns -INTR
6807 if the sleep has been interrupted.
6808 The command will fail and the error number will be
6809 .Va ^ERR Ns -OVERFLOW
6810 if the given duration(s) overflow the time datatype, and
6811 .Va ^ERR Ns -INVAL
6812 if the given durations are no valid integers.
6817 .It Ic sort , unsort
6818 The latter command disables sorted or threaded mode, returns to normal
6819 message order and, if the
6820 .Va header
6821 variable is set,
6822 displays a header summary.
6823 The former command shows the current sorting criterion when used without
6824 an argument, but creates a sorted representation of the current folder
6825 otherwise, and changes the
6826 .Ic next
6827 command and the addressing modes such that they refer to messages in
6828 the sorted order.
6829 Message numbers are the same as in regular mode.
6830 If the
6831 .Va header
6832 variable is set,
6833 a header summary in the new order is also displayed.
6834 Automatic folder sorting can be enabled by setting the
6835 .Va autosort
6836 variable, as in, e.g.,
6837 .Ql set autosort=thread .
6838 Possible sorting criterions are:
6841 .Bl -tag -compact -width "subject"
6842 .It Ar date
6843 Sort the messages by their
6844 .Ql Date:
6845 field, that is by the time they were sent.
6846 .It Ar from
6847 Sort messages by the value of their
6848 .Ql From:
6849 field, that is by the address of the sender.
6850 If the
6851 .Va showname
6852 variable is set, the sender's real name (if any) is used.
6853 .It Ar size
6854 Sort the messages by their size.
6855 .It spam
6856 \*(OP Sort the message by their spam score, as has been classified by
6857 .Ic spamrate .
6858 .It Ar status
6859 Sort the messages by their message status.
6860 .It Ar subject
6861 Sort the messages by their subject.
6862 .It Ar thread
6863 Create a threaded display.
6864 .It Ar to
6865 Sort messages by the value of their
6866 .Ql To:
6867 field, that is by the address of the recipient.
6868 If the
6869 .Va showname
6870 variable is set, the recipient's real name (if any) is used.
6875 .It Ic source
6876 \*(NQ (so) The source command reads commands from the given file.
6877 .Sx "Filename transformations"
6878 will be applied.
6879 If the given expanded argument ends with a vertical bar
6880 .Ql |
6881 then the argument will instead be interpreted as a shell command and
6882 \*(UA will read the output generated by it.
6883 Dependent on the settings of
6884 .Va posix
6886 .Va errexit ,
6887 and also dependent on whether the command modifier
6888 .Cm ignerr
6889 had been used, encountering errors will stop sourcing of the given input.
6890 \*(ID Note that
6891 .Ic \&\&source
6892 cannot be used from within macros that execute as
6893 .Va folder-hook Ns s
6895 .Ic account Ns s ,
6896 i.e., it can only be called from macros that were
6897 .Ic call Ns ed .
6900 .It Ic source_if
6901 \*(NQ The difference to
6902 .Ic source
6903 (beside not supporting pipe syntax aka shell command input) is that
6904 this command will not generate an error nor warn if the given file
6905 argument cannot be opened successfully.
6908 .It Ic spamclear
6909 \*(OP Takes a list of messages and clears their
6910 .Ql is-spam
6911 flag.
6914 .It Ic spamforget
6915 \*(OP Takes a list of messages and causes the
6916 .Va spam-interface
6917 to forget it has ever used them to train its Bayesian filter.
6918 Unless otherwise noted the
6919 .Ql is-spam
6920 flag of the message is inspected to chose whether a message shall be
6921 forgotten to be
6922 .Dq ham
6924 .Dq spam .
6927 .It Ic spamham
6928 \*(OP Takes a list of messages and informs the Bayesian filter of the
6929 .Va spam-interface
6930 that they are
6931 .Dq ham .
6932 This also clears the
6933 .Ql is-spam
6934 flag of the messages in question.
6937 .It Ic spamrate
6938 \*(OP Takes a list of messages and rates them using the configured
6939 .Va spam-interface ,
6940 without modifying the messages, but setting their
6941 .Ql is-spam
6942 flag as appropriate; because the spam rating headers are lost the rate
6943 will be forgotten once the mailbox is left.
6944 Refer to the manual section
6945 .Sx "Handling spam"
6946 for the complete picture of spam handling in \*(UA.
6949 .It Ic spamset
6950 \*(OP Takes a list of messages and sets their
6951 .Ql is-spam
6952 flag.
6955 .It Ic spamspam
6956 \*(OP Takes a list of messages and informs the Bayesian filter of the
6957 .Va spam-interface
6958 that they are
6959 .Dq spam .
6960 This also sets the
6961 .Ql is-spam
6962 flag of the messages in question.
6964 .It Ic thread
6965 \*(OB The same as
6966 .Ql sort thread
6967 (consider using a
6968 .Ql commandalias
6969 as necessary).
6973 .It Ic tls
6974 \*(NQ TLS information and management command multiplexer to aid in
6975 .Sx "Encrypted network communication" .
6976 Commands support
6977 .Cm vput
6978 if so documented (see
6979 .Sx "Command modifiers" ) .
6980 The result that is shown in case of errors is always the empty string,
6981 errors can be identified via the error number
6982 .Va \&! .
6983 For example, string length overflows are caught and set
6984 .Va \&!
6986 .Va ^ERR Ns -OVERFLOW .
6987 Note this command of course honours the overall TLS configuration.
6988 .Bd -literal -offset indent
6989 ? vput tls result fingerprint pop3s://ex.am.ple
6990 ? echo $?/$!/$^ERRNAME: $result
6993 .Bl -hang -width ".It Cm random"
6994 .It Cm fingerprint
6995 Show the
6996 .Va tls-fingerprint-digest Ns
6997 ed fingerprint of the certificate of the given HOST
6998 .Pf ( Ql server:port ,
6999 where the port defaults to the HTTPS port, 443).
7000 .Va tls-fingerprint
7001 is actively ignored for the runtime of this command.
7002 Only available if the term
7003 .Ql +sockets
7004 is included in
7005 .Va features .
7010 .It Ic Top
7011 Like
7012 .Ic top
7013 but always uses the
7014 .Ic headerpick
7015 .Ql type
7016 slot for white- and blacklisting header fields.
7019 .It Ic top
7020 (to) Takes a message list and types out the first
7021 .Va toplines
7022 lines of each message on the user's terminal.
7023 Unless a special selection has been established for the
7024 .Ql top
7025 slot of the
7026 .Ic headerpick
7027 command, the only header fields that are displayed are
7028 .Ql From: ,
7029 .Ql To: ,
7030 .Ql CC: ,
7032 .Ql Subject: .
7033 .Ic Top
7034 will always use the
7035 .Ql type
7036 .Ic headerpick
7037 selection instead.
7038 It is possible to apply compression to what is displayed by setting
7039 .Va topsqueeze .
7040 Messages are decrypted and converted to the terminal character set
7041 if necessary.
7044 .It Ic touch
7045 (tou) Takes a message list and marks the messages for saving in the
7046 .Mx -sx
7047 .Sx "secondary mailbox"
7048 .Ev MBOX .
7049 \*(UA deviates from the POSIX standard with this command,
7050 as a following
7051 .Ic next
7052 command will display the following message instead of the current one.
7055 .It Ic Type
7056 (T) Like
7057 .Ic type
7058 but also displays header fields which would not pass the
7059 .Ic headerpick
7060 selection, and all visualizable parts of MIME
7061 .Ql multipart/alternative
7062 messages.
7065 .It Ic type
7066 (t) Takes a message list and types out each message on the user's terminal.
7067 The display of message headers is selectable via
7068 .Ic headerpick .
7069 For MIME multipart messages, all parts with a content type of
7070 .Ql text ,
7071 all parts which have a registered MIME type handler (see
7072 .Sx "HTML mail and MIME attachments" )
7073 which produces plain text output, and all
7074 .Ql message
7075 parts are shown, others are hidden except for their headers.
7076 Messages are decrypted and converted to the terminal character set
7077 if necessary.
7078 The command
7079 .Ic mimeview
7080 can be used to display parts which are not displayable as plain text.
7082 .It Ic unaccount
7084 .Ic account .
7086 .It Ic unalias
7087 (una) See
7088 .Ic alias .
7090 .It Ic unanswered
7092 .Ic answered .
7094 .It Ic unbind
7096 .Ic bind .
7098 .It Ic uncollapse
7100 .Ic collapse .
7102 .It Ic uncolour
7104 .Ic colour .
7106 .It Ic undefine
7108 .Ic define .
7110 .It Ic undelete
7112 .Ic delete .
7114 .It Ic undraft
7116 .Ic draft .
7118 .It Ic unflag
7120 .Ic flag .
7122 .It Ic unfwdignore
7123 \*(OB Superseded by the multiplexer
7124 .Ic headerpick .
7126 .It Ic unfwdretain
7127 \*(OB Superseded by the multiplexer
7128 .Ic headerpick .
7131 .It Ic unignore
7132 Superseded by the multiplexer
7133 .Ic headerpick .
7135 .It Ic unmimetype
7137 .Ic mimetype .
7139 .It Ic unmlist
7141 .Ic mlist .
7143 .It Ic unmlsubscribe
7145 .Ic mlsubscribe .
7148 .It Ic Unread
7149 Same as
7150 .Ic unread .
7153 .It Ic unread
7154 Takes a message list and marks each message as not having been read.
7157 .It Ic unretain
7158 Superseded by the multiplexer
7159 .Ic headerpick .
7161 .It Ic unsaveignore
7162 \*(OB Superseded by the multiplexer
7163 .Ic headerpick .
7165 .It Ic unsaveretain
7166 \*(OB Superseded by the multiplexer
7167 .Ic headerpick .
7169 .It Ic unset
7170 \*(NQ (uns) See
7171 .Ic set .
7173 .It Ic unshortcut
7175 .Ic shortcut .
7177 .It Ic unsort
7179 .Ic short .
7181 .It Ic unthread
7182 \*(OB
7183 Same as
7184 .Ic unsort .
7187 .It Ic urlcodec
7188 Perform URL percent codec operations on the raw-data argument, rather
7189 according to RFC 3986.
7190 Supports
7191 .Cm vput
7192 (see
7193 .Sx "Command modifiers" ) ,
7194 and manages the error number
7195 .Va \&! .
7196 This is a character set agnostic and thus locale dependent operation,
7197 and it may decode bytes which are invalid in the current
7198 .Va ttycharset .
7199 \*(ID This command does not know about URLs beside that.
7201 The first argument specifies the operation:
7202 .Ar e[ncode]
7204 .Ar d[ecode]
7205 perform plain URL percent en- and decoding, respectively.
7206 .Ar p[ath]enc[ode]
7208 .Ar p[ath]dec[ode]
7209 perform a slightly modified operation which should be better for
7210 pathnames: it does not allow a tilde
7211 .Ql ~ ,
7212 and will neither accept hyphen-minus
7213 .Ql -
7214 nor dot
7215 .Ql .
7216 as an initial character.
7217 The remains of the line form the URL data which is to be converted.
7218 If the coding operation fails the error number
7219 .Va \&!
7220 is set to
7221 .Va ^ERR Ns -CANCELED ,
7222 and the unmodified input is used as the result; the error number may
7223 change again due to output or result storage errors.
7226 .It Ic varshow
7227 \*(NQ This command produces the same output as the listing mode of
7228 .Ic set ,
7229 including
7230 .Va verbose Ns
7231 ity adjustments, but only for the given variables.
7234 .It Ic verify
7235 \*(OP Takes a message list and verifies each message.
7236 If a message is not a S/MIME signed message,
7237 verification will fail for it.
7238 The verification process checks if the message was signed using a valid
7239 certificate,
7240 if the message sender's email address matches one of those contained
7241 within the certificate,
7242 and if the message content has been altered.
7245 .It Ic version
7246 Shows the
7247 .Va version
7249 .Va features
7250 of \*(UA, as well as the build and running system environment.
7251 This command can produce a more
7252 .Va verbose
7253 output, and supports
7254 .Cm vput
7255 (see
7256 .Sx "Command modifiers" ) .
7260 .It Ic vexpr
7261 \*(NQ Evaluate arguments according to a given operator.
7262 This is a multiplexer command which can be used to perform signed 64-bit
7263 numeric calculations as well as byte string and string operations.
7264 It uses polish notation, i.e., the operator is the first argument and
7265 defines the number and type, and the meaning of the remaining arguments.
7266 An empty argument is replaced with a 0 if a number is expected.
7267 Supports
7268 .Cm vput
7269 (see
7270 .Sx "Command modifiers" ) .
7273 The result that is shown in case of errors is always
7274 .Ql -1
7275 for usage errors and numeric operations, and the empty string for byte
7276 string and string operations;
7277 if the latter two fail to provide result data for
7278 .Dq soft
7279 errors, e.g., when a search operation failed, they also set the
7280 .Va \&!
7281 error number to
7282 .Va ^ERR Ns -NODATA .
7283 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7284 numbers, and errors will be reported in the error number
7285 .Va \&!
7286 as the numeric error
7287 .Va ^ERR Ns -RANGE .
7290 Numeric operations work on one or two signed 64-bit integers.
7291 Numbers prefixed with
7292 .Ql 0x
7294 .Ql 0X
7295 are interpreted as hexadecimal (base 16) numbers, whereas
7296 .Ql 0
7297 indicates octal (base 8), and
7298 .Ql 0b
7299 as well as
7300 .Ql 0B
7301 denote binary (base 2) numbers.
7302 It is possible to use any base in between 2 and 36, inclusive, with the
7303 .Ql BASE#number
7304 notation, where the base is given as an unsigned decimal number, e.g.,
7305 .Ql 16#AFFE
7306 is a different way of specifying a hexadecimal number.
7307 Unsigned interpretation of a number can be enforced by prefixing an
7308 .Ql u
7309 (case-insensitively), e.g.,
7310 .Ql u-110 ;
7311 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7312 which will be interpreted as unsigned by default, but it still makes
7313 a difference regarding overflow detection and overflow constant.
7314 It is possible to enforce signed interpretation by (instead) prefixing a
7315 .Ql s
7316 (case-insensitively).
7319 One integer is expected by assignment (equals sign
7320 .Ql = ) ,
7321 which does nothing but parsing the argument, thus detecting validity and
7322 possible overflow conditions, and unary not (tilde
7323 .Ql ~ ) ,
7324 which creates the bitwise complement.
7325 Two integers are used by addition (plus sign
7326 .Ql + ) ,
7327 subtraction (hyphen-minus
7328 .Ql - ) ,
7329 multiplication (asterisk
7330 .Ql * ) ,
7331 division (solidus
7332 .Ql / )
7333 and modulo (percent sign
7334 .Ql % ) ,
7335 as well as for the bitwise operators logical or (vertical bar
7336 .Ql | ,
7337 to be quoted) ,
7338 bitwise and (ampersand
7339 .Ql \&& ,
7340 to be quoted) ,
7341 bitwise xor (circumflex
7342 .Ql ^ ) ,
7343 the bitwise signed left- and right shifts
7344 .Pf ( Ql << ,
7345 .Ql >> ) ,
7346 as well as for the unsigned right shift
7347 .Ql >>> .
7350 Another numeric operation is
7351 .Cm pbase ,
7352 which takes a number base in between 2 and 36, inclusive, and will act
7353 on the second number given just the same as what equals sign
7354 .Ql =
7355 does, but the number result will be formatted in the base given.
7358 All numeric operators can be prefixed with a commercial at
7359 .Ql @ ,
7360 e.g.,
7361 .Ql @* :
7362 this will turn the operation into a saturated one, which means that
7363 overflow errors and division and modulo by zero are no longer reported
7364 via the exit status, but the result will linger at the minimum or
7365 maximum possible value, instead of overflowing (or trapping).
7366 This is true also for the argument parse step.
7367 For the bitwise shifts, the saturated maximum is 63.
7368 Any caught overflow will be reported via the error number
7369 .Va \&!
7371 .Va ^ERR Ns -OVERFLOW .
7372 .Bd -literal -offset indent
7373 ? vexpr @- +1 -9223372036854775808
7374 ? echo $?/$!/$^ERRNAME
7378 Character set agnostic string functions have no notion of locale
7379 settings and character sets.
7381 .Bl -hang -width ".It Cm random"
7382 .It Cm file-expand
7383 Performs the usual
7384 .Sx "Filename transformations"
7385 on its argument.
7386 .It Cm random
7387 Generates a random string of the given length, or of
7388 .Dv \&\&PATH_MAX
7389 bytes (a constant from
7390 .Pa /usr/include )
7391 if the value 0 is given; the random string will be base64url encoded
7392 according to RFC 4648, and thus be usable as a (portable) filename.
7396 Byte string operations work on 8-bit bytes and have no notion of locale
7397 settings and character sets, effectively assuming ASCII data.
7400 .Bl -hang -width ".It Cm length"
7401 .It Cm length
7402 Queries the length of the given argument.
7404 .It Cm hash
7405 Calculates the Chris Torek hash of the given argument.
7407 .It Cm find
7408 Byte-searches in the first for the second argument.
7409 Shows the resulting 0-based offset shall it have been found.
7411 .It Cm ifind
7412 Identical to
7413 .Cm find ,
7414 but works case-insensitively according to the rules of the ASCII
7415 character set.
7417 .It Cm substring
7418 Creates a substring of its first argument.
7419 The second argument is the 0-based starting offset, a negative one
7420 counts from the end;
7421 the optional third argument specifies the length of the desired result,
7422 a negative length leaves off the given number of bytes at the end of the
7423 original string, by default the entire string is used;
7424 this operation tries to work around faulty arguments (set
7425 .Va verbose
7426 for error logs), but reports them via the error number
7427 .Va \&!
7429 .Va ^ERR Ns -OVERFLOW .
7431 .It Cm trim
7432 Trim away whitespace characters from both ends of the argument.
7434 .It Cm trim-front
7435 Trim away whitespace characters from the begin of the argument.
7437 .It Cm trim-end
7438 Trim away whitespace characters from the end of the argument.
7443 String operations work, sufficient support provided, according to the
7444 active user's locale encoding and character set (see
7445 .Sx "Character sets" ) .
7448 .Bl -hang -width ".It Cm regex"
7449 .It Cm makeprint
7450 (One-way) Converts the argument to something safely printable on the
7451 terminal.
7453 .It Cm regex
7454 \*(OP A string operation that will try to match the first argument with
7455 the regular expression given as the second argument.
7456 If the optional third argument has been given then instead of showing
7457 the match offset a replacement operation is performed: the third
7458 argument is treated as if specified within dollar-single-quote (see
7459 .Sx "Shell-style argument quoting" ) ,
7460 and any occurrence of a positional parameter, e.g.,
7461 .Va 1 ,
7462 is replaced by the corresponding match group of the regular expression:
7463 .Bd -literal -offset indent
7464 ? vput vexpr res regex bananarama \e
7465     (.*)NanA(.*) '\e${1}au\e$2'
7466 ? echo $?/$!/$^ERRNAME: $res
7469 .It Cm iregex
7470 On otherwise identical case-insensitive equivalent to
7471 .Cm regex :
7472 .Bd -literal -offset indent
7473 ? vput vexpr res ire bananarama \e
7474     (.*)NanA(.*) '\e${1}au\e$2'
7475 ? echo $?/$!/$^ERRNAME: $res
7481 .It Ic vpospar
7482 \*(NQ Manage the positional parameter stack (see
7483 .Va 1 , # , * , @
7484 as well as
7485 .Ic shift ) .
7486 If the first argument is
7487 .Ql clear ,
7488 then the positional parameter stack of the current context, or the
7489 global one, if there is none, is cleared.
7490 If it is
7491 .Ql set ,
7492 then the remaining arguments will be used to (re)create the stack,
7493 if the parameter stack size limit is excessed an
7494 .Va ^ERR Ns -OVERFLOW
7495 error will occur.
7498 If the first argument is
7499 .Ql quote ,
7500 a round-trip capable representation of the stack contents is created,
7501 with each quoted parameter separated from each other with the first
7502 character of
7503 .Va ifs ,
7504 and followed by the first character of
7505 .Va if-ws ,
7506 if that is not empty and not identical to the first.
7507 If that results in no separation at all a
7508 .Cm space
7509 character is used.
7510 This mode supports
7511 .Cm vput
7512 (see
7513 .Sx "Command modifiers" ) .
7514 I.e., the subcommands
7515 .Ql set
7517 .Ql quote
7518 can be used (in conjunction with
7519 .Ic eval )
7520 to (re)create an argument stack from and to a single variable losslessly.
7522 .Bd -literal -offset indent
7523 ? vpospar set hey, "'you    ", world!
7524 ? echo $#: <${1}><${2}><${3}>
7525 ? vput vpospar x quote
7526 ? vpospar clear
7527 ? echo $#: <${1}><${2}><${3}>
7528 ? eval vpospar set ${x}
7529 ? echo $#: <${1}><${2}><${3}>
7534 .It Ic visual
7535 (v) Takes a message list and invokes the
7536 .Ev VISUAL
7537 display editor on each message.
7538 Modified contents are discarded unless the
7539 .Va writebackedited
7540 variable is set, and are not used unless the mailbox can be written to
7541 and the editor returns a successful exit status.
7542 .Ic edit
7543 can be used instead for a less display oriented editor.
7546 .It Ic write
7547 (w) For conventional messages the body without all headers is written.
7548 The original message is never marked for deletion in the originating
7549 mail folder.
7550 The output is decrypted and converted to its native format as necessary.
7551 If the output file exists, the text is appended.
7552 If a message is in MIME multipart format its first part is written to
7553 the specified file as for conventional messages, handling of the remains
7554 depends on the execution mode.
7555 No special handling of compressed files is performed.
7557 In interactive mode the user is consecutively asked for the filenames of
7558 the processed parts.
7559 For convience saving of each part may be skipped by giving an empty
7560 value, the same result as writing it to
7561 .Pa /dev/null .
7562 Shell piping the part content by specifying a leading vertical bar
7563 .Ql |
7564 character for the filename is supported.
7565 Other user input undergoes the usual
7566 .Sx "Filename transformations" ,
7567 including shell pathname wildcard pattern expansions
7568 .Pf ( Xr glob 7 )
7569 and shell variable expansion for the message as such, not the individual
7570 parts, and contents of the destination file are overwritten if the file
7571 previously existed.
7573 \*(ID In non-interactive mode any part which does not specify a filename
7574 is ignored, and suspicious parts of filenames of the remaining parts are
7575 URL percent encoded (as via
7576 .Ic urlcodec )
7577 to prevent injection of malicious character sequences, resulting in
7578 a filename that will be written into the current directory.
7579 Existing files will not be overwritten, instead the part number or
7580 a dot are appended after a number sign
7581 .Ql #
7582 to the name until file creation succeeds (or fails due to other
7583 reasons).
7586 .It Ic xcall
7587 \*(NQ The sole difference to
7588 .Ic call
7589 is that the new macro is executed in place of the current one, which
7590 will not regain control: all resources of the current macro will be
7591 released first.
7592 This implies that any setting covered by
7593 .Ic localopts
7594 will be forgotten and covered variables will become cleaned up.
7595 If this command is not used from within a
7596 .Ic call Ns
7597 ed macro it will silently be (a more expensive variant of)
7598 .Ic call .
7601 .It Ic xit
7602 (x) A synonym for
7603 .Ic exit .
7606 .It Ic z
7607 \*(NQ \*(UA presents message headers in
7608 .Va screen Ns
7609 fuls as described under the
7610 .Ic headers
7611 command.
7612 Without arguments this command scrolls to the next window of messages,
7613 likewise if the argument is
7614 .Ql + .
7615 An argument of
7616 .Ql -
7617 scrolls to the last,
7618 .Ql ^
7619 scrolls to the first, and
7620 .Ql $
7621 to the last
7622 .Va \&\&screen
7623 of messages.
7624 A number argument prefixed by
7625 .Ql +
7627 .Ql \-
7628 indicates that the window is calculated in relation to the current
7629 position, and a number without a prefix specifies an absolute position.
7632 .It Ic Z
7633 \*(NQ Similar to
7634 .Ic z ,
7635 but scrolls to the next or previous window that contains at least one
7636 .Ql new
7638 .Ic flag Ns
7639 ged message.
7641 .\" }}}
7643 .\" }}}
7646 .\" .Sh COMMAND ESCAPES {{{
7647 .Sh "COMMAND ESCAPES"
7649 Command escapes are available in compose mode, and are used to perform
7650 special functions when composing messages.
7651 Command escapes are only recognized at the beginning of lines, and
7652 consist of a trigger (escape), and a command character.
7653 The actual escape character can be set via the internal variable
7654 .Va escape ,
7655 it defaults to the tilde
7656 .Ql ~ .
7657 Otherwise ignored whitespace characters following the escape character
7658 will prevent a possible addition of the command line to the \*(OPal
7659 history.
7662 Unless otherwise noted all compose mode command escapes ensure proper
7663 updates of the variables which represent the error number
7664 .Va \&!
7665 and the exit status
7666 .Va \&? .
7667 If the variable
7668 .Va errexit
7669 is set they will, unless stated otherwise, error out message compose mode
7670 and cause a program exit if an operation fails;
7671 an effect equivalent to the command modifier
7672 .Cm ignerr
7673 can however be achieved by placing a hyphen-minus
7674 .Ql -
7675 after (possible whitespace following) the escape character.
7676 If the \*(OPal key bindings are available it is possible to create
7677 .Ic bind Ns
7678 ings specifically for the compose mode.
7681 .Bl -tag -width ".It Ic BaNg"
7683 .It Ic ~~ Ar string
7684 Insert the string of text in the message prefaced by a single
7685 .Ql ~ .
7686 (If the escape character has been changed,
7687 that character must be doubled instead.)
7690 .It Ic ~! Ar command
7691 Execute the indicated shell
7692 .Ar command
7693 which follows, replacing unescaped exclamation marks with the previously
7694 executed command if the internal variable
7695 .Va bang
7696 is set, then return to the message.
7699 .It Ic ~.
7700 End compose mode and send the message.
7701 The hooks
7702 .Va on-compose-splice-shell
7704 .Va on-compose-splice ,
7705 in order, will be called when set, after which, in interactive mode
7706 .Va askatend
7707 (leading to
7708 .Va askcc , askbcc )
7710 .Va askattach
7711 will be checked as well as
7712 .Va asksend ,
7713 after which a set
7714 .Va on-compose-leave
7715 hook will be called,
7716 .Va autocc
7718 .Va autobcc
7719 will be joined in if set,
7720 finally a given
7721 .Va message-inject-tail
7722 will be incorporated, after which the compose mode is left.
7725 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
7726 Execute the given \*(UA command.
7727 Not all commands, however, are allowed.
7730 .It Ic ~< Ar filename
7731 Identical to
7732 .Ic ~r .
7735 .It Ic ~<! Ar command
7736 .Ar command
7737 is executed using the shell.
7738 Its standard output is inserted into the message.
7741 .It Ic ~?
7742 \*(OP Write a summary of command escapes.
7745 .It Ic ~@ Op Ar filename...
7746 Append or edit the list of attachments.
7747 Does not manage the error number
7748 .Va \&!
7749 and the exit status
7750 .Va \&?
7751 (please use
7752 .Ic ~^
7753 instead if this is a concern).
7754 The append mode expects a list of
7755 .Ar filename
7756 arguments as shell tokens (see
7757 .Sx "Shell-style argument quoting" ;
7758 token-separating commas are ignored, too), to be
7759 interpreted as documented for the command line option
7760 .Fl a ,
7761 with the message number exception as below.
7763 Without
7764 .Ar filename
7765 arguments the attachment list is edited, entry by entry;
7766 if a filename is left empty, that attachment is deleted from the list;
7767 once the end of the list is reached either new attachments may be
7768 entered or the session can be quit by committing an empty
7769 .Dq new
7770 attachment.
7771 In non-interactive mode or in batch mode
7772 .Pf ( Fl # )
7773 the list of attachments is effectively not edited but instead recreated;
7774 again, an empty input ends list creation.
7776 For all modes, if a given filename solely consists of the number sign
7777 .Ql #
7778 followed by either a valid message number of the currently active
7779 mailbox, or by a period
7780 .Ql \&. ,
7781 referring to the current message of the active mailbox, the so-called
7782 .Dq dot ,
7783 then the given message is attached as a
7784 .Ql message/rfc822
7785 MIME message part.
7786 The number sign must be quoted to avoid misinterpretation with the shell
7787 comment character.
7790 .It Ic ~| Ar command
7791 Pipe the message text through the specified filter command.
7792 If the command gives no output or terminates abnormally,
7793 retain the original text of the message.
7794 E.g., the command
7795 .Xr fmt 1
7796 is often used as a rejustifying filter.
7798 If the first character of the command is a vertical bar, then the entire
7799 message including header fields is subject to the filter command, e.g.,
7800 .Ql ~|| echo Fcc: /tmp/test; cat
7801 will prepend a file-carbon-copy message header.
7802 Also see
7803 .Ic ~e , ~v .
7807 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7808 Low-level compose mode command which shares semantic with
7809 .Ic digmsg .
7810 In general the first field of a response line represents a status code
7811 which specifies whether a command was successful or not, whether result
7812 data is to be expected, and if, the format of the result data.
7813 Does not manage the error number
7814 .Va \&!
7815 and the exit status
7816 .Va \&? ,
7817 because errors are reported via the protocol
7818 (hard errors like I/O failures cannot be handled).
7821 This command has read-only access to several virtual pseudo headers in
7822 the \*(UA private namespace which optionally (except for the
7823 non-optional first) exist in compose mode:
7827 .Bl -tag -compact -width ".It Va BaNg"
7828 .It Ql Mailx-Command:
7829 The name of the command that generates the message, one of
7830 .Ql forward ,
7831 .Ql Lreply ,
7832 .Ql mail ,
7833 .Ql Reply ,
7834 .Ql reply ,
7835 .Ql resend .
7837 .It Ql Mailx-Raw-To:
7838 .It Ql Mailx-Raw-Cc:
7839 .It Ql Mailx-Raw-Bcc:
7840 Represent the frozen initial state of these headers before any
7841 transformation (e.g.,
7842 .Ic alias ,
7843 .Ic alternates ,
7844 .Va recipients-in-cc
7845 etc.) took place.
7847 .It Ql Mailx-Orig-From:
7848 .It Ql Mailx-Orig-To:
7849 .It Ql Mailx-Orig-Cc:
7850 .It Ql Mailx-Orig-Bcc:
7851 The values of said headers of the original message which has been
7852 addressed by any of
7853 .Ic reply , forward , resend .
7858 Error status code lines may optionally contain additional context.
7859 The status codes are:
7863 .Bl -tag -compact -width ".It Ql 210"
7864 .It Ql 210
7865 Status ok; the remains of the line are the result.
7867 .It Ql 211
7868 Status ok; the rest of the line is optionally used for more status.
7869 What follows are lines of result addresses, terminated by an empty line.
7870 The address lines consist of two fields, the first of which is the
7871 plain address, e.g.,
7872 .Ql bob@exam.ple ,
7873 separated by a single ASCII SP space from the second which contains the
7874 unstripped address, even if that is identical to the first field, e.g.,
7875 .Ql (Lovely) Bob <bob@exam.ple> .
7876 Non-network addressees, however, place a single-letter indicating
7877 the address type in the first field (hyphen-minus
7878 .Ql -
7879 for files, vertical bar
7880 .Ql |
7881 for pipes, and number sign
7882 .Ql #
7883 for names: what is supposed to become expanded via
7884 .Ic alias Ns
7885 ), and only the second field contains a value.
7886 All the input, including the empty line, must be consumed before further
7887 commands can be issued.
7889 .It Ql 212
7890 Status ok; the rest of the line is optionally used for more status.
7891 What follows are lines of furtherly unspecified string content,
7892 terminated by an empty line.
7893 All the input, including the empty line, must be consumed before further
7894 commands can be issued.
7896 .It Ql 500
7897 Syntax error; invalid command.
7899 .It Ql 501
7900 Syntax error in parameters or arguments.
7902 .It Ql 505
7903 Error: an argument fails verification.
7904 For example an invalid address has been specified (also see
7905 .Va expandaddr ) ,
7906 or an attempt was made to modify anything in \*(UA's own namespace,
7907 or a modifying subcommand has been used on a read-only message.
7909 .It Ql 506
7910 Error: an otherwise valid argument is rendered invalid due to context.
7911 For example, a second address is added to a header which may consist of
7912 a single address only.
7917 If a command indicates failure then the message will have remained
7918 unmodified.
7919 Most commands can fail with
7920 .Ql 500
7921 if required arguments are missing (false command usage).
7922 The following (case-insensitive) commands are supported:
7925 .Bl -hang -width ".It Cm version"
7926 .It Cm version
7927 This command will print the protocol version via 210.
7929 .It Cm header
7930 This command allows listing, inspection, and editing of message headers.
7931 Header name case is not normalized, and case-insensitive comparison
7932 should be used when matching names.
7933 The second argument specifies the subcommand to apply, one of:
7935 .Bl -hang -width ".It Cm remove"
7936 .It Cm list
7937 Without a third argument a list of all yet existing headers is given via
7938 .Ql 210 ;
7939 this command is the default command of
7940 .Cm header
7941 if no second argument has been given.
7942 A third argument restricts output to the given header only, which may
7943 fail with
7944 .Ql 501
7945 if no such field is defined.
7947 .It Cm show
7948 Shows the content of the header given as the third argument.
7949 Dependent on the header type this may respond with
7950 .Ql 211
7952 .Ql 212 ;
7953 any failure results in
7954 .Ql 501 .
7956 .It Cm remove
7957 This will remove all instances of the header given as the third
7958 argument, reporting
7959 .Ql 210
7960 upon success,
7961 .Ql 501
7962 if no such header can be found, and
7963 Ql 505
7964 on \*(UA namespace violations.
7966 .It Cm remove-at
7967 This will remove from the header given as the third argument the
7968 instance at the list position (counting from one!) given with the fourth
7969 argument, reporting
7970 .Ql 210
7971 upon success or
7972 .Ql 505
7973 if the list position argument is not a number or on \*(UA namespace
7974 violations, and
7975 .Ql 501
7976 if no such header instance exists.
7978 .It Cm insert
7979 Create a new or an additional instance of the header given in the third
7980 argument, with the header body content as given in the fourth argument
7981 (the remains of the line).
7982 It may return
7983 .Ql 501
7984 if the third argument specifies a free-form header field name that is
7985 invalid, or if body content extraction fails to succeed,
7986 .Ql 505
7987 if any extracted address does not pass syntax and/or security checks or
7988 on \*(UA namespace violations, and
7989 .Ql 506
7990 to indicate prevention of excessing a single-instance header \(em note that
7991 .Ql Subject:
7992 can be appended to (a space separator will be added automatically first).
7994 .Ql 210
7995 is returned upon success, followed by the name of the header and the list
7996 position of the newly inserted instance.
7997 The list position is always 1 for single-instance header fields.
7998 All free-form header fields are managed in a single list.
8002 .It Cm attachment
8003 This command allows listing, removal and addition of message attachments.
8004 The second argument specifies the subcommand to apply, one of:
8006 .Bl -hang -width ".It Cm remove"
8007 .It Cm list
8008 List all attachments via
8009 .Ql 212 ,
8010 or report
8011 .Ql 501
8012 if no attachments exist.
8013 This command is the default command of
8014 .Cm attachment
8015 if no second argument has been given.
8017 .It Cm remove
8018 This will remove the attachment given as the third argument, and report
8019 .Ql 210
8020 upon success or
8021 .Ql 501
8022 if no such attachment can be found.
8023 If there exists any path component in the given argument, then an exact
8024 match of the path which has been used to create the attachment is used
8025 directly, but if only the basename of that path matches then all
8026 attachments are traversed to find an exact match first, and the removal
8027 occurs afterwards; if multiple basenames match, a
8028 .Ql 506
8029 error occurs.
8030 Message attachments are treated as absolute pathnames.
8032 If no path component exists in the given argument, then all attachments
8033 will be searched for
8034 .Ql filename=
8035 parameter matches as well as for matches of the basename of the path
8036 which has been used when the attachment has been created; multiple
8037 matches result in a
8038 .Ql 506 .
8040 .It Cm remove-at
8041 This will interpret the third argument as a number and remove the
8042 attachment at that list position (counting from one!), reporting
8043 .Ql 210
8044 upon success or
8045 .Ql 505
8046 if the argument is not a number or
8047 .Ql 501
8048 if no such attachment exists.
8050 .It Cm insert
8051 Adds the attachment given as the third argument, specified exactly as
8052 documented for the command line option
8053 .Fl a ,
8054 and supporting the message number extension as documented for
8055 .Ic ~@ .
8056 This reports
8057 .Ql 210
8058 upon success, with the index of the new attachment following,
8059 .Ql 505
8060 if the given file cannot be opened,
8061 .Ql 506
8062 if an on-the-fly performed character set conversion fails, otherwise
8063 .Ql 501
8064 is reported; this is also reported if character set conversion is
8065 requested but not available.
8067 .It Cm attribute
8068 This uses the same search mechanism as described for
8069 .Cm remove
8070 and prints any known attributes of the first found attachment via
8071 .Ql 212
8072 upon success or
8073 .Ql 501
8074 if no such attachment can be found.
8075 The attributes are written as lines of keyword and value tuples, the
8076 keyword being separated from the rest of the line with an ASCII SP space
8077 character.
8079 .It Cm attribute-at
8080 This uses the same search mechanism as described for
8081 .Cm remove-at
8082 and is otherwise identical to
8083 .Cm attribute .
8085 .It Cm attribute-set
8086 This uses the same search mechanism as described for
8087 .Cm remove ,
8088 and will assign the attribute given as the fourth argument, which is
8089 expected to be a value tuple of keyword and other data, separated by
8090 a ASCII SP space or TAB tabulator character.
8091 If the value part is empty, then the given attribute is removed, or
8092 reset to a default value if existence of the attribute is crucial.
8094 It returns via
8095 .Ql 210
8096 upon success, with the index of the found attachment following,
8097 .Ql 505
8098 for message attachments or if the given keyword is invalid, and
8099 .Ql 501
8100 if no such attachment can be found.
8101 The following keywords may be used (case-insensitively):
8103 .Bl -hang -compact -width ".It Ql filename"
8104 .It Ql filename
8105 Sets the filename of the MIME part, i.e., the name that is used for
8106 display and when (suggesting a name for) saving (purposes).
8107 .It Ql content-description
8108 Associate some descriptive information to the attachment's content, used
8109 in favour of the plain filename by some MUAs.
8110 .It Ql content-id
8111 May be used for uniquely identifying MIME entities in several contexts;
8112 this expects a special reference address format as defined in RFC 2045
8113 and generates a
8114 .Ql 505
8115 upon address content verification failure.
8116 .It Ql content-type
8117 Defines the media type/subtype of the part, which is managed
8118 automatically, but can be overwritten.
8119 .It Ql content-disposition
8120 Automatically set to the string
8121 .Ql attachment .
8124 .It Cm attribute-set-at
8125 This uses the same search mechanism as described for
8126 .Cm remove-at
8127 and is otherwise identical to
8128 .Cm attribute-set .
8134 .It Ic ~A
8135 The same as
8136 .Ql Ic ~i Ns \| Va Sign .
8139 .It Ic ~a
8140 The same as
8141 .Ql Ic ~i Ns \| Va sign .
8144 .It Ic ~b Ar name ...
8145 Add the given names to the list of blind carbon copy recipients.
8148 .It Ic ~c Ar name ...
8149 Add the given names to the list of carbon copy recipients.
8152 .It Ic ~d
8153 Read the file specified by the
8154 .Ev DEAD
8155 variable into the message.
8158 .It Ic ~e
8159 Invoke the text
8160 .Ev EDITOR
8161 on the message collected so far, then return to compose mode.
8162 .Ic ~v
8163 can be used for a more display oriented editor, and
8164 .Ic ~| Ns |
8165 offers a pipe-based editing approach.
8168 .It Ic ~F Ar messages
8169 Read the named messages into the message being sent, including all
8170 message headers and MIME parts.
8171 If no messages are specified, read in the current message, the
8172 .Dq dot .
8175 .It Ic ~f Ar messages
8176 Read the named messages into the message being sent.
8177 If no messages are specified, read in the current message, the
8178 .Dq dot .
8179 Strips down the list of header fields according to the
8180 .Ql type
8181 white- and blacklist selection of
8182 .Ic headerpick .
8183 For MIME multipart messages,
8184 only the first displayable part is included.
8187 .It Ic ~H
8188 Edit the message header fields
8189 .Ql From: ,
8190 .Ql Reply-To:
8192 .Ql Sender:
8193 by typing each one in turn and allowing the user to edit the field.
8194 The default values for these fields originate from the
8195 .Va from , reply-to
8197 .Va sender
8198 variables.
8201 .It Ic ~h
8202 Edit the message header fields
8203 .Ql To: ,
8204 .Ql Cc: ,
8205 .Ql Bcc:
8207 .Ql Subject:
8208 by typing each one in turn and allowing the user to edit the field.
8211 .It Ic ~I Ar variable
8212 Insert the value of the specified variable into the message.
8213 The message remains unaltered if the variable is unset or empty.
8214 Any embedded character sequences
8215 .Ql \et
8216 horizontal tabulator and
8217 .Ql \en
8218 line feed are expanded in
8219 .Va posix
8220 mode; otherwise the expansion should occur at
8221 .Ic set
8222 time (\*(ID by using the command modifier
8223 .Va wysh ) .
8226 .It Ic ~i Ar variable
8227 Like
8228 .Ic ~I ,
8229 but appends a newline character.
8232 .It Ic ~M Ar messages
8233 Read the named messages into the message being sent,
8234 indented by
8235 .Va indentprefix .
8236 If no messages are specified, read the current message, the
8237 .Dq dot .
8240 .It Ic ~m Ar messages
8241 Read the named messages into the message being sent,
8242 indented by
8243 .Va indentprefix .
8244 If no messages are specified, read the current message, the
8245 .Dq dot .
8246 Strips down the list of header fields according to the
8247 .Ql type
8248 white- and blacklist selection of
8249 .Ic headerpick .
8250 For MIME multipart messages,
8251 only the first displayable part is included.
8254 .It Ic ~p
8255 Display the message collected so far,
8256 prefaced by the message header fields
8257 and followed by the attachment list, if any.
8260 .It Ic ~Q
8261 Read in the given / current message(s) according to the algorithm of
8262 .Va quote .
8265 .It Ic ~q
8266 Abort the message being sent,
8267 copying it to the file specified by the
8268 .Ev DEAD
8269 variable if
8270 .Va save
8271 is set.
8274 .It Ic ~R Ar filename
8275 Identical to
8276 .Ic ~r ,
8277 but indent each line that has been read by
8278 .Va indentprefix .
8281 .It Ic ~r Ar filename Op Ar HERE-delimiter
8282 Read the named file, object to the usual
8283 .Sx "Filename transformations" ,
8284 into the message; if (the expanded)
8285 .Ar filename
8286 is the hyphen-minus
8287 .Ql -
8288 then standard input is used, e.g., for pasting purposes.
8289 Only in this latter mode
8290 .Ar HERE-delimiter
8291 may be given: if it is data will be read in until the given
8292 .Ar HERE-delimiter
8293 is seen on a line by itself, and encountering EOF is an error; the
8294 .Ar HERE-delimiter
8295 is a required argument in non-interactive mode; if it is single-quote
8296 quoted then the pasted content will not be expanded, \*(ID otherwise
8297 a future version of \*(UA may perform shell-style expansion on the content.
8300 .It Ic ~s Ar string
8301 Cause the named string to become the current subject field.
8302 Newline (NL) and carriage-return (CR) bytes are invalid and will be
8303 normalized to space (SP) characters.
8306 .It Ic ~t Ar name ...
8307 Add the given name(s) to the direct recipient list.
8310 .It Ic ~U Ar messages
8311 Read in the given / current message(s) excluding all headers, indented by
8312 .Va indentprefix .
8315 .It Ic ~u Ar messages
8316 Read in the given / current message(s), excluding all headers.
8319 .It Ic ~v
8320 Invoke the
8321 .Ev VISUAL
8322 editor on the message collected so far, then return to compose mode.
8323 .Ic ~e
8324 can be used for a less display oriented editor, and
8325 .Ic ~| Ns |
8326 offers a pipe-based editing approach.
8329 .It Ic ~w Ar filename
8330 Write the message onto the named file, which is object to the usual
8331 .Sx "Filename transformations" .
8332 If the file exists,
8333 the message is appended to it.
8336 .It Ic ~x
8337 Same as
8338 .Ic ~q ,
8339 except that the message is not saved at all.
8342 .\" }}}
8345 .\" .Sh INTERNAL VARIABLES {{{
8346 .Sh "INTERNAL VARIABLES"
8348 Internal \*(UA variables are controlled via the
8349 .Ic set
8351 .Ic unset
8352 commands; prefixing a variable name with the string
8353 .Ql no
8354 and calling
8355 .Ic set
8356 has the same effect as using
8357 .Ic unset :
8358 .Ql unset crt
8360 .Ql set nocrt
8361 do the same thing.
8362 .Ic varshow
8363 will give more insight on the given variable(s), and
8364 .Ic set ,
8365 when called without arguments, will show a listing of all variables.
8366 Both commands support a more
8367 .Va verbose
8368 listing mode.
8369 Some well-known variables will also become inherited from the
8370 program
8371 .Sx ENVIRONMENT
8372 implicitly, others can be imported explicitly with the command
8373 .Ic environ
8374 and henceforth share said properties.
8377 Two different kinds of internal variables exist, and both of which can
8378 also form chains.
8379 There are boolean variables, which can only be in one of the two states
8380 .Dq set
8382 .Dq unset ,
8383 and value variables with a(n optional) string value.
8384 For the latter proper quoting is necessary upon assignment time, the
8385 introduction of the section
8386 .Sx COMMANDS
8387 documents the supported quoting rules.
8389 .Bd -literal -offset indent
8390 ? wysh set one=val\e 1 two="val 2" \e
8391     three='val "3"' four=$'val \e'4\e''; \e
8392     varshow one two three four; \e
8393     unset one two three four
8397 Dependent upon the actual option string values may become interpreted as
8398 colour names, command specifications, normal text, etc.
8399 They may be treated as numbers, in which case decimal values are
8400 expected if so documented, but otherwise any numeric format and
8401 base that is valid and understood by the
8402 .Ic vexpr
8403 command may be used, too.
8406 There also exists a special kind of string value, the
8407 .Dq boolean string ,
8408 which must either be a decimal integer (in which case
8409 .Ql 0
8410 is false and
8411 .Ql 1
8412 and any other value is true) or any of the (case-insensitive) strings
8413 .Ql off ,
8414 .Ql no ,
8415 .Ql n
8417 .Ql false
8418 for a false boolean and
8419 .Ql on ,
8420 .Ql yes ,
8421 .Ql y
8423 .Ql true
8424 for a true boolean; a special kind of boolean string is the
8425 .Dq quadoption ,
8426 which is a boolean string that can optionally be prefixed with the
8427 (case-insensitive) term
8428 .Ql ask- ,
8429 as in
8430 .Ql ask-yes ,
8431 which causes prompting of the user in interactive mode, with the given
8432 boolean as the default value.
8435 Variable chains extend a plain
8436 .Ql variable
8437 with
8438 .Ql variable-HOST
8440 .Ql variable-USER@HOST
8441 variants.
8442 Here
8443 .Ql HOST
8444 will be converted to all lowercase when looked up (but not when the
8445 variable is set or unset!), \*(OPally IDNA converted, and indeed means
8446 .Ql server:port
8447 if a
8448 .Ql port
8449 had been specified in the contextual Uniform Resource Locator URL, see
8450 .Sx "On URL syntax and credential lookup" .
8451 Even though this mechanism is based on URLs no URL percent encoding may
8452 be applied to neither of
8453 .Ql USER
8455 .Ql HOST ,
8456 variable chains need to be specified using raw data;
8457 the mentioned section contains examples.
8458 Variables which support chains are explicitly documented as such, and
8459 \*(UA treats the base name of any such variable special, meaning that
8460 users should not create custom names like
8461 .Ql variable-xyz
8462 in order to avoid false classifications and treatment of such variables.
8464 .\" .Ss "Initial settings" {{{
8465 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
8466 .Ss "Initial settings"
8468 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8469 variable settings:
8470 .Pf no Va allnet ,
8471 .Pf no Va append ,
8472 .Va asksub ,
8473 .Pf no Va askbcc ,
8474 .Pf no Va autoprint ,
8475 .Pf no Va bang ,
8476 .Pf no Va cmd ,
8477 .Pf no Va crt ,
8478 .Pf no Va debug ,
8479 .Pf no Va dot ,
8480 .Va escape
8481 set to
8482 .Ql ~ ,
8483 .Pf no Va flipr ,
8484 .Pf no Va folder ,
8485 .Va header ,
8486 .Pf no Va hold ,
8487 .Pf no Va ignore ,
8488 .Pf no Va ignoreeof ,
8489 .Pf no Va keep ,
8490 .Pf no Va keepsave ,
8491 .Pf no Va metoo ,
8492 .Pf no Va outfolder ,
8493 .Pf no Va page ,
8494 .Va prompt
8495 set to
8496 .Ql ?\0 ,
8497 .Pf no Va quiet ,
8498 .Pf no Va record ,
8499 .Va save ,
8500 .Pf no Va sendwait ,
8501 .Pf no Va showto ,
8502 .Pf no Va Sign ,
8503 .Pf no Va sign ,
8504 .Va toplines
8505 set to
8506 .Ql 5 .
8509 Notes: \*(UA does not support the
8510 .Pf no Va onehop
8511 variable \(en use command line options or
8512 .Va mta-arguments
8513 to pass options through to a
8514 .Va mta .
8515 And the default global
8516 .Pa \*(UR
8517 file, which is loaded unless the
8518 .Fl \&:
8519 (with according argument) or
8520 .Fl n
8521 command line options have been used, or the
8522 .Ev MAILX_NO_SYSTEM_RC
8523 environment variable is set (see
8524 .Sx "Resource files" )
8525 bends those initial settings a bit, e.g., it sets the variables
8526 .Va hold ,
8527 .Va keepsave
8529 .Va keep ,
8530 to name a few, establishes a default
8531 .Ic headerpick
8532 selection etc., and should thus be taken into account.
8533 .\" }}}
8535 .\" .Ss "Variables" {{{
8536 .Ss "Variables"
8538 .Bl -tag -width ".It Va BaNg"
8541 .It Va \&?
8542 \*(RO The exit status of the last command, or the
8543 .Ic return
8544 value of the macro
8545 .Ic call Ns
8546 ed last.
8547 This status has a meaning in the state machine: in conjunction with
8548 .Va errexit
8549 any non-0 exit status will cause a program exit, and in
8550 .Va posix
8551 mode any error while loading (any of the) resource files will have the
8552 same effect.
8553 .Cm ignerr ,
8554 one of the
8555 .Sx "Command modifiers" ,
8556 can be used to instruct the state machine to ignore errors.
8559 .It Va \&!
8560 \*(RO The current error number
8561 .Pf ( Xr errno 3 ) ,
8562 which is set after an error occurred; it is also available via
8563 .Va ^ERR ,
8564 and the error name and documentation string can be queried via
8565 .Va ^ERRNAME
8567 .Va ^ERRDOC .
8568 \*(ID This machinery is new and the error number is only really usable
8569 if a command explicitly states that it manages the variable
8570 .Va \&! ,
8571 for others errno will be used in case of errors, or
8572 .Va ^ERR Ns -INVAL
8573 if that is 0: it thus may or may not reflect the real error.
8574 The error number may be set with the command
8575 .Ic return .
8579 .It Va ^
8580 \*(RO This is a multiplexer variable which performs dynamic expansion of
8581 the requested state or condition, of which there are:
8584 .Bl -tag -compact -width ".It Va BaNg"
8588 .It Va ^ERR , ^ERRDOC , ^ERRNAME
8589 The number, documentation, and name of the current
8590 .Xr errno 3 ,
8591 respectively, which is usually set after an error occurred.
8592 The documentation is an \*(OP, the name is used if not available.
8593 \*(ID This machinery is new and is usually reliable only if a command
8594 explicitly states that it manages the variable
8595 .Va \&! ,
8596 which is effectively identical to
8597 .Va \&\&^ERR .
8598 Each of those variables can be suffixed with a hyphen minus followed by
8599 a name or number, in which case the expansion refers to the given error.
8600 Note this is a direct mapping of (a subset of) the system error values:
8601 .Bd -literal -offset indent
8602 define work {
8603   eval echo \e$1: \e$^ERR-$1:\e
8604     \e$^ERRNAME-$1: \e$^ERRDOC-$1
8605   vput vexpr i + "$1" 1
8606   if [ $i -lt 16 ]
8607     \excall work $i
8608   end
8610 call work 0
8616 .It Va *
8617 \*(RO Expands all positional parameters (see
8618 .Va 1 ) ,
8619 separated by the first character of the value of
8620 .Va ifs .
8621 \*(ID The special semantics of the equally named special parameter of the
8622 .Xr sh 1
8623 are not yet supported.
8626 .It Va @
8627 \*(RO Expands all positional parameters (see
8628 .Va 1 ) ,
8629 separated by a space character.
8630 If placed in double quotation marks, each positional parameter is
8631 properly quoted to expand to a single parameter again.
8634 .It Va #
8635 \*(RO Expands to the number of positional parameters, i.e., the size of
8636 the positional parameter stack in decimal.
8639 .It Va \&0
8640 \*(RO Inside the scope of a
8641 .Ic define Ns
8642 d and
8643 .Ic call Ns
8644 ed macro this expands to the name of the calling macro, or to the empty
8645 string if the macro is running from top-level.
8646 For the \*(OPal regular expression search and replace operator of
8647 .Ic vexpr
8648 this expands to the entire matching expression.
8649 It represents the program name in global context.
8652 .It Va 1
8653 \*(RO Access of the positional parameter stack.
8654 All further parameters can be accessed with this syntax, too, e.g.,
8655 .Ql 2 ,
8656 .Ql 3
8657 etc.; positional parameters can be shifted off the stack by calling
8658 .Ic shift .
8659 The parameter stack contains, e.g., the arguments of a
8660 .Ic call Ns
8662 .Ic define Ns
8663 d macro, the matching groups of the \*(OPal regular expression search
8664 and replace expression of
8665 .Ic vexpr ,
8666 and can be explicitly created or overwritten with the command
8667 .Ic vpospar .
8670 .It Va account
8671 \*(RO Is set to the active
8672 .Ic account .
8675 .It Va add-file-recipients
8676 \*(BO When file or pipe recipients have been specified,
8677 mention them in the corresponding address fields of the message instead
8678 of silently stripping them from their recipient list.
8679 By default such addressees are not mentioned.
8682 .It Va allnet
8683 \*(BO Causes only the local part to be evaluated
8684 when comparing addresses.
8687 .It Va append
8688 \*(BO Causes messages saved in the
8689 .Mx -sx
8690 .Sx "secondary mailbox"
8691 .Ev MBOX
8692 to be appended to the end rather than prepended.
8693 This should always be set.
8696 .It Va askatend
8697 \*(BO Causes the prompts for
8698 .Ql Cc:
8700 .Ql Bcc:
8701 lists to appear after the message has been edited.
8704 .It Va askattach
8705 \*(BO If set, \*(UA asks for files to attach at the end of each message.
8706 An empty line finalizes the list.
8709 .It Va askcc
8710 \*(BO Causes the user to be prompted for carbon copy recipients
8711 (at the end of each message if
8712 .Va askatend
8714 .Va bsdcompat
8715 are set).
8718 .It Va askbcc
8719 \*(BO Causes the user to be prompted for blind carbon copy
8720 recipients (at the end of each message if
8721 .Va askatend
8723 .Va bsdcompat
8724 are set).
8727 .It Va asksend
8728 \*(BO Causes the user to be prompted for confirmation to send the
8729 message or reenter compose mode after having been shown an envelope
8730 summary.
8731 This is by default enabled.
8734 .It Va asksign
8735 \*(BO\*(OP Causes the user to be prompted if the message is to be
8736 signed at the end of each message.
8738 .Va smime-sign
8739 variable is ignored when this variable is set.
8742 .It Va asksub
8743 .\" The alternative *ask* is not documented on purpose
8744 \*(BO Causes \*(UA to prompt for the subject upon entering compose mode
8745 unless a subject already exists.
8748 .It Va attrlist
8749 A sequence of characters to display in the
8750 .Ql attribute
8751 column of the
8752 .Va headline
8753 as shown in the display of
8754 .Ic headers ;
8755 each for one type of messages (see
8756 .Sx "Message states" ) ,
8757 with the default being
8758 .Ql NUROSPMFAT+\-$~
8760 .Ql NU\ \ *HMFAT+\-$~
8761 if the
8762 .Va bsdflags
8763 variable is set, in the following order:
8765 .Bl -tag -compact -width ".It Ql _"
8766 .It Ql N
8767 new.
8768 .It Ql U
8769 unread but old.
8770 .It Ql R
8771 new but read.
8772 .It Ql O
8773 read and old.
8774 .It Ql S
8775 saved.
8776 .It Ql P
8777 preserved.
8778 .It Ql M
8779 mboxed.
8780 .It Ql F
8781 flagged.
8782 .It Ql A
8783 answered.
8784 .It Ql T
8785 draft.
8786 .It Ql +
8787 \*(ID start of a (collapsed) thread in threaded mode (see
8788 .Va autosort ,
8789 .Ic thread ) ;
8790 .It Ql -
8791 \*(ID an uncollapsed thread in threaded mode; only used in conjunction with
8792 .Fl L .
8793 .It Ql $
8794 classified as spam.
8795 .It Ql ~
8796 classified as possible spam.
8801 .It Va autobcc
8802 Specifies a list of recipients to which a blind carbon copy of each
8803 outgoing message will be sent automatically.
8806 .It Va autocc
8807 Specifies a list of recipients to which a carbon copy of each outgoing
8808 message will be sent automatically.
8811 .It Va autocollapse
8812 \*(BO Causes threads to be collapsed automatically when .Ql thread Ns
8814 .Ic sort
8815 mode is entered (see the
8816 .Ic collapse
8817 command).
8820 .It Va autoprint
8821 \*(BO Enable automatic
8822 .Ic type Ns
8823 ing of a(n existing)
8824 .Dq successive
8825 message after
8826 .Ic delete
8828 .Ic undelete
8829 commands, e.g., the message that becomes the new
8830 .Dq dot
8831 is shown automatically, as via
8832 .Ic dp
8834 .Ic dt .
8837 .It Va autosort
8838 Causes sorted mode (see the
8839 .Ic sort
8840 command) to be entered automatically with the value of this variable as
8841 sorting method when a folder is opened, e.g.,
8842 .Ql set autosort=thread .
8845 .It Va bang
8846 \*(BO Enables the substitution of all not (reverse-solidus) escaped
8847 exclamation mark
8848 .Ql \&!
8849 characters by the contents of the last executed command for the
8850 .Ic \&!
8851 shell escape command and
8852 .Ic ~! ,
8853 one of the compose mode
8854 .Sx "COMMAND ESCAPES" .
8855 If this variable is not set no reverse solidus stripping is performed.
8858 .It Va bind-timeout
8859 \*(OP Terminals generate multi-byte sequences for certain forms of
8860 input, for example for function and other special keys.
8861 Some terminals however do not write these multi-byte sequences as
8862 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
8863 This variable specifies the timeout in milliseconds that the MLE (see
8864 .Sx "On terminal control and line editor" )
8865 waits for more bytes to arrive unless it considers a sequence
8866 .Dq complete .
8867 The default is 200.
8870 .It Va bsdcompat
8871 \*(BO Sets some cosmetical features to traditional BSD style;
8872 has the same affect as setting
8873 .Va askatend
8874 and all other variables prefixed with
8875 .Ql bsd ;
8876 it also changes the behaviour of
8877 .Va emptystart
8878 (which does not exist in BSD).
8881 .It Va bsdflags
8882 \*(BO Changes the letters shown in the first column of a header
8883 summary to traditional BSD style.
8886 .It Va bsdheadline
8887 \*(BO Changes the display of columns in a header summary to traditional
8888 BSD style.
8891 .It Va bsdmsgs
8892 \*(BO Changes some informational messages to traditional BSD style.
8895 .It Va bsdorder
8896 \*(BO Causes the
8897 .Ql Subject:
8898 field to appear immediately after the
8899 .Ql To:
8900 field in message headers and with the
8901 .Ic ~h
8902 .Sx "COMMAND ESCAPES" .
8908 .It Va build-cc , build-ld , build-os , build-rest
8909 \*(RO The build environment, including the compiler, the linker, the
8910 operating system \*(UA has been build for, usually taken from
8911 .Xr uname 1
8913 .Ql uname -s ,
8914 and then lowercased, as well as all the rest that may possibly be useful
8915 to include in a bug report, respectively.
8918 .It Va charset-7bit
8919 The value that should appear in the
8920 .Ql charset=
8921 parameter of
8922 .Ql Content-Type:
8923 MIME header fields when no character set conversion of the message data
8924 was performed.
8925 This defaults to US-ASCII, and the chosen character set should be
8926 US-ASCII compatible.
8929 .It Va charset-8bit
8930 \*(OP The default 8-bit character set that is used as an implicit last
8931 member of the variable
8932 .Va sendcharsets .
8933 This defaults to UTF-8 if character set conversion capabilities are
8934 available, and to ISO-8859-1 otherwise (unless the operating system
8935 environment is known to always and exclusively support UTF-8 locales),
8936 in which case the only supported character set is
8937 .Va ttycharset
8938 and this variable is effectively ignored.
8939 Refer to the section
8940 .Sx "Character sets"
8941 for the complete picture of character set conversion in \*(UA.
8944 .It Va charset-unknown-8bit
8945 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
8946 .Dq upgrade
8947 the content of a mail message by using a character set with the name
8948 .Ql unknown-8bit .
8949 Because of the unclassified nature of this character set \*(UA will not
8950 be capable to convert this character set to any other character set.
8951 If this variable is set any message part which uses the character set
8952 .Ql unknown-8bit
8953 is assumed to really be in the character set given in the value,
8954 otherwise the (final) value of
8955 .Va charset-8bit
8956 is used for this purpose.
8958 This variable will also be taken into account if a MIME type (see
8959 .Sx "The mime.types files" )
8960 of a MIME message part that uses the
8961 .Ql binary
8962 character set is forcefully treated as text.
8965 .It Va cmd
8966 The default value for the
8967 .Ic pipe
8968 command.
8971 .It Va colour-disable
8972 \*(BO\*(OP Forcefully disable usage of colours.
8973 Also see the section
8974 .Sx "Coloured display" .
8977 .It Va colour-pager
8978 \*(BO\*(OP Whether colour shall be used for output that is paged through
8979 .Ev PAGER .
8980 Note that pagers may need special command line options, e.g.,
8981 .Xr less 1
8982 requires the option
8983 .Fl \&\&R
8985 .Xr lv 1
8986 the option
8987 .Fl \&\&c
8988 in order to support colours.
8989 Often doing manual adjustments is unnecessary since \*(UA may perform
8990 adjustments dependent on the value of the environment variable
8991 .Ev PAGER
8992 (see there for more).
8996 .It Va contact-mail , contact-web
8997 \*(RO Addresses for contact per email and web, respectively, e.g., for
8998 bug reports, suggestions, or help regarding \*(UA.
8999 The former can be used directly:
9000 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
9003 .It Va crt
9004 In a(n interactive) terminal session, then if this valued variable is
9005 set it will be used as a threshold to determine how many lines the given
9006 output has to span before it will be displayed via the configured
9007 .Ev PAGER ;
9008 Usage of the
9009 .Ev PAGER
9010 can be forced by setting this to the value
9011 .Ql 0 ,
9012 setting it without a value will deduce the current height of the
9013 terminal screen to compute the threshold (see
9014 .Ev LINES ,
9015 .Va screen
9017 .Xr stty 1 ) .
9018 \*(ID At the moment this uses the count of lines of the message in wire
9019 format, which, dependent on the
9020 .Va mime-encoding
9021 of the message, is unrelated to the number of display lines.
9022 (The software is old and historically the relation was a given thing.)
9025 .It Va customhdr
9026 Define a set of custom headers to be injected into newly composed or
9027 forwarded messages.
9028 A custom header consists of the field name followed by a colon
9029 .Ql \&:
9030 and the field content body.
9031 Standard header field names cannot be overwritten by a custom header.
9032 Different to the command line option
9033 .Fl C
9034 the variable value is interpreted as a comma-separated list of custom
9035 headers: to include commas in header bodies they need to become escaped
9036 with reverse solidus
9037 .Ql \e .
9038 Headers can be managed more freely in compose mode via
9039 .Ic ~^ .
9041 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
9044 .It Va datefield
9045 Controls the appearance of the
9046 .Ql %d
9047 date and time format specification of the
9048 .Va headline
9049 variable, that is used, for example, when viewing the summary of
9050 .Ic headers .
9051 If unset, then the local receiving date is used and displayed
9052 unformatted, otherwise the message sending
9053 .Ql Date: .
9054 It is possible to assign a
9055 .Xr strftime 3
9056 format string and control formatting, but embedding newlines via the
9057 .Ql %n
9058 format is not supported, and will result in display errors.
9059 The default is
9060 .Ql %Y-%m-%d %H:%M ,
9061 and also see
9062 .Va datefield-markout-older .
9065 .It Va datefield-markout-older
9066 Only used in conjunction with
9067 .Va datefield .
9068 Can be used to create a visible distinction of messages dated more than
9069 a day in the future, or older than six months, a concept comparable to the
9070 .Fl \&\&l
9071 option of the POSIX utility
9072 .Xr ls 1 .
9073 If set to the empty string, then the plain month, day and year of the
9074 .Ql Date:
9075 will be displayed, but a
9076 .Xr strftime 3
9077 format string to control formatting can be assigned.
9078 The default is
9079 .Ql %Y-%m-%d .
9082 .It Va debug
9083 \*(BO Enables debug messages and obsoletion warnings, disables the
9084 actual delivery of messages and also implies
9085 .Pf no Va record
9086 as well as
9087 .Pf no Va save .
9090 .It Va disposition-notification-send
9091 \*(BO\*(OP Emit a
9092 .Ql Disposition-Notification-To:
9093 header (RFC 3798) with the message.
9094 This requires the
9095 .Va from
9096 variable to be set.
9097 .\" TODO .It Va disposition-notification-send-HOST
9098 .\"Overrides
9099 .\".Va disposition-notification-send
9100 .\" for SMTP accounts on a specific host.
9101 .\" TODO .It Va disposition-notification-send-USER@HOST
9102 .\"Overrides
9103 .\".Va disposition-notification-send
9104 .\"for a specific account.
9107 .It Va dot
9108 \*(BO When dot is set, a period
9109 .Ql \&.
9110 on a line by itself during message input in (interactive or batch
9111 .Fl # )
9112 compose mode will be treated as end-of-message (in addition to the
9113 normal end-of-file condition).
9114 This behaviour is implied in
9115 .Va posix
9116 mode with a set
9117 .Va ignoreeof .
9120 .It Va dotlock-disable
9121 \*(BO\*(OP Disable creation of
9122 .Mx -sx
9123 .Sx "dotlock files"
9124 for MBOX databases.
9126 .It Va dotlock-ignore-error
9127 \*(OB\*(BO\*(OP Ignore failures when creating
9128 .Mx -sx
9129 .Sx "dotlock files" .
9130 Please use
9131 .Va dotlock-disable
9132 instead.
9135 .It Va editalong
9136 If this variable is set then the editor is started automatically when
9137 a message is composed in interactive mode.
9138 If the value starts with the letter
9139 .Ql v
9140 then this acts as if
9141 .Ic ~v ,
9142 otherwise as if
9143 .Ic ~e
9144 .Pf (see\0 Sx "COMMAND ESCAPES" )
9145 had been specified.
9147 .Va editheaders
9148 variable is implied for this automatically spawned editor session.
9151 .It Va editheaders
9152 \*(BO When a message is edited while being composed,
9153 its header is included in the editable text.
9156 .It Va emptystart
9157 \*(BO When entering interactive mode \*(UA normally writes
9158 .Dq \&No mail for user
9159 and exits immediately if a mailbox is empty or does not exist.
9160 If this variable is set \*(UA starts even with an empty or non-existent
9161 mailbox (the latter behaviour furtherly depends upon
9162 .Va bsdcompat ,
9163 though).
9166 .It Va errexit
9167 \*(BO Let each command with a non-0 exit status, including every
9168 .Ic call Ns
9169 ed macro which
9170 .Ic return Ns
9171 s a non-0 status, cause a program exit unless prefixed by
9172 .Cm ignerr
9173 (see
9174 .Sx "Command modifiers" ) .
9175 This also affects
9176 .Sx "COMMAND ESCAPES" ,
9177 but which use a different modifier for ignoring the error.
9178 Please refer to the variable
9179 .Va \&?
9180 for more on this topic.
9183 .It Va escape
9184 The first character of this value defines the escape character for
9185 .Sx "COMMAND ESCAPES"
9186 in compose mode.
9187 The default value is the character tilde
9188 .Ql ~ .
9189 If set to the empty string, command escapes are disabled.
9192 .It Va expandaddr
9193 If unset then file and command pipeline address targets are not allowed,
9194 and any such address will be filtered out, giving a warning message.
9195 If set then all possible recipient address specifications will be
9196 accepted unless a possible value content is more specific (also see
9197 .Sx "On sending mail, and non-interactive mode" ) ;
9198 if desired so only in interactive mode, or when tilde commands were
9199 enabled explicitly via
9200 .Fl ~
9202 .Fl # ,
9203 the (case-insensitive) value
9204 .Ql restrict
9205 can be used (this really acts like
9206 .Ql restrict,-all,+name,+addr ,
9207 so that care for ordering issues must be taken).
9209 The value is actually interpreted as a comma-separated list.
9210 If that contains
9211 .Ql fail
9212 the existence of disallowed addressees is treated as a hard send error
9213 instead of only causing them to be filtered out.
9214 Address targets can be added and subtracted by prefixing with a plus sign
9215 .Ql +
9216 or hyphen-minus
9217 .Ql -
9218 prefix: the value
9219 .Ql all
9220 addresses all possible address specifications,
9221 .Ql file
9222 file targets,
9223 .Ql pipe
9224 command pipeline targets,
9225 .Ql name
9226 plain user names and (MTA) aliases and
9227 .Ql addr
9228 network addresses;
9229 Targets are interpreted in the given order, so that
9230 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
9231 will cause hard errors for any non-network address recipient address
9232 unless \*(UA is in interactive mode or has been started with the
9233 .Fl ~
9235 .Fl #
9236 command line option; in the latter case(s) any address may be used, then.
9238 Historically invalid network addressees were silently stripped off.
9239 To change this so that any encountered invalid email address causes
9240 a hard error it must be ensured that
9241 .Ql failinvaddr
9242 is an entry in the above list, which automatically enables network
9243 addressees; it really acts like
9244 .Ql failinvaddr,+addr ,
9245 so that care for ordering issues must be taken.
9246 \*(ID If the value
9247 .Ql shquote
9248 is present a few address providers (for example
9249 .Fl b , c
9250 and all recipients given on the command line) will be will evaluated as
9251 if specified within dollar-single-quotes (see
9252 .Sx "Shell-style argument quoting" ) .
9255 .It Va expandargv
9256 Unless this variable is set additional
9257 .Va mta
9258 (Mail-Transfer-Agent)
9259 arguments from the command line, as can be given after a
9260 .Fl \&\&-
9261 separator, results in a program termination with failure status.
9262 The same can be accomplished by using the special (case-insensitive) value
9263 .Ql fail .
9264 A lesser strict variant is the otherwise identical
9265 .Ql restrict ,
9266 which does accept such arguments in interactive mode, or if tilde
9267 commands were enabled explicitly by using one of the command line options
9268 .Fl ~
9270 .Fl # .
9271 The empty value will allow unconditional usage.
9274 .It Va features
9275 \*(RO String giving a list of optional features.
9276 Features are preceded with a plus sign
9277 .Ql +
9278 if they are available, with a hyphen-minus
9279 .Ql -
9280 otherwise.
9281 The output of the command
9282 .Ic version
9283 will include this information in a more pleasant output.
9286 .It Va flipr
9287 \*(BO This setting reverses the meanings of a set of reply commands,
9288 turning the lowercase variants, which by default address all recipients
9289 included in the header of a message
9290 .Pf ( Ic reply , respond , followup )
9291 into the uppercase variants, which by default address the sender only
9292 .Pf ( Ic Reply , Respond , Followup )
9293 and vice versa.
9294 The commands
9295 .Ic replysender , respondsender , followupsender
9296 as well as
9297 .Ic replyall , respondall , followupall
9298 are not affected by the current setting of
9299 .Va flipr .
9302 .It Va folder
9303 The default path under which mailboxes are to be saved:
9304 filenames that begin with the plus sign
9305 .Ql +
9306 will have the plus sign replaced with the value of this variable if set,
9307 otherwise the plus sign will remain unchanged when doing
9308 .Sx "Filename transformations" ;
9309 also see
9310 .Ic file
9311 for more on this topic, and know about standard imposed implications of
9312 .Va outfolder .
9313 The value supports a subset of transformations itself, and if the
9314 non-empty value does not start with a solidus
9315 .Ql / ,
9316 then the value of
9317 .Ev HOME
9318 will be prefixed automatically.
9319 Once the actual value is evaluated first, the internal variable
9320 .Va folder-resolved
9321 will be updated for caching purposes.
9323 .Mx Va folder-hook
9324 .It Va folder-hook-FOLDER , Va folder-hook
9325 Names a
9326 .Ic define Ns d
9327 macro which will be called whenever a
9328 .Ic file
9329 is opened.
9330 The macro will also be invoked when new mail arrives,
9331 but message lists for commands executed from the macro
9332 only include newly arrived messages then.
9333 .Ic localopts
9334 are activated by default in a folder hook, causing the covered settings
9335 to be reverted once the folder is left again.
9337 The specialized form will override the generic one if
9338 .Ql FOLDER
9339 matches the file that is opened.
9340 Unlike other folder specifications, the fully expanded name of a folder,
9341 without metacharacters, is used to avoid ambiguities.
9342 However, if the mailbox resides under
9343 .Va folder
9344 then the usual
9345 .Ql +
9346 specification is tried in addition, e.g., if
9347 .Va \&\&folder
9349 .Dq mail
9350 (and thus relative to the user's home directory) then
9351 .Pa /home/usr1/mail/sent
9352 will be tried as
9353 .Ql folder-hook-/home/usr1/mail/sent
9354 first, but then followed by
9355 .Ql folder-hook-+sent .
9358 .It Va folder-resolved
9359 \*(RO Set to the fully resolved path of
9360 .Va folder
9361 once that evaluation has occurred; rather internal.
9364 .It Va followup-to
9365 \*(BO Controls whether a
9366 .Ql Mail-Followup-To:
9367 header is generated when sending messages to known mailing lists.
9368 Also see
9369 .Va followup-to-honour
9370 and the commands
9371 .Ic mlist , mlsubscribe , reply
9373 .Ic Lreply .
9376 .It Va followup-to-honour
9377 Controls whether a
9378 .Ql Mail-Followup-To:
9379 header is honoured when group-replying to a message via
9380 .Ic reply
9382 .Ic Lreply .
9383 This is a quadoption; if set without a value it defaults to
9384 .Dq yes .
9385 Also see
9386 .Va followup-to
9387 and the commands
9388 .Ic mlist
9390 .Ic mlsubscribe .
9393 .It Va forward-as-attachment
9394 \*(BO Original messages are normally sent as inline text with the
9395 .Ic forward
9396 command,
9397 and only the first part of a multipart message is included.
9398 With this setting enabled messages are sent as unmodified MIME
9399 .Ql message/rfc822
9400 attachments with all of their parts included.
9404 .It Va forward-inject-head , forward-inject-tail
9405 The strings to put before and after the text of a message with the
9406 .Ic forward
9407 command, respectively.
9408 The former defaults to
9409 .Ql -------- Original Message --------\en .
9410 Special format directives in these strings will be expanded if possible,
9411 and if so configured the output will be folded according to
9412 .Va quote-fold ;
9413 for more please refer to
9414 .Va quote-inject-head .
9415 These variables are ignored if the
9416 .Va forward-as-attachment
9417 variable is set.
9421 .It Va from
9422 The address (or a list of addresses) to put into the
9423 .Ql From:
9424 field of the message header, quoting RFC 5322:
9425 the author(s) of the message, that is, the mailbox(es) of the person(s)
9426 or system(s) responsible for the writing of the message.
9427 According to that RFC setting the
9428 .Va sender
9429 variable is required if
9430 .Va \&\&from
9431 contains more than one address.
9432 Dependent on the context these addresses are handled as if they were in
9433 the list of
9434 .Ic alternates .
9437 If a file-based MTA is used, then
9438 .Va \&\&from
9439 (or, if that contains multiple addresses,
9440 .Va sender )
9441 can nonetheless be enforced to appear as the envelope sender address at
9442 the MTA protocol level (the RFC 5321 reverse-path), either by using the
9443 .Fl r
9444 command line option (with an empty argument; see there for the complete
9445 picture on this topic), or by setting the internal variable
9446 .Va r-option-implicit .
9449 If the machine's hostname is not valid at the Internet (for example at
9450 a dialup machine) then either this variable or
9451 .Va hostname
9452 (\*(IN a SMTP-based
9453 .Va mta
9454 adds even more fine-tuning capabilities with
9455 .Va smtp-hostname )
9456 have to be set: if so the message and MIME part related unique ID fields
9457 .Ql Message-ID:
9459 .Ql Content-ID:
9460 will be created (except when disallowed by
9461 .Va message-id-disable
9463 .Va stealthmua ) .
9467 .It Va fullnames
9468 \*(BO Due to historical reasons comments and name parts of email
9469 addresses are removed by default when sending mail, replying to or
9470 forwarding a message.
9471 If this variable is set such stripping is not performed.
9473 .It Va fwdheading
9474 \*(OB Predecessor of
9475 .Va forward-inject-head .
9478 .It Va header
9479 \*(BO Causes the header summary to be written at startup and after
9480 commands that affect the number of messages or the order of messages in
9481 the current
9482 .Ic folder .
9483 Unless in
9484 .Va posix
9485 mode a header summary will also be displayed on folder changes.
9486 The command line option
9487 .Fl N
9488 can be used to set
9489 .Pf no Va header .
9493 .It Va headline
9494 A format string to use for the summary of
9495 .Ic headers .
9496 Format specifiers in the given string start with a percent sign
9497 .Ql %
9498 and may be followed by an optional decimal number indicating the field
9499 width \(em if that is negative, the field is to be left-aligned.
9500 Names and addresses are subject to modifications according to
9501 .Va showname
9503 .Va showto .
9504 Valid format specifiers are:
9507 .Bl -tag -compact -width ".It Ql _%%_"
9508 .It Ql %%
9509 A plain percent sign.
9510 .It Ql %>
9511 .Dq Dotmark :
9512 a space character but for the current message
9513 .Pf ( Dq dot ) ,
9514 for which it expands to
9515 .Ql >
9516 (dependent on
9517 .Va headline-plain ) .
9518 .It Ql %<
9519 .Dq Dotmark :
9520 a space character but for the current message
9521 .Pf ( Dq dot ) ,
9522 for which it expands to
9523 .Ql <
9524 (dependent on
9525 .Va headline-plain ) .
9526 .It Ql %$
9527 \*(OP The spam score of the message, as has been classified via the
9528 command
9529 .Ic spamrate .
9530 Shows only a replacement character if there is no spam support.
9531 .It Ql %a
9532 Message attribute character (status flag); the actual content can be
9533 adjusted by setting
9534 .Va attrlist .
9535 .It Ql %d
9536 The date found in the
9537 .Ql Date:
9538 header of the message when
9539 .Va datefield
9540 is set (the default), otherwise the date when the message was received.
9541 Formatting can be controlled by assigning a
9542 .Xr strftime 3
9543 format string to
9544 .Va datefield
9545 (and
9546 .Va datefield-markout-older ) .
9547 .It Ql %e
9548 The indenting level in
9549 .Ql thread Ns
9551 .Ic sort
9552 mode.
9553 .It Ql %f
9554 The address of the message sender.
9555 .It Ql %i
9556 The message thread tree structure.
9557 (Note that this format does not support a field width, and honours
9558 .Va headline-plain . )
9559 .It Ql %l
9560 The number of lines of the message, if available.
9561 .It Ql %m
9562 Message number.
9563 .It Ql %o
9564 The number of octets (bytes) in the message, if available.
9565 .It Ql %s
9566 Message subject (if any).
9567 .It Ql %S
9568 Message subject (if any) in double quotes.
9569 .It Ql \&%T
9570 Message recipient flags: is the addressee of the message a known or
9571 subscribed mailing list \(en see
9572 .Ic mlist
9574 .Ic mlsubscribe .
9575 .It Ql %t
9576 The position in threaded/sorted order.
9577 .It Ql \%U
9578 The value 0 except in an IMAP mailbox,
9579 where it expands to the UID of the message.
9582 The default is
9583 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
9585 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
9587 .Va bsdcompat
9588 is set.
9589 Also see
9590 .Va attrlist ,
9591 .Va headline-plain
9593 .Va headline-bidi .
9597 .It Va headline-bidi
9598 Bidirectional text requires special treatment when displaying headers,
9599 because numbers (in dates or for file sizes etc.) will not affect the
9600 current text direction, in effect resulting in ugly line layouts when
9601 arabic or other right-to-left text is to be displayed.
9602 On the other hand only a minority of terminals is capable to correctly
9603 handle direction changes, so that user interaction is necessary for
9604 acceptable results.
9605 Note that extended host system support is required nonetheless, e.g.,
9606 detection of the terminal character set is one precondition;
9607 and this feature only works in an Unicode (i.e., UTF-8) locale.
9609 In general setting this variable will cause \*(UA to encapsulate text
9610 fields that may occur when displaying
9611 .Va headline
9612 (and some other fields, like dynamic expansions in
9613 .Va prompt )
9614 with special Unicode control sequences;
9615 it is possible to fine-tune the terminal support level by assigning
9616 a value:
9617 no value (or any value other than
9618 .Ql 1 ,
9619 .Ql 2
9621 .Ql 3 )
9622 will make \*(UA assume that the terminal is capable to properly deal
9623 with Unicode version 6.3, in which case text is embedded in a pair of
9624 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
9625 characters.
9626 In addition no space on the line is reserved for these characters.
9628 Weaker support is chosen by using the value
9629 .Ql 1
9630 (Unicode 6.3, but reserve the room of two spaces for writing the control
9631 sequences onto the line).
9632 The values
9633 .Ql 2
9635 .Ql 3
9636 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
9637 again reserves room for two spaces in addition.
9640 .It Va headline-plain
9641 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
9642 used by default for certain entries of
9643 .Va headline .
9644 If this variable is set only basic US-ASCII symbols will be used.
9647 .It Va history-file
9648 \*(OP If a line editor is available then this can be set to
9649 name the (expandable) path of the location of a permanent
9650 .Ic history
9651 file; also see
9652 .Va history-size .
9655 .It Va history-gabby
9656 \*(BO\*(OP Add more entries to the
9657 .Ic history
9658 as is normally done.
9661 .It Va history-gabby-persist
9662 \*(BO\*(OP \*(UA's own MLE will not save the additional
9663 .Va history-gabby
9664 entries in persistent storage unless this variable is set.
9665 On the other hand it will not loose the knowledge of whether
9666 a persistent entry was gabby or not.
9667 Also see
9668 .Va history-file .
9671 .It Va history-size
9672 \*(OP Setting this variable imposes a limit on the number of concurrent
9673 .Ic history
9674 entries.
9675 If set to the value 0 then no further history entries will be added,
9676 and loading and incorporation of the
9677 .Va history-file
9678 upon program startup can also be suppressed by doing this.
9679 Runtime changes will not be reflected before the
9680 .Ic history
9681 is saved or loaded (again).
9684 .It Va hold
9685 \*(BO This setting controls whether messages are held in the system
9686 .Va inbox ,
9687 and it is set by default.
9690 .It Va hostname
9691 Used instead of the value obtained from
9692 .Xr uname 3
9694 .Xr getaddrinfo 3
9695 as the hostname when expanding local addresses, e.g., in
9696 .Ql From:
9697 (also see
9698 .Sx "On sending mail, and non-interactive mode" ,
9699 especially for expansion of network addresses that contain domain-less
9700 valid user names in angle brackets).
9701 If either of
9702 .Va from
9703 or this variable Is set the message and MIME part related unique ID fields
9704 .Ql Message-ID:
9706 .Ql Content-ID:
9707 will be created (except when disallowed by
9708 .Va message-id-disable
9710 .Va stealthmua ) .
9711 If the \*(OPal IDNA support is available (see
9712 .Va idna-disable )
9713 variable assignment is aborted when a necessary conversion fails.
9715 Setting it to the empty string will cause the normal hostname to be
9716 used, but nonetheless enables creation of said ID fields.
9717 \*(IN in conjunction with the built-in SMTP
9718 .Va mta
9719 .Va smtp-hostname
9720 also influences the results:
9721 one should produce some test messages with the desired combination of
9722 .Va \&\&hostname ,
9723 and/or
9724 .Va from ,
9725 .Va sender
9726 etc. first.
9729 .It Va idna-disable
9730 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
9731 names according to the rules of IDNA (internationalized domain names
9732 for applications).
9733 Since the IDNA code assumes that domain names are specified with the
9734 .Va ttycharset
9735 character set, an UTF-8 locale charset is required to represent all
9736 possible international domain names (before conversion, that is).
9739 .It Va ifs
9740 The input field separator that is used (\*(ID by some functions) to
9741 determine where to split input data.
9743 .Bl -tag -compact -width ".It MMM"
9744 .It 1.
9745 Unsetting is treated as assigning the default value,
9746 .Ql \& \et\en .
9747 .It 2.
9748 If set to the empty value, no field splitting will be performed.
9749 .It 3.
9750 If set to a non-empty value, all whitespace characters are extracted
9751 and assigned to the variable
9752 .Va ifs-ws .
9755 .Bl -tag -compact -width ".It MMM"
9756 .It a.
9757 .Va \&\&ifs-ws
9758 will be ignored at the beginning and end of input.
9759 Diverging from POSIX shells default whitespace is removed in addition,
9760 which is owed to the entirely different line content extraction rules.
9761 .It b.
9762 Each occurrence of a character of
9763 .Va \&\&ifs
9764 will cause field-splitting, any adjacent
9765 .Va \&\&ifs-ws
9766 characters will be skipped.
9770 .It Va ifs-ws
9771 \*(RO Automatically deduced from the whitespace characters in
9772 .Va ifs .
9775 .It Va ignore
9776 \*(BO Ignore interrupt signals from the terminal while entering
9777 messages; instead echo them as
9778 .Ql @
9779 characters and discard the current line.
9782 .It Va ignoreeof
9783 \*(BO Ignore end-of-file conditions
9784 .Pf ( Ql control-D )
9785 in compose mode on message input and in interactive command input.
9786 If set an interactive command input session can only be left by
9787 explicitly using one of the commands
9788 .Ic exit
9790 .Ic quit ,
9791 and message input in compose mode can only be terminated by entering
9792 a period
9793 .Ql \&.
9794 on a line by itself or by using the
9795 .Ic ~.
9796 .Sx "COMMAND ESCAPES" ;
9797 Setting this implies the behaviour that
9798 .Va dot
9799 describes in
9800 .Va posix
9801 mode.
9804 .It Va inbox
9805 If this is set to a non-empty string it will specify the user's
9806 .Mx -sx
9807 .Sx "primary system mailbox" ,
9808 overriding
9809 .Ev MAIL
9810 and the system-dependent default, and (thus) be used to replace
9811 .Ql %
9812 when doing
9813 .Sx "Filename transformations" ;
9814 also see
9815 .Ic file
9816 for more on this topic.
9817 The value supports a subset of transformations itself.
9820 .It Va indentprefix
9821 String used by the
9822 .Ic ~m , ~M
9824 .Ic ~R
9825 .Sx "COMMAND ESCAPES"
9826 and by the
9827 .Va quote
9828 option for indenting messages,
9829 in place of the POSIX mandated default tabulator character
9830 .Ql \et .
9831 Also see
9832 .Va quote-chars .
9835 .It Va keep
9836 \*(BO If set, an empty
9837 .Mx -sx
9838 .Sx "primary system mailbox"
9839 file is not removed.
9840 Note that, in conjunction with
9841 .Va posix
9842 mode any empty file will be removed unless this variable is set.
9843 This may improve the interoperability with other mail user agents
9844 when using a common folder directory, and prevents malicious users
9845 from creating fake mailboxes in a world-writable spool directory.
9846 \*(ID Only local regular (MBOX) files are covered, Maildir and other
9847 mailbox types will never be removed, even if empty.
9850 .It Va keep-content-length
9851 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
9852 be told to keep the
9853 .Ql Content-Length:
9855 .Ql Lines:
9856 header fields that some MUAs generate by setting this variable.
9857 Since \*(UA does neither use nor update these non-standardized header
9858 fields (which in itself shows one of their conceptual problems),
9859 stripping them should increase interoperability in between MUAs that
9860 work with with same mailbox files.
9861 Note that, if this is not set but
9862 .Va writebackedited ,
9863 as below, is, a possibly performed automatic stripping of these header
9864 fields already marks the message as being modified.
9865 \*(ID At some future time \*(UA will be capable to rewrite and apply an
9866 .Va mime-encoding
9867 to modified messages, and then those fields will be stripped silently.
9870 .It Va keepsave
9871 \*(BO When a message is saved it is usually discarded from the
9872 originating folder when \*(UA is quit.
9873 This setting causes all saved message to be retained.
9876 .It Va line-editor-disable
9877 \*(BO Turn off any enhanced line editing capabilities (see
9878 .Sx "On terminal control and line editor"
9879 for more).
9882 .It Va line-editor-no-defaults
9883 \*(BO\*(OP Do not establish any default key binding.
9886 .It Va log-prefix
9887 Error log message prefix string
9888 .Pf ( Ql "\*(uA: " ) .
9891 .It Va mailbox-display
9892 \*(RO The name of the current mailbox
9893 .Pf ( Ic file ) ,
9894 possibly abbreviated for display purposes.
9897 .It Va mailbox-resolved
9898 \*(RO The fully resolved path of the current mailbox.
9901 .It Va mailx-extra-rc
9902 An additional startup file that is loaded as the last of the
9903 .Sx "Resource files" .
9904 Use this file for commands that are not understood by other POSIX
9905 .Xr mailx 1
9906 implementations, i.e., mostly anything which is not covered by
9907 .Sx "Initial settings" .
9910 .It Va markanswered
9911 \*(BO When a message is replied to and this variable is set,
9912 it is marked as having been
9913 .Ic answered .
9914 See the section
9915 .Sx "Message states" .
9918 .It Va mbox-rfc4155
9919 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
9920 POSIX rules for detecting message boundaries (so-called
9921 .Ql From_
9922 lines) due to compatibility reasons, instead of the stricter rules that
9923 have been standardized in RFC 4155.
9924 This behaviour can be switched to the stricter RFC 4155 rules by
9925 setting this variable.
9926 (This is never necessary for any message newly generated by \*(UA,
9927 it only applies to messages generated by buggy or malicious MUAs, or may
9928 occur in old MBOX databases: \*(UA itself will choose a proper
9929 .Va mime-encoding
9930 to avoid false interpretation of
9931 .Ql From_
9932 content lines in the MBOX database.)
9934 This may temporarily be handy when \*(UA complains about invalid
9935 .Ql From_
9936 lines when opening a MBOX: in this case setting this variable and
9937 re-opening the mailbox in question may correct the result.
9938 If so, copying the entire mailbox to some other file, as in
9939 .Ql copy * SOME-FILE ,
9940 will perform proper, all-compatible
9941 .Ql From_
9942 quoting for all detected messages, resulting in a valid MBOX mailbox.
9943 Finally the variable can be unset again:
9944 .Bd -literal -offset indent
9945 define mboxfix {
9946   localopts yes; wysh set mbox-rfc4155;\e
9947     wysh File "${1}"; eval copy * "${2}"
9949 call mboxfix /tmp/bad.mbox /tmp/good.mbox
9953 .It Va memdebug
9954 \*(BO Internal development variable.
9957 .It Va message-id-disable
9958 \*(BO By setting this variable the generation of
9959 .Ql Message-ID:
9961 .Ql Content-ID:
9962 message and MIME part headers can be completely suppressed, effectively
9963 leaving this task up to the
9964 .Va mta
9965 (Mail-Transfer-Agent) or the SMTP server.
9966 Note that according to RFC 5321 a SMTP server is not required to add this
9967 field by itself, so it should be ensured that it accepts messages without
9968 .Ql Message-ID .
9971 .It Va message-inject-head
9972 A string to put at the beginning of each new message, followed by a newline.
9973 \*(OB The escape sequences tabulator
9974 .Ql \et
9975 and newline
9976 .Ql \en
9977 are understood (use the
9978 .Cm wysh
9979 prefix when
9980 .Ic set Ns
9981 ting the variable(s) instead).
9984 .It Va message-inject-tail
9985 A string to put at the end of each new message, followed by a newline.
9986 \*(OB The escape sequences tabulator
9987 .Ql \et
9988 and newline
9989 .Ql \en
9990 are understood (use the
9991 .Cm wysh
9992 prefix when
9993 .Ic set Ns
9994 ting the variable(s) instead).
9997 .It Va metoo
9998 \*(BO Usually, when an
9999 .Ic alias
10000 expansion contains the sender, the sender is removed from the expansion.
10001 Setting this option suppresses these removals.
10002 Note that a set
10003 .Va metoo
10004 also causes a
10005 .Ql -m
10006 option to be passed through to the
10007 .Va mta
10008 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
10009 this flag, no MTA is known which does not support it (for historical
10010 compatibility).
10013 .It Va mime-allow-text-controls
10014 \*(BO When sending messages, each part of the message is MIME-inspected
10015 in order to classify the
10016 .Ql Content-Type:
10018 .Ql Content-Transfer-Encoding:
10019 (see
10020 .Va mime-encoding )
10021 that is required to send this part over mail transport, i.e.,
10022 a computation rather similar to what the
10023 .Xr file 1
10024 command produces when used with the
10025 .Ql --mime
10026 option.
10028 This classification however treats text files which are encoded in
10029 UTF-16 (seen for HTML files) and similar character sets as binary
10030 octet-streams, forcefully changing any
10031 .Ql text/plain
10033 .Ql text/html
10034 specification to
10035 .Ql application/octet-stream :
10036 If that actually happens a yet unset charset MIME parameter is set to
10037 .Ql binary ,
10038 effectively making it impossible for the receiving MUA to automatically
10039 interpret the contents of the part.
10041 If this variable is set, and the data was unambiguously identified as
10042 text data at first glance (by a
10043 .Ql .txt
10045 .Ql .html
10046 file extension), then the original
10047 .Ql Content-Type:
10048 will not be overwritten.
10051 .It Va mime-alternative-favour-rich
10052 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
10053 HTML) will be preferred in favour of included plain text versions when
10054 displaying messages, provided that a handler exists which produces
10055 output that can be (re)integrated into \*(UA's normal visual display.
10056 (E.g., at the time of this writing some newsletters ship their full
10057 content only in the rich HTML part, whereas the plain text part only
10058 contains topic subjects.)
10061 .It Va mime-counter-evidence
10062 Normally the
10063 .Ql Content-Type:
10064 field is used to decide how to handle MIME parts.
10065 Some MUAs, however, do not use
10066 .Sx "The mime.types files"
10067 (also see
10068 .Sx "HTML mail and MIME attachments" )
10069 or a similar mechanism to correctly classify content, but specify an
10070 unspecific MIME type
10071 .Pf ( Ql application/octet-stream )
10072 even for plain text attachments.
10073 If this variable is set then \*(UA will try to re-classify such MIME
10074 message parts, if possible, for example via a possibly existing
10075 attachment filename.
10076 A non-empty value may also be given, in which case a number is expected,
10077 actually a carrier of bits, best specified as a binary value, e.g.,
10078 .Ql 0b1111 .
10080 .Bl -bullet -compact
10082 If bit two is set (counting from 1, decimal 2) then the detected
10083 .Ic mimetype
10084 will be carried along with the message and be used for deciding which
10085 MIME handler is to be used, for example;
10086 when displaying such a MIME part the part-info will indicate the
10087 overridden content-type by showing a plus sign
10088 .Ql + .
10090 If bit three is set (decimal 4) then the counter-evidence is always
10091 produced and a positive result will be used as the MIME type, even
10092 forcefully overriding the parts given MIME type.
10094 If bit four is set (decimal 8) as a last resort the actual content of
10095 .Ql application/octet-stream
10096 parts will be inspected, so that data which looks like plain text can be
10097 treated as such.
10098 This mode is even more relaxed when data is to be displayed to the user
10099 or used as a message quote (data consumers which mangle data for display
10100 purposes, which includes masking of control characters, for example).
10104 .It Va mime-encoding
10105 The MIME
10106 .Ql Content-Transfer-Encoding
10107 to use in outgoing text messages and message parts, where applicable.
10108 (7-bit clean text messages are sent as-is, without a transfer encoding.)
10109 Valid values are:
10111 .Bl -tag -compact -width ".It Ql _%%_"
10112 .It Ql 8bit
10113 .Pf (Or\0 Ql 8b . )
10114 8-bit transport effectively causes the raw data be passed through
10115 unchanged, but may cause problems when transferring mail messages over
10116 channels that are not ESMTP (RFC 1869) compliant.
10117 Also, several input data constructs are not allowed by the
10118 specifications and may cause a different transfer-encoding to be used.
10119 .It Ql quoted-printable
10120 .Pf (Or\0 Ql qp . )
10121 Quoted-printable encoding is 7-bit clean and has the property that ASCII
10122 characters are passed through unchanged, so that an english message can
10123 be read as-is; it is also acceptable for other single-byte locales that
10124 share many characters with ASCII, like, e.g., ISO-8859-1.
10125 The encoding will cause a large overhead for messages in other character
10126 sets: e.g., it will require up to twelve (12) bytes to encode a single
10127 UTF-8 character of four (4) bytes.
10128 It is the default encoding.
10129 .It Ql base64
10130 .Pf (Or\0 Ql b64 . )
10131 This encoding is 7-bit clean and will always be used for binary data.
10132 This encoding has a constant input:output ratio of 3:4, regardless of
10133 the character set of the input data it will encode three bytes of input
10134 to four bytes of output.
10135 This transfer-encoding is not human readable without performing
10136 a decoding step.
10140 .It Va mimetypes-load-control
10141 Can be used to control which of
10142 .Sx "The mime.types files"
10143 are loaded: if the letter
10144 .Ql u
10145 is part of the option value, then the user's personal
10146 .Pa \*(vU
10147 file will be loaded (if it exists); likewise the letter
10148 .Ql s
10149 controls loading of the system wide
10150 .Pa \*(vS ;
10151 directives found in the user file take precedence, letter matching is
10152 case-insensitive.
10153 If this variable is not set \*(UA will try to load both files.
10154 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
10155 but they will be matched last (the order can be listed via
10156 .Ic mimetype ) .
10158 More sources can be specified by using a different syntax: if the
10159 value string contains an equals sign
10160 .Ql =
10161 then it is instead parsed as a comma-separated list of the described
10162 letters plus
10163 .Ql f=FILENAME
10164 pairs; the given filenames will be expanded and loaded, and their
10165 content may use the extended syntax that is described in the section
10166 .Sx "The mime.types files" .
10167 Directives found in such files always take precedence (are prepended to
10168 the MIME type cache).
10172 .It Va mta
10173 To choose an alternate Mail-Transfer-Agent, set this option to either
10174 the full pathname of an executable (optionally prefixed with the protocol
10175 .Ql file:// ) ,
10176 or \*(OPally a SMTP a.k.a. SUBMISSION protocol URL, e.g., \*(IN
10178 .Dl submissions://[user[:password]@]server[:port]
10180 (\*(OU:
10181 .Ql [smtp://]server[:port] . )
10182 The default has been chosen at compile time.
10183 All supported data transfers are executed in child processes, which
10184 run asynchronously and without supervision unless either the
10185 .Va sendwait
10186 or the
10187 .Va verbose
10188 variable is set.
10189 If such a child receives a TERM signal, it will abort and
10190 .Va save
10191 the message to
10192 .Ev DEAD ,
10193 if so configured.
10196 For a file-based MTA it may be necessary to set
10197 .Va mta-argv0
10198 in in order to choose the right target of a modern
10199 .Xr mailwrapper 8
10200 environment.
10201 It will be passed command line arguments from several possible sources:
10202 from the variable
10203 .Va mta-arguments
10204 if set, from the command line if given and the variable
10205 .Va expandargv
10206 allows their use.
10207 Argument processing of the MTA will be terminated with a
10208 .Fl \&\&-
10209 separator.
10212 The otherwise occurring implicit usage of the following MTA command
10213 line arguments can be disabled by setting the boolean variable
10214 .Va mta-no-default-arguments
10215 (which will also disable passing
10216 .Fl \&\&-
10217 to the MTA):
10218 .Fl \&\&i
10219 (for not treating a line with only a dot
10220 .Ql \&.
10221 character as the end of input),
10222 .Fl \&\&m
10223 (shall the variable
10224 .Va metoo
10225 be set) and
10226 .Fl \&\&v
10227 (if the
10228 .Va verbose
10229 variable is set); in conjunction with the
10230 .Fl r
10231 command line option \*(UA will also (not) pass
10232 .Fl \&\&f
10233 as well as possibly
10234 .Fl \&\&F .
10237 \*(OPally \*(UA can send mail over SMTP a.k.a. SUBMISSION network
10238 connections to a single defined smart host by setting this variable to
10239 a SMTP or SUBMISSION URL (see
10240 .Sx "On URL syntax and credential lookup" ) .
10241 An authentication scheme can be specified via the variable chain
10242 .Va smtp-auth .
10243 Encrypted network connections are \*(OPally available, the section
10244 .Sx "Encrypted network communication"
10245 should give an overview and provide links to more information on this.
10246 Note that with some mail providers it may be necessary to set the
10247 .Va smtp-hostname
10248 variable in order to use a specific combination of
10249 .Va from ,
10250 .Va hostname
10252 .Va mta .
10253 \*(UA also supports forwarding of all network traffic over a specified
10254 .Va socks-proxy .
10255 The following SMTP variants may be used:
10257 .Bl -bullet
10259 The plain SMTP protocol (RFC 5321) that normally lives on the
10260 server port 25 and requires setting the
10261 .Va smtp-use-starttls
10262 variable to enter a TLS encrypted session state.
10263 Assign a value like \*(IN
10264 .Ql smtp://[user[:password]@]server[:port]
10265 (\*(OU
10266 .Ql smtp://server[:port] )
10267 to choose this protocol.
10269 The so-called SMTPS which is supposed to live on server port 465
10270 and is automatically TLS secured.
10271 Unfortunately it never became a standardized protocol and may thus not
10272 be supported by your hosts network service database
10273 \(en in fact the port number has already been reassigned to other
10274 protocols!
10276 SMTPS is nonetheless a commonly offered protocol and thus can be
10277 chosen by assigning a value like \*(IN
10278 .Ql smtps://[user[:password]@]server[:port]
10279 (\*(OU
10280 .Ql smtps://server[:port] ) ;
10281 due to the mentioned problems it is usually necessary to explicitly
10282 specify the port as
10283 .Ql :465 ,
10284 however.
10286 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
10287 is identically to the SMTP protocol from \*(UA's point of view;
10288 it requires setting
10289 .Va smtp-use-starttls
10290 to enter a TLS secured session state; e.g., \*(IN
10291 .Ql submission://[user[:password]@]server[:port] .
10293 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
10294 TLS secured by default.
10295 It can be chosen by assigning a value like \*(IN
10296 .Ql submissions://[user[:password]@]server[:port] .
10297 Due to the problems mentioned for SMTPS above and the fact that
10298 SUBMISSIONS is new and a successor that lives on the same port as the
10299 historical engineering mismanagement named SMTPS, it is usually
10300 necessary to explicitly specify the port as
10301 .Ql :465 .
10306 .It Va mta-arguments
10307 Arguments to pass through to a file-based
10308 .Va mta
10309 can be given via this variable, which is parsed according to
10310 .Sx "Shell-style argument quoting"
10311 into an array of arguments, and which will be joined onto MTA options
10312 from other sources, and then passed individually to the MTA:
10313 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
10316 .It Va mta-no-default-arguments
10317 \*(BO Unless this variable is set \*(UA will pass some well known
10318 standard command line options to a file-based
10319 .Va mta
10320 (Mail-Transfer-Agent), see there for more.
10323 .It Va mta-no-receiver-arguments
10324 \*(BO By default a file-based
10325 .Va mta
10326 will be passed all receiver addresses on the command line.
10327 This variable can be set to suppress any such argument.
10330 .It Va mta-argv0
10331 Many systems use a so-called
10332 .Xr mailwrapper 8
10333 environment to ensure compatibility with
10334 .Xr sendmail 1 .
10335 This works by inspecting the name that was used to invoke the mail
10336 delivery system.
10337 If this variable is set then the mailwrapper (the program that is
10338 actually executed when calling the file-based
10339 .Va mta )
10340 will treat its contents as that name.
10342 .Mx Va netrc-lookup
10343 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
10344 \*(BO\*(IN\*(OP Used to control usage of the user's
10345 .Pa \*(VN
10346 file for lookup of account credentials, as documented in the section
10347 .Sx "On URL syntax and credential lookup"
10348 and for the command
10349 .Ic netrc ;
10350 the section
10351 .Sx "The .netrc file"
10352 documents the file format.
10353 Also see
10354 .Va netrc-pipe .
10357 .It Va netrc-pipe
10358 \*(IN\*(OP When
10359 .Pa \*(VN
10360 is loaded (see
10361 .Ic netrc
10363 .Va netrc-lookup )
10364 then \*(UA will read the output of a shell pipe instead of the user's
10365 .Pa \*(VN
10366 file if this variable is set (to the desired shell command).
10367 This can be used to, e.g., store
10368 .Pa \*(VN
10369 in encrypted form:
10370 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
10373 .It Va newfolders
10374 \*(OP If this variable has the value
10375 .Ql maildir ,
10376 newly created local folders will be in Maildir instead of MBOX format.
10379 .It Va newmail
10380 Checks for new mail in the current folder each time the prompt is shown.
10381 A Maildir folder must be re-scanned to determine if new mail has arrived.
10382 If this variable is set to the special value
10383 .Ql nopoll
10384 then a Maildir folder will not be rescanned completely, but only
10385 timestamp changes are detected.
10386 Maildir folders are \*(OPal.
10389 .It Va outfolder
10390 \*(BO Unless specified as absolute pathnames, causes the filename given
10391 in the
10392 .Va record
10393 variable
10394 and the sender-based filenames for the
10395 .Ic Copy
10397 .Ic Save
10398 commands to be interpreted relative to the directory given in the
10399 .Va folder
10400 variable rather than relative to the current directory.
10402 .Mx Va on-account-cleanup
10403 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
10404 Macro hook which will be called once an
10405 .Ic account
10406 is left, as the very last step before unrolling per-account
10407 .Ic localopts .
10408 This hook is run even in case of fatal errors, and it is advisable to
10409 perform only absolutely necessary actions, like cleaning up
10410 .Ic alternates ,
10411 for example.
10412 The specialized form is used in favour of the generic one if found.
10415 .It Va on-compose-cleanup
10416 Macro hook which will be called after the message has been sent (or not,
10417 in case of failures), as the very last step before unrolling compose mode
10418 .Ic localopts .
10419 This hook is run even in case of fatal errors, and it is advisable to
10420 perform only absolutely necessary actions, like cleaning up
10421 .Ic alternates ,
10422 for example.
10424 For compose mode hooks that may affect the message content please see
10425 .Va on-compose-enter , on-compose-leave , on-compose-splice .
10426 \*(ID This hook exists because
10427 .Ic alias , alternates , commandalias , shortcut ,
10428 to name a few, are neither covered by
10429 .Ic localopts
10430 nor by
10431 .Cm local :
10432 changes applied in compose mode will continue to be in effect thereafter.
10437 .It Va on-compose-enter , on-compose-leave
10438 Macro hooks which will be called once compose mode is entered,
10439 and after composing has been finished, respectively;
10440 the exact order of the steps taken is documented for
10441 .Ic ~. ,
10442 one of the
10443 .Sx "COMMAND ESCAPES" .
10444 Context about the message being worked on can be queried via
10445 .Ic digmsg .
10446 .Ic localopts
10447 are enabled for these hooks, and changes on variables will be forgotten
10448 after the message has been sent.
10449 .Va on-compose-cleanup
10450 can be used to perform other necessary cleanup steps.
10453 Here is am example that injects a signature via
10454 .Va message-inject-tail ;
10455 instead using
10456 .Va on-compose-splice
10457 to simply inject the file of desire via
10458 .Ic ~<
10460 .Ic ~<!
10461 may be a better approach.
10463 .Bd -literal -offset indent
10464 define t_ocl {
10465   vput ! i cat ~/.mysig
10466   if [ $? -eq 0 ]
10467      vput vexpr message-inject-tail trim-end $i
10468   end
10470   # Alternatively
10471   readctl create ~/.mysig
10472   if [ $? -eq 0 ]
10473     readall i
10474     if [ $? -eq 0 ]
10475       vput vexpr message-inject-tail trim-end $i
10476     end
10477     readctl remove ~/.mysig
10478   end
10480 set on-compose-leave=t_ocl
10486 .It Va on-compose-splice , on-compose-splice-shell
10487 These hooks run once the normal compose mode is finished, but before the
10488 .Va on-compose-leave
10489 macro hook is called etc.
10490 Both hooks will be executed in a subprocess, with their input and output
10491 connected to \*(UA such that they can act as if they would be an
10492 interactive user.
10493 The difference in between them is that the latter is a
10494 .Ev SHELL
10495 command, whereas the former is a normal
10496 .Ic define Ns
10497 d macro, but which is restricted to a small set of commands (the
10498 .Va verbose
10499 output of, e.g.,
10500 .Ic list
10501 will indicate said capability).
10502 .Ic localopts
10503 are enabled for these hooks (in the parent process), causing any setting
10504 to be forgotten after the message has been sent;
10505 .Va on-compose-cleanup
10506 can be used to perform other cleanup as necessary.
10509 During execution of these hooks \*(UA will temporarily forget whether it
10510 has been started in interactive mode, (a restricted set of)
10511 .Sx "COMMAND ESCAPES"
10512 will always be available, and for guaranteed reproducibilities sake
10513 .Va escape
10515 .Va ifs
10516 will be set to their defaults.
10517 The compose mode command
10518 .Ic ~^
10519 has been especially designed for scriptability (via these hooks).
10520 The first line the hook will read on its standard input is the protocol
10521 version of said command escape, currently
10522 .Dq 0 0 1 :
10523 backward incompatible protocol changes have to be expected.
10526 Care must be taken to avoid deadlocks and other false control flow:
10527 if both involved processes wait for more input to happen at the
10528 same time, or one does not expect more input but the other is stuck
10529 waiting for consumption of its output, etc.
10530 There is no automatic synchronization of the hook: it will not be
10531 stopped automatically just because it, e.g., emits
10532 .Ql ~x .
10533 The hooks will however receive a termination signal if the parent enters
10534 an error condition.
10535 \*(ID Protection against and interaction with signals is not yet given;
10536 it is likely that in the future these scripts will be placed in an
10537 isolated session, which is signalled in its entirety as necessary.
10539 .Bd -literal -offset indent
10540 define ocs_signature {
10541   read version
10542   echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
10544 set on-compose-splice=ocs_signature
10546 wysh set on-compose-splice-shell=$'\e
10547   read version;\e
10548   printf "hello $version!  Headers: ";\e
10549   echo \e'~^header list\e';\e
10550   read status result;\e
10551   echo "status=$status result=$result";\e
10552   '
10554 define ocsm {
10555   read version
10556   echo Splice protocol version is $version
10557   echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
10558   if [ "$es" != 2 ]
10559     echoerr 'Cannot read header list'; echo '~x'; xit
10560   endif
10561   if [ "$hl" @i!% ' cc' ]
10562     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
10563       vput vexpr es substring "${es}" 0 1
10564     if [ "$es" != 2 ]
10565       echoerr 'Cannot insert Cc: header'; echo '~x'
10566       # (no xit, macro finishs anyway)
10567     endif
10568   endif
10570 set on-compose-splice=ocsm
10575 .It Va on-resend-cleanup
10576 \*(ID Identical to
10577 .Va on-compose-cleanup ,
10578 but is only triggered by
10579 .Ic resend .
10582 .It Va on-resend-enter
10583 \*(ID Identical to
10584 .Va on-compose-enter ,
10585 but is only triggered by
10586 .Ic resend ;
10587 currently there is no
10588 .Ic digmsg
10589 support, for example.
10592 .It Va page
10593 \*(BO If set, each message feed through the command given for
10594 .Ic pipe
10595 is followed by a formfeed character
10596 .Ql \ef .
10598 .Mx Va password
10599 .It Va password-USER@HOST , password-HOST , password
10600 \*(IN Variable chain that sets a password, which is used in case none has
10601 been given in the protocol and account-specific URL;
10602 as a last resort \*(UA will ask for a password on the user's terminal if
10603 the authentication method requires a password.
10604 Specifying passwords in a startup file is generally a security risk;
10605 the file should be readable by the invoking user only.
10607 .It Va password-USER@HOST
10608 \*(OU (see the chain above for \*(IN)
10609 Set the password for
10610 .Ql USER
10611 when connecting to
10612 .Ql HOST .
10613 If no such variable is defined for a host,
10614 the user will be asked for a password on standard input.
10615 Specifying passwords in a startup file is generally a security risk;
10616 the file should be readable by the invoking user only.
10619 .It Va piperaw
10620 \*(BO Send messages to the
10621 .Ic pipe
10622 command without performing MIME and character set conversions.
10626 .It Va pipe-TYPE/SUBTYPE
10627 When a MIME message part of type
10628 .Ql TYPE/SUBTYPE
10629 (case-insensitive) is displayed or quoted,
10630 its text is filtered through the value of this variable interpreted as
10631 a shell command.
10632 Note that only parts which can be displayed inline as plain text (see
10633 .Cd copiousoutput )
10634 are displayed unless otherwise noted, other MIME parts will only be
10635 considered by and for the command
10636 .Ic mimeview .
10639 The special value commercial at
10640 .Ql @
10641 forces interpretation of the message part as plain text, e.g.,
10642 .Ql set pipe-application/xml=@
10643 will henceforth display XML
10644 .Dq as is .
10645 (The same could also be achieved by adding a MIME type marker with the
10646 .Ic mimetype
10647 command.
10648 And \*(OPally MIME type handlers may be defined via
10649 .Sx "The Mailcap files"
10650 \(em these directives,
10651 .Cd copiousoutput
10652 has already been used, should be referred to for further documentation.
10655 The commercial at
10656 .Ql @
10657 can in fact be used as a trigger character to adjust usage and behaviour
10658 of a following shell command specification more thoroughly by appending
10659 more special characters which refer to further mailcap directives, e.g.,
10660 the following hypothetical command specification could be used:
10662 .Bd -literal -offset indent
10663 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
10667 .Bl -tag -compact -width ".It Ql __"
10668 .It Ql *
10669 The command produces plain text to be integrated in \*(UAs output:
10670 .Cd copiousoutput .
10672 .It Ql #
10673 If set the handler will not be invoked when a message is to be quoted,
10674 but only when it will be displayed:
10675 .Cd x-mailx-noquote .
10677 .It Ql &
10678 Run the command asynchronously, i.e., without blocking \*(UA:
10679 .Cd x-mailx-async .
10681 .It Ql \&!
10682 The command must be run on an interactive terminal, \*(UA will
10683 temporarily release the terminal to it:
10684 .Cd needsterminal .
10686 .It Ql +
10687 Request creation of a zero-sized temporary file, the absolute pathname
10688 of which will be made accessible via the environment variable
10689 .Ev MAILX_FILENAME_TEMPORARY :
10690 .Cd x-mailx-tmpfile .
10691 If given twice then the file will be unlinked automatically by \*(UA
10692 when the command loop is entered again at latest:
10693 .Cd x-mailx-tmpfile-unlink .
10695 .It Ql =
10696 Normally the MIME part content is passed to the handler via standard
10697 input; if this flag is set then the data will instead be written into
10698 .Ev MAILX_FILENAME_TEMPORARY
10699 .Pf ( Cd x-mailx-tmpfile-fill ) ,
10700 the creation of which is implied; note however that in order to cause
10701 deletion of the temporary file you still have to use two plus signs
10702 .Ql ++
10703 explicitly!
10705 .It Ql @
10706 To avoid ambiguities with normal shell command content you can use
10707 another commercial at to forcefully terminate interpretation of
10708 remaining characters.
10709 (Any character not in this list will have the same effect.)
10713 Some information about the MIME part to be displayed is embedded into
10714 the environment of the shell command:
10717 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
10719 .It Ev MAILX_CONTENT
10720 The MIME content-type of the part, if known, the empty string otherwise.
10723 .It Ev MAILX_CONTENT_EVIDENCE
10725 .Va mime-counter-evidence
10726 includes the carry-around-bit (2), then this will be set to the detected
10727 MIME content-type; not only then identical to
10728 .Ev \&\&MAILX_CONTENT
10729 otherwise.
10732 .It Ev MAILX_EXTERNAL_BODY_URL
10733 MIME parts of type
10734 .Ql message/external-body access-type=url
10735 will store the access URL in this variable, it is empty otherwise.
10736 URL targets should not be activated automatically, without supervision.
10739 .It Ev MAILX_FILENAME
10740 The filename, if any is set, the empty string otherwise.
10743 .It Ev MAILX_FILENAME_GENERATED
10744 A random string.
10747 .It Ev MAILX_FILENAME_TEMPORARY
10748 If temporary file creation has been requested through the command prefix
10749 this variable will be set and contain the absolute pathname of the
10750 temporary file.
10755 .It Va pipe-EXTENSION
10756 This is identical to
10757 .Va pipe-TYPE/SUBTYPE
10758 except that
10759 .Ql EXTENSION
10760 (normalized to lowercase using character mappings of the ASCII charset)
10761 names a file extension, e.g.,
10762 .Ql xhtml .
10763 Handlers registered using this method take precedence.
10765 .Mx Va pop3-auth
10766 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
10767 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
10768 The only possible value as of now is
10769 .Ql plain ,
10770 which is thus the default.
10772 .Mx Va pop3-bulk-load
10773 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
10774 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
10775 the messages, and only requests the message bodies on user request.
10776 For the POP3 protocol this means that the message headers will be
10777 downloaded twice.
10778 If this variable is set then \*(UA will download only complete messages
10779 from the given POP3 server(s) instead.
10781 .Mx Va pop3-keepalive
10782 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
10783 \*(OP POP3 servers close the connection after a period of inactivity;
10784 the standard requires this to be at least 10 minutes,
10785 but practical experience may vary.
10786 Setting this variable to a numeric value greater than
10787 .Ql 0
10788 causes a
10789 .Ql NOOP
10790 command to be sent each value seconds if no other operation is performed.
10792 .Mx Va pop3-no-apop
10793 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
10794 \*(BO\*(OP Unless this variable is set the
10795 .Ql APOP
10796 authentication method will be used when connecting to a POP3 server that
10797 advertises support.
10798 The advantage of
10799 .Ql APOP
10800 is that the password is not sent in clear text over the wire and that
10801 only a single packet is sent for the user/password tuple.
10802 Note that
10803 .Va pop3-no-apop-HOST
10804 requires \*(IN.
10806 .Mx Va pop3-use-starttls
10807 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
10808 \*(BO\*(OP Causes \*(UA to issue a
10809 .Ql STLS
10810 command to make an unencrypted POP3 session TLS encrypted.
10811 This functionality is not supported by all servers,
10812 and is not used if the session is already encrypted by the POP3S method.
10813 Note that
10814 .Va pop3-use-starttls-HOST
10815 requires \*(IN.
10819 .It Va posix
10820 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
10821 where that deviates from standardized behaviour.
10822 It will be set implicitly before the
10823 .Sx "Resource files"
10824 are loaded if the environment variable
10825 .Ev POSIXLY_CORRECT
10826 is set, and adjusting any of those two will be reflected by the other
10827 one implicitly.
10828 The following behaviour is covered and enforced by this mechanism:
10831 .Bl -bullet -compact
10833 In non-interactive mode, any error encountered while loading resource
10834 files during program startup will cause a program exit, whereas in
10835 interactive mode such errors will stop loading of the currently loaded
10836 (stack of) file(s, i.e., recursively).
10837 These exits can be circumvented on a per-command base by using
10838 .Cm ignerr ,
10839 one of the
10840 .Sx "Command modifiers" ,
10841 for each command which shall be allowed to fail.
10844 .Ic alternates
10845 will replace the list of alternate addresses instead of appending to it.
10846 In addition alternates will only be honoured for any sort of message
10847 .Ic reply ,
10848 and for aliases.
10851 The variable inserting
10852 .Sx "COMMAND ESCAPES"
10853 .Ic ~A ,
10854 .Ic ~a ,
10855 .Ic ~I
10857 .Ic ~i
10858 will expand embedded character sequences
10859 .Ql \et
10860 horizontal tabulator and
10861 .Ql \en
10862 line feed.
10863 \*(ID For compatibility reasons this step will always be performed.
10866 Upon changing the active
10867 .Ic file
10868 no summary of
10869 .Ic headers
10870 will be displayed even if
10871 .Va header
10872 is set.
10875 Setting
10876 .Va ignoreeof
10877 implies the behaviour described by
10878 .Va dot .
10881 The variable
10882 .Va keep
10883 is extended to cover any empty mailbox, not only empty
10884 .Mx -sx
10885 .Sx "primary system mailbox" Ns
10886 es: they will be removed when they are left in empty state otherwise.
10891 .It Va print-alternatives
10892 \*(BO When a MIME message part of type
10893 .Ql multipart/alternative
10894 is displayed and it contains a subpart of type
10895 .Ql text/plain ,
10896 other parts are normally discarded.
10897 Setting this variable causes all subparts to be displayed,
10898 just as if the surrounding part was of type
10899 .Ql multipart/mixed .
10902 .It Va prompt
10903 The string used as a prompt in interactive mode.
10904 Whenever the variable is evaluated the value is treated as if specified
10905 within dollar-single-quotes (see
10906 .Sx "Shell-style argument quoting" ) .
10907 This (post-assignment, i.e., second) expansion can be used to embed
10908 status information, for example
10909 .Va \&? ,
10910 .Va \&! ,
10911 .Va account
10913 .Va mailbox-display .
10915 In order to embed characters which should not be counted when
10916 calculating the visual width of the resulting string, enclose the
10917 characters of interest in a pair of reverse solidus escaped brackets:
10918 .Ql \e[\eE[0m\e] ;
10919 a slot for coloured prompts is also available with the \*(OPal command
10920 .Ic colour .
10921 Prompting may be prevented by setting this to the null string
10922 (a.k.a.\|
10923 .Ql set noprompt ) .
10926 .It Va prompt2
10927 This string is used for secondary prompts, but is otherwise identical to
10928 .Va prompt .
10929 The default is
10930 .Ql ..\0 .
10933 .It Va quiet
10934 \*(BO Suppresses the printing of the version when first invoked.
10937 .It Va quote
10938 If set a
10939 .Ic reply
10940 message is started with the quoted original message,
10941 the lines of which are prefixed by the value of the variable
10942 .Va indentprefix ,
10943 taking into account
10944 .Va quote-chars
10946 .Va quote-fold .
10947 If set to the empty value, the quoted message will be preceded and
10948 followed by the expansions of the values of
10949 .Va quote-inject-head
10951 .Va quote-inject-tail ,
10952 respectively.
10953 None of the headers of the quoted message is included in the quote if
10954 the value equals
10955 .Ql noheading ,
10956 and only the headers selected by the
10957 .Ql type
10958 .Ic headerpick
10959 selection are put above the message body for
10960 .Ql headers ,
10961 whereas all headers and all MIME parts are included for
10962 .Ql allheaders .
10963 Also see
10964 .Va quote-as-attachment
10966 .Ic ~Q ,
10967 one of the
10968 .Sx "COMMAND ESCAPES" .
10971 .It Va quote-as-attachment
10972 \*(BO Add the original message in its entirety as a
10973 .Ql message/rfc822
10974 MIME attachment when replying to a message.
10975 Note this works regardless of the setting of
10976 .Va quote .
10979 .It Va quote-chars
10980 Can be set to a string consisting of non-whitespace ASCII characters
10981 which shall be treated as quotation leaders, the default being
10982 .Ql >|}: .
10985 .It Va quote-fold
10986 \*(OP Can be set in addition to
10987 .Va indentprefix ,
10988 and creates a more fancy quotation in that leading quotation characters
10989 .Pf ( Va quote-chars )
10990 are compressed and overlong lines are folded.
10991 .Va \&\&quote-fold
10992 can be set to either one, two or three (space separated) numeric values,
10993 which are interpreted as the maximum (goal) and the minimum line length,
10994 respectively, in a spirit rather equal to the
10995 .Xr fmt 1
10996 program, but line- instead of paragraph-based.
10997 The third value is used as the maximum line length instead of the first
10998 if no better break point can be found; it is ignored unless it is larger
10999 than the minimum and smaller than the maximum.
11000 If not set explicitly the minimum will reflect the goal algorithmically.
11001 The goal cannot be smaller than the length of
11002 .Va indentprefix
11003 plus some additional pad; necessary adjustments take place silently.
11008 .It Va quote-inject-head , quote-inject-tail
11009 The strings to put before and after the text of a
11010 .Va quote Ns
11011 d message, respectively.
11012 The former defaults to
11013 .Ql %f wrote:\en\en .
11014 Special format directives will be expanded if possible, and if so
11015 configured the output will be folded according to
11016 .Va quote-fold .
11017 Format specifiers in the given strings start with a percent sign
11018 .Ql %
11019 and expand values of the original message, unless noted otherwise.
11020 Note that names and addresses are not subject to the setting of
11021 .Va showto .
11022 Valid format specifiers are:
11025 .Bl -tag -compact -width ".It Ql _%%_"
11026 .It Ql %%
11027 A plain percent sign.
11028 .It Ql %a
11029 The address(es) of the sender(s).
11030 .It Ql %d
11031 The date found in the
11032 .Ql Date:
11033 header of the message when
11034 .Va datefield
11035 is set (the default), otherwise the date when the message was received.
11036 Formatting can be controlled by assigning a
11037 .Xr strftime 3
11038 format string to
11039 .Va datefield
11040 (and
11041 .Va datefield-markout-older ) .
11042 .It Ql %f
11043 The full name(s) (name and address, as given) of the sender(s).
11044 .It Ql %i
11046 .Ql Message-ID: .
11047 .It Ql %n
11048 The real name(s) of the sender(s) if there is one and
11049 .Va showname
11050 allows usage, the address(es) otherwise.
11051 .It Ql %r
11052 The senders real name(s) if there is one, the address(es) otherwise.
11057 .It Va r-option-implicit
11058 \*(BO Setting this option evaluates the contents of
11059 .Va from
11060 (or, if that contains multiple addresses,
11061 .Va sender )
11062 and passes the results onto the used (file-based) MTA as described for the
11063 .Fl r
11064 option (empty argument case).
11067 .It Va recipients-in-cc
11068 \*(BO When doing a
11069 .Ic reply ,
11070 the original
11071 .Ql From:
11073 .Ql To:
11074 are by default merged into the new
11075 .Ql To: .
11076 If this variable is set, only the original
11077 .Ql From:
11078 ends in the new
11079 .Ql To: ,
11080 the rest is merged into
11081 .Ql Cc: .
11084 .It Va record
11085 Unless this variable is defined, no copies of outgoing mail will be saved.
11086 If defined it gives the pathname, subject to the usual
11087 .Sx "Filename transformations" ,
11088 of a folder where all new, replied-to or forwarded messages are saved:
11089 when saving to this folder fails the message is not sent, but instead
11090 .Va save Ns
11091 d to
11092 .Ev DEAD .
11093 The standard defines that relative (fully expanded) paths are to be
11094 interpreted relative to the current directory
11095 .Pf ( Ic cwd ) ,
11096 to force interpretation relative to
11097 .Va folder
11098 .Va outfolder
11099 needs to be set in addition.
11102 .It Va record-files
11103 \*(BO If this variable is set the meaning of
11104 .Va record
11105 will be extended to cover messages which target only file and pipe
11106 recipients (see
11107 .Va expandaddr ) .
11108 These address types will not appear in recipient lists unless
11109 .Va add-file-recipients
11110 is also set.
11113 .It Va record-resent
11114 \*(BO If this variable is set the meaning of
11115 .Va record
11116 will be extended to also cover the
11117 .Ic resend
11119 .Ic Resend
11120 commands.
11123 .It Va reply-in-same-charset
11124 \*(BO If this variable is set \*(UA first tries to use the same
11125 character set of the original message for replies.
11126 If this fails, the mechanism described in
11127 .Sx "Character sets"
11128 is evaluated as usual.
11131 .It Va reply-strings
11132 Can be set to a comma-separated list of (case-insensitive according to
11133 ASCII rules) strings which shall be recognized in addition to the
11134 built-in strings as
11135 .Ql Subject:
11136 reply message indicators \(en built-in are
11137 .Ql Re: ,
11138 which is mandated by RFC 5322, as well as the german
11139 .Ql Aw: ,
11140 .Ql Antw: ,
11141 and the
11142 .Ql Wg:
11143 which often has been seen in the wild;
11144 I.e., the separating colon has to be specified explicitly.
11147 .It Va reply-to
11148 A list of addresses to put into the
11149 .Ql Reply-To:
11150 field of the message header.
11151 Members of this list are handled as if they were in the
11152 .Ic alternates
11153 list.
11155 .It Va replyto
11156 \*(OB Variant of
11157 .Va reply-to .
11160 .It Va reply-to-honour
11161 Controls whether a
11162 .Ql Reply-To:
11163 header is honoured when replying to a message via
11164 .Ic reply
11166 .Ic Lreply .
11167 This is a quadoption; if set without a value it defaults to
11168 .Dq yes .
11171 .It Va rfc822-body-from_
11172 \*(BO This variable can be used to force displaying a so-called
11173 .Ql From_
11174 line for messages that are embedded into an envelope mail via the
11175 .Ql message/rfc822
11176 MIME mechanism, for more visual convenience.
11179 .It Va save
11180 \*(BO Enable saving of (partial) messages in
11181 .Ev DEAD
11182 upon interrupt or delivery error.
11185 .It Va screen
11186 The number of lines that represents a
11187 .Dq screenful
11188 of lines, used in
11189 .Ic headers
11190 summary display,
11191 .Ic from
11192 .Ic search Ns
11193 ing, message
11194 .Ic top Ns
11195 line display and scrolling via
11196 .Ic z .
11197 If this variable is not set \*(UA falls back to a calculation based upon
11198 the detected terminal window size and the baud rate: the faster the
11199 terminal, the more will be shown.
11200 Overall screen dimensions and pager usage is influenced by the
11201 environment variables
11202 .Ev COLUMNS
11204 .Ev LINES
11205 and the variable
11206 .Va crt .
11209 .It Va searchheaders
11210 \*(BO Expand message-list specifiers in the form
11211 .Ql /x:y
11212 to all messages containing the substring
11213 .Dq y
11214 in the header field
11215 .Ql x .
11216 The string search is case insensitive.
11219 .It Va sendcharsets
11220 \*(OP A comma-separated list of character set names that can be used in
11221 outgoing internet mail.
11222 The value of the variable
11223 .Va charset-8bit
11224 is automatically appended to this list of character sets.
11225 If no character set conversion capabilities are compiled into \*(UA then
11226 the only supported charset is
11227 .Va ttycharset .
11228 Also see
11229 .Va sendcharsets-else-ttycharset
11230 and refer to the section
11231 .Sx "Character sets"
11232 for the complete picture of character set conversion in \*(UA.
11235 .It Va sendcharsets-else-ttycharset
11236 \*(BO\*(OP If this variable is set, but
11237 .Va sendcharsets
11238 is not, then \*(UA acts as if
11239 .Va sendcharsets
11240 had been set to the value of the variable
11241 .Va ttycharset .
11242 In effect this combination passes through the message data in the
11243 character set of the current locale encoding:
11244 therefore mail message text will be (assumed to be) in ISO-8859-1
11245 encoding when send from within a ISO-8859-1 locale, and in UTF-8
11246 encoding when send from within an UTF-8 locale.
11248 The 8-bit fallback
11249 .Va charset-8bit
11250 never comes into play as
11251 .Va ttycharset
11252 is implicitly assumed to be 8-bit and capable to represent all files the
11253 user may specify (as is the case when no character set conversion
11254 support is available in \*(UA and the only supported character set is
11255 .Va ttycharset :
11256 .Sx "Character sets" ) .
11257 This might be a problem for scripts which use the suggested
11258 .Ql LC_ALL=C
11259 setting, since in this case the character set is US-ASCII by definition,
11260 so that it is better to also override
11261 .Va ttycharset ,
11262 then.
11265 .It Va sender
11266 An address that is put into the
11267 .Ql Sender:
11268 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
11269 responsible for the actual transmission of the message.
11270 This field should normally not be used unless the
11271 .Va from
11272 field contains more than one address, on which case it is required.
11273 Dependent on the context this address is handled as if it were in
11274 the list of
11275 .Ic alternates .
11276 Also see
11277 .Fl r ,
11278 .Va r-option-implicit .
11280 .It Va sendmail
11281 \*(OB Predecessor of
11282 .Va mta .
11284 .It Va sendmail-arguments
11285 \*(OB Predecessor of
11286 .Va mta-arguments .
11288 .It Va sendmail-no-default-arguments
11289 \*(OB\*(BO Predecessor of
11290 .Va mta-no-default-arguments .
11292 .It Va sendmail-progname
11293 \*(OB Predecessor of
11294 .Va mta-argv0 .
11297 .It Va sendwait
11298 \*(BO When sending a message wait until the
11299 .Va mta
11300 (including the built-in SMTP one) exits before accepting further commands.
11301 .Sy Only
11302 with this variable set errors reported by the MTA will be recognizable!
11303 If the MTA returns a non-zero exit status,
11304 the exit status of \*(UA will also be non-zero.
11307 .It Va showlast
11308 \*(BO This setting causes \*(UA to start at the last message
11309 instead of the first one when opening a mail folder, as well as with
11310 .Ic from
11312 .Ic headers .
11315 .It Va showname
11316 \*(BO Causes \*(UA to use the sender's real name instead of the plain
11317 address in the header field summary and in message specifications.
11320 .It Va showto
11321 \*(BO Causes the recipient of the message to be shown in the header
11322 summary if the message was sent by the user.
11325 .It Va Sign
11326 The value backing
11327 .Ic ~A ,
11328 one of the
11329 .Sx "COMMAND ESCAPES" .
11330 Also see
11331 .Va message-inject-tail ,
11332 .Va on-compose-leave
11334 .Va on-compose-splice .
11337 .It Va sign
11338 The value backing
11339 .Ic ~a ,
11340 one of the
11341 .Sx "COMMAND ESCAPES" .
11342 Also see
11343 .Va message-inject-tail ,
11344 .Va on-compose-leave
11346 .Va on-compose-splice .
11349 .It Va signature
11350 \*(OB Please use
11351 .Va on-compose-splice
11353 .Va on-compose-splice-shell
11355 .Va on-compose-leave
11356 and (if necessary)
11357 .Va message-inject-tail
11358 instead!
11361 .It Va skipemptybody
11362 \*(BO If an outgoing message does not contain any text in its first or
11363 only message part, do not send it but discard it silently (see also the
11364 command line option
11365 .Fl E ) .
11369 .It Va smime-ca-dir , smime-ca-file
11370 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
11371 Enhanced Mail) for the purpose of verification of S/MIME signed messages.
11372 .Va tls-ca-dir
11373 documents the necessary preparation steps to use the former.
11374 The set of CA certificates which are built into the TLS library can
11375 be explicitly turned off by setting
11376 .Va smime-ca-no-defaults ,
11377 and further fine-tuning is possible via
11378 .Va smime-ca-flags .
11381 .It Va smime-ca-flags
11382 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
11383 storage, and the certificate verification that is used.
11384 The actual values and their meanings are documented for
11385 .Va tls-ca-flags .
11388 .It Va smime-ca-no-defaults
11389 \*(BO\*(OP Do not load the default CA locations that are built into the
11390 used to TLS library to verify S/MIME signed messages.
11392 .Mx Va smime-cipher
11393 .It Va smime-cipher-USER@HOST , smime-cipher
11394 \*(OP Specifies the cipher to use when generating S/MIME encrypted
11395 messages (for the specified account).
11396 RFC 5751 mandates a default of
11397 .Ql aes128
11398 (AES-128 CBC).
11399 Possible values are (case-insensitive and) in decreasing cipher strength:
11400 .Ql aes256
11401 (AES-256 CBC),
11402 .Ql aes192
11403 (AES-192 CBC),
11404 .Ql aes128
11405 (AES-128 CBC),
11406 .Ql des3
11407 (DES EDE3 CBC, 168 bits; default if
11408 .Ql aes128
11409 is not available) and
11410 .Ql des
11411 (DES CBC, 56 bits).
11413 The actually available cipher algorithms depend on the cryptographic
11414 library that \*(UA uses.
11415 \*(OP Support for more cipher algorithms may be available through
11416 dynamic loading via, e.g.,
11417 .Xr EVP_get_cipherbyname 3
11418 (OpenSSL) if \*(UA has been compiled to support this.
11421 .It Va smime-crl-dir
11422 \*(OP Specifies a directory that contains files with CRLs in PEM format
11423 to use when verifying S/MIME messages.
11426 .It Va smime-crl-file
11427 \*(OP Specifies a file that contains a CRL in PEM format to use when
11428 verifying S/MIME messages.
11431 .It Va smime-encrypt-USER@HOST
11432 \*(OP If this variable is set, messages send to the given receiver are
11433 encrypted before sending.
11434 The value of the variable must be set to the name of a file that
11435 contains a certificate in PEM format.
11437 If a message is sent to multiple recipients,
11438 each of them for whom a corresponding variable is set will receive an
11439 individually encrypted message;
11440 other recipients will continue to receive the message in plain text
11441 unless the
11442 .Va smime-force-encryption
11443 variable is set.
11444 It is recommended to sign encrypted messages, i.e., to also set the
11445 .Va smime-sign
11446 variable.
11449 .It Va smime-force-encryption
11450 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
11453 .It Va smime-sign
11454 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
11455 and include the user's certificate as a MIME attachment.
11456 Signing a message enables a recipient to verify that the sender used
11457 a valid certificate,
11458 that the email addresses in the certificate match those in the message
11459 header and that the message content has not been altered.
11460 It does not change the message text,
11461 and people will be able to read the message as usual.
11462 Also see
11463 .Va smime-sign-cert , smime-sign-include-certs
11465 .Va smime-sign-digest .
11467 .Mx Va smime-sign-cert
11468 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
11469 \*(OP Points to a file in PEM format.
11470 For the purpose of signing and decryption this file needs to contain the
11471 user's private key, followed by his certificate.
11473 For message signing
11474 .Ql USER@HOST
11475 is always derived from the value of
11476 .Va from
11477 (or, if that contains multiple addresses,
11478 .Va sender ) .
11479 For the purpose of encryption the recipient's public encryption key
11480 (certificate) is expected; the command
11481 .Ic certsave
11482 can be used to save certificates of signed messages (the section
11483 .Sx "Signed and encrypted messages with S/MIME"
11484 gives some details).
11485 This mode of operation is usually driven by the specialized form.
11487 When decrypting messages the account is derived from the recipient
11488 fields
11489 .Pf ( Ql To:
11491 .Ql Cc: )
11492 of the message, which are searched for addresses for which such
11493 a variable is set.
11494 \*(UA always uses the first address that matches,
11495 so if the same message is sent to more than one of the user's addresses
11496 using different encryption keys, decryption might fail.
11498 For signing and decryption purposes it is possible to use encrypted
11499 keys, and the pseudo-host(s)
11500 .Ql USER@HOST.smime-cert-key
11501 for the private key
11502 (and
11503 .Ql USER@HOST.smime-cert-cert
11504 for the certificate stored in the same file)
11505 will be used for performing any necessary password lookup,
11506 therefore the lookup can be automated via the mechanisms described in
11507 .Sx "On URL syntax and credential lookup" .
11508 For example, the hypothetical address
11509 .Ql bob@exam.ple
11510 could be driven with a private key / certificate pair path defined in
11511 .Va \&\&smime-sign-cert-bob@exam.ple ,
11512 and needed passwords would then be looked up via the pseudo hosts
11513 .Ql bob@exam.ple.smime-cert-key
11514 (and
11515 .Ql bob@exam.ple.smime-cert-cert ) .
11516 To include intermediate certificates, use
11517 .Va smime-sign-include-certs .
11519 .Mx Va smime-sign-digest
11520 .It Va smime-sign-digest-USER@HOST , smime-sign-digest
11521 \*(OP Specifies the message digestto use when signing S/MIME messages.
11522 Please remember that for this use case
11523 .Ql USER@HOST
11524 refers to the variable
11525 .Va from
11526 (or, if that contains multiple addresses,
11527 .Va sender ) .
11528 The available algorithms depend on the used cryptographic library, but
11529 at least one usable builtin algorithm is ensured as a default.
11530 If possible the standard RFC 5751 will be violated by using
11531 .Ql SHA512
11532 instead of the mandated
11533 .Ql SHA1
11534 due to security concerns.
11536 \*(UA will try to add built-in support for the following message
11537 digests, names are case-insensitive:
11538 .Ql BLAKE2b512 ,
11539 .Ql BLAKE2s256 ,
11540 .Ql SHA3-512 ,
11541 .Ql SHA3-384 ,
11542 .Ql SHA3-256 ,
11543 .Ql SHA3-224 ,
11544 as well as the widely available
11545 .Ql SHA512 ,
11546 .Ql SHA384 ,
11547 .Ql SHA256 ,
11548 .Ql SHA224 ,
11549 and the proposed insecure
11550 .Ql SHA1
11552 .Ql MD5 .
11553 More digests may \*(OPally be available through dynamic loading via,
11554 e.g., the OpenSSL function
11555 .Xr EVP_get_digestbyname 3 .
11557 .Mx Va smime-sign-include-certs
11558 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
11559 \*(OP If used, this is supposed to a consist of a comma-separated list
11560 of files, each of which containing a single certificate in PEM format to
11561 be included in the S/MIME message in addition to the
11562 .Va smime-sign-cert
11563 certificate.
11564 This can be used to include intermediate certificates of the certificate
11565 authority, in order to allow the receiver's S/MIME implementation to
11566 perform a verification of the entire certificate chain, starting from
11567 a local root certificate, over the intermediate certificates, down to the
11568 .Va smime-sign-cert .
11569 Even though top level certificates may also be included in the chain,
11570 they won't be used for the verification on the receiver's side.
11572 For the purpose of the mechanisms involved here,
11573 .Ql USER@HOST
11574 refers to the content of the internal variable
11575 .Va from
11576 (or, if that contains multiple addresses,
11577 .Va sender ) .
11578 The pseudo-host
11579 .Ql USER@HOST.smime-include-certs
11580 will be used for performing password lookups for these certificates,
11581 shall they have been given one, therefore the lookup can be automated
11582 via the mechanisms described in
11583 .Sx "On URL syntax and credential lookup" .
11585 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
11586 \*(OB\*(OP Predecessor(s) of
11587 .Va smime-sign-digest .
11589 .It Va smtp
11590 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
11591 .Va mta .
11592 \*(ID For compatibility reasons a set
11593 .Va smtp
11594 is used in preference of
11595 .Va mta .
11597 .Mx Va smtp-auth
11598 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
11599 \*(OP Variable chain that controls the SMTP
11600 .Va mta
11601 authentication method, possible values are
11602 .Ql none
11603 (\*(OU default),
11604 .Ql plain
11605 (\*(IN default),
11606 .Ql login
11607 as well as the \*(OPal methods
11608 .Ql cram-md5
11610 .Ql gssapi .
11612 .Ql none
11613 method does not need any user credentials,
11614 .Ql gssapi
11615 requires a user name and all other methods require a user name and
11616 a password.
11617 See \*(IN
11618 .Va mta ,
11619 .Va user
11621 .Va password
11622 (\*(OU
11623 .Va smtp-auth-password
11625 .Va smtp-auth-user ) .
11626 Note that
11627 .Va smtp-auth-HOST
11628 is \*(IN.
11629 \*(OU: Note for
11630 .Va smtp-auth-USER@HOST :
11631 may override dependent on sender address in the variable
11632 .Va from .
11634 .It Va smtp-auth-password
11635 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
11636 If the authentication method requires a password, but neither
11637 .Va smtp-auth-password
11638 nor a matching
11639 .Va smtp-auth-password-USER@HOST
11640 can be found,
11641 \*(UA will ask for a password on the user's terminal.
11643 .It Va smtp-auth-password-USER@HOST
11644 \*(OU Overrides
11645 .Va smtp-auth-password
11646 for specific values of sender addresses, dependent upon the variable
11647 .Va from .
11649 .It Va smtp-auth-user
11650 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
11651 If the authentication method requires a user name, but neither
11652 .Va smtp-auth-user
11653 nor a matching
11654 .Va smtp-auth-user-USER@HOST
11655 can be found,
11656 \*(UA will ask for a user name on the user's terminal.
11658 .It Va smtp-auth-user-USER@HOST
11659 \*(OU Overrides
11660 .Va smtp-auth-user
11661 for specific values of sender addresses, dependent upon the variable
11662 .Va from .
11665 .It Va smtp-hostname
11666 \*(OP\*(IN Normally \*(UA uses the variable
11667 .Va from
11668 to derive the necessary
11669 .Ql USER@HOST
11670 information in order to issue a
11671 .Ql MAIL FROM:<>
11672 SMTP
11673 .Va mta
11674 command.
11675 Setting
11676 .Va smtp-hostname
11677 can be used to use the
11678 .Ql USER
11679 from the SMTP account
11680 .Pf ( Va mta
11681 or the
11682 .Va user
11683 variable chain)
11684 and the
11685 .Ql HOST
11686 from the content of this variable (or, if that is the empty string,
11687 .Va hostname
11688 or the local hostname as a last resort).
11689 This often allows using an address that is itself valid but hosted by
11690 a provider other than which (in
11691 .Va from )
11692 is about to send the message.
11693 Setting this variable also influences generated
11694 .Ql Message-ID:
11696 .Ql Content-ID:
11697 header fields.
11698 If the \*(OPal IDNA support is available (see
11699 .Va idna-disable )
11700 variable assignment is aborted when a necessary conversion fails.
11702 .Mx Va smtp-use-starttls
11703 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
11704 \*(BO\*(OP Causes \*(UA to issue a
11705 .Ql STARTTLS
11706 command to make an SMTP
11707 .Va mta
11708 session TLS encrypted, i.e., to enable transport layer security.
11710 .Mx Va socks-proxy
11711 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
11712 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
11713 \*(UA will proxy all of its network activities through it.
11714 This can be used to proxy SMTP, POP3 etc. network traffic through the
11715 Tor anonymizer, for example.
11716 The following would create a local SOCKS proxy on port 10000 that
11717 forwards to the machine
11718 .Ql HOST ,
11719 and from which the network traffic is actually instantiated:
11720 .Bd -literal -offset indent
11721 # Create local proxy server in terminal 1 forwarding to HOST
11722 $ ssh -D 10000 USER@HOST
11723 # Then, start a client that uses it in terminal 2
11724 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
11728 .It Va spam-interface
11729 \*(OP In order to use any of the spam-related commands (like, e.g.,
11730 .Ic spamrate )
11731 the desired spam interface must be defined by setting this variable.
11732 Please refer to the manual section
11733 .Sx "Handling spam"
11734 for the complete picture of spam handling in \*(UA.
11735 All or none of the following interfaces may be available:
11737 .Bl -tag -width ".It Ql _ilte_"
11738 .It Ql spamc
11739 Interaction with
11740 .Xr spamc 1
11741 from the
11742 .Xr spamassassin 1
11743 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
11744 suite.
11745 Different to the generic filter interface \*(UA will automatically add
11746 the correct arguments for a given command and has the necessary
11747 knowledge to parse the program's output.
11748 A default value for
11749 .Va spamc-command
11750 will have been compiled into the \*(UA binary if
11751 .Xr spamc 1
11752 has been found in
11753 .Ev PATH
11754 during compilation.
11755 Shall it be necessary to define a specific connection type (rather than
11756 using a configuration file for that), the variable
11757 .Va spamc-arguments
11758 can be used as in, e.g.,
11759 .Ql -d server.example.com -p 783 .
11760 It is also possible to specify a per-user configuration via
11761 .Va spamc-user .
11762 Note that this interface does not inspect the
11763 .Ql is-spam
11764 flag of a message for the command
11765 .Ic spamforget .
11767 .It Ql filter
11768 generic spam filter support via freely configurable hooks.
11769 This interface is meant for programs like
11770 .Xr bogofilter 1
11771 and requires according behaviour in respect to the hooks' exit
11772 status for at least the command
11773 .Ic spamrate
11774 .Pf ( Ql 0
11775 meaning a message is spam,
11776 .Ql 1
11777 for non-spam,
11778 .Ql 2
11779 for unsure and any other return value indicating a hard error);
11780 since the hooks can include shell code snippets diverting behaviour
11781 can be intercepted as necessary.
11782 The hooks are
11783 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
11784   spamfilter-rate
11786 .Va spamfilter-spam ;
11787 the manual section
11788 .Sx "Handling spam"
11789 contains examples for some programs.
11790 The process environment of the hooks will have the variable
11791 .Ev MAILX_FILENAME_GENERATED
11792 set.
11793 Note that spam score support for
11794 .Ic spamrate
11795 is not supported unless the \*(OPtional regular expression support is
11796 available and the
11797 .Va spamfilter-rate-scanscore
11798 variable is set.
11803 .It Va spam-maxsize
11804 \*(OP Messages that exceed this size will not be passed through to the
11805 configured
11806 .Va spam-interface .
11807 If unset or 0, the default of 420000 bytes is used.
11810 .It Va spamc-command
11811 \*(OP The path to the
11812 .Xr spamc 1
11813 program for the
11814 .Ql spamc
11815 .Va spam-interface .
11816 Note that the path is not expanded, but used
11817 .Dq as is .
11818 A fallback path will have been compiled into the \*(UA binary if the
11819 executable had been found during compilation.
11822 .It Va spamc-arguments
11823 \*(OP Even though \*(UA deals with most arguments for the
11824 .Ql spamc
11825 .Va spam-interface
11826 automatically, it may at least sometimes be desirable to specify
11827 connection-related ones via this variable, e.g.,
11828 .Ql -d server.example.com -p 783 .
11831 .It Va spamc-user
11832 \*(OP Specify a username for per-user configuration files for the
11833 .Ql spamc
11834 .Va spam-interface .
11835 If this is set to the empty string then \*(UA will use the name of the
11836 current
11837 .Va user .
11844 .It Va spamfilter-ham , spamfilter-noham , \
11845   spamfilter-nospam , spamfilter-rate , spamfilter-spam
11846 \*(OP Command and argument hooks for the
11847 .Ql filter
11848 .Va spam-interface .
11849 The manual section
11850 .Sx "Handling spam"
11851 contains examples for some programs.
11854 .It Va spamfilter-rate-scanscore
11855 \*(OP Because of the generic nature of the
11856 .Ql filter
11857 .Va spam-interface
11858 spam scores are not supported for it by default, but if the \*(OPnal
11859 regular expression support is available then setting this variable can
11860 be used to overcome this restriction.
11861 It is interpreted as follows: first a number (digits) is parsed that
11862 must be followed by a semicolon
11863 .Ql \&;
11864 and an extended regular expression.
11865 Then the latter is used to parse the first output line of the
11866 .Va spamfilter-rate
11867 hook, and, in case the evaluation is successful, the group that has been
11868 specified via the number is interpreted as a floating point scan score.
11870 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
11871   ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
11872 \*(OB\*(OP Predecessors of
11873 .Va tls-ca-file ,
11874 .Va tls-ca-dir .
11876 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
11877 \*(OB\*(OP Predecessor of
11878 .Va tls-ca-flags .
11880 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
11881   ssl-ca-no-defaults
11882 \*(OB\*(BO\*(OP Predecessor of
11883 .Va tls-ca-no-defaults .
11885 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
11886 \*(OB\*(OP Please use the
11887 .Cd Certificate
11888 slot of
11889 .Va tls-config-pairs .
11891 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
11892 \*(OB\*(OP Please use the
11893 .Cd CipherString
11894 slot of
11895 .Va tls-config-pairs .
11897 .It Va ssl-config-file
11898 \*(OB\*(OP Predecessor of
11899 .Va tls-config-file .
11901 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
11902   ssl-config-module
11903 \*(OB\*(OP Predecessor of
11904 .Va tls-config-module .
11906 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
11907 \*(OB\*(OP Predecessor of
11908 .Va tls-config-pairs .
11910 .It Va ssl-crl-dir , ssl-crl-file
11911 \*(OB\*(OP Predecessors of
11912 .Va tls-crl-dir ,
11913 .Va tls-crl-file .
11915 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
11916 \*(OB\*(OP Please use the
11917 .Cd Curves
11918 slot of
11919 .Va tls-config-pairs .
11921 .It Va ssl-features
11922 \*(OB\*(OP\*(RO Predecessor of
11923 .Va tls-features .
11925 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
11926 \*(OB\*(OP Please use the
11927 .Cd PrivateKey
11928 slot of
11929 .Va tls-config-pairs .
11931 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
11932 \*(OB\*(OP Please use the
11933 .Cd Protocol
11934 slot of
11935 .Va tls-config-pairs .
11937 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
11938 \*(OB\*(OP Please use the
11939 .Cd Protocol
11940 slot of
11941 .Va tls-config-pairs .
11943 .It Va ssl-rand-file
11944 \*(OB\*(OP Predecessor of
11945 .Va tls-rand-file .
11947 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
11948 \*(OB\*(OP Predecessor of
11949 .Va tls-verify .
11952 .It Va stealthmua
11953 If only set without an assigned value, then this setting inhibits the
11954 generation of the
11955 .Ql Message-ID: ,
11956 .Ql Content-ID:
11958 .Ql User-Agent:
11959 header fields that include obvious references to \*(UA.
11960 There are two pitfalls associated with this:
11961 First, the message id of outgoing messages is not known anymore.
11962 Second, an expert may still use the remaining information in the header
11963 to track down the originating mail user agent.
11964 If set to the value
11965 .Ql noagent ,
11966 then the mentioned
11967 .Ql Message-ID:
11969 .Ql Content-ID:
11970 suppression does not occur.
11973 .It Va system-mailrc
11974 \*(RO The compiled in path of the system wide initialization file
11975 one of the
11976 .Sx "Resource files" :
11977 .Pa \*(UR .
11981 .It Va termcap
11982 (\*(OP) This specifies a comma-separated list of
11983 .Lb libterminfo
11984 and/or
11985 .Lb libtermcap
11986 capabilities (see
11987 .Sx "On terminal control and line editor" ,
11988 escape commas with reverse solidus) to be used to overwrite or define
11989 entries.
11990 .Sy Note
11991 this variable will only be queried once at program startup and can
11992 thus only be specified in resource files or on the command line.
11995 String capabilities form
11996 .Ql cap=value
11997 pairs and are expected unless noted otherwise.
11998 Numerics have to be notated as
11999 .Ql cap#number
12000 where the number is expected in normal decimal notation.
12001 Finally, booleans do not have any value but indicate a true or false
12002 state simply by being defined or not; this indeed means that \*(UA
12003 does not support undefining an existing boolean.
12004 String capability values will undergo some expansions before use:
12005 for one notations like
12006 .Ql ^LETTER
12007 stand for
12008 .Ql control-LETTER ,
12009 and for clarification purposes
12010 .Ql \eE
12011 can be used to specify
12012 .Ql escape
12013 (the control notation
12014 .Ql ^[
12015 could lead to misreadings when a left bracket follows, which it does for
12016 the standard CSI sequence);
12017 finally three letter octal sequences, as in
12018 .Ql \e061 ,
12019 are supported.
12020 To specify that a terminal supports 256-colours, and to define sequences
12021 that home the cursor and produce an audible bell, one might write:
12023 .Bd -literal -offset indent
12024 ? set termcap='Co#256,home=\eE[H,bel=^G'
12028 The following terminal capabilities are or may be meaningful for the
12029 operation of the built-in line editor or \*(UA in general:
12032 .Bl -tag -compact -width ".It Cd yay"
12033 .\" HAVE_COLOUR
12034 .It Cd colors Ns \0or Cd Co
12035 .Cd max_colors :
12036 numeric capability specifying the maximum number of colours.
12037 Note that \*(UA does not actually care about the terminal beside that,
12038 but always emits ANSI / ISO 6429 escape sequences.
12040 .\" HAVE_TERMCAP
12041 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
12042 .Cd exit_ca_mode
12044 .Cd enter_ca_mode ,
12045 respectively: exit and enter the alternative screen ca-mode,
12046 effectively turning \*(UA into a fullscreen application.
12047 This must be enabled explicitly by setting
12048 .Va termcap-ca-mode .
12050 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
12051 .Cd keypad_xmit
12053 .Cd keypad_local ,
12054 respectively: enable and disable the keypad.
12055 This is always enabled if available, because it seems even keyboards
12056 without keypads generate other key codes for, e.g., cursor keys in that
12057 case, and only if enabled we see the codes that we are interested in.
12059 .It Cd ed Ns \0or Cd cd
12060 .Cd clr_eos :
12061 clear the screen.
12063 .It Cd clear Ns \0or Cd cl
12064 .Cd clear_screen :
12065 clear the screen and home cursor.
12066 (Will be simulated via
12067 .Cd ho
12068 plus
12069 .Cd cd . )
12071 .It Cd home Ns \0or Cd ho
12072 .Cd cursor_home :
12073 home cursor.
12075 .\" HAVE_MLE
12076 .It Cd el Ns \0or Cd ce
12077 .Cd clr_eol :
12078 clear to the end of line.
12079 (Will be simulated via
12080 .Cd ch
12081 plus repetitions of space characters.)
12083 .It Cd hpa Ns \0or Cd ch
12084 .Cd column_address :
12085 move the cursor (to the given column parameter) in the current row.
12086 (Will be simulated via
12087 .Cd cr
12088 plus
12089 .Cd nd . )
12091 .It Cd cr
12092 .Cd carriage_return :
12093 move to the first column in the current row.
12094 The default built-in fallback is
12095 .Ql \er .
12097 .It Cd cub1 Ns \0or Cd le
12098 .Cd cursor_left :
12099 move the cursor left one space (non-destructively).
12100 The default built-in fallback is
12101 .Ql \eb .
12103 .It Cd cuf1 Ns \0or Cd nd
12104 .Cd cursor_right :
12105 move the cursor right one space (non-destructively).
12106 The default built-in fallback is
12107 .Ql \eE[C ,
12108 which is used by most terminals.
12109 Less often occur
12110 .Ql \eEC
12112 .Ql \eEOC .
12116 Many more capabilities which describe key-sequences are documented for
12117 .Ic bind .
12121 .It Va termcap-ca-mode
12122 \*(OP Allow usage of the
12123 .Cd exit_ca_mode
12125 .Cd enter_ca_mode
12126 terminal capabilities, see
12127 .Va termcap .
12128 .Sy Note
12129 this variable will only be queried once at program startup and can
12130 thus only be specified in resource files or on the command line.
12133 .It Va termcap-disable
12134 \*(OP Disable any interaction with a terminal control library.
12135 If set only some generic fallback built-ins and possibly the content of
12136 .Va termcap
12137 describe the terminal to \*(UA.
12138 .Sy Note
12139 this variable will only be queried once at program startup and can
12140 thus only be specified in resource files or on the command line.
12142 .Mx Va tls-ca-file
12143 .Mx Va tls-ca-dir
12144 .It Va tls-ca-dir-USER@HOST , tls-ca-dir-HOST , tls-ca-dir ,\
12145   tls-ca-file-USER@HOST , tls-ca-file-HOST , tls-ca-file
12146 \*(OP Directory and file, respectively, for pools of trusted CA
12147 certificates in PEM (Privacy Enhanced Mail) format, for the purpose of
12148 verification of TLS server certificates.
12149 Concurrent use is possible, the file is loaded once needed first, the
12150 directory lookup is performed anew as a last resort whenever necessary.
12151 The CA certificate pool built into the TLS library can be disabled via
12152 .Va tls-ca-no-defaults ,
12153 further fine-tuning is possible via
12154 .Va tls-ca-flags .
12155 Note the directory search variant requires the certificate files to
12156 adhere special filename conventions, please see
12157 .Xr SSL_CTX_load_verify_locations 3
12159 .Xr verify 1
12161 .Xr c_rehash 1 ) .
12164 .Mx Va tls-ca-flags
12165 .It Va tls-ca-flags-USER@HOST , tls-ca-flags-HOST , tls-ca-flags
12166 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
12167 storage, and the certificate verification that is used (also see
12168 .Va tls-verify ) .
12169 The value is expected to consist of a comma-separated list of
12170 configuration directives, with any intervening whitespace being ignored.
12171 The directives directly map to flags that can be passed to
12172 .Xr X509_STORE_set_flags 3 ,
12173 which are usually defined in a file
12174 .Pa openssl/x509_vfy.h ,
12175 and the availability of which depends on the used TLS library
12176 version: a directive without mapping is ignored (error log subject to
12177 .Va debug ) .
12178 Directives currently understood (case-insensitively) include:
12181 .Bl -tag -compact -width ".It Cd BaNg"
12182 .It Cd no-alt-chains
12183 If the initial chain is not trusted, do not attempt to build an
12184 alternative chain.
12185 Setting this flag will make OpenSSL certificate verification match that
12186 of older OpenSSL versions, before automatic building and checking of
12187 alternative chains has been implemented; also see
12188 .Cd trusted-first .
12189 .It Cd no-check-time
12190 Do not check certificate/CRL validity against current time.
12191 .It Cd partial-chain
12192 By default partial, incomplete chains which cannot be verified up to the
12193 chain top, a self-signed root certificate, will not verify.
12194 With this flag set, a chain succeeds to verify if at least one signing
12195 certificate of the chain is in any of the configured trusted stores of
12196 CA certificates.
12197 The OpenSSL manual page
12198 .Xr SSL_CTX_load_verify_locations 3
12199 gives some advise how to manage your own trusted store of CA certificates.
12200 .It Cd strict
12201 Disable workarounds for broken certificates.
12202 .It Cd trusted-first
12203 Try building a chain using issuers in the trusted store first to avoid
12204 problems with server-sent legacy intermediate certificates.
12205 Newer versions of OpenSSL support alternative chain checking and enable
12206 it by default, resulting in the same behaviour; also see
12207 .Cd no-alt-chains .
12211 .Mx Va tls-ca-no-defaults
12212 .It Va tls-ca-no-defaults-USER@HOST , tls-ca-no-defaults-HOST ,\
12213   tls-ca-no-defaults
12214 \*(BO\*(OP Do not load the default CA locations that are built into the
12215 used to TLS library to verify TLS server certificates.
12218 .It Va tls-config-file
12219 \*(OP If this variable is set
12220 .Xr CONF_modules_load_file 3
12221 (if announced via
12222 .Ql +modules-load-file
12224 .Va tls-features )
12225 is used to allow resource file based configuration of the TLS library.
12226 This happens once the library is used first, which may also be early
12227 during startup (logged with
12228 .Va verbose ) !
12229 If a non-empty value is given then the given file, after performing
12230 .Sx "Filename transformations" ,
12231 will be used instead of the TLS libraries global default, and it is an
12232 error if the file cannot be loaded.
12233 The application name will always be passed as
12234 .Ql \*(uA .
12235 Some TLS libraries support application-specific configuration via
12236 resource files loaded like this, please see
12237 .Va tls-config-module .
12239 .Mx Va tls-config-module
12240 .It Va tls-config-module-USER@HOST , tls-config-module-HOST ,\
12241   tls-config-module
12242 \*(OP If file based application-specific configuration via
12243 .Va tls-config-file
12244 is available, announced as
12245 .Ql +ctx-config
12247 .Va tls-features ,
12248 indicating availability of
12249 .Xr SSL_CTX_config 3 ,
12250 then, it becomes possible to use a central TLS configuration file
12251 for all programs, including \*(uA, e.g.:
12252 .Bd -literal -offset indent
12253 # Register a configuration section for \*(uA
12254 \*(uA = mailx_master
12255 # The top configuration section creates a relation
12256 # in between dynamic SSL configuration and an actual
12257 # program specific configuration section
12258 [mailx_master]
12259 ssl_conf = mailx_tls_config
12260 # Well that actual program specific configuration section
12261 # now can map individual tls-config-module names to sections,
12262 # e.g., tls-config-module=account_xy
12263 [mailx_tls_config]
12264 account_xy = mailx_account_xy
12265 account_yz = mailx_account_yz
12266 [mailx_account_xy]
12267 MinProtocol = TLSv1.2
12268 Curves=P-521
12269 [mailx_account_yz]
12270 CipherString = TLSv1.2:!aNULL:!eNULL:
12271 MinProtocol = TLSv1.1
12272 Options = Bugs
12276 .Mx Va tls-config-pairs
12277 .It Va tls-config-pairs-USER@HOST , tls-config-pairs-HOST , tls-config-pairs
12278 \*(OP The value of this variable chain will be interpreted as
12279 a comma-separated list of directive/value pairs.
12280 Directives and values need to be separated by equals signs
12281 .Ql = ,
12282 any whitespace surrounding pair members is removed.
12283 Keys are (usually) case-insensitive.
12284 Different to when placing these pairs in a
12285 .Va tls-config-module
12286 section of a
12287 .Va tls-config-file ,
12288 commas
12289 .Ql \&,
12290 need to be escaped with a reverse solidus
12291 .Ql \e
12292 when included in pairs; also different: if the equals sign
12293 .Ql =
12294 is preceded with an asterisk
12295 .Ql *
12296 .Sx "Filename transformations"
12297 will be performed on the value; it is an error if these fail.
12298 Unless proper support is announced by
12299 .Va tls-features
12300 .Pf ( Ql +conf-ctx )
12301 only the keys below are supported, otherwise the pairs will be used
12302 directly as arguments to the function
12303 .Xr SSL_CONF_cmd 3 .
12306 .Bl -tag -compact -width ".It Cd C_rtificate_"
12307 .It Cd Certificate
12308 Filename of a TLS client certificate (chain) required by some servers.
12309 Fallback support via
12310 .Xr SSL_CTX_use_certificate_chain_file 3 .
12311 .Sx "Filename transformations"
12312 are performed.
12313 .\" v15compat: remove the next sentence
12314 .Sy Note:
12315 if you use this you need to specify the private key via
12316 .Cd PrivateKey ,
12317 .Va tls-key
12318 will not be used!
12320 .It Cd CipherString
12321 A list of ciphers for TLS connections, see
12322 .Xr ciphers 1 .
12323 By default no list of ciphers is set, resulting in a
12324 .Cd Protocol Ns - Ns
12325 specific list of ciphers (the protocol standards define lists of
12326 acceptable ciphers; possibly cramped by the used TLS library).
12327 Fallback support via
12328 .Xr SSL_CTX_set_cipher_list 3 .
12330 .It Cd Ciphersuites
12331 A list of ciphers used for TLSv1.3 connections, see
12332 .Xr ciphers 1 .
12333 These will be joined onto the list of ciphers from
12334 .Cd CipherString .
12335 Available if
12336 .Va tls-features
12337 announces
12338 .Ql +ctx-set-ciphersuites ,
12339 as necessary via
12340 .Xr SSL_CTX_set_ciphersuites 3 .
12342 .It Cd Curves
12343 A list of supported elliptic curves, if applicable.
12344 By default no curves are set.
12345 Fallback support via
12346 .Xr SSL_CTX_set1_curves_list 3 ,
12347 if available.
12349 .It Cd MaxProtocol , MinProtocol
12350 The maximum and minimum supported TLS versions, respectively.
12351 Available if
12352 .Va tls-features
12353 announces
12354 .Ql +ctx-set-maxmin-proto ,
12355 as necessary via
12356 .Xr SSL_CTX_set_max_proto_version 3
12358 .Xr SSL_CTX_set_min_proto_version 3 ;
12359 these fallbacks use an internal parser which understands the strings
12360 .Ql SSLv3 ,
12361 .Ql TLSv1 ,
12362 .Ql TLSv1.1 ,
12363 .Ql TLSv1.2 ,
12364 .Ql TLSv1.3 ,
12365 and the special value
12366 .Ql None ,
12367 which disables the given limit.
12369 .It Cd Options
12370 Various flags to set.
12371 Fallback via
12372 .Xr SSL_CTX_set_options 3 ,
12373 in which case any other value but (exactly)
12374 .Ql Bugs
12375 results in an error.
12377 .It Cd PrivateKey
12378 Filename of the private key in PEM format of a TLS client certificate.
12379 If unset, the name of the certificate file is used.
12380 .Sx "Filename transformations"
12381 are performed.
12382 Fallback via
12383 .Xr SSL_CTX_use_PrivateKey_file 3 .
12384 .\" v15compat: remove the next sentence
12385 .Sy Note:
12386 if you use this you need to specify the certificate (chain) via
12387 .Cd Certificate ,
12388 .Va tls-cert
12389 will not be used!
12391 .It Cd Protocol
12392 The used TLS protocol.
12394 .Va tls-features
12395 announces
12396 .Ql +conf-ctx
12398 .Ql ctx-set-maxmin-proto
12399 then using
12400 .Cd MaxProtocol
12402 .Cd MinProtocol
12403 is preferable.
12404 Fallback is
12405 .Xr SSL_CTX_set_options 3 ,
12406 driven via an internal parser which understands the strings
12407 .Ql SSLv3 ,
12408 .Ql TLSv1 ,
12409 .Ql TLSv1.1 ,
12410 .Ql TLSv1.2 ,
12411 .Ql TLSv1.3 ,
12412 and the special value
12413 .Ql ALL .
12414 Multiple protocols may be given as a comma-separated list, any
12415 whitespace is ignored, an optional plus sign
12416 .Ql +
12417 prefix enables, a hyphen-minus
12418 .Ql -
12419 prefix disables a protocol, so that
12420 .Ql -ALL, TLSv1.2
12421 enables only the TLSv1.2 protocol.
12427 .It Va tls-crl-dir , tls-crl-file
12428 \*(OP Specify a directory / a file, respectively, that contains a CRL in
12429 PEM format to use when verifying TLS server certificates.
12432 .It Va tls-features
12433 \*(OP\*(RO This expands to a comma separated list of the TLS library
12434 identity and optional SSL library features.
12435 Currently supported identities are
12436 .Ql libressl
12437 (LibreSSL) ,
12438 .Ql libssl-0x10100
12439 (OpenSSL v1.1.x series)
12441 .Ql libssl-0x10000
12442 (elder OpenSSL series, other clones).
12443 Optional features are preceded with a plus sign
12444 .Ql +
12445 when available, and with a hyphen-minus
12446 .Ql -
12447 otherwise.
12449 Currently known features are
12450 .Ql modules-load-file
12451 .Pf ( Va tls-config-file ) ,
12452 .Ql conf-ctx
12453 .Pf ( Va tls-config-pairs ) ,
12454 .Ql ctx-config
12455 .Pf ( Va tls-config-module ) ,
12456 .Ql ctx-set-maxmin-proto
12457 .Pf ( Va tls-config-pairs ) ,
12458 .Ql ctx-set-ciphersuites
12459 (the
12460 .Cd Ciphersuites
12461 slot of
12462 .Va tls-config-pairs ) .
12464 .Mx Va tls-fingerprint
12465 .It Va tls-fingerprint-USER@HOST , tls-fingerprint-HOST , tls-fingerprint
12466 \*(OP It is possible to replace the verification of the connection
12467 peer certificate against the entire local pool of CAs (for more see
12468 .Sx "Encrypted network communication" )
12469 with the comparison against a precalculated certificate message digest,
12470 the so-called fingerprint, to be specified as the used
12471 .Va tls-fingerprint-digest .
12472 This fingerprint can be calculated with, e.g.,
12473 .Ql Ic tls Ns \:\0\:fingerprint HOST .
12475 .Mx Va tls-fingerprint-digest
12476 .It Va tls-fingerprint-digest-USER@HOST , tls-fingerprint-digest-HOST , \
12477   tls-fingerprint-digest
12478 \*(OP The message digest to be used when creating TLS certificate
12479 fingerprints, the defaults, if available, in test order, being
12480 .Ql BLAKE2s256 ,
12481 .Ql SHA256 .
12482 For the complete list of digest algorithms refer to
12483 .Va smime-sign-digest .
12486 .It Va tls-rand-file
12487 \*(OP Gives the filename to a file with random entropy data, see
12488 .Xr RAND_load_file 3 .
12489 If this variable is not set, or set to the empty string, or if the
12490 .Sx "Filename transformations"
12491 fail, then
12492 .Xr RAND_file_name 3
12493 will be used to create the filename.
12494 If the SSL PRNG was seeded successfully
12495 The file will be updated
12496 .Pf ( Xr RAND_write_file 3 )
12497 if and only if seeding and buffer stirring succeeds.
12499 .Mx Va tls-verify
12500 .It Va tls-verify-USER@HOST , tls-verify-HOST , tls-verify
12501 \*(OP Variable chain that sets the action to be performed if an error
12502 occurs during TLS server certificate validation against the
12503 specified or default trust stores
12504 .Va tls-ca-dir ,
12505 .Va tls-ca-file ,
12506 or the TLS library built-in defaults (unless usage disallowed via
12507 .Va tls-ca-no-defaults ) ,
12508 and as fine-tuned via
12509 .Va tls-ca-flags .
12510 Valid (case-insensitive) values are
12511 .Ql strict
12512 (fail and close connection immediately),
12513 .Ql ask
12514 (ask whether to continue on standard input),
12515 .Ql warn
12516 (show a warning and continue),
12517 .Ql ignore
12518 (do not perform validation).
12519 The default is
12520 .Ql ask .
12522 .It Va toplines
12523 If defined, gives the number of lines of a message to be displayed
12524 with the command
12525 .Ic top ;
12526 if unset, the first five lines are printed, if set to 0 the variable
12527 .Va screen
12528 is inspected.
12529 If the value is negative then its absolute value will be used for
12530 unsigned right shifting (see
12531 .Ic vexpr )
12533 .Va screen
12534 height.
12537 .It Va topsqueeze
12538 \*(BO If set then the
12539 .Ic top
12540 command series will strip adjacent empty lines and quotations.
12543 .It Va ttycharset
12544 The character set of the terminal \*(UA operates on,
12545 and the one and only supported character set that \*(UA can use if no
12546 character set conversion capabilities have been compiled into it,
12547 in which case it defaults to ISO-8859-1.
12548 Otherwise it defaults to UTF-8.
12549 Sufficient locale support provided the default will be preferably
12550 deduced from the locale environment if that is set (e.g.,
12551 .Ev LC_CTYPE ,
12552 see there for more); runtime locale changes will be reflected by
12553 .Va \&\&ttycharset
12554 except during the program startup phase and if
12555 .Fl S
12556 had been used to freeze the given value.
12557 Refer to the section
12558 .Sx "Character sets"
12559 for the complete picture about character sets.
12562 .It Va typescript-mode
12563 \*(BO A special multiplex variable that disables all variables and
12564 settings which result in behaviour that interferes with running \*(UA in
12565 .Xr script 1 ,
12566 e.g., it sets
12567 .Va colour-disable ,
12568 .Va line-editor-disable
12569 and (before startup completed only)
12570 .Va termcap-disable .
12571 Unsetting it does not restore the former state of the covered settings.
12574 .It Va umask
12575 For a safe-by-default policy the process file mode creation mask
12576 .Xr umask 2
12577 will be set to
12578 .Ql 0077
12579 on program startup by default.
12580 Child processes inherit the file mode creation mask of their parent, and
12581 by setting this variable to an empty value no change will be applied,
12582 and the inherited value will be used.
12583 Otherwise the given value will be made the new file mode creation mask.
12585 .Mx Va user
12586 .It Va user-HOST , user
12587 \*(IN Variable chain that sets a global fallback user name, which is
12588 used in case none has been given in the protocol and account-specific
12589 URL.
12590 This variable defaults to the name of the user who runs \*(UA.
12593 .It Va v15-compat
12594 \*(BO Setting this enables upward compatibility with \*(UA
12595 version 15.0 in respect to which configuration options are available and
12596 how they are handled.
12597 This manual uses \*(IN and \*(OU to refer to the new and the old way of
12598 doing things, respectively.
12601 .It Va verbose
12602 \*(BO This setting, also controllable via the command line option
12603 .Fl v ,
12604 causes \*(UA to be more verbose, e.g., it will display obsoletion
12605 warnings and TLS certificate chains.
12606 Even though marked \*(BO this option may be set twice in order to
12607 increase the level of verbosity even more, in which case even details of
12608 the actual message delivery and protocol conversations are shown.
12609 A single
12610 .Pf no Va verbose
12611 is sufficient to disable verbosity as such.
12618 .It Va version , version-date , \
12619   version-hexnum , version-major , version-minor , version-update
12620 \*(RO \*(UA version information: the first variable is a string with
12621 the complete version identification, the second the release date in ISO
12622 8601 notation without time.
12623 The third is a 32-bit hexadecimal number with the upper 8 bits storing
12624 the major, followed by the minor and update version numbers which occupy
12625 12 bits each.
12626 The latter three variables contain only decimal digits: the major, minor
12627 and update version numbers.
12628 The output of the command
12629 .Ic version
12630 will include this information.
12633 .It Va writebackedited
12634 If this variable is set messages modified using the
12635 .Ic edit
12637 .Ic visual
12638 commands are written back to the current folder when it is quit;
12639 it is only honoured for writable folders in MBOX format, though.
12640 Note that the editor will be pointed to the raw message content in that
12641 case, i.e., neither MIME decoding nor decryption will have been
12642 performed, and proper RFC 4155
12643 .Ql From_
12644 quoting of newly added or edited content is also left as an exercise to
12645 the user.
12647 .\" }}} (Variables)
12649 .\" }}} (INTERNAL VARIABLES)
12652 .\" .Sh ENVIRONMENT {{{
12653 .Sh ENVIRONMENT
12655 The term
12656 .Dq environment variable
12657 should be considered an indication that these variables are either
12658 standardized as vivid parts of process environments, or that they are
12659 commonly found in there.
12660 The process environment is inherited from the
12661 .Xr sh 1
12662 once \*(UA is started, and unless otherwise explicitly noted handling of
12663 the following variables transparently integrates into that of the
12664 .Sx "INTERNAL VARIABLES"
12665 from \*(UA's point of view.
12666 This means that, e.g., they can be managed via
12667 .Ic set
12669 .Ic unset ,
12670 causing automatic program environment updates (to be inherited by
12671 newly created child processes).
12674 In order to integrate other environment variables equally they need to
12675 be imported (linked) with the command
12676 .Ic environ .
12677 This command can also be used to set and unset non-integrated
12678 environment variables from scratch, sufficient system support provided.
12679 The following example, applicable to a POSIX shell, sets the
12680 .Ev COLUMNS
12681 environment variable for \*(UA only, and beforehand exports the
12682 .Ev EDITOR
12683 in order to affect any further processing in the running shell:
12685 .Bd -literal -offset indent
12686 $ EDITOR="vim -u ${HOME}/.vimrc"
12687 $ export EDITOR
12688 $ COLUMNS=80 \*(uA -R
12691 .Bl -tag -width ".It Ev BaNg"
12693 .It Ev COLUMNS
12694 The user's preferred width in column positions for the terminal screen
12695 or window.
12696 Queried and used once on program startup, actively managed for child
12697 processes and the MLE (see
12698 .Sx "On terminal control and line editor" )
12699 in interactive mode thereafter.
12700 Ignored in non-interactive mode, which always uses 80 columns, unless in
12701 .Fl \&#
12702 batch mode.
12705 .It Ev DEAD
12706 The name of the (mailbox)
12707 .Ic file
12708 to use for saving aborted messages if
12709 .Va save
12710 is set; this defaults to
12711 .Pa \*(VD .
12712 If the variable
12713 .Va debug
12714 is set no output will be generated, otherwise the contents of the file
12715 will be replaced.
12718 .It Ev EDITOR
12719 Pathname of the text editor to use for the
12720 .Ic edit
12721 command and
12722 .Ic ~e
12723 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
12724 .Ev VISUAL
12725 is used for a more display oriented editor.
12728 .It Ev HOME
12729 The user's home directory.
12730 This variable is only used when it resides in the process environment.
12731 The calling user's home directory will be used instead if this directory
12732 does not exist, is not accessible or cannot be read;
12733 it will always be used for the root user.
12734 (No test for being writable is performed to allow usage by
12735 non-privileged users within read-only jails, but dependent on the
12736 variable settings this directory is a default write target, e.g. for
12737 .Ev DEAD ,
12738 .Ev MBOX
12739 and more.)
12744 .It Ev LC_ALL , LC_CTYPE , LANG
12745 \*(OP The (names in lookup order of the)
12746 .Xr locale 7
12747 (and / or see
12748 .Xr setlocale 3 )
12749 which indicates the used
12750 .Sx "Character sets" .
12751 Runtime changes trigger automatic updates of the entire locale system,
12752 which includes updating
12753 .Va ttycharset
12754 (except during startup if the variable has been frozen via
12755 .Fl S ) .
12758 .It Ev LINES
12759 The user's preferred number of lines on a page or the vertical screen
12760 or window size in lines.
12761 Queried and used once on program startup, actively managed for child
12762 processes in interactive mode thereafter.
12763 Ignored in non-interactive mode, which always uses 24 lines, unless in
12764 .fl #
12765 batch mode.
12768 .It Ev LISTER
12769 Pathname of the directory lister to use in the
12770 .Ic folders
12771 command when operating on local mailboxes.
12772 Default is
12773 .Xr ls 1
12774 (path search through
12775 .Ev SHELL ) .
12778 .It Ev LOGNAME
12779 Upon startup \*(UA will actively ensure that this variable refers to the
12780 name of the user who runs \*(UA, in order to be able to pass a verified
12781 name to any newly created child process.
12784 .It Ev MAIL
12785 Is used as the user's
12786 .Mx -sx
12787 .Sx "primary system mailbox"
12788 unless
12789 .Va inbox
12790 is set.
12791 This is assumed to be an absolute pathname.
12792 If this environmental fallback is also not set, a built-in compile-time
12793 default is used.
12796 .It Ev MAILCAPS
12797 \*(OP Overrides the default path search for
12798 .Sx "The Mailcap files" ,
12799 which is defined in the standard RFC 1524 as
12800 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
12801 .\" TODO we should have a mailcaps-default virtual RDONLY option!
12802 (\*(UA makes it a configuration option, however.)
12803 Note this is not a search path, but a path search.
12806 .It Ev MAILRC
12807 Is used as a startup file instead of
12808 .Pa \*(ur
12809 if set.
12810 In order to avoid side-effects from configuration files scripts should
12811 either set this variable to
12812 .Pa /dev/null
12813 or the
12814 .Fl \&:
12815 command line option should be used.
12818 .It Ev MAILX_NO_SYSTEM_RC
12819 If this variable is set then reading of
12820 .Pa \*(UR
12821 (a.k.a.\&
12822 .Va system-mailrc )
12823 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
12824 had been started up with the option
12825 .Fl \&:
12826 (and according argument) or
12827 .Fl n .
12828 This variable is only used when it resides in the process environment.
12831 .It Ev MBOX
12832 The name of the user's
12833 .Mx -sx
12834 .Sx "secondary mailbox"
12835 file.
12836 A logical subset of the special
12837 .Sx "Filename transformations"
12838 (also see
12839 .Ic file )
12840 are supported.
12841 The default is
12842 .Pa \*(VM .
12843 Traditionally this MBOX is used as the file to save messages from the
12844 .Mx -sx
12845 .Sx "primary system mailbox"
12846 that have been read.
12847 Also see
12848 .Sx "Message states" .
12851 .It Ev NETRC
12852 \*(IN\*(OP This variable overrides the default location of the user's
12853 .Pa \*(VN
12854 file.
12857 .It Ev PAGER
12858 Pathname of the program to use for backing the command
12859 .Ic more ,
12860 and when the
12861 .Va crt
12862 variable enforces usage of a pager for output.
12863 The default paginator is
12864 .Xr more 1
12865 (path search through
12866 .Ev SHELL ) .
12868 \*(UA inspects the contents of this variable: if its contains the string
12869 .Dq less
12870 then a non-existing environment variable
12871 .Ev LESS
12872 will be set to
12873 .Ql Ri ,
12874 likewise for
12875 .Dq lv
12876 .Ev LV
12877 will optionally be set to
12878 .Ql -c .
12879 Alse see
12880 .Va colour-pager .
12883 .It Ev PATH
12884 A colon-separated list of directories that is searched by the shell when
12885 looking for commands, e.g.,
12886 .Ql /bin:/usr/bin:/usr/local/bin .
12889 .It Ev POSIXLY_CORRECT
12890 This variable is automatically looked for upon startup, see
12891 .Va posix
12892 for more.
12895 .It Ev SHELL
12896 The shell to use for the commands
12897 .Ic \&! ,
12898 .Ic shell ,
12900 .Ic ~!
12901 .Sx "COMMAND ESCAPES"
12902 and when starting subprocesses.
12903 A default shell is used if this environment variable is not defined.
12906 .It Ev SOURCE_DATE_EPOCH
12907 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
12908 used in place of the current time.
12909 This variable is looked up upon program startup, and its existence will
12910 switch \*(UA to a reproducible mode
12911 .Pf ( Lk https://reproducible-builds.org )
12912 which uses deterministic random numbers, a special fixated pseudo
12913 .Ev LOGNAME
12914 and more.
12915 This operation mode is used for development and by software packagers.
12916 \*(ID Currently an invalid setting is only ignored, rather than causing
12917 a program abortion.
12919 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
12922 .It Ev TERM
12923 \*(OP The terminal type for which output is to be prepared.
12924 For extended colour and font control please refer to
12925 .Sx "Coloured display" ,
12926 and for terminal management in general to
12927 .Sx "On terminal control and line editor" .
12930 .It Ev TMPDIR
12931 Except for the root user this variable defines the directory for
12932 temporary files to be used instead of
12933 .Pa \*(VT
12934 (or the given compile-time constant) if set, existent, accessible as
12935 well as read- and writable.
12936 This variable is only used when it resides in the process environment,
12937 but \*(UA will ensure at startup that this environment variable is
12938 updated to contain a usable temporary directory.
12941 .It Ev USER
12942 Identical to
12943 .Ev LOGNAME
12944 (see there), but this variable is not standardized, should therefore not
12945 be used, and is only corrected if already set.
12948 .It Ev VISUAL
12949 Pathname of the text editor to use for the
12950 .Ic visual
12951 command and
12952 .Ic ~v
12953 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
12954 .Ev EDITOR
12955 is used for a less display oriented editor.
12958 .\" }}}
12961 .\" .Sh FILES {{{
12962 .Sh FILES
12964 .\" file list {{{
12965 .Bl -tag -width ".It Pa BaNg"
12966 .It Pa \*(ur
12967 User-specific file giving initial commands, one of the
12968 .Sx "Resource files" .
12969 The actual value is read from
12970 .Va MAILRC .
12972 .It Pa \*(UR
12973 System wide initialization file, one of the
12974 .Sx "Resource files" .
12975 The actual value is read from
12976 .Va system-mailrc .
12979 .It Pa ~/.mailcap
12980 \*(OP Personal MIME type handler definition file, see
12981 .Sx "The Mailcap files" .
12982 This location is part of the RFC 1524 standard search path, which is
12983 a configuration option and can be overridden via
12984 .Ev MAILCAPS .
12987 .It Pa /etc/mailcap
12988 \*(OP System wide MIME type handler definition file, see
12989 .Sx "The Mailcap files" .
12990 This location is part of the RFC 1524 standard search path, which is
12991 a configuration option and can be overridden via
12994 .It Pa \*(VM
12995 The default value for
12996 .Ev MBOX .
12999 .It Pa \*(vU
13000 Personal MIME types, see
13001 .Sx "The mime.types files" .
13004 .It Pa \*(vS
13005 System wide MIME types, see
13006 .Sx "The mime.types files" .
13009 .It Pa \*(VN
13010 \*(IN\*(OP The default location of the user's
13011 .Pa .netrc
13012 file \(en the section
13013 .Sx "The .netrc file"
13014 documents the file format.
13015 The actually used path can be overridden via
13016 .Ev NETRC .
13019 .It Pa /dev/null
13020 The data sink
13021 .Xr null 4 .
13023 .\" }}}
13025 .\" .Ss "Resource files" {{{
13026 .Ss "Resource files"
13028 Upon startup \*(UA reads in several resource files, in order:
13030 .Bl -tag -width ".It Pa BaNg"
13032 .It Pa \*(UR
13033 System wide initialization file
13034 .Pf ( Va system-mailrc ) .
13035 Reading of this file can be suppressed, either by using the
13036 .Fl \&:
13037 (and according argument) or
13038 .Fl n
13039 command line options, or by setting the
13040 .Sx ENVIRONMENT
13041 variable
13042 .Ev MAILX_NO_SYSTEM_RC .
13045 .It Pa \*(ur
13046 File giving initial commands.
13047 A different file can be chosen by setting the
13048 .Sx ENVIRONMENT
13049 variable
13050 .Ev MAILRC .
13051 Reading of this file can be suppressed with the
13052 .Fl \&:
13053 command line option.
13055 .It Va mailx-extra-rc
13056 Defines a startup file to be read after all other resource files.
13057 It can be used to specify settings that are not understood by other
13058 .Xr mailx 1
13059 implementations, for example.
13060 This variable is only honoured when defined in a resource file, e.g.,
13061 it is one of the
13062 .Sx "INTERNAL VARIABLES" .
13066 The content of these files is interpreted as follows:
13069 .Bl -bullet -compact
13071 The whitespace characters space, tabulator and newline,
13072 as well as those defined by the variable
13073 .Va ifs ,
13074 are removed from the beginning and end of input lines.
13076 Empty lines are ignored.
13078 Any other line is interpreted as a command.
13079 It may be spread over multiple input lines if the newline character is
13080 .Dq escaped
13081 by placing a reverse solidus character
13082 .Ql \e
13083 as the last character of the line; whereas any leading whitespace of
13084 follow lines is ignored, trailing whitespace before a escaped newline
13085 remains in the input.
13087 If the line (content) starts with the number sign
13088 .Ql #
13089 then it is a comment-command and also ignored.
13090 (The comment-command is a real command, which does nothing, and
13091 therefore the usual follow lines mechanism applies!)
13095 Unless \*(UA is about to enter interactive mode syntax errors that occur
13096 while loading these files are treated as errors and cause program exit.
13097 More files with syntactically equal content can be
13098 .Ic source Ns ed .
13099 The following, saved in a file, would be an examplary content:
13101 .Bd -literal -offset indent
13102  # This line is a comment command.  And y\e
13103     es, it is really continued here.
13104 set debug \e
13105     verbose
13106     set editheaders
13108 .\" }}}
13110 .\" .Ss "The mime.types files" {{{
13111 .Ss "The mime.types files"
13113 As stated in
13114 .Sx "HTML mail and MIME attachments"
13115 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
13116 media types in order to classify message and attachment content.
13117 One source for them are
13118 .Pa mime.types
13119 files, the loading of which can be controlled by setting the variable
13120 .Va mimetypes-load-control .
13121 Another is the command
13122 .Ic mimetype ,
13123 which also offers access to \*(UAs MIME type cache.
13124 .Pa mime.types
13125 files have the following syntax:
13127 .Bd -literal -offset indent
13128 type/subtype extension [extension ...]
13129 # E.g., text/html html htm
13133 where
13134 .Ql type/subtype
13135 define the MIME media type, as standardized in RFC 2046:
13136 .Ql type
13137 is used to declare the general type of data, while the
13138 .Ql subtype
13139 specifies a specific format for that type of data.
13140 One or multiple filename
13141 .Ql extension Ns
13142 s, separated by whitespace, can be bound to the media type format.
13143 Comments may be introduced anywhere on a line with a number sign
13144 .Ql # ,
13145 causing the remaining line to be discarded.
13147 \*(UA also supports an extended, non-portable syntax in especially
13148 crafted files, which can be loaded via the alternative value syntax of
13149 .Va mimetypes-load-control ,
13150 and prepends an optional
13151 .Ql type-marker :
13154 .Dl [type-marker ]type/subtype extension [extension ...]
13157 The following type markers are supported:
13160 .Bl -tag -compact -width ".It Ar _n_u"
13161 .It Ar @
13162 Treat message parts with this content as plain text.
13163 .It Ar @t
13164 The same as plain
13165 .Ar @ .
13166 .It Ar @h
13167 Treat message parts with this content as HTML tagsoup.
13168 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
13169 the content as plain text instead.
13170 .It Ar @H
13171 Likewise
13172 .Ar @h ,
13173 but instead of falling back to plain text require an explicit content
13174 handler to be defined.
13175 .It Ar @q
13176 If no handler can be found a text message is displayed which says so.
13177 This can be annoying, for example signatures serve a contextual purpose,
13178 their content is of no use by itself.
13179 This marker will avoid displaying the text message.
13183 Further reading:
13184 for sending messages:
13185 .Ic mimetype ,
13186 .Va mime-allow-text-controls ,
13187 .Va mimetypes-load-control .
13188 For reading etc. messages:
13189 .Sx "HTML mail and MIME attachments" ,
13190 .Sx "The Mailcap files" ,
13191 .Ic mimetype ,
13192 .Va mime-counter-evidence ,
13193 .Va mimetypes-load-control ,
13194 .Va pipe-TYPE/SUBTYPE ,
13195 .Va pipe-EXTENSION .
13196 .\" }}}
13198 .\" .Ss "The Mailcap files" {{{
13199 .Ss "The Mailcap files"
13201 .\" TODO MAILCAP DISABLED
13202 .Sy This feature is not available in v14.9.0, sorry!
13203 RFC 1524 defines a
13204 .Dq User Agent Configuration Mechanism
13205 which \*(UA \*(OPally supports (see
13206 .Sx "HTML mail and MIME attachments" ) .
13207 It defines a file format to be used to inform mail user agent programs
13208 about the locally-installed facilities for handling various data
13209 formats, i.e., about commands and how they can be used to display, edit
13210 et cetera MIME part contents, as well as a default path search that
13211 includes multiple possible locations of
13212 .Dq mailcap
13213 files and the
13214 .Ev MAILCAPS
13215 environment variable that can be used to overwrite that (repeating here
13216 that it is not a search path, but instead a path search specification).
13217 Any existing files will be loaded in sequence, appending any content to
13218 the list of MIME type handler directives.
13221 .Dq Mailcap
13222 files consist of a set of newline separated entries.
13223 Comment lines start with a number sign
13224 .Ql #
13225 (in the first column!) and are ignored.
13226 Empty lines are also ignored.
13227 All other lines form individual entries that must adhere to the syntax
13228 described below.
13229 To extend a single entry (not comment) its line can be continued on
13230 follow lines if newline characters are
13231 .Dq escaped
13232 by preceding them with the reverse solidus character
13233 .Ql \e .
13234 The standard does not specify how leading whitespace of follow lines
13235 is to be treated, therefore \*(UA retains it.
13238 .Dq Mailcap
13239 entries consist of a number of semicolon
13240 .Ql \&;
13241 separated fields, and the reverse solidus
13242 .Ql \e
13243 character can be used to escape any following character including
13244 semicolon and itself.
13245 The first two fields are mandatory and must occur in the specified
13246 order, the remaining fields are optional and may appear in any order.
13247 Leading and trailing whitespace of content is ignored (removed).
13250 The first field defines the MIME
13251 .Ql TYPE/SUBTYPE
13252 the entry is about to handle (case-insensitively, and no reverse solidus
13253 escaping is possible in this field).
13254 If the subtype is specified as an asterisk
13255 .Ql *
13256 the entry is meant to match all subtypes of the named type, e.g.,
13257 .Ql audio/*
13258 would match any audio type.
13259 The second field defines the shell command which shall be used to
13260 .Dq display
13261 MIME parts of the given type; it is implicitly called the
13262 .Cd view
13263 command.
13266 For data
13267 .Dq consuming
13268 shell commands message (MIME part) data is passed via standard input
13269 unless the given shell command includes one or more instances of the
13270 (unquoted) string
13271 .Ql %s ,
13272 in which case these instances will be replaced with a temporary filename
13273 and the data will have been stored in the file that is being pointed to.
13274 Likewise, for data
13275 .Dq producing
13276 shell commands data is assumed to be generated on standard output unless
13277 the given command includes (one ore multiple)
13278 .Ql %s .
13279 In any case any given
13280 .Ql %s
13281 format is replaced with a(n already) properly quoted filename.
13282 Note that when a command makes use of a temporary file via
13283 .Ql %s
13284 then \*(UA will remove it again, as if the
13285 .Cd x-mailx-tmpfile ,
13286 .Cd x-mailx-tmpfile-fill
13288 .Cd x-mailx-tmpfile-unlink
13289 flags had been set; see below for more.
13292 The optional fields either define a shell command or an attribute (flag)
13293 value, the latter being a single word and the former being a keyword
13294 naming the field followed by an equals sign
13295 .Ql =
13296 succeeded by a shell command, and as usual for any
13297 .Dq Mailcap
13298 content any whitespace surrounding the equals sign will be removed, too.
13299 Optional fields include the following:
13302 .Bl -tag -width ".It Cd BaNg"
13303 .It Cd compose
13304 A program that can be used to compose a new body or body part in the
13305 given format.
13306 (Currently unused.)
13308 .It Cd composetyped
13309 Similar to the
13310 .Cd compose
13311 field, but is to be used when the composing program needs to specify the
13312 .Ql Content-type:
13313 header field to be applied to the composed data.
13314 (Currently unused.)
13316 .It Cd edit
13317 A program that can be used to edit a body or body part in the given
13318 format.
13319 (Currently unused.)
13321 .It Cd print
13322 A program that can be used to print a message or body part in the given
13323 format.
13324 (Currently unused.)
13326 .It Cd test
13327 Specifies a program to be run to test some condition, e.g., the machine
13328 architecture, or the window system in use, to determine whether or not
13329 this mailcap entry applies.
13330 If the test fails, a subsequent mailcap entry should be sought; also see
13331 .Cd x-mailx-test-once .
13334 .It Cd needsterminal
13335 This flag field indicates that the given shell command must be run on
13336 an interactive terminal.
13337 \*(UA will temporarily release the terminal to the given command in
13338 interactive mode, in non-interactive mode this entry will be entirely
13339 ignored; this flag implies
13340 .Cd x-mailx-noquote .
13343 .It Cd copiousoutput
13344 A flag field which indicates that the output of the
13345 .Cd view
13346 command will be an extended stream of textual output that can be
13347 (re)integrated into \*(UA's normal visual display.
13348 It is mutually exclusive with
13349 .Cd needsterminal .
13351 .It Cd textualnewlines
13352 A flag field which indicates that this type of data is line-oriented and
13353 that, if encoded in
13354 .Ql base64 ,
13355 all newlines should be converted to canonical form (CRLF) before
13356 encoding, and will be in that form after decoding.
13357 (Currently unused.)
13359 .It Cd nametemplate
13360 This field gives a filename format, in which
13361 .Ql %s
13362 will be replaced by a random string, the joined combination of which
13363 will be used as the filename denoted by
13364 .Ev MAILX_FILENAME_TEMPORARY .
13365 One could specify that a GIF file being passed to an image viewer should
13366 have a name ending in
13367 .Ql .gif
13368 by using
13369 .Ql nametemplate=%s.gif .
13370 Note that \*(UA ignores the name template unless that solely specifies
13371 a filename suffix that consists of (ASCII) alphabetic and numeric
13372 characters, the underscore and dot only.
13374 .It Cd x11-bitmap
13375 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
13376 icon to be used to visually denote the presence of this kind of data.
13377 This field is not used by \*(UA.
13379 .It Cd description
13380 A textual description that describes this type of data.
13383 .It Cd x-mailx-even-if-not-interactive
13384 An extension flag test field \(em by default handlers without
13385 .Cd copiousoutput
13386 are entirely ignored in non-interactive mode, but if this flag is set
13387 then their use will be considered.
13388 It is an error if this flag is set for commands that use the flag
13389 .Cd needsterminal .
13392 .It Cd x-mailx-noquote
13393 An extension flag field that indicates that even a
13394 .Cd copiousoutput
13395 .Cd view
13396 command shall not be used to generate message quotes
13397 (as it would be by default).
13400 .It Cd x-mailx-async
13401 Extension flag field that denotes that the given
13402 .Cd view
13403 command shall be executed asynchronously, without blocking \*(UA.
13404 Cannot be used in conjunction with
13405 .Cd needsterminal .
13408 .It Cd x-mailx-test-once
13409 Extension flag which denotes whether the given
13410 .Cd test
13411 command shall be evaluated once only and the (boolean) result be cached.
13412 This is handy if some global unchanging condition is to be queried, like
13413 .Dq running under the X Window System .
13416 .It Cd x-mailx-tmpfile
13417 Extension flag field that requests creation of a zero-sized temporary
13418 file, the name of which is to be placed in the environment variable
13419 .Ev MAILX_FILENAME_TEMPORARY .
13420 It is an error to use this flag with commands that include a
13421 .Ql %s
13422 format.
13425 .It Cd x-mailx-tmpfile-fill
13426 Normally the MIME part content is passed to the handler via standard
13427 input; if this flag is set then the data will instead be written into
13428 the implied
13429 .Cd x-mailx-tmpfile .
13430 In order to cause deletion of the temporary file you will have to set
13431 .Cd x-mailx-tmpfile-unlink
13432 explicitly!
13433 It is an error to use this flag with commands that include a
13434 .Ql %s
13435 format.
13438 .It Cd x-mailx-tmpfile-unlink
13439 Extension flag field that requests that the temporary file shall be
13440 deleted automatically when the command loop is entered again at latest.
13441 (Do not use this for asynchronous handlers.)
13442 It is an error to use this flag with commands that include a
13443 .Ql %s
13444 format, or in conjunction with
13445 .Cd x-mailx-async ,
13446 or without also setting
13447 .Cd x-mailx-tmpfile
13449 .Cd x-mailx-tmpfile-fill .
13452 .It Cd x-mailx-tmpfile-keep
13453 Using the string
13454 .Ql %s
13455 implies the three tmpfile related flags above, but if you want, e.g.,
13456 .Cd x-mailx-async
13457 and deal with the temporary file yourself, you can add in this flag to
13458 forcefully ignore
13459 .Cd x-mailx-tmpfile-unlink .
13464 The standard includes the possibility to define any number of additional
13465 entry fields, prefixed by
13466 .Ql x- .
13467 Flag fields apply to the entire
13468 .Dq Mailcap
13469 entry \(em in some unusual cases, this may not be desirable, but
13470 differentiation can be accomplished via separate entries, taking
13471 advantage of the fact that subsequent entries are searched if an earlier
13472 one does not provide enough information.
13473 E.g., if a
13474 .Cd view
13475 command needs to specify the
13476 .Cd needsterminal
13477 flag, but the
13478 .Cd compose
13479 command shall not, the following will help out the latter (with enabled
13480 .Va debug
13481 or an increased
13482 .Va verbose
13483 level \*(UA will show information about handler evaluation):
13485 .Bd -literal -offset indent
13486 application/postscript; ps-to-terminal %s; needsterminal
13487 application/postscript; ps-to-terminal %s; compose=idraw %s
13491 In fields any occurrence of the format string
13492 .Ql %t
13493 will be replaced by the
13494 .Ql TYPE/SUBTYPE
13495 specification.
13496 Named parameters from the
13497 .Ql Content-type:
13498 field may be placed in the command execution line using
13499 .Ql %{
13500 followed by the parameter name and a closing
13501 .Ql }
13502 character.
13503 The entire parameter should appear as a single command line argument,
13504 regardless of embedded spaces; thus:
13506 .Bd -literal -offset indent
13507 # Message
13508 Content-type:  multipart/mixed; boundary=42
13510 # Mailcap file
13511 multipart/*; /usr/local/bin/showmulti \e
13512   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
13514 # Executed shell command
13515 /usr/local/bin/showmulti multipart/mixed 42
13519 .\" TODO v15: Mailcap: %n,%F
13520 Note that \*(UA does not support handlers for multipart MIME parts as
13521 shown in this example (as of today).
13522 \*(UA does not support the additional formats
13523 .Ql %n
13525 .Ql %F .
13526 An example file, also showing how to properly deal with the expansion of
13527 .Ql %s ,
13528 which includes any quotes that are necessary to make it a valid shell
13529 argument by itself and thus will cause undesired behaviour when placed
13530 in additional user-provided quotes:
13532 .Bd -literal -offset indent
13533 # Comment line
13534 text/richtext; richtext %s; copiousoutput
13536 text/x-perl; perl -cWT %s
13538 application/pdf; \e
13539   infile=%s\e; \e
13540     trap "rm -f ${infile}" EXIT\e; \e
13541     trap "exit 75" INT QUIT TERM\e; \e
13542     mupdf %s; \e
13543   x-mailx-async; x-mailx-tmpfile-keep
13545 application/*; echo "This is \e"%t\e" but \e
13546     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vet; \e
13547   copiousoutput; x-mailx-noquote
13551 Further reading:
13552 .Sx "HTML mail and MIME attachments" ,
13553 .Sx "The mime.types files" ,
13554 .Ic mimetype ,
13555 .Ev MAILCAPS ,
13556 .Va mime-counter-evidence ,
13557 .Va pipe-TYPE/SUBTYPE ,
13558 .Va pipe-EXTENSION .
13559 .\" }}}
13561 .\" .Ss "The .netrc file" {{{
13562 .Ss "The .netrc file"
13565 .Pa .netrc
13566 file contains user credentials for machine accounts.
13567 The default location
13568 .Pa \*(VN
13569 may be overridden by the
13570 .Ev NETRC
13571 environment variable.
13572 It is possible to load encrypted
13573 .Pa .netrc
13574 files by using an appropriate value in
13575 .Va netrc-pipe .
13578 The file consists of space, tabulator or newline separated tokens.
13579 \*(UA implements a parser that supports a superset of the original BSD
13580 syntax, but users should nonetheless be aware of portability glitches
13581 of that file format, shall their
13582 .Pa .netrc
13583 be usable across multiple programs and platforms:
13586 .Bl -bullet -compact
13588 BSD does not support single, but only double quotation marks, e.g.,
13589 .Ql password="pass with spaces" .
13591 BSD (only?) supports escaping of single characters via a reverse solidus
13592 (e.g., a space can be escaped via
13593 .Ql \e\0 ) ,
13594 in- as well as outside of a quoted string.
13596 BSD does not require a final quotation mark of the last user input token.
13598 The original BSD (Berknet) parser also supported a format which allowed
13599 tokens to be separated with commas \(en whereas at least Hewlett-Packard
13600 still seems to support this syntax, \*(UA does not!
13602 As a non-portable extension some widely-used programs support
13603 shell-style comments: if an input line starts, after any amount of
13604 whitespace, with a number sign
13605 .Ql # ,
13606 then the rest of the line is ignored.
13608 Whereas other programs may require that the
13609 .Pa .netrc
13610 file is accessible by only the user if it contains a
13611 .Cd password
13612 token for any other
13613 .Cd login
13614 than
13615 .Dq anonymous ,
13616 \*(UA will always require these strict permissions.
13620 Of the following list of supported tokens \*(UA only uses (and caches)
13621 .Cd machine ,
13622 .Cd login
13624 .Cd password .
13625 At runtime the command
13626 .Ic netrc
13627 can be used to control \*(UA's
13628 .Pa .netrc
13629 cache.
13631 .Bl -tag -width ".It Cd BaNg"
13632 .It Cd machine Ar name
13633 The hostname of the entries' machine, lowercase-normalized by \*(UA
13634 before use.
13635 Any further file content, until either end-of-file or the occurrence
13636 of another
13637 .Cd machine
13638 or a
13639 .Cd default
13640 first-class token is bound (only related) to the machine
13641 .Ar name .
13643 As an extension that should not be the cause of any worries
13644 \*(UA supports a single wildcard prefix for
13645 .Ar name :
13646 .Bd -literal -offset indent
13647 machine *.example.com login USER password PASS
13648 machine pop3.example.com login USER password PASS
13649 machine smtp.example.com login USER password PASS
13652 which would match
13653 .Ql xy.example.com
13654 as well as
13655 .Ql pop3.example.com ,
13656 but neither
13657 .Ql example.com
13659 .Ql local.smtp.example.com .
13660 Note that in the example neither
13661 .Ql pop3.example.com
13663 .Ql smtp.example.com
13664 will be matched by the wildcard, since the exact matches take
13665 precedence (it is however faster to specify it the other way around).
13667 .It Cd default
13668 This is the same as
13669 .Cd machine
13670 except that it is a fallback entry that is used shall none of the
13671 specified machines match; only one default token may be specified,
13672 and it must be the last first-class token.
13674 .It Cd login Ar name
13675 The user name on the remote machine.
13677 .It Cd password Ar string
13678 The user's password on the remote machine.
13680 .It Cd account Ar string
13681 Supply an additional account password.
13682 This is merely for FTP purposes.
13684 .It Cd macdef Ar name
13685 Define a macro.
13686 A macro is defined with the specified
13687 .Ar name ;
13688 it is formed from all lines beginning with the next line and continuing
13689 until a blank line is (consecutive newline characters are) encountered.
13690 (Note that
13691 .Cd macdef
13692 entries cannot be utilized by multiple machines, too, but must be
13693 defined following the
13694 .Ic machine
13695 they are intended to be used with.)
13696 If a macro named
13697 .Ar init
13698 exists, it is automatically run as the last step of the login process.
13699 This is merely for FTP purposes.
13701 .\" }}}
13703 .\" }}}
13706 .\" .Sh EXAMPLES {{{
13707 .Sh EXAMPLES
13709 .\" .Ss "An example configuration" {{{
13710 .Ss "An example configuration"
13712 .Bd -literal -offset indent
13713 # This example assumes v15.0 compatibility mode
13714 set v15-compat
13716 # Request strict TLL transport layer security checks
13717 set tls-verify=strict
13719 # Where are the up-to-date TLS certificates?
13720 # (Since we manage up-to-date ones explicitly, do not use any,
13721 # possibly outdated, default certificates shipped with OpenSSL)
13722 #set tls-ca-dir=/etc/ssl/certs
13723 set tls-ca-file=/etc/ssl/certs/ca-certificates.crt
13724 set tls-ca-no-defaults
13725 #set tls-ca-flags=partial-chain
13726 wysh set smime-ca-file="${tls-ca-file}" \e
13727   smime-ca-no-defaults #smime-ca-flags="${tls-ca-flags}"
13729 # This could be outsourced to a central configuration file via
13730 # tls-config-file plus tls-config-module if the used library allows.
13731 # CipherString: explicitly define the list of ciphers, which may
13732 #   improve security, especially with protocols older than TLS v1.2.
13733 #   See ciphers(1).  Possibly best to only use tls-config-pairs-HOST
13734 #   (or -USER@HOST), as necessary, again..
13735 #   Note that TLSv1.3 uses Ciphersuites= instead, which will join
13736 #   with CipherString (if protocols older than v1.3 are allowed)
13737 # Curves: especially with TLSv1.3 curves selection may be desired.
13738 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
13739 #   Change this only when the remote server does not support it:
13740 #   maybe use chain support via tls-config-pairs-HOST / -USER@HOST
13741 #   to define such explicit exceptions, then, e.g.
13742 #     MinProtocol=TLSv1.1
13743 if [ "$tls-features" =% +ctx-set-maxmin-proto ]
13744   wysh set tls-config-pairs='\e
13745       CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
13746       Curves=P-521:P-384:P-256,\e
13747       MinProtocol=TLSv1.1'
13748 else
13749   wysh set tls-config-pairs='\e
13750       CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
13751       Curves=P-521:P-384:P-256,\e
13752       Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2\e, +TLSv1.3'
13753 endif
13755 # Essential setting: select allowed character sets
13756 set sendcharsets=utf-8,iso-8859-1
13758 # A very kind option: when replying to a message, first try to
13759 # use the same encoding that the original poster used herself!
13760 set reply-in-same-charset
13762 # When replying, do not merge From: and To: of the original message
13763 # into To:.  Instead old From: -> new To:, old To: -> merge Cc:.
13764 set recipients-in-cc
13766 # When sending messages, wait until the Mail-Transfer-Agent finishs.
13767 # Only like this you will be able to see errors reported through the
13768 # exit status of the MTA (including the built-in SMTP one)!
13769 set sendwait
13771 # Only use built-in MIME types, no mime.types(5) files
13772 set mimetypes-load-control
13774 # Default directory where we act in (relative to $HOME)
13775 set folder=mail
13776 # A leading "+" (often) means: under *folder*
13777 # *record* is used to save copies of sent messages
13778 set MBOX=+mbox.mbox DEAD=+dead.txt \e
13779   record=+sent.mbox record-files record-resent
13781 # Make "file mymbox" and "file myrec" go to..
13782 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
13784 # Not really optional, e.g., for S/MIME
13785 set from='Your Name <address@exam.ple>'
13787 # It may be necessary to set hostname and/or smtp-hostname
13788 # if the "SERVER" of mta and "domain" of from do not match.
13789 # The `urlencode' command can be used to encode USER and PASS
13790 set mta=(smtps?|submissions?)://[USER[:PASS]@]SERVER[:PORT] \e
13791   smtp-auth=login/plain... \e
13792   smtp-use-starttls
13794 # Never refuse to start into interactive mode, and more
13795 set emptystart \e
13796   colour-pager crt= \e
13797   followup-to followup-to-honour=ask-yes fullnames \e
13798   history-file=+.\*(uAhist history-size=-1 history-gabby \e
13799   mime-counter-evidence=0b1111 \e
13800   prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
13801   reply-to-honour=ask-yes \e
13802   umask=
13804 # Only include the selected header fields when typing messages
13805 headerpick type retain from_ date from to cc subject \e
13806   message-id mail-followup-to reply-to
13807 # ...when forwarding messages
13808 headerpick forward retain subject date from to cc
13809 # ...when saving message, etc.
13810 #headerpick save ignore ^Original-.*$ ^X-.*$
13812 # Some mailing lists
13813 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
13814 mlsubscribe '^xfans@xfans\e.xyz$'
13816 # Handle a few file extensions (to store MBOX databases)
13817 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
13818   gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
13819   zst 'zstd -dc' 'zstd -19 -zc' \e
13820   zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
13822 # A real life example of a very huge free mail provider
13823 # Instead of directly placing content inside `account',
13824 # we `define' a macro: like that we can switch "accounts"
13825 # from within *on-compose-splice*, for example!
13826 define XooglX {
13827   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
13828   set from='Your Name <address@examp.ple>'
13830   set pop3-no-apop-pop.gmXil.com
13831   shortcut pop %:pop3s://pop.gmXil.com
13832   shortcut imap %:imaps://imap.gmXil.com
13833   # Or, entirely IMAP based setup
13834   #set folder=imaps://imap.gmail.com record="+[Gmail]/Sent Mail" \e
13835   #   imap-cache=~/spool/cache
13837   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
13838   # Alternatively:
13839   set mta=smtps://USER:PASS@smtp.gmail.com:465
13841 account XooglX {
13842   \ecall XooglX
13845 # Here is a pretty large one which does not allow sending mails
13846 # if there is a domain name mismatch on the SMTP protocol level,
13847 # which would bite us if the value of from does not match, e.g.,
13848 # for people who have a sXXXXeforge project and want to speak
13849 # with the mailing list under their project account (in from),
13850 # still sending the message through their normal mail provider
13851 define XandeX {
13852   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
13853   set from='Your Name <address@exam.ple>'
13855   shortcut pop %:pop3s://pop.yaXXex.com
13856   shortcut imap %:imaps://imap.yaXXex.com
13858   set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
13859     hostname=yaXXex.com smtp-hostname=
13861 account XandeX {
13862   \ecall Xandex
13865 # Create some new commands so that, e.g., `ls /tmp' will..
13866 commandalias lls '!ls ${LS_COLOUR_FLAG} -aFlrS'
13867 commandalias llS '!ls ${LS_COLOUR_FLAG} -aFlS'
13869 set pipe-message/external-body='@* echo $MAILX_EXTERNAL_BODY_URL'
13871 # We do not support gpg(1) directly yet.  But simple --clearsign'd
13872 # message parts can be dealt with as follows:
13873 define V {
13874   localopts yes
13875   wysh set pipe-text/plain=$'@*#++=@\e
13876     < "${MAILX_FILENAME_TEMPORARY}" awk \e
13877         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
13878       BEGIN{done=0}\e
13879       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
13880         if(done++ != 0)\e
13881           next;\e
13882         print "--- GPG --verify ---";\e
13883         system("gpg --verify " TMPFILE " 2>&1");\e
13884         print "--- GPG --verify ---";\e
13885         print "";\e
13886         next;\e
13887       }\e
13888       /^-----BEGIN PGP SIGNATURE-----/,\e
13889           /^-----END PGP SIGNATURE-----/{\e
13890         next;\e
13891       }\e
13892       {print}\e
13893     \e''
13894     print
13896 commandalias V '\e'call V
13900 When storing passwords in
13901 .Pa \*(ur
13902 appropriate permissions should be set on this file with
13903 .Ql $ chmod 0600 \*(ur .
13904 If the \*(OPal
13905 .Va netrc-lookup
13906 is available user credentials can be stored in the central
13907 .Pa \*(VN
13908 file instead; e.g., here is a different version of the example account
13909 that sets up SMTP and POP3:
13911 .Bd -literal -offset indent
13912 define XandeX {
13913   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
13914   set from='Your Name <address@exam.ple>'
13915   set netrc-lookup
13916   # Load an encrypted ~/.netrc by uncommenting the next line
13917   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
13919   set mta=smtps://smtp.yXXXXx.ru:465 \e
13920       smtp-hostname= hostname=yXXXXx.com
13921   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
13922   commandalias xp fi pop3s://pop.yXXXXx.ru
13924 account XandeX {
13925   \ecall XandeX
13930 and, in the
13931 .Pa \*(VN
13932 file:
13934 .Bd -literal -offset indent
13935 machine *.yXXXXx.ru login USER password PASS
13939 This configuration should now work just fine:
13942 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
13943 .\" }}}
13945 .\" .Ss "S/MIME step by step" {{{
13946 .Ss "S/MIME step by step"
13948 \*(OP The first thing that is needed for
13949 .Sx "Signed and encrypted messages with S/MIME"
13950 is a personal certificate, and a private key.
13951 The certificate contains public information, in particular a name and
13952 email address(es), and the public key that can be used by others to
13953 encrypt messages for the certificate holder (the owner of the private
13954 key), and to
13955 .Ic verify
13956 signed messages generated with that certificate('s private key).
13957 Whereas the certificate is included in each signed message, the private
13958 key must be kept secret.
13959 It is used to decrypt messages that were previously encrypted with the
13960 public key, and to sign messages.
13963 For personal use it is recommended that get a S/MIME certificate from
13964 one of the major CAs on the Internet.
13965 Many CAs offer such certificates for free.
13966 Usually offered is a combined certificate and private key in PKCS#12
13967 format which \*(UA does not accept directly.
13968 To convert it to PEM format, the following shell command can be used;
13969 please read on for how to use these PEM files.
13971 .Bd -literal -offset indent
13972 $ openssl pkcs12 -in cert.p12 -out certpem.pem -clcerts -nodes
13973 $ # Alternatively
13974 $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
13975 $ openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
13979 There is also
13980 .Lk https://www.CAcert.org
13981 which issues client and server certificates to members of their
13982 community for free; their root certificate
13983 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
13984 is often not in the default set of trusted CA root certificates, though,
13985 which means their root certificate has to be downloaded separately,
13986 and needs to be part of the S/MIME certificate validation chain by
13987 including it in
13988 .Va smime-ca-dir
13989 or as a vivid member of the
13990 .Va smime-ca-file .
13991 But let us take a step-by-step tour on how to setup S/MIME with
13992 a certificate from CAcert.org despite this situation!
13995 First of all you will have to become a member of the CAcert.org
13996 community, simply by registrating yourself via the web interface.
13997 Once you are, create and verify all email addresses you want to be able
13998 to create signed and encrypted messages for/with using the corresponding
13999 entries of the web interface.
14000 Now ready to create S/MIME certificates, so let us create a new
14001 .Dq client certificate ,
14002 ensure to include all email addresses that should be covered by the
14003 certificate in the following web form, and also to use your name as the
14004 .Dq common name .
14007 Create a private key and a certificate request on your local computer
14008 (please see the manual pages of the used commands for more in-depth
14009 knowledge on what the used arguments etc. do):
14012 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
14015 Afterwards copy-and-paste the content of
14016 .Dq creq.pem
14017 into the certificate-request (CSR) field of the web form on the
14018 CAcert.org website (you may need to unfold some
14019 .Dq advanced options
14020 to see the corresponding text field).
14021 This last step will ensure that your private key (which never left your
14022 box) and the certificate belong together (through the public key that
14023 will find its way into the certificate via the certificate-request).
14024 You are now ready and can create your CAcert certified certificate.
14025 Download and store or copy-and-paste it as
14026 .Dq pub.crt .
14029 Yay.
14030 In order to use your new S/MIME setup a combined private key/public key
14031 (certificate) file has to be created:
14034 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
14037 This is the file \*(UA will work with.
14038 If you have created your private key with a passphrase then \*(UA will
14039 ask you for it whenever a message is signed or decrypted, unless this
14040 operation has been automated as described in
14041 .Sx "Signed and encrypted messages with S/MIME" .
14042 Set the following variables to henceforth use S/MIME (setting
14043 .Va smime-ca-file
14044 is of interest for verification only):
14046 .Bd -literal -offset indent
14047 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
14048     smime-sign-cert=ME@HERE.com.paired \e
14049     smime-sign-digest=SHA512 \e
14050     smime-sign
14053 .\" }}}
14055 .\" .Ss "Using CRLs with S/MIME or TLS" {{{
14056 .Ss "Using CRLs with S/MIME or TLS"
14058 \*(OP Certification authorities (CAs) issue certificate revocation
14059 lists (CRLs) on a regular basis.
14060 These lists contain the serial numbers of certificates that have been
14061 declared invalid after they have been issued.
14062 Such usually happens because the private key for the certificate has
14063 been compromised,
14064 because the owner of the certificate has left the organization that is
14065 mentioned in the certificate, etc.
14066 To seriously use S/MIME or TLS verification,
14067 an up-to-date CRL is required for each trusted CA.
14068 There is otherwise no method to distinguish between valid and
14069 invalidated certificates.
14070 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
14071 the Internet, so they have to be retrieved by some external mechanism.
14074 \*(UA accepts CRLs in PEM format only;
14075 CRLs in DER format must be converted, like, e.\|g.:
14078 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
14081 To tell \*(UA about the CRLs, a directory that contains all CRL files
14082 (and no other files) must be created.
14084 .Va smime-crl-dir
14086 .Va tls-crl-dir
14087 variables, respectively, must then be set to point to that directory.
14088 After that, \*(UA requires a CRL to be present for each CA that is used
14089 to verify a certificate.
14090 .\" }}}
14092 .\" }}} (Examples)
14095 .\" .Sh "FAQ" {{{
14096 .Sh "FAQ"
14098 In general it is a good idea to turn on
14099 .Va debug
14100 .Pf ( Fl d )
14101 and / or
14102 .Va verbose
14103 .Pf ( Fl v ,
14104 twice) if something does not work well.
14105 Very often a diagnostic message can be produced that leads to the
14106 problems' solution.
14108 .\" .Ss "\*(UA shortly hangs on startup" {{{
14109 .Ss "\*(UA shortly hangs on startup"
14111 This can have two reasons, one is the necessity to wait for a file lock
14112 and cannot be helped, the other being that \*(UA calls the function
14113 .Xr uname 2
14114 in order to query the nodename of the box (sometimes the real one is
14115 needed instead of the one represented by the internal variable
14116 .Va hostname ) .
14117 One may have varying success by ensuring that the real hostname and
14118 .Ql localhost
14119 have entries in
14120 .Pa /etc/hosts ,
14121 or, more generally, that the name service is properly setup \(en
14122 and does
14123 .Xr hostname 1
14124 return the expected value?
14125 Does this local hostname have a domain suffix?
14126 RFC 6762 standardized the link-local top-level domain
14127 .Ql .local ,
14128 try again after adding an (additional) entry with this extension.
14129 .\" }}}
14131 .\" .Ss "I cannot login to Google mail aka GMail" {{{
14132 .Ss "I cannot login to Google mail aka GMail"
14134 Since 2014 some free service providers classify programs as
14135 .Dq less secure
14136 unless they use a special authentication method (OAuth 2.0) which
14137 was not standardized for non-HTTP protocol authentication token query
14138 until August 2015 (RFC 7628).
14141 Different to Kerberos / GSSAPI, which is developed since the mid of the
14142 1980s, where a user can easily create a local authentication ticket for
14143 her- and himself with the locally installed
14144 .Xr kinit 1
14145 program, that protocol has no such local part but instead requires
14146 a world-wide-web query to create or fetch a token; since there is no
14147 local cache this query would have to be performed whenever \*(UA is
14148 invoked (in interactive sessions situation may differ).
14151 \*(UA does not support OAuth.
14152 Because of this it is necessary to declare \*(UA a
14153 .Dq less secure app
14154 (on the providers account web page) in order to read and send mail.
14155 However, it also seems possible to take the following steps instead:
14158 .Bl -enum -compact
14160 give the provider the number of a mobile phone,
14162 enable
14163 .Dq 2-Step Verification ,
14165 create an application specific password (16 characters), and
14167 use that special password instead of the real Google account password in
14168 \*(UA (for more on that see the section
14169 .Sx "On URL syntax and credential lookup" ) .
14171 .\" }}}
14173 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
14174 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
14176 It can happen that the terminal library (see
14177 .Sx "On terminal control and line editor",
14178 .Ic bind ,
14179 .Va termcap )
14180 reports different codes than the terminal really sends, in which case
14181 \*(UA will tell that a key binding is functional, but will not be able to
14182 recognize it because the received data does not match anything expected.
14183 Especially without the \*(OPal terminal capability library support one
14184 reason for this may be that the (possibly even non-existing) keypad
14185 is not turned on and the resulting layout reports the keypad control
14186 codes for the normal keyboard keys.
14188 .Va verbose
14189 listing of
14190 .Ic bind Ns
14191 ings will show the byte sequences that are expected.
14194 To overcome the situation, use, e.g., the program
14195 .Xr cat 1 ,
14196 in conjunction with the command line option
14197 .Fl \&\&v ,
14198 if available, to see the byte sequences which are actually produced
14199 by keypresses, and use the variable
14200 .Va termcap
14201 to make \*(UA aware of them.
14202 E.g., the terminal this is typed on produces some false sequences, here
14203 an example showing the shifted home key:
14205 .Bd -literal -offset indent
14206 ? set verbose
14207 ? bind*
14208 # 1B 5B=[ 31=1 3B=; 32=2 48=H
14209   bind base :kHOM z0
14210 ? x
14211 $ cat -v
14212 ^[[H
14213 $ \*(uA -v -Stermcap='kHOM=\eE[H'
14214 ? bind*
14215 # 1B 5B=[ 48=H
14216   bind base :kHOM z0
14218 .\" }}}
14220 .\" .Ss "Can \*(UA git-send-email?" {{{
14221 .Ss "Can \*(UA git-send-email?"
14223 Yes.
14224 Put (at least parts of) the following in your
14225 .Pa ~/.gitconfig :
14227 .Bd -literal -offset indent
14228 [sendemail]
14229 smtpserver = /usr/bin/s-mailx
14230 smtpserveroption = -t
14231 #smtpserveroption = -Sexpandaddr
14232 smtpserveroption = -Athe-account-you-need
14234 suppresscc = all
14235 suppressfrom = false
14236 assume8bitEncoding = UTF-8
14237 #to = /tmp/OUT
14238 confirm = always
14239 chainreplyto = true
14240 multiedit = false
14241 thread = true
14242 quiet = true
14243 annotate = true
14245 .\" }}}
14247 .\" }}}
14250 .\" .Sh "IMAP CLIENT" {{{
14251 .Sh "IMAP CLIENT"
14253 \*(OPally there is IMAP client support available.
14254 This part of the program is obsolete and will vanish in v15 with the
14255 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
14256 and makes excessive use of signal based long code jumps.
14257 Support can hopefully be readded later based on a new-style I/O, with
14258 SysV signal handling.
14259 In fact the IMAP support had already been removed from the codebase, but
14260 was reinstantiated on user demand: in effect the IMAP code is at the
14261 level of \*(UA v14.8.16 (with
14262 .Ic imapcodec
14263 being the sole exception), and should be treated with some care.
14266 IMAP uses the
14267 .Ql imap://
14269 .Ql imaps://
14270 protocol prefixes, and an IMAP-based
14271 .Va folder
14272 may be used.
14273 IMAP URLs (paths) undergo inspections and possible transformations
14274 before use (and the command
14275 .Ic imapcodec
14276 can be used to manually apply them to any given argument).
14277 Hierarchy delimiters are normalized, a step which is configurable via the
14278 .Va imap-delim
14279 variable chain, but defaults to the first seen delimiter otherwise.
14280 \*(UA supports internationalised IMAP names, and en- and decodes the
14281 names from and to the
14282 .Va ttycharset
14283 as necessary and possible.
14284 If a mailbox name is expanded (see
14285 .Sx "Filename transformations" )
14286 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
14287 mailboxes below the
14288 .Va folder
14289 target box, while folder names prefixed by `@' refer to folders below
14290 the hierarchy base, e.g., the following lists all folders below the
14291 current one when in an IMAP mailbox:
14292 .Ql folders @ .
14295 Note: some IMAP servers do not accept the creation of mailboxes in
14296 the hierarchy base, but require that they are created as subfolders of
14297 `INBOX' \(en with such servers a folder name of the form
14299 .Dl imaps://mylogin@imap.myisp.example/INBOX.
14301 should be used (the last character is the server's hierarchy
14302 delimiter).
14303 The following IMAP-specific commands exist:
14306 .Bl -tag -width ".It Ic BaNg"
14308 .It Ic cache
14309 Only applicable to cached IMAP mailboxes;
14310 takes a message list and reads the specified messages into the IMAP
14311 cache.
14314 .It Ic connect
14315 If operating in disconnected mode on an IMAP mailbox,
14316 switch to online mode and connect to the mail server while retaining
14317 the mailbox status.
14318 See the description of the
14319 .Va disconnected
14320 variable for more information.
14323 .It Ic disconnect
14324 If operating in online mode on an IMAP mailbox,
14325 switch to disconnected mode while retaining the mailbox status.
14326 See the description of the
14327 .Va disconnected
14328 variable for more.
14329 A list of messages may optionally be given as argument;
14330 the respective messages are then read into the cache before the
14331 connection is closed, thus
14332 .Ql disco *
14333 makes the entire mailbox available for disconnected use.
14336 .It Ic imap
14337 Sends command strings directly to the current IMAP server.
14338 \*(UA operates always in IMAP `selected state' on the current mailbox;
14339 commands that change this will produce undesirable results and should be
14340 avoided.
14341 Useful IMAP commands are:
14342 .Bl -tag -offset indent -width ".Ic getquotearoot"
14343 .It create
14344 Takes the name of an IMAP mailbox as an argument and creates it.
14345 .It getquotaroot
14346 (RFC 2087) Takes the name of an IMAP mailbox as an argument
14347 and prints the quotas that apply to the mailbox.
14348 Not all IMAP servers support this command.
14349 .It namespace
14350 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
14351 the Other User's Namespaces and the Shared Namespaces.
14352 Each namespace type is printed in parentheses;
14353 if there are multiple namespaces of the same type,
14354 inner parentheses separate them.
14355 For each namespace a prefix and a hierarchy separator is listed.
14356 Not all IMAP servers support this command.
14360 .It Ic imapcodec
14361 Perform IMAP path transformations.
14362 Supports
14363 .Cm vput
14364 (see
14365 .Sx "Command modifiers" ) ,
14366 and manages the error number
14367 .Va \&! .
14368 The first argument specifies the operation:
14369 .Ar e[ncode]
14370 normalizes hierarchy delimiters (see
14371 .Va imap-delim )
14372 and converts the strings from the locale
14373 .Va ttycharset
14374 to the internationalized variant used by IMAP,
14375 .Ar d[ecode]
14376 performs the reverse operation.
14381 The following IMAP-specific internal variables exist:
14384 .Bl -tag -width ".It Va BaNg"
14386 .It Va disconnected
14387 \*(BO When an IMAP mailbox is selected and this variable is set,
14388 no connection to the server is initiated.
14389 Instead, data is obtained from the local cache (see
14390 .Va imap-cache Ns
14392 Mailboxes that are not present in the cache
14393 and messages that have not yet entirely been fetched from the server
14394 are not available;
14395 to fetch all messages in a mailbox at once,
14396 the command
14397 .No ` Ns Li copy * /dev/null Ns '
14398 can be used while still in connected mode.
14399 Changes that are made to IMAP mailboxes in disconnected mode are queued
14400 and committed later when a connection to that server is made.
14401 This procedure is not completely reliable since it cannot be guaranteed
14402 that the IMAP unique identifiers (UIDs) on the server still match the
14403 ones in the cache at that time.
14404 Data is saved to
14405 .Ev DEAD
14406 when this problem occurs.
14408 .It Va disconnected-USER@HOST
14409 The specified account is handled as described for the
14410 .Va disconnected
14411 variable above,
14412 but other accounts are not affected.
14414 .Mx Va imap-auth
14415 .It Va imap-auth-USER@HOST , imap-auth
14416 Sets the IMAP authentication method.
14417 Valid values are `login' for the usual password-based authentication
14418 (the default),
14419 `cram-md5', which is a password-based authentication that does not send
14420 the password over the network in clear text,
14421 and `gssapi' for GSS-API based authentication.
14424 .It Va imap-cache
14425 Enables caching of IMAP mailboxes.
14426 The value of this variable must point to a directory that is either
14427 existent or can be created by \*(UA.
14428 All contents of the cache can be deleted by \*(UA at any time;
14429 it is not safe to make assumptions about them.
14431 .Mx Va imap-delim
14432 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
14433 The hierarchy separator used by the IMAP server.
14434 Whenever an IMAP path is specified it will undergo normalization.
14435 One of the normalization steps is the squeezing and adjustment of
14436 hierarchy separators.
14437 If this variable is set, any occurrence of any character of the given
14438 value that exists in the path will be replaced by the first member of
14439 the value; an empty value will cause the default to be used, it is
14440 .Ql /. .
14441 If not set, we will reuse the first hierarchy separator character that
14442 is discovered in a user-given mailbox name.
14444 .Mx Va imap-keepalive
14445 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
14446 IMAP servers may close the connection after a period of
14447 inactivity; the standard requires this to be at least 30 minutes,
14448 but practical experience may vary.
14449 Setting this variable to a numeric `value' greater than 0 causes
14450 a `NOOP' command to be sent each `value' seconds if no other operation
14451 is performed.
14454 .It Va imap-list-depth
14455 When retrieving the list of folders on an IMAP server, the
14456 .Ic folders
14457 command stops after it has reached a certain depth to avoid possible
14458 infinite loops.
14459 The value of this variable sets the maximum depth allowed.
14460 The default is 2.
14461 If the folder separator on the current IMAP server is a slash `/',
14462 this variable has no effect and the
14463 .Ic folders
14464 command does not descend to subfolders.
14466 .Mx Va imap-use-starttls
14467 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
14468 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
14469 IMAP session TLS encrypted.
14470 This functionality is not supported by all servers,
14471 and is not used if the session is already encrypted by the IMAPS method.
14474 .\" }}}
14477 .\" .Sh "SEE ALSO" {{{
14478 .Sh "SEE ALSO"
14480 .Xr bogofilter 1 ,
14481 .Xr gpg 1 ,
14482 .Xr more 1 ,
14483 .Xr newaliases 1 ,
14484 .Xr openssl 1 ,
14485 .Xr sendmail 1 ,
14486 .Xr sh 1 ,
14487 .Xr spamassassin 1 ,
14488 .Xr iconv 3 ,
14489 .Xr setlocale 3 ,
14490 .Xr aliases 5 ,
14491 .Xr termcap 5 ,
14492 .Xr terminfo 5 ,
14493 .Xr locale 7 ,
14494 .Xr mailaddr 7 ,
14495 .Xr re_format 7 ,
14496 .Xr mailwrapper 8 ,
14497 .Xr sendmail 8
14499 .\" }}}
14502 .\" .Sh HISTORY {{{
14503 .Sh HISTORY
14505 M. Douglas McIlroy writes in his article
14506 .Dq A Research UNIX Reader: Annotated Excerpts \
14507 from the Programmer's Manual, 1971-1986
14508 that a
14509 .Xr mail 1
14510 command already appeared in First Edition
14512 in 1971:
14514 .Bd -ragged -offset indent
14515 Electronic mail was there from the start.
14516 Never satisfied with its exact behavior, everybody touched it at one
14517 time or another: to assure the safety of simultaneous access, to improve
14518 privacy, to survive crashes, to exploit uucp, to screen out foreign
14519 freeloaders, or whatever.
14520 Not until v7 did the interface change (Thompson).
14521 Later, as mail became global in its reach, Dave Presotto took charge and
14522 brought order to communications with a grab-bag of external networks
14523 (v8).
14528 Mail was written in 1978 by Kurt Shoens and developed as part of the
14531 distribution until 1995.
14532 Mail has then seen further development in open source
14534 variants, noticeably by Christos Zoulas in
14535 .Pf Net Bx .
14536 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
14537 Ritter in the years 2000 until 2008.
14538 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
14539 This man page is derived from
14540 .Dq The Mail Reference Manual
14541 that was originally written by Kurt Shoens.
14543 .\" }}}
14546 .Sh AUTHORS
14548 .An -nosplit
14549 .An "Kurt Shoens" ,
14550 .An "Edward Wang" ,
14551 .An "Keith Bostic" ,
14552 .An "Christos Zoulas" ,
14553 .An "Gunnar Ritter" .
14554 \*(UA is developed by
14555 .An "Steffen Nurpmeso" Aq s-mailx@lists.sdaoden.eu .
14558 .\" .Sh CAVEATS {{{
14559 .Sh CAVEATS
14561 \*(ID Interrupting an operation via
14562 .Dv \&\&SIGINT
14564 .Ql control-C
14565 from anywhere else but a command prompt is very problematic and likely
14566 to leave the program in an undefined state: many library functions
14567 cannot deal with the
14568 .Fn siglongjmp 3
14569 that this software (still) performs; even though efforts have been taken
14570 to address this, no sooner but in v15 it will have been worked out:
14571 interruptions have not been disabled in order to allow forceful breakage
14572 of hanging network connections, for example (all this is unrelated to
14573 .Va ignore ) .
14576 The SMTP and POP3 protocol support of \*(UA is very basic.
14577 Also, if it fails to contact its upstream SMTP server, it will not make
14578 further attempts to transfer the message at a later time (setting
14579 .Va save
14581 .Va sendwait
14582 may be useful).
14583 If this is a concern, it might be better to set up a local SMTP server
14584 that is capable of message queuing.
14586 .\" }}}
14589 .Sh BUGS
14591 After deleting some message of a POP3 mailbox the header summary falsely
14592 claims that there are no messages to display, one needs to perform
14593 a scroll or dot movement to restore proper state.
14596 .Ql thread Ns
14598 .Ic sort
14599 mode a power user may encounter crashes very occasionally (this is may
14600 and very).
14602 The file
14603 .Pa TODO
14604 in the source repository lists future directions.
14607 Please report bugs to the
14608 .Va contact-mail
14609 address, e.g., from within \*(uA:
14610 .\" v15-compat: drop eval as `mail' will expand variable?
14611 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
14612 Including the
14613 .Va verbose
14614 output of the command
14615 .Ic version
14616 may be helpful, e.g.,
14618 .Bd -literal -offset indent
14619 ? wysh set escape=! verbose; vput version xy; unset verbose;\e
14620   eval mail $contact-mail
14621 Bug subject
14622 !I xy
14627 Information on the web at
14628 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ' -Xx .
14630 .\" s-ts-mode