1 .\"@ nail.1 - S-nail(1) reference manual.
3 .\" Copyright (c) 2012 - 2020 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 .\" SPDX-License-Identifier: ISC
6 .\" Permission to use, copy, modify, and/or distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 .\"@ S-nail v14.9.22 / 2021-02-24
29 .ds VD \\%~/dead.letter
33 .ds vS /etc/mime.types
40 .ds ID [v15 behaviour may differ]
42 .ds NQ [Only new quoting rules]
45 .ds OU [no v15-compat]
49 .if !d str-Lb-libterminfo \
50 .ds str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo)
59 .Nd send and receive Internet mail
65 .\" Keep in SYNC: ./nail.1:"SYNOPSIS, main()
71 .Op : Ns Fl a Ar attachment Ns \&:
72 .Op : Ns Fl b Ar bcc-addr Ns \&:
73 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
74 .Op : Ns Fl c Ar cc-addr Ns \&:
75 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
77 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
79 .Op : Ns Fl T Ar """field:\0addr""" Ns \&:
80 .Op : Ns Fl X Ar cmd Ns \&:
81 .Op : Ns Fl Y Ar cmd Ns \&:
83 .Pf : Ar to-addr Ns \&:
84 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
92 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
95 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
97 .Op : Ns Fl X Ar cmd Ns \&:
98 .Op : Ns Fl Y Ar cmd Ns \&:
99 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
106 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
109 .Op Fl r Ar from-addr
110 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
111 .Op : Ns Fl X Ar cmd Ns \&:
112 .Op : Ns Fl Y Ar cmd Ns \&:
114 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
120 .Fl V | Fl Fl version
125 .Mx -toc -tree html pdf ps xhtml
128 .\" .Sh DESCRIPTION {{{
131 .Bd -filled -compact -offset indent
133 S-nail (\*(UA) will see major changes in v15.0 (circa 2022).
134 Some backward incompatibilities cannot be avoided.
137 .Sx "Shell-style argument quoting" ,
138 and shell metacharacters will become (more) meaningful.
139 Some commands accept new syntax today via
141 .Pf ( Sx "Command modifiers" ) .
142 Behaviour is flagged \*(IN and \*(OU,
146 .Pf ( Sx "INTERNAL VARIABLES" )
147 will choose new behaviour when applicable;
148 giving it a value makes
151 \*(OB flags what will vanish.
155 (with value) will be a default in v14.10.0!
159 \*(UA provides a simple and friendly environment for sending and
161 It is intended to provide the functionality of the POSIX
163 command, but is MIME capable and optionally offers extensions for
164 line editing, S/MIME, SMTP and POP3, among others.
165 \*(UA divides incoming mail into its constituent messages and allows
166 the user to deal with them in any order.
170 .Sx "INTERNAL VARIABLES"
171 for manipulating messages and sending mail.
172 It provides the user simple editing capabilities to ease the composition
173 of outgoing messages, and increasingly powerful and reliable
174 non-interactive scripting capabilities.
176 .\" .Ss "Options" {{{
179 .Bl -tag -width ".It Fl BaNg"
181 .It Fl \&: Ar spec , Fl Fl resource-files Ns =..
182 Controls loading of (as via
184 .Sx "Resource files" :
186 is parsed case-insensitively, the letter
188 corresponds to the system wide
191 the user's personal file
193 The (original) system wide resource is also compiled-in, accessible via
199 disable usage of resource files.
200 Order matters, default is
202 This option overrides
206 .It Fl A Ar name , Fl Fl account Ns =..
210 after program startup is complete (resource files loaded, only
212 commands are to be executed), and switch to its
214 .Sx "primary system mailbox"
217 If activation fails the program
219 s if used non-interactively, or if any of
226 .It Fl a Ar file Ns Oo Ar =input-charset Ns Oo Ar #output-charset Oc Oc , \
230 For \*(CM opportunities refer to
235 is subject to tilde expansion (see
236 .Sx "Filename transformations"
239 if it is not accessible but contains a
241 character, anything before the last
243 will be used as the filename, anything thereafter as a character set
244 specification, as shown.
246 If only an input character set
247 .Mx -ix "character set specification"
248 is specified, the input side is fixed, and no character set conversion
249 will be applied; an empty or the special string hyphen-minus
254 If an output character set has also been specified the desired
255 conversion is performed immediately, not considering file type and
256 content, except for an empty string or hyphen-minus
258 which select the default conversion algorithm (see
259 .Sx "Character sets" ) :
260 no immediate conversion is performed,
262 and its contents will be MIME-classified
263 .Pf ( Sx "HTML mail and MIME attachments" , "The mime.types files")
264 first \(em only the latter mode is available unless
270 (\*(OB: \*(UA will always use line-buffered output, to gain
271 line-buffered input even in batch mode enable batch mode via
275 .It Fl b Ar addr , Fl Fl bcc Ns =..
276 \*(SM Send a blind carbon copy to recipient
278 The option may be used multiple times.
280 .Sx "On sending mail, and non-interactive mode" .
283 .It Fl C Ar """field: body""" , Fl Fl custom-header Ns =..
284 Create a custom header which persists for an entire session.
285 A custom header consists of the field name followed by a colon
287 and the field content body, for example
288 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" .
289 Standard header field names cannot be overwritten by custom headers.
290 Runtime adjustable custom headers are available via the variable
295 .Sx "COMMAND ESCAPES" ,
298 are the most flexible and powerful options to manage message headers.
299 This option may be used multiple times.
302 .It Fl c Ar addr , Fl Fl cc Ns =..
305 except it places the argument in the list of carbon copies.
308 .It Fl D , Fl Fl disconnected
314 .It Fl d , Fl Fl debug
315 Enter a debug-only sandbox mode by setting the internal variable
317 the same can be achieved via
318 .Ql Fl S Va \&\&debug
320 .Ql Ic set Va \&\&debug .
325 .It Fl E , Fl Fl discard-empty-messages
329 and thus discard messages with an empty message part body, successfully.
332 .It Fl e , Fl Fl check-and-exit
333 Just check if mail is present (in the system
335 or the one specified via
337 if yes, return an exit status of zero, a non-zero value otherwise.
338 To restrict the set of mails to consider in this evaluation a message
339 specification can be added with the option
341 Quickrun: does not open an interactive session.
345 \*(SM Save the message to send in a file named after the local part of
346 the first recipient's address (instead of in
350 .It Fl f , Fl Fl file
351 Read in the contents of the user's
353 .Sx "secondary mailbox"
355 (or the specified file) for processing;
356 when \*(UA is quit, it writes undeleted messages back to this file
362 argument will undergo some special
363 .Sx "Filename transformations"
368 is not an argument to the flag
370 but is instead taken from the command line after option processing has
374 that starts with a hyphen-minus, prefix with a relative path, as in
375 .Ql ./-hyphenbox.mbox .
378 .It Fl H , Fl Fl header-summary
391 A configurable summary view is available via the option
393 This mode does not honour
395 Quickrun: does not open an interactive session.
398 .It Fl h , Fl Fl help
399 Show a brief usage summary; use
401 for a list long options.
407 to ignore tty interrupt signals.
410 .It Fl L Ar spec , Fl Fl search Ns =..
413 of all messages that match the given
417 found by the same algorithm used by
421 .Sx "Specifying messages"
424 This mode does not honour
429 option has been given in addition no header summary is produced,
430 but \*(UA will instead indicate via its exit status whether
436 note that any verbose output is suppressed in this mode and must instead
437 be enabled explicitly (see
439 Quickrun: does not open an interactive session.
443 \*(SM Will flag standard input with the MIME
445 set to the given known
447 .Pf ( Sx "HTML mail and MIME attachments" , "The mime.types files" )
448 and use it as the main message body.
449 \*(ID Using this option will bypass processing of
450 .Va message-inject-head
452 .Va message-inject-tail .
458 \*(SM MIME classify the specified
460 and use it as the main message body.
461 \*(ID Using this option will bypass processing of
462 .Va message-inject-head
464 .Va message-inject-tail .
469 .It Fl N , Fl Fl no-header-summary
470 inhibit the initial display of message headers when reading mail or
475 for the internal variable
480 Standard flag that inhibits reading the system wide
485 allows more control over the startup sequence; also see
486 .Sx "Resource files" .
489 .It Fl q Ar file , Fl Fl quote-file Ns =..
490 \*(SM Initialize the message body with the contents of
492 which may be standard input
494 only in non-interactive context.
499 .It Fl R , Fl Fl read-only
504 opened will be in read-only mode.
508 .It Fl r Ar from-addr , Fl Fl from-address Ns =..
509 The RFC 5321 reverse-path used for relaying and delegating messages to
510 its destination(s), for example to report delivery errors, is normally
511 derived from the address which appears in the
513 header (or, if that contains multiple addresses, in
515 A file-based aka local executable
517 (Mail-Transfer-Agent), however, instead uses the local identity of the
521 When this command line option is used the given single addressee
523 will be assigned to the internal variable
525 but in addition the command line option
526 .Fl \&\&f Ar from-addr
527 will be passed to a file-based
529 whenever a message is sent.
532 include a user name the address components will be separated and
533 the name part will be passed to a file-based
537 Even though not a recipient the
543 If an empty string is passed as
545 then the content of the variable
547 (or, if that contains multiple addresses,
549 will be evaluated and used for this purpose whenever the file-based
558 command line options are used when contacting a file-based MTA, unless
559 this automatic deduction is enforced by
561 ting the internal variable
562 .Va r-option-implicit .
565 Remarks: many default installations and sites disallow overriding the
566 local user identity like this unless either the MTA has been configured
567 accordingly or the user is member of a group with special privileges.
568 Passing an invalid address will cause an error.
572 .It Fl S Ar var Ns Oo = Ns value Oc , Fl Fl set Ns =..
574 (or, with a prefix string
577 .Sx "INTERNAL VARIABLES" ,
580 iable and optionally assign
582 if supported; \*(ID the entire expression is evaluated as if specified
583 within dollar-single-quotes (see
584 .Sx "Shell-style argument quoting" )
585 if the internal variable
588 If the operation fails the program will exit if any of
593 Settings established via
595 cannot be changed from within
597 or an account switch initiated by
599 They will become mutable again before commands registered via
604 .It Fl s Ar subject , Fl Fl subject Ns =..
605 \*(SM Specify the subject of the message to be sent.
606 Newline (NL) and carriage-return (CR) bytes are invalid and will be
607 normalized to space (SP) characters.
610 .It Fl T Ar """field: addr""" , Fl Fl target Ns =..
613 to the list of receivers targeted by
615 for now supported are only
621 Field and body (address) are separated by a colon
623 and optionally blank (space, tabulator) characters.
629 is parsed like a message header address line, as if it would be part of
630 a template message fed in via
632 and the same modifier suffix is supported.
633 This option may be used multiple times.
636 .It Fl t , Fl Fl template
637 \*(SM The text message given (on standard input) is expected to contain,
638 separated from the message body by an empty line, one or multiple
639 plain text message headers.
640 \*(ID Readily prepared MIME mail messages cannot be passed.
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
645 in the first column is ignored.
646 Message recipients can be given via the message headers
652 modifier enforces treatment as a single addressee, for example
653 .Ql To?single: exa, <m@ple> )
656 they will be added to any recipients specified on the command line,
657 and are likewise subject to
660 If a message subject is specified via
662 then it will be used in favour of one given on the command line.
664 More optional headers are
678 .Ql Mail-Followup-To: ,
679 by default created automatically dependent on message context, will
680 be used if specified (a special address massage will however still occur
682 Any other custom header field (also see
687 is passed through entirely
688 unchanged, and in conjunction with the options
692 it is possible to embed
693 .Sx "COMMAND ESCAPES" .
698 .It Fl u Ar user , Fl Fl inbox-of Ns =..
701 .Sx "primary system mailbox"
704 appropriate privileges presumed; effectively identical to
705 .Ql Fl \&\&f Ns \0%user .
708 .It Fl V , Fl Fl version
714 will also show the list of
716 .Ql $ \*(uA -:/ -Xversion -Xx .
719 .It Fl v , Fl Fl verbose
721 s the internal variable
723 to enable logging of informational context messages.
724 (Increases level of verbosity when used multiple times.)
729 .It Fl X Ar cmd , Fl Fl startup-cmd Ns =..
730 Add the given (or multiple for a multiline argument)
732 to a list of commands to be executed before normal operation starts.
733 The commands will be evaluated as a unit, just as via
741 .It Fl Y Ar cmd , Fl Fl cmd Ns =..
742 Add the given (or multiple for a multiline argument)
744 to a list of commands to be executed after normal operation has started.
745 The commands will be evaluated successively in the given order, and as
746 if given on the program's standard input \(em before interactive
747 prompting begins in interactive mode, after standard input has been
751 .It Fl ~ , Fl Fl enable-cmd-escapes
753 .Sx "COMMAND ESCAPES"
754 in \*(CM even in non-interactive use cases.
755 This can for example be used to automatically format the composed
756 message text before sending the message:
757 .Bd -literal -offset indent
758 $ ( echo 'line one. Word. Word2.';\e
759 echo '~| /usr/bin/fmt -tuw66' ) |\e
760 LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
764 .It Fl # , Fl Fl batch-mode
765 Enables batch mode: standard input is made line buffered, the complete
766 set of (interactive) commands is available, processing of
767 .Sx "COMMAND ESCAPES"
771 .Sx "INTERNAL VARIABLES"
772 are adjusted for batch necessities, exactly as if done via
792 are looked up, and acted upon.
793 The following prepares an email message in a batched dry run:
794 .Bd -literal -offset indent
795 $ for name in bob alice@exam.ple lisa@exam.ple; do
796 printf 'mail %s\en~s ubject\enText\en~.\en' "${name}"
798 LC_ALL=C \*(uA -#:x -Smta=test \e
799 -X'alias bob bob@exam.ple'
803 .It Fl \&. , Fl Fl end-options
804 This flag forces termination of option processing in order to prevent
807 It also forcefully puts \*(UA into send mode, see
808 .Sx "On sending mail, and non-interactive mode" .
814 allows their recognition all
816 arguments given at the end of the command line after a
818 separator will be passed through to a file-based
820 (Mail-Transfer-Agent) and persist for the entire session.
822 constraints do not apply to the content of
824 Command line receiver address handling supports the
829 .Sx "On sending mail, and non-interactive mode" .
831 .Bd -literal -offset indent
832 $ \*(uA -#:/ -X 'addrcodec enc Hey, ho <silver@go>' -Xx
836 .\" .Ss "A starter" {{{ review
839 \*(UA is a direct descendant of
841 Mail, itself a successor to the Research
844 .Dq was there from the start
847 It thus represents the user side of the
849 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
850 traditionally taken by
852 (and most MTAs provide a binary of this name for compatibility reasons).
857 of \*(UA then the system side is not a mandatory precondition for mail
861 \*(UA strives for compliance with the POSIX
866 .Sx "INTERNAL VARIABLES" ,
870 .Ev POSIXLY_CORRECT ,
871 needs to be set to adjust behaviour to be almost on par.
872 Almost, because there is one important difference: POSIX
873 .Sx "Shell-style argument quoting"
874 is (\*(ID increasingly) used instead of the
875 .Sx "Old-style argument quoting"
876 that the standard documents, which is believed to be a feature.
877 The builtin as well as the (default) global
880 already bend the standard imposed settings a bit.
889 in order to suppress the automatic moving of messages to the
891 .Sx "secondary mailbox"
893 that would otherwise occur (see
894 .Sx "Message states" ) ,
897 to not remove empty system MBOX mailbox files (or all empty such files in
899 mode) to avoid mangling of file permissions when files eventually get
903 To enter interactive mode even if the initial mailbox is empty
907 to allow editing of headers as well as
909 to not strip down addresses in
913 to include the message that is being responded to when
915 ing, which is indented by an
917 that also deviates from standard imposed settings.
918 .Va mime-counter-evidence
919 is fully enabled, too.
921 .Va followup-to-honour
924 to comply with reply address desires.
927 Credentials and other settings are easily addressable by grouping them via
929 The file mode creation mask can be managed with
931 Files and shell pipe output can be
935 uation, also during startup from within the
936 .Sx "Resource files" .
937 Informational context can be available by
947 .\" .Ss "On sending mail, and non-interactive mode" {{{
948 .Ss "On sending mail, and non-interactive mode"
950 To send a message to one or more people, using a local or built-in
952 (Mail-Transfer-Agent) transport to actually deliver the generated mail
953 message, \*(UA can be invoked with arguments which are the names of
954 people to whom the mail will be sent, and the command line options
958 can be used to add (blind) carbon copy receivers:
960 .Bd -literal -offset indent
962 $ echo Hello, world | \*(uA -:/ -Smta=test -s test $LOGNAME
964 # Via sendmail(1) MTA
965 $ </dev/null \*(uA -:x -s test $LOGNAME
967 # Debug dry-run mode:
968 $ </dev/null LC_ALL=C \*(uA -d -:/ \e
969 -Sttycharset=utf8 -Sfullnames \e
970 -b bcc@exam.ple -c cc@exam.ple -. \e
971 '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
973 # With SMTP (no real sending due to -d debug dry-run)
974 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Sttycharset=utf8 \e
975 -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
976 -S from=scriptreply@exam.ple \e
977 -a /etc/mail.rc --end-options \e
978 eric@exam.ple < /tmp/letter.txt
982 Email addresses and plain user names are subject to
984 filtering, names only are first expanded through
988 An address in angle brackets consisting only of a valid local user
990 will be converted to a fully qualified address if either
992 is not set, or set to a non-empty value; if set to the empty value the
993 conversion is left up to the
995 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
996 .\" grep the latter for the complete picture
999 fine-grained control of recipient address types other than user names
1000 and network addresses is possible.
1001 Recipients are classified as follows:
1002 any name that starts with a vertical bar
1004 character specifies a command pipe \(en the command string following the
1006 is executed and the message is sent to its standard input;
1007 likewise, any name that consists only of hyphen-minus
1009 or starts with the character solidus
1011 or the character sequence dot solidus
1013 is treated as a file, regardless of the remaining content.
1014 Any other name which contains a commercial at
1016 character is a network address;
1017 Any other name which starts with a plus sign
1019 character is a mailbox name;
1020 Any other name which contains a solidus
1022 character but no exclamation mark
1026 character before is also a mailbox name;
1027 What remains is treated as a network address.
1028 This classification can be avoided by using a
1031 .Sx "Compose mode" .
1033 .Bd -literal -offset indent
1034 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1035 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1036 $ echo safe | LC_ALL=C \e
1037 \*(uA -:/ -Smta=test -Sv15-compat -Sttycharset=utf8 \e
1038 --set mime-force-sendout --set fullnames \e
1039 -S expandaddr=fail,-all,+addr,failinvaddr -s test \e
1040 --end-options 'Imagine John <cold@turk.ey>'
1044 Before messages are sent they undergo editing in
1045 .Sx "Compose mode" .
1046 But many settings are static and can be set more generally.
1047 The envelope sender address for example is defined by
1049 explicitly defining an originating
1051 may be desirable, especially with the built-in SMTP Mail-Transfer-Agent
1053 .Sx "Character sets"
1054 for outgoing message and MIME part content are configurable via
1056 whereas input data is assumed to be in
1058 Message data will be passed over the wire in a
1060 and MIME parts aka attachments need a
1062 usually taken out of
1063 .Sx "The mime.types files" .
1064 Saving copies of sent messages in a
1066 mailbox may be desirable \(en as for most mailbox
1069 .Sx "Filename transformations"
1073 For the purpose of arranging a complete environment of settings that can
1074 be switched to with a single command or command line option there are
1076 Alternatively a flat configuration could be possible, making use
1077 of so-called variable chains which automatically pick
1081 context-dependent variants some variables support: for example addressing
1082 .Ql Ic Folder Ns \& pop3://yaa@exam.ple
1084 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1085 .Va \&\&pop3-no-apop-exam.ple
1090 .Sx "On URL syntax and credential lookup"
1092 .Sx "INTERNAL VARIABLES" .
1095 To avoid environmental noise scripts should create a script-local
1096 environment, ideally with the command line options
1098 to disable configuration files in conjunction with repetitions of
1100 to specify variables:
1102 .Bd -literal -offset indent
1103 $ env LC_ALL=C \*(uA -:/ \e
1105 -Sttycharset=utf-8 -Smime-force-sendout \e
1106 -Sexpandaddr=fail,-all,failinvaddr \e
1107 -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1108 -S from=scriptreply@exam.ple \e
1109 -s 'Subject to go' -a attachment_file \e
1111 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1116 As shown, scripts producing messages can
1118 a locale environment, the above specifies the all-compatible 7-bit clean
1121 but will nonetheless take and send UTF-8 in the message text by using
1123 If character set conversion is compiled in
1127 invalid (according to
1129 character input data would normally cause errors; setting
1130 .Va mime-force-sendout
1131 will instead, as a last resort, classify the input as binary data, and
1132 therefore allow message creation to be successful.
1133 (Such content can then be inspected either by installing a
1134 .Va pipe-TYPE/SUBTYPE
1136 .Ql application/octet-stream ,
1137 or possibly automatically through
1138 .Va mime-counter-evidence ) .
1141 In interactive mode, introduced soon, messages can be sent by calling the
1143 command with a list of recipient addresses:
1145 .Bd -literal -offset indent
1146 $ \*(uA -:/ -Squiet -Semptystart -Sfullnames -Smta=test
1147 "/var/spool/mail/user": 0 messages
1148 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1150 ? # Will do the right thing (tm)
1151 ? m rec1@exam.ple rec2@exam.ple
1155 .\" .Ss "Compose mode" {{{
1158 If standard input is a terminal rather than the message to be sent,
1159 the user is expected to type in the message contents.
1160 In compose mode lines beginning with the character
1162 (in fact the value of
1164 are special \(en these are so-called
1165 .Sx "COMMAND ESCAPES"
1166 which can be used to read in files, process shell commands, add and edit
1167 attachments and more.
1176 respectively, to revise the message in its current state,
1178 allows editing of the most important message headers, with the potent
1180 custom headers can be created, for example (more specifically than with
1186 gives an overview of most other available command escapes.
1189 To create file-carbon-copies the special recipient header
1191 may be used as often as desired, for example via
1193 Its entire value (or body in standard terms) is interpreted as a
1195 target, after having been subject to
1196 .Sx "Filename transformations" :
1197 this is the only way to create a file-carbon-copy without introducing an
1198 ambiguity regarding the interpretation of the address, file names with
1199 leading vertical bars or commercial ats can be used.
1200 Like all other recipients
1202 is subject to the checks of
1204 Any local file and pipe command addressee honours the setting of
1205 .Va mbox-fcc-and-pcc .
1208 Once finished with editing the command escape
1210 (see there) will call hooks, insert automatic injections and receivers,
1211 leave compose mode and send the message once it is completed.
1212 Aborting letter composition is possible with either of
1216 the latter of which will save the message in the file denoted by
1223 is set the effect of
1225 can also be achieved by typing end-of-transmission (EOT) via
1228 at the beginning of an empty line, and
1230 is always reachable by typing end-of-text (ETX) twice via
1235 The compose mode hooks
1236 .Va on-compose-enter , on-compose-splice , on-compose-leave
1238 .Va on-compose-cleanup
1241 d macros and provide reliable and increasingly powerful mechanisms to
1242 perform automated message adjustments dependent on message context,
1243 for example addition of message signatures
1244 .Pf ( Va message-inject-head , message-inject-tail )
1245 or creation of additional receiver lists (also by setting
1246 .Va autocc , autobcc ) .
1247 To achieve that the command
1249 may be used in order to query and adjust status of message(s).
1250 The splice hook can also make use of
1251 .Sx "COMMAND ESCAPES" .
1252 (\*(ID The compose mode hooks work for
1253 .Ic forward , mail , reply
1258 only provide the hooks
1261 .Va on-resend-cleanup ,
1262 which are pretty restricted due to the nature of the operation.)
1265 .\" .Ss "On reading mail, and more on interactive mode" {{{
1266 .Ss "On reading mail, and more on interactive mode"
1268 When invoked without addressees \*(UA enters interactive mode in which
1270 When used like that the user's system
1272 (for more on mailbox types please see the command
1274 is read in and a one line header of each message therein is displayed if
1278 The visual style of this summary of
1280 can be adjusted through the variable
1282 and the possible sorting criterion via
1288 can be performed with the command
1290 If the initially opened mailbox is empty \*(UA will instead exit
1291 immediately (after displaying a message) unless the variable
1300 will give a listing of all available commands and
1302 will \*(OPally give a summary of some common ones.
1303 If the \*(OPal documentation strings are available (see
1307 .Pf "(or " Ql \&?X )
1308 and see the actual expansion of
1310 and what its purpose is, i.e., commands can be abbreviated
1311 (note that POSIX defines some abbreviations, so that the alphabetical
1312 order of commands does not necessarily relate to the abbreviations; it is
1313 however possible to define overwrites with
1314 .Ic commandalias ) .
1315 These commands can also produce a more
1320 Messages are given numbers (starting at 1) which uniquely identify
1321 messages; the current message \(en the
1323 \(en will either be the first new message, or the first unread message,
1324 or the first message of the mailbox; the internal variable
1326 will instead cause usage of the last message for this purpose.
1331 ful of header summaries containing the
1335 will display only the summaries of the given messages, defaulting to the
1339 Message content can be displayed with the command
1346 controls whether and when \*(UA will use the configured
1348 for display instead of directly writing to the user terminal
1350 the sole difference to the command
1352 which will always use the
1356 will instead only show the first
1358 of a message (maybe even compressed if
1361 Message display experience may improve by setting and adjusting
1362 .Va mime-counter-evidence ,
1364 .Sx "HTML mail and MIME attachments" .
1367 By default the current message
1369 is displayed, but like with many other commands it is possible to give
1370 a fancy message specification (see
1371 .Sx "Specifying messages" ) ,
1374 will display all unread messages,
1379 will type the messages 1 and 5,
1381 will type the messages 1 through 5, and
1385 will display the previous and the next message, respectively.
1388 (a more substantial alias for
1390 will display a header summary of the given message specification list
1391 instead of their content; the following will search for subjects:
1394 .Dl ? from "'@Some subject to search for'"
1397 In the default setup all header fields of a message will be
1399 d, but fields can be white- or blacklisted for a variety of
1400 applications by using the command
1402 e.g., to restrict their display to a very restricted set for
1404 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1405 In order to display all header fields of a message regardless of
1406 currently active ignore or retain lists, use the commands
1411 will show the raw message content.
1412 Note that historically the global
1414 not only adjusts the list of displayed headers, but also sets
1416 (\*(ID A yet somewhat restricted) Reliable scriptable message
1417 inspection is available via
1421 Dependent upon the configuration a line editor (see the section
1422 .Sx "On terminal control and line editor" )
1423 aims at making the user experience with the many
1426 When reading the system
1432 specified a mailbox explicitly prefixed with the special
1434 modifier (to propagate it to a
1436 .Sx "primary system mailbox" ) ,
1437 then messages which have been read
1438 .Pf (see\0 Sx "Message states" )
1439 will be automatically moved to a
1441 .Sx "secondary mailbox" ,
1444 file, when the mailbox is left, either by changing the active mailbox or
1445 by quitting \*(UA \(en this automatic moving from a system- or primary-
1446 to the secondary mailbox is not performed when the variable
1449 Messages can also be explicitly
1451 d to other mailboxes, whereas
1453 keeps the original message.
1455 can be used to write out data content of specific parts of messages.
1458 After examining a message the user can
1460 to the sender and all recipients (which will also be placed in
1463 .Va recipients-in-cc
1466 exclusively to the sender(s).
1467 To comply with with the receivers desired reply address the
1471 .Va followup-to-honour
1474 should usually be set.
1479 know how to apply a special addressee massage, see
1480 .Sx "Mailing lists" .
1481 Dependent on the presence and value of
1483 the message being replied to will be included in a quoted form.
1485 ing a message will allow editing the new message: the original message
1486 will be contained in the message body, adjusted according to
1492 messages: the former will add a series of
1494 headers, whereas the latter will not; different to newly created
1495 messages editing is not possible and no copy will be saved even with
1497 unless the additional variable
1500 When sending, replying or forwarding messages comments and full names
1501 will be stripped from recipient addresses unless the internal variable
1506 Of course messages can be
1508 and they can spring into existence again via
1510 or when the \*(UA session is ended via the
1514 commands to perform a quick program termation.
1515 To end a mail processing session regularly and perform a full program
1516 exit one may issue the command
1518 It will, among others, move read messages to the
1520 .Sx "secondary mailbox"
1522 as necessary, discard deleted messages in the current mailbox,
1523 and update the \*(OPal (see
1527 By the way, whenever the main event loop is about to look out for the
1528 next input line it will trigger the hook
1529 .Va on-main-loop-tick .
1532 .\" .Ss "HTML mail and MIME attachments" {{{ review
1533 .Ss "HTML mail and MIME attachments"
1535 HTML-only messages become more and more common, and many messages come
1536 bundled with a bouquet of MIME (Multipurpose Internet Mail Extensions)
1537 parts and attachments.
1538 To get a notion of MIME types \*(UA has a default set of types built-in,
1539 onto which the content of
1540 .Sx "The mime.types files"
1541 will be added (as configured and allowed by
1542 .Va mimetypes-load-control ) .
1543 Types can also become registered with the command
1545 To improve interaction with the faulty MIME part declarations of real life
1546 .Va mime-counter-evidence
1547 will allow verification of the given assertion, and the possible
1548 provision of an alternative, better MIME type.
1551 Whereas a simple HTML-to-text filter for displaying HTML messages is
1552 \*(OPally supported (indicated by
1553 .Ql ,+filter-html-tagsoup,
1556 MIME types other than plain text cannot be handled directly.
1557 Instead programs need to become registered to deal with specific MIME
1558 types or file extensions, either to prepare (re-)integrable plain text
1559 versions of their input (a mode which is called
1560 .Cd copiousoutput ) ,
1561 or to display the content externally, for example in a graphical window:
1562 the latter type is only considered by and for the command
1566 To install a handler program for a MIME type an according
1567 .Va pipe-TYPE/SUBTYPE
1568 variable needs to be set; to define a handler for a file extension
1570 can be used \(en these handlers take precedence.
1571 \*(OPally mail user agent configuration is supported (see
1572 .Sx "The Mailcap files" ) ,
1573 and will be queried for display or quote handlers after the former ones.
1574 Type-markers registered via
1576 are the last possible source for information how to handle a MIME type.
1579 For example, to display HTML messages integrated via the text browsers
1583 register a MathML MIME type and enable its plain text display, and to
1584 open PDF attachments in an external PDF viewer, asynchronously and with
1585 some other magic attached:
1587 .Bd -literal -offset indent
1588 ? if "$features" !% ,+filter-html-tagsoup,
1589 ? #set pipe-text/html='?* elinks -force-html -dump 1'
1590 ? set pipe-text/html='?* lynx -stdin -dump -force_html'
1591 ? # Display HTML as plain text instead
1592 ? #set pipe-text/html=?t
1594 ? mimetype ?t application/mathml+xml mathml
1595 ? wysh set pipe-application/pdf='?&=? \e
1596 trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1597 trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1598 mupdf "${MAILX_FILENAME_TEMPORARY}"'
1602 .\" .Ss "Mailing lists" {{{
1605 Known or subscribed-to mailing lists may be flagged in the summary of
1610 and will gain special treatment when sending mails: the variable
1611 .Va followup-to-honour
1613 .Ql Mail-\:Followup-\:To:
1614 header is honoured when a message is being replied to
1621 controls creation of this header when creating
1623 s, if the necessary user setup
1624 .Pf ( from , sender ) ;
1625 is available; then, it may also be created automatically, for example
1626 when list-replying via
1634 is used and the messages
1635 .Ql Mail-Followup-To:
1643 manage \*(UAs notion of which addresses are mailing lists.
1644 With the \*(OPal regular expression support any address
1645 .Mx -ix "magic regular expression characters"
1646 which contains any of the magic regular expression characters
1652 dependent on the host system)
1653 will be compiled and used as one, possibly matching many addresses.
1654 It is not possible to escape the
1656 in order to match special characters as-is, bracket expressions must be
1658 .Ql Ic search Li @subject@'[[]open bracket' .
1660 .Bd -literal -offset indent
1661 ? set followup-to followup-to-honour=ask-yes \e
1662 reply-to-honour=ask-yes
1663 ? mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1664 ? mlsubscribe a4@b4.c4 exact@lists.c3
1668 Known and subscribed lists differ in that for the latter the
1670 s address is not part of a generated
1671 .Ql Mail-Followup-To: .
1672 There are exceptions, for example if multiple lists are addressed and
1673 not all have the subscription attribute.
1674 When replying to a message its list address
1676 header) is automatically and temporarily treated like a known
1678 dependent on the variable
1682 is used instead (if it is a single address on the same domain as
1684 in order to accept a list administrator's wish that is supposed to have
1685 been manifested like that.
1688 For convenience and compatibility with mail programs that do not honour
1689 the non-standard M-F-T, an automatic user entry in the carbon-copy
1691 address list of generated message can be created by setting
1692 .Va followup-to-add-cc .
1693 This entry will be added whenever the user will be placed in the
1694 .Ql Mail-Followup-To:
1695 list, and is not a regular addressee already.
1696 .Va reply-to-swap-in
1697 tries to deal with the address rewriting that many mailing-lists nowadays
1698 perform to work around DKIM / DMARC etc. standard imposed problems.
1701 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1702 .Ss "Signed and encrypted messages with S/MIME"
1704 \*(OP S/MIME provides two central mechanisms:
1705 message signing and message encryption.
1706 A signed message contains some data in addition to the regular text.
1707 The data can be used to verify that the message has been sent using
1708 a valid certificate, that the sender address matches that in the
1709 certificate, and that the message text has not been altered.
1710 Signing a message does not change its regular text;
1711 it can be read regardless of whether the recipients software is able to
1713 It is thus usually possible to sign all outgoing messages if so desired.
1716 Encryption, in contrast, makes the message text invisible for all people
1717 except those who have access to the secret decryption key.
1718 To encrypt a message, the specific recipients public encryption key
1720 It is therefore not possible to send encrypted mail to people unless their
1721 key has been retrieved from either previous communication or public key
1723 Because signing is performed with private keys, and encryption with
1724 public keys, messages should always be signed before being encrypted.
1727 A central concept to S/MIME is that of the certification authority (CA).
1728 A CA is a trusted institution that issues certificates.
1729 For each of these certificates it can be verified that it really
1730 originates from the CA, provided that the CA's own certificate is
1732 A set of CA certificates is usually delivered and installed together
1733 with the cryptographical library that is used on the local system.
1734 Therefore reasonable security for S/MIME on the Internet is provided if
1735 the source that provides that library installation is trusted.
1736 It is also possible to use a specific pool of trusted certificates.
1738 .Va smime-ca-no-defaults
1739 should be set to avoid using the default certificate pool, and
1743 should be pointed to a trusted pool of certificates.
1744 A certificate cannot be more secure than the method its CA certificate
1745 has been retrieved with.
1748 This trusted pool of certificates is used by the command
1750 to ensure that the given S/MIME messages can be trusted.
1751 If so, verified sender certificates that were embedded in signed
1752 messages can be saved locally with the command
1754 and used by \*(UA to encrypt further communication with these senders:
1756 .Bd -literal -offset indent
1758 ? set smime-encrypt-USER@HOST=FILENAME \e
1759 smime-cipher-USER@HOST=AES256
1763 To sign outgoing messages, in order to allow receivers to verify the
1764 origin of these messages, a personal S/MIME certificate is required.
1765 \*(UA supports password-protected personal certificates (and keys), see
1766 .Va smime-sign-cert .
1768 .Sx "On URL syntax and credential lookup"
1769 gives an overview of the possible sources of user credentials, and
1770 .Sx "S/MIME step by step"
1771 shows examplarily how a private S/MIME certificate can be obtained.
1772 In general, if such a private key plus certificate
1774 is available, all that needs to be done is to set some variables:
1776 .Bd -literal -offset indent
1777 ? set smime-sign-cert=ME@exam.ple.paired \e
1778 smime-sign-digest=SHA512 \e
1779 smime-sign from=myname@my.host
1783 Variables of interest for S/MIME in general are
1786 .Va smime-ca-flags ,
1787 .Va smime-ca-no-defaults ,
1789 .Va smime-crl-file .
1790 For S/MIME signing of interest are
1792 .Va smime-sign-cert ,
1793 .Va smime-sign-include-certs
1795 .Va smime-sign-digest .
1796 Additional variables of interest for S/MIME en- and decryption:
1799 .Va smime-encrypt-USER@HOST .
1800 Variables of secondary interest may be
1801 .Va content-description-smime-message
1803 .Va content-description-smime-signature .
1804 S/MIME is available if
1810 \*(ID Note that neither S/MIME signing nor encryption applies to
1811 message subjects or other header fields yet.
1812 Thus they may not contain sensitive information for encrypted messages,
1813 and cannot be trusted even if the message content has been verified.
1814 When sending signed messages,
1815 it is recommended to repeat any important header information in the
1819 .\" .Ss "On URL syntax and credential lookup" {{{ review
1820 .Ss "On URL syntax and credential lookup"
1822 For accessing protocol-specific resources Uniform Resource Locators
1823 (URL, RFC 3986) have become omnipresent.
1824 Here they are expected in a
1826 variant, not used in data exchange, but only meant as a compact,
1827 easy-to-use way of defining and representing information in a well-known
1828 notation; as such they do not conform to any real standard.
1829 Optional parts are placed in brackets
1831 optional either because there also exist other ways to define the
1832 information, or because the part is protocol specific.
1834 for example is used by the \*(OPal Maildir
1836 type and the IMAP protocol, but not by POP3.
1841 are included in an URL server specification, URL percent encoded
1842 (RFC 3986) forms are needed, generable with
1846 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1850 .Sx "INTERNAL VARIABLES"
1851 exist in multiple versions, called
1853 in this document: the plain
1858 .Ql variable-USER@HOST .
1859 If a port was specified
1867 is never in URL percent encoded form.
1868 For example, whether the hypothetical
1869 .Ql smtp://\:wings\:%3A\:of\:@a.dove
1870 including user and password was used, or whether it was
1872 and it came from a different source, to lookup the chain
1873 .Va tls-config-pairs
1875 .Ql tls-\:config-\:pairs-\:wings:of@a.dove
1877 .Ql tls-\:config-pairs\-\:a.dove ,
1878 before finally looking up the plain variable.
1881 The logic to collect (an
1883 s) credential information is as follows:
1887 A user is always required.
1890 has been given in the URL the variables
1895 Afterwards, when enforced by the \*(OPal variables
1896 .Va netrc-lookup-HOST
1899 .Sx "The .netrc file"
1900 of the user will be searched for a
1902 specific entry which provides a
1904 name: only unambiguous entries are used (one possible matching entry for
1907 If there is still no
1911 known to be a valid user on the current host, is used.
1914 Authentication: unless otherwise noted the chain
1915 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1916 is checked, falling back to a protocol-specific default as necessary.
1921 has been given in the URL, then if the
1923 has been found through the \*(OPal
1925 that may have also provided the password.
1927 .Va password-USER@HOST , password-HOST , password
1930 Thereafter the (now complete) \*(OPal chain
1931 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1932 is checked, if set the
1934 cache is searched for a password only (multiple user accounts for
1935 a single machine may exist as well as a fallback entry without user
1936 but with a password).
1938 If at that point there is still no password available, but the
1939 (protocols') chosen authentication type requires a password, then in
1940 interactive mode the user will be prompted on the terminal.
1945 S/MIME verification works relative to the values found in the
1949 header field(s), which means the values of
1950 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1952 .Va smime-sign-digest
1953 will not be looked up using the
1957 chains from above, but instead use the corresponding values from the
1958 message that is being worked on.
1959 If no address matches we assume and use the setting of
1961 In unusual cases multiple and different
1965 combinations may therefore be involved \(en on the other hand those
1966 unusual cases become possible.
1967 The usual case is as short as:
1969 .Bd -literal -offset indent
1970 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1971 smime-sign smime-sign-cert=+smime.pair \e
1978 contains complete example configurations.
1981 .\" .Ss "Encrypted network communication" {{{ review
1982 .Ss "Encrypted network communication"
1984 \*(OP SSL (Secure Sockets Layer) aka its successor TLS (Transport Layer
1985 Security) are protocols which aid in securing communication by providing
1986 a safely initiated and encrypted network connection.
1987 A central concept of TLS are certificates: as part of each network
1988 connection setup a (set of) certificates will be exchanged through which
1989 the identity of the network peer can be cryptographically verified;
1990 if possible the TLS/SNI (ServerNameIndication) extension will be enabled
1991 to allow servers fine-grained control over the certificates being used.
1992 A locally installed pool of trusted certificates will then be inspected,
1993 and verification will succeed if it contains a(n in)direct signer of the
1994 presented certificate(s).
1997 The local pool of trusted so-called CA (Certification Authority)
1998 certificates is usually delivered with and used along the TLS library.
1999 A custom pool of trusted certificates can be selected by pointing
2001 and/or (with special preparation)
2003 to the desired location; setting
2004 .Va tls-ca-no-defaults
2005 in addition will avoid additional inspection of the default pool.
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 with the command
2011 (port can usually be the protocol name, too, and
2013 is taken into account here):
2015 .Bd -literal -offset indent
2016 $ \*(uA -vX 'tls certchain SERVER-URL[:PORT]; x'
2020 A local pool of CA certificates is not strictly necessary, however,
2021 server certificates can also be verified via their fingerprint.
2022 For this a message digest will be calculated and compared against the
2024 .Va tls-fingerprint ,
2025 and verification will succeed if the fingerprint matches.
2026 The message digest (algorithm) can be configured via the variable chain
2027 .Va tls-fingerprint-digest ;
2031 .Bd -literal -offset indent
2032 $ \*(uA -X 'wysh set verbose; tls fingerprint SERVER-URL[:PORT]; x'
2036 It depends on the used protocol whether encrypted communication is
2037 possible, and which configuration steps have to be taken to enable it.
2038 Some protocols, like POP3S, are implicitly encrypted, others, like
2039 POP3, can upgrade a plain text connection if so requested.
2040 For example, to use the
2042 that POP3 offers (a member of) the variable (chain)
2043 .Va pop3-use-starttls
2044 needs to be set, with convenience via
2047 .Bd -literal -offset indent
2048 shortcut encpop1 pop3s://pop1.exam.ple
2050 shortcut encpop2 pop3://pop2.exam.ple
2051 set pop3-use-starttls-pop2.exam.ple
2053 set mta=smtps://smtp.exam.ple:465
2054 set mta=smtp://smtp.exam.ple smtp-use-starttls
2058 Normally that is all there is to do, given that TLS libraries try to
2059 provide safe defaults, plenty of knobs however exist to adjust settings.
2060 For example certificate verification settings can be fine-tuned via
2062 and the TLS configuration basics are accessible via
2063 .Va tls-config-pairs ,
2064 for example to control protocol versions or cipher lists.
2065 In the past hints on how to restrict the set of protocols to highly
2066 secure ones were indicated, but as of the time of this writing the list
2067 of protocols or ciphers may need to become relaxed in order to be able
2068 to connect to some servers; the following example allows connecting to a
2070 that uses OpenSSL 0.9.8za from June 2014 (refer to
2071 .Sx "INTERNAL VARIABLES"
2072 for more on variable chains):
2074 .Bd -literal -offset indent
2075 wysh set tls-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
2076 CipherString=TLSv1.2:!aNULL:!eNULL:\e
2077 ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
2078 DHE-RSA-AES256-SHA:@STRENGTH'
2084 should be referred to when creating a custom cipher list.
2085 Variables of interest for TLS in general are
2089 .Va tls-ca-no-defaults ,
2090 .Va tls-config-file ,
2091 .Va tls-config-module ,
2092 .Va tls-config-pairs ,
2106 .\" .Ss "Character sets" review {{{
2107 .Ss "Character sets"
2109 \*(OP The user's locale environment is detected by looking at the
2111 environment variable.
2112 The internal variable
2114 will be set to the detected terminal character set accordingly,
2115 and will thus show up in the output of commands like
2119 This character set will be targeted when trying to display data,
2120 and user input data is expected to be in this character set, too.
2123 When creating messages their character input data is classified.
2124 7-bit clean text data and attachments will be classified as
2126 8-bit data will \*(OPally be converted into members of
2128 until a character set conversion succeeds.
2130 is the implied default last member of this list.
2131 If no 8-bit character set is capable to represent input data,
2132 no message will be sent, and its text will optionally be
2136 If that is not acceptable, for example in script environments,
2137 .Va mime-force-sendout
2138 can be set to force sending of non-convertible data as
2139 .Ql application/octet-stream
2140 classified binary content instead: like this receivers still have the
2141 option to inspect message content (for example via
2142 .Va mime-counter-evidence ) .
2143 If the \*(OPal character set conversion is not available
2148 is the only supported character set for non 7-bit clean data, and
2149 it is simply assumed it can be used to exchange 8-bit messages.
2153 may also be given an explicit value to send mail in a completely
2155 locale environment, which can be used to generate and send for
2156 example 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2158 environment (an example of this can be found in the section
2159 .Sx "On sending mail, and non-interactive mode" ) .
2160 Due to lack of programming interfaces reading mail will not really work
2161 as expected in a faked environment: whereas
2163 might be addressable, any output will be made safely printable, as via
2166 according to the actual locale environment, which is not affected by
2170 Classifying 7-bit clean data as
2172 is a problem if the input character set
2173 .Pf ( Va ttycharset )
2174 is a multibyte character set that is itself 7-bit clean.
2175 For example, the Japanese character set ISO-2022-JP is, but is capable
2176 to encode the rich set of Japanese Kanji, Hiragana and Katakana
2177 characters: in order to notify receivers of this character set the mail
2178 message must be MIME encoded so that the character set ISO-2022-JP can
2179 be advertised, otherwise an invalid email message would result!
2180 To achieve this, the variable
2182 can be set to ISO-2022-JP.
2183 (Today a better approach regarding email is the usage of UTF-8, which
2184 uses 8-bit bytes for non-US-ASCII data.)
2187 When replying to a message and the variable
2188 .Va reply-in-same-charset
2189 is set, the character set of the message being replied to is tried first
2190 as a target character set (still being a subject of
2192 filtering, however).
2193 Another opportunity is
2194 .Va sendcharsets-else-ttycharset
2195 to reflect the user's locale environment automatically, it will treat
2197 as an implied member of (an unset)
2201 \*(OP When reading messages, their text data is converted into
2203 as necessary in order to display them on the user's terminal.
2204 Unprintable characters and invalid byte sequences are detected
2205 and replaced by substitution characters.
2206 Character set mappings for source character sets can be established with
2208 which may be handy to work around faulty or incomplete character set
2209 catalogues (one could for example add a missing LATIN1 to ISO-8859-1
2210 mapping), or to enforce treatment of one character set as another one
2211 .Pf ( Dq interpret LATIN1 as CP1252 ) .
2213 .Va charset-unknown-8bit
2214 to deal with another hairy aspect of message interpretation.
2217 In general, if a message saying
2218 .Dq cannot convert from a to b
2219 appears, either some characters are not appropriate for the currently
2220 selected (terminal) character set,
2221 or the needed conversion is not supported by the system.
2222 In the first case, it is necessary to set an appropriate
2224 locale and/or the variable
2226 The best results are usually achieved when running in a UTF-8
2227 locale on a UTF-8 capable terminal, in which case the full Unicode
2228 spectrum of characters is available.
2229 In this setup characters from various countries can be displayed,
2230 while it is still possible to use more simple character sets for sending
2231 to retain maximum compatibility with older mail clients.
2234 On the other hand the POSIX standard defines a locale-independent 7-bit
2235 .Dq portable character set
2236 that should be used when overall portability is an issue, the even more
2237 restricted subset named
2238 .Dq portable filename character set
2239 consists of A-Z, a-z, 0-9, period
2247 .\" .Ss "Message states" {{{
2248 .Ss "Message states"
2250 \*(UA differentiates in between several message states; the current
2251 state will be reflected in the summary of
2258 .Sx "Specifying messages"
2259 dependent on their state is possible.
2260 When operating on the system
2264 .Sx "primary system mailbox" ,
2265 special actions, like the automatic moving of messages to the
2267 .Sx "secondary mailbox"
2269 may be applied when the mailbox is left (also implicitly by program
2270 termination, unless the command
2272 was used) \(en however, because this may be irritating to users which
2275 mail-user-agents, the provided global
2277 template sets the internal
2281 variables in order to suppress this behaviour.
2283 .Bl -hang -width ".It Ql new"
2285 Message has neither been viewed nor moved to any other state.
2286 Such messages are retained even in the
2288 .Sx "primary system mailbox" .
2291 Message has neither been viewed nor moved to any other state, but the
2292 message was present already when the mailbox has been opened last:
2293 Such messages are retained even in the
2295 .Sx "primary system mailbox" .
2298 The message has been processed by one of the following commands:
2317 will always try to automatically
2323 logical message, and may thus mark multiple messages as read, the
2325 command will do so if the internal variable
2331 command is used, messages that are in a
2333 .Sx "primary system mailbox"
2336 state when the mailbox is left will be saved in the
2338 .Sx "secondary mailbox"
2340 unless the internal variable
2345 The message has been processed by one of the following commands:
2351 can be used to access such messages.
2354 The message has been processed by a
2356 command and it will be retained in its current location.
2359 The message has been processed by one of the following commands:
2365 command is used, messages that are in a
2367 .Sx "primary system mailbox"
2370 state when the mailbox is left will be deleted; they will be saved in the
2372 .Sx "secondary mailbox"
2374 when the internal variable
2380 In addition to these message states, flags which otherwise have no
2381 technical meaning in the mail system except allowing special ways of
2382 addressing them when
2383 .Sx "Specifying messages"
2384 can be set on messages.
2385 These flags are saved with messages and are thus persistent, and are
2386 portable between a set of widely used MUAs.
2388 .Bl -hang -width ".It Ic answered"
2390 Mark messages as having been answered.
2392 Mark messages as being a draft.
2394 Mark messages which need special attention.
2398 .\" .Ss "Specifying messages" {{{
2399 .Ss "Specifying messages"
2404 .Sx "Message list arguments" ,
2411 can perform actions on a number of messages at once.
2412 Specifying invalid messages, or using illegal syntax, will cause errors
2413 to be reported through the
2414 .Sx "INTERNAL VARIABLES"
2417 and companions, as well as the command exit status
2423 deletes the messages 1 and 2,
2426 will delete the messages 1 through 5.
2427 In sorted or threaded mode (see the
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
2437 Errors can for example be
2439 when requesting an invalid message,
2441 if no applicable message can be found,
2442 .Va ^ERR Ns -CANCELED
2443 for missing informational data (mostly thread-related).
2445 for invalid syntax as well as
2447 for input/output errors can happen.
2448 The following special message names exist:
2451 .Bl -tag -width ".It Ar BaNg"
2453 The current message, the so-called
2457 The message that was previously the current message; needs to be quoted.
2460 The parent message of the current message,
2461 that is the message with the Message-ID given in the
2463 field or the last entry of the
2465 field of the current message.
2468 The previous undeleted message, or the previous deleted message for the
2474 ed mode, the previous such message in the according order.
2477 The next undeleted message, or the next deleted message for the
2483 ed mode, the next such message in the according order.
2486 The first undeleted message,
2487 or the first deleted message for the
2493 ed mode, the first such message in the according order.
2496 The last message; In
2500 ed mode, the last such message in the according order.
2508 mode, selects the message addressed with
2512 is any other message specification,
2513 and all messages from the thread that begins at it.
2514 Otherwise it is identical to
2519 the thread beginning with the current message is selected.
2525 All messages that were included in the
2526 .Sx "Message list arguments"
2527 of the previous command; needs to be quoted.
2528 (A convenient way to read all new messages is to select them via
2530 as below, and then to read them in order with the default command \(em
2532 \(em simply by successively typing
2539 An inclusive range of message numbers.
2540 Selectors that may also be used as endpoints include any of
2545 .Dq any substring matches
2548 header, which will match addresses (too) even if
2550 is set (and POSIX says
2551 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2554 variable is set, only the local part of the address is evaluated
2555 for the comparison, not ignoring case, and the setting of
2557 is completely ignored.
2558 For finer control and match boundaries use the
2562 .It Ar / Ns Ar string
2563 All messages that contain
2565 in the subject field (case ignored according to locale).
2572 the string from the previous specification of that type is used again.
2575 .It Xo Op Ar @ Ns Ar name-list Ns
2578 All messages that contain the given case-insensitive search
2580 ession; If the \*(OPal regular expression support is available
2582 will be interpreted as (an extended) one if any of the
2584 .Sx "magic regular expression characters"
2587 .Ar @ Ns Ar name-list
2588 part is missing the search is restricted to the subject field body,
2591 specifies a comma-separated list of header fields to search, for example
2594 .Dl '@to,from,cc@Someone i ought to know'
2597 In order to search for a string that includes a
2599 (commercial at) character the
2601 is effectively non-optional, but may be given as the empty string.
2602 Also, specifying an empty search
2604 ession will effectively test for existence of the given header fields.
2605 Some special header fields may be abbreviated:
2619 respectively and case-insensitively.
2620 \*(OPally, and just like
2623 will be interpreted as (an extended) regular expression if any of the
2625 .Sx "magic regular expression characters"
2633 can be used to search in (all of) the header(s) of the message, and the
2642 will perform full text searches \(en whereas the former searches only
2643 the body, the latter also searches the message header (\*(ID this mode
2644 yet brute force searches over the entire decoded content of messages,
2645 including administrativa strings).
2648 This specification performs full text comparison, but even with
2649 regular expression support it is almost impossible to write a search
2650 expression that safely matches only a specific address domain.
2651 To request that the body content of the header is treated as a list of
2652 addresses, and to strip those down to the plain email address which the
2653 search expression is to be matched against, prefix the effective
2659 .Dl '@~f,c@@a\e.safe\e.domain\e.match$'
2663 All messages of state or with matching condition
2667 is one or multiple of the following colon modifiers:
2669 .Bl -tag -compact -width ".It Ar :M"
2672 messages (cf. the variable
2673 .Va markanswered ) .
2685 Messages with receivers that match
2689 Messages with receivers that match
2696 Old messages (any not in state
2704 \*(OP Messages with unsure spam classification (see
2705 .Sx "Handling spam" ) .
2707 \*(OP Messages classified as spam.
2719 \*(OP IMAP-style SEARCH expressions may also be used.
2720 These consist of keywords and criterions, and because
2721 .Sx "Message list arguments"
2722 are split into tokens according to
2723 .Sx "Shell-style argument quoting"
2724 it is necessary to quote the entire IMAP search expression in order to
2725 ensure that it remains a single token.
2726 This addressing mode is available with all types of mailbox
2728 s; \*(UA will perform the search locally as necessary.
2729 Strings must be enclosed by double quotation marks
2731 in their entirety if they contain whitespace or parentheses;
2732 within the quotes, only reverse solidus
2734 is recognized as an escape character.
2735 All string searches are case-insensitive.
2736 When the description indicates that the
2738 representation of an address field is used,
2739 this means that the search string is checked against both a list
2742 .Bd -literal -offset indent
2743 \&'(\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)'
2748 and the addresses without real names from the respective header field.
2749 These search expressions can be nested using parentheses, see below for
2753 .Bl -tag -compact -width ".It Ar _n_u"
2754 .It Ar ( criterion )
2755 All messages that satisfy the given
2757 .It Ar ( criterion1 criterion2 ... criterionN )
2758 All messages that satisfy all of the given criteria.
2760 .It Ar ( or criterion1 criterion2 )
2761 All messages that satisfy either
2766 To connect more than two criteria using
2768 specifications have to be nested using additional parentheses,
2770 .Ql (or a (or b c)) ,
2774 .Ql ((a or b) and c) .
2777 operation of independent criteria on the lowest nesting level,
2778 it is possible to achieve similar effects by using three separate
2782 .It Ar ( not criterion )
2783 All messages that do not satisfy
2785 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2786 All messages that contain
2788 in the envelope representation of the
2791 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2792 All messages that contain
2794 in the envelope representation of the
2797 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2798 All messages that contain
2800 in the envelope representation of the
2803 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2804 All messages that contain
2809 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2810 All messages that contain
2812 in the envelope representation of the
2815 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2816 All messages that contain
2821 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2822 All messages that contain
2825 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2826 All messages that contain
2828 in their header or body.
2829 .It Ar ( larger size )
2830 All messages that are larger than
2833 .It Ar ( smaller size )
2834 All messages that are smaller than
2838 .It Ar ( before date )
2839 All messages that were received before
2841 which must be in the form
2845 denotes the day of the month as one or two digits,
2847 is the name of the month \(en one of
2848 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2851 is the year as four digits, for example
2855 All messages that were received on the specified date.
2856 .It Ar ( since date )
2857 All messages that were received since the specified date.
2858 .It Ar ( sentbefore date )
2859 All messages that were sent on the specified date.
2860 .It Ar ( senton date )
2861 All messages that were sent on the specified date.
2862 .It Ar ( sentsince date )
2863 All messages that were sent since the specified date.
2865 The same criterion as for the previous search.
2866 This specification cannot be used as part of another criterion.
2867 If the previous command line contained more than one independent
2868 criterion then the last of those criteria is used.
2872 .\" .Ss "On terminal control and line editor" {{{ review
2873 .Ss "On terminal control and line editor"
2875 \*(OP Terminal control through one of the standard
2884 inal defined in the environment interactive usage aspects, for example
2885 .Sx "Coloured display" ,
2886 and insight of cursor and function keys for the Mailx-Line-Editor
2887 (MLE), will be enhanced or enabled.
2888 Library interaction can be disabled on a per-invocation basis via
2889 .Va termcap-disable ,
2890 whereas the internal variable
2892 is always used as a preferred source of terminal capabilities.
2893 (For a usage example see the
2896 .Sx "Not \(dqdefunctional\(dq, but the editor key does not work" . )
2899 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2900 environments which comply to the ISO C standard
2902 and will support wide glyphs if possible (the necessary functionality
2903 had been removed from ISO C, but was included in
2905 Usage of a line editor in interactive mode can be prevented by setting
2906 .Va line-editor-disable .
2907 Especially if the \*(OPal terminal control support is missing setting
2910 will help shall the MLE misbehave, see there for more.
2911 The MLE can support a little bit of
2917 feature is available then input from line editor prompts will be saved
2918 in a history list that can be searched in and be expanded from.
2919 Such saving can be prevented by prefixing input with any amount of
2921 Aspects of history, like allowed content and maximum size, as well as
2922 whether history shall be saved persistently, can be configured with the
2926 .Va history-gabby-persist
2929 There also exists the macro hook
2930 .Va on-history-addition
2931 which can be used to apply finer control on what enters history.
2934 The MLE supports a set of editing and control commands.
2935 By default (as) many (as possible) of these will be assigned to a set of
2936 single-letter control codes, which should work on any terminal (and can
2937 be generated by holding the
2939 key while pressing the key of desire, for example
2943 command is available then the MLE commands can also be accessed freely
2944 by assigning the command name, which is shown in parenthesis in the list
2945 below, to any desired key-sequence, and the MLE will instead and also use
2947 to establish its built-in key bindings
2948 (more of them if the \*(OPal terminal control is available),
2949 an action which can then be suppressed completely by setting
2950 .Va line-editor-no-defaults .
2951 .Sx "Shell-style argument quoting"
2952 notation is used in the following:
2956 .Bl -tag -compact -width ".It Ql \eBa"
2958 Go to the start of the line
2960 .Pf ( Cd mle-go-home ) .
2963 Move the cursor backward one character
2965 .Pf ( Cd mle-go-bwd ) .
2971 .Pf ( Cd mle-raise-int ) .
2974 Forward delete the character under the cursor;
2975 quits \*(UA if used on the empty line unless the internal variable
2979 .Pf ( Cd mle-del-fwd ) .
2982 Go to the end of the line
2984 .Pf ( Cd mle-go-end ) .
2987 Move the cursor forward one character
2989 .Pf ( Cd mle-go-fwd ) .
2992 Cancel current operation, full reset.
2993 If there is an active history search or tabulator expansion then this
2994 command will first reset that, reverting to the former line content;
2995 thus a second reset is needed for a full reset in this case
2997 .Pf ( Cd mle-reset ) .
3000 Backspace: backward delete one character
3002 .Pf ( Cd mle-del-bwd ) .
3006 Horizontal tabulator:
3007 try to expand the word before the cursor, supporting the usual
3008 .Sx "Filename transformations"
3010 .Pf ( Cd mle-complete ;
3012 .Cd mle-quote-rndtrip
3014 .Va line-editor-cpl-word-breaks ) .
3018 commit the current line
3020 .Pf ( Cd mle-commit ) .
3023 Cut all characters from the cursor to the end of the line
3025 .Pf ( Cd mle-snarf-end ) .
3030 .Pf ( Cd mle-repaint ) .
3033 \*(OP Go to the next history entry
3035 .Pf ( Cd mle-hist-fwd ) .
3038 (\*(OPally context-dependent) Invokes the command
3042 \*(OP Go to the previous history entry
3044 .Pf ( Cd mle-hist-bwd ) .
3047 Toggle roundtrip mode shell quotes, where produced,
3050 .Pf ( Cd mle-quote-rndtrip ) .
3051 This setting is temporary, and will be forgotten once the command line
3052 is committed; also see
3056 \*(OP Complete the current line from (the remaining) older history entries
3058 .Pf ( Cd mle-hist-srch-bwd ) .
3061 \*(OP Complete the current line from (the remaining) newer history entries
3063 .Pf ( Cd mle-hist-srch-fwd ) .
3066 Paste the snarf buffer
3068 .Pf ( Cd mle-paste ) .
3076 .Pf ( Cd mle-snarf-line ) .
3079 Prompts for a Unicode character (hexadecimal number without prefix, see
3083 .Pf ( Cd mle-prompt-char ) .
3084 Note this command needs to be assigned to a single-letter control code
3085 in order to become recognized and executed during input of
3086 a key-sequence (only three single-letter control codes can be used for
3087 that shortcut purpose); this control code is then special-treated and
3088 thus cannot be part of any other sequence (because it will trigger the
3089 .Cd \&\&mle-prompt-char
3090 function immediately).
3093 Cut the characters from the one preceding the cursor to the preceding
3096 .Pf ( Cd mle-snarf-word-bwd ) .
3099 Move the cursor forward one word boundary
3101 .Pf ( Cd mle-go-word-fwd ) .
3104 Move the cursor backward one word boundary
3106 .Pf ( Cd mle-go-word-bwd ) .
3112 .Pf ( Cd mle-raise-tstp ) .
3115 Escape: reset a possibly used multibyte character input state machine
3116 and \*(OPally a lingering, incomplete key binding
3118 .Pf ( Cd mle-cancel ) .
3119 This command needs to be assigned to a single-letter control code in
3120 order to become recognized and executed during input of a key-sequence
3121 (only three single-letter control codes can be used for that shortcut
3123 This control code may also be part of a multi-byte sequence, but if
3124 a sequence is active and the very control code is currently also an
3125 expected input, then the active sequence takes precedence and will
3126 consume the control code.
3129 (\*(OPally context-dependent) Invokes the command
3133 (\*(OPally context-dependent) Invokes the command
3137 (\*(OPally context-dependent) Invokes the command
3141 Cut the characters from the one after the cursor to the succeeding word
3144 .Pf ( Cd mle-snarf-word-fwd ) .
3153 ring the audible bell.
3158 .Cd mle-clear-screen :
3159 move the cursor home and clear the screen.
3166 this will immediately reset a possibly active search etc.
3170 .Cd mle-go-screen-bwd :
3171 move the cursor backward one screen width.
3175 .Cd mle-go-screen-fwd :
3176 move the cursor forward one screen width.
3186 .\" .Ss "Coloured display" {{{ review
3187 .Ss "Coloured display"
3189 \*(OP Colours and font attributes through ANSI a.k.a. ISO 6429 SGR
3190 (select graphic rendition) escape sequences are optionally supported.
3191 Usage of colours and font attributes solely depends upon the
3192 capability of the detected terminal type
3194 and as fine-tuned through
3196 Colours and font attributes can be managed with the multiplexer command
3200 removes the given mappings.
3203 suppresses usage of colour and font attribute sequences, while leaving
3204 established mappings unchanged.
3207 Whether actually applicable colour and font attribute sequences should
3208 also be generated when output is going to be paged through the external
3212 ) depends upon the setting of
3214 because pagers usually need to be configured in order to support ISO
3216 Knowledge of some widely used pagers is however built-in, and in a clean
3217 environment it is often enough to simply set
3219 please refer to that variable for more on this topic.
3222 It might make sense to conditionalize colour setup on interactive mode via
3228 .Bd -literal -offset indent
3229 if terminal && "$features" =% ,+colour,
3230 colour iso view-msginfo ft=bold,fg=green
3231 colour iso view-header ft=bold,fg=red (from|subject) # regex
3232 colour iso view-header fg=red
3234 uncolour iso view-header from,subject
3235 colour iso view-header ft=bold,fg=magenta,bg=cyan
3236 colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3237 colour mono view-header ft=bold
3238 colour mono view-header ft=bold,ft=reverse subject,from
3243 .\" .Ss "Handling spam" {{{
3246 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3247 identification of, and, in general, dealing with spam messages.
3248 A precondition of most commands in order to function is that the
3250 variable is set to one of the supported interfaces.
3251 .Sx "Specifying messages"
3252 that have been identified as spam is possible via their (volatile)
3258 specifications, and their
3260 entries will be used when displaying the
3268 rates the given messages and sets their
3271 If the spam interface offers spam scores these can be shown in
3280 will interact with the Bayesian filter of the chosen interface and learn
3281 the given messages as
3285 respectively; the last command can be used to cause
3287 of messages; it adheres to their current
3289 state and thus reverts previous teachings.
3294 will simply set and clear, respectively, the mentioned volatile
3296 message flag, without any interface interaction.
3305 requires a running instance of the
3307 server in order to function, started with the option
3309 shall Bayesian filter learning be possible.
3311 .Bd -literal -offset indent
3312 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3313 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3314 --daemonize [--local] [--allow-tell]
3318 Thereafter \*(UA can make use of these interfaces:
3320 .Bd -literal -offset indent
3321 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3322 -Sspamc-command=/usr/local/bin/spamc \e
3323 -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3325 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3326 -Sspamc-command=/usr/local/bin/spamc \e
3327 -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3331 Using the generic filter approach allows usage of programs like
3333 Here is an example, requiring it to be accessible via
3336 .Bd -literal -offset indent
3337 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3338 -Sspamfilter-ham="bogofilter -n" \e
3339 -Sspamfilter-noham="bogofilter -N" \e
3340 -Sspamfilter-nospam="bogofilter -S" \e
3341 -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3342 -Sspamfilter-spam="bogofilter -s" \e
3343 -Sspamfilter-rate-scanscore="1;^(.+)$"
3347 Because messages must exist on local storage in order to be scored (or
3348 used for Bayesian filter training), it is possibly a good idea to
3349 perform the local spam check last.
3350 Spam can be checked automatically when opening specific folders by
3351 setting a specialized form of the internal variable
3354 .Bd -literal -offset indent
3355 define spamdelhook {
3357 spamset (header x-dcc-brand-metrics "bulk")
3358 # Server-side spamassassin(1)
3359 spamset (header x-spam-flag "YES")
3360 del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3366 set folder-hook-SOMEFOLDER=spamdelhook
3370 See also the documentation for the variables
3371 .Va spam-interface , spam-maxsize ,
3372 .Va spamc-command , spamc-arguments , spamc-user ,
3373 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3376 .Va spamfilter-rate-scanscore .
3379 .\" }}} (DESCRIPTION)
3382 .\" .Sh COMMANDS {{{
3385 \*(UA reads input in lines.
3386 An unquoted reverse solidus
3388 at the end of a command line
3390 the newline character: it is discarded and the next line of input is
3391 used as a follow-up line, with all leading whitespace removed;
3392 once an entire line is completed, the whitespace characters
3393 .Cm space , tabulator , newline
3394 as well as those defined by the variable
3396 are removed from the beginning and end.
3397 Placing any whitespace characters at the beginning of a line will
3398 prevent a possible addition of the command line to the \*(OPal
3402 The beginning of such input lines is then scanned for the name of
3403 a known command: command names may be abbreviated, in which case the
3404 first command that matches the given prefix will be used.
3405 .Sx "Command modifiers"
3406 may prefix a command in order to modify its behaviour.
3407 A name may also be a
3409 which will become expanded until no more expansion is possible.
3410 Once the command that shall be executed is known, the remains of the
3411 input line will be interpreted according to command-specific rules,
3412 documented in the following.
3415 This behaviour is different to the
3417 ell, which is a programming language with syntactic elements of clearly
3418 defined semantics, and therefore capable to sequentially expand and
3419 evaluate individual elements of a line.
3420 .Ql \&? set one=value two=$one
3421 for example will never possibly assign value to one, because the
3422 variable assignment is performed no sooner but by the command
3424 long after the expansion happened.
3427 A list of all commands in lookup order is dumped by the command
3429 \*(OPally the command
3433 when given an argument, will show a documentation string for the
3434 command matching the expanded argument, as in
3436 which should be a shorthand of
3438 with these documentation strings both commands support a more
3440 listing mode which includes the argument type of the command and other
3441 information which applies; a handy suggestion might thus be:
3443 .Bd -literal -offset indent
3445 # Before v15: need to enable sh(1)ell-style on _entire_ line!
3446 localopts yes;wysh set verbose;ignerr eval "${@}";return ${?}
3448 ? commandalias xv '\ecall __xv'
3452 .\" .Ss "Command modifiers" {{{
3453 .Ss "Command modifiers"
3455 Commands may be prefixed by none to multiple command modifiers.
3456 Some command modifiers can be used with a restricted set of commands
3461 will (\*(OPally) show which modifiers apply.
3465 The modifier reverse solidus
3468 to be placed first, prevents
3470 expansions on the remains of the line, for example
3472 will always evaluate the command
3474 even if an (command)alias of the same name exists.
3476 content may itself contain further command modifiers, including
3477 an initial reverse solidus to prevent further expansions.
3483 indicates that any error generated by the following command should be
3484 ignored by the state machine and not cause a program exit with enabled
3486 or for the standardized exit cases in
3491 .Sx "INTERNAL VARIABLES" ,
3492 will be set to the real exit status of the command regardless.
3497 will alter the called command to apply changes only temporarily,
3498 local to block-scope, and can thus only be used inside of a
3503 Specifying it implies the modifier
3505 Local variables will not be inherited by macros deeper in the
3507 chain, and all local settings will be garbage collected once the local
3509 To record and unroll changes in the global scope use the command
3515 does yet not implement any functionality.
3520 does yet not implement any functionality.
3523 Some commands support the
3526 modifier: if used, they expect the name of a variable, which can itself
3527 be a variable, i.e., shell expansion is applied, as their first
3528 argument, and will place their computation result in it instead of the
3529 default location (it is usually written to standard output).
3531 The given name will be tested for being a valid
3533 variable name, and may therefore only consist of upper- and lowercase
3534 characters, digits, and the underscore; the hyphen-minus may be used as
3535 a non-portable extension; digits may not be used as first, hyphen-minus
3536 may not be used as last characters.
3537 In addition the name may either not be one of the known
3538 .Sx "INTERNAL VARIABLES" ,
3539 or must otherwise refer to a writable (non-boolean) value variable.
3540 The actual put operation may fail nonetheless, for example if the
3541 variable expects a number argument only a number will be accepted.
3542 Any error during these operations causes the command as such to fail,
3543 and the error number
3546 .Va ^ERR Ns -NOTSUP ,
3551 but some commands deviate from the latter, which is documented.
3554 Last, but not least, the modifier
3557 can be used for some old and established commands to choose the new
3558 .Sx "Shell-style argument quoting"
3559 rules over the traditional
3560 .Sx "Old-style argument quoting" .
3561 This modifier is implied if
3563 is set to a non-empty value.
3567 .\" .Ss "Old-style argument quoting" v15-compat: rename Obsolete.. {{{
3568 .Ss "Old-style argument quoting"
3570 \*(ID This section documents the traditional and POSIX standardized
3571 style of quoting non-message list arguments to commands which expect
3572 this type of arguments: whereas still used by the majority of such
3574 .Sx "Shell-style argument quoting"
3575 may be available even for those via
3578 .Sx "Command modifiers" .
3579 Nonetheless care must be taken, because only new commands have been
3580 designed with all the capabilities of the new quoting rules in mind,
3581 which can, for example generate control characters.
3584 .Bl -bullet -offset indent
3586 An argument can be enclosed between paired double-quotes
3591 any whitespace, shell word expansion, or reverse solidus characters
3592 (except as described next) within the quotes are treated literally as
3593 part of the argument.
3594 A double-quote will be treated literally within single-quotes and vice
3596 Inside such a quoted string the actually used quote character can be
3597 used nonetheless by escaping it with a reverse solidus
3603 An argument that is not enclosed in quotes, as above, can usually still
3604 contain space characters if those spaces are reverse solidus escaped, as in
3608 A reverse solidus outside of the enclosing quotes is discarded
3609 and the following character is treated literally as part of the argument.
3613 .\" .Ss "Shell-style argument quoting" {{{
3614 .Ss "Shell-style argument quoting"
3617 ell-style, and therefore POSIX standardized, argument parsing and
3618 quoting rules are used by most commands.
3619 \*(ID Most new commands only support these new rules and are flagged
3620 \*(NQ, some elder ones can use them with the command modifier
3622 in the future only this type of argument quoting will remain.
3625 A command line is parsed from left to right and an input token is
3626 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3627 Metacharacters are vertical bar
3633 as well as all characters from the variable
3636 .Cm space , tabulator , newline .
3637 The additional metacharacters left and right parenthesis
3639 and less-than and greater-than signs
3643 supports are not used, and are treated as ordinary characters: for one
3644 these characters are a vivid part of email addresses, and it seems
3645 highly unlikely that their function will become meaningful to \*(UA.
3647 .Bd -filled -offset indent
3648 .Sy Compatibility note:
3649 \*(ID Please note that even many new-style commands do not yet honour
3651 to parse their arguments: whereas the
3653 ell is a language with syntactic elements of clearly defined semantics,
3654 \*(UA parses entire input lines and decides on a per-command base what
3655 to do with the rest of the line.
3656 This also means that whenever an unknown command is seen all that \*(UA
3657 can do is cancellation of the processing of the remains of the line.
3659 It also often depends on an actual subcommand of a multiplexer command
3660 how the rest of the line should be treated, and until v15 we are not
3661 capable to perform this deep inspection of arguments.
3662 Nonetheless, at least the following commands which work with positional
3663 parameters fully support
3665 for an almost shell-compatible field splitting:
3666 .Ic call , call_if , read , vpospar , xcall .
3670 Any unquoted number sign
3672 at the beginning of a new token starts a comment that extends to the end
3673 of the line, and therefore ends argument processing.
3674 An unquoted dollar sign
3676 will cause variable expansion of the given name, which must be a valid
3678 ell-style variable name (see
3680 .Sx "INTERNAL VARIABLES"
3683 (shell) variables can be accessed through this mechanism, brace
3684 enclosing the name is supported (i.e., to subdivide a token).
3687 Whereas the metacharacters
3688 .Cm space , tabulator , newline
3689 only complete an input token, vertical bar
3695 also act as control operators and perform control functions.
3696 For now supported is semicolon
3698 which terminates a single command, therefore sequencing the command line
3699 and making the remainder of the line a subject to reevaluation.
3700 With sequencing, multiple command argument types and quoting rules may
3701 therefore apply to a single line, which can become problematic before
3702 v15: e.g., the first of the following will cause surprising results.
3705 .Dl ? echo one; set verbose; echo verbose=$verbose.
3706 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3709 Quoting is a mechanism that will remove the special meaning of
3710 metacharacters and reserved words, and will prevent expansion.
3711 There are four quoting mechanisms: the escape character, single-quotes,
3712 double-quotes and dollar-single-quotes:
3715 .Bl -bullet -offset indent
3717 The literal value of any character can be preserved by preceding it
3718 with the escape character reverse solidus
3722 Arguments which are enclosed in
3723 .Ql 'single-\:quotes'
3724 retain their literal value.
3725 A single-quote cannot occur within single-quotes.
3728 The literal value of all characters enclosed in
3729 .Ql \(dqdouble-\:quotes\(dq
3730 is retained, with the exception of dollar sign
3732 which will cause variable expansion, as above, backquote (grave accent)
3734 (which not yet means anything special), reverse solidus
3736 which will escape any of the characters dollar sign
3738 (to prevent variable expansion), backquote (grave accent)
3742 (to prevent ending the quote) and reverse solidus
3744 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3745 but has no special meaning otherwise.
3748 Arguments enclosed in
3749 .Ql $'dollar-\:single-\:quotes'
3750 extend normal single quotes in that reverse solidus escape sequences are
3751 expanded as follows:
3753 .Bl -tag -compact -width ".Ql \eNNN"
3755 bell control character (ASCII and ISO-10646 BEL).
3757 backspace control character (ASCII and ISO-10646 BS).
3759 escape control character (ASCII and ISO-10646 ESC).
3763 form feed control character (ASCII and ISO-10646 FF).
3765 line feed control character (ASCII and ISO-10646 LF).
3767 carriage return control character (ASCII and ISO-10646 CR).
3769 horizontal tabulator control character (ASCII and ISO-10646 HT).
3771 vertical tabulator control character (ASCII and ISO-10646 VT).
3773 emits a reverse solidus character.
3777 double quote (escaping is optional).
3779 eight-bit byte with the octal value
3781 (one to three octal digits), optionally prefixed by an additional
3783 A 0 byte will suppress further output for the quoted argument.
3785 eight-bit byte with the hexadecimal value
3787 (one or two hexadecimal characters, no prefix, see
3789 A 0 byte will suppress further output for the quoted argument.
3791 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3793 (one to eight hexadecimal characters) \(em note that Unicode defines the
3794 maximum codepoint ever to be supported as
3799 This escape is only supported in locales that support Unicode (see
3800 .Sx "Character sets" ) ,
3801 in other cases the sequence will remain unexpanded unless the given code
3802 point is ASCII compatible or (if the \*(OPal character set conversion is
3803 available) can be represented in the current locale.
3804 The character NUL will suppress further output for the quoted argument.
3808 except it takes only one to four hexadecimal characters.
3810 Emits the non-printable (ASCII and compatible) C0 control codes
3811 0 (NUL) to 31 (US), and 127 (DEL).
3812 Printable representations of ASCII control codes can be created by
3813 mapping them to a different, visible part of the ASCII character set.
3814 Adding the number 64 achieves this for the codes 0 to 31, here 7 (BEL):
3815 .Ql 7 + 64 = 71 = G .
3816 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3818 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3819 .Ql \&?\0vexpr\0^\0127\064 .
3821 Whereas historically circumflex notation has often been used for
3822 visualization purposes of control codes, as in
3824 the reverse solidus notation has been standardized:
3826 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3832 whenever such an alias exists it will be used for display purposes.
3833 The control code NUL
3835 a non-standard extension) will suppress further output for the remains
3836 of the token (which may extend beyond the current quote), or, depending
3837 on the context, the remains of all arguments for the current command.
3839 Non-standard extension: expand the given variable name, as above.
3840 Brace enclosing the name is supported.
3842 Not yet supported, just to raise awareness: Non-standard extension.
3849 .Bd -literal -offset indent
3850 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3851 ? echo Quotes ${HOME} and tokens differ! # comment
3852 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3856 .\" .Ss "Message list arguments" {{{
3857 .Ss "Message list arguments"
3859 Many commands operate on message list specifications, as documented in
3860 .Sx "Specifying messages" .
3861 The argument input is first split into individual tokens via
3862 .Sx "Shell-style argument quoting" ,
3863 which are then interpreted as the mentioned specifications.
3864 If no explicit message list has been specified, many commands will
3865 search for and use the next message forward that satisfies the commands'
3866 requirements, and if there are no messages forward of the current
3867 message, the search proceeds backwards;
3868 if there are no good messages at all to be found, an error message is
3869 shown and the command is aborted.
3872 output of the command
3874 will indicate whether a command searches for a default message, or not.
3877 .\" .Ss "Raw data arguments for codec commands" {{{
3878 .Ss "Raw data arguments for codec commands"
3880 A special set of commands, which all have the string
3886 take raw string data as input, which means that the content of the
3887 command input line is passed completely unexpanded and otherwise
3888 unchanged: like this the effect of the actual codec is visible without
3889 any noise of possible shell quoting rules etc., i.e., the user can input
3890 one-to-one the desired or questionable data.
3891 To gain a level of expansion, the entire command line can be
3893 uated first, for example
3895 .Bd -literal -offset indent
3896 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3898 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3900 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3901 ? eval shcodec d $res
3902 /usr/Sch\[:o]nes Wetter/heute.txt
3906 .\" .Ss "Filename transformations" {{{
3907 .Ss "Filename transformations"
3909 Filenames, where expected, and unless documented otherwise, are
3910 subsequently subject to the following filename transformations, in
3913 .Bl -bullet -offset indent
3915 If the given name is a registered
3917 it will be replaced with the expanded shortcut.
3918 This step is mostly taken for
3923 The filename is matched against the following patterns or strings.
3927 expansion this step is mostly taken for
3933 .Bl -hang -compact -width ".Ar %user"
3935 (Number sign) is expanded to the previous file.
3938 (Percent sign) is replaced by the invoking
3939 .Mx -ix "primary system mailbox"
3940 user's primary system mailbox, which either is the (itself expandable)
3942 if that is set, the standardized absolute pathname indicated by
3944 if that is set, or a built-in compile-time default otherwise.
3947 the used name is actively checked for being a primary mailbox, first
3954 Expands to the primary system mailbox of
3956 (and never the value of
3958 regardless of its actual setting).
3961 (Ampersand) is replaced with the invoking user's
3962 .Mx -ix "secondary mailbox"
3963 secondary mailbox, the
3971 directory (if that variable is set).
3974 Expands to the same value as
3976 but has special meaning when used with, for example, the command
3978 the file will be treated as a primary system mailbox by, among others, the
3982 commands, meaning that messages that have been read in the current
3983 session will be moved to the
3985 mailbox instead of simply being flagged as read.
3990 Meta expansions may be applied to the resulting filename, as allowed by
3991 the operation and applicable to the resulting access protocol (also see
3992 .Sx "On URL syntax and credential lookup" ) .
3993 For the file-protocol, a leading tilde
3995 character will be replaced by the expansion of
3997 except when followed by a valid user name, in which case the home
3998 directory of the given user is used instead.
4000 A shell expansion as if specified in double-quotes (see
4001 .Sx "Shell-style argument quoting" )
4002 may be applied, so that any occurrence of
4006 will be replaced by the expansion of the variable, if possible;
4007 .Sx "INTERNAL VARIABLES"
4010 (shell) variables can be accessed through this mechanism.
4012 Shell pathname wildcard pattern expansions
4014 may be applied as documented.
4015 If the fully expanded filename results in multiple pathnames and the
4016 command is expecting only one file, an error results.
4018 In interactive context, in order to allow simple value acceptance (via
4020 arguments will usually be displayed in a properly quoted form, so a file
4021 .Ql diet\e is \ecurd.txt
4023 .Ql 'diet\e is \ecurd.txt' .
4027 .\" .Ss "Commands" {{{
4030 The following commands are available:
4032 .Bl -tag -width ".It Ic BaNg"
4039 command which follows, replacing unescaped exclamation marks with the
4040 previously executed command if the internal variable
4043 This command supports
4046 .Sx "Command modifiers" ,
4047 and manages the error number
4049 A 0 or positive exit status
4051 reflects the exit status of the command, negative ones that
4052 an error happened before the command was executed, or that the program
4053 did not exit cleanly, but maybe due to a signal: the error number is
4054 .Va ^ERR Ns -CHILD ,
4058 In conjunction with the
4060 modifier the following special cases exist:
4061 a negative exit status occurs if the collected data could not be stored
4062 in the given variable, which is a
4064 error that should otherwise not occur.
4065 .Va ^ERR Ns -CANCELED
4066 indicates that no temporary file could be created to collect the command
4067 output at first glance.
4068 In case of catchable out-of-memory situations
4070 will occur and \*(UA will try to store the empty string, just like with
4071 all other detected error conditions.
4076 The comment-command causes the entire line to be ignored.
4078 this really is a normal command which' purpose is to discard its
4081 indicating special character, which means that for example trailing
4082 comments on a line are not possible (except for commands which use
4083 .Sx "Shell-style argument quoting" ) .
4087 Goes to the next message in sequence and types it
4093 Display the preceding message, or the n'th previous message if given
4094 a numeric argument n.
4098 Shows the message number of the current message (the
4100 when used without arguments, that of the given list otherwise.
4101 Output numbers will be separated from each other with the first
4104 and followed by the first character of
4106 if that is not empty and not identical to the first.
4107 If that results in no separation at all a
4110 This command supports
4113 .Sx "Command modifiers" ) ,
4114 and manages the error number
4119 \*(OP Show a brief summary of commands.
4120 \*(OP Given an argument a synopsis for the command in question is
4121 shown instead; commands can be abbreviated in general and this command
4122 can be used to see the full expansion of an abbreviation including the
4123 synopsis, try, for example
4128 and see how the output changes.
4129 To avoid that aliases are resolved the modifier
4131 can be prepended to the argument, but note it must be quoted.
4132 This mode also supports a more
4134 output, which will provide the information documented for
4145 .It Ic account , unaccount
4146 (ac, una) Creates, selects or lists (an) account(s).
4147 Accounts are special incarnations of
4149 macros and group commands and variable settings which together usually
4150 arrange the environment for the purpose of creating an email account.
4151 Different to normal macros settings which are covered by
4153 \(en here by default enabled! \(en will not be reverted before the
4158 (case-insensitive) always exists, and all but it can be deleted by the
4159 latter command, and in one operation with the special name
4161 Also for all but it a possibly set
4162 .Va on-account-cleanup
4163 hook is called once they are left, also for program exit.
4165 Without arguments a listing of all defined accounts is shown.
4166 With one argument the given account is activated: the system
4168 of that account will be activated (as via
4170 a possibly installed
4172 will be run, and the internal variable
4175 The two argument form behaves identical to defining a macro as via
4177 Important settings for accounts include
4178 .Va folder , from , hostname , inbox , mta , password
4181 .Pf ( Sx "On URL syntax and credential lookup" ) ,
4182 as well as things like
4183 .Va tls-config-pairs
4184 .Pf ( Sx "Encrypted network communication" ) ,
4185 and protocol specifics like
4186 .Va imap-auth , pop3-auth , smtp-auth .
4187 .Bd -literal -offset indent
4189 set folder=~/mail inbox=+syste.mbox record=+sent.mbox
4190 set from='(My Name) myname@myisp.example'
4191 set mta=smtp://mylogin@smtp.myisp.example
4198 Perform email address codec transformations on raw-data argument, rather
4199 according to email standards (RFC 5322; \*(ID will furtherly improve).
4203 .Sx "Command modifiers" ) ,
4204 and manages the error number
4206 The first argument must be either
4207 .Ar [+[+[+]]]e[ncode] ,
4212 and specifies the operation to perform on the rest of the line.
4215 Decoding will show how a standard-compliant MUA will display the given
4216 argument, which should be an email address.
4217 Please be aware that most MUAs have difficulties with the address
4218 standards, and vary wildly when (comments) in parenthesis,
4220 strings, or quoted-pairs, as below, become involved.
4221 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4224 Skinning is identical to decoding but only outputs the plain address,
4225 without any string, comment etc. components.
4226 Another difference is that it may fail with the error number
4230 if decoding fails to find a(n) (valid) email address, in which case the
4231 unmodified input will be output again.
4235 first performs a skin operation, and thereafter checks a valid
4236 address for whether it is a registered mailing list (see
4240 eventually reporting that state in the error number
4243 .Va ^ERR Ns -EXIST .
4244 (This state could later become overwritten by an I/O error, though.)
4247 Encoding supports four different modes, lesser automated versions can be
4248 chosen by prefixing one, two or three plus signs: the standard imposes
4249 a special meaning on some characters, which thus have to be transformed
4250 to so-called quoted-pairs by pairing them with a reverse solidus
4252 in order to remove the special meaning; this might change interpretation
4253 of the entire argument from what has been desired, however!
4254 Specify one plus sign to remark that parenthesis shall be left alone,
4255 two for not turning double quotation marks into quoted-pairs, and three
4256 for also leaving any user-specified reverse solidus alone.
4257 The result will always be valid, if a successful exit status is reported
4258 (\*(ID the current parser fails this assertion for some constructs).
4259 \*(ID Addresses need to be specified in between angle brackets
4262 if the construct becomes more difficult, otherwise the current parser
4263 will fail; it is not smart enough to guess right.
4265 .Bd -literal -offset indent
4266 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4267 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4268 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4269 "Hey, you", \e out\e there <diet@exam.ple>
4270 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4277 .It Ic alias , unalias
4278 \*(NQ(a, una) Define or list, and remove, respectively, address aliases,
4279 which are a method of creating personal distribution lists that map
4280 a single name to none to multiple receivers, to be expanded after
4282 is left; the expansion correlates with
4284 The latter command removes all given aliases, the special name asterisk
4286 will remove all existing aliases.
4287 When used without arguments the former shows a list of all currently
4288 known aliases, with one argument only the target(s) of the given one.
4289 When given two arguments, hyphen-minus
4291 being the first, the target(s) of the second is/are expanded recursively.
4294 In all other cases the given alias is newly defined, or will be appended
4295 to: arguments must either be themselves valid alias names, or any
4296 other address type (see
4297 .Sx "On sending mail, and non-interactive mode" ) .
4298 Recursive expansion of aliases can be prevented by prefixing the desired
4299 argument with the modifier reverse solidus
4301 A valid alias name conforms to
4303 syntax, but follow-up characters can also be the number sign
4314 .Dq any character that has the high bit set .
4317 may be the last character.
4321 .Sx "Shell-style argument quoting" .
4324 .\" ALIASCOLON next sentence
4325 \*(ID Unfortunately the colon is currently not supported, as it
4326 interferes with normal address parsing rules.
4327 .\" ALIASCOLON next sentence
4328 \*(ID Such high bit characters will likely cause warnings at the moment
4329 for the same reasons why colon is unsupported; also, in the future
4330 locale dependent character set validity checks will be performed.
4332 .Bd -literal -offset indent
4333 ? alias cohorts bill jkf mark kridle@ucbcory ~/cohorts.mbox
4334 ? alias mark mark@exam.ple
4335 ? set mta-aliases=/etc/aliases
4341 .It Ic alternates , unalternates
4342 \*(NQ (alt) Manage a list of alternate addresses or names of the active
4343 user, members of which will be removed from recipient lists (except one).
4344 There is a set of implicit alternates which is formed of the values of
4354 The latter command removes the given list of alternates, the special name
4356 will discard all existing alternate names.
4358 The former command manages the error number
4360 It shows the current set of alternates when used without arguments; in
4361 this mode only it also supports
4364 .Sx "Command modifiers" ) .
4365 Otherwise the given arguments (after being checked for validity) are
4366 appended to the list of alternate names; in
4368 mode they replace that list instead.
4372 .It Ic answered , unanswered
4373 Take a message lists and mark each message as (not) having been answered.
4374 Messages will be marked answered when being
4376 to automatically if the
4380 .Sx "Message states" .
4385 .It Ic bind , unbind
4386 \*(OP\*(NQ The bind command extends the MLE (see
4387 .Sx "On terminal control and line editor" )
4388 with freely configurable key bindings.
4389 The latter command removes from the given context the given key binding,
4390 both of which may be specified as a wildcard
4394 will remove all bindings of all contexts.
4395 Due to initialization order unbinding will not work for built-in key
4396 bindings upon program startup, however: please use
4397 .Va line-editor-no-defaults
4398 for this purpose instead.
4401 With zero arguments, or with a context name the former command shows
4402 all key bindings (of the given context; an asterisk
4404 will iterate over all contexts); a more verbose listing will be
4405 produced if either of
4410 With two or more arguments a specific binding is shown, or
4411 (re)established: the first argument is the context to which the binding
4412 shall apply, the second argument is a comma-separated list of the
4414 which form the binding.
4415 Further arguments will be joined to form the expansion, and cause the
4416 binding to be created or updated.
4417 To indicate that a binding shall not be auto-committed, but that the
4418 expansion shall instead be furtherly editable by the user, a commercial at
4420 (that will be removed) can be placed last in the expansion, from which
4421 leading and trailing whitespace will finally be removed.
4422 Reverse solidus cannot be used as the last character of expansion.
4423 An empty expansion will be rejected.
4426 Contexts define when a binding applies, i.e., a binding will not be seen
4427 unless the context for which it is defined for is currently active.
4428 This is not true for the shared binding
4430 which is the foundation for all other bindings and as such always
4431 applies, its bindings, however, only apply secondarily.
4432 The available contexts are the shared
4436 context which is used in all not otherwise documented situations, and
4438 which applies only to
4439 .Sx "Compose mode" .
4442 Bindings are specified as a comma-separated list of byte-sequences,
4443 where each list entry corresponds to one
4446 Byte sequence boundaries will be forcefully terminated after
4447 .Va bind-inter-byte-timeout
4448 milliseconds, whereas key sequences can be timed out via
4449 .Va bind-inter-key-timeout .
4450 A list entry may, indicated by a leading colon character
4452 also refer to the name of a terminal capability; several dozen names
4453 are compiled in and may be specified either by their
4455 or, if existing, by their
4457 name, regardless of the actually used \*(OPal terminal control library.
4458 But any capability may be used, as long as the name is resolvable by the
4459 \*(OPal control library, or was defined via the internal variable
4461 Input sequences are not case-normalized, an exact match is required to
4462 update or remove a binding.
4463 It is advisable to use an initial escape or other control character (like
4465 for user (as opposed to purely terminal capability based) bindings in
4466 order to avoid ambiguities; it also reduces search time.
4469 .Bd -literal -offset indent
4470 ? bind base a,b echo one
4471 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4472 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc,Delete
4473 ? bind default $'\ecA',:khome,w 'echo Editable binding@'
4474 ? bind default a,b,c rm -irf / @ # Also editable
4475 ? bind default :kf1 File %
4476 ? bind compose :kf1 ~v
4480 Note that the entire comma-separated list is first parsed (over) as a
4481 shell-token with whitespace as the field separator, then parsed and
4482 expanded for real with comma as the field separator, therefore
4483 whitespace needs to be properly quoted, see
4484 .Sx "Shell-style argument quoting" .
4485 Using Unicode reverse solidus escape sequences renders a binding
4486 defunctional if the locale does not support Unicode (see
4487 .Sx "Character sets" ) ,
4488 and using terminal capabilities does so if no (corresponding) terminal
4489 control support is (currently) available.
4490 Adding, deleting or modifying a key binding invalidates the internal
4491 prebuilt lookup tree, it will be recreated as necessary: this process
4492 will be visualized in most
4499 The following terminal capability names are built-in and can be used in
4501 or (if available) the two-letter
4504 See the respective manual for a list of capabilities.
4507 can be used to show all the capabilities of
4509 or the given terminal type;
4512 flag will also show supported (non-standard) extensions.
4515 .Bl -tag -compact -width kcuuf_or_kcuuf
4516 .It Cd kbs Ns \0or Cd kb
4518 .It Cd kdch1 Ns \0or Cd kD
4520 .It Cd kDC Ns \0or Cd *4
4521 \(em shifted variant.
4522 .It Cd kel Ns \0or Cd kE
4523 Clear to end of line.
4524 .It Cd kext Ns \0or Cd @9
4526 .It Cd kich1 Ns \0or Cd kI
4528 .It Cd kIC Ns \0or Cd #3
4529 \(em shifted variant.
4530 .It Cd khome Ns \0or Cd kh
4532 .It Cd kHOM Ns \0or Cd #2
4533 \(em shifted variant.
4534 .It Cd kend Ns \0or Cd @7
4536 .It Cd knp Ns \0or Cd kN
4538 .It Cd kpp Ns \0or Cd kP
4540 .It Cd kcub1 Ns \0or Cd kl
4541 Left cursor (with more modifiers: see below).
4542 .It Cd kLFT Ns \0or Cd #4
4543 \(em shifted variant.
4544 .It Cd kcuf1 Ns \0or Cd kr
4545 Right cursor (ditto).
4546 .It Cd kRIT Ns \0or Cd %i
4547 \(em shifted variant.
4548 .It Cd kcud1 Ns \0or Cd kd
4549 Down cursor (ditto).
4551 \(em shifted variant (only terminfo).
4552 .It Cd kcuu1 Ns \0or Cd ku
4555 \(em shifted variant (only terminfo).
4556 .It Cd kf0 Ns \0or Cd k0
4558 Add one for each function key up to
4563 .It Cd kf10 Ns \0or Cd k;
4565 .It Cd kf11 Ns \0or Cd F1
4567 Add one for each function key up to
4575 Some terminals support key-modifier combination extensions, e.g.,
4577 For example, the delete key,
4579 in its shifted variant, the name is mutated to
4581 then a number is appended for the states
4593 .Ql Shift+Alt+Control
4595 The same for the left cursor key,
4597 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4602 \*(NQ Calls the given macro, which must have been created via
4604 (see there for more), otherwise an
4607 Calling macros recursively will at some time excess the stack size
4608 limit, causing a hard program abortion; if recursively calling a macro
4609 is the last command of the current macro, consider to use the command
4611 which will first release all resources of the current macro before
4612 replacing the current macro with the called one.
4619 if the given macro has been created via
4621 but does not fail nor warn if the macro does not exist.
4630 \*(OP Only applicable to S/MIME signed messages.
4631 Takes an optional message list and a filename and saves the certificates
4632 contained within the message signatures to the named file in both
4633 human-readable and PEM format.
4634 The certificates can later be used to send encrypted messages to the
4635 respective message senders by setting
4636 .Va smime-encrypt-USER@HOST
4641 .It Ic charsetalias , uncharsetalias
4642 \*(NQ Manage alias mappings for (conversion of)
4643 .Sx "Character sets" .
4644 Alias processing is not performed for
4645 .Sx "INTERNAL VARIABLES" ,
4648 and mappings are ineffective if character set conversion is not available
4652 Expansion happens recursively for cases where aliases point to other
4653 aliases (built-in loop limit: 8).
4655 The latter command deletes all aliases given as arguments,
4656 or all at once when given the asterisk
4658 The former shows the list of all currently defined aliases if used
4659 without arguments, or the target of the given single argument;
4660 when given two arguments, hyphen-minus
4662 being the first, the second is instead expanded recursively.
4663 In all other cases the given arguments are treated as pairs of character
4664 sets and their desired target alias name, creating new or updating
4665 already existing aliases.
4669 \*(NQ(ch) Change the working directory to
4671 or the given argument.
4677 .It Ic collapse , uncollapse
4683 Takes a message list and makes all replies to these messages invisible
4684 in header summaries, except for
4688 Also when a message with collapsed replies is displayed,
4689 all of these are automatically uncollapsed.
4690 The latter command undoes collapsing.
4693 .\" FIXME review until this point
4696 .It Ic colour , uncolour
4697 \*(OP\*(NQ Manage colour mappings of and for a
4698 .Sx "Coloured display" .
4699 Without arguments the former shows all currently defined mappings.
4700 Otherwise a colour type is expected (case-insensitively),
4703 for 256-colour terminals,
4708 for the standard 8-colour ANSI / ISO 6429 colour palette, and
4712 for monochrome terminals, which only support (some) font attributes.
4713 Without further arguments the list of all currently defined mappings
4714 of the given type is shown (here the special
4718 also show all currently defined mappings).
4721 Otherwise the second argument defines the mappable slot, the third
4722 argument a (comma-separated list of) colour and font attribute
4723 specification(s), and the optionally supported fourth argument can be
4724 used to specify a precondition: if conditioned mappings exist they are
4725 tested in (creation) order unless a (case-insensitive) match has been
4726 found, and the default mapping (if any has been established) will only
4727 be chosen as a last resort.
4728 The types of available preconditions depend on the mappable slot,
4729 the following of which exist:
4732 Mappings prefixed with
4734 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4735 .Sx "On terminal control and line editor" )
4736 and do not support preconditions.
4738 .Bl -tag -compact -width view-partinfo
4740 This mapping is used for the position indicator that is visible when
4741 a line cannot be fully displayed on the screen.
4746 Used for the occasionally appearing error indicator that is joined onto
4748 \*(ID Also used for error messages written on standard error .
4752 Mappings prefixed with
4754 are used in header summaries, and they all understand the preconditions
4756 (the current message) and
4758 for elder messages (only honoured in conjunction with
4759 .Va datefield-markout-older ) .
4761 .Bl -tag -compact -width view-partinfo
4763 This mapping is used for the
4765 that can be created with the
4769 formats of the variable
4772 For the complete header summary line except the
4774 and the thread structure.
4776 For the thread structure which can be created with the
4778 format of the variable
4783 Mappings prefixed with
4785 are used when displaying messages.
4787 .Bl -tag -compact -width view-partinfo
4789 This mapping is used for so-called
4791 lines, which are MBOX file format specific header lines (also see
4792 .Va mbox-rfc4155 ) .
4795 A comma-separated list of headers to which the mapping applies may be
4796 given as a precondition; if the \*(OPal regular expression support is
4797 available then if any of the
4799 .Sx "magic regular expression characters"
4800 is seen the precondition will be evaluated as (an extended) one.
4802 For the introductional message info line.
4803 .It Ar view-partinfo
4804 For MIME part info lines.
4808 The following (case-insensitive) colour definitions and font attributes
4809 are understood, multiple of which can be specified in a comma-separated
4819 It is possible (and often applicable) to specify multiple font
4820 attributes for a single mapping.
4823 foreground colour attribute, in order (numbers 0 - 7)
4833 To specify a 256-colour mode a decimal number colour specification in
4834 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4836 .Bl -tag -compact -width "999 - 999"
4838 the standard ISO 6429 colours, as above.
4840 high intensity variants of the standard colours.
4842 216 colours in tuples of 6.
4844 grayscale from black to white in 24 steps.
4846 .Bd -literal -offset indent
4848 fg() { printf "\e033[38;5;${1}m($1)"; }
4849 bg() { printf "\e033[48;5;${1}m($1)"; }
4851 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4852 printf "\e033[0m\en"
4854 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4855 printf "\e033[0m\en"
4859 background colour attribute (see
4861 for possible values).
4867 will remove for the given colour type (the special type
4869 selects all) the given mapping; if the optional precondition argument is
4870 given only the exact tuple of mapping and precondition is removed.
4873 will remove all mappings (no precondition allowed), thus
4875 will remove all established mappings.
4880 .It Ic commandalias , uncommandalias
4881 \*(NQ Define or list, and remove, respectively, command aliases.
4882 An (command)alias can be used everywhere a normal command can be used,
4883 but always takes precedence: any arguments that are given to the command
4884 alias are joined onto the alias expansion, and the resulting string
4885 forms the command line that is, in effect, executed.
4886 The latter command removes all given aliases, the special name asterisk
4888 will remove all existing aliases.
4889 When used without arguments the former shows a list of all currently
4890 known aliases, with one argument only the expansion of the given one.
4892 With two or more arguments a command alias is defined or updated: the
4893 first argument is the name under which the remaining command line should
4894 be accessible, the content of which can be just about anything.
4895 An alias may itself expand to another alias, but to avoid expansion loops
4896 further expansion will be prevented if an alias refers to itself or if
4897 an expansion depth limit is reached.
4898 Explicit expansion prevention is available via reverse solidus
4901 .Sx "Command modifiers" .
4902 .Bd -literal -offset indent
4904 \*(uA: `commandalias': no such alias: xx
4905 ? commandalias xx echo hello,
4907 commandalias xx 'echo hello,'
4918 but copy the messages to a file named after the local part of the
4919 sender of the first message instead of taking a filename argument;
4921 is inspected to decide on the actual storage location.
4925 (c) Copy messages to the named file and do not mark them as being saved;
4926 otherwise identical to
4932 \*(NQ A multiplexer command which provides C-style string operations on
4933 8-bit bytes without a notion of locale settings and character sets,
4934 effectively assuming ASCII data.
4935 For numeric and other operations refer to
4939 .Sx "Command modifiers" ,
4943 for usage errors and numeric results, the empty string otherwise;
4944 missing data errors, as for unsuccessful searches, result in the
4946 error number being set to
4947 .Va ^ERR Ns -NODATA .
4948 Where the question mark
4950 modifier suffix is supported, a case-insensitive (ASCII mapping)
4951 operation mode is supported; the keyword
4959 .Bl -hang -width ".It Cm length"
4961 Queries the length of the given argument.
4963 .It Cm hash , Cm hash32
4964 Calculates a hash value of the given argument.
4965 The latter will return a 32-bit result regardless of host environment.
4967 modifier suffix is supported.
4968 These use Chris Torek's hash algorithm, the resulting hash value is
4969 bit mixed as shown by Bret Mulvey.
4972 Search for the second in the first argument.
4973 Shows the resulting 0-based offset shall it have been found.
4975 modifier suffix is supported.
4978 Creates a substring of its first argument.
4979 The optional second argument is the 0-based starting offset,
4980 a negative one counts from the end;
4981 the optional third argument specifies the length of the desired result,
4982 a negative length leaves off the given number of bytes at the end of the
4983 original string; by default the entire string is used.
4984 This operation tries to work around faulty arguments (set
4986 for error logs), but reports them via the error number
4989 .Va ^ERR Ns -OVERFLOW .
4992 Trim away whitespace characters from both ends of the argument.
4995 Trim away whitespace characters from the begin of the argument.
4998 Trim away whitespace characters from the end of the argument.
5004 Show the name of the current working directory, as reported by
5009 .Sx "Command modifiers" ) .
5010 The return status is tracked via
5015 \*(OP For unencrypted messages this command is identical to
5017 Encrypted messages are first decrypted, if possible, and then copied.
5021 \*(OP For unencrypted messages this command is identical to
5023 Encrypted messages are first decrypted, if possible, and then copied.
5028 .It Ic define , undefine
5029 The latter command deletes the given macro, the special name
5031 will discard all existing macros.
5032 Deletion of (a) macro(s) can be performed from within running (a)
5033 macro(s), including self-deletion.
5034 Without arguments the former command prints the current list of macros,
5035 including their content, otherwise it defines a macro, replacing an
5036 existing one of the same name as applicable.
5039 A defined macro can be invoked explicitly by using the
5044 commands, or implicitly if a macro hook is triggered, for example a
5046 Execution of a macro body can be stopped from within by calling
5050 Temporary macro block-scope variables can be created or deleted with the
5052 command modifier in conjunction with the commands
5057 To enforce unrolling of changes made to (global)
5058 .Sx "INTERNAL VARIABLES"
5061 can be used instead; its covered scope depends on how (i.e.,
5063 normal macro, folder hook, hook,
5065 switch) the macro is invoked.
5070 ed macro, the given positional parameters are implicitly local
5071 to the macro's scope, and may be accessed via the variables
5077 and any other positive unsigned decimal number less than or equal to
5079 Positional parameters can be
5081 ed, or become completely replaced, removed etc. via
5083 A helpful command for numeric computation and string evaluations is
5086 offers C-style byte string operations.
5088 .Bd -literal -offset indent
5097 echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
5100 call exmac Hello macro exmac!
5101 echo ${?}/${!}/${^ERRNAME}
5107 .It Ic delete , undelete
5108 (d, u) Marks the given message list as being or not being
5110 respectively; if no argument has been specified then the usual search
5111 for a visible message is performed, as documented for
5112 .Sx "Message list arguments" ,
5113 showing only the next input prompt if the search fails.
5114 Deleted messages will neither be saved in the
5116 .Sx "secondary mailbox"
5118 nor will they be available for most other commands.
5121 variable is set, the new
5123 or the last message restored, respectively, is automatically
5132 \*(NQ Digging (information out of) messages is possible through
5134 objects, which can be
5136 d for the given message number; in
5140 will instead open the message that is being composed.
5141 If a hyphen-minus is given as the optional third argument then output
5142 will be generated on the standard output channel instead of being
5143 subject to consumption by the
5150 Note: digmsg output must be fully consumed before normal processing
5151 (the lack of I/O redirection is sorely missed here); for
5153 objects this means each command output has to be read until end of file
5159 d again by giving the same identifier used for creation;
5160 this step could be omitted: objects will be automatically closed
5163 (mailbox) or the compose mode is left, respectively.
5164 In all other use cases the second argument is an object identifier,
5165 and the third and all following arguments are interpreted as via
5168 .Sx "COMMAND ESCAPES" ) :
5170 .Bd -literal -offset indent
5171 ? vput = msgno; digmsg create $msgno
5172 ? digmsg $msgno header list; readall x; echon $x
5173 210 Subject From To Message-ID References In-Reply-To
5174 ? digmsg $msgno header show Subject;readall x;echon $x
5178 ? digmsg remove $msgno
5186 Superseded by the multiplexer
5192 Delete the given messages and automatically
5196 if one exists, regardless of the setting of
5203 up or down by one message when given
5207 argument, respectively.
5211 .It Ic draft , undraft
5212 Take message lists and mark each given message as being draft, or not
5213 being draft, respectively, as documented in the section
5214 .Sx "Message states" .
5218 \*(NQ(ec) Print the given strings, equivalent to the shell utility
5221 .Sx "Shell-style argument quoting"
5222 expansion is performed and, different to the otherwise identical
5224 a trailing newline is echoed.
5227 .Sx "Command modifiers"
5228 is supported, and the error number
5230 is managed: if data is stored in a variable then the return value
5231 reflects the length of the result string in case of success and is
5236 this command traditionally (in BSD Mail) also performed
5237 .Sx "Filename transformations" ,
5238 which is standard incompatible and hard to handle because quoting
5239 transformation patterns is not possible; the subcommand
5243 can be used to expand filenames.
5249 but the message is written to standard error, and prefixed by
5253 In interactive sessions the \*(OPal message ring queue for
5255 will be used instead, if available and
5263 but does not write or store a trailing newline.
5269 but does not write or store a trailing newline.
5275 at each message from the given list in turn.
5276 Modified contents are discarded unless the
5278 variable is set, and are not used unless the mailbox can be written to
5279 and the editor returns a successful exit status.
5281 can be used instead for a more display oriented editor.
5287 (see there for more),
5288 .Ic elif , else , endif
5289 conditional \(em if the condition of a preceding
5291 was false, check the following condition and execute the following block
5292 if it evaluates true.
5298 (see there for more),
5299 .Ic elif , else , endif
5300 conditional \(em if none of the conditions of the preceding
5304 commands was true, the
5310 (en) Marks the end of an
5312 (see there for more),
5313 .Ic elif , else , endif
5314 conditional execution block.
5319 \*(NQ There is a strict separation in between
5320 .Sx "INTERNAL VARIABLES"
5323 which is inherited by child processes.
5324 Some variables of the latter are however vivid for program operation,
5325 their purpose is known, therefore they have been integrated
5326 transparently into handling of the former, as accessible via
5330 To integrate any other environment variable, and/or to export internal
5331 variables into the process environment where they normally are not, a
5333 needs to become established with this command, for example
5336 .Dl environ link PERL5LIB TZ
5339 Afterwards changing such variables with
5341 will cause automatic updates of the environment, too.
5342 Sufficient system support provided (it was in BSD as early as 1987, and
5343 is standardized since Y2K) removing such variables with
5345 will remove them also from the environment, but in any way the knowledge
5351 may cause loss of such links.
5356 removes an existing link without otherwise touching variables, the
5360 subcommands are identical to
5364 but additionally update the program environment accordingly; removing
5365 a variable breaks any freely established
5371 \*(OP As console user interfaces at times scroll error messages by too
5372 fast and/or out of scope, data can additionally be sent to an error queue
5373 manageable by this command:
5375 or no argument will display and clear the queue,
5378 As the queue becomes filled with
5380 entries the eldest entries are being dropped.
5381 There are also the variables
5384 .Va ^ERRQUEUE-EXISTS .
5388 \*(NQ Construct a command by concatenating the arguments, separated with
5389 a single space character, and then evaluate the result.
5390 This command passes through the exit status
5394 of the evaluated command; also see
5396 .Bd -literal -offset indent
5407 call yyy '\ecall xxx' "b\e$'\et'u ' "
5415 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5416 any saving of messages in the
5418 .Sx "secondary mailbox"
5420 as well as a possibly tracked line editor
5423 .Va on-account-cleanup
5424 will be invoked, however.
5425 The optional status number argument will be passed through to
5427 \*(ID For now it can happen that the given status will be overwritten,
5428 later this will only occur if a later error needs to be reported onto an
5429 otherwise success indicating status.
5435 but open the mailbox read-only.
5444 .It Ic filetype , unfiletype
5445 \*(NQ Define, list, and remove, respectively, file handler hooks,
5446 which provide (shell) commands that enable \*(UA to load and save MBOX
5447 files from and to files with the registered file extensions, as shown
5450 The extensions are used case-insensitively, yet the auto-completion
5451 feature of for example
5453 will only work case-sensitively.
5454 An intermediate temporary file will be used to store the expanded data.
5455 The latter command will remove hooks for all given extensions, asterisk
5457 will remove all existing handlers.
5459 When used without arguments the former shows a list of all currently
5460 defined file hooks, with one argument the expansion of the given alias.
5461 Otherwise three arguments are expected, the first specifying the file
5462 extension for which the hook is meant, and the second and third defining
5463 the load- and save commands to deal with the file type, respectively,
5464 both of which must read from standard input and write to standard
5466 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5467 \*(ID For now too much work is done, and files are oftened read in twice
5468 where once would be sufficient: this can cause problems if a filetype is
5469 changed while such a file is opened; this was already so with the
5470 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5471 \*(ID For now all handler strings are passed to the
5472 .Ev SHELL for evaluation purposes; in the future a
5474 prefix to load and save commands may mean to bypass this shell instance:
5475 placing a leading space will avoid any possible misinterpretations.
5476 .Bd -literal -offset indent
5477 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5478 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
5479 zst 'zstd -dc' 'zstd -19 -zc' \e
5480 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5481 ? set record=+sent.zst.pgp
5486 .It Ic flag , unflag
5487 Take message lists and mark the messages as being flagged, or not being
5488 flagged, respectively, for urgent/special attention.
5490 .Sx "Message states" .
5496 but open the mailbox read-only.
5501 (fold) Open a new, or show status information of the current mailbox.
5502 If an argument is given, changes (such as deletions) will be written
5503 out, a new mailbox will be opened, the internal variables
5504 .Va mailbox-resolved
5507 will be updated, a set according
5509 is executed, and optionally a summary of
5511 is displayed if the variable
5516 .Sx "Filename transformations"
5517 will be applied to the
5521 prefixes are, i.e., URL (see
5522 .Sx "On URL syntax and credential lookup" )
5523 syntax is understood, as in
5524 .Ql mbox:///tmp/somefolder .
5525 If a protocol prefix is used the mailbox type is fixated, otherwise
5526 opening none-existing
5528 uses the protocol defined in
5536 (MBOX database), as well as
5538 (electronic mail message \*(ID read-only) the list of all registered
5540 s is traversed to check whether hooks shall be used to load (and save)
5541 data from (and to) the given
5543 Changing hooks will not affect already opened mailboxes.
5544 For example, the following creates hooks for the
5546 compression tool and a combined compressed and encrypted format:
5548 .Bd -literal -offset indent
5550 gzip 'gzip -dc' 'gzip -c' \e
5551 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5555 For historic reasons
5557 s provide limited (case-sensitive) auto-completion capabilities.
5562 provided that corresponding handlers are installed.
5563 It will neither find
5567 however, but an explicit
5568 .Ql \&? file mbox.GZ
5569 will find and use the handler for
5571 \*(ID The latter mode can only be used for MBOX files.
5574 EML files consist of only one mail message,
5575 \*(ID and can only be opened read-only.
5576 When reading MBOX files tolerant POSIX rules are used by default.
5577 Invalid message boundaries that can be found quite often in historic
5578 MBOX files will be complained about (even more with
5580 in this case the method described for
5582 can be used to create a valid MBOX database from the invalid input.
5585 MBOX databases and EML files will always be protected via file-region locks
5587 during file operations to protect against concurrent modifications.
5588 .Mx -ix "dotlock files"
5594 .Sx "primary system mailbox"
5595 will also be protected by so-called dotlock files,
5596 the traditional way of mail spool file locking: for any file
5600 will be created during the synchronization, in the same directory and
5601 with the same user and group identities as the file of interest \(em
5602 as necessary created by an external privileged dotlock helper.
5604 disables dotlock files.
5607 .Sx "Howto handle stale dotlock files" .
5610 \*(OP If no protocol has been fixated, and
5612 refers to a directory with the subdirectories
5617 then it is treated as a folder in
5620 The maildir format stores each message in its own file, and has been
5621 designed so that file locking is not necessary when reading or writing
5625 \*(OPally URLs can be used to access network resources, securely via
5626 .Sx "Encrypted network communication" ,
5628 Network communication socket timeouts are configurable via
5629 .Va socket-connect-timeout .
5630 All network traffic may be proxied over a SOCKS server via
5634 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5635 .Dl \*(OU protocol://[user@]host[:port][/path]
5638 \*(OPally supported network protocols are
5642 (POP3 with TLS encrypted transport),
5648 part is valid only for IMAP; there it defaults to
5650 Network URLs require a special encoding as documented in the section
5651 .Sx "On URL syntax and credential lookup" .
5656 Lists the names of all folders below the given argument or
5658 For file-based protocols
5660 will be used for display purposes.
5664 .It Ic Followup , followup
5665 \*(CM(F,fo) Similar to
5669 respectively, but save the message in a file named after the local part
5670 of the (first) recipient's address, possibly overwriting
5683 but saves the message in a file named after the local part of the
5684 recipient's address (instead of in
5689 \*(CM Take a message list and the address of a recipient, subject to
5691 to whom the messages are sent.
5692 The text of the original message is included in the new one,
5693 enclosed by the values of
5694 .Va forward-inject-head
5696 .Va forward-inject-tail .
5697 .Va content-description-forwarded-message
5699 The list of included headers can be filtered with the
5701 slot of the white- and blacklisting command
5703 Only the first part of a multipart message is included but for
5704 .Va forward-as-attachment .
5706 This may generate the errors
5707 .Va ^ERR Ns -DESTADDRREQ
5708 if no receiver has been specified, or was rejected by
5712 if an I/O error occurs,
5714 if a necessary character set conversion fails, and
5717 It can also fail with errors of
5718 .Sx "Specifying messages" .
5719 Any error stops processing of further messages.
5723 (f) Takes a list of message specifications and displays a summary of
5724 their message headers, exactly as via
5726 making the first message of the result the new
5728 (the last message if
5731 An alias of this command is
5734 .Sx "Specifying messages" .
5745 \*(OB Superseded by the multiplexer
5749 \*(OB Superseded by the multiplexer
5752 .It Ic ghost , unghost
5755 .Ic uncommandalias .
5759 .It Ic headerpick , unheaderpick
5760 \*(NQ Multiplexer command to manage white- and blacklisting
5761 selections of header fields for a variety of applications.
5762 Without arguments the set of contexts that have settings is displayed.
5763 When given arguments, the first argument is the context to which the
5764 command applies, one of (case-insensitive)
5766 for display purposes (for example
5769 for selecting which headers shall be stored persistently when
5775 ing messages (note that MIME related etc. header fields should not be
5776 ignored in order to not destroy usability of the message in this case),
5778 for stripping down messages when
5780 ing message (has no effect if
5781 .Va forward-as-attachment
5784 for defining user-defined set of fields for the command
5787 The current settings of the given context are displayed if it is the
5789 A second argument denotes the type of restriction that is to be chosen,
5790 it may be (a case-insensitive prefix of)
5794 for white- and blacklisting purposes, respectively.
5795 Establishing a whitelist suppresses inspection of the corresponding
5798 If no further argument is given the current settings of the given type
5799 will be displayed, otherwise the remaining arguments specify header
5800 fields, which \*(OPally may be given as regular expressions, to be added
5802 The special wildcard field (asterisk,
5804 will establish a (fast) shorthand setting which covers all fields.
5806 The latter command always takes three or more arguments and can be used
5807 to remove selections, i.e., from the given context, the given type of
5808 list, all the given headers will be removed, the special argument
5810 will remove all headers.
5814 (h) Show the current group of headers, the size of which depends on
5817 in interactive mode, and the format of which can be defined with
5819 If a message-specification is given the group of headers containing the
5820 first message therein is shown and the message at the top of the screen
5823 the last message is targeted if
5834 \*(OP Without arguments or when given
5836 all history entries are shown (this mode also supports a more
5840 will replace the list of entries with the content of
5844 will dump all entries to said file, replacing former content, and
5846 will delete all entries.
5847 The argument can also be a signed decimal
5849 which will select and evaluate the respective history entry, and move it
5850 to the top of the history; a negative number is used as an offset to the
5851 current command so that
5853 will select the last command, the history top, whereas
5855 will delete all given entries
5856 .Pf ( Ar :NUMBER: ) .
5858 .Sx "On terminal control and line editor" .
5864 Takes a message list and marks each message therein to be saved in the
5869 .Sx "secondary mailbox"
5871 Does not override the
5874 \*(UA deviates from the POSIX standard with this command, because a
5876 command issued after
5878 will display the following message, not the current one.
5884 .Ic \&\&if , Ic elif , else , endif
5885 conditional execution construct \(em if the given condition is true then
5886 the encapsulated block is executed.
5887 The POSIX standard only supports the (case-insensitive) conditions
5892 end, the remaining are non-portable extensions.
5893 \*(ID In conjunction with the
5896 .Sx "Shell-style argument quoting"
5897 and more test operators are available.
5899 .Bd -literal -offset indent
5908 Further (case-insensitive) one-argument conditions are
5910 erminal which evaluates to true in interactive terminal sessions
5911 (running with standard input or standard output attached to a terminal,
5914 command line options
5919 have been used), as well as any boolean value (see
5920 .Sx "INTERNAL VARIABLES"
5921 for textual boolean representations) to mark an enwrapped block as
5924 .Dq always execute .
5925 (Remarks: condition syntax errors skip all branches until
5931 It is possible to check
5932 .Sx "INTERNAL VARIABLES"
5935 variables for existence or compare their expansion against a user given
5936 value or another variable by using the
5938 .Pf ( Dq variable next )
5939 conditional trigger character;
5940 a variable on the right hand side may be signalled using the same
5942 Variable names may be enclosed in a pair of matching braces.
5943 When this mode has been triggered, several operators are available
5946 they are always available, and there is no trigger: variables will have
5947 been expanded by the shell-compatible parser before the
5949 etc. command sees them).
5952 \*(IN Two argument conditions.
5953 Variables can be tested for existence and expansion:
5955 will test whether the given variable exists, so that
5957 will evaluate to true when
5962 .Ql -n """$editalong"""
5963 will be true if the variable is set and expands to a non-empty string,
5964 .Ql -z $'\e$editalong'
5965 only if the expansion is empty, whether the variable exists or not.
5966 The remaining conditions take three arguments.
5969 Integer operators treat the arguments on the left and right hand side of
5970 the operator as integral numbers and compare them arithmetically.
5971 It is an error if any of the operands is not a valid integer, an empty
5972 argument (which implies it had been quoted) is treated as if it were 0.
5973 Via the question mark
5975 modifier suffix a saturated operation mode is available where numbers
5976 will linger at the minimum or maximum possible value, instead of
5977 overflowing (or trapping), the keyword
5984 are therefore identical.
5985 Available operators are
5989 (less than or equal to),
5995 (greater than or equal to), and
6000 String and regular expression data operators compare the left and right
6001 hand side according to their textual content.
6002 Unset variables are treated as the empty string.
6003 Via the question mark
6005 modifier suffix a case-insensitive operation mode is available, the keyword
6014 Available string operators are
6018 (less than or equal to),
6024 (greater than or equal to),
6028 (is substring of) and
6030 (is not substring of).
6031 By default these operators work on bytes and (therefore) do not take
6032 into account character set specifics.
6033 If the case-insensitivity modifier has been used, case is ignored
6034 according to the rules of the US-ASCII encoding, i.e., bytes are
6038 When the \*(OPal regular expression support is available, the additional
6044 They treat the right hand side as an extended regular expression that is
6045 matched according to the active locale (see
6046 .Sx "Character sets" ) ,
6047 i.e., character sets should be honoured correctly.
6050 Conditions can be joined via AND-OR lists (where the AND operator is
6052 and the OR operator is
6054 which have equal precedence and will be evaluated with left
6055 associativity, thus using the same syntax that is known for the
6057 It is also possible to form groups of conditions and lists by enclosing
6058 them in pairs of brackets
6059 .Ql [\ \&.\&.\&.\ ] ,
6060 which may be interlocked within each other, and also be joined via
6064 The results of individual conditions and entire groups may be modified
6065 via unary operators: the unary operator
6067 will reverse the result.
6069 .Bd -literal -offset indent
6070 wysh set v15-compat=yes # with value: automatic "wysh"!
6071 if -N debug;echo *debug* set;else;echo not;endif
6072 if "$ttycharset" == UTF-8 || "$ttycharset" ==?cas UTF8
6073 echo ttycharset is UTF-8, the former case-sensitive!
6076 if [ "${t1}" == "${t2}" ]
6077 echo These two variables are equal
6079 if "$features" =% ,+regex, && "$TERM" =~?case ^xterm\&.*
6080 echo ..in an X terminal
6082 if [ [ true ] && [ [ "${debug}" != '' ] || \e
6083 [ "$verbose" != '' ] ] ]
6086 if true && [ -n "$debug" || -n "${verbose}" ]
6087 echo Left associativity, as is known from the shell
6096 Superseded by the multiplexer
6101 Shows the names of all available commands, in command lookup order.
6102 \*(OP In conjunction with a set variable
6104 additional information will be provided for each command: the argument
6105 type will be indicated, the documentation string will be shown,
6106 and the set of command flags will show up:
6108 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
6110 command supports the command modifier
6113 command supports the command modifier
6116 the error number is tracked in
6119 whether the command needs an active mailbox, a
6122 indicators whether command is \&.\h'.3m'.\h'.3m'.
6123 .Bl -tag -compact -width ".It Ql SUBPROCESS"
6124 .It Ql batch/interactive
6125 usable in interactive or batch mode
6128 usable in send mode.
6130 allowed to be used when running in a subprocess instance,
6131 for example from within a macro that is called via
6132 .Va on-compose-splice .
6135 indicators whether command is not \&.\h'.3m'.\h'.3m'.
6136 .Bl -tag -compact -width ".It Ql COMPOSE_MODE"
6141 available during program startup, like in
6142 .Sx "Resource files" .
6145 The command produces
6154 Enforce change localization of
6159 .Sx "INTERNAL VARIABLES" ,
6160 meaning that their state will be reverted to the former one once the
6163 Just like the command modifier
6165 which provides block-scope localization for some commands (instead),
6166 it can only be used inside of macro definition blocks introduced by
6170 The covered scope of an
6172 is left once a different account is activated, and some macros, notably
6173 .Va folder-hook Ns s ,
6174 use their own specific notion of covered scope, here it will be extended
6175 until the folder is left again.
6178 This setting stacks up: i.e., if
6180 enables change localization and calls
6182 which explicitly resets localization, then any value changes within
6184 will still be reverted when the scope of
6187 (Caveats: if in this example
6189 changes to a different
6191 which sets some variables that are already covered by localizations,
6192 their scope will be extended, and in fact leaving the
6194 will (thus) restore settings in (likely) global scope which actually
6195 were defined in a local, macro private context!)
6198 This command takes one or two arguments, the optional first one
6199 specifies an attribute that may be one of
6201 which refers to the current scope and is thus the default,
6203 which causes any macro that is being
6205 ed to be started with localization enabled by default, as well as
6207 which (if enabled) disallows any called macro to turn off localization:
6208 like this it can be ensured that once the current scope regains control,
6209 any changes made in deeper levels have been reverted.
6210 The latter two are mutually exclusive, and neither affects
6212 The (second) argument is interpreted as a boolean (string, see
6213 .Sx "INTERNAL VARIABLES" )
6214 and states whether the given attribute shall be turned on or off.
6216 .Bd -literal -offset indent
6217 define temporary_settings {
6218 set possibly_global_option1
6220 set localized_option1
6221 set localized_option2
6223 set possibly_global_option2
6230 .It Ic Lfollowup , Lreply
6231 \*(CM Reply to messages that come in via known
6234 .Pf ( Ic mlsubscribe )
6235 mailing lists, or pretend to do so (see
6236 .Sx "Mailing lists" ) :
6241 respectively, functionality this will actively resort and even remove
6242 message recipients in order to generate a message that is supposed to be
6243 sent to a mailing list.
6244 For example it will also implicitly generate a
6245 .Ql Mail-Followup-To:
6246 header if that seems useful, regardless of the setting of the variable
6248 For more documentation please refer to
6249 .Sx "On sending mail, and non-interactive mode" .
6251 This may generate the errors
6252 .Va ^ERR Ns -DESTADDRREQ
6253 if no receiver has been specified,
6255 if some addressees where rejected by
6258 if an I/O error occurs,
6260 if a necessary character set conversion fails, and
6263 It can also fail with errors of
6264 .Sx "Specifying messages" .
6265 Occurrence of some of the errors depend on the value of
6267 Any error stops processing of further messages.
6273 but saves the message in a file named after the local part of the first
6274 recipient's address (instead of in
6279 \*(CM(m) Takes a (list of) recipient address(es) as (an) argument(s),
6280 or asks on standard input if none were given;
6281 then collects the remaining mail content and sends it out.
6282 Unless the internal variable
6284 is set recipient addresses will be stripped from comments, names etc.
6285 For more documentation please refer to
6286 .Sx "On sending mail, and non-interactive mode" .
6288 This may generate the errors
6289 .Va ^ERR Ns -DESTADDRREQ
6290 if no receiver has been specified,
6292 if some addressees where rejected by
6295 if multiple messages have been specified,
6297 if an I/O error occurs,
6299 if a necessary character set conversion fails, and
6302 It can also fail with errors of
6303 .Sx "Specifying messages" .
6304 Occurrence of some of the errors depend on the value of
6309 \*(OP When used without arguments or if
6311 has been given the content of
6312 .Sx "The Mailcap files"
6313 cache is shown, (re-)initializing it first (as necessary.
6316 then the cache will only be (re-)initialized, and
6318 will remove its contents.
6319 Note that \*(UA will try to load the files only once, use
6320 .Ql Ic \&\&mailcap Ns \:\0\:clear
6321 to unlock further attempts.
6322 Loading and parsing can be made more
6327 (mb) The given message list is to be sent to the
6329 .Sx "secondary mailbox"
6331 when \*(UA is quit; this is the default action unless the variable
6334 \*(ID This command can only be used in a
6336 .Sx "primary system mailbox" .
6340 .It Ic mimetype , unmimetype
6341 \*(NQ Without arguments the content of the MIME type cache will displayed;
6342 a more verbose listing will be produced if either of
6347 When given arguments they will be joined, interpreted as shown in
6348 .Sx "The mime.types files"
6350 .Sx "HTML mail and MIME attachments" ) ,
6351 and the resulting entry will be added (prepended) to the cache.
6352 In any event MIME type sources are loaded first as necessary \(en
6353 .Va mimetypes-load-control
6354 can be used to fine-tune which sources are actually loaded.
6356 The latter command deletes all specifications of the given MIME type, thus
6357 .Ql \&? unmimetype text/plain
6358 will remove all registered specifications for the MIME type
6362 will discard all existing MIME types, just as will
6364 but which also reenables cache initialization via
6365 .Va mimetypes-load-control .
6369 \*(ID Only available in interactive mode, this command allows execution
6370 of external MIME type handlers which do not integrate into the normal
6373 .Sx "HTML mail and MIME attachments" ) .
6374 (\*(ID No syntax to directly address parts, this restriction may vanish.)
6375 The user will be asked for each non-text part of the given message in
6376 turn whether the registered handler shall be used to display the part.
6380 .It Ic mlist , unmlist
6381 \*(NQ Manage the list of known
6382 .Sx "Mailing lists" ;
6383 subscriptions are controlled via
6385 The latter command deletes all given arguments,
6386 or all at once when given the asterisk
6388 The former shows the list of all currently known lists if used
6389 without arguments, otherwise the given arguments will become known.
6390 \*(OP In the latter case, arguments which contain any of the
6392 .Sx "magic regular expression characters"
6393 will be interpreted as one, possibly matching many addresses;
6394 these will be sequentially matched via linked lists instead of being
6395 looked up in a dictionary.
6399 .It Ic mlsubscribe , unmlsubscribe
6400 Building upon the command pair
6401 .Ic mlist , unmlist ,
6402 but only managing the subscription attribute of mailing lists.
6403 (The former will also create not yet existing mailing lists.)
6409 but move the messages to a file named after the local part of the
6410 sender of the first message instead of taking a filename argument;
6412 is inspected to decide on the actual storage location.
6418 but marks the messages for deletion if they were transferred
6425 but also displays header fields which would not pass the
6427 selection, and all MIME parts.
6435 on the given messages, even in non-interactive mode and as long as the
6436 standard output is a terminal.
6442 \*(OP When used without arguments or if
6444 has been given the content of the
6446 cache is shown, (re-)initializing it first (as necessary).
6449 then the cache will only be (re-)initialized, and
6451 will remove its contents.
6455 \*(OP When used without arguments, or when the argument was
6459 cache is shown, initializing it as necessary.
6462 then the cache will be (re)loaded, whereas
6465 Loading and parsing can be made more
6468 will query the cache for the URL given as the second argument
6469 .Pf ( Ql [USER@]HOST ) .
6474 .Sx "On URL syntax and credential lookup" ;
6476 .Sx "The .netrc file"
6477 documents the file format in detail.
6481 Checks for new mail in the current folder without committing any changes
6483 If new mail is present, a message is shown.
6487 the headers of each new message are also shown.
6488 This command is not available for all mailbox types.
6496 Goes to the next message in sequence and types it.
6497 With an argument list, types the next matching message.
6511 If the current folder is accessed via a network connection, a
6513 command is sent, otherwise no operation is performed.
6519 but also displays header fields which would not pass the
6521 selection, and all MIME parts.
6529 on the given messages, even in non-interactive mode and as long as the
6530 standard output is a terminal.
6538 but also pipes header fields which would not pass the
6540 selection, and all parts of MIME
6541 .Ql multipart/alternative
6546 (pi) Takes an optional message list and shell command (that defaults to
6548 and pipes the messages through the command.
6552 every message is followed by a formfeed character.
6573 (q) Terminates the session, saving all undeleted, unsaved messages in
6576 .Sx "secondary mailbox"
6578 preserving all messages marked with
6582 or never referenced in the system
6584 and removing all other messages from the
6586 .Sx "primary system mailbox" .
6587 If new mail has arrived during the session,
6589 .Dq You have new mail
6591 If given while editing a mailbox file with the command line option
6593 then the edit file is rewritten.
6594 A return to the shell is effected,
6595 unless the rewrite of edit file fails,
6596 in which case the user can escape with the exit command.
6597 The optional status number argument will be passed through to
6599 \*(ID For now it can happen that the given status will be overwritten,
6600 later this will only occur if a later error needs to be reported onto an
6601 otherwise success indicating status.
6605 \*(NQ Read a line from standard input, or the channel set active via
6607 and assign the data, which will be split as indicated by
6609 to the given variables.
6610 The variable names are checked by the same rules as documented for
6612 and the same error codes will be seen in
6616 indicates the number of bytes read, it will be
6618 with the error number
6622 in case of I/O errors, or
6625 If there are more fields than variables, assigns successive fields to the
6626 last given variable.
6627 If there are less fields than variables, assigns the empty string to the
6629 .Bd -literal -offset indent
6632 ? echo "<$a> <$b> <$c>"
6634 ? wysh set ifs=:; read a b c;unset ifs
6635 hey2.0,:"'you ",:world!:mars.:
6636 ? echo $?/$^ERRNAME / <$a><$b><$c>
6637 0/NONE / <hey2.0,><"'you ",><world!:mars.:><><>
6644 but splits on shell token boundaries (see
6645 .Sx "Shell-style argument quoting" )
6648 \*(ID Could become a
6651 .Ql read --tokenize -- .
6655 \*(NQ Read anything from standard input, or the channel set active via
6657 and assign the data to the given variable.
6658 The variable name is checked by the same rules as documented for
6660 and the same error codes will be seen in
6664 indicates the number of bytes read, it will be
6666 with the error number
6670 in case of I/O errors, or
6673 \*(ID The input data length is restricted to 31-bits.
6677 \*(NQ Manages input channels for
6682 to be used to avoid complicated or impracticable code, like calling
6684 from within a macro in non-interactive mode.
6685 Without arguments, or when the first argument is
6687 a listing of all known channels is printed.
6688 Channels can otherwise be
6690 d, and existing channels can be
6694 d by giving the string used for creation.
6696 The channel name is expected to be a file descriptor number, or,
6697 if parsing the numeric fails, an input file name that undergoes
6698 .Sx "Filename transformations" .
6699 For example (this example requires a modern shell):
6700 .Bd -literal -offset indent
6701 $ printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6704 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6705 LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6711 \*(NQ Removes the named files or directories.
6712 If a name refers to a mailbox, say a Maildir mailbox, then a mailbox
6713 type specific removal will be performed, deleting the complete mailbox.
6714 In interactive mode the user is asked for confirmation.
6718 \*(NQ Takes the name of an existing folder
6719 and the name for the new folder
6720 and renames the first to the second one.
6721 .Sx "Filename transformations"
6722 including shell pathname wildcard pattern expansions
6724 are performed on both arguments.
6725 Both folders must be of the same type.
6729 .It Ic Reply , Respond
6730 \*(CM(R) Identical to
6732 except that it replies to only the sender of each message of the given
6733 list, by using the first message as the template to quote, for the
6737 will exchange this command with
6742 .It Ic reply , respond
6743 \*(CM(r) Take a message (list) and group-respond (to each in turn)
6744 by addressing the sender and all recipients, subject to
6750 .Va followup-to-honour ,
6753 .Va recipients-in-cc
6754 influence response behaviour.
6757 .Va quote-as-attachment
6758 configure whether responded-to message shall be quoted etc.,
6759 .Va content-description-quote-attachment
6763 will exchange this command with
6767 offers special support for replying to mailing lists.
6768 For more documentation please refer to
6769 .Sx "On sending mail, and non-interactive mode" .
6771 This may generate the errors
6772 .Va ^ERR Ns -DESTADDRREQ
6773 if no receiver has been specified, or was rejected by
6777 if an I/O error occurs,
6779 if a necessary character set conversion fails, and
6782 It can also fail with errors of
6783 .Sx "Specifying messages" .
6784 Any error stops processing of further messages.
6790 but does not add any header lines.
6791 This is not a way to hide the sender's identity,
6792 but useful for sending a message again to the same recipients.
6796 Takes a list of messages and a name,
6797 and sends each message to the given addressee, which is subject to
6800 and related header fields are prepended to the new copy of the message.
6803 is only performed if
6806 \*(ID\*(CM is not entered, the only supported hooks are
6809 .Va on-resend-cleanup .
6811 This may generate the errors
6812 .Va ^ERR Ns -DESTADDRREQ
6813 if no receiver has been specified, or was rejected by
6817 if an I/O error occurs,
6819 if a necessary character set conversion fails, and
6822 It can also fail with errors of
6823 .Sx "Specifying messages" .
6824 Any error stops processing of further messages.
6828 (ret) Superseded by the multiplexer
6833 Only available inside of a
6837 this command returns control of execution to the outer scope.
6838 The two optional parameters are positive decimal numbers and default to 0:
6839 the first specifies the 32-bit return value (stored in
6841 \*(ID and later extended to 64-bit),
6842 the second the 32-bit error number (stored in
6846 a non-0 exit status may cause the program to exit.
6852 but saves the messages in a file named after the local part of the
6853 sender of the first message instead of taking a filename argument;
6855 is inspected to decide on the actual storage location.
6859 (s) Takes a message list and a filename and appends each message in turn
6860 to the end of the file.
6861 .Sx "Filename transformations"
6862 including shell pathname wildcard pattern expansions
6864 is performed on the filename.
6865 If no filename is given, the
6867 .Sx "secondary mailbox"
6870 The filename in quotes, followed by the generated character count
6871 is echoed on the user's terminal.
6874 .Sx "primary system mailbox"
6875 the messages are marked for deletion.
6876 To filter the saved header fields to the desired subset use the
6878 slot of the white- and blacklisting command
6884 \*(OB Superseded by the multiplexer
6888 \*(OB Superseded by the multiplexer
6892 \*(OB Superseded by the multiplexer
6897 Takes a message specification (list) and displays a header summary of
6898 all matching messages, as via
6900 This command is an alias of
6903 .Sx "Specifying messages" .
6907 Takes a message list and marks all messages as having been read.
6913 (se, \*(NQ uns) The latter command will delete all given global
6914 variables, or only block-scope local ones if the
6916 command modifier has been used.
6917 The former, when used without arguments, will show all
6918 currently known variables, being more verbose if either of
6923 Remarks: this list mode will not automatically link-in (known)
6925 variables, this only happens for explicit addressing, examples are
6927 using a variable in an
6929 condition or a string passed to
6933 ting, as well as some program-internal use cases (look-ups).
6936 Otherwise the given variables (and arguments) are set or adjusted.
6937 Arguments are of the form
6939 (no space before or after
6943 if there is no value, i.e., a boolean variable.
6944 If a name begins with
6948 the effect is the same as invoking the
6950 command with the remaining part of the variable
6951 .Pf ( Ql unset save ) .
6952 \*(ID In conjunction with the
6954 .Pf (or\0 Cm local )
6956 .Sx "Shell-style argument quoting"
6957 can be used to quote arguments as necessary.
6958 \*(ID Otherwise quotation marks may be placed around any part of the
6959 assignment statement to quote blanks or tabs.
6962 When operating in global scope any
6964 that is known to map to an environment variable will automatically cause
6965 updates in the program environment (unsetting a variable in the
6966 environment requires corresponding system support) \(em use the command
6968 for further environmental control.
6969 If the command modifier
6971 has been used to enforce local scoping then the given user variables
6972 will be garbage collected when the local scope is left;
6974 .Sx "INTERNAL VARIABLES" ,
6977 behaves the same as if
6979 would have been set (temporarily), which means that changes are
6980 inherited by deeper scopes.
6984 .Sx "INTERNAL VARIABLES"
6988 .Bd -literal -offset indent
6989 ? wysh set indentprefix=' -> '
6990 ? wysh set atab=$'\t' aspace=' ' zero=0
6996 Apply shell quoting rules to the given raw-data arguments.
7000 .Sx "Command modifiers" ) .
7001 The first argument specifies the operation:
7005 cause shell quoting to be applied to the remains of the line, and
7006 expanded away thereof, respectively.
7007 If the former is prefixed with a plus-sign, the quoted result will not
7008 be roundtrip enabled, and thus can be decoded only in the very same
7009 environment that was used to perform the encode; also see
7010 .Cd mle-quote-rndtrip .
7011 If the coding operation fails the error number
7014 .Va ^ERR Ns -CANCELED ,
7015 and the unmodified input is used as the result; the error number may
7016 change again due to output or result storage errors.
7020 \*(NQ (sh) Invokes an interactive version of the shell,
7021 and returns its exit status.
7025 .It Ic shortcut , unshortcut
7026 \*(NQ Manage the file- or pathname shortcuts as documented for
7028 The latter command deletes all shortcuts given as arguments,
7029 or all at once when given the asterisk
7031 The former shows the list of all currently defined shortcuts if used
7032 without arguments, the target of the given with a single argument.
7033 Otherwise arguments are treated as pairs of shortcuts and their desired
7034 expansion, creating new or updating already existing ones.
7038 \*(NQ Shift the positional parameter stack (starting at
7040 by the given number (which must be a positive decimal),
7041 or 1 if no argument has been given.
7042 It is an error if the value exceeds the number of positional parameters.
7043 If the given number is 0, no action is performed, successfully.
7044 The stack as such can be managed via
7046 Note this command will fail in
7048 and hook macros unless the positional parameter stack has been
7049 explicitly created in the current context via
7056 but performs neither MIME decoding nor decryption, so that the raw
7057 message text is shown.
7061 (si) Shows the size in characters of each message of the given
7066 \*(NQ Sleep for the specified number of seconds (and optionally
7067 milliseconds), by default interruptible.
7068 If a third argument is given the sleep will be uninterruptible,
7069 otherwise the error number
7073 if the sleep has been interrupted.
7074 The command will fail and the error number will be
7075 .Va ^ERR Ns -OVERFLOW
7076 if the given duration(s) overflow the time datatype, and
7078 if the given durations are no valid integers.
7083 .It Ic sort , unsort
7084 The latter command disables sorted or threaded mode, returns to normal
7085 message order and, if the
7088 displays a header summary.
7089 The former command shows the current sorting criterion when used without
7090 an argument, but creates a sorted representation of the current folder
7091 otherwise, and changes the
7093 command and the addressing modes such that they refer to messages in
7095 Message numbers are the same as in regular mode.
7099 a header summary in the new order is also displayed.
7100 Automatic folder sorting can be enabled by setting the
7103 .Ql set autosort=thread .
7104 Possible sorting criterions are:
7107 .Bl -tag -compact -width "subject"
7109 Sort the messages by their
7111 field, that is by the time they were sent.
7113 Sort messages by the value of their
7115 field, that is by the address of the sender.
7118 variable is set, the sender's real name (if any) is used.
7120 Sort the messages by their size.
7122 \*(OP Sort the message by their spam score, as has been classified by
7125 Sort the messages by their message status.
7127 Sort the messages by their subject.
7129 Create a threaded display.
7131 Sort messages by the value of their
7133 field, that is by the address of the recipient.
7136 variable is set, the recipient's real name (if any) is used.
7142 \*(NQ (so) The source command reads commands from the given file.
7143 .Sx "Filename transformations"
7145 If the given expanded argument ends with a vertical bar
7147 then the argument will instead be interpreted as a shell command and
7148 \*(UA will read the output generated by it.
7149 Dependent on the settings of
7153 and also dependent on whether the command modifier
7155 had been used, encountering errors will stop sourcing of the given input.
7158 cannot be used from within macros that execute as
7159 .Va folder-hook Ns s
7162 i.e., it can only be called from macros that were
7167 \*(NQ The difference to
7169 (beside not supporting pipe syntax aka shell command input) is that
7170 this command will not generate an error nor warn if the given file
7171 argument cannot be opened successfully.
7175 \*(OP Takes a list of messages and clears their
7181 \*(OP Takes a list of messages and causes the
7183 to forget it has ever used them to train its Bayesian filter.
7184 Unless otherwise noted the
7186 flag of the message is inspected to chose whether a message shall be
7194 \*(OP Takes a list of messages and informs the Bayesian filter of the
7198 This also clears the
7200 flag of the messages in question.
7204 \*(OP Takes a list of messages and rates them using the configured
7205 .Va spam-interface ,
7206 without modifying the messages, but setting their
7208 flag as appropriate; because the spam rating headers are lost the rate
7209 will be forgotten once the mailbox is left.
7210 Refer to the manual section
7212 for the complete picture of spam handling in \*(UA.
7216 \*(OP Takes a list of messages and sets their
7222 \*(OP Takes a list of messages and informs the Bayesian filter of the
7228 flag of the messages in question.
7240 \*(NQ TLS information and management command multiplexer to aid in
7241 .Sx "Encrypted network communication" ,
7242 mostly available only if the term
7248 if so documented (see
7249 .Sx "Command modifiers" ) .
7250 The result that is shown in case of errors is always the empty string,
7251 errors can be identified via the error number
7253 For example, string length overflows are caught and set
7256 .Va ^ERR Ns -OVERFLOW .
7257 The TLS configuration is honoured, especially
7260 .Bd -literal -offset indent
7261 ? vput tls result fingerprint pop3s://ex.am.ple
7262 ? echo $?/$!/$^ERRNAME: $result
7265 .Bl -hang -width ".It Cm random"
7267 Show the complete verified peer certificate chain.
7268 Includes informational fields in conjunction with
7271 Show only the peer certificate, without any signers.
7272 Includes informational fields in conjunction with
7276 .Va tls-fingerprint-digest Ns
7277 ed fingerprint of the certificate of the given HOST
7278 .Pf ( Ql server:port ,
7279 where the port defaults to the HTTPS port, 443).
7281 is actively ignored for the runtime of this command.
7292 slot for white- and blacklisting header fields.
7296 (to) Takes a message list and types out the first
7298 lines of each message on the user's terminal.
7299 Unless a special selection has been established for the
7303 command, the only header fields that are displayed are
7314 It is possible to apply compression to what is displayed by setting
7316 Messages are decrypted and converted to the terminal character set
7321 (tou) Takes a message list and marks the messages for saving in the
7323 .Sx "secondary mailbox"
7325 \*(UA deviates from the POSIX standard with this command,
7328 command will display the following message instead of the current one.
7334 but also displays header fields which would not pass the
7336 selection, and all visualizable parts of MIME
7337 .Ql multipart/alternative
7342 (t) Takes a message list and types out each message on the user's terminal.
7343 The display of message headers is selectable via
7345 For MIME multipart messages, all parts with a content type of
7347 all parts which have a registered MIME type handler (see
7348 .Sx "HTML mail and MIME attachments" )
7349 which produces plain text output, and all
7351 parts are shown, others are hidden except for their headers.
7352 Messages are decrypted and converted to the terminal character set
7356 can be used to display parts which are not displayable as plain text.
7399 \*(OB Superseded by the multiplexer
7403 \*(OB Superseded by the multiplexer
7408 Superseded by the multiplexer
7419 .It Ic unmlsubscribe
7430 Takes a message list and marks each message as not having been read.
7434 Superseded by the multiplexer
7438 \*(OB Superseded by the multiplexer
7442 \*(OB Superseded by the multiplexer
7464 Perform URL percent codec operations on the raw-data argument, rather
7465 according to RFC 3986.
7466 The first argument specifies the operation:
7470 perform plain URL percent en- and decoding, respectively.
7474 perform a slightly modified operation which should be better for
7475 pathnames: it does not allow a tilde
7477 and will neither accept hyphen-minus
7481 as an initial character.
7482 The remains of the line form the URL data which is to be converted.
7483 This is a character set agnostic operation,
7484 and it may thus decode bytes which are invalid in the current
7490 .Sx "Command modifiers" ) ,
7491 and manages the error number
7493 If the coding operation fails the error number
7496 .Va ^ERR Ns -CANCELED ,
7497 and the unmodified input is used as the result; the error number may
7498 change again due to output or result storage errors.
7499 \*(ID This command does not know about URLs beside what is documented.
7503 subcommand, shall the URL be displayed.)
7507 \*(NQ This command produces the same output as the listing mode of
7511 ity adjustments, but only for the given variables.
7515 \*(OP Takes a message list and verifies each message.
7516 If a message is not a S/MIME signed message,
7517 verification will fail for it.
7518 The verification process checks if the message was signed using a valid
7520 if the message sender's email address matches one of those contained
7521 within the certificate,
7522 and if the message content has been altered.
7530 of \*(UA, optionally in a more
7532 form which also includes the build and running system environment.
7533 This command supports
7536 .Sx "Command modifiers" ) .
7541 \*(NQ A multiplexer command which offers signed 64-bit numeric
7542 calculations, as well as other, mostly string-based operations.
7543 C-style byte string operations are available via
7545 The first argument defines the number, type, and meaning of the
7546 remaining arguments.
7547 An empty number argument is treated as 0.
7551 .Sx "Command modifiers" ) .
7552 The result shown in case of errors is
7554 for usage errors and numeric operations, the empty string otherwise;
7556 errors, like when a search operation failed, will also set the
7559 .Va ^ERR Ns -NODATA .
7560 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7561 numbers, and errors will be reported in the error number
7563 as the numeric error
7564 .Va ^ERR Ns -RANGE .
7567 Numeric operations work on one or two signed 64-bit integers.
7568 Numbers prefixed with
7572 are interpreted as hexadecimal (base 16) numbers, whereas
7574 indicates octal (base 8), and
7578 denote binary (base 2) numbers.
7579 It is possible to use any base in between 2 and 36, inclusive, with the
7581 notation, where the base is given as an unsigned decimal number, so
7583 is a different way of specifying a hexadecimal number.
7584 Unsigned interpretation of a number can be enforced by prefixing an
7586 (case-insensitively), as in
7588 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7589 which will be interpreted as unsigned by default, but it still makes
7590 a difference regarding overflow detection and overflow constant.
7591 It is possible to enforce signed interpretation by (instead) prefixing a
7593 (case-insensitively).
7594 The number sign notation uses a permissive parse mode and as such
7595 supports complicated conditions out of the box:
7596 .Bd -literal -offset indent
7597 ? wysh set ifs=:;read i;unset ifs;echo $i;vexpr pb 2 10#$i
7604 One integer is expected by assignment (equals sign
7606 which does nothing but parsing the argument, thus detecting validity and
7607 possible overflow conditions, unary not (tilde
7609 which creates the bitwise complement, and unary plus and minus.
7610 Two integers are used by addition (plus sign
7612 subtraction (hyphen-minus
7614 multiplication (asterisk
7618 and modulo (percent sign
7620 as well as for the bitwise operators logical or (vertical bar
7623 bitwise and (ampersand
7626 bitwise xor (circumflex
7628 the bitwise signed left- and right shifts
7631 as well as for the unsigned right shift
7635 Another numeric operation is
7637 which takes a number base in between 2 and 36, inclusive, and will act
7638 on the second number given just the same as what equals sign
7640 does, but the number result will be formatted in the base given, as
7641 a signed 64-bit number unless unsigned interpretation of the input
7642 number had been forced (with an u prefix).
7645 Numeric operations support a saturated mode via the question mark
7647 modifier suffix; the keyword
7654 are therefore identical.
7655 In saturated mode overflow errors and division and modulo by zero are no
7656 longer reported via the exit status, but the result will linger at the
7657 minimum or maximum possible value, instead of overflowing (or trapping).
7658 This is true also for the argument parse step.
7659 For the bitwise shifts, the saturated maximum is 63.
7660 Any caught overflow will be reported via the error number
7663 .Va ^ERR Ns -OVERFLOW .
7665 .Bd -literal -offset indent
7666 ? vput vexpr res -? +1 -9223372036854775808
7667 ? echo $?/$!/$^ERRNAME:$res
7668 0/75/OVERFLOW:-9223372036854775808
7672 Character set agnostic string functions have no notion of locale
7673 settings and character sets.
7675 .Bl -hang -width ".It Cm random"
7677 Outputs the current date and time in UTC (Coordinated Universal Time)
7678 with values named such that
7679 .Ql vput vexpr x date-utc; eval wysh set $x
7680 creates accessible variables.
7681 .It Cm date-stamp-utc
7682 Outputs a RFC 3339 internet date/time format of UTC.
7684 The seconds and nanoseconds since the Unix epoch (1970-01-01T00:00:00)
7690 .Ql vput vexpr x epoch; eval wysh set $x
7691 creates accessible variables.
7694 .Sx "Filename transformations"
7696 .It Cm file-stat , file-lstat
7698 .Sx "Filename transformations"
7699 on the argument, then call
7703 respectively, and output values such that
7704 .Ql vput vexpr x file-stat FILE; eval wysh set $x
7705 creates accessible variables.
7710 to denote directories, commercial at
7712 for links, number sign
7714 for block devices, percent sign
7716 for for character devices, vertical bar
7718 for FIFOs, equal sign
7720 for sockets, and the period
7724 Generates a random string of the given length, or of
7726 bytes (a constant from
7728 if the value 0 is given; the random string will be base64url encoded
7729 according to RFC 4648, and thus be usable as a (portable) filename.
7733 String operations work, sufficient support provided, according to the
7734 active user's locale encoding and character set (see
7735 .Sx "Character sets" ) .
7736 Where the question mark
7738 modifier suffix is supported, a case-insensitive operation mode is
7739 available; the keyword
7745 are therefore identical.
7747 .Bl -hang -width ".It Cm regex"
7749 (One-way) Converts the argument to something safely printable on the
7753 \*(OP A string operation that will try to match the first argument with
7754 the regular expression given as the second argument.
7756 modifier suffix is supported.
7757 If the optional third argument has been given then instead of showing
7758 the match offset a replacement operation is performed: the third
7759 argument is treated as if specified within dollar-single-quote (see
7760 .Sx "Shell-style argument quoting" ) ,
7761 and any occurrence of a positional parameter, for example
7763 etc. is replaced with the according match group of the regular expression:
7764 .Bd -literal -offset indent
7765 ? vput vexpr res regex bananarama \e
7766 (.*)NanA(.*) '\e${1}au\e$2'
7767 ? echo $?/$!/$^ERRNAME:$res:
7769 ? vput vexpr res regex?case bananarama \e
7770 (.*)NanA(.*) '\e${1}uauf\e$2'
7771 ? echo $?/$!/$^ERRNAME:$res:
7772 0/0/NONE:bauauframa:
7779 \*(NQ Manage the positional parameter stack (see
7783 If the first argument is
7785 then the positional parameter stack of the current context, or the
7786 global one, if there is none, is cleared.
7789 then the remaining arguments will be used to (re)create the stack,
7790 if the parameter stack size limit is excessed an
7791 .Va ^ERR Ns -OVERFLOW
7795 If the first argument is
7797 a round-trip capable representation of the stack contents is created,
7798 with each quoted parameter separated from each other with the first
7801 and followed by the first character of
7803 if that is not empty and not identical to the first.
7804 If that results in no separation at all a
7810 .Sx "Command modifiers" ) .
7811 I.e., the subcommands
7815 can be used (in conjunction with
7817 to (re)create an argument stack from and to a single variable losslessly.
7819 .Bd -literal -offset indent
7820 ? vpospar set hey, "'you ", world!
7821 ? echo $#: <${1}><${2}><${3}>
7822 ? vput vpospar x quote
7824 ? echo $#: <${1}><${2}><${3}>
7825 ? eval vpospar set ${x}
7826 ? echo $#: <${1}><${2}><${3}>
7832 (v) Takes a message list and invokes the
7834 display editor on each message.
7835 Modified contents are discarded unless the
7837 variable is set, and are not used unless the mailbox can be written to
7838 and the editor returns a successful exit status.
7840 can be used instead for a less display oriented editor.
7844 (w) For conventional messages the body without all headers is written.
7845 The original message is never marked for deletion in the originating
7847 The output is decrypted and converted to its native format as necessary.
7848 If the output file exists, the text is appended.
7849 If a message is in MIME multipart format its first part is written to
7850 the specified file as for conventional messages, handling of the remains
7851 depends on the execution mode.
7852 No special handling of compressed files is performed.
7854 In interactive mode the user is consecutively asked for the filenames of
7855 the processed parts.
7856 For convenience saving of each part may be skipped by giving an empty
7857 value, the same result as writing it to
7859 Shell piping the part content by specifying a leading vertical bar
7861 character for the filename is supported.
7862 Other user input undergoes the usual
7863 .Sx "Filename transformations" ,
7864 including shell pathname wildcard pattern expansions
7866 and shell variable expansion for the message as such, not the individual
7867 parts, and contents of the destination file are overwritten if the file
7869 Character set conversion to
7871 is performed when saving text data.
7873 \*(ID In non-interactive mode any part which does not specify a filename
7874 is ignored, and suspicious parts of filenames of the remaining parts are
7875 URL percent encoded (as via
7877 to prevent injection of malicious character sequences, resulting in
7878 a filename that will be written into the current directory.
7879 Existing files will not be overwritten, instead the part number or
7880 a dot are appended after a number sign
7882 to the name until file creation succeeds (or fails due to other
7887 \*(NQ The sole difference to
7889 is that the new macro is executed in place of the current one, which
7890 will not regain control: all resources of the current macro will be
7892 This implies that any setting covered by
7894 will be forgotten and covered variables will become cleaned up.
7895 If this command is not used from within a
7897 ed macro it will silently be (a more expensive variant of)
7907 \*(NQ \*(UA presents message headers in
7909 fuls as described under the
7912 Without arguments this command scrolls to the next window of messages,
7913 likewise if the argument is
7917 scrolls to the last,
7919 scrolls to the first, and
7924 A number argument prefixed by
7928 indicates that the window is calculated in relation to the current
7929 position, and a number without a prefix specifies an absolute position.
7935 but scrolls to the next or previous window that contains at least one
7946 .\" .Sh COMMAND ESCAPES {{{
7947 .Sh "COMMAND ESCAPES"
7949 Command escapes are available in
7951 during interactive usage, when explicitly requested via
7955 They perform special functions, like editing headers of the message
7956 being composed, calling normal
7958 yielding a shell, etc.
7959 Command escapes are only recognized at the beginning of lines, and
7960 consist of an escape followed by a command character.
7963 character is the tilde
7967 Unless otherwise documented command escapes ensure proper updates of
7974 controls whether a failed operation errors out message compose mode and
7975 causes program exit.
7976 Escapes may be prefixed by none to multiple single character command
7977 modifiers, interspersed whitespace is ignored:
7981 An effect equivalent to the command modifier
7983 can be achieved with hyphen-minus
7991 uates the remains of the line; also see
7992 .Sx "Shell-style argument quoting" .
7993 \*(ID For now the entire input line is evaluated as a whole; to avoid
7994 that control operators like semicolon
7996 are interpreted unintentionally, they must be quoted.
8000 Addition of the command line to the \*(OPal history can be prevented by
8001 placing whitespace directly after
8005 ings support a compose mode specific context.
8006 The following command escapes are supported:
8009 .Bl -tag -width ".It Ic BaNg"
8012 Insert the string of text in the message prefaced by a single
8014 (If the escape character has been changed,
8015 that character must be doubled instead.)
8018 .It Ic ~! Ar command
8019 Execute the indicated shell
8021 which follows, replacing unescaped exclamation marks with the previously
8022 executed command if the internal variable
8024 is set, then return to the message.
8028 End compose mode and send the message.
8030 .Va on-compose-splice-shell
8032 .Va on-compose-splice ,
8033 in order, will be called when set, after which, in interactive mode
8036 .Va askcc , askbcc )
8039 will be checked as well as
8042 .Va on-compose-leave
8043 hook will be called,
8047 will be joined in if set,
8049 .Va message-inject-tail
8050 will be incorporated, after which the compose mode is left.
8053 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
8054 Can be used to execute
8056 (which are allowed in compose mode).
8059 .It Ic ~< Ar filename
8064 .It Ic ~<! Ar command
8066 is executed using the shell.
8067 Its standard output is inserted into the message.
8071 \*(OP Write a summary of command escapes.
8074 .It Ic ~@ Op Ar filename...
8075 Append or edit the list of attachments.
8076 Does not manage the error number
8082 if error handling is necessary).
8083 The append mode expects a list of
8085 arguments as shell tokens (see
8086 .Sx "Shell-style argument quoting" ;
8087 token-separating commas are ignored, too), to be
8088 interpreted as documented for the command line option
8090 with the message number exception as below.
8094 arguments the attachment list is edited, entry by entry;
8095 if a filename is left empty, that attachment is deleted from the list;
8096 once the end of the list is reached either new attachments may be
8097 entered or the session can be quit by committing an empty
8100 In non-interactive mode or in batch mode
8102 the list of attachments is effectively not edited but instead recreated;
8103 again, an empty input ends list creation.
8105 For all modes, if a given filename solely consists of the number sign
8107 followed by either a valid message number of the currently active
8108 mailbox, or by a period
8110 referring to the current message of the active mailbox, the so-called
8112 then the given message is attached as a
8115 The number sign must be quoted to avoid misinterpretation as a shell
8119 .It Ic ~| Ar command
8120 Pipe the message text through the specified filter command.
8121 If the command gives no output or terminates abnormally,
8122 retain the original text of the message.
8125 is often used as a rejustifying filter.
8127 If the first character of the command is a vertical bar, then the entire
8128 message including header fields is subject to the filter command, so
8129 .Ql ~|| echo Fcc: /tmp/test; cat
8130 will prepend a file-carbon-copy message header.
8136 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
8137 Low-level compose mode command which shares semantics with
8139 and therefore evaluates its command line as documented in
8140 .Sx "Shell-style argument quoting" .
8141 Does not manage the error number
8145 errors are handled via the protocol, and hard errors like I/O failures
8149 The protocol consists of command lines followed by (a) response line(s).
8150 The first field of the response line represents a status code
8151 which specifies whether a command was successful or not, whether result
8152 data is to be expected, and if, the format of the result data.
8153 Response data will be shell quoted as necessary for consumption by
8160 Error status code lines may optionally contain additional context:
8164 .Bl -tag -compact -width ".It Ql 210"
8166 Status ok; the remains of the line are the result.
8169 Status ok; the rest of the line is optionally used for more status.
8170 What follows are lines of result addresses, terminated by an empty line.
8171 All the input, including the empty line, must be consumed before further
8172 commands can be issued.
8173 Address lines consist of two token, first the plain network address, e.g.,
8175 followed by the (quoted) full address as known:
8176 .Ql '(Lovely) Bob <bob@exam.ple>' .
8177 Non-network addresses use the first field to indicate the type (hyphen-minus
8179 for files, vertical bar
8181 for pipes, and number sign
8183 for names which will undergo
8185 processing) instead, the actual value will be in the second field.
8188 Status ok; the rest of the line is optionally used for more status.
8189 What follows are lines of furtherly unspecified (quoted) string content,
8190 terminated by an empty line.
8191 All the input, including the empty line, must be consumed before further
8192 commands can be issued.
8195 Syntax error; invalid command.
8198 Syntax error in parameters or arguments.
8201 Error: an argument fails verification.
8202 For example an invalid address has been specified (also see
8204 or an attempt was made to modify anything in \*(UA's own namespace,
8205 or a modifying subcommand has been used on a read-only message.
8208 Error: an otherwise valid argument is rendered invalid due to context.
8209 For example, a second address is added to a header which may consist of
8210 a single address only.
8215 If a command indicates failure then the message will have remained
8217 Most commands can fail with
8219 if required arguments are missing, or excessive arguments have been
8220 given (false command usage).
8221 (\*(ID The latter does not yet occur regularly, because as stated in
8222 .Sx "Shell-style argument quoting"
8223 our argument parser is not yet smart enough to work on subcommand base;
8224 for example one might get excess argument error for a three argument
8225 subcommand that receives four arguments, but not for a four argument
8226 subcommand which receives six arguments: here excess will be joined.)
8227 The following (case-insensitive) commands are supported:
8230 .Bl -hang -width ".It Cm version"
8232 This command allows listing, removal and addition of message attachments.
8233 The second argument specifies the subcommand to apply, one of:
8235 .Bl -hang -width ".It Cm remove"
8237 This uses the same search mechanism as described for
8239 and prints any known attributes of the first found attachment via
8243 if no such attachment can be found.
8244 The attributes are written as lines with a keyword and a value token.
8247 This uses the same search mechanism as described for
8249 and is otherwise identical to
8252 .It Cm attribute-set
8253 This uses the same search mechanism as described for
8255 and will set the attribute given as the fourth to the value given as
8256 the fifth token argument.
8257 If the value is an empty token, then the given attribute is removed,
8258 or reset to a default value if existence of the attribute is crucial.
8262 upon success, with the index of the found attachment following,
8264 for message attachments or if the given keyword is invalid, and
8266 if no such attachment can be found.
8267 The following keywords may be used (case-insensitively):
8269 .Bl -hang -compact -width ".It Ql filename"
8271 Sets the filename of the MIME part, i.e., the name that is used for
8272 display and when (suggesting a name for) saving (purposes).
8273 .It Ql content-description
8274 Associate some descriptive information to the attachment's content, used
8275 in favour of the plain filename by some MUAs.
8277 May be used for uniquely identifying MIME entities in several contexts;
8278 this expects a special reference address format as defined in RFC 2045
8281 upon address content verification failure.
8283 Defines the media type/subtype of the part, which is managed
8284 automatically, but can be overwritten.
8285 .It Ql content-disposition
8286 Automatically set to the string
8290 .It Cm attribute-set-at
8291 This uses the same search mechanism as described for
8293 and is otherwise identical to
8297 Adds the attachment given as the third argument, specified exactly as
8298 documented for the command line option
8300 and supporting the message number extension as documented for
8304 upon success, with the index of the new attachment following,
8306 if the given file cannot be opened,
8308 if an on-the-fly performed character set conversion fails, otherwise
8310 is reported; this is also reported if character set conversion is
8311 requested but not available.
8314 List all attachments via
8318 if no attachments exist.
8319 This command is the default command of
8321 if no second argument has been given.
8324 This will remove the attachment given as the third argument, and report
8328 if no such attachment can be found.
8329 If there exists any path component in the given argument, then an exact
8330 match of the path which has been used to create the attachment is used
8331 directly, but if only the basename of that path matches then all
8332 attachments are traversed to find an exact match first, and the removal
8333 occurs afterwards; if multiple basenames match, a
8336 Message attachments are treated as absolute pathnames.
8338 If no path component exists in the given argument, then all attachments
8339 will be searched for
8341 parameter matches as well as for matches of the basename of the path
8342 which has been used when the attachment has been created; multiple
8347 This will interpret the third argument as a number and remove the
8348 attachment at that list position (counting from one!), reporting
8352 if the argument is not a number or
8354 if no such attachment exists.
8359 This command allows listing, inspection, and editing of message headers.
8360 Header name case is not normalized, so that case-insensitive comparison
8361 should be used when matching names.
8362 The second argument specifies the subcommand to apply, one of:
8365 .Bl -hang -width ".It Cm remove"
8367 Create a new or an additional instance of the header given in the third
8368 argument, with the header body content as given in the fourth token.
8371 if the third argument specifies a free-form header field name that is
8372 invalid, or if body content extraction fails to succeed,
8374 if any extracted address does not pass syntax and/or security checks or
8375 on \*(UA namespace violations, and
8377 to indicate prevention of excessing a single-instance header \(em note that
8379 can be appended to (a space separator will be added automatically first).
8386 modifier to enforce treatment as a single addressee, for example
8387 .Ql header insert To?single: 'exa, <m@ple>' ;
8393 is returned upon success, followed by the name of the header and the list
8394 position of the newly inserted instance.
8395 The list position is always 1 for single-instance header fields.
8396 All free-form header fields are managed in a single list; also see
8400 Without a third argument a list of all yet existing headers is given via
8402 this command is the default command of
8404 if no second argument has been given.
8405 A third argument restricts output to the given header only, which may
8408 if no such field is defined.
8411 This will remove all instances of the header given as the third
8416 if no such header can be found, and
8418 on \*(UA namespace violations.
8421 This will remove from the header given as the third argument the
8422 instance at the list position (counting from one!) given with the fourth
8427 if the list position argument is not a number or on \*(UA namespace
8430 if no such header instance exists.
8433 Shows the content of the header given as the third argument.
8434 Dependent on the header type this may respond with
8438 any failure results in
8444 In compose-mode read-only access to optional pseudo headers in the \*(UA
8445 private namespace is available:
8449 .Bl -tag -compact -width ".It Va BaNg"
8450 .It Ql Mailx-Command:
8451 The name of the command that generates the message, one of
8458 This pseudo header always exists (in compose-mode).
8460 .It Ql Mailx-Raw-To:
8461 .It Ql Mailx-Raw-Cc:
8462 .It Ql Mailx-Raw-Bcc:
8463 Represent the frozen initial state of these headers before any
8467 .Va recipients-in-cc
8470 .It Ql Mailx-Orig-Sender:
8471 .It Ql Mailx-Orig-From:
8472 .It Ql Mailx-Orig-To:
8473 .It Ql Mailx-Orig-Cc:
8474 .It Ql Mailx-Orig-Bcc:
8475 The values of said headers of the original message which has been
8477 .Ic reply , forward , resend .
8478 The sender field is special as it is filled in with the sole sender
8479 according to RFC 5322 rules, it may thus be equal to the from field.
8484 Show an abstract of the above commands via
8488 This command will print the protocol version via
8496 .Ql Ic ~i Ns \| Va Sign .
8501 .Ql Ic ~i Ns \| Va sign .
8504 .It Ic ~b Ar name ...
8505 Add the given names to the list of blind carbon copy recipients.
8508 .It Ic ~c Ar name ...
8509 Add the given names to the list of carbon copy recipients.
8513 Read the file specified by the
8515 variable into the message.
8521 on the message collected so far, then return to compose mode.
8523 can be used for a more display oriented editor, and
8525 offers a pipe-based editing approach.
8528 .It Ic ~F Ar messages
8529 Read the named messages into the message being sent, including all
8530 message headers and MIME parts, and honouring
8533 .Va forward-inject-head
8535 .Va forward-inject-tail .
8536 If no messages are specified, read in the current message, the
8540 .It Ic ~f Ar messages
8541 Read the named messages into the message being sent.
8542 If no messages are specified, read in the current message, the
8544 Strips down the list of header fields according to the
8549 white- and blacklist selection of
8554 .Va forward-inject-head
8556 .Va forward-inject-tail .
8557 For MIME multipart messages,
8558 only the first displayable part is included.
8562 In interactive mode, edit the message header fields
8567 by typing each one in turn and allowing the user to edit the field.
8568 The default values for these fields originate from the
8573 In non-interactive mode this sets
8574 .Va ^ERR Ns -NOTTY .
8578 In interactive mode, edit the message header fields
8584 by typing each one in turn and allowing the user to edit the field.
8585 In non-interactive mode this sets
8586 .Va ^ERR Ns -NOTTY .
8589 .It Ic ~I Ar variable
8590 Insert the value of the specified variable into the message.
8591 The message remains unaltered if the variable is unset or empty.
8592 Any embedded character sequences
8594 horizontal tabulator and
8596 line feed are expanded in
8598 mode; otherwise the expansion should occur at
8600 time (\*(ID by using the command modifier
8604 .It Ic ~i Ar variable
8607 but appends a newline character.
8610 .It Ic ~M Ar messages
8611 Read the named messages into the message being sent,
8614 If no messages are specified, read the current message, the
8619 .Va forward-inject-head
8621 .Va forward-inject-tail .
8624 .It Ic ~m Ar messages
8625 Read the named messages into the message being sent,
8628 If no messages are specified, read the current message, the
8630 Strips down the list of header fields according to the
8632 white- and blacklist selection of
8637 .Va forward-inject-head
8639 .Va forward-inject-tail .
8640 For MIME multipart messages,
8641 only the first displayable part is included.
8645 Display the message collected so far,
8646 prefaced by the message header fields
8647 and followed by the attachment list, if any.
8651 Read in the given / current message(s) using the algorithm of
8653 (except that is implicitly assumed, even if not set), honouring
8658 Abort the message being sent,
8659 copying it to the file specified by the
8666 .It Ic ~R Ar filename
8669 but indent each line that has been read by
8673 .It Ic ~r Ar filename Op Ar HERE-delimiter
8674 Read the named file, object to
8675 .Sx "Filename transformations"
8676 excluding shell globs and variable expansions, into the message; if
8680 then standard input is used (for pasting, for example).
8681 Only in this latter mode
8683 may be given: if it is data will be read in until the given
8685 is seen on a line by itself, and encountering EOF is an error; the
8687 is a required argument in non-interactive mode; if it is single-quote
8688 quoted then the pasted content will not be expanded, \*(ID otherwise
8689 a future version of \*(UA may perform shell-style expansion on the content.
8693 Cause the named string to become the current subject field.
8694 Newline (NL) and carriage-return (CR) bytes are invalid and will be
8695 normalized to space (SP) characters.
8698 .It Ic ~t Ar name ...
8699 Add the given name(s) to the direct recipient list.
8702 .It Ic ~U Ar messages
8703 Read in the given / current message(s) excluding all headers, indented by
8708 .Va forward-inject-head
8710 .Va forward-inject-tail .
8713 .It Ic ~u Ar messages
8714 Read in the given / current message(s), excluding all headers.
8718 .Va forward-inject-head
8720 .Va forward-inject-tail .
8726 editor on the message collected so far, then return to compose mode.
8728 can be used for a less display oriented editor, and
8730 offers a pipe-based editing approach.
8733 .It Ic ~w Ar filename
8734 Write the message onto the named file, which is object to the usual
8735 .Sx "Filename transformations" .
8737 the message is appended to it.
8743 except that the message is not saved at all.
8749 .\" .Sh INTERNAL VARIABLES {{{
8750 .Sh "INTERNAL VARIABLES"
8752 Internal \*(UA variables are controlled via the
8756 commands; prefixing a variable name with the string
8760 has the same effect as using
8767 will give more insight on the given variable(s), and
8769 when called without arguments, will show a listing of all variables.
8770 Both commands support a more
8773 Some well-known variables will also become inherited from the
8776 implicitly, others can be imported explicitly with the command
8778 and henceforth share said properties.
8781 Two different kinds of internal variables exist, and both of which can
8783 There are boolean variables, which can only be in one of the two states
8787 and value variables with a(n optional) string value.
8788 For the latter proper quoting is necessary upon assignment time, the
8789 introduction of the section
8791 documents the supported quoting rules.
8793 .Bd -literal -offset indent
8794 ? wysh set one=val\e 1 two="val 2" \e
8795 three='val "3"' four=$'val \e'4\e''; \e
8796 varshow one two three four; \e
8797 unset one two three four
8801 Dependent upon the actual option string values may become interpreted as
8802 colour names, command specifications, normal text, etc.
8803 They may be treated as numbers, in which case decimal values are
8804 expected if so documented, but otherwise any numeric format and
8805 base that is valid and understood by the
8807 command may be used, too.
8810 There also exists a special kind of string value, the
8811 .Dq boolean string ,
8812 which must either be a decimal integer (in which case
8816 and any other value is true) or any of the (case-insensitive) strings
8822 for a false boolean and
8830 a special kind of boolean string is the
8832 it can optionally be prefixed with the (case-insensitive) term
8836 in interactive mode the user will be prompted, otherwise the actual
8840 Variable chains extend a plain
8845 .Ql variable-USER@HOST
8849 will be converted to all lowercase when looked up (but not when the
8850 variable is set or unset!), \*(OPally IDNA converted, and indeed means
8854 had been specified in the contextual Uniform Resource Locator URL, see
8855 .Sx "On URL syntax and credential lookup" .
8856 Even though this mechanism is based on URLs no URL percent encoding may
8857 be applied to neither of
8861 variable chains need to be specified using raw data;
8862 the mentioned section contains examples.
8863 Variables which support chains are explicitly documented as such, and
8864 \*(UA treats the base name of any such variable special, meaning that
8865 users should not create custom names like
8867 in order to avoid false classifications and treatment of such variables.
8869 .\" .Ss "Initial settings" {{{
8870 .\" (Keep in SYNC: mx/nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
8871 .Ss "Initial settings"
8873 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8879 .Pf no Va autoprint ,
8893 .Pf no Va ignoreeof ,
8895 .Pf no Va keepsave ,
8897 .Pf no Va outfolder ,
8905 .Pf no Va sendwait ,
8914 However, \*(UA has built-in some initial (and some default) settings
8915 which (may) diverge, others may become adjusted by one of the
8916 .Sx "Resource files" .
8917 Displaying the former is accomplished via
8919 .Ql $ \*(uA -:/ -v -Xset -Xx .
8920 In general this implementation sets (and has extended the meaning of)
8922 and does not support the
8924 variable \(en use command line options or
8926 to pass options through to a
8928 The default global resource file sets, among others, the variables
8933 establishes a default
8935 selection etc., and should thus be taken into account.
8938 .\" .Ss "Variables" {{{
8941 .Bl -tag -width ".It Va BaNg"
8945 \*(RO The exit status of the last command, or the
8950 This status has a meaning in the state machine: in conjunction with
8952 any non-0 exit status will cause a program exit, and in
8954 mode any error while loading (any of the) resource files will have the
8958 .Sx "Command modifiers" ,
8959 can be used to instruct the state machine to ignore errors.
8963 \*(RO The current error number
8964 .Pf ( Xr errno 3 ) ,
8965 which is set after an error occurred; it is also available via
8967 and the error name and documentation string can be queried via
8971 \*(ID This machinery is new and the error number is only really usable
8972 if a command explicitly states that it manages the variable
8974 for others errno will be used in case of errors, or
8976 if that is 0: it thus may or may not reflect the real error.
8977 The error number may be set with the command
8983 \*(RO This is a multiplexer variable which performs dynamic expansion of
8984 the requested state or condition, of which there are:
8986 .Bl -tag -width ".It Va BaNg"
8990 .It Va ^ERR , ^ERRDOC , ^ERRNAME
8991 The number, documentation, and name of the current
8993 respectively, which is usually set after an error occurred.
8994 The documentation is an \*(OP, the name is used if not available.
8995 \*(ID This machinery is new and is usually reliable only if a command
8996 explicitly states that it manages the variable
8998 which is effectively identical to
9000 Each of those variables can be suffixed with a hyphen minus followed by
9001 a name or number, in which case the expansion refers to the given error.
9002 Note this is a direct mapping of (a subset of) the system error values:
9003 .Bd -literal -offset indent
9005 eval echo \e$1: \e$^ERR-$1:\e
9006 \e$^ERRNAME-$1: \e$^ERRDOC-$1
9007 vput vexpr i + "$1" 1
9017 .It Va ^ERRQUEUE-COUNT , ^ERRQUEUE-EXISTS
9018 The number of messages present in the \*(OPal log queue of
9020 and a boolean which indicates whether the queue is not empty,
9021 respectively; both are always 0 unless
9030 \*(RO Expands all positional parameters (see
9032 separated by the first character of the value of
9034 \*(ID The special semantics of the equally named special parameter of the
9036 are not yet supported.
9040 \*(RO Expands all positional parameters (see
9042 separated by a space character.
9043 If placed in double quotation marks, each positional parameter is
9044 properly quoted to expand to a single parameter again.
9048 \*(RO Expands to the number of positional parameters, i.e., the size of
9049 the positional parameter stack in decimal.
9053 \*(RO Inside the scope of a
9057 ed macro this expands to the name of the calling macro, or to the empty
9058 string if the macro is running from top-level.
9059 For the \*(OPal regular expression search and replace operator of
9061 this expands to the entire matching expression.
9062 It represents the program name in global context.
9066 \*(RO Access of the positional parameter stack.
9067 All further parameters can be accessed with this syntax, too,
9070 etc.; positional parameters can be shifted off the stack by calling
9072 The parameter stack contains, for example, the arguments of a
9076 d macro, the matching groups of the \*(OPal regular expression search
9077 and replace expression of
9079 and can be explicitly created or overwritten with the command
9084 \*(RO Is set to the active
9088 .It Va add-file-recipients
9089 \*(BO When file or pipe recipients have been specified,
9090 mention them in the corresponding address fields of the message instead
9091 of silently stripping them from their recipient list.
9092 By default such addressees are not mentioned.
9096 \*(BO Causes only the local part to be evaluated
9097 when comparing addresses.
9101 \*(BO Causes messages saved in the
9103 .Sx "secondary mailbox"
9105 to be appended to the end rather than prepended.
9106 This should always be set.
9110 \*(BO Causes the prompts for
9114 lists to appear after the message has been edited.
9118 \*(BO If set, \*(UA asks an interactive user for files to attach at the
9119 end of each message; An empty line finalizes the list.
9123 \*(BO Causes the interactive user to be prompted for carbon copy
9124 recipients (at the end of each message if
9132 \*(BO Causes the interactive user to be prompted for blind carbon copy
9133 recipients (at the end of each message if
9141 \*(BO Causes the interactive user to be prompted for confirmation to
9142 send the message or reenter compose mode after having been shown
9143 a preliminary envelope summary.
9147 \*(BO\*(OP Causes the interactive user to be prompted if the message is
9148 to be signed at the end of each message.
9151 variable is ignored when this variable is set.
9155 .\" The alternative *ask* is not documented on purpose
9156 \*(BO Causes \*(UA to prompt the interactive user for the subject upon
9157 entering compose mode unless a subject already exists.
9161 A sequence of characters to display in the
9165 as shown in the display of
9167 each for one type of messages (see
9168 .Sx "Message states" ) ,
9169 with the default being
9172 .Ql NU\ \ *HMFAT+\-$~
9175 variable is set, in the following order:
9177 .Bl -tag -compact -width ".It Ql _"
9199 \*(ID start of a (collapsed) thread in threaded mode (see
9203 \*(ID an uncollapsed thread in threaded mode; only used in conjunction with
9208 classified as possible spam.
9214 Specifies a list of recipients to which a blind carbon copy of each
9215 outgoing message will be sent automatically.
9219 Specifies a list of recipients to which a carbon copy of each outgoing
9220 message will be sent automatically.
9224 \*(BO Causes threads to be collapsed automatically when .Ql thread Ns
9227 mode is entered (see the
9233 \*(BO Enable automatic
9235 ing of a(n existing)
9241 commands: the message that becomes the new
9243 is shown automatically, as via
9250 Causes sorted mode (see the
9252 command) to be entered automatically with the value of this variable as
9253 sorting method when a folder is opened, for example
9254 .Ql set autosort=thread .
9258 \*(BO Enables the substitution of all not (reverse-solidus) escaped
9261 characters by the contents of the last executed command for the
9263 shell escape command and
9265 one of the compose mode
9266 .Sx "COMMAND ESCAPES" .
9267 If this variable is not set no reverse solidus stripping is performed.
9271 \*(OB Predecessor of
9272 .Va bind-inter-byte-timeout .
9273 \*(ID Setting this automatically sets the successor.
9276 .It Va bind-inter-byte-timeout
9277 \*(OP Terminals may generate multi-byte sequences for special function
9278 keys, for example, but these sequences may not become read as a unit.
9279 And multi-byte sequences can be defined freely via
9281 This variable specifies the timeout in milliseconds that the MLE (see
9282 .Sx "On terminal control and line editor" )
9283 waits for more bytes to arrive unless it considers a sequence
9285 The default is 200, the maximum is about 10 seconds.
9286 In the following example the comments state which sequences are
9287 affected by this timeout:
9288 .Bd -literal -offset indent
9289 ? bind base abc echo 0 # abc
9290 ? bind base ab,c echo 1 # ab
9291 ? bind base abc,d echo 2 # abc
9292 ? bind base ac,d echo 3 # ac
9293 ? bind base a,b,c echo 4
9294 ? bind base a,b,c,d echo 5
9295 ? bind base a,b,cc,dd echo 6 # cc and dd
9299 .It Va bind-inter-key-timeout
9302 sequences do not time out by default.
9303 If this variable is set, then the current key sequence is forcefully
9304 terminated once the timeout (in milliseconds) triggers.
9305 The value should be (maybe significantly) larger than
9306 .Va bind-inter-byte-timeout ,
9307 but may not excess the maximum, too.
9311 \*(BO Sets some cosmetical features to traditional BSD style;
9312 has the same affect as setting
9314 and all other variables prefixed with
9316 it also changes the behaviour of
9318 (which does not exist in BSD).
9322 \*(BO Changes the letters shown in the first column of a header
9323 summary to traditional BSD style.
9327 \*(BO Changes the display of columns in a header summary to traditional
9332 \*(BO Changes some informational messages to traditional BSD style.
9338 field to appear immediately after the
9340 field in message headers and with the
9342 .Sx "COMMAND ESCAPES" .
9348 .It Va build-cc , build-ld , build-os , build-rest
9349 \*(RO The build environment, including the compiler, the linker, the
9350 operating system \*(UA has been build for, usually taken from
9354 and then lowercased, as well as all the possibly interesting rest of the
9355 configuration and build environment.
9356 This information is also available in the
9358 output of the command
9363 The value that should appear in the
9367 MIME header fields when no character set conversion of the message data
9369 This defaults to US-ASCII, and the chosen character set should be
9370 US-ASCII compatible.
9374 \*(OP The default 8-bit character set that is used as an implicit last
9375 member of the variable
9377 This defaults to UTF-8 if character set conversion capabilities are
9378 available, and to ISO-8859-1 otherwise (unless the operating system
9379 environment is known to always and exclusively support UTF-8 locales),
9380 in which case the only supported character set is
9382 and this variable is effectively ignored.
9385 .It Va charset-unknown-8bit
9386 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
9388 the content of a mail message by using a character set with the name
9390 Because of the unclassified nature of this character set \*(UA will not
9391 be capable to convert this character set to any other character set.
9392 If this variable is set any message part which uses the character set
9394 is assumed to really be in the character set given in the value,
9395 otherwise the (final) value of
9397 is used for this purpose.
9399 This variable will also be taken into account if a MIME type (see
9400 .Sx "The mime.types files" )
9401 of a MIME message part that uses the
9403 character set is forcefully treated as text.
9407 The default value for the
9412 .It Va colour-disable
9413 \*(BO\*(OP Forcefully disable usage of colours.
9414 Also see the section
9415 .Sx "Coloured display" .
9419 \*(BO\*(OP Whether colour shall be used for output that is paged through
9421 Note that pagers may need special command line options, for example
9429 in order to support colours.
9430 Often doing manual adjustments is unnecessary since \*(UA may perform
9431 adjustments dependent on the value of the environment variable
9433 (see there for more).
9437 .It Va contact-mail , contact-web
9438 \*(RO Addresses for contact per email and web, respectively, for
9439 bug reports, suggestions, or anything else regarding \*(UA.
9440 The former can be used directly:
9441 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
9447 .It Va content-description-forwarded-message , \
9448 content-description-quote-attachment , \
9449 content-description-smime-message , \
9450 content-description-smime-signature
9451 \*(OP(partially) Strings which will be placed in according
9452 .Ql Content-Description:
9453 headers if non-empty.
9454 They all have default values, for example
9455 .Ql Forwarded message .
9459 In a(n interactive) terminal session, then if this valued variable is
9460 set it will be used as a threshold to determine how many lines the given
9461 output has to span before it will be displayed via the configured
9465 can be forced by setting this to the value
9467 setting it without a value will deduce the current height of the
9468 terminal screen to compute the threshold (see
9473 \*(ID At the moment this uses the count of lines of the message in wire
9474 format, which, dependent on the
9476 of the message, is unrelated to the number of display lines.
9477 (The software is old and historically the relation was a given thing.)
9481 Define a set of custom headers to be injected into newly composed or
9483 A custom header consists of the field name followed by a colon
9485 and the field content body.
9486 Standard header field names cannot be overwritten by a custom header,
9487 with the exception of
9491 Different to the command line option
9493 the variable value is interpreted as a comma-separated list of custom
9494 headers: to include commas in header bodies they need to become escaped
9495 with reverse solidus
9497 Headers can be managed more freely in
9502 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2, Hdr2: Body2'
9506 Controls the appearance of the
9508 date and time format specification of the
9510 variable, that is used, for example, when viewing the summary of
9512 If unset, then the local receiving date is used and displayed
9513 unformatted, otherwise the message sending
9515 It is possible to assign a
9517 format string and control formatting, but embedding newlines via the
9519 format is not supported, and will result in display errors.
9521 .Ql %Y-%m-%d %H:%M ,
9523 .Va datefield-markout-older .
9526 .It Va datefield-markout-older
9527 Only used in conjunction with
9529 Can be used to create a visible distinction of messages dated more than
9530 a day in the future, or older than six months, a concept comparable to the
9532 option of the POSIX utility
9534 If set to the empty string, then the plain month, day and year of the
9536 will be displayed, but a
9538 format string to control formatting can be assigned.
9544 \*(BO (Almost) Enter a debug-only sandbox mode which generates many
9545 log messages, disables the actual delivery of messages, and also implies
9553 .It Va disposition-notification-send
9555 .Ql Disposition-Notification-To:
9556 header (RFC 3798) with the message.
9560 .\" TODO .It Va disposition-notification-send-HOST
9562 .\".Va disposition-notification-send
9563 .\" for SMTP accounts on a specific host.
9564 .\" TODO .It Va disposition-notification-send-USER@HOST
9566 .\".Va disposition-notification-send
9567 .\"for a specific account.
9571 \*(BO When dot is set, a period
9573 on a line by itself during message input in (interactive or batch
9576 will be treated as end-of-message (in addition to the
9577 normal end-of-file condition).
9578 This behaviour is implied in
9584 .It Va dotlock-disable
9585 \*(BO\*(OP Disable creation of
9590 .It Va dotlock-ignore-error
9591 \*(OB\*(BO\*(OP Ignore failures when creating
9593 .Sx "dotlock files" .
9600 If this variable is set then the editor is started automatically when
9601 a message is composed in interactive mode.
9602 If the value starts with the letter
9604 then this acts as if
9608 .Pf (see\0 Sx "COMMAND ESCAPES" )
9612 variable is implied for this automatically spawned editor session.
9616 \*(BO When a message is edited while being composed,
9617 its header is included in the editable text.
9621 \*(BO When entering interactive mode \*(UA normally writes
9622 .Dq \&No mail for user
9623 and exits immediately if a mailbox is empty or does not exist.
9624 If this variable is set \*(UA starts even with an empty or non-existent
9625 mailbox (the latter behaviour furtherly depends upon
9631 \*(BO Let each command with a non-0 exit status, including every
9635 s a non-0 status, cause a program exit unless prefixed by
9638 .Sx "Command modifiers" ) .
9640 .Sx "COMMAND ESCAPES" ,
9641 but which use a different modifier for ignoring the error.
9642 Please refer to the variable
9644 for more on this topic.
9648 \*(OP Maximum number of entries in the
9654 The first character of this value defines the escape character for
9655 .Sx "COMMAND ESCAPES"
9657 .Sx "Compose mode" .
9658 The default value is the character tilde
9660 If set to the empty string, command escapes are disabled.
9665 If unset only user name and email address recipients are allowed
9666 .Sx "On sending mail, and non-interactive mode" .
9667 If set without value all possible recipient types will be accepted.
9668 A value is parsed as a comma-separated list of case-insensitive strings,
9669 and if that contains
9671 behaviour equals the former except when in interactive mode or if
9672 .Sx "COMMAND ESCAPES"
9677 in which case it equals the latter, allowing all address types.
9680 .Ql restrict,\:-all,\:+name,\:+addr ,
9681 so care for ordering issues must be taken.
9684 Recipient types can be added and removed with a plus sign
9688 prefix, respectively.
9689 By default invalid or disallowed types are filtered out and
9690 cause a warning, hard send errors need to be enforced by including
9698 header targets regardless of other settings,
9700 file targets (it includes
9703 command pipeline targets,
9705 user names still unexpanded after
9709 processing and thus left for expansion by the
9711 (invalid for the built-in SMTP one), and
9714 Targets are interpreted in the given order, so that
9715 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
9716 will cause hard errors for any non-network address recipient address
9717 unless running interactively or having been started with the option
9721 in the latter case(s) any type may be used.
9724 User name receivers addressing valid local users can be expanded to
9725 fully qualified network addresses (also see
9730 Historically invalid recipients were stripped off without causing
9731 errors, this can be changed by making
9733 an entry of the list (it really acts like
9734 .Ql failinvaddr,\:+addr ) .
9737 .Pf (really\0\: Ql domaincheck,\:+addr )
9738 compares address domain names against a whitelist and strips off
9740 for hard errors) addressees which fail this test; the domain name
9742 and the non-empty value of
9744 (the real hostname otherwise) are always whitelisted,
9745 .Va expandaddr-domaincheck
9746 can be set to extend this list.
9747 Finally some address providers (for example
9749 and all other command line recipients) will be evaluated as
9750 if specified within dollar-single-quotes (see
9751 .Sx "Shell-style argument quoting" )
9752 if the value list contains the string
9757 .It Va expandaddr-domaincheck
9758 Can be set to a comma-separated list of domain names which should be
9759 whitelisted for the evaluation of the
9763 IDNA encoding is not automatically performed,
9765 can be used to prepare the domain (of an address).
9769 Unless this variable is set additional
9771 (Mail-Transfer-Agent)
9772 arguments from the command line, as can be given after a
9774 separator, results in a program termination with failure status.
9775 The same can be accomplished by using the special (case-insensitive) value
9777 A lesser strict variant is the otherwise identical
9779 which does accept such arguments in interactive mode, or if tilde
9780 commands were enabled explicitly by using one of the command line options
9784 The empty value will allow unconditional usage.
9788 \*(RO String giving a list of optional features.
9789 Features are preceded with a plus sign
9791 if they are available, with a hyphen-minus
9794 To ease substring matching the string starts and ends with a comma.
9795 The output of the command
9797 includes this information in a more pleasant output.
9801 \*(BO This setting reverses the meanings of a set of reply commands,
9802 turning the lowercase variants, which by default address all recipients
9803 included in the header of a message
9804 .Pf ( Ic reply , respond , followup )
9805 into the uppercase variants, which by default address the sender only
9806 .Pf ( Ic Reply , Respond , Followup )
9811 The default path under which mailboxes are to be saved:
9812 filenames that begin with the plus sign
9814 will have the plus sign replaced with the value of this variable if set,
9815 otherwise the plus sign will remain unchanged when doing
9816 .Sx "Filename transformations" ;
9819 for more on this topic, and know about standard imposed implications of
9821 The value supports a subset of transformations itself, and if the
9822 non-empty value does not start with a solidus
9826 will be prefixed automatically.
9827 Once the actual value is evaluated first, the internal variable
9829 will be updated for caching purposes.
9832 .It Va folder-hook-FOLDER , Va folder-hook
9835 macro which will be called whenever a
9838 The macro will also be invoked when new mail arrives,
9839 but message lists for commands executed from the macro
9840 only include newly arrived messages then.
9842 are activated by default in a folder hook, causing the covered settings
9843 to be reverted once the folder is left again.
9845 The specialized form will override the generic one if
9847 matches the file that is opened.
9848 Unlike other folder specifications, the fully expanded name of a folder,
9849 without metacharacters, is used to avoid ambiguities.
9850 However, if the mailbox resides under
9854 specification is tried in addition, so that if
9858 (and thus relative to the user's home directory) then
9859 .Pa /home/usr1/mail/sent
9861 .Ql folder-hook-/home/usr1/mail/sent
9862 first, but then followed by
9863 .Ql folder-hook-+sent .
9866 .It Va folder-resolved
9867 \*(RO Set to the fully resolved path of
9869 once that evaluation has occurred; rather internal.
9873 \*(BO Controls whether a
9874 .Ql Mail-Followup-To:
9875 header is generated when sending messages to known mailing lists.
9876 The user as determined via
9878 (or, if that contains multiple addresses,
9880 will be placed in there if any list addressee is not a subscribed list.
9882 .Va followup-to-honour
9884 .Ic mlist , mlsubscribe , reply
9889 .It Va followup-to-add-cc
9890 \*(BO Controls whether the user will be added to the messages'
9892 list in addition to placing an entry in
9893 .Ql Mail-Followup-To:
9898 .It Va followup-to-honour
9900 .Ql Mail-Followup-To:
9901 header is honoured when group-replying to a message via
9908 if set without a value it defaults to
9914 .It Va forward-add-cc
9915 \*(BO Whether senders of messages forwarded via
9916 .Ic ~F , ~f , ~m , ~U
9919 shall be made members of the carbon copies
9924 .It Va forward-as-attachment
9925 \*(BO Original messages are normally sent as inline text with the
9928 and only the first part of a multipart message is included.
9929 With this setting enabled messages are sent as unmodified MIME
9931 attachments with all of their parts included.
9935 .It Va forward-inject-head , forward-inject-tail
9936 The strings to put before and after the text of a message with the
9938 command, respectively.
9939 The former defaults to
9940 .Ql -------- Original Message --------\en .
9941 Special format directives in these strings will be expanded if possible,
9942 and if so configured the output will be folded according to
9944 for more please refer to
9945 .Va quote-inject-head .
9946 Injections will not be performed by
9949 .Va forward-as-attachment
9951 .Sx "COMMAND ESCAPES"
9952 .Ic ~F , ~f , ~M , ~m , ~U , ~u
9958 The address (or a list of addresses) to put into the
9960 field of the message header, quoting RFC 5322:
9961 the author(s) of the message, that is, the mailbox(es) of the person(s)
9962 or system(s) responsible for the writing of the message.
9963 According to that RFC setting the
9965 variable is required if
9967 contains more than one address.
9968 \*(ID Please expect automatic management of the
9973 Dependent on the context these addresses are handled as if they were in
9978 If a file-based MTA is used, then
9980 (or, if that contains multiple addresses,
9982 can nonetheless be used as the envelope sender address at the MTA
9983 protocol level (the RFC 5321 reverse-path), either via the
9985 command line option (without argument; see there for more), or by setting
9986 .Va r-option-implicit .
9989 If the machine's hostname is not valid at the Internet (for example at
9990 a dialup machine), then either this variable or
9994 adds even more fine-tuning capabilities with
9996 have to be set: if so the message and MIME part related unique ID fields
10000 will be created (except when disallowed by
10001 .Va message-id-disable
10008 \*(BO Due to historical reasons comments and name parts of email
10009 addresses are removed by default when sending mail, replying to or
10010 forwarding a message.
10011 If this variable is set such stripping is not performed.
10014 \*(OB Predecessor of
10015 .Va forward-inject-head .
10019 \*(BO Causes the header summary to be written at startup and after
10020 commands that affect the number of messages or the order of messages in
10025 mode a header summary will also be displayed on folder changes.
10026 The command line option
10034 A format string to use for the summary of
10036 Format specifiers in the given string start with a percent sign
10038 and may be followed by an optional decimal number indicating the field
10039 width \(em if that is negative, the field is to be left-aligned.
10040 Names and addresses are subject to modifications according to
10044 Valid format specifiers are:
10047 .Bl -tag -compact -width ".It Ql _%%_"
10049 A plain percent sign.
10052 a space character but for the current message
10054 for which it expands to
10057 .Va headline-plain ) .
10060 a space character but for the current message
10062 for which it expands to
10065 .Va headline-plain ) .
10067 \*(OP The spam score of the message, as has been classified via the
10070 Shows only a replacement character if there is no spam support.
10072 Message attribute character (status flag); the actual content can be
10073 adjusted by setting
10076 The date found in the
10078 header of the message when
10080 is set (the default), otherwise the date when the message was received.
10081 Formatting can be controlled by assigning a
10086 .Va datefield-markout-older ) .
10088 The indenting level in
10094 The address of the message sender.
10096 The message thread tree structure.
10097 (Note that this format does not support a field width, and honours
10098 .Va headline-plain . )
10100 Mailing list status: is the addressee of the message a known
10109 announces the presence of a RFC 2369
10111 header, which makes a message a valuable target of
10114 The number of lines of the message, if available.
10118 The number of octets (bytes) in the message, if available.
10120 Message subject (if any) in double quotes.
10122 Message subject (if any).
10124 The position in threaded/sorted order.
10126 The value 0 except in an IMAP mailbox,
10127 where it expands to the UID of the message.
10131 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
10133 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
10141 .Va headline-bidi .
10145 .It Va headline-bidi
10146 Bidirectional text requires special treatment when displaying headers,
10147 because numbers (in dates or for file sizes etc.) will not affect the
10148 current text direction, in effect resulting in ugly line layouts when
10149 arabic or other right-to-left text is to be displayed.
10150 On the other hand only a minority of terminals is capable to correctly
10151 handle direction changes, so that user interaction is necessary for
10152 acceptable results.
10153 Note that extended host system support is required nonetheless, e.g.,
10154 detection of the terminal character set is one precondition;
10155 and this feature only works in an Unicode (i.e., UTF-8) locale.
10157 In general setting this variable will cause \*(UA to encapsulate text
10158 fields that may occur when displaying
10160 (and some other fields, like dynamic expansions in
10162 with special Unicode control sequences;
10163 it is possible to fine-tune the terminal support level by assigning
10165 no value (or any value other than
10170 will make \*(UA assume that the terminal is capable to properly deal
10171 with Unicode version 6.3, in which case text is embedded in a pair of
10172 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
10174 In addition no space on the line is reserved for these characters.
10176 Weaker support is chosen by using the value
10178 (Unicode 6.3, but reserve the room of two spaces for writing the control
10179 sequences onto the line).
10184 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
10185 again reserves room for two spaces in addition.
10188 .It Va headline-plain
10189 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
10190 used by default for certain entries of
10192 If this variable is set only basic US-ASCII symbols will be used.
10195 .It Va history-file
10196 \*(OP The (expandable) location of a permanent
10198 file for the MLE line editor
10199 .Pf ( Sx "On terminal control and line editor" ) .
10204 .It Va history-gabby
10205 \*(OP Add more entries to the MLE
10207 as is normally done.
10208 A comma-separated list of case-insensitive strings can be used to
10209 fine-tune which gabby entries shall be allowed.
10212 erroneous commands will also be added.
10214 adds all optional entries, and is the fallback chattiness identifier of
10215 .Va on-history-addition .
10218 .It Va history-gabby-persist
10221 entries will not be saved in persistent storage unless this variable is set.
10222 The knowledge of whether a persistent entry was gabby is not lost.
10227 .It Va history-size
10228 \*(OP Setting this variable imposes a limit on the number of concurrent
10231 If set to the value 0 then no further history entries will be added,
10232 and loading and incorporation of the
10234 upon program startup can also be suppressed by doing this.
10235 Runtime changes will not be reflected before the
10237 is saved or loaded (again).
10241 \*(BO This setting controls whether messages are held in the system
10243 and it is set by default.
10247 Used instead of the value obtained from
10251 as the hostname when expanding local addresses, for example in
10254 .Sx "On sending mail, and non-interactive mode" ,
10255 for expansion of addresses that have a valid user-, but no domain
10256 name in angle brackets).
10259 or this variable is set the message and MIME part related unique ID fields
10263 will be created (except when disallowed by
10264 .Va message-id-disable
10267 If the \*(OPal IDNA support is available (see
10269 variable assignment is aborted when a necessary conversion fails.
10271 Setting it to the empty string will cause the normal hostname to be
10272 used, but nonetheless enables creation of said ID fields.
10273 \*(IN in conjunction with the built-in SMTP
10276 also influences the results:
10277 one should produce some test messages with the desired combination of
10285 .It Va idna-disable
10286 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
10287 names according to the rules of IDNA (internationalized domain names
10289 Since the IDNA code assumes that domain names are specified with the
10291 character set, an UTF-8 locale charset is required to represent all
10292 possible international domain names (before conversion, that is).
10296 The input field separator that is used (\*(ID by some functions) to
10297 determine where to split input data.
10299 .Bl -tag -compact -width ".It MMM"
10301 Unsetting is treated as assigning the default value,
10304 If set to the empty value, no field splitting will be performed.
10306 If set to a non-empty value, all whitespace characters are extracted
10307 and assigned to the variable
10311 .Bl -tag -compact -width ".It MMM"
10314 will be ignored at the beginning and end of input.
10315 Diverging from POSIX shells default whitespace is removed in addition,
10316 which is owed to the entirely different line content extraction rules.
10318 Each occurrence of a character of
10320 will cause field-splitting, any adjacent
10322 characters will be skipped.
10327 \*(RO Automatically deduced from the whitespace characters in
10332 \*(BO Ignore interrupt signals from the terminal while entering
10333 messages; instead echo them as
10335 characters and discard the current line.
10339 \*(BO Ignore end-of-file conditions
10340 .Pf ( Ql control-D )
10343 on message input and in interactive command input.
10344 If set an interactive command input session can only be left by
10345 explicitly using one of the commands
10349 and message input in compose mode can only be terminated by entering
10352 on a line by itself or by using the
10354 .Sx "COMMAND ESCAPES" ;
10355 Setting this implies the behaviour that
10363 If this is set to a non-empty string it will specify the user's
10365 .Sx "primary system mailbox" ,
10368 and the system-dependent default, and (thus) be used to replace
10371 .Sx "Filename transformations" ;
10374 for more on this topic.
10375 The value supports a subset of transformations itself.
10377 .It Va indentprefix
10382 .Sx "COMMAND ESCAPES"
10385 option for indenting messages,
10386 in place of the POSIX mandated default tabulator character
10393 \*(BO If set, an empty
10395 .Sx "primary system mailbox"
10396 file is not removed.
10397 Note that, in conjunction with
10399 mode any empty file will be removed unless this variable is set.
10400 This may improve the interoperability with other mail user agents
10401 when using a common folder directory, and prevents malicious users
10402 from creating fake mailboxes in a world-writable spool directory.
10403 \*(ID Only local regular (MBOX) files are covered, Maildir and other
10404 mailbox types will never be removed, even if empty.
10407 .It Va keep-content-length
10408 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
10409 be told to keep the
10410 .Ql Content-Length:
10413 header fields that some MUAs generate by setting this variable.
10414 Since \*(UA does neither use nor update these non-standardized header
10415 fields (which in itself shows one of their conceptual problems),
10416 stripping them should increase interoperability in between MUAs that
10417 work with with same mailbox files.
10418 Note that, if this is not set but
10419 .Va writebackedited ,
10420 as below, is, a possibly performed automatic stripping of these header
10421 fields already marks the message as being modified.
10422 \*(ID At some future time \*(UA will be capable to rewrite and apply an
10424 to modified messages, and then those fields will be stripped silently.
10428 \*(BO When a message is saved it is usually discarded from the
10429 originating folder when \*(UA is quit.
10430 This setting causes all saved message to be retained.
10433 .It Va line-editor-cpl-word-breaks
10434 \*(OP List of bytes which are used by the
10436 tabulator completion to decide where word boundaries exist, by default
10438 \*(ID This mechanism is yet restricted.
10441 .It Va line-editor-disable
10442 \*(BO Turn off any line editing capabilities (from \*(UAs POW, see
10443 .Sx "On terminal control and line editor"
10447 .It Va line-editor-no-defaults
10448 \*(BO\*(OP Do not establish any default key binding.
10452 Error log message prefix string
10453 .Pf ( Ql "\*(uA: " ) .
10456 .It Va mailbox-display
10457 \*(RO The name of the current mailbox
10458 .Pf ( Ic folder ) ,
10459 possibly abbreviated for display purposes.
10462 .It Va mailbox-resolved
10463 \*(RO The fully resolved path of the current mailbox.
10466 .It Va mailcap-disable
10467 \*(BO\*(OP Turn off consideration of MIME type handlers from,
10468 and implicit loading of
10469 .Sx "The Mailcap files" .
10472 .It Va mailx-extra-rc
10473 An additional startup file that is loaded as the last of the
10474 .Sx "Resource files" .
10475 Use this file for commands that are not understood by other POSIX
10477 implementations, i.e., mostly anything which is not covered by
10478 .Sx "Initial settings" .
10481 .It Va markanswered
10482 \*(BO When a message is replied to and this variable is set,
10483 it is marked as having been
10486 .Sx "Message states" .
10489 .It Va mbox-fcc-and-pcc
10490 \*(BO By default all file and pipe message receivers (see
10492 will be fed valid MBOX database entry message data (see
10494 .Va mbox-rfc4155 ) ,
10495 and existing file targets will become extended in compliance to RFC 4155.
10496 If this variable is unset then a plain standalone RFC 5322 message will
10497 be written, and existing file targets will be overwritten.
10500 .It Va mbox-rfc4155
10501 \*(BO When opening MBOX mailbox databases, and in order to achieve
10502 compatibility with old software, the very tolerant POSIX standard rules
10503 for detecting message boundaries (so-called
10505 lines) are used instead of the stricter rules from the standard RFC 4155.
10506 This behaviour can be switched by setting this variable.
10508 This may temporarily be handy when \*(UA complains about invalid
10510 lines when opening a MBOX: in this case setting this variable and
10511 re-opening the mailbox in question may correct the result.
10512 If so, copying the entire mailbox to some other file, as in
10513 .Ql copy * SOME-FILE ,
10514 will perform proper, all-compatible
10516 quoting for all detected messages, resulting in a valid MBOX mailbox.
10517 (\*(ID The better and non-destructive approach is to re-encode invalid
10518 messages, as if it would be created anew, instead of mangling the
10520 lines; this requires the structural code changes of the v15 rewrite.)
10521 Finally the variable can be unset again:
10522 .Bd -literal -offset indent
10524 localopts yes; wysh set mbox-rfc4155;\e
10525 wysh File "${1}"; copy * "${2}"
10527 call mboxfix /tmp/bad.mbox /tmp/good.mbox
10532 \*(BO Internal development variable.
10533 (Keeps memory debug enabled even if
10538 .It Va message-id-disable
10539 \*(BO By setting this variable the generation of
10543 message and MIME part headers can be completely suppressed, effectively
10544 leaving this task up to the
10546 (Mail-Transfer-Agent) or the SMTP server.
10547 Note that according to RFC 5321 a SMTP server is not required to add this
10548 field by itself, so it should be ensured that it accepts messages without
10552 .It Va message-inject-head
10553 A string to put at the beginning of each new message, followed by a newline.
10554 \*(OB The escape sequences tabulator
10558 are understood (use the
10562 ting the variable(s) instead).
10565 .It Va message-inject-tail
10566 A string to put at the end of each new message, followed by a newline.
10567 \*(OB The escape sequences tabulator
10571 are understood (use the
10575 ting the variable(s) instead).
10577 .Va on-compose-leave .
10581 \*(BO Usually, when an
10583 expansion contains the sender, the sender is removed from the expansion.
10584 Setting this option suppresses these removals.
10589 option to be passed through to the
10591 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
10592 this flag, no MTA is known which does not support it (for historical
10596 .It Va mime-allow-text-controls
10597 \*(BO When sending messages, each part of the message is MIME-inspected
10598 in order to classify the
10601 .Ql Content-Transfer-Encoding:
10603 .Va mime-encoding )
10604 that is required to send this part over mail transport, i.e.,
10605 a computation rather similar to what the
10607 command produces when used with the
10611 This classification however treats text files which are encoded in
10612 UTF-16 (seen for HTML files) and similar character sets as binary
10613 octet-streams, forcefully changing any
10618 .Ql application/octet-stream :
10619 If that actually happens a yet unset charset MIME parameter is set to
10621 effectively making it impossible for the receiving MUA to automatically
10622 interpret the contents of the part.
10624 If this variable is set, and the data was unambiguously identified as
10625 text data at first glance (by a
10629 file extension), then the original
10631 will not be overwritten.
10634 .It Va mime-alternative-favour-rich
10635 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
10636 HTML) will be preferred in favour of included plain text versions when
10637 displaying messages, provided that a handler exists which produces
10638 output that can be (re)integrated into \*(UA's normal visual display.
10641 .It Va mime-counter-evidence
10644 field is used to decide how to handle MIME parts.
10645 Some MUAs, however, do not use
10646 .Sx "The mime.types files"
10648 .Sx "HTML mail and MIME attachments" )
10649 or a similar mechanism to correctly classify content, but specify an
10650 unspecific MIME type
10651 .Pf ( Ql application/octet-stream )
10652 even for plain text attachments.
10653 If this variable is set then \*(UA will try to re-classify such MIME
10654 message parts, if possible, for example via a possibly existing
10655 attachment filename.
10656 A non-empty value may also be given, in which case a number is expected,
10657 actually a carrier of bits, best specified as a binary value, like
10660 .Bl -bullet -compact
10662 If bit two is set (counting from 1, decimal 2) then the detected
10664 will be carried along with the message and be used for deciding which
10665 MIME handler is to be used, for example;
10666 when displaying such a MIME part the part-info will indicate the
10667 overridden content-type by showing a plus sign
10670 If bit three is set (decimal 4) then the counter-evidence is always
10671 produced and a positive result will be used as the MIME type, even
10672 forcefully overriding the parts given MIME type.
10674 If bit four is set (decimal 8) as a last resort the actual content of
10675 .Ql application/octet-stream
10676 parts will be inspected, so that data which looks like plain text can be
10678 This mode is even more relaxed when data is to be displayed to the user
10679 or used as a message quote (data consumers which mangle data for display
10680 purposes, which includes masking of control characters, for example).
10685 .It Va mime-encoding
10687 .Ql Content-Transfer-Encoding
10688 to use in outgoing text messages and message parts, where applicable
10689 (7-bit clean text messages are without an encoding if possible):
10692 .Bl -tag -compact -width ".It Ql _%%_"
10694 .Pf (Or\0 Ql 8b . )
10695 8-bit transport effectively causes the raw data be passed through
10696 unchanged, but may cause problems when transferring mail messages over
10697 channels that are not ESMTP (RFC 1869) compliant.
10698 Also, several input data constructs are not allowed by the
10699 specifications and may cause a different transfer-encoding to be used.
10700 By established rules and popular demand occurrences of
10704 will be MBOXO quoted (prefixed with greater-than sign
10706 instead of causing a non-destructive encoding like
10707 .Ql quoted-printable
10708 to be chosen, unless context (like message signing) requires otherwise.
10710 .It Ql quoted-printable
10711 .Pf (Or\0 Ql qp . )
10712 Quoted-printable encoding is 7-bit clean and has the property that ASCII
10713 characters are passed through unchanged, so that an english message can
10714 be read as-is; it is also acceptable for other single-byte locales that
10715 share many characters with ASCII, for example ISO-8859-1.
10716 The encoding will cause a large overhead for messages in other character
10717 sets: for example it will require up to twelve (12) bytes to encode
10718 a single UTF-8 character of four (4) bytes.
10719 It is the default encoding.
10722 .Pf (Or\0 Ql b64 . )
10723 This encoding is 7-bit clean and will always be used for binary data.
10724 This encoding has a constant input:output ratio of 3:4, regardless of
10725 the character set of the input data it will encode three bytes of input
10726 to four bytes of output.
10727 This transfer-encoding is not human readable without performing
10733 .It Va mime-force-sendout
10734 \*(BO\*(OP Whenever it is not acceptable to fail sending out messages
10735 because of non-convertible character content this variable may be set.
10736 It will, as a last resort, classify the part content as
10737 .Ql application/octet-stream .
10738 Please refer to the section
10739 .Sx "Character sets"
10740 for the complete picture of character set conversion in \*(UA.
10743 .It Va mimetypes-load-control
10744 Can be used to control which of
10745 .Sx "The mime.types files"
10746 are loaded: if the letter
10748 is part of the option value, then the user's personal
10750 file will be loaded (if it exists); likewise the letter
10752 controls loading of the system wide
10754 directives found in the user file take precedence, letter matching is
10756 If this variable is not set \*(UA will try to load both files.
10757 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
10758 but they will be matched last (the order can be listed via
10761 More sources can be specified by using a different syntax: if the
10762 value string contains an equals sign
10764 then it is instead parsed as a comma-separated list of the described
10767 pairs; the given filenames will be expanded and loaded, and their
10768 content may use the extended syntax that is described in the section
10769 .Sx "The mime.types files" .
10770 Directives found in such files always take precedence (are prepended to
10771 the MIME type cache).
10776 Select an alternate Mail-Transfer-Agent by either specifying the full
10777 pathname of an executable (a
10779 prefix may be given), or \*(OPally a SMTP aka SUBMISSION protocol URL \*(IN:
10781 .Dl submissions://[user[:password]@]server[:port]
10784 .Ql [smtp://]server[:port] . )
10785 The default has been chosen at compile time.
10786 MTA data transfers are always performed in asynchronous child processes,
10787 and without supervision unless either the
10794 \*(OPally expansion of
10796 can be performed by setting
10800 For testing purposes there is the
10802 pseudo-MTA, which dumps to standard output or optionally to a file,
10804 .Va mbox-fcc-and-pcc :
10806 .Bd -literal -offset indent
10807 $ echo text | \*(uA -:/ -Smta=test -s ubject ex@am.ple
10808 $ </dev/null \*(uA -:/ -Smta=test://./xy ex@am.ple
10812 For a file-based MTA it may be necessary to set
10814 in in order to choose the right target of a modern
10817 It will be passed command line arguments from several possible sources:
10820 if set, from the command line if given and the variable
10823 Argument processing of the MTA will be terminated with a
10828 The otherwise occurring implicit usage of the following MTA command
10829 line arguments can be disabled by setting the boolean variable
10830 .Va mta-no-default-arguments
10831 (which will also disable passing
10835 (for not treating a line with only a dot
10837 character as the end of input),
10839 (shall the variable
10845 variable is set); in conjunction with the
10847 command line option or
10848 .Va r-option-implicit
10850 as well as possibly
10852 will (not) be passed.
10855 \*(OPally \*(UA can send mail over SMTP aka SUBMISSION network
10856 connections to a single defined smart host by setting this variable to
10857 a SMTP or SUBMISSION URL (see
10858 .Sx "On URL syntax and credential lookup" ) .
10859 An authentication scheme can be specified via the variable chain
10861 Encrypted network connections are \*(OPally available, the section
10862 .Sx "Encrypted network communication"
10863 should give an overview and provide links to more information on this.
10864 Note that with some mail providers it may be necessary to set the
10866 variable in order to use a specific combination of
10871 Network communication socket timeouts are configurable via
10872 .Va socket-connect-timeout .
10873 All generated network traffic may be proxied over a SOCKS
10875 it can be logged by setting
10878 The following SMTP variants may be used:
10882 The plain SMTP protocol (RFC 5321) that normally lives on the
10883 server port 25 and requires setting the
10884 .Va smtp-use-starttls
10885 variable to enter a TLS encrypted session state.
10886 Assign a value like \*(IN
10887 .Ql smtp://[user[:password]@]server[:port]
10889 .Ql smtp://server[:port] )
10890 to choose this protocol.
10892 The so-called SMTPS which is supposed to live on server port 465
10893 and is automatically TLS secured.
10894 Unfortunately it never became a standardized protocol and may thus not
10895 be supported by your hosts network service database
10896 \(en in fact the port number has already been reassigned to other
10899 SMTPS is nonetheless a commonly offered protocol and thus can be
10900 chosen by assigning a value like \*(IN
10901 .Ql smtps://[user[:password]@]server[:port]
10903 .Ql smtps://server[:port] ) ;
10904 due to the mentioned problems it is usually necessary to explicitly
10905 specify the port as
10909 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
10910 is identically to the SMTP protocol from \*(UA's point of view;
10911 it requires setting
10912 .Va smtp-use-starttls
10913 to enter a TLS secured session state; e.g., \*(IN
10914 .Ql submission://[user[:password]@]server[:port] .
10916 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
10917 TLS secured by default.
10918 It can be chosen by assigning a value like \*(IN
10919 .Ql submissions://[user[:password]@]server[:port] .
10920 Due to the problems mentioned for SMTPS above and the fact that
10921 SUBMISSIONS is new and a successor that lives on the same port as the
10922 historical engineering mismanagement named SMTPS, it is usually
10923 necessary to explicitly specify the port as
10930 \*(OP If set to a path pointing to a text file in valid MTA (Postfix)
10932 format, the file is loaded and cached (manageable with
10934 and henceforth plain
10938 message receiver names are recursively expanded as a last expansion
10939 step, after the distribution lists which can be created with
10943 content support: only local addresses (names) which are valid usernames
10944 .Pf ( Ql [a-z_][a-z0-9_-]*[$]? )
10945 are treated as expandable aliases, and \*(ID
10946 .Ql :include:/file/name
10947 directives are not supported.
10952 it can be asserted that only expanded names (mail addresses) are passed
10953 through to the MTA.
10956 .It Va mta-arguments
10957 Arguments to pass through to a file-based
10959 (Mail-Transfer-Agent), parsed according to
10960 .Sx "Shell-style argument quoting"
10961 into an array of arguments which will be joined onto MTA options
10962 from other sources, for example
10963 .Ql \&? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
10966 .It Va mta-no-default-arguments
10967 \*(BO Avoids passing standard command line options to a file-based
10969 (please see there).
10972 .It Va mta-no-receiver-arguments
10973 \*(BO By default all receiver addresses will be passed as command line
10974 options to a file-based
10976 Setting this variable disables this behaviour to aid those MTAs which
10977 employ special treatment of such arguments.
10978 Doing so can make it necessary to pass a
10981 .Va mta-arguments ,
10982 to testify the MTA that it should use the passed message as a template.
10986 Many systems use a so-called
10988 environment to ensure compatibility with
10990 This works by inspecting the name that was used to invoke the mail
10992 If this variable is set then the mailwrapper (the program that is
10993 actually executed when calling the file-based
10995 will treat its contents as that name.
10999 \*(BO In violation of RFC 5322 some MTAs do not remove
11001 header lines from transported messages after having noted the respective
11002 receivers for addressing purposes.
11003 (The MTAs Exim and Courier for example require the command line option
11005 to enforce removal.)
11006 Unless this is set corresponding receivers are addressed by
11007 protocol-specific means or MTA command line options only, the header
11008 itself is stripped before being sent over the wire.
11010 .Mx Va netrc-lookup
11011 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
11012 \*(BO\*(IN\*(OP Used to control usage of the user's
11014 file for lookup of account credentials, as documented in the section
11015 .Sx "On URL syntax and credential lookup"
11016 and for the command
11019 .Sx "The .netrc file"
11020 documents the file format.
11032 then \*(UA will read the output of a shell pipe instead of the user's
11034 file if this variable is set (to the desired shell command).
11035 This can be used to, for example, store
11038 .Ql \&? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
11042 \*(OP If this variable has the value
11044 newly created local folders will be in Maildir instead of MBOX format.
11048 Checks for new mail in the current folder each time the prompt is shown.
11049 A Maildir folder must be re-scanned to determine if new mail has arrived.
11050 If this variable is set to the special value
11052 then a Maildir folder will not be rescanned completely, but only
11053 timestamp changes are detected.
11054 Maildir folders are \*(OPal.
11058 \*(BO Causes a non-absolute filename specified in
11060 as well as the sender-based filenames of the
11066 commands to be interpreted relative to the
11068 directory rather than relative to the current directory.
11070 .Mx Va on-account-cleanup
11071 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
11072 Macro hook which will be called once an
11074 is left, as the very last step before unrolling per-account
11076 This hook is run even in case of fatal errors, including those generated
11077 by switching to the account as such, and it is advisable to perform only
11078 absolutely necessary actions, like cleaning up
11081 The specialized form is used in favour of the generic one if found.
11084 .It Va on-compose-cleanup
11085 Macro hook which will be called after the message has been sent (or not,
11086 in case of failures), as the very last step before unrolling compose mode
11088 This hook is run even in case of fatal errors, and it is advisable to
11089 perform only absolutely necessary actions, like cleaning up
11093 For compose mode hooks that may affect the message content please see
11094 .Va on-compose-enter , on-compose-leave , on-compose-splice .
11095 \*(ID This hook exists because
11096 .Ic alias , alternates , commandalias , shortcut ,
11097 to name a few, are neither covered by
11101 changes applied in compose mode will continue to be in effect thereafter.
11106 .It Va on-compose-enter , on-compose-leave
11107 Macro hooks which will be called once compose mode is entered,
11108 and after composing has been finished, respectively;
11109 the exact order of the steps taken is documented for
11112 .Sx "COMMAND ESCAPES" .
11113 Context about the message being worked on can be queried via
11116 are enabled for these hooks, and changes on variables will be forgotten
11117 after the message has been sent.
11118 .Va on-compose-cleanup
11119 can be used to perform other necessary cleanup steps.
11122 Here is an example that injects a signature via
11123 .Va message-inject-tail ;
11125 .Va on-compose-splice
11126 to simply inject the file of desire via
11130 may be a better approach.
11132 .Bd -literal -offset indent
11134 vput ! i cat ~/.mysig
11136 vput csop message-inject-tail trim-end $i
11140 readctl create ~/.mysig
11144 vput csop message-inject-tail trim-end $i
11146 readctl remove ~/.mysig
11149 set on-compose-leave=t_ocl
11155 .It Va on-compose-splice , on-compose-splice-shell
11156 These hooks run once the normal compose mode is finished, but before the
11157 .Va on-compose-leave
11158 macro hook is called etc.
11159 Both hooks will be executed in a subprocess, with their input and output
11160 connected to \*(UA such that they can act as if they would be an
11162 The difference in between them is that the latter is a
11164 command, whereas the former is a normal
11166 d macro, but which is restricted to a small set of commands (the
11168 output of for example
11170 will indicate said capability).
11172 are enabled for these hooks (in the parent process), causing any setting
11173 to be forgotten after the message has been sent;
11174 .Va on-compose-cleanup
11175 can be used to perform other cleanup as necessary.
11178 During execution of these hooks \*(UA will temporarily forget whether it
11179 has been started in interactive mode, (a restricted set of)
11180 .Sx "COMMAND ESCAPES"
11181 will always be available, and for guaranteed reproducibilities sake
11185 will be set to their defaults.
11186 The compose mode command
11188 has been especially designed for scriptability (via these hooks).
11189 The first line the hook will read on its standard input is the protocol
11190 version of said command escape, currently
11192 backward incompatible protocol changes have to be expected.
11195 Care must be taken to avoid deadlocks and other false control flow:
11196 if both involved processes wait for more input to happen at the
11197 same time, or one does not expect more input but the other is stuck
11198 waiting for consumption of its output, etc.
11199 There is no automatic synchronization of the hook: it will not be
11200 stopped automatically just because it, e.g., emits
11202 The hooks will however receive a termination signal if the parent enters
11203 an error condition.
11204 \*(ID Protection against and interaction with signals is not yet given;
11205 it is likely that in the future these scripts will be placed in an
11206 isolated session, which is signalled in its entirety as necessary.
11208 .Bd -literal -offset indent
11209 define ocs_signature {
11211 echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
11213 set on-compose-splice=ocs_signature
11215 wysh set on-compose-splice-shell=$'\e
11217 printf "hello $version! Headers: ";\e
11218 echo \e'~^header list\e';\e
11219 read status result;\e
11220 echo "status=$status result=$result";\e
11225 echo Splice protocol version is $version
11226 echo '~^h l'; read hl; vput csop es subs "${hl}" 0 1
11228 echoerr 'Cannot read header list'; echo '~x'; xit
11230 if "$hl" !%?case ' cc'
11231 echo '~^h i cc "Diet is your <mirr.or>"'; read es;\e
11232 vput csop es substring "${es}" 0 1
11234 echoerr 'Cannot insert Cc: header'; echo '~x'
11235 # (no xit, macro finishes anyway)
11239 set on-compose-splice=ocsm
11244 .It Va on-history-addition
11245 This hook will be called if an entry is about to be added to the
11247 of the MLE, as documented in
11248 .Sx "On terminal control and line editor" .
11249 It will be called with three arguments: the first is the name of the
11252 the second is either an empty string or the matching
11254 type, and the third being the complete command line to be added.
11255 The entry will not be added to history if the hook uses a non-0
11257 \*(ID A future version will give the expanded command name as the third
11258 argument, followed by the tokenized command line as parsed in the
11259 remaining arguments, the first of which is the original unexpanded
11260 command name; i.e., one may do
11261 .Ql Ic shift Ns \| 4
11262 and will then be able to access the positional parameters as usual via
11267 .It Va on-main-loop-tick
11268 This hook will be called whenever the program's main event loop is
11269 about to read the next input line.
11270 Note variable and other changes it performs are not scoped as via
11274 .It Va on-program-exit
11275 This hook will be called when the program exits, whether via
11279 or because the send mode is done.
11281 this runs late and so terminal settings etc. are already teared down.
11284 .It Va on-resend-cleanup
11286 .Va on-compose-cleanup ,
11287 but is only triggered by
11291 .It Va on-resend-enter
11293 .Va on-compose-enter ,
11294 but is only triggered by
11296 currently there is no
11298 support, for example.
11302 \*(BO If set, each message feed through the command given for
11304 is followed by a formfeed character
11308 .It Va password-USER@HOST , password-HOST , password
11309 \*(IN Variable chain that sets a password, which is used in case none has
11310 been given in the protocol and account-specific URL;
11311 as a last resort \*(UA will ask for a password on the user's terminal if
11312 the authentication method requires a password.
11313 Specifying passwords in a startup file is generally a security risk;
11314 the file should be readable by the invoking user only.
11316 .It Va password-USER@HOST
11317 \*(OU (see the chain above for \*(IN)
11318 Set the password for
11322 If no such variable is defined for a host,
11323 the user will be asked for a password on standard input.
11324 Specifying passwords in a startup file is generally a security risk;
11325 the file should be readable by the invoking user only.
11329 \*(BO Send messages to the
11331 command without performing MIME and character set conversions.
11335 .It Va pipe-TYPE/SUBTYPE
11336 When a MIME message part of type
11338 (case-insensitive) is displayed or quoted,
11339 its text is filtered through the value of this variable interpreted as
11341 Note that only parts which can be displayed inline as plain text (see
11342 .Cd copiousoutput )
11343 are displayed unless otherwise noted, other MIME parts will only be
11344 considered by and for the command
11348 The special value question mark
11350 forces interpretation of the message part as plain text, for example
11351 .Ql set pipe-application/xml=?
11352 will henceforth display XML
11354 (The same could also be achieved by adding a MIME type marker with the
11357 And \*(OPally MIME type handlers may be defined via
11358 .Sx "The Mailcap files"
11359 \(em these directives,
11361 has already been used, should be referred to for further documentation.
11366 can in fact be used as a trigger character to adjust usage and behaviour
11367 of a following shell command specification more thoroughly by appending
11368 more special characters which refer to further mailcap directives, for
11369 example the following hypothetical command specification could be used:
11371 .Bd -literal -offset indent
11372 ? set pipe-X/Y='?!++=? vim ${MAILX_FILENAME_TEMPORARY}'
11376 .Bl -tag -compact -width ".It Ql __"
11378 The command produces plain text to be integrated in \*(UAs output:
11379 .Cd copiousoutput .
11382 If set the handler will not be invoked when a message is to be quoted,
11383 but only when it will be displayed:
11384 .Cd x-mailx-noquote .
11387 Run the command asynchronously, i.e., without blocking \*(UA:
11388 .Cd x-mailx-async .
11389 The standard output of the command will go to
11393 The command must be run on an interactive terminal, \*(UA will
11394 temporarily release the terminal to it:
11395 .Cd needsterminal .
11398 Request creation of a zero-sized temporary file, the absolute pathname
11399 of which will be made accessible via the environment variable
11400 .Ev MAILX_FILENAME_TEMPORARY :
11401 .Cd x-mailx-tmpfile .
11402 If given twice then the file will be unlinked automatically by \*(UA
11403 when the command loop is entered again at latest:
11404 .Cd x-mailx-tmpfile-unlink ;
11405 it is an error to use automatic deletion in conjunction with
11406 .Cd x-mailx-async .
11409 Normally the MIME part content is passed to the handler via standard
11410 input; if this flag is set then the data will instead be written into
11411 .Ev MAILX_FILENAME_TEMPORARY
11412 .Pf ( Cd x-mailx-tmpfile-fill ) ,
11413 the creation of which is implied; in order to cause automatic deletion
11414 of the temporary file two plus signs
11416 still have to be used.
11419 To avoid ambiguities with normal shell command content another
11420 question mark can be used to forcefully terminate interpretation of
11421 remaining characters.
11422 (Any character not in this list will have the same effect.)
11426 Some information about the MIME part to be displayed is embedded into
11427 the environment of the shell command:
11430 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
11432 .It Ev MAILX_CONTENT
11433 The MIME content-type of the part, if known, the empty string otherwise.
11436 .It Ev MAILX_CONTENT_EVIDENCE
11438 .Va mime-counter-evidence
11439 includes the carry-around-bit (2), then this will be set to the detected
11440 MIME content-type; not only then identical to
11441 .Ev \&\&MAILX_CONTENT
11445 .It Ev MAILX_EXTERNAL_BODY_URL
11447 .Ql message/external-body access-type=url
11448 will store the access URL in this variable, it is empty otherwise.
11449 URL targets should not be activated automatically, without supervision.
11452 .It Ev MAILX_FILENAME
11453 The filename, if any is set, the empty string otherwise.
11456 .It Ev MAILX_FILENAME_GENERATED
11460 .It Ev MAILX_FILENAME_TEMPORARY
11461 If temporary file creation has been requested through the command prefix
11462 this variable will be set and contain the absolute pathname of the
11468 .It Va pipe-EXTENSION
11469 This is identical to
11470 .Va pipe-TYPE/SUBTYPE
11473 (normalized to lowercase using character mappings of the ASCII charset)
11474 names a file extension, for example
11476 Handlers registered using this method take precedence.
11479 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
11480 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
11481 Supported are the default
11488 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
11493 for TLS secured connections which pass a client certificate via
11494 .Va tls-config-pairs .
11495 There may be the \*(OPal method \*(IN
11498 does not need any user credentials,
11504 the remains also require a
11507 solely builds upon the credentials passed via a client certificate,
11508 and is usually the way to go since tested servers do not actually follow
11509 RFC 4422, and fail if additional credentials are actually passed.
11514 method will \*(OPally be replaced with APOP if possible (see there).
11516 .Mx Va pop3-bulk-load
11517 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
11518 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
11519 the messages, and only requests the message bodies on user request.
11520 For the POP3 protocol this means that the message headers will be
11522 If this variable is set then \*(UA will download only complete messages
11523 from the given POP3 server(s) instead.
11525 .Mx Va pop3-keepalive
11526 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
11527 \*(OP POP3 servers close the connection after a period of inactivity;
11528 the standard requires this to be at least 10 minutes,
11529 but practical experience may vary.
11530 Setting this variable to a numeric value greater than
11534 command to be sent each value seconds if no other operation is performed.
11536 .Mx Va pop3-no-apop
11537 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
11538 \*(BO\*(OP Unless this variable is set the MD5 based
11540 authentication method will be used instead of a chosen
11543 when connecting to a POP3 server that advertises support.
11546 is that only a single packet is sent for the user/password tuple.
11547 (Originally also that the password is not sent in clear text over the
11548 wire, but for one MD5 does not any longer offer sufficient security,
11549 and then today transport is almost ever TLS secured.)
11551 .Va pop3-no-apop-HOST
11554 .Mx Va pop3-use-starttls
11555 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
11556 \*(BO\*(OP Causes \*(UA to issue a
11558 command to make an unencrypted POP3 session TLS encrypted.
11559 This functionality is not supported by all servers,
11560 and is not used if the session is already encrypted by the POP3S method.
11562 .Va pop3-use-starttls-HOST
11568 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
11569 where that deviates from standardized behaviour.
11570 It is automatically squared with the environment variable
11571 .Ev POSIXLY_CORRECT ,
11572 changing the one will adjust the other.
11573 The following behaviour is covered and enforced by this mechanism:
11576 .Bl -bullet -compact
11578 In non-interactive mode, any error encountered while loading resource
11579 files during program startup will cause a program exit, whereas in
11580 interactive mode such errors will stop loading of the currently loaded
11581 (stack of) file(s, i.e., recursively).
11582 These exits can be circumvented on a per-command base by using
11585 .Sx "Command modifiers" ,
11586 for each command which shall be allowed to fail.
11590 will replace the list of alternate addresses instead of appending to it.
11591 In addition alternates will only be honoured for any sort of message
11596 The variable inserting
11597 .Sx "COMMAND ESCAPES"
11603 will expand embedded character sequences
11605 horizontal tabulator and
11608 \*(ID For compatibility reasons this step will always be performed.
11611 Reading in messages via
11613 .Pf ( Sx "COMMAND ESCAPES" )
11622 Upon changing the active
11626 will be displayed even if
11633 implies the behaviour described by
11639 is extended to cover any empty mailbox, not only empty
11641 .Sx "primary system mailbox" Ns
11642 es: they will be removed when they are left in empty state otherwise.
11647 .It Va print-alternatives
11648 \*(BO When a MIME message part of type
11649 .Ql multipart/alternative
11650 is displayed and it contains a subpart of type
11652 other parts are normally discarded.
11653 Setting this variable causes all subparts to be displayed,
11654 just as if the surrounding part was of type
11655 .Ql multipart/mixed .
11659 The string used as a prompt in interactive mode.
11660 Whenever the variable is evaluated the value is treated as if specified
11661 within dollar-single-quotes (see
11662 .Sx "Shell-style argument quoting" ) .
11663 This (post-assignment, i.e., second) expansion can be used to embed
11664 status information, for example
11669 .Va mailbox-display .
11671 In order to embed characters which should not be counted when
11672 calculating the visual width of the resulting string, enclose the
11673 characters of interest in a pair of reverse solidus escaped brackets:
11675 a slot for coloured prompts is also available with the \*(OPal command
11677 Prompting may be prevented by setting this to the null string
11679 .Ql set noprompt ) .
11683 This string is used for secondary prompts, but is otherwise identical to
11690 \*(BO Suppresses the printing of the version when first invoked.
11694 If set messages processed by variants of
11698 will start with the original message, lines of which prefixed by
11700 taking into account
11704 No headers will be quoted when set without value or for
11711 selection will be included in the quote,
11713 embeds the (body) contents of all MIME parts, and
11715 also includes all headers.
11716 The quoted message will be enclosed by the expansions of
11717 .Va quote-inject-head
11719 .Va quote-inject-tail .
11722 .Va quote-as-attachment
11726 .Sx "COMMAND ESCAPES" .
11729 .It Va quote-add-cc
11730 \*(BO Whether senders of messages quoted via
11732 shall be made members of the carbon copies
11737 .It Va quote-as-attachment
11738 \*(BO Add the original message in its entirety as a
11740 MIME attachment when replying to a message.
11741 Note this works regardless of the setting of
11746 Can be set to a string consisting of non-whitespace ASCII characters
11747 which shall be treated as quotation leaders, the default being
11752 \*(OP Can be set in addition to
11754 and creates a more fancy quotation in that leading quotation characters
11755 .Pf ( Va quote-chars )
11756 are compressed and overlong lines are folded.
11758 can be set to either one, two or three (space separated) numeric values,
11759 which are interpreted as the maximum (goal) and the minimum line length,
11760 respectively, in a spirit rather equal to the
11762 program, but line- instead of paragraph-based.
11763 The third value is used as the maximum line length instead of the first
11764 if no better break point can be found; it is ignored unless it is larger
11765 than the minimum and smaller than the maximum.
11766 If not set explicitly the minimum will reflect the goal algorithmically.
11767 The goal cannot be smaller than the length of
11769 plus some additional pad; necessary adjustments take place silently.
11774 .It Va quote-inject-head , quote-inject-tail
11775 The strings to put before and after the text of a
11777 d message, if non-empty, and respectively.
11778 The former defaults to
11779 .Ql %f wrote:\en\en .
11780 Special format directives will be expanded if possible, and if so
11781 configured the output will be folded according to
11783 Format specifiers in the given strings start with a percent sign
11785 and expand values of the original message, unless noted otherwise.
11786 Note that names and addresses are not subject to the setting of
11788 Valid format specifiers are:
11791 .Bl -tag -compact -width ".It Ql _%%_"
11793 A plain percent sign.
11795 The address(es) of the sender(s).
11797 The date found in the
11799 header of the message when
11801 is set (the default), otherwise the date when the message was received.
11802 Formatting can be controlled by assigning a
11807 .Va datefield-markout-older ) .
11809 The full name(s) (name and address, as given) of the sender(s).
11814 The real name(s) of the sender(s) if there is one and
11816 allows usage, the address(es) otherwise.
11818 The senders real name(s) if there is one, the address(es) otherwise.
11823 .It Va r-option-implicit
11824 \*(BO Setting this option evaluates the contents of
11826 (or, if that contains multiple addresses,
11828 and passes the results onto the used (file-based) MTA as described for the
11830 option (empty argument case).
11833 .It Va recipients-in-cc
11840 as well as addressees which possibly came in via
11843 .Ql Mail-Followup-To:
11844 are by default merged into the new
11846 If this variable is set a sensitive algorithm tries to place in
11848 only the sender of the message being replied to, others are placed in
11853 Unless this variable is defined, no copies of outgoing mail will be saved.
11854 If defined it gives the pathname, subject to the usual
11855 .Sx "Filename transformations" ,
11856 of a folder where all new, replied-to or forwarded messages are saved:
11857 when saving to this folder fails the message is not sent, but instead
11861 The standard defines that relative (fully expanded) paths are to be
11862 interpreted relative to the current directory
11864 to force interpretation relative to
11867 needs to be set in addition.
11870 .It Va record-files
11871 \*(BO If this variable is set the meaning of
11873 will be extended to cover messages which target only file and pipe
11876 These address types will not appear in recipient lists unless
11877 .Va add-file-recipients
11881 .It Va record-resent
11882 \*(BO If this variable is set the meaning of
11884 will be extended to also cover the
11891 .It Va reply-in-same-charset
11892 \*(BO If this variable is set \*(UA first tries to use the same
11893 character set of the original message for replies.
11894 If this fails, the mechanism described in
11895 .Sx "Character sets"
11896 is evaluated as usual.
11899 .It Va reply-strings
11900 Can be set to a comma-separated list of (case-insensitive according to
11901 ASCII rules) strings which shall be recognized in addition to the
11902 built-in strings as
11904 reply message indicators \(en built-in are
11906 which is mandated by RFC 5322, as well as the german
11911 which often has been seen in the wild;
11912 I.e., the separating colon has to be specified explicitly.
11916 A list of addresses to put into the
11918 field of the message header.
11919 Members of this list are handled as if they were in the
11928 .It Va reply-to-honour
11931 header is honoured when replying to a message via
11938 if set without a value it defaults to
11942 .It Va reply-to-swap-in
11943 Standards like DKIM and (in conjunction with) DMARC caused many
11944 .Sx "Mailing lists"
11945 to use sender address rewriting in the style of
11946 .Ql Name via List <list@address> ,
11947 where the original sender address often being placed in
11949 If this is set and a
11951 exists, and consists of only one addressee (!), then that is used in
11952 place of the pretended sender.
11953 This works independently from
11954 .Va reply-to-honour .
11955 The optional value, a comma-separated list of strings, offers more
11956 fine-grained control on when swapping shall be used; for now supported is
11958 here swapping occurs if the sender is a mailing-list as defined by
11962 .It Va rfc822-body-from_
11963 \*(BO This variable can be used to force displaying a so-called
11965 line for messages that are embedded into an envelope mail via the
11967 MIME mechanism, for more visual convenience, also see
11972 \*(BO Enable saving of (partial) messages in
11974 upon interrupt or delivery error.
11978 The number of lines that represents a
11987 line display and scrolling via
11989 If this variable is not set \*(UA falls back to a calculation based upon
11990 the detected terminal window size and the baud rate: the faster the
11991 terminal, the more will be shown.
11992 Overall screen dimensions and pager usage is influenced by the
11993 environment variables
12001 .It Va searchheaders
12002 \*(BO Expand message list specifiers in the form
12004 to all messages containing the substring
12006 in the header field
12008 The string search is case insensitive.
12011 .It Va sendcharsets
12012 \*(OP A comma-separated list of character set names that can be used in
12013 outgoing internet mail.
12014 The value of the variable
12016 is automatically appended to this list of character sets.
12017 If no character set conversion capabilities are compiled into \*(UA then
12018 the only supported charset is
12021 .Va sendcharsets-else-ttycharset
12022 and refer to the section
12023 .Sx "Character sets"
12024 for the complete picture of character set conversion in \*(UA.
12027 .It Va sendcharsets-else-ttycharset
12028 \*(BO\*(OP If this variable is set, but
12030 is not, then \*(UA acts as if
12032 had been set to the value of the variable
12034 In effect this combination passes through the message data in the
12035 character set of the current locale encoding:
12036 therefore mail message text will be (assumed to be) in ISO-8859-1
12037 encoding when send from within a ISO-8859-1 locale, and in UTF-8
12038 encoding when send from within an UTF-8 locale.
12042 never comes into play as
12044 is implicitly assumed to be 8-bit and capable to represent all files the
12045 user may specify (as is the case when no character set conversion
12046 support is available in \*(UA and the only supported character set is
12049 .Sx "Character sets" ) .
12050 This might be a problem for scripts which use the suggested
12052 setting, since in this case the character set is US-ASCII by definition,
12053 so that it is better to also override
12055 then; and/or do something like the following in the resource file:
12056 .Bd -literal -offset indent
12057 # Avoid ASCII "propagates to 8-bit" when scripting
12058 \eif ! t && "$LC_ALL" != C && "$LC_CTYPE" != C
12059 \eset sendcharsets-else-ttycharset
12065 An address that is put into the
12067 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
12068 responsible for the actual transmission of the message.
12069 This field should normally not be used unless the
12071 field contains more than one address, on which case it is required.
12072 \*(ID Please expect automatic management of the
12077 Dependent on the context this address is handled as if it were in
12082 .Va r-option-implicit .
12085 \*(OB Predecessor of
12088 .It Va sendmail-arguments
12089 \*(OB Predecessor of
12090 .Va mta-arguments .
12092 .It Va sendmail-no-default-arguments
12093 \*(OB\*(BO Predecessor of
12094 .Va mta-no-default-arguments .
12096 .It Va sendmail-progname
12097 \*(OB Predecessor of
12102 Sending messages to the chosen
12104 or to command-pipe receivers (see
12105 .Sx "On sending mail, and non-interactive mode" )
12106 will be performed asynchronously.
12107 This means that only startup errors of the respective program will be
12108 recognizable, but no delivery errors.
12109 Also, no guarantees can be made as to when the respective program will
12110 actually run, as well as to when they will have produced output.
12112 If this variable is set then child program exit is waited for, and its
12113 exit status code is used to decide about success.
12114 Remarks: in conflict with the POSIX standard this variable is built-in
12115 to be initially set.
12116 Another difference is that it can have a value, which is interpreted as
12117 a comma-separated list of case-insensitive strings naming specific
12118 subsystems for which synchronousness shall be ensured (only).
12119 Possible values are
12125 for command-pipe receivers.
12129 \*(BO This setting causes \*(UA to start at the last message
12130 instead of the first one when opening a mail folder, as well as with
12137 \*(BO Causes \*(UA to use the sender's real name instead of the plain
12138 address in the header field summary and in message specifications.
12142 \*(BO Causes the recipient of the message to be shown in the header
12143 summary if the message was sent by the user.
12150 .Sx "COMMAND ESCAPES" .
12152 .Va message-inject-tail ,
12153 .Va on-compose-leave
12155 .Va on-compose-splice .
12162 .Sx "COMMAND ESCAPES" .
12164 .Va message-inject-tail ,
12165 .Va on-compose-leave
12167 .Va on-compose-splice .
12172 .Va on-compose-splice
12174 .Va on-compose-splice-shell
12176 .Va on-compose-leave
12178 .Va message-inject-tail
12182 .It Va skipemptybody
12183 \*(BO If an outgoing message has an empty first or only message part, do
12184 not send, but discard it, successfully (also see the command line option
12189 .It Va smime-ca-dir , smime-ca-file
12190 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
12191 Enhanced Mail) for the purpose of verification of S/MIME signed messages.
12193 documents the necessary preparation steps to use the former.
12194 The set of CA certificates which are built into the TLS library can
12195 be explicitly turned off by setting
12196 .Va smime-ca-no-defaults ,
12197 and further fine-tuning is possible via
12198 .Va smime-ca-flags .
12201 .It Va smime-ca-flags
12202 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
12203 storage, and the certificate verification that is used.
12204 The actual values and their meanings are documented for
12208 .It Va smime-ca-no-defaults
12209 \*(BO\*(OP Do not load the default CA locations that are built into the
12210 used to TLS library to verify S/MIME signed messages.
12212 .Mx Va smime-cipher
12213 .It Va smime-cipher-USER@HOST , smime-cipher
12214 \*(OP Specifies the cipher to use when generating S/MIME encrypted
12215 messages (for the specified account).
12216 RFC 5751 mandates a default of
12219 Possible values are (case-insensitive and) in decreasing cipher strength:
12227 (DES EDE3 CBC, 168 bits; default if
12229 is not available) and
12231 (DES CBC, 56 bits).
12233 The actually available cipher algorithms depend on the cryptographic
12234 library that \*(UA uses.
12235 \*(OP Support for more cipher algorithms may be available through
12236 dynamic loading via
12237 .Xr EVP_get_cipherbyname 3
12238 (OpenSSL) if \*(UA has been compiled to support this.
12241 .It Va smime-crl-dir
12242 \*(OP Specifies a directory that contains files with CRLs in PEM format
12243 to use when verifying S/MIME messages.
12246 .It Va smime-crl-file
12247 \*(OP Specifies a file that contains a CRL in PEM format to use when
12248 verifying S/MIME messages.
12251 .It Va smime-encrypt-USER@HOST
12252 \*(OP If this variable is set, messages send to the given receiver are
12253 encrypted before sending.
12254 The value of the variable must be set to the name of a file that
12255 contains a certificate in PEM format.
12257 If a message is sent to multiple recipients,
12258 each of them for whom a corresponding variable is set will receive an
12259 individually encrypted message;
12260 other recipients will continue to receive the message in plain text
12262 .Va smime-force-encryption
12264 It is recommended to sign encrypted messages, i.e., to also set the
12267 .Va content-description-smime-message
12268 will be inspected for messages which become encrypted.
12271 .It Va smime-force-encryption
12272 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
12276 \*(BO\*(OP S/MIME sign outgoing messages with the user's
12278 private key and include the users certificate as a MIME attachment.
12279 Signing a message enables a recipient to verify that the sender used
12280 a valid certificate,
12281 that the email addresses in the certificate match those in the message
12282 header and that the message content has not been altered.
12283 It does not change the message text,
12284 and people will be able to read the message as usual.
12285 .Va content-description-smime-signature
12288 .Va smime-sign-cert , smime-sign-include-certs
12290 .Va smime-sign-digest .
12292 .Mx Va smime-sign-cert
12293 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
12294 \*(OP Points to a file in PEM format.
12295 For the purpose of signing and decryption this file needs to contain the
12296 user's private key, followed by his certificate.
12298 For message signing
12300 is always derived from the value of
12302 (or, if that contains multiple addresses,
12304 For the purpose of encryption the recipients public encryption key
12305 (certificate) is expected; the command
12307 can be used to save certificates of signed messages (the section
12308 .Sx "Signed and encrypted messages with S/MIME"
12309 gives some details).
12310 This mode of operation is usually driven by the specialized form.
12312 When decrypting messages the account is derived from the recipient
12317 of the message, which are searched for addresses for which such
12319 \*(UA always uses the first address that matches,
12320 so if the same message is sent to more than one of the user addresses
12321 using different encryption keys, decryption might fail.
12323 Password-encrypted keys may be used for signing and decryption.
12324 Automated password lookup is possible via the
12326 .Ql USER@HOST.smime-cert-key
12327 for the private key, and
12328 .Ql USER@HOST.smime-cert-cert
12329 for the certificate stored in the same file.
12330 For example, the hypothetical address
12332 could be driven with a private key / certificate pair path defined in
12333 .Va \&\&smime-sign-cert-bob@exam.ple ,
12334 and the needed passwords would then be looked up as
12335 .Ql bob@exam.ple.smime-cert-key
12337 .Ql bob@exam.ple.smime-cert-cert .
12338 When decrypting the value of
12340 will be tried as a fallback to provide the necessary
12342 To include intermediate certificates, use
12343 .Va smime-sign-include-certs .
12344 The possible password sources are documented in
12345 .Sx "On URL syntax and credential lookup" .
12347 .Mx Va smime-sign-digest
12348 .It Va smime-sign-digest-USER@HOST , smime-sign-digest
12349 \*(OP Specifies the message digest to use when signing S/MIME messages.
12350 Please remember that for this use case
12352 refers to the variable
12354 (or, if that contains multiple addresses,
12356 The available algorithms depend on the used cryptographic library, but
12357 at least one usable built-in algorithm is ensured as a default.
12358 If possible the standard RFC 5751 will be violated by using
12360 instead of the mandated
12362 due to security concerns.
12363 This variable is ignored for very old (released before 2010)
12364 cryptographic libraries which do not offer the necessary interface:
12365 it will be logged if that happened.
12367 \*(UA will try to add built-in support for the following message
12368 digests, names are case-insensitive:
12375 as well as the widely available
12380 and the proposed insecure
12384 More digests may \*(OPally be available through dynamic loading via the
12386 .Xr EVP_get_digestbyname 3 .
12388 .Mx Va smime-sign-include-certs
12389 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
12390 \*(OP If used, this is supposed to a consist of a comma-separated list
12391 of files, each of which containing a single certificate in PEM format to
12392 be included in the S/MIME message in addition to the
12393 .Va smime-sign-cert
12395 This can be used to include intermediate certificates of the certificate
12396 authority, in order to allow the receiver's S/MIME implementation to
12397 perform a verification of the entire certificate chain, starting from
12398 a local root certificate, over the intermediate certificates, down to the
12399 .Va smime-sign-cert .
12400 Even though top level certificates may also be included in the chain,
12401 they will not be used for the verification on the receiver's side.
12403 For the purpose of the mechanisms involved here,
12405 refers to the content of the internal variable
12407 (or, if that contains multiple addresses,
12410 .Ql USER@HOST.smime-include-certs
12411 will be used for performing password lookups for these certificates,
12412 shall they have been given one, therefore the lookup can be automated
12413 via the mechanisms described in
12414 .Sx "On URL syntax and credential lookup" .
12416 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
12417 \*(OB\*(OP Predecessor(s) of
12418 .Va smime-sign-digest .
12421 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
12423 \*(ID For compatibility reasons a set
12425 is used in preference of
12429 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
12430 \*(OP Variable chain that controls the SMTP
12432 authentication method, possible values are
12443 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" )
12448 for TLS secured connections which pass a client certificate via
12449 .Va tls-config-pairs .
12450 There may be the \*(OPal methods
12457 do not need any user credentials,
12461 require a user name, and all other methods require a
12466 solely builds upon the credentials passed via a client certificate,
12467 and is usually the way to go since tested servers do not actually follow
12468 RFC 4422 aka RFC 4954, and fail if additional credentials are passed.
12475 .Va smtp-auth-password
12477 .Va smtp-auth-user .
12479 .Va smtp-auth-USER@HOST :
12480 may override dependent on sender address in the variable
12483 .It Va smtp-auth-password
12484 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
12485 If the authentication method requires a password, but neither
12486 .Va smtp-auth-password
12488 .Va smtp-auth-password-USER@HOST
12490 \*(UA will ask for a password on the user's terminal.
12492 .It Va smtp-auth-password-USER@HOST
12494 .Va smtp-auth-password
12495 for specific values of sender addresses, dependent upon the variable
12498 .It Va smtp-auth-user
12499 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
12500 If the authentication method requires a user name, but neither
12503 .Va smtp-auth-user-USER@HOST
12505 \*(UA will ask for a user name on the user's terminal.
12507 .It Va smtp-auth-user-USER@HOST
12510 for specific values of sender addresses, dependent upon the variable
12514 .It Va smtp-hostname
12515 \*(OP\*(IN Normally \*(UA uses the variable
12517 to derive the necessary
12519 information in order to issue a
12526 can be used to use the
12528 from the SMTP account
12536 if the empty string is given, or the local hostname as a last resort).
12537 This often allows using an address that is itself valid but hosted by
12538 a provider other than from which (in
12540 the message is sent.
12541 Setting this variable also influences generated
12546 If the \*(OPal IDNA support is available (see
12548 variable assignment is aborted when a necessary conversion fails.
12550 .Mx Va smtp-use-starttls
12551 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
12552 \*(BO\*(OP Causes \*(UA to issue a
12554 command to make an SMTP
12556 session TLS encrypted, i.e., to enable transport layer security.
12559 .It Va socket-connect-timeout
12560 \*(OP A positive number that defines the timeout to wait for
12561 establishing a socket connection before forcing
12562 .Va ^ERR Ns -TIMEDOUT .
12565 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
12566 \*(OP If set to the URL of a SOCKS5 server then all network activities
12567 are proxied through it, except for the single DNS name lookup necessary
12568 to resolve the proxy URL (unnecessary when given an already resolved IP
12570 It is automatically squared with the environment variable
12572 changing the one will adjust the other.
12573 This example creates a local SOCKS5 proxy on port 10000 that forwards to
12578 and from which actual network traffic happens:
12579 .Bd -literal -offset indent
12580 $ ssh -D 10000 USER@HOST
12581 $ \*(uA -Ssocks-proxy=[socks5://]localhost:10000
12582 # or =localhost:10000; no local DNS: =127.0.0.1:10000
12586 .It Va spam-interface
12587 \*(OP In order to use any of the spam-related commands (like
12589 the desired spam interface must be defined by setting this variable.
12590 Please refer to the manual section
12591 .Sx "Handling spam"
12592 for the complete picture of spam handling in \*(UA.
12593 All or none of the following interfaces may be available:
12595 .Bl -tag -width ".It Ql _ilte_"
12601 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
12603 Different to the generic filter interface \*(UA will automatically add
12604 the correct arguments for a given command and has the necessary
12605 knowledge to parse the program's output.
12606 A default value for
12608 will have been compiled into the \*(UA binary if
12612 during compilation.
12613 Shall it be necessary to define a specific connection type (rather than
12614 using a configuration file for that), the variable
12615 .Va spamc-arguments
12616 can be used as in for example
12617 .Ql -d server.example.com -p 783 .
12618 It is also possible to specify a per-user configuration via
12620 Note that this interface does not inspect the
12622 flag of a message for the command
12626 generic spam filter support via freely configurable hooks.
12627 This interface is meant for programs like
12629 and requires according behaviour in respect to the hooks' exit
12630 status for at least the command
12633 meaning a message is spam,
12637 for unsure and any other return value indicating a hard error);
12638 since the hooks can include shell code snippets diverting behaviour
12639 can be intercepted as necessary.
12641 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
12644 .Va spamfilter-spam ;
12646 .Sx "Handling spam"
12647 contains examples for some programs.
12648 The process environment of the hooks will have the variable
12649 .Ev MAILX_FILENAME_GENERATED
12651 Note that spam score support for
12653 is not supported unless the \*(OPtional regular expression support is
12655 .Va spamfilter-rate-scanscore
12661 .It Va spam-maxsize
12662 \*(OP Messages that exceed this size will not be passed through to the
12664 .Va spam-interface .
12665 If unset or 0, the default of 420000 bytes is used.
12668 .It Va spamc-command
12669 \*(OP The path to the
12673 .Va spam-interface .
12674 Note that the path is not expanded, but used
12676 A fallback path will have been compiled into the \*(UA binary if the
12677 executable had been found during compilation.
12680 .It Va spamc-arguments
12681 \*(OP Even though \*(UA deals with most arguments for the
12684 automatically, it may at least sometimes be desirable to specify
12685 connection-related ones via this variable, for example
12686 .Ql -d server.example.com -p 783 .
12690 \*(OP Specify a username for per-user configuration files for the
12692 .Va spam-interface .
12693 If this is set to the empty string then \*(UA will use the name of the
12702 .It Va spamfilter-ham , spamfilter-noham , \
12703 spamfilter-nospam , spamfilter-rate , spamfilter-spam
12704 \*(OP Command and argument hooks for the
12706 .Va spam-interface .
12708 .Sx "Handling spam"
12709 contains examples for some programs.
12712 .It Va spamfilter-rate-scanscore
12713 \*(OP Because of the generic nature of the
12716 spam scores are not supported for it by default, but if the \*(OPnal
12717 regular expression support is available then setting this variable can
12718 be used to overcome this restriction.
12719 It is interpreted as follows: first a number (digits) is parsed that
12720 must be followed by a semicolon
12722 and an extended regular expression.
12723 Then the latter is used to parse the first output line of the
12724 .Va spamfilter-rate
12725 hook, and, in case the evaluation is successful, the group that has been
12726 specified via the number is interpreted as a floating point scan score.
12728 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
12729 ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
12730 \*(OB\*(OP Predecessors of
12734 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
12735 \*(OB\*(OP Predecessor of
12738 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
12740 \*(OB\*(BO\*(OP Predecessor of
12741 .Va tls-ca-no-defaults .
12743 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
12744 \*(OB\*(OP Please use the
12747 .Va tls-config-pairs .
12749 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
12750 \*(OB\*(OP Please use the
12753 .Va tls-config-pairs .
12755 .It Va ssl-config-file
12756 \*(OB\*(OP Predecessor of
12757 .Va tls-config-file .
12759 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
12761 \*(OB\*(OP Predecessor of
12762 .Va tls-config-module .
12764 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
12765 \*(OB\*(OP Predecessor of
12766 .Va tls-config-pairs .
12768 .It Va ssl-crl-dir , ssl-crl-file
12769 \*(OB\*(OP Predecessors of
12773 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
12774 \*(OB\*(OP Please use the
12777 .Va tls-config-pairs .
12779 .It Va ssl-features
12780 \*(OB\*(OP\*(RO Predecessor of
12783 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
12784 \*(OB\*(OP Please use the
12787 .Va tls-config-pairs .
12789 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
12790 \*(OB\*(OP Please use the
12793 .Va tls-config-pairs .
12795 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
12796 \*(OB\*(OP Please use the
12799 .Va tls-config-pairs .
12801 .It Va ssl-rand-file
12802 \*(OB\*(OP Predecessor of
12803 .Va tls-rand-file .
12805 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
12806 \*(OB\*(OP Predecessor of
12811 If only set without an assigned value, then this setting inhibits the
12817 header fields that include obvious references to \*(UA.
12818 There are two pitfalls associated with this:
12819 First, the message id of outgoing messages is not known anymore.
12820 Second, an expert may still use the remaining information in the header
12821 to track down the originating mail user agent.
12822 If set to the value
12828 suppression does not occur.
12831 .It Va system-mailrc
12832 \*(RO The compiled in path of the system wide initialization file
12834 .Sx "Resource files" :
12840 (\*(OP) This specifies a comma-separated list of
12845 .Sx "On terminal control and line editor" ,
12846 escape commas with reverse solidus
12848 to be used to overwrite or define entries.
12850 this variable will only be queried once at program startup and can
12851 thus only be specified in resource files or on the command line.
12852 It will always be inspected, regardless of whether
12854 denotes termcap/terminfo library support via
12858 String capabilities form
12860 pairs and are expected unless noted otherwise.
12861 Numerics have to be notated as
12863 where the number is expected in normal decimal notation.
12864 Finally, booleans do not have any value but indicate a true or false
12865 state simply by being defined or not; this indeed means that \*(UA
12866 does not support undefining an existing boolean.
12867 String capability values will undergo some expansions before use:
12868 for one notations like
12871 .Ql control-LETTER ,
12872 and for clarification purposes
12874 can be used to specify
12876 (the control notation
12878 could lead to misreadings when a left bracket follows, which it does for
12879 the standard CSI sequence);
12880 finally three letter octal sequences, as in
12883 To specify that a terminal supports 256-colours, and to define sequences
12884 that home the cursor and produce an audible bell, one might write:
12886 .Bd -literal -offset indent
12887 ? set termcap='Co#256,home=\eE[H,bel=^G'
12891 The following terminal capabilities are or may be meaningful for the
12892 operation of the built-in line editor or \*(UA in general:
12895 .Bl -tag -compact -width ".It Cd yay"
12897 .Cd auto_right_margin :
12898 boolean which indicates if the right margin needs special treatment; the
12900 capability is related, for more see
12902 This capability is only used when backed by library support.
12904 .It Cd clear Ns \0or Cd cl
12906 clear the screen and home cursor.
12907 (Will be simulated via
12913 .It Cd colors Ns \0or Cd Co
12915 numeric capability specifying the maximum number of colours.
12916 Note that \*(UA does not actually care about the terminal beside that,
12917 but always emits ANSI / ISO 6429 escape sequences; also see
12921 .Cd carriage_return :
12922 move to the first column in the current row.
12923 The default built-in fallback is
12926 .It Cd cub1 Ns \0or Cd le
12928 move the cursor left one space (non-destructively).
12929 The default built-in fallback is
12932 .It Cd cuf1 Ns \0or Cd nd
12934 move the cursor right one space (non-destructively).
12935 The default built-in fallback is
12937 which is used by most terminals.
12943 .It Cd ed Ns \0or Cd cd
12948 .It Cd el Ns \0or Cd ce
12950 clear to the end of line.
12951 (Will be simulated via
12953 plus repetitions of space characters.)
12955 .It Cd home Ns \0or Cd ho
12959 .It Cd hpa Ns \0or Cd ch
12960 .Cd column_address :
12961 move the cursor (to the given column parameter) in the current row.
12962 (Will be simulated via
12967 .\" mx_HAVE_TERMCAP
12968 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
12971 .Cd enter_ca_mode ,
12972 respectively: exit and enter the alternative screen ca-mode,
12973 effectively turning \*(UA into a fullscreen application.
12974 This must be enabled explicitly by setting
12975 .Va termcap-ca-mode .
12977 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
12981 respectively: enable and disable the keypad.
12982 This is always enabled if available, because it seems even keyboards
12983 without keypads generate other key codes for, e.g., cursor keys in that
12984 case, and only if enabled we see the codes that we are interested in.
12986 .It Cd xenl Ns \0or Cd xn
12987 .Cd eat_newline_glitch :
12988 boolean which indicates whether a newline written in the last column of an
12989 .Cd auto_right_margin
12990 indicating terminal is ignored.
12991 With it the full terminal width is available even on autowrap terminals.
12992 This will be inspected even without
12998 Many more capabilities which describe key-sequences are documented for
13003 .It Va termcap-ca-mode
13004 \*(OP Allow usage of the
13009 abilities in order to enter an alternative exclusive screen, the
13010 so-called ca-mode; this usually requires special configuration of the
13012 also dependent on the value of
13015 this variable will only be queried once at program startup and can
13016 thus only be specified in resource files or on the command line.
13019 .It Va termcap-disable
13020 \*(OP Disable any interaction with a terminal control library.
13021 If set only some generic fallback built-ins and possibly the content of
13023 describe the terminal to \*(UA.
13025 this variable will only be queried once at program startup and can
13026 thus only be specified in resource files or on the command line.
13030 .It Va tls-ca-dir-USER@HOST , tls-ca-dir-HOST , tls-ca-dir ,\
13031 tls-ca-file-USER@HOST , tls-ca-file-HOST , tls-ca-file
13032 \*(OP Directory and file, respectively, for pools of trusted CA
13033 certificates in PEM (Privacy Enhanced Mail) format, for the purpose of
13034 verification of TLS server certificates.
13035 Concurrent use is possible, the file is loaded once needed first, the
13036 directory lookup is performed anew as a last resort whenever necessary.
13037 The CA certificate pool built into the TLS library can be disabled via
13038 .Va tls-ca-no-defaults ,
13039 further fine-tuning is possible via
13041 The directory search requires special filename conventions, please see
13042 .Xr SSL_CTX_load_verify_locations 3
13049 .Mx Va tls-ca-flags
13050 .It Va tls-ca-flags-USER@HOST , tls-ca-flags-HOST , tls-ca-flags
13051 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
13052 storage, and the certificate verification that is used (also see
13054 The value is expected to consist of a comma-separated list of
13055 configuration directives, with any intervening whitespace being ignored.
13056 The directives directly map to flags that can be passed to
13057 .Xr X509_STORE_set_flags 3 ,
13058 which are usually defined in a file
13059 .Pa openssl/x509_vfy.h ,
13060 and the availability of which depends on the used TLS library
13061 version: a directive without mapping is ignored (error log subject to
13063 Directives currently understood (case-insensitively) include:
13066 .Bl -tag -compact -width ".It Cd BaNg"
13067 .It Cd no-alt-chains
13068 If the initial chain is not trusted, do not attempt to build an
13070 Setting this flag will make OpenSSL certificate verification match that
13071 of older OpenSSL versions, before automatic building and checking of
13072 alternative chains has been implemented; also see
13073 .Cd trusted-first .
13074 .It Cd no-check-time
13075 Do not check certificate/CRL validity against current time.
13076 .It Cd partial-chain
13077 By default partial, incomplete chains which cannot be verified up to the
13078 chain top, a self-signed root certificate, will not verify.
13079 With this flag set, a chain succeeds to verify if at least one signing
13080 certificate of the chain is in any of the configured trusted stores of
13082 The OpenSSL manual page
13083 .Xr SSL_CTX_load_verify_locations 3
13084 gives some advise how to manage your own trusted store of CA certificates.
13086 Disable workarounds for broken certificates.
13087 .It Cd trusted-first
13088 Try building a chain using issuers in the trusted store first to avoid
13089 problems with server-sent legacy intermediate certificates.
13090 Newer versions of OpenSSL support alternative chain checking and enable
13091 it by default, resulting in the same behaviour; also see
13092 .Cd no-alt-chains .
13096 .Mx Va tls-ca-no-defaults
13097 .It Va tls-ca-no-defaults-USER@HOST , tls-ca-no-defaults-HOST ,\
13099 \*(BO\*(OP Do not load the default CA locations that are built into the
13100 used to TLS library to verify TLS server certificates.
13103 .It Va tls-config-file
13104 \*(OP If this variable is set
13105 .Xr CONF_modules_load_file 3
13107 .Ql ,+modules-load-file,
13110 is used to allow resource file based configuration of the TLS library.
13111 This happens once the library is used first, which may also be early
13112 during startup (logged with
13114 If a non-empty value is given then the given file, after performing
13115 .Sx "Filename transformations" ,
13116 will be used instead of the TLS libraries global default, and it is an
13117 error if the file cannot be loaded.
13118 The application name will always be passed as
13120 Some TLS libraries support application-specific configuration via
13121 resource files loaded like this, please see
13122 .Va tls-config-module .
13124 .Mx Va tls-config-module
13125 .It Va tls-config-module-USER@HOST , tls-config-module-HOST ,\
13127 \*(OP If file based application-specific configuration via
13128 .Va tls-config-file
13129 is available, announced as
13133 indicating availability of
13134 .Xr SSL_CTX_config 3 ,
13135 then, it becomes possible to use a central TLS configuration file
13136 for all programs, including \*(uA, for example
13137 .Bd -literal -offset indent
13138 # Register a configuration section for \*(uA
13139 \*(uA = mailx_master
13140 # The top configuration section creates a relation
13141 # in between dynamic SSL configuration and an actual
13142 # program specific configuration section
13144 ssl_conf = mailx_tls_config
13145 # And that program specific configuration section now
13146 # can map diverse tls-config-module names to sections,
13147 # as in: tls-config-module=account_xy
13149 account_xy = mailx_account_xy
13150 account_yz = mailx_account_yz
13152 MinProtocol = TLSv1.2
13155 CipherString = TLSv1.2:!aNULL:!eNULL:
13156 MinProtocol = TLSv1.1
13161 .Mx Va tls-config-pairs
13162 .It Va tls-config-pairs-USER@HOST , tls-config-pairs-HOST , tls-config-pairs
13163 \*(OP The value of this variable chain will be interpreted as
13164 a comma-separated list of directive/value pairs.
13165 Directives and values need to be separated by equals signs
13167 any whitespace surrounding pair members is removed.
13168 Keys are (usually) case-insensitive.
13169 Different to when placing these pairs in a
13170 .Va tls-config-module
13172 .Va tls-config-file ,
13175 need to be escaped with a reverse solidus
13177 when included in pairs; also different: if the equals sign
13179 is preceded with an asterisk
13181 .Sx "Filename transformations"
13182 will be performed on the value; it is an error if these fail.
13183 Unless proper support is announced by
13185 .Pf ( Ql ,+conf-ctx, )
13186 only the keys below are supported, otherwise the pairs will be used
13187 directly as arguments to the function
13188 .Xr SSL_CONF_cmd 3 .
13191 .Bl -tag -compact -width ".It Cd C_rtificate_"
13193 Filename of a TLS client certificate (chain) required by some servers.
13194 Fallback support via
13195 .Xr SSL_CTX_use_certificate_chain_file 3 .
13196 .Sx "Filename transformations"
13199 will be set to the same value if not initialized explicitly.
13200 Some services support so-called
13202 authentication if a TLS client certificate was successfully presented
13203 during connection establishment
13204 .Pf ( Dq connecting is authenticating ) .
13206 .It Cd CipherString
13207 A list of ciphers for TLS connections, see
13209 By default no list of ciphers is set, resulting in a
13210 .Cd Protocol Ns - Ns
13211 specific list of ciphers (the protocol standards define lists of
13212 acceptable ciphers; possibly cramped by the used TLS library).
13213 Fallback support via
13214 .Xr SSL_CTX_set_cipher_list 3 .
13216 .It Cd Ciphersuites
13217 A list of ciphers used for TLSv1.3 connections, see
13219 These will be joined onto the list of ciphers from
13224 .Ql ,+ctx-set-ciphersuites, ,
13226 .Xr SSL_CTX_set_ciphersuites 3 .
13229 A list of supported elliptic curves, if applicable.
13230 By default no curves are set.
13231 Fallback support via
13232 .Xr SSL_CTX_set1_curves_list 3 ,
13235 .It Cd MaxProtocol , MinProtocol
13236 The maximum and minimum supported TLS versions, respectively.
13240 .Ql ,+ctx-set-maxmin-proto, ,
13242 .Xr SSL_CTX_set_max_proto_version 3
13244 .Xr SSL_CTX_set_min_proto_version 3 ;
13245 these fallbacks use an internal parser which understands the strings
13251 and the special value
13253 which disables the given limit.
13256 Various flags to set.
13258 .Xr SSL_CTX_set_options 3 ,
13259 in which case any other value but (exactly)
13261 results in an error.
13264 Filename of the private key in PEM format of a TLS client certificate.
13265 If unset, the value of
13268 .Sx "Filename transformations"
13271 .Xr SSL_CTX_use_PrivateKey_file 3 .
13274 The used TLS protocol.
13280 .Ql ctx-set-maxmin-proto
13287 .Xr SSL_CTX_set_options 3 ,
13288 driven via an internal parser which understands the strings
13294 and the special value
13296 Multiple protocols may be given as a comma-separated list, any
13297 whitespace is ignored, an optional plus sign
13299 prefix enables, a hyphen-minus
13301 prefix disables a protocol, so that
13303 enables only the TLSv1.2 protocol.
13309 .It Va tls-crl-dir , tls-crl-file
13310 \*(OP Specify a directory / a file, respectively, that contains a CRL in
13311 PEM format to use when verifying TLS server certificates.
13314 .It Va tls-features
13315 \*(OP\*(RO This expands to a comma-separated list of the TLS library
13316 identity and optional features.
13317 To ease substring matching the string starts and ends with a comma.
13318 Currently supported identities are
13322 (OpenSSL v3.0.0 series),
13324 (OpenSSL v1.1.x series)
13327 (elder OpenSSL series, other clones).
13328 Optional features are preceded with a plus sign
13330 when available, and with a hyphen-minus
13334 Currently known features are
13336 .Pf ( Va tls-config-pairs ) ,
13338 .Pf ( Va tls-config-module ) ,
13339 .Ql ctx-set-ciphersuites
13340 .Pf ( Cd Ciphersuites
13342 .Va tls-config-pairs ) ,
13343 .Ql ctx-set-maxmin-proto
13344 .Pf ( Va tls-config-pairs ) ,
13345 .Ql modules-load-file
13346 .Pf ( Va tls-config-file ) ,
13349 .Pf ( Va tls-rand-file ) .
13351 .Mx Va tls-fingerprint
13352 .It Va tls-fingerprint-USER@HOST , tls-fingerprint-HOST , tls-fingerprint
13353 \*(OP It is possible to replace the verification of the connection
13354 peer certificate against the entire local pool of CAs (for more see
13355 .Sx "Encrypted network communication" )
13356 with the comparison against a precalculated certificate message digest,
13357 the so-called fingerprint, to be specified as the used
13358 .Va tls-fingerprint-digest .
13359 This fingerprint can for example be calculated with
13360 .Ql Ic tls Ns \:\0\:fingerprint HOST .
13362 .Mx Va tls-fingerprint-digest
13363 .It Va tls-fingerprint-digest-USER@HOST , tls-fingerprint-digest-HOST , \
13364 tls-fingerprint-digest
13365 \*(OP The message digest to be used when creating TLS certificate
13366 fingerprints, the defaults, if available, in test order, being
13369 For the complete list of digest algorithms refer to
13370 .Va smime-sign-digest .
13373 .It Va tls-rand-file
13377 .Ql ,+tls-rand-file,
13378 then this will be queried to find a file with random entropy data which
13379 can be used to seed the P(seudo)R(andom)N(umber)G(enerator), see
13380 .Xr RAND_load_file 3 .
13381 The default filename
13382 .Pf ( Xr RAND_file_name 3 ,
13385 will be used if this variable is not set or empty, or if the
13386 .Sx "Filename transformations"
13388 Shall seeding the PRNG have been successful,
13389 .Xr RAND_write_file 3
13390 will be called to update the entropy.
13391 Remarks: libraries which do not announce this feature seed the PRNG by
13395 .It Va tls-verify-USER@HOST , tls-verify-HOST , tls-verify
13396 \*(OP Variable chain that sets the action to be performed if an error
13397 occurs during TLS server certificate validation against the
13398 specified or default trust stores
13401 or the TLS library built-in defaults (unless usage disallowed via
13402 .Va tls-ca-no-defaults ) ,
13403 and as fine-tuned via
13405 Valid (case-insensitive) values are
13407 (fail and close connection immediately),
13409 (ask whether to continue on standard input),
13411 (show a warning and continue),
13413 (do not perform validation).
13418 If defined, gives the number of lines of a message to be displayed
13421 if unset, the first five lines are printed, if set to 0 the variable
13424 If the value is negative then its absolute value will be used for
13425 unsigned right shifting (see
13433 \*(BO If set then the
13435 command series will strip adjacent empty lines and quotations.
13439 The character set of the terminal \*(UA operates on,
13440 and the one and only supported character set that \*(UA can use if no
13441 character set conversion capabilities have been compiled into it,
13442 in which case it defaults to ISO-8859-1.
13443 Otherwise it defaults to UTF-8.
13444 Sufficient locale support provided the default will be preferably
13445 deduced from the locale environment if that is set (for example
13447 see there for more); runtime locale changes will be reflected by
13449 except during the program startup phase and if
13451 had been used to freeze the given value.
13452 Refer to the section
13453 .Sx "Character sets"
13454 for the complete picture about character sets.
13457 .It Va typescript-mode
13458 \*(BO A special multiplex variable that disables all variables and
13459 settings which result in behaviour that interferes with running \*(UA in
13462 .Va colour-disable ,
13463 .Va line-editor-disable
13464 and (before startup completed only)
13465 .Va termcap-disable .
13466 Unsetting it does not restore the former state of the covered settings.
13470 For a safe-by-default policy the process file mode creation mask
13474 on program startup after the resource files have been loaded,
13475 and unless this variable is set.
13476 By assigning this an empty value the active setting will not be changed,
13477 otherwise the given value will be made the new file mode creation mask.
13478 Child processes inherit the file mode creation mask of their parent.
13481 .It Va user-HOST , user
13482 \*(IN Variable chain that sets a global fallback user name, used in case
13483 none has been given in the protocol and account-specific URL.
13484 This variable defaults to the name of the user who runs \*(UA.
13488 Enable upward compatibility with \*(UA version 15.0 in respect to which
13489 configuration options are available and how they are handled.
13490 If set to a non-empty value the command modifier
13492 is implied and thus enforces
13493 .Sx "Shell-style argument quoting"
13495 .Sx "Old-style argument quoting"
13496 for all commands which support both.
13497 This manual uses \*(IN and \*(OU to refer to the new and the old way of
13498 doing things, respectively.
13502 Verbose mode enables logging of informational context messages.
13503 Historically a \*(BO variable, this can either be set multiple times
13504 (what the command line option
13506 uses), or be assigned a numeric value in order to increase verbosity.
13507 Assigning the value 0 disables verbosity and thus (almost) equals
13509 The maximum number is 3.
13519 .It Va version , version-date , \
13520 version-hexnum , version-major , version-minor , version-update
13521 \*(RO \*(UA version information: the first variable is a string with
13522 the complete version identification, the second the release date in ISO
13523 8601 notation without time.
13524 The third is a 32-bit hexadecimal number with the upper 8 bits storing
13525 the major, followed by the minor and update version numbers which occupy
13527 The latter three variables contain only decimal digits: the major, minor
13528 and update version numbers.
13529 The output of the command
13531 will include this information.
13534 .It Va writebackedited
13535 If this variable is set messages modified using the
13539 commands are written back to the current folder when it is quit;
13540 it is only honoured for writable folders in MBOX format, though.
13541 Note that the editor will be pointed to the raw message content in that
13542 case, i.e., neither MIME decoding nor decryption will have been
13543 performed, and proper
13546 quoting of newly added or edited content is also left as an exercise
13549 .\" }}} (Variables)
13551 .\" }}} (INTERNAL VARIABLES)
13554 .\" .Sh ENVIRONMENT {{{
13558 .Dq environment variable
13559 should be considered an indication that these variables are either
13560 standardized as vivid parts of process environments, or that they are
13561 commonly found in there.
13562 The process environment is inherited from the
13564 once \*(UA is started, and unless otherwise explicitly noted handling of
13565 the following variables transparently integrates into that of the
13566 .Sx "INTERNAL VARIABLES"
13567 from \*(UA's point of view.
13568 This means they can be managed via
13572 causing automatic program environment updates (to be inherited by
13573 newly created child processes).
13576 In order to integrate other environment variables equally they need to
13577 be imported (linked) with the command
13579 This command can also be used to set and unset non-integrated
13580 environment variables from scratch, sufficient system support provided.
13581 The following example, applicable to a POSIX shell, sets the
13583 environment variable for \*(UA only, and beforehand exports the
13585 in order to affect any further processing in the running shell:
13587 .Bd -literal -offset indent
13588 $ EDITOR="vim -u ${HOME}/.vimrc"
13590 $ COLUMNS=80 \*(uA -R
13593 .Bl -tag -width ".It Ev BaNg"
13596 The user's preferred width in column positions for the terminal screen.
13597 Queried and used once on program startup in interactive or batch
13599 mode, actively managed for child processes and the MLE (see
13600 .Sx "On terminal control and line editor" )
13601 in interactive mode thereafter.
13602 Non-interactive mode always uses, and the fallback default is
13603 a compile-time constant, by default 80 columns.
13608 are both set but not both are usable (empty, not a number, or 0) at
13609 program startup, then the real terminal screen size will be (tried to
13610 be) determined once.
13613 manages these variables, and unsets them for pipe specifications etc.)
13617 The name of the (mailbox)
13619 to use for saving aborted messages if
13621 is set; this defaults to
13625 is set no output will be generated, otherwise the contents of the file
13628 .Sx "Filename transformations"
13635 Pathname of the text editor to use for the
13639 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13641 is used for a more display oriented editor.
13645 The user's home directory.
13646 This variable is only used when it resides in the process environment.
13647 The calling user's home directory will be used instead if this directory
13648 does not exist, is not accessible or cannot be read;
13649 it will always be used for the root user.
13650 (No test for being writable is performed to allow usage by
13651 non-privileged users within read-only jails, but dependent on settings
13652 this directory is a default write target for, for example,
13660 .It Ev LC_ALL , LC_CTYPE , LANG
13661 \*(OP The (names in lookup order of the)
13665 which indicates the used
13666 .Sx "Character sets" .
13667 Runtime changes trigger automatic updates of the entire locale system,
13668 which includes updating
13670 (except during startup if the variable has been frozen via
13675 The user's preferred number of lines for the terminal screen.
13676 The behaviour is as described for
13678 yet the compile-time constant used in non-interactive mode and as
13679 a fallback defaults to 24 (lines).
13683 Pathname of the directory lister to use in the
13685 command when operating on local mailboxes.
13688 (path search through
13693 Upon startup \*(UA will actively ensure that this variable refers to the
13694 name of the user who runs \*(UA, in order to be able to pass a verified
13695 name to any newly created child process.
13699 Is used as the user's
13701 .Sx "primary system mailbox"
13705 If the environmental fallback is also not set, a built-in compile-time
13707 This is assumed to be an absolute pathname.
13711 \*(OP Override the default path search of
13712 .Sx "The Mailcap files" :
13713 any existing file therein will be loaded in sequence, appending any
13714 content to the list of MIME type handler directives.
13715 The RFC 1524 standard imposed default value is assigned otherwise:
13716 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
13717 (The default value is a compile-time \*(OP.)
13721 Is used as a startup file instead of
13724 In order to avoid side-effects from configuration files scripts should
13725 either set this variable to
13729 command line option should be used.
13732 .It Ev MAILX_NO_SYSTEM_RC
13733 If this variable is set then reading of
13736 .Va system-mailrc )
13737 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
13738 had been started up with the option
13740 (and according argument) or
13742 This variable is only used when it resides in the process environment.
13746 The name of the user's
13748 .Sx "secondary mailbox"
13750 A logical subset of the special
13751 .Sx "Filename transformations"
13757 Traditionally this MBOX is used as the file to save messages from the
13759 .Sx "primary system mailbox"
13760 that have been read.
13762 .Sx "Message states" .
13766 \*(IN\*(OP This variable overrides the default location of the user's
13772 Pathname of the program to use for backing the command
13776 variable enforces usage of a pager for output.
13777 The default paginator is
13779 (path search through
13782 \*(UA inspects the contents of this variable: if its contains the string
13784 then a non-existing environment variable
13791 will optionally be set to
13798 A colon-separated list of directories that is searched by the shell when
13799 looking for commands, for example
13800 .Ql /bin:/usr/bin:/usr/local/bin .
13803 .It Ev POSIXLY_CORRECT
13804 This environment entry is automatically squared with
13809 The shell to use for the commands
13814 .Sx "COMMAND ESCAPES"
13815 and when starting subprocesses.
13816 A default shell is used if this environment variable is not defined.
13819 .It Ev SOCKS5_PROXY
13820 This environment entry is automatically squared with
13824 .It Ev SOURCE_DATE_EPOCH
13825 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
13826 used in place of the current time.
13827 This variable is looked up upon program startup, and its existence will
13828 switch \*(UA to a reproducible mode
13829 .Pf ( Lk https://reproducible-builds.org )
13830 which uses deterministic random numbers, a special fixated pseudo
13833 This operation mode is used for development and by software packagers.
13834 \*(ID Currently an invalid setting is only ignored, rather than causing
13835 a program abortion.
13837 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
13841 \*(OP The terminal type for which output is to be prepared.
13842 For extended colour and font control please refer to
13843 .Sx "Coloured display" ,
13844 and for terminal management in general to
13845 .Sx "On terminal control and line editor" .
13849 Except for the root user this variable defines the directory for
13850 temporary files to be used instead of
13852 (or the given compile-time constant) if set, existent, accessible as
13853 well as read- and writable.
13854 This variable is only used when it resides in the process environment,
13855 but \*(UA will ensure at startup that this environment variable is
13856 updated to contain a usable temporary directory.
13862 (see there), but this variable is not standardized, should therefore not
13863 be used, and is only corrected if already set.
13867 Pathname of the text editor to use for the
13871 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13873 is used for a less display oriented editor.
13883 .Bl -tag -width ".It Pa BaNg"
13886 .It Pa ~/.mailcap , /etc/mailcap
13887 \*(OP Personal and system-wide MIME type handler definition files, see
13888 .Sx "The Mailcap files" .
13889 (The shown names are part of the RFC 1524 standard search path
13892 .It Pa \*(ur , \*(UR
13893 User-specific and system-wide files giving initial commands, the
13894 .Sx "Resource files" .
13895 (The used filenames come from
13898 .Va system-mailrc ,
13903 The default value for
13908 .It Pa \*(vU , \*(vS
13909 Personal and system-wide MIME types, see
13910 .Sx "The mime.types files" .
13914 \*(IN\*(OP The default location of the user's
13916 file \(en the section
13917 .Sx "The .netrc file"
13918 documents the file format.
13919 The used path can be set via
13929 \*(OP Possible location for persistent random entropy seed storage, see
13930 .Va tls-rand-file .
13934 .\" .Ss "Resource files" {{{
13935 .Ss "Resource files"
13937 Upon startup \*(UA reads in several resource files, in order:
13939 .Bl -tag -width ".It Pa BaNg"
13942 System wide initialization file
13943 .Pf ( Va system-mailrc ) .
13944 Reading of this file can be suppressed, either by using the
13946 (and according argument) or
13948 command line options, or by setting the
13951 .Ev MAILX_NO_SYSTEM_RC .
13955 File giving initial commands.
13956 A different file can be chosen by setting the
13960 Reading of this file can be suppressed with the
13962 command line option.
13964 .It Va mailx-extra-rc
13965 Defines a startup file to be read after all other resource files.
13966 It can be used to specify settings that are not understood by other
13968 implementations, for example.
13972 The content of these files is interpreted as follows:
13975 .Bl -bullet -compact
13977 The whitespace characters space, tabulator and newline,
13978 as well as those defined by the variable
13980 are removed from the beginning and end of input lines.
13982 Empty lines are ignored.
13984 Any other line is interpreted as a command.
13985 It may be spread over multiple input lines if the newline character is
13987 by placing a reverse solidus character
13989 as the last character of the line; whereas any leading whitespace of
13990 follow lines is ignored, trailing whitespace before a escaped newline
13991 remains in the input.
13993 If the line (content) starts with the number sign
13995 then it is a comment-command and also ignored.
13996 (The comment-command is a real command, which does nothing, and
13997 therefore the usual follow lines mechanism applies!)
14001 Errors while loading these files are subject to the settings of
14005 More files with syntactically equal content can be
14007 The following, saved in a file, would be an examplary content:
14009 .Bd -literal -offset indent
14010 # This line is a comment command. And y\e
14011 es, it is really continued here.
14018 .\" .Ss "The mime.types files" {{{
14019 .Ss "The mime.types files"
14022 .Sx "HTML mail and MIME attachments"
14023 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
14024 media types in order to classify message and attachment content.
14025 One source for them are
14027 files, the loading of which can be controlled by setting the variable
14028 .Va mimetypes-load-control .
14029 Another is the command
14031 which also offers access to \*(UAs MIME type cache.
14033 files have the following syntax:
14035 .Bd -literal -offset indent
14036 type/subtype extension [extension ...]
14037 # For example text/html html htm
14043 define the MIME media type, as standardized in RFC 2046:
14045 is used to declare the general type of data, while the
14047 specifies a specific format for that type of data.
14048 One or multiple filename
14050 s, separated by whitespace, can be bound to the media type format.
14051 Comments may be introduced anywhere on a line with a number sign
14053 causing the remaining line to be discarded.
14055 \*(UA also supports an extended, non-portable syntax in especially
14056 crafted files, which can be loaded via the alternative value syntax of
14057 .Va mimetypes-load-control ,
14058 and prepends an optional
14062 .Dl [type-marker ]type/subtype extension [extension ...]
14065 The following type markers are supported:
14068 .Bl -tag -compact -width ".It Ar _n_u"
14070 Treat message parts with this content as plain text.
14075 Treat message parts with this content as HTML tagsoup.
14076 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
14077 the content as plain text instead.
14081 but instead of falling back to plain text require an explicit content
14082 handler to be defined.
14084 If no handler can be found a text message is displayed which says so.
14085 This can be annoying, for example signatures serve a contextual purpose,
14086 their content is of no use by itself.
14087 This marker will avoid displaying the text message.
14092 for sending messages:
14094 .Va mime-allow-text-controls ,
14095 .Va mimetypes-load-control .
14096 For reading etc. messages:
14097 .Sx "HTML mail and MIME attachments" ,
14098 .Sx "The Mailcap files" ,
14100 .Va mime-counter-evidence ,
14101 .Va mimetypes-load-control ,
14102 .Va pipe-TYPE/SUBTYPE ,
14103 .Va pipe-EXTENSION .
14106 .\" .Ss "The Mailcap files" {{{ review
14107 .Ss "The Mailcap files"
14109 \*(OP RFC 1524 defines a
14110 .Dq User Agent Configuration Mechanism
14111 to be used to inform mail user agent programs about the locally
14112 installed facilities for handling various data formats, i.e., about
14113 commands and how they can be used to display, edit et cetera MIME part
14114 contents, as well as a default path search that includes multiple
14115 possible locations of resource files, and the
14117 environment variable to overwrite that.
14118 Handlers found from doing the path search will be cached, the command
14120 operates on that cache, and the variable
14121 .Va mailcap-disable
14122 will suppress automatic loading, and usage of any mailcap handlers.
14123 .Sx "HTML mail and MIME attachments"
14124 gives a general overview of how MIME types are handled.
14128 files consist of a set of newline separated entries.
14129 Comment lines start with a number sign
14131 (in the first column!) and are ignored.
14132 Empty lines are ignored.
14133 All other lines are interpreted as mailcap entries.
14134 An entry definition may be split over multiple lines by placing the
14135 reverse solidus character
14137 last in all but the final line.
14138 The standard does not specify how leading whitespace of successive lines
14139 is to be treated, therefore they are retained.
14143 entries consist of a number of semicolon
14146 The first two fields are mandatory and must occur in the specified
14147 order, the remaining fields are optional and may appear in any order.
14148 Leading and trailing whitespace of field content is ignored (removed).
14149 The reverse solidus
14151 character can be used to escape any following character including
14152 semicolon and itself in the content of the second field, and in value
14153 parts of any optional key/value field.
14156 The first field defines the MIME
14158 the entry is about to handle (case-insensitively).
14159 If the subtype is specified as an asterisk
14161 the entry is meant to match all subtypes of the named type, e.g.,
14163 would match any audio type.
14164 The second field is the
14166 shell command used to display MIME parts of the given type.
14169 Data consuming shell commands will be fed message (MIME part) data on
14170 standard input unless one or more instances of the (unquoted) string
14172 are used: these formats will be replaced with a temporary file(name)
14173 that has been prefilled with the parts data.
14174 Data producing shell commands are expected to generata data on their
14175 standard output unless that format is used.
14176 In all cases any given
14178 format is replaced with a properly shell quoted filename.
14179 When a command requests a temporary file via
14181 then that will be removed again, as if the
14182 .Cd x-mailx-tmpfile
14184 .Cd x-mailx-tmpfile-fill
14185 flags had been set; unless the command requests
14188 .Cd x-mailx-tmpfile-unlink
14189 flag is also implied; see below for more.
14192 Optional fields define single-word flags (case-insensitive), or key
14193 / value pairs consisting of a case-insensitive keyword, an equals sign
14195 and a shell command; whitespace surrounding the equals sign is removed.
14196 Optional fields include the following:
14199 .Bl -tag -width ".It Cd BaNg"
14201 A program that can be used to compose a new body or body part in the
14203 (Currently unused.)
14205 .It Cd composetyped
14208 field, but is to be used when the composing program needs to specify the
14210 header field to be applied to the composed data.
14211 (Currently unused.)
14214 .It Cd copiousoutput
14215 A flag field which indicates that the output of the
14217 command is integrable into \*(UAs normal visual display.
14218 It is mutually exclusive with
14219 .Cd needsterminal .
14222 A textual description that describes this type of data.
14223 The text may optionally be enclosed within double quotation marks
14227 A program that can be used to edit a body or body part in the given
14229 (Currently unused.)
14231 .It Cd nametemplate
14232 This field specifies a filename format for the
14234 format used in the shell command fields, in which
14236 will be replaced by a random string.
14237 (The filename is also stored in and passed to subprocesses via
14238 .Ev MAILX_FILENAME_TEMPORARY . )
14239 The standard says this is
14240 .Dq only expected to be relevant in environments \
14241 where filename extensions are meaningful ,
14242 and so this field is ignored unless the
14244 is a prefix, optionally followed by (ASCII) alphabetic and numeric
14245 characters, the underscore and the period.
14246 For example, to specify that a JPG file is to be passed to an image
14247 viewer with a name ending in
14249 .Ql nametemplate=%s.jpg
14253 .It Cd needsterminal
14254 This flag field indicates that the given shell command must be run on
14255 an interactive terminal.
14256 \*(UA will temporarily release the terminal to the given command in
14257 interactive mode, in non-interactive mode this entry will be entirely
14258 ignored; this flag implies
14259 .Cd x-mailx-noquote .
14262 A program that can be used to print a message or body part in the given
14264 (Currently unused.)
14267 Specifies a program to be run to test some condition, for example, the
14268 machine architecture, or the window system in use, to determine whether
14269 or not this mailcap entry applies.
14270 If the test fails, a subsequent mailcap entry should be sought; also see
14271 .Cd x-mailx-test-once .
14272 Standard I/O of the test program is redirected from and to
14276 is not supported (the data does not yet exist).
14278 .It Cd textualnewlines
14279 A flag field which indicates that this type of data is line-oriented and
14280 that, if encoded in
14282 all newlines should be converted to canonical form (CRLF) before
14283 encoding, and will be in that form after decoding.
14284 (Currently unused.)
14287 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
14288 icon to be used to visually denote the presence of this kind of data.
14289 This field is not used by \*(UA.
14292 .It Cd x-mailx-async
14293 Extension flag field that denotes that the given
14295 command shall be executed asynchronously, without blocking \*(UA.
14296 Cannot be used in conjunction with
14297 .Cd needsterminal ;
14298 the standard output of the command will go to
14302 .It Cd x-mailx-noquote
14303 An extension flag field that indicates that even a
14306 command shall not be used when
14308 ing messages, as it would by default.
14311 .It Cd x-mailx-test-once
14312 Extension flag which denotes whether the given
14314 command shall be evaluated once only with its exit status being cached.
14315 This is handy if some global unchanging condition is to be queried, like
14316 .Dq running under the X Window System .
14319 .It Cd x-mailx-tmpfile
14320 Extension flag field that requests creation of a zero-sized temporary
14321 file, the name of which is to be placed in the environment variable
14322 .Ev MAILX_FILENAME_TEMPORARY .
14323 It is an error to use this flag with commands that include a
14325 format (because that is implemented by means of this temporary file).
14328 .It Cd x-mailx-tmpfile-fill
14329 Normally the MIME part content is passed to the handler via standard
14330 input; if this flag is set then the data will instead be written into
14332 .Cd x-mailx-tmpfile .
14333 In order to cause deletion of the temporary file you will have to set
14334 .Cd x-mailx-tmpfile-unlink
14336 It is an error to use this flag with commands that include a
14341 .It Cd x-mailx-tmpfile-unlink
14342 Extension flag field that requests that the temporary file shall be
14343 deleted automatically when the command loop is entered again at latest.
14344 It is an error to use this flag with commands that include a
14346 format, or in conjunction with
14347 .Cd x-mailx-async .
14348 .Cd x-mailx-tmpfile
14352 .It Cd x-mailx-last-resort
14353 An extension flag that indicates that this handler shall only be used
14354 as a last resort, when no other source (see
14355 .Sx "HTML mail and MIME attachments" )
14356 provides a MIME handler.
14359 .It Cd x-mailx-ignore
14360 An extension that enforces that this handler is not used at all.
14365 The standard includes the possibility to define any number of additional
14366 fields, prefixed by
14368 Flag fields apply to the entire
14370 entry \(em in some unusual cases, this may not be desirable, but
14371 differentiation can be accomplished via separate entries, taking
14372 advantage of the fact that subsequent entries are searched if an earlier
14373 one does not provide enough information.
14376 command needs to specify the
14380 command shall not, the following will help out the latter:
14382 .Bd -literal -offset indent
14383 application/postscript; ps-to-terminal %s; needsterminal
14384 application/postscript; ps-to-terminal %s; compose=idraw %s
14388 In value parts of command fields any occurrence of the format string
14390 will be replaced by the
14393 Any named parameter from a messages'
14395 field may be embedded into the command line using the format
14397 followed by the parameter name and a closing brace
14400 The entire parameter should appear as a single command line argument,
14401 regardless of embedded spaces, shell quoting will be performed by the
14402 RFC 1524 processor, thus:
14404 .Bd -literal -offset indent
14406 Content-type: multipart/mixed; boundary=42
14409 multipart/*; /usr/local/bin/showmulti \e
14410 %t %{boundary} ; composetyped = /usr/local/bin/makemulti
14412 # Executed shell command
14413 /usr/local/bin/showmulti multipart/mixed 42
14417 Note that \*(UA does not support handlers for multipart MIME parts as
14418 shown in this example (as of today).
14419 It does not support the additional formats
14423 An example file, also showing how to properly deal with the expansion of
14425 which includes any quotes that are necessary to make it a valid shell
14426 argument by itself and thus will cause undesired behaviour when placed
14427 in additional user-provided quotes:
14429 .Bd -literal -offset indent
14431 text/richtext; richtext %s; copiousoutput
14433 text/x-perl; perl -cWT %s; nametemplate = %s.pl
14435 # Exit EX_TEMPFAIL=75 on signal
14436 application/pdf; \e
14438 trap "rm -f ${infile}" EXIT\e; \e
14439 trap "exit 75" INT QUIT TERM\e; \e
14440 mupdf "${infile}"; \e
14441 test = [ -n "${DISPLAY}" ]; \e
14442 nametemplate = %s.pdf; x-mailx-async
14443 application/pdf; pdftotext -layout - -; copiousoutput
14445 application/*; echo "This is \e\e"%t\e\e" but \e
14446 is 50 \e% Greek to me" \e; < %s head -c 512 | cat -vet; \e
14447 copiousoutput; x-mailx-noquote; x-mailx-last-resort
14452 .Sx "HTML mail and MIME attachments" ,
14453 .Sx "The mime.types files" ,
14456 .Va mime-counter-evidence ,
14457 .Va pipe-TYPE/SUBTYPE ,
14458 .Va pipe-EXTENSION .
14461 .\" .Ss "The .netrc file" {{{ review
14462 .Ss "The .netrc file"
14464 User credentials for machine accounts (see
14465 .Sx "On URL syntax and credential lookup" )
14466 can be placed in the
14468 file, which will be loaded and cached when requested by
14470 The default location
14472 may be overridden by the
14474 environment variable.
14475 As long as syntax constraints are honoured the file source may be
14476 replaced with the output of the shell command set in
14478 to load an encrypted file, for example.
14479 The cache can be managed with the command
14483 The file consists of space, tabulator or newline separated tokens.
14484 This parser implements a superset of the original BSD syntax, but users
14485 should nonetheless be aware of portability glitches, shall their
14487 be usable across multiple programs and platforms:
14490 .Bl -bullet -compact
14492 BSD only supports double quotation marks, for example
14493 .Ql password """pass with spaces""" .
14495 BSD (only?) supports escaping of single characters via a reverse solidus
14496 (a space could be escaped via
14498 in- as well as outside of a quoted string.
14499 This method is assumed to be present, and will actively be used to quote
14500 double quotation marks
14502 and reverse solidus
14504 characters inside the
14508 tokens, for example for display purposes.
14510 BSD does not require a final quotation mark of the last user input token.
14512 The original BSD (Berknet) parser also supported a format which allowed
14513 tokens to be separated with commas \(en whereas at least Hewlett-Packard
14514 still seems to support this syntax, this parser does not!
14516 As a non-portable extension some widely-used programs support
14517 shell-style comments: if an input line starts, after any amount of
14518 whitespace, with a number sign
14520 then the rest of the line is ignored.
14522 Whereas other programs may require that the
14524 file is accessible by only the user if it contains a
14526 token for any other
14530 this parser will always require these strict permissions.
14534 Of the following list of supported tokens this parser uses (and caches)
14541 entry will not be used.
14543 .Bl -tag -width ".It Cd BaNg"
14544 .It Cd machine Ar name
14545 The hostname of the entries' machine, lowercase-normalized before use.
14546 Any further file content, until either end-of-file or the occurrence
14551 first-class token is bound (only related) to the machine
14554 As an extension that should not be the cause of any worries this parser
14555 supports a single wildcard prefix for
14557 .Bd -literal -offset indent
14558 machine *.example.com login USER password PASS
14559 machine pop3.example.com login USER password PASS
14560 machine smtp.example.com login USER password PASS
14566 .Ql pop3.example.com ,
14570 .Ql local.smtp.example.com .
14571 In the example neither
14572 .Ql pop3.example.com
14574 .Ql smtp.example.com
14575 will be matched by the wildcard, since the exact matches take
14576 precedence (it is however faster to specify it the other way around).
14579 This is the same as
14581 except that it is a fallback entry that is used shall none of the
14582 specified machines match; only one default token may be specified,
14583 and it must be the last first-class token.
14585 .It Cd login Ar name
14586 The user name on the remote machine.
14588 .It Cd password Ar string
14589 The user's password on the remote machine.
14591 .It Cd account Ar string
14592 Supply an additional account password.
14593 This is merely for FTP purposes.
14595 .It Cd macdef Ar name
14597 A macro is defined with the specified
14599 it is formed from all lines beginning with the next line and continuing
14600 until a blank line is (consecutive newline characters are) encountered.
14603 entries cannot be utilized by multiple machines, too, but must be
14604 defined following the
14606 they are intended to be used with.)
14609 exists, it is automatically run as the last step of the login process.
14610 This is merely for FTP purposes.
14617 .\" .Sh EXAMPLES {{{
14620 .\" .Ss "An example configuration" {{{
14621 .Ss "An example configuration"
14623 .Bd -literal -offset indent
14624 # This example assumes v15.0 compatibility mode
14627 # Request strict TLL transport layer security checks
14628 set tls-verify=strict
14630 # Where are the up-to-date TLS certificates?
14631 # (Since we manage up-to-date ones explicitly, do not use any,
14632 # possibly outdated, default certificates shipped with OpenSSL)
14633 #set tls-ca-dir=/etc/ssl/certs
14634 set tls-ca-file=/etc/ssl/certs/ca-certificates.crt
14635 set tls-ca-no-defaults
14636 #set tls-ca-flags=partial-chain
14637 wysh set smime-ca-file="${tls-ca-file}" \e
14638 smime-ca-no-defaults #smime-ca-flags="${tls-ca-flags}"
14640 # This could be outsourced to a central configuration file via
14641 # tls-config-file plus tls-config-module if the used library allows.
14642 # CipherString: explicitly define the list of ciphers, which may
14643 # improve security, especially with protocols older than TLS v1.2.
14644 # See ciphers(1). Possibly best to only use tls-config-pairs-HOST
14645 # (or -USER@HOST), as necessary, again..
14646 # Note that TLSv1.3 uses Ciphersuites= instead, which will join
14647 # with CipherString (if protocols older than v1.3 are allowed)
14648 # Curves: especially with TLSv1.3 curves selection may be desired.
14649 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
14650 # Change this only when the remote server does not support it:
14651 # maybe use chain support via tls-config-pairs-HOST / -USER@HOST
14652 # to define such explicit exceptions, then, e.g.,
14653 # MinProtocol=TLSv1.1
14654 if "$tls-features" =% ,+ctx-set-maxmin-proto,
14655 wysh set tls-config-pairs='\e
14656 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14657 Curves=P-521:P-384:P-256,\e
14658 MinProtocol=TLSv1.1'
14660 wysh set tls-config-pairs='\e
14661 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14662 Curves=P-521:P-384:P-256,\e
14663 Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2\e, +TLSv1.3'
14666 # Essential setting: select allowed character sets
14667 set sendcharsets=utf-8,iso-8859-1
14669 # A very kind option: when replying to a message, first try to
14670 # use the same encoding that the original poster used herself!
14671 set reply-in-same-charset
14673 # When replying, do not merge From: and To: of the original message
14674 # into To:. Instead old From: -> new To:, old To: -> merge Cc:.
14675 set recipients-in-cc
14677 # When sending messages, wait until the Mail-Transfer-Agent finishs.
14678 # Only like this you will be able to see errors reported through the
14679 # exit status of the MTA (including the built-in SMTP one)!
14682 # Only use built-in MIME types, no mime.types(5) files
14683 set mimetypes-load-control
14685 # Default directory where we act in (relative to $HOME)
14687 # A leading "+" (often) means: under *folder*
14688 # *record* is used to save copies of sent messages
14689 set MBOX=+mbox.mbox DEAD=+dead.txt \e
14690 record=+sent.mbox record-files record-resent
14692 # Make "file mymbox" and "file myrec" go to..
14693 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
14695 # Not really optional, e.g., for S/MIME
14696 set from='Your Name <address@exam.ple>'
14698 # It may be necessary to set hostname and/or smtp-hostname
14699 # if the "SERVER" of mta and "domain" of from do not match.
14700 # The `urlencode' command can be used to encode USER and PASS
14701 set mta=(smtps?|submissions?)://[USER[:PASS]@]SERVER[:PORT] \e
14702 smtp-auth=login/plain... \e
14705 # Never refuse to start into interactive mode, and more
14707 colour-pager crt= \e
14708 followup-to followup-to-honour=ask-yes fullnames \e
14709 history-file=+.\*(uAhist history-size=-1 history-gabby \e
14710 mime-counter-evidence=0b1111 \e
14711 prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
14712 reply-to-honour=ask-yes \e
14715 # Only include the selected header fields when typing messages
14716 headerpick type retain from_ date from to cc subject \e
14717 message-id mail-followup-to reply-to
14718 # ...when forwarding messages
14719 headerpick forward retain subject date from to cc
14720 # ...when saving message, etc.
14721 #headerpick save ignore ^Original-.*$ ^X-.*$
14723 # Some mailing lists
14724 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
14725 mlsubscribe '^xfans@xfans\e.xyz$'
14727 # Handle a few file extensions (to store MBOX databases)
14728 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
14729 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
14730 zst 'zstd -dc' 'zstd -19 -zc' \e
14731 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
14733 # A real life example of a very huge free mail provider
14734 # Instead of directly placing content inside `account',
14735 # we `define' a macro: like that we can switch "accounts"
14736 # from within *on-compose-splice*, for example!
14738 set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
14739 set from='Your Name <address@examp.ple>'
14741 set pop3-no-apop-pop.gmXil.com
14742 shortcut pop %:pop3s://pop.gmXil.com
14743 shortcut imap %:imaps://imap.gmXil.com
14744 # Or, entirely IMAP based setup
14745 #set folder=imaps://imap.gmail.com record="+[Gmail]/Sent Mail" \e
14746 # imap-cache=~/spool/cache
14748 set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
14750 set mta=smtps://USER:PASS@smtp.gmail.com:465
14756 # Here is a pretty large one which does not allow sending mails
14757 # if there is a domain name mismatch on the SMTP protocol level,
14758 # which would bite us if the value of from does not match, e.g.,
14759 # for people who have a sXXXXeforge project and want to speak
14760 # with the mailing list under their project account (in from),
14761 # still sending the message through their normal mail provider
14763 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14764 set from='Your Name <address@exam.ple>'
14766 shortcut pop %:pop3s://pop.yaXXex.com
14767 shortcut imap %:imaps://imap.yaXXex.com
14769 set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
14770 hostname=yaXXex.com smtp-hostname=
14776 # Create some new commands so that, e.g., `ls /tmp' will..
14777 commandalias lls '!ls ${LS_COLOUR_FLAG} -aFlrS'
14778 commandalias llS '!ls ${LS_COLOUR_FLAG} -aFlS'
14780 set pipe-message/external-body='?* echo $MAILX_EXTERNAL_BODY_URL'
14782 # We do not support gpg(1) directly yet. But simple --clearsign'd
14783 # message parts can be dealt with as follows:
14786 wysh set pipe-text/plain=$'?*#++=?\e
14787 < "${MAILX_FILENAME_TEMPORARY}" awk \e
14788 -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
14790 /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
14793 print "--- GPG --verify ---";\e
14794 system("gpg --verify " TMPFILE " 2>&1");\e
14795 print "--- GPG --verify ---";\e
14799 /^-----BEGIN PGP SIGNATURE-----/,\e
14800 /^-----END PGP SIGNATURE-----/{\e
14807 commandalias V '\e'call V
14811 When storing passwords in
14813 appropriate permissions should be set on this file with
14814 .Ql $ chmod 0600 \*(ur .
14817 is available user credentials can be stored in the central
14819 file instead; e.g., here is a different version of the example account
14820 that sets up SMTP and POP3:
14822 .Bd -literal -offset indent
14824 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14825 set from='Your Name <address@exam.ple>'
14827 # Load an encrypted ~/.netrc by uncommenting the next line
14828 #set netrc-pipe='gpg -qd ~/.netrc.pgp'
14830 set mta=smtps://smtp.yXXXXx.ru:465 \e
14831 smtp-hostname= hostname=yXXXXx.com
14832 set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
14833 commandalias xp fi pop3s://pop.yXXXXx.ru
14845 .Bd -literal -offset indent
14846 machine *.yXXXXx.ru login USER password PASS
14850 This configuration should now work just fine:
14853 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
14856 .\" .Ss "S/MIME step by step" {{{
14857 .Ss "S/MIME step by step"
14859 \*(OP The first thing that is needed for
14860 .Sx "Signed and encrypted messages with S/MIME"
14861 is a personal certificate, and a private key.
14862 The certificate contains public information, in particular a name and
14863 email address(es), and the public key that can be used by others to
14864 encrypt messages for the certificate holder (the owner of the private
14867 signed messages generated with that certificate('s private key).
14868 Whereas the certificate is included in each signed message, the private
14869 key must be kept secret.
14870 It is used to decrypt messages that were previously encrypted with the
14871 public key, and to sign messages.
14874 For personal use it is recommended to get a S/MIME certificate from
14875 one of the major CAs on the Internet.
14876 Many CAs offer such certificates for free.
14877 Usually offered is a combined certificate and private key in PKCS#12
14878 format which \*(UA does not accept directly.
14879 To convert it to PEM format, the following shell command can be used;
14880 please read on for how to use these PEM files.
14882 .Bd -literal -offset indent
14883 $ openssl pkcs12 -in cert.p12 -out certpem.pem -clcerts -nodes
14885 $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
14886 $ openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
14891 .Lk https://www.CAcert.org
14892 which issues client and server certificates to members of their
14893 community for free; their root certificate
14894 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
14895 is often not in the default set of trusted CA root certificates, though,
14896 which means their root certificate has to be downloaded separately,
14897 and needs to be part of the S/MIME certificate validation chain by
14900 or as a vivid member of the
14901 .Va smime-ca-file .
14902 But let us take a step-by-step tour on how to setup S/MIME with
14903 a certificate from CAcert.org despite this situation!
14906 First of all you will have to become a member of the CAcert.org
14907 community, simply by registrating yourself via the web interface.
14908 Once you are, create and verify all email addresses you want to be able
14909 to create signed and encrypted messages for/with using the corresponding
14910 entries of the web interface.
14911 Now ready to create S/MIME certificates, so let us create a new
14912 .Dq client certificate ,
14913 ensure to include all email addresses that should be covered by the
14914 certificate in the following web form, and also to use your name as the
14918 Create a private key and a certificate request on your local computer
14919 (please see the manual pages of the used commands for more in-depth
14920 knowledge on what the used arguments etc. do):
14923 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
14926 Afterwards copy-and-paste the content of
14928 into the certificate-request (CSR) field of the web form on the
14929 CAcert.org website (you may need to unfold some
14930 .Dq advanced options
14931 to see the corresponding text field).
14932 This last step will ensure that your private key (which never left your
14933 box) and the certificate belong together (through the public key that
14934 will find its way into the certificate via the certificate-request).
14935 You are now ready and can create your CAcert certified certificate.
14936 Download and store or copy-and-paste it as
14941 In order to use your new S/MIME setup a combined private key/public key
14942 (certificate) file has to be created:
14945 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
14948 This is the file \*(UA will work with.
14949 If you have created your private key with a passphrase then \*(UA will
14950 ask you for it whenever a message is signed or decrypted, unless this
14951 operation has been automated as described in
14952 .Sx "Signed and encrypted messages with S/MIME" .
14953 Set the following variables to henceforth use S/MIME (setting
14955 is of interest for verification only):
14957 .Bd -literal -offset indent
14958 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
14959 smime-sign-cert=ME@HERE.com.paired \e
14960 smime-sign-digest=SHA512 \e
14961 smime-sign from=myname@my.host
14966 .\" .Ss "Using CRLs with S/MIME or TLS" {{{
14967 .Ss "Using CRLs with S/MIME or TLS"
14969 \*(OP Certification authorities (CAs) issue certificate revocation
14970 lists (CRLs) on a regular basis.
14971 These lists contain the serial numbers of certificates that have been
14972 declared invalid after they have been issued.
14973 Such usually happens because the private key for the certificate has
14975 because the owner of the certificate has left the organization that is
14976 mentioned in the certificate, etc.
14977 To seriously use S/MIME or TLS verification,
14978 an up-to-date CRL is required for each trusted CA.
14979 There is otherwise no method to distinguish between valid and
14980 invalidated certificates.
14981 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
14982 the Internet, so they have to be retrieved by some external mechanism.
14985 \*(UA accepts CRLs in PEM format only;
14986 CRLs in DER format must be converted, like, e.\|g.:
14989 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
14992 To tell \*(UA about the CRLs, a directory that contains all CRL files
14993 (and no other files) must be created.
14998 variables, respectively, must then be set to point to that directory.
14999 After that, \*(UA requires a CRL to be present for each CA that is used
15000 to verify a certificate.
15009 In general it is a good idea to turn on
15015 twice) if something does not work well.
15016 Very often a diagnostic message can be produced that leads to the
15017 problems' solution.
15019 .\" .Ss "\*(UA shortly hangs on startup" {{{
15020 .Ss "\*(UA shortly hangs on startup"
15022 This can have two reasons, one is the necessity to wait for a file lock
15023 and cannot be helped, the other being that \*(UA calls the function
15025 in order to query the nodename of the box (sometimes the real one is
15026 needed instead of the one represented by the internal variable
15028 One may have varying success by ensuring that the real hostname and
15032 or, more generally, that the name service is properly setup \(en
15035 return the expected value?
15036 Does this local hostname have a domain suffix?
15037 RFC 6762 standardized the link-local top-level domain
15039 try again after adding an (additional) entry with this extension.
15042 .\" .Ss "I cannot login to Google mail (via OAuth)" {{{
15043 .Ss "I cannot login to Google mail \&(via OAuth\&)"
15045 Since 2014 some free service providers classify programs as
15047 unless they use a special authentication method (OAuth 2.0) which
15048 was not standardized for non-HTTP protocol authentication token query
15049 until August 2015 (RFC 7628).
15052 Different to Kerberos / GSSAPI, which is developed since the mid of the
15053 1980s, where a user can easily create a local authentication ticket for
15054 her- and himself with the locally installed
15056 program, that protocol has no such local part but instead requires
15057 a world-wide-web query to create or fetch a token; since there is no
15058 local cache this query would have to be performed whenever \*(UA is
15059 invoked (in interactive sessions situation may differ).
15062 \*(UA does not directly support OAuth.
15063 It, however, supports XOAUTH2 / OAUTHBEARER, see
15064 .Sx "But, how about XOAUTH2 / OAUTHBEARER?"
15065 If that is not used it is necessary to declare \*(UA a
15066 .Dq less secure app
15067 (on the providers account web page) in order to read and send mail.
15068 However, it also seems possible to take the following steps instead:
15073 give the provider the number of a mobile phone,
15076 .Dq 2-Step Verification ,
15078 create an application specific password (16 characters), and
15080 use that special password instead of the real Google account password in
15081 \*(UA (for more on that see the section
15082 .Sx "On URL syntax and credential lookup" ) .
15086 .\" .Ss "But, how about XOAUTH2 / OAUTHBEARER?" {{{
15087 .Ss "But, how about XOAUTH2 / OAUTHBEARER?"
15090 .Sx "I cannot login to Google mail \&(via OAuth\&)"
15091 one OAuth-based authentication method is available:
15092 the OAuth 2.0 bearer token usage as standardized in RFC 6750 (according
15093 SASL mechanism in RFC 7628), also known as XOAUTH2 and OAUTHBEARER,
15094 allows fetching a temporary access token via the web that can locally be
15097 The protocol is simple and extendable, token updates or even password
15098 changes via a simple TLS secured server login would be possible in
15099 theory, but today a web browser and an external support tool are
15100 prerequisites for using this authentication method.
15101 The token times out and must be periodically refreshed via the web.
15104 Some hurdles must be taken before being able to use this method.
15105 Using GMail as an example, an application (that is a name) must be
15106 registered, for which credentials, a
15109 .Dq client secret ,
15110 need to be created and saved locally (in a secure way).
15111 These initial configuration steps can be performed at
15112 .Lk https://console.developers.google.com/apis/credentials .
15113 Thereafter a refresh token can be requested;
15114 a python program to do this for GMail accounts is
15115 .Lk https://github.com/google/\:gmail-oauth2-tools/\:raw/\:\
15116 master/\:python/\:oauth2.py :
15118 .Bd -literal -offset indent
15119 $ python oauth2.py --user=EMAIL \e
15120 --client-id=THE-ID --client-secret=THE-SECRET \e
15121 --generate_oauth2_token
15122 To authorize token, visit this url and follow the directions:
15123 https://accounts.google.com/o/oauth2/auth?client_id=...
15124 Enter verification code: ...
15127 Access Token Expiration Seconds: 3600
15128 $ # Of which the last three are actual token responses.
15129 $ # Thereafter access tokens can regularly be refreshed
15130 $ # via the created refresh token (read on)
15134 The generated refresh token must also be saved locally (securely).
15135 The procedure as a whole can be read at
15136 .Lk https://github.com/google/\:gmail-oauth2-tools/\:wiki/\:\
15137 OAuth2DotPyRunThrough .
15138 Since periodic timers are not yet supported, keeping an access token
15139 up-to-date (from within \*(UA) can only be performed via the hook
15140 .Va on-main-loop-tick ,
15141 or (for sending only)
15142 .Va on-compose-enter
15143 (for more on authentication please see the section
15144 .Sx "On URL syntax and credential lookup" ) :
15146 .Bd -literal -offset indent
15147 set on-main-loop-tick=o-m-l-t on-compose-enter=o-c-e
15149 xcall update_access_token
15152 xcall update_access_token
15155 set access_token_=0
15156 define update_access_token {
15157 local set i epoch_sec epoch_nsec
15159 eval set $i # set epoch_sec/_nsec of vexpr epoch
15160 vput vexpr i + $access_token_ 2100
15161 if $epoch_sec -ge $i
15162 vput ! password python oauth2.py --user=EMAIL \e
15163 --client-id=THE-ID --client-secret=THE-SECRET \e
15164 --refresh-token=THE-REFRESH-TOKEN |\e
15165 sed '1b PASS;d; :PASS s/^.\e{1,\e}:\e(.\e{1,\e}\e)$/\e1/'
15166 vput csop password trim "$password"
15168 echo password is <$password>
15170 set access_token_=$epoch_sec
15176 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{ review
15177 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
15179 Two thinkable situations: the first is a shadowed sequence; setting
15181 or the most possible
15183 mode, causes a printout of the
15185 tree after that is built; being a cache, this happens only upon startup
15186 or after modifying bindings.
15189 Or second, terminal libraries (see
15190 .Sx "On terminal control and line editor",
15193 may report different codes than the terminal really sends, rendering
15194 bindings dysfunctional because expected and received data do not match; the
15198 ings will show the byte sequences that are expected.
15199 (One common source of problems is that the \(em possibly even
15200 non-existing \(em keypad is not turned on, and the resulting layout
15201 reports the keypad control codes for the normal keyboard keys.)
15204 To overcome the situation use for example the program
15208 if available, to see the byte sequences which are actually produced
15209 by keypresses, and use the variable
15211 to make \*(UA aware of them.
15212 The terminal this is typed on produces some unexpected sequences,
15213 here for an example the shifted home key:
15215 .Bd -literal -offset indent
15218 # 1B 5B=[ 31=1 3B=; 32=2 48=H
15223 $ \*(uA -v -Stermcap='kHOM=\eE[H'
15230 .\" .Ss "Can \*(UA git-send-email?" {{{
15231 .Ss "Can \*(UA git-send-email?"
15234 Put (at least parts of) the following in your
15237 .Bd -literal -offset indent
15239 smtpserver = /usr/bin/\*(uA
15240 smtpserveroption = -t
15241 #smtpserveroption = -Sexpandaddr
15242 smtpserveroption = -Athe-account-you-need
15245 suppressfrom = false
15246 assume8bitEncoding = UTF-8
15249 chainreplyto = true
15257 Patches can also be send directly, for example:
15259 .Bd -literal -offset indent
15260 $ git format-patch -M --stdout HEAD^ |
15261 \*(uA -A the-account-you-need -t RECEIVER
15265 .\" .Ss "Howto handle stale dotlock files" {{{
15266 .Ss "Howto handle stale dotlock files"
15269 sometimes fails to open MBOX mail databases because creation of
15271 .Sx "dotlock files"
15272 is impossible due to existing but unowned lock files.
15273 \*(UA does not offer an option to deal with those files, because it is
15274 considered a site policy what counts as unowned, and what not.
15275 The site policy is usually defined by administrator(s), and expressed in
15276 the configuration of a locally installed MTA (for example Postfix
15277 .Ql stale_lock_time=500s ) .
15278 Therefore the suggestion:
15280 .Bd -literal -offset indent
15281 $ </dev/null \*(uA -s 'MTA: be no frog, handle lock' $LOGNAME
15285 By sending a mail to yourself the local MTA can use its normal queue
15286 mechanism to try the delivery multiple times, finally decide a lock file
15287 has become stale, and remove it.
15293 .\" .Sh "IMAP CLIENT" {{{
15296 \*(OPally there is IMAP client support available.
15297 This part of the program is obsolete and will vanish in v15 with the
15298 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
15299 and makes excessive use of signal based long code jumps.
15300 Support can hopefully be readded later based on a new-style I/O, with
15301 SysV signal handling.
15302 In fact the IMAP support had already been removed from the codebase, but
15303 was reinstantiated on user demand: in effect the IMAP code is at the
15304 level of \*(UA v14.8.16 (with
15306 being the sole exception), and should be treated with some care.
15313 protocol prefixes, and an IMAP-based
15316 IMAP URLs (paths) undergo inspections and possible transformations
15317 before use (and the command
15319 can be used to manually apply them to any given argument).
15320 Hierarchy delimiters are normalized, a step which is configurable via the
15322 variable chain, but defaults to the first seen delimiter otherwise.
15323 \*(UA supports internationalised IMAP names, and en- and decodes the
15324 names from and to the
15326 as necessary and possible.
15327 If a mailbox name is expanded (see
15328 .Sx "Filename transformations" )
15329 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
15330 mailboxes below the
15332 target box, while folder names prefixed by `@' refer to folders below
15333 the hierarchy base, so the following will list all folders below the
15334 current one when in an IMAP mailbox:
15338 Note: some IMAP servers do not accept the creation of mailboxes in
15339 the hierarchy base, but require that they are created as subfolders of
15340 `INBOX' \(en with such servers a folder name of the form
15342 .Dl imaps://mylogin@imap.myisp.example/INBOX.
15344 should be used (the last character is the server's hierarchy
15346 The following IMAP-specific commands exist:
15349 .Bl -tag -width ".It Ic BaNg"
15352 Only applicable to cached IMAP mailboxes;
15353 takes a message list and reads the specified messages into the IMAP
15358 If operating in disconnected mode on an IMAP mailbox,
15359 switch to online mode and connect to the mail server while retaining
15360 the mailbox status.
15361 See the description of the
15363 variable for more information.
15367 If operating in online mode on an IMAP mailbox,
15368 switch to disconnected mode while retaining the mailbox status.
15369 See the description of the
15372 A list of messages may optionally be given as argument;
15373 the respective messages are then read into the cache before the
15374 connection is closed, thus
15376 makes the entire mailbox available for disconnected use.
15380 Sends command strings directly to the current IMAP server.
15381 \*(UA operates always in IMAP `selected state' on the current mailbox;
15382 commands that change this will produce undesirable results and should be
15384 Useful IMAP commands are:
15385 .Bl -tag -offset indent -width ".Ic getquotearoot"
15387 Takes the name of an IMAP mailbox as an argument and creates it.
15389 (RFC 2087) Takes the name of an IMAP mailbox as an argument
15390 and prints the quotas that apply to the mailbox.
15391 Not all IMAP servers support this command.
15393 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
15394 the Other User's Namespaces and the Shared Namespaces.
15395 Each namespace type is printed in parentheses;
15396 if there are multiple namespaces of the same type,
15397 inner parentheses separate them.
15398 For each namespace a prefix and a hierarchy separator is listed.
15399 Not all IMAP servers support this command.
15404 Perform IMAP path transformations.
15408 .Sx "Command modifiers" ) ,
15409 and manages the error number
15411 The first argument specifies the operation:
15413 normalizes hierarchy delimiters (see
15415 and converts the strings from the locale
15417 to the internationalized variant used by IMAP,
15419 performs the reverse operation.
15420 Encoding will honour the (global) value of
15426 The following IMAP-specific internal variables exist:
15429 .Bl -tag -width ".It Va BaNg"
15431 .It Va disconnected
15432 \*(BO When an IMAP mailbox is selected and this variable is set,
15433 no connection to the server is initiated.
15434 Instead, data is obtained from the local cache (see
15437 Mailboxes that are not present in the cache
15438 and messages that have not yet entirely been fetched from the server
15440 to fetch all messages in a mailbox at once,
15442 .No ` Ns Li copy * /dev/null Ns '
15443 can be used while still in connected mode.
15444 Changes that are made to IMAP mailboxes in disconnected mode are queued
15445 and committed later when a connection to that server is made.
15446 This procedure is not completely reliable since it cannot be guaranteed
15447 that the IMAP unique identifiers (UIDs) on the server still match the
15448 ones in the cache at that time.
15451 when this problem occurs.
15453 .It Va disconnected-USER@HOST
15454 The specified account is handled as described for the
15457 but other accounts are not affected.
15460 .It Va imap-auth-USER@HOST , imap-auth
15461 Sets the IMAP authentication method.
15462 Supported are the default
15469 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
15474 (for TLS secured connections which pass a client certificate via
15475 .Va tls-config-pairs ) ,
15476 as well as the \*(OPal
15488 which only need the former.
15490 solely builds upon the credentials passed via a client certificate,
15491 and is usually the way to go since tested servers do not actually follow
15492 RFC 4422, and fail if additional credentials are actually passed.
15496 Enables caching of IMAP mailboxes.
15497 The value of this variable must point to a directory that is either
15498 existent or can be created by \*(UA.
15499 All contents of the cache can be deleted by \*(UA at any time;
15500 it is not safe to make assumptions about them.
15503 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
15504 The hierarchy separator used by the IMAP server.
15505 Whenever an IMAP path is specified it will undergo normalization.
15506 One of the normalization steps is the squeezing and adjustment of
15507 hierarchy separators.
15508 If this variable is set, any occurrence of any character of the given
15509 value that exists in the path will be replaced by the first member of
15510 the value; an empty value will cause the default to be used, it is
15512 If not set, we will reuse the first hierarchy separator character that
15513 is discovered in a user-given mailbox name.
15515 .Mx Va imap-keepalive
15516 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
15517 IMAP servers may close the connection after a period of
15518 inactivity; the standard requires this to be at least 30 minutes,
15519 but practical experience may vary.
15520 Setting this variable to a numeric `value' greater than 0 causes
15521 a `NOOP' command to be sent each `value' seconds if no other operation
15525 .It Va imap-list-depth
15526 When retrieving the list of folders on an IMAP server, the
15528 command stops after it has reached a certain depth to avoid possible
15530 The value of this variable sets the maximum depth allowed.
15532 If the folder separator on the current IMAP server is a slash `/',
15533 this variable has no effect and the
15535 command does not descend to subfolders.
15537 .Mx Va imap-use-starttls
15538 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
15539 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
15540 IMAP session TLS encrypted.
15541 This functionality is not supported by all servers,
15542 and is not used if the session is already encrypted by the IMAPS method.
15548 .\" .Sh "SEE ALSO" {{{
15558 .Xr spamassassin 1 ,
15567 .Pf (or\0 Xr regex 7 ) ,
15568 .Xr mailwrapper 8 ,
15574 .\" .Sh HISTORY {{{
15577 M. Douglas McIlroy writes in his article
15578 .Dq A Research UNIX Reader: Annotated Excerpts \
15579 from the Programmer's Manual, 1971-1986
15582 command already appeared in First Edition
15586 .Bd -ragged -offset indent
15587 Electronic mail was there from the start.
15588 Never satisfied with its exact behavior, everybody touched it at one
15589 time or another: to assure the safety of simultaneous access, to improve
15590 privacy, to survive crashes, to exploit uucp, to screen out foreign
15591 freeloaders, or whatever.
15592 Not until v7 did the interface change (Thompson).
15593 Later, as mail became global in its reach, Dave Presotto took charge and
15594 brought order to communications with a grab-bag of external networks
15600 Mail, in large parts compatible with
15602 mail, was written in 1978 by Kurt Shoens and developed as part of the
15605 distribution until 1995.
15606 This manual page is derived from
15607 .Dq The Mail Reference Manual
15608 that Kurt Shoens wrote for Mail 1.3, included in 3BSD in 1980.
15613 denominator became standardized as
15615 in the X/Open Portability Guide Issue 2 (January 1987).
15616 After the rise of Open Source
15619 Mail saw continuous development in the individual code forks,
15620 noticeably by Christos Zoulas in
15622 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
15623 Ritter in the years 2000 until 2008.
15624 Since 2012 S-nail is maintained by Steffen Nurpmeso.
15627 Electronic mail exchange in general is a concept even older.
15628 The earliest well documented electronic mail system was part of the
15629 Compatible Time Sharing System (CTSS) at MIT, its MAIL command had been
15630 proposed in a staff planning memo at the end of 1964 and was implemented
15631 in mid-1965 when Tom Van Vleck and Noel Morris wrote the necessary code.
15632 Similar communication programs were built for other timesharing systems.
15633 One of the most ambitious and influential was Murray Turoff's EMISARI.
15634 Created in 1971 for the United States Office of Emergency Preparedness,
15635 EMISARI combined private electronic messages with a chat system, public
15636 postings, voting, and a user directory.
15639 During the 1960s it was common to connect a large number of terminals to
15640 a single, central computer.
15641 Connecting two computers together was relatively unusual.
15642 This began to change with the development of the ARPANET, the ancestor
15643 of today's Internet.
15644 In 1971 Ray Tomlinson adapted the SNDMSG program, originally developed
15645 for the University of California at Berkeley timesharing system, to give
15646 it the ability to transmit a message across the network into the mailbox
15647 of a user on a different computer.
15648 For the first time it was necessary to specify the recipient's computer
15649 as well as an account name.
15650 Tomlinson decided that the underused commercial at
15652 would work to separate the two.
15655 Sending a message across the network was originally treated as a special
15656 instance of transmitting a file, and so a MAIL command was included in
15657 RFC 385 on file transfer in 1972.
15658 Because it was not always clear when or where a message had come from,
15659 RFC 561 in 1973 aimed to formalize electronic mail headers, including
15664 In 1975 RFC 680 described fields to help with the transmission of
15665 messages to multiple users, including
15670 In 1977 these features and others went from best practices to a binding
15671 standard in RFC 733.
15672 Queen Elizabeth II of England became the first head of state to send
15673 electronic mail on March 26 1976 while ceremonially opening a building
15674 in the British Royal Signals and Radar Establishment (RSRE) in Malvern.
15681 .An "Kurt Shoens" ,
15682 .An "Edward Wang" ,
15683 .An "Keith Bostic" ,
15684 .An "Christos Zoulas" ,
15685 .An "Gunnar Ritter" .
15686 \*(UA is developed by
15687 .An "Steffen Nurpmeso" Aq s-mailx@lists.sdaoden.eu .
15690 .\" .Sh CAVEATS {{{
15693 \*(ID Interrupting an operation via
15697 from anywhere else but a command prompt is very problematic and likely
15698 to leave the program in an undefined state: many library functions
15699 cannot deal with the
15701 that this software (still) performs; even though efforts have been taken
15702 to address this, no sooner but in v15 it will have been worked out:
15703 interruptions have not been disabled in order to allow forceful breakage
15704 of hanging network connections, for example (all this is unrelated to
15708 The SMTP and POP3 protocol support of \*(UA is very basic.
15709 Also, if it fails to contact its upstream SMTP server, it will not make
15710 further attempts to transfer the message at a later time (setting
15715 If this is a concern, it might be better to set up a local SMTP server
15716 that is capable of message queuing.
15723 When a network-based mailbox is open, directly changing to another
15724 network-based mailbox of a different protocol (i.e., from POP3 to IMAP
15725 or vice versa) will cause a
15729 After deleting some message of a POP3 mailbox the header summary falsely
15730 claims that there are no messages to display, one needs to perform
15731 a scroll or dot movement to restore proper state.
15738 mode a power user may encounter crashes very occasionally (this is may
15742 Please report bugs to the
15744 address, for example from within \*(uA:
15745 .\" v15-compat: drop eval as `mail' will expand variable?
15746 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
15749 output of the command
15753 .Bd -literal -offset indent
15754 ? wysh set escape=! verbose; vput version xy; unset verbose;\e
15755 eval mail $contact-mail
15762 Information on the web at
15763 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ; x' .