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.24 / 2022-03-26
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 there is a built-in default set,
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 and listed 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.
1549 Note plain text parts will always be preferred in
1550 .Ql multipart/alternative
1551 MIME messages unless
1552 .Va mime-alternative-favour-rich
1556 Whereas a simple HTML-to-text filter for displaying HTML messages is
1557 \*(OPally supported (indicated by
1558 .Ql ,+filter-html-tagsoup,
1561 MIME types other than plain text cannot be handled directly.
1562 To deal with specific non-text MIME types or file extensions programs
1563 need to be registered which either prepare (re-)integrable plain text
1564 versions of their input (a mode which is called
1565 .Cd copiousoutput ) ,
1566 or display the content externally, for example in a graphical window:
1567 the latter type is only considered by and for the command
1571 To install a handler program for a MIME type an according
1572 .Va pipe-TYPE/SUBTYPE
1573 variable needs to be set; to define a handler for a file extension
1575 can be used \(en these handlers take precedence.
1576 \*(OPally mail user agent configuration is supported (see
1577 .Sx "The Mailcap files" ) ,
1578 and will be queried for display or quote handlers after the former ones.
1579 Type-markers registered via
1581 are the last possible source for information how to handle a MIME type.
1584 For example, to display HTML messages integrated via the text browsers
1588 register a MathML MIME type and enable its plain text display, and to
1589 open PDF attachments in an external PDF viewer, asynchronously and with
1590 some other magic attached:
1592 .Bd -literal -offset indent
1593 ? if "$features" !% ,+filter-html-tagsoup,
1594 ? #set pipe-text/html='?* elinks -force-html -dump 1'
1595 ? set pipe-text/html='?* lynx -stdin -dump -force_html'
1596 ? # Display HTML as plain text instead
1597 ? #set pipe-text/html=?t
1600 ? mimetype ?t application/mathml+xml mathml
1602 ? wysh set pipe-application/pdf='?&=? \e
1603 trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1604 trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1605 mupdf "${MAILX_FILENAME_TEMPORARY}"'
1609 ? \eset mime-alternative-favour-rich pipe-text/html=?h?
1612 ? \ecommandalias html \e\ecall showhtml
1616 .\" .Ss "Mailing lists" {{{
1619 Known or subscribed-to mailing lists may be flagged in the summary of
1624 and will gain special treatment when sending mails: the variable
1625 .Va followup-to-honour
1627 .Ql Mail-\:Followup-\:To:
1628 header is honoured when a message is being replied to
1635 controls creation of this header when creating
1637 s, if the necessary user setup
1638 .Pf ( from , sender ) ;
1639 is available; then, it may also be created automatically, for example
1640 when list-replying via
1648 is used and the messages
1649 .Ql Mail-Followup-To:
1657 manage \*(UAs notion of which addresses are mailing lists.
1658 With the \*(OPal regular expression support any address
1659 .Mx -ix "magic regular expression characters"
1660 which contains any of the magic regular expression characters
1666 dependent on the host system)
1667 will be compiled and used as one, possibly matching many addresses.
1668 It is not possible to escape the
1670 in order to match special characters as-is, bracket expressions must be
1672 .Ql Ic search Li @subject@'[[]open bracket' .
1674 .Bd -literal -offset indent
1675 ? set followup-to followup-to-honour=ask-yes \e
1676 reply-to-honour=ask-yes
1677 ? mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1678 ? mlsubscribe a4@b4.c4 exact@lists.c3
1682 Known and subscribed lists differ in that for the latter the
1684 s address is not part of a generated
1685 .Ql Mail-Followup-To: .
1686 There are exceptions, for example if multiple lists are addressed and
1687 not all have the subscription attribute.
1688 When replying to a message its list address
1690 header) is automatically and temporarily treated like a known
1692 dependent on the variable
1696 is used instead (if it is a single address on the same domain as
1698 in order to accept a list administrator's wish that is supposed to have
1699 been manifested like that.
1702 For convenience and compatibility with mail programs that do not honour
1703 the non-standard M-F-T, an automatic user entry in the carbon-copy
1705 address list of generated message can be created by setting
1706 .Va followup-to-add-cc .
1707 This entry will be added whenever the user will be placed in the
1708 .Ql Mail-Followup-To:
1709 list, and is not a regular addressee already.
1710 .Va reply-to-swap-in
1711 tries to deal with the address rewriting that many mailing-lists nowadays
1712 perform to work around DKIM / DMARC etc. standard imposed problems.
1715 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1716 .Ss "Signed and encrypted messages with S/MIME"
1718 \*(OP S/MIME provides two central mechanisms:
1719 message signing and message encryption.
1720 A signed message contains some data in addition to the regular text.
1721 The data can be used to verify that the message has been sent using
1722 a valid certificate, that the sender address matches that in the
1723 certificate, and that the message text has not been altered.
1724 Signing a message does not change its regular text;
1725 it can be read regardless of whether the recipients software is able to
1727 It is thus usually possible to sign all outgoing messages if so desired.
1730 Encryption, in contrast, makes the message text invisible for all people
1731 except those who have access to the secret decryption key.
1732 To encrypt a message, the specific recipients public encryption key
1734 It is therefore not possible to send encrypted mail to people unless their
1735 key has been retrieved from either previous communication or public key
1737 Because signing is performed with private keys, and encryption with
1738 public keys, messages should always be signed before being encrypted.
1741 A central concept to S/MIME is that of the certification authority (CA).
1742 A CA is a trusted institution that issues certificates.
1743 For each of these certificates it can be verified that it really
1744 originates from the CA, provided that the CA's own certificate is
1746 A set of CA certificates is usually delivered and installed together
1747 with the cryptographical library that is used on the local system.
1748 Therefore reasonable security for S/MIME on the Internet is provided if
1749 the source that provides that library installation is trusted.
1750 It is also possible to use a specific pool of trusted certificates.
1752 .Va smime-ca-no-defaults
1753 should be set to avoid using the default certificate pool, and
1757 should be pointed to a trusted pool of certificates.
1758 A certificate cannot be more secure than the method its CA certificate
1759 has been retrieved with.
1762 This trusted pool of certificates is used by the command
1764 to ensure that the given S/MIME messages can be trusted.
1765 If so, verified sender certificates that were embedded in signed
1766 messages can be saved locally with the command
1768 and used by \*(UA to encrypt further communication with these senders:
1770 .Bd -literal -offset indent
1772 ? set smime-encrypt-USER@HOST=FILENAME \e
1773 smime-cipher-USER@HOST=AES256
1777 To sign outgoing messages, in order to allow receivers to verify the
1778 origin of these messages, a personal S/MIME certificate is required.
1779 \*(UA supports password-protected personal certificates (and keys), see
1780 .Va smime-sign-cert .
1782 .Sx "On URL syntax and credential lookup"
1783 gives an overview of the possible sources of user credentials, and
1784 .Sx "S/MIME step by step"
1785 shows examplarily how a private S/MIME certificate can be obtained.
1786 In general, if such a private key plus certificate
1788 is available, all that needs to be done is to set some variables:
1790 .Bd -literal -offset indent
1791 ? set smime-sign-cert=ME@exam.ple.paired \e
1792 smime-sign-digest=SHA512 \e
1793 smime-sign from=myname@my.host
1797 Variables of interest for S/MIME in general are
1800 .Va smime-ca-flags ,
1801 .Va smime-ca-no-defaults ,
1803 .Va smime-crl-file .
1804 For S/MIME signing of interest are
1806 .Va smime-sign-cert ,
1807 .Va smime-sign-include-certs
1809 .Va smime-sign-digest .
1810 Additional variables of interest for S/MIME en- and decryption:
1813 .Va smime-encrypt-USER@HOST .
1814 Variables of secondary interest may be
1815 .Va content-description-smime-message
1817 .Va content-description-smime-signature .
1818 S/MIME is available if
1824 \*(ID Note that neither S/MIME signing nor encryption applies to
1825 message subjects or other header fields yet.
1826 Thus they may not contain sensitive information for encrypted messages,
1827 and cannot be trusted even if the message content has been verified.
1828 When sending signed messages,
1829 it is recommended to repeat any important header information in the
1833 .\" .Ss "On URL syntax and credential lookup" {{{ review
1834 .Ss "On URL syntax and credential lookup"
1836 For accessing protocol-specific resources Uniform Resource Locators
1837 (URL, RFC 3986) have become omnipresent.
1838 Here they are expected in a
1840 variant, not used in data exchange, but only meant as a compact,
1841 easy-to-use way of defining and representing information in a well-known
1842 notation; as such they do not conform to any real standard.
1843 Optional parts are placed in brackets
1845 optional either because there also exist other ways to define the
1846 information, or because the part is protocol specific.
1848 for example is used by the \*(OPal Maildir
1850 type and the IMAP protocol, but not by POP3.
1855 are included in an URL server specification, URL percent encoded
1856 (RFC 3986) forms are needed, generable with
1860 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1864 .Sx "INTERNAL VARIABLES"
1865 exist in multiple versions, called
1867 in this document: the plain
1872 .Ql variable-USER@HOST .
1873 If a port was specified
1881 is never in URL percent encoded form.
1882 For example, whether the hypothetical
1883 .Ql smtp://\:wings\:%3A\:of\:@a.dove
1884 including user and password was used, or whether it was
1886 and it came from a different source, to lookup the chain
1887 .Va tls-config-pairs
1889 .Ql tls-\:config-\:pairs-\:wings:of@a.dove
1891 .Ql tls-\:config-pairs\-\:a.dove ,
1892 before finally looking up the plain variable.
1895 The logic to collect (an
1897 s) credential information is as follows:
1901 A user is always required.
1904 has been given in the URL the variables
1909 Afterwards, when enforced by the \*(OPal variables
1910 .Va netrc-lookup-HOST
1913 .Sx "The .netrc file"
1914 of the user will be searched for a
1916 specific entry which provides a
1918 name: only unambiguous entries are used (one possible matching entry for
1921 If there is still no
1925 known to be a valid user on the current host, is used.
1928 Authentication: unless otherwise noted the chain
1929 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1930 is checked, falling back to a protocol-specific default as necessary.
1935 has been given in the URL, then if the
1937 has been found through the \*(OPal
1939 that may have also provided the password.
1941 .Va password-USER@HOST , password-HOST , password
1944 Thereafter the (now complete) \*(OPal chain
1945 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1946 is checked, if set the
1948 cache is searched for a password only (multiple user accounts for
1949 a single machine may exist as well as a fallback entry without user
1950 but with a password).
1952 If at that point there is still no password available, but the
1953 (protocols') chosen authentication type requires a password, then in
1954 interactive mode the user will be prompted on the terminal.
1959 S/MIME verification works relative to the values found in the
1963 header field(s), which means the values of
1964 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1966 .Va smime-sign-digest
1967 will not be looked up using the
1971 chains from above, but instead use the corresponding values from the
1972 message that is being worked on.
1973 If no address matches we assume and use the setting of
1975 In unusual cases multiple and different
1979 combinations may therefore be involved \(en on the other hand those
1980 unusual cases become possible.
1981 The usual case is as short as:
1983 .Bd -literal -offset indent
1984 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1985 smime-sign smime-sign-cert=+smime.pair \e
1992 contains complete example configurations.
1995 .\" .Ss "Encrypted network communication" {{{ review
1996 .Ss "Encrypted network communication"
1998 \*(OP SSL (Secure Sockets Layer) aka its successor TLS (Transport Layer
1999 Security) are protocols which aid in securing communication by providing
2000 a safely initiated and encrypted network connection.
2001 A central concept of TLS are certificates: as part of each network
2002 connection setup a (set of) certificates will be exchanged through which
2003 the identity of the network peer can be cryptographically verified;
2004 if possible the TLS/SNI (ServerNameIndication) extension will be enabled
2005 to allow servers fine-grained control over the certificates being used.
2006 A locally installed pool of trusted certificates will then be inspected,
2007 and verification will succeed if it contains a(n in)direct signer of the
2008 presented certificate(s).
2011 The local pool of trusted so-called CA (Certification Authority)
2012 certificates is usually delivered with and used along the TLS library.
2013 A custom pool of trusted certificates can be selected by pointing
2015 and/or (with special preparation)
2017 to the desired location; setting
2018 .Va tls-ca-no-defaults
2019 in addition will avoid additional inspection of the default pool.
2020 A certificate cannot be more secure than the method its CA certificate
2021 has been retrieved with.
2022 For inspection or other purposes, the certificate of a server (as seen
2023 when connecting to it) can be fetched with the command
2025 (port can usually be the protocol name, too, and
2027 is taken into account here):
2029 .Bd -literal -offset indent
2030 $ \*(uA -vX 'tls certchain SERVER-URL[:PORT]; x'
2034 A local pool of CA certificates is not strictly necessary, however,
2035 server certificates can also be verified via their fingerprint.
2036 For this a message digest will be calculated and compared against the
2038 .Va tls-fingerprint ,
2039 and verification will succeed if the fingerprint matches.
2040 The message digest (algorithm) can be configured via the variable chain
2041 .Va tls-fingerprint-digest ;
2045 .Bd -literal -offset indent
2046 $ \*(uA -X 'wysh set verbose; tls fingerprint SERVER-URL[:PORT]; x'
2050 It depends on the used protocol whether encrypted communication is
2051 possible, and which configuration steps have to be taken to enable it.
2052 Some protocols, like POP3S, are implicitly encrypted, others, like
2053 POP3, can upgrade a plain text connection if so requested.
2054 For example, to use the
2056 that POP3 offers (a member of) the variable (chain)
2057 .Va pop3-use-starttls
2058 needs to be set, with convenience via
2061 .Bd -literal -offset indent
2062 shortcut encpop1 pop3s://pop1.exam.ple
2064 shortcut encpop2 pop3://pop2.exam.ple
2065 set pop3-use-starttls-pop2.exam.ple
2067 set mta=smtps://smtp.exam.ple:465
2068 set mta=smtp://smtp.exam.ple smtp-use-starttls
2072 Normally that is all there is to do, given that TLS libraries try to
2073 provide safe defaults, plenty of knobs however exist to adjust settings.
2074 For example certificate verification settings can be fine-tuned via
2076 and the TLS configuration basics are accessible via
2077 .Va tls-config-pairs ,
2078 for example to control protocol versions or cipher lists.
2079 In the past hints on how to restrict the set of protocols to highly
2080 secure ones were indicated, but as of the time of this writing the list
2081 of protocols or ciphers may need to become relaxed in order to be able
2082 to connect to some servers; the following example allows connecting to a
2084 that uses OpenSSL 0.9.8za from June 2014 (refer to
2085 .Sx "INTERNAL VARIABLES"
2086 for more on variable chains):
2088 .Bd -literal -offset indent
2089 wysh set tls-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
2090 CipherString=TLSv1.2:!aNULL:!eNULL:\e
2091 ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
2092 DHE-RSA-AES256-SHA:@STRENGTH'
2098 should be referred to when creating a custom cipher list.
2099 Variables of interest for TLS in general are
2103 .Va tls-ca-no-defaults ,
2104 .Va tls-config-file ,
2105 .Va tls-config-module ,
2106 .Va tls-config-pairs ,
2120 .\" .Ss "Character sets" review {{{
2121 .Ss "Character sets"
2123 \*(OP The user's locale environment is detected by looking at the
2125 environment variable.
2126 The internal variable
2128 will be set to the detected terminal character set accordingly,
2129 and will thus show up in the output of commands like
2133 This character set will be targeted when trying to display data,
2134 and user input data is expected to be in this character set, too.
2137 When creating messages their character input data is classified.
2138 7-bit clean text data and attachments will be classified as
2140 8-bit data will \*(OPally be converted into members of
2142 until a character set conversion succeeds.
2144 is the implied default last member of this list.
2145 If no 8-bit character set is capable to represent input data,
2146 no message will be sent, and its text will optionally be
2150 If that is not acceptable, for example in script environments,
2151 .Va mime-force-sendout
2152 can be set to force sending of non-convertible data as
2153 .Ql application/octet-stream
2154 classified binary content instead: like this receivers still have the
2155 option to inspect message content (for example via
2156 .Va mime-counter-evidence ) .
2157 If the \*(OPal character set conversion is not available
2162 is the only supported character set for non 7-bit clean data, and
2163 it is simply assumed it can be used to exchange 8-bit messages.
2167 may also be given an explicit value to send mail in a completely
2169 locale environment, which can be used to generate and send for
2170 example 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2172 environment (an example of this can be found in the section
2173 .Sx "On sending mail, and non-interactive mode" ) .
2174 Due to lack of programming interfaces reading mail will not really work
2175 as expected in a faked environment: whereas
2177 might be addressable, any output will be made safely printable, as via
2180 according to the actual locale environment, which is not affected by
2184 Classifying 7-bit clean data as
2186 is a problem if the input character set
2187 .Pf ( Va ttycharset )
2188 is a multibyte character set that is itself 7-bit clean.
2189 For example, the Japanese character set ISO-2022-JP is, but is capable
2190 to encode the rich set of Japanese Kanji, Hiragana and Katakana
2191 characters: in order to notify receivers of this character set the mail
2192 message must be MIME encoded so that the character set ISO-2022-JP can
2193 be advertised, otherwise an invalid email message would result!
2194 To achieve this, the variable
2196 can be set to ISO-2022-JP.
2197 (Today a better approach regarding email is the usage of UTF-8, which
2198 uses 8-bit bytes for non-US-ASCII data.)
2201 When replying to a message and the variable
2202 .Va reply-in-same-charset
2203 is set, the character set of the message being replied to is tried first
2204 as a target character set (still being a subject of
2206 filtering, however).
2207 Another opportunity is
2208 .Va sendcharsets-else-ttycharset
2209 to reflect the user's locale environment automatically, it will treat
2211 as an implied member of (an unset)
2215 \*(OP When reading messages, their text data is converted into
2217 as necessary in order to display them on the user's terminal.
2218 Unprintable characters and invalid byte sequences are detected
2219 and replaced by substitution characters.
2220 Character set mappings for source character sets can be established with
2222 which may be handy to work around faulty or incomplete character set
2223 catalogues (one could for example add a missing LATIN1 to ISO-8859-1
2224 mapping), or to enforce treatment of one character set as another one
2225 .Pf ( Dq interpret LATIN1 as CP1252 ) .
2227 .Va charset-unknown-8bit
2228 to deal with another hairy aspect of message interpretation.
2231 In general, if a message saying
2232 .Dq cannot convert from a to b
2233 appears, either some characters are not appropriate for the currently
2234 selected (terminal) character set,
2235 or the needed conversion is not supported by the system.
2236 In the first case, it is necessary to set an appropriate
2238 locale and/or the variable
2240 The best results are usually achieved when running in a UTF-8
2241 locale on a UTF-8 capable terminal, in which case the full Unicode
2242 spectrum of characters is available.
2243 In this setup characters from various countries can be displayed,
2244 while it is still possible to use more simple character sets for sending
2245 to retain maximum compatibility with older mail clients.
2248 On the other hand the POSIX standard defines a locale-independent 7-bit
2249 .Dq portable character set
2250 that should be used when overall portability is an issue, the even more
2251 restricted subset named
2252 .Dq portable filename character set
2253 consists of A-Z, a-z, 0-9, period
2261 .\" .Ss "Message states" {{{
2262 .Ss "Message states"
2264 \*(UA differentiates in between several message states; the current
2265 state will be reflected in the summary of
2272 .Sx "Specifying messages"
2273 dependent on their state is possible.
2274 When operating on the system
2278 .Sx "primary system mailbox" ,
2279 special actions, like the automatic moving of messages to the
2281 .Sx "secondary mailbox"
2283 may be applied when the mailbox is left (also implicitly by program
2284 termination, unless the command
2286 was used) \(en however, because this may be irritating to users which
2289 mail-user-agents, the provided global
2291 template sets the internal
2295 variables in order to suppress this behaviour.
2297 .Bl -hang -width ".It Ql new"
2299 Message has neither been viewed nor moved to any other state.
2300 Such messages are retained even in the
2302 .Sx "primary system mailbox" .
2305 Message has neither been viewed nor moved to any other state, but the
2306 message was present already when the mailbox has been opened last:
2307 Such messages are retained even in the
2309 .Sx "primary system mailbox" .
2312 The message has been processed by one of the following commands:
2331 will always try to automatically
2337 logical message, and may thus mark multiple messages as read, the
2339 command will do so if the internal variable
2345 command is used, messages that are in a
2347 .Sx "primary system mailbox"
2350 state when the mailbox is left will be saved in the
2352 .Sx "secondary mailbox"
2354 unless the internal variable
2359 The message has been processed by one of the following commands:
2365 can be used to access such messages.
2368 The message has been processed by a
2370 command and it will be retained in its current location.
2373 The message has been processed by one of the following commands:
2379 command is used, messages that are in a
2381 .Sx "primary system mailbox"
2384 state when the mailbox is left will be deleted; they will be saved in the
2386 .Sx "secondary mailbox"
2388 when the internal variable
2394 In addition to these message states, flags which otherwise have no
2395 technical meaning in the mail system except allowing special ways of
2396 addressing them when
2397 .Sx "Specifying messages"
2398 can be set on messages.
2399 These flags are saved with messages and are thus persistent, and are
2400 portable between a set of widely used MUAs.
2402 .Bl -hang -width ".It Ic answered"
2404 Mark messages as having been answered.
2406 Mark messages as being a draft.
2408 Mark messages which need special attention.
2412 .\" .Ss "Specifying messages" {{{
2413 .Ss "Specifying messages"
2418 .Sx "Message list arguments" ,
2425 can perform actions on a number of messages at once.
2426 Specifying invalid messages, or using illegal syntax, will cause errors
2427 to be reported through the
2428 .Sx "INTERNAL VARIABLES"
2431 and companions, as well as the command exit status
2437 deletes the messages 1 and 2,
2440 will delete the messages 1 through 5.
2441 In sorted or threaded mode (see the
2445 will delete the messages that are located between (and including)
2446 messages 1 through 5 in the sorted/threaded order, as shown in the
2451 Errors can for example be
2453 when requesting an invalid message,
2455 if no applicable message can be found,
2456 .Va ^ERR Ns -CANCELED
2457 for missing informational data (mostly thread-related).
2459 for invalid syntax as well as
2461 for input/output errors can happen.
2462 The following special message names exist:
2465 .Bl -tag -width ".It Ar BaNg"
2467 The current message, the so-called
2471 The message that was previously the current message; needs to be quoted.
2474 The parent message of the current message,
2475 that is the message with the Message-ID given in the
2477 field or the last entry of the
2479 field of the current message.
2482 The previous undeleted message, or the previous deleted message for the
2488 ed mode, the previous such message in the according order.
2491 The next undeleted message, or the next deleted message for the
2497 ed mode, the next such message in the according order.
2500 The first undeleted message,
2501 or the first deleted message for the
2507 ed mode, the first such message in the according order.
2510 The last message; In
2514 ed mode, the last such message in the according order.
2522 mode, selects the message addressed with
2526 is any other message specification,
2527 and all messages from the thread that begins at it.
2528 Otherwise it is identical to
2533 the thread beginning with the current message is selected.
2539 All messages that were included in the
2540 .Sx "Message list arguments"
2541 of the previous command; needs to be quoted.
2542 (A convenient way to read all new messages is to select them via
2544 as below, and then to read them in order with the default command \(em
2546 \(em simply by successively typing
2553 An inclusive range of message numbers.
2554 Selectors that may also be used as endpoints include any of
2559 .Dq any substring matches
2562 header, which will match addresses (too) even if
2564 is set (and POSIX says
2565 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2568 variable is set, only the local part of the address is evaluated
2569 for the comparison, not ignoring case, and the setting of
2571 is completely ignored.
2572 For finer control and match boundaries use the
2576 .It Ar / Ns Ar string
2577 All messages that contain
2579 in the subject field (case ignored according to locale).
2586 the string from the previous specification of that type is used again.
2589 .It Xo Op Ar @ Ns Ar name-list Ns
2592 All messages that contain the given case-insensitive search
2594 ession; If the \*(OPal regular expression support is available
2596 will be interpreted as (an extended) one if any of the
2598 .Sx "magic regular expression characters"
2601 .Ar @ Ns Ar name-list
2602 part is missing the search is restricted to the subject field body,
2605 specifies a comma-separated list of header fields to search, for example
2608 .Dl '@to,from,cc@Someone i ought to know'
2611 In order to search for a string that includes a
2613 (commercial at) character the
2615 is effectively non-optional, but may be given as the empty string.
2616 Also, specifying an empty search
2618 ession will effectively test for existence of the given header fields.
2619 Some special header fields may be abbreviated:
2633 respectively and case-insensitively.
2634 \*(OPally, and just like
2637 will be interpreted as (an extended) regular expression if any of the
2639 .Sx "magic regular expression characters"
2647 can be used to search in (all of) the header(s) of the message, and the
2656 will perform full text searches \(en whereas the former searches only
2657 the body, the latter also searches the message header (\*(ID this mode
2658 yet brute force searches over the entire decoded content of messages,
2659 including administrativa strings).
2662 This specification performs full text comparison, but even with
2663 regular expression support it is almost impossible to write a search
2664 expression that safely matches only a specific address domain.
2665 To request that the body content of the header is treated as a list of
2666 addresses, and to strip those down to the plain email address which the
2667 search expression is to be matched against, prefix the effective
2673 .Dl '@~f,c@@a\e.safe\e.domain\e.match$'
2677 All messages of state or with matching condition
2681 is one or multiple of the following colon modifiers:
2683 .Bl -tag -compact -width ".It Ar :M"
2686 messages (cf. the variable
2687 .Va markanswered ) .
2699 Messages with receivers that match
2703 Messages with receivers that match
2710 Old messages (any not in state
2718 \*(OP Messages with unsure spam classification (see
2719 .Sx "Handling spam" ) .
2721 \*(OP Messages classified as spam.
2733 \*(OP IMAP-style SEARCH expressions may also be used.
2734 These consist of keywords and criterions, and because
2735 .Sx "Message list arguments"
2736 are split into tokens according to
2737 .Sx "Shell-style argument quoting"
2738 it is necessary to quote the entire IMAP search expression in order to
2739 ensure that it remains a single token.
2740 This addressing mode is available with all types of mailbox
2742 s; \*(UA will perform the search locally as necessary.
2743 Strings must be enclosed by double quotation marks
2745 in their entirety if they contain whitespace or parentheses;
2746 within the quotes, only reverse solidus
2748 is recognized as an escape character.
2749 All string searches are case-insensitive.
2750 When the description indicates that the
2752 representation of an address field is used,
2753 this means that the search string is checked against both a list
2756 .Bd -literal -offset indent
2757 \&'(\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)'
2762 and the addresses without real names from the respective header field.
2763 These search expressions can be nested using parentheses, see below for
2767 .Bl -tag -compact -width ".It Ar _n_u"
2768 .It Ar ( criterion )
2769 All messages that satisfy the given
2771 .It Ar ( criterion1 criterion2 ... criterionN )
2772 All messages that satisfy all of the given criteria.
2774 .It Ar ( or criterion1 criterion2 )
2775 All messages that satisfy either
2780 To connect more than two criteria using
2782 specifications have to be nested using additional parentheses,
2784 .Ql (or a (or b c)) ,
2788 .Ql ((a or b) and c) .
2791 operation of independent criteria on the lowest nesting level,
2792 it is possible to achieve similar effects by using three separate
2796 .It Ar ( not criterion )
2797 All messages that do not satisfy
2799 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2800 All messages that contain
2802 in the envelope representation of the
2805 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2806 All messages that contain
2808 in the envelope representation of the
2811 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2812 All messages that contain
2814 in the envelope representation of the
2817 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2818 All messages that contain
2823 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2824 All messages that contain
2826 in the envelope representation of the
2829 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2830 All messages that contain
2835 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2836 All messages that contain
2839 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2840 All messages that contain
2842 in their header or body.
2843 .It Ar ( larger size )
2844 All messages that are larger than
2847 .It Ar ( smaller size )
2848 All messages that are smaller than
2852 .It Ar ( before date )
2853 All messages that were received before
2855 which must be in the form
2859 denotes the day of the month as one or two digits,
2861 is the name of the month \(en one of
2862 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2865 is the year as four digits, for example
2869 All messages that were received on the specified date.
2870 .It Ar ( since date )
2871 All messages that were received since the specified date.
2872 .It Ar ( sentbefore date )
2873 All messages that were sent on the specified date.
2874 .It Ar ( senton date )
2875 All messages that were sent on the specified date.
2876 .It Ar ( sentsince date )
2877 All messages that were sent since the specified date.
2879 The same criterion as for the previous search.
2880 This specification cannot be used as part of another criterion.
2881 If the previous command line contained more than one independent
2882 criterion then the last of those criteria is used.
2886 .\" .Ss "On terminal control and line editor" {{{ review
2887 .Ss "On terminal control and line editor"
2889 \*(OP Terminal control through one of the standard
2898 inal defined in the environment interactive usage aspects, for example
2899 .Sx "Coloured display" ,
2900 and insight of cursor and function keys for the Mailx-Line-Editor
2901 (MLE), will be enhanced or enabled.
2902 Library interaction can be disabled on a per-invocation basis via
2903 .Va termcap-disable ,
2904 whereas the internal variable
2906 is always used as a preferred source of terminal capabilities.
2907 (For a usage example see the
2910 .Sx "Not \(dqdefunctional\(dq, but the editor key does not work" . )
2913 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2914 environments which comply to the ISO C standard
2916 and will support wide glyphs if possible (the necessary functionality
2917 had been removed from ISO C, but was included in
2919 Usage of a line editor in interactive mode can be prevented by setting
2920 .Va line-editor-disable .
2921 Especially if the \*(OPal terminal control support is missing setting
2924 will help shall the MLE misbehave, see there for more.
2925 The MLE can support a little bit of
2931 feature is available then input from line editor prompts will be saved
2932 in a history list that can be searched in and be expanded from.
2933 Such saving can be prevented by prefixing input with any amount of
2935 Aspects of history, like allowed content and maximum size, as well as
2936 whether history shall be saved persistently, can be configured with the
2940 .Va history-gabby-persist
2943 There also exists the macro hook
2944 .Va on-history-addition
2945 which can be used to apply finer control on what enters history.
2948 The MLE supports a set of editing and control commands.
2949 By default (as) many (as possible) of these will be assigned to a set of
2950 single-letter control codes, which should work on any terminal (and can
2951 be generated by holding the
2953 key while pressing the key of desire, for example
2957 command is available then the MLE commands can also be accessed freely
2958 by assigning the command name, which is shown in parenthesis in the list
2959 below, to any desired key-sequence, and the MLE will instead and also use
2961 to establish its built-in key bindings
2962 (more of them if the \*(OPal terminal control is available),
2963 an action which can then be suppressed completely by setting
2964 .Va line-editor-no-defaults .
2965 .Sx "Shell-style argument quoting"
2966 notation is used in the following:
2970 .Bl -tag -compact -width ".It Ql \eBa"
2972 Go to the start of the line
2974 .Pf ( Cd mle-go-home ) .
2977 Move the cursor backward one character
2979 .Pf ( Cd mle-go-bwd ) .
2985 .Pf ( Cd mle-raise-int ) .
2988 Forward delete the character under the cursor;
2989 quits \*(UA if used on the empty line unless the internal variable
2993 .Pf ( Cd mle-del-fwd ) .
2996 Go to the end of the line
2998 .Pf ( Cd mle-go-end ) .
3001 Move the cursor forward one character
3003 .Pf ( Cd mle-go-fwd ) .
3006 Cancel current operation, full reset.
3007 If there is an active history search or tabulator expansion then this
3008 command will first reset that, reverting to the former line content;
3009 thus a second reset is needed for a full reset in this case
3011 .Pf ( Cd mle-reset ) .
3014 Backspace: backward delete one character
3016 .Pf ( Cd mle-del-bwd ) .
3020 Horizontal tabulator:
3021 try to expand the word before the cursor, supporting the usual
3022 .Sx "Filename transformations"
3024 .Pf ( Cd mle-complete ;
3026 .Cd mle-quote-rndtrip
3028 .Va line-editor-cpl-word-breaks ) .
3032 commit the current line
3034 .Pf ( Cd mle-commit ) .
3037 Cut all characters from the cursor to the end of the line
3039 .Pf ( Cd mle-snarf-end ) .
3044 .Pf ( Cd mle-repaint ) .
3047 \*(OP Go to the next history entry
3049 .Pf ( Cd mle-hist-fwd ) .
3052 (\*(OPally context-dependent) Invokes the command
3056 \*(OP Go to the previous history entry
3058 .Pf ( Cd mle-hist-bwd ) .
3061 Toggle roundtrip mode shell quotes, where produced,
3064 .Pf ( Cd mle-quote-rndtrip ) .
3065 This setting is temporary, and will be forgotten once the command line
3066 is committed; also see
3070 \*(OP Complete the current line from (the remaining) older history entries
3072 .Pf ( Cd mle-hist-srch-bwd ) .
3075 \*(OP Complete the current line from (the remaining) newer history entries
3077 .Pf ( Cd mle-hist-srch-fwd ) .
3080 Paste the snarf buffer
3082 .Pf ( Cd mle-paste ) .
3090 .Pf ( Cd mle-snarf-line ) .
3093 Prompts for a Unicode character (hexadecimal number without prefix, see
3097 .Pf ( Cd mle-prompt-char ) .
3098 Note this command needs to be assigned to a single-letter control code
3099 in order to become recognized and executed during input of
3100 a key-sequence (only three single-letter control codes can be used for
3101 that shortcut purpose); this control code is then special-treated and
3102 thus cannot be part of any other sequence (because it will trigger the
3103 .Cd \&\&mle-prompt-char
3104 function immediately).
3107 Cut the characters from the one preceding the cursor to the preceding
3110 .Pf ( Cd mle-snarf-word-bwd ) .
3113 Move the cursor forward one word boundary
3115 .Pf ( Cd mle-go-word-fwd ) .
3118 Move the cursor backward one word boundary
3120 .Pf ( Cd mle-go-word-bwd ) .
3126 .Pf ( Cd mle-raise-tstp ) .
3129 Escape: reset a possibly used multibyte character input state machine
3130 and \*(OPally a lingering, incomplete key binding
3132 .Pf ( Cd mle-cancel ) .
3133 This command needs to be assigned to a single-letter control code in
3134 order to become recognized and executed during input of a key-sequence
3135 (only three single-letter control codes can be used for that shortcut
3137 This control code may also be part of a multi-byte sequence, but if
3138 a sequence is active and the very control code is currently also an
3139 expected input, then the active sequence takes precedence and will
3140 consume the control code.
3143 (\*(OPally context-dependent) Invokes the command
3147 (\*(OPally context-dependent) Invokes the command
3151 (\*(OPally context-dependent) Invokes the command
3155 Cut the characters from the one after the cursor to the succeeding word
3158 .Pf ( Cd mle-snarf-word-fwd ) .
3167 ring the audible bell.
3172 .Cd mle-clear-screen :
3173 move the cursor home and clear the screen.
3180 this will immediately reset a possibly active search etc.
3184 .Cd mle-go-screen-bwd :
3185 move the cursor backward one screen width.
3189 .Cd mle-go-screen-fwd :
3190 move the cursor forward one screen width.
3200 .\" .Ss "Coloured display" {{{ review
3201 .Ss "Coloured display"
3203 \*(OP Colours and font attributes through ANSI a.k.a. ISO 6429 SGR
3204 (select graphic rendition) escape sequences are optionally supported.
3205 Usage of colours and font attributes solely depends upon the
3206 capability of the detected terminal type
3208 and as fine-tuned through
3210 Colours and font attributes can be managed with the multiplexer command
3214 removes the given mappings.
3217 suppresses usage of colour and font attribute sequences, while leaving
3218 established mappings unchanged.
3221 Whether actually applicable colour and font attribute sequences should
3222 also be generated when output is going to be paged through the external
3226 ) depends upon the setting of
3228 because pagers usually need to be configured in order to support ISO
3230 Knowledge of some widely used pagers is however built-in, and in a clean
3231 environment it is often enough to simply set
3233 please refer to that variable for more on this topic.
3236 It might make sense to conditionalize colour setup on interactive mode via
3242 .Bd -literal -offset indent
3243 if terminal && "$features" =% ,+colour,
3244 colour iso view-msginfo ft=bold,fg=green
3245 colour iso view-header ft=bold,fg=red (from|subject) # regex
3246 colour iso view-header fg=red
3248 uncolour iso view-header from,subject
3249 colour iso view-header ft=bold,fg=magenta,bg=cyan
3250 colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3251 colour mono view-header ft=bold
3252 colour mono view-header ft=bold,ft=reverse subject,from
3257 .\" .Ss "Handling spam" {{{
3260 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3261 identification of, and, in general, dealing with spam messages.
3262 A precondition of most commands in order to function is that the
3264 variable is set to one of the supported interfaces.
3265 .Sx "Specifying messages"
3266 that have been identified as spam is possible via their (volatile)
3272 specifications, and their
3274 entries will be used when displaying the
3282 rates the given messages and sets their
3285 If the spam interface offers spam scores these can be shown in
3294 will interact with the Bayesian filter of the chosen interface and learn
3295 the given messages as
3299 respectively; the last command can be used to cause
3301 of messages; it adheres to their current
3303 state and thus reverts previous teachings.
3308 will simply set and clear, respectively, the mentioned volatile
3310 message flag, without any interface interaction.
3319 requires a running instance of the
3321 server in order to function, started with the option
3323 shall Bayesian filter learning be possible.
3325 .Bd -literal -offset indent
3326 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3327 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3328 --daemonize [--local] [--allow-tell]
3332 Thereafter \*(UA can make use of these interfaces:
3334 .Bd -literal -offset indent
3335 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3336 -Sspamc-command=/usr/local/bin/spamc \e
3337 -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3339 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3340 -Sspamc-command=/usr/local/bin/spamc \e
3341 -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3345 Using the generic filter approach allows usage of programs like
3347 Here is an example, requiring it to be accessible via
3350 .Bd -literal -offset indent
3351 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3352 -Sspamfilter-ham="bogofilter -n" \e
3353 -Sspamfilter-noham="bogofilter -N" \e
3354 -Sspamfilter-nospam="bogofilter -S" \e
3355 -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3356 -Sspamfilter-spam="bogofilter -s" \e
3357 -Sspamfilter-rate-scanscore="1;^(.+)$"
3361 Because messages must exist on local storage in order to be scored (or
3362 used for Bayesian filter training), it is possibly a good idea to
3363 perform the local spam check last.
3364 Spam can be checked automatically when opening specific folders by
3365 setting a specialized form of the internal variable
3368 .Bd -literal -offset indent
3369 define spamdelhook {
3371 spamset (header x-dcc-brand-metrics "bulk")
3372 # Server-side spamassassin(1)
3373 spamset (header x-spam-flag "YES")
3374 del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3380 set folder-hook-SOMEFOLDER=spamdelhook
3384 See also the documentation for the variables
3385 .Va spam-interface , spam-maxsize ,
3386 .Va spamc-command , spamc-arguments , spamc-user ,
3387 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3390 .Va spamfilter-rate-scanscore .
3393 .\" }}} (DESCRIPTION)
3396 .\" .Sh COMMANDS {{{
3399 \*(UA reads input in lines.
3400 An unquoted reverse solidus
3402 at the end of a command line
3404 the newline character: it is discarded and the next line of input is
3405 used as a follow-up line, with all leading whitespace removed;
3406 once an entire line is completed, the whitespace characters
3407 .Cm space , tabulator , newline
3408 as well as those defined by the variable
3410 are removed from the beginning and end.
3411 Placing any whitespace characters at the beginning of a line will
3412 prevent a possible addition of the command line to the \*(OPal
3416 The beginning of such input lines is then scanned for the name of
3417 a known command: command names may be abbreviated, in which case the
3418 first command that matches the given prefix will be used.
3419 .Sx "Command modifiers"
3420 may prefix a command in order to modify its behaviour.
3421 A name may also be a
3423 which will become expanded until no more expansion is possible.
3424 Once the command that shall be executed is known, the remains of the
3425 input line will be interpreted according to command-specific rules,
3426 documented in the following.
3429 This behaviour is different to the
3431 ell, which is a programming language with syntactic elements of clearly
3432 defined semantics, and therefore capable to sequentially expand and
3433 evaluate individual elements of a line.
3434 .Ql \&? set one=value two=$one
3435 for example will never possibly assign value to one, because the
3436 variable assignment is performed no sooner but by the command
3438 long after the expansion happened.
3441 A list of all commands in lookup order is dumped by the command
3443 \*(OPally the command
3447 when given an argument, will show a documentation string for the
3448 command matching the expanded argument, as in
3450 which should be a shorthand of
3452 with these documentation strings both commands support a more
3454 listing mode which includes the argument type of the command and other
3455 information which applies; a handy suggestion might thus be:
3457 .Bd -literal -offset indent
3459 # Before v15: need to enable sh(1)ell-style on _entire_ line!
3460 localopts yes;wysh set verbose;ignerr eval "${@}";return ${?}
3462 ? commandalias xv '\ecall __xv'
3466 .\" .Ss "Command modifiers" {{{
3467 .Ss "Command modifiers"
3469 Commands may be prefixed by none to multiple command modifiers.
3470 Some command modifiers can be used with a restricted set of commands
3475 will (\*(OPally) show which modifiers apply.
3479 The modifier reverse solidus
3482 to be placed first, prevents
3484 expansions on the remains of the line, for example
3486 will always evaluate the command
3488 even if an (command)alias of the same name exists.
3490 content may itself contain further command modifiers, including
3491 an initial reverse solidus to prevent further expansions.
3497 indicates that any error generated by the following command should be
3498 ignored by the state machine and not cause a program exit with enabled
3500 or for the standardized exit cases in
3505 .Sx "INTERNAL VARIABLES" ,
3506 will be set to the real exit status of the command regardless.
3511 will alter the called command to apply changes only temporarily,
3512 local to block-scope, and can thus only be used inside of a
3517 Specifying it implies the modifier
3519 Local variables will not be inherited by macros deeper in the
3521 chain, and all local settings will be garbage collected once the local
3523 To record and unroll changes in the global scope use the command
3529 does yet not implement any functionality.
3534 does yet not implement any functionality.
3537 Some commands support the
3540 modifier: if used, they expect the name of a variable, which can itself
3541 be a variable, i.e., shell expansion is applied, as their first
3542 argument, and will place their computation result in it instead of the
3543 default location (it is usually written to standard output).
3545 The given name will be tested for being a valid
3547 variable name, and may therefore only consist of upper- and lowercase
3548 characters, digits, and the underscore; the hyphen-minus may be used as
3549 a non-portable extension; digits may not be used as first, hyphen-minus
3550 may not be used as last characters.
3551 In addition the name may either not be one of the known
3552 .Sx "INTERNAL VARIABLES" ,
3553 or must otherwise refer to a writable (non-boolean) value variable.
3554 The actual put operation may fail nonetheless, for example if the
3555 variable expects a number argument only a number will be accepted.
3556 Any error during these operations causes the command as such to fail,
3557 and the error number
3560 .Va ^ERR Ns -NOTSUP ,
3565 but some commands deviate from the latter, which is documented.
3568 Last, but not least, the modifier
3571 can be used for some old and established commands to choose the new
3572 .Sx "Shell-style argument quoting"
3573 rules over the traditional
3574 .Sx "Old-style argument quoting" .
3575 This modifier is implied if
3577 is set to a non-empty value.
3581 .\" .Ss "Old-style argument quoting" v15-compat: rename Obsolete.. {{{
3582 .Ss "Old-style argument quoting"
3584 \*(ID This section documents the traditional and POSIX standardized
3585 style of quoting non-message list arguments to commands which expect
3586 this type of arguments: whereas still used by the majority of such
3588 .Sx "Shell-style argument quoting"
3589 may be available even for those via
3592 .Sx "Command modifiers" .
3593 Nonetheless care must be taken, because only new commands have been
3594 designed with all the capabilities of the new quoting rules in mind,
3595 which can, for example generate control characters.
3598 .Bl -bullet -offset indent
3600 An argument can be enclosed between paired double-quotes
3605 any whitespace, shell word expansion, or reverse solidus characters
3606 (except as described next) within the quotes are treated literally as
3607 part of the argument.
3608 A double-quote will be treated literally within single-quotes and vice
3610 Inside such a quoted string the actually used quote character can be
3611 used nonetheless by escaping it with a reverse solidus
3617 An argument that is not enclosed in quotes, as above, can usually still
3618 contain space characters if those spaces are reverse solidus escaped, as in
3622 A reverse solidus outside of the enclosing quotes is discarded
3623 and the following character is treated literally as part of the argument.
3627 .\" .Ss "Shell-style argument quoting" {{{
3628 .Ss "Shell-style argument quoting"
3631 ell-style, and therefore POSIX standardized, argument parsing and
3632 quoting rules are used by most commands.
3633 \*(ID Most new commands only support these new rules and are flagged
3634 \*(NQ, some elder ones can use them with the command modifier
3636 in the future only this type of argument quoting will remain.
3639 A command line is parsed from left to right and an input token is
3640 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3641 Metacharacters are vertical bar
3647 as well as all characters from the variable
3650 .Cm space , tabulator , newline .
3651 The additional metacharacters left and right parenthesis
3653 and less-than and greater-than signs
3657 supports are not used, and are treated as ordinary characters: for one
3658 these characters are a vivid part of email addresses, and it seems
3659 highly unlikely that their function will become meaningful to \*(UA.
3661 .Bd -filled -offset indent
3662 .Sy Compatibility note:
3663 \*(ID Please note that even many new-style commands do not yet honour
3665 to parse their arguments: whereas the
3667 ell is a language with syntactic elements of clearly defined semantics,
3668 \*(UA parses entire input lines and decides on a per-command base what
3669 to do with the rest of the line.
3670 This also means that whenever an unknown command is seen all that \*(UA
3671 can do is cancellation of the processing of the remains of the line.
3673 It also often depends on an actual subcommand of a multiplexer command
3674 how the rest of the line should be treated, and until v15 we are not
3675 capable to perform this deep inspection of arguments.
3676 Nonetheless, at least the following commands which work with positional
3677 parameters fully support
3679 for an almost shell-compatible field splitting:
3680 .Ic call , call_if , read , vpospar , xcall .
3684 Any unquoted number sign
3686 at the beginning of a new token starts a comment that extends to the end
3687 of the line, and therefore ends argument processing.
3688 An unquoted dollar sign
3690 will cause variable expansion of the given name, which must be a valid
3692 ell-style variable name (see
3694 .Sx "INTERNAL VARIABLES"
3697 (shell) variables can be accessed through this mechanism, brace
3698 enclosing the name is supported (i.e., to subdivide a token).
3701 Whereas the metacharacters
3702 .Cm space , tabulator , newline
3703 only complete an input token, vertical bar
3709 also act as control operators and perform control functions.
3710 For now supported is semicolon
3712 which terminates a single command, therefore sequencing the command line
3713 and making the remainder of the line a subject to reevaluation.
3714 With sequencing, multiple command argument types and quoting rules may
3715 therefore apply to a single line, which can become problematic before
3716 v15: e.g., the first of the following will cause surprising results.
3719 .Dl ? echo one; set verbose; echo verbose=$verbose.
3720 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3723 Quoting is a mechanism that will remove the special meaning of
3724 metacharacters and reserved words, and will prevent expansion.
3725 There are four quoting mechanisms: the escape character, single-quotes,
3726 double-quotes and dollar-single-quotes:
3729 .Bl -bullet -offset indent
3731 The literal value of any character can be preserved by preceding it
3732 with the escape character reverse solidus
3736 Arguments which are enclosed in
3737 .Ql 'single-\:quotes'
3738 retain their literal value.
3739 A single-quote cannot occur within single-quotes.
3742 The literal value of all characters enclosed in
3743 .Ql \(dqdouble-\:quotes\(dq
3744 is retained, with the exception of dollar sign
3746 which will cause variable expansion, as above, backquote (grave accent)
3748 (which not yet means anything special), reverse solidus
3750 which will escape any of the characters dollar sign
3752 (to prevent variable expansion), backquote (grave accent)
3756 (to prevent ending the quote) and reverse solidus
3758 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3759 but has no special meaning otherwise.
3762 Arguments enclosed in
3763 .Ql $'dollar-\:single-\:quotes'
3764 extend normal single quotes in that reverse solidus escape sequences are
3765 expanded as follows:
3767 .Bl -tag -compact -width ".Ql \eNNN"
3769 bell control character (ASCII and ISO-10646 BEL).
3771 backspace control character (ASCII and ISO-10646 BS).
3773 escape control character (ASCII and ISO-10646 ESC).
3777 form feed control character (ASCII and ISO-10646 FF).
3779 line feed control character (ASCII and ISO-10646 LF).
3781 carriage return control character (ASCII and ISO-10646 CR).
3783 horizontal tabulator control character (ASCII and ISO-10646 HT).
3785 vertical tabulator control character (ASCII and ISO-10646 VT).
3787 emits a reverse solidus character.
3791 double quote (escaping is optional).
3793 eight-bit byte with the octal value
3795 (one to three octal digits), optionally prefixed by an additional
3797 A 0 byte will suppress further output for the quoted argument.
3799 eight-bit byte with the hexadecimal value
3801 (one or two hexadecimal characters, no prefix, see
3803 A 0 byte will suppress further output for the quoted argument.
3805 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3807 (one to eight hexadecimal characters) \(em note that Unicode defines the
3808 maximum codepoint ever to be supported as
3813 This escape is only supported in locales that support Unicode (see
3814 .Sx "Character sets" ) ,
3815 in other cases the sequence will remain unexpanded unless the given code
3816 point is ASCII compatible or (if the \*(OPal character set conversion is
3817 available) can be represented in the current locale.
3818 The character NUL will suppress further output for the quoted argument.
3822 except it takes only one to four hexadecimal characters.
3824 Emits the non-printable (ASCII and compatible) C0 control codes
3825 0 (NUL) to 31 (US), and 127 (DEL).
3826 Printable representations of ASCII control codes can be created by
3827 mapping them to a different, visible part of the ASCII character set.
3828 Adding the number 64 achieves this for the codes 0 to 31, here 7 (BEL):
3829 .Ql 7 + 64 = 71 = G .
3830 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3832 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3833 .Ql \&?\0vexpr\0^\0127\064 .
3835 Whereas historically circumflex notation has often been used for
3836 visualization purposes of control codes, as in
3838 the reverse solidus notation has been standardized:
3840 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3846 whenever such an alias exists it will be used for display purposes.
3847 The control code NUL
3849 a non-standard extension) will suppress further output for the remains
3850 of the token (which may extend beyond the current quote), or, depending
3851 on the context, the remains of all arguments for the current command.
3853 Non-standard extension: expand the given variable name, as above.
3854 Brace enclosing the name is supported.
3856 Not yet supported, just to raise awareness: Non-standard extension.
3863 .Bd -literal -offset indent
3864 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3865 ? echo Quotes ${HOME} and tokens differ! # comment
3866 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3870 .\" .Ss "Message list arguments" {{{
3871 .Ss "Message list arguments"
3873 Many commands operate on message list specifications, as documented in
3874 .Sx "Specifying messages" .
3875 The argument input is first split into individual tokens via
3876 .Sx "Shell-style argument quoting" ,
3877 which are then interpreted as the mentioned specifications.
3878 If no explicit message list has been specified, many commands will
3879 search for and use the next message forward that satisfies the commands'
3880 requirements, and if there are no messages forward of the current
3881 message, the search proceeds backwards;
3882 if there are no good messages at all to be found, an error message is
3883 shown and the command is aborted.
3886 output of the command
3888 will indicate whether a command searches for a default message, or not.
3891 .\" .Ss "Raw data arguments for codec commands" {{{
3892 .Ss "Raw data arguments for codec commands"
3894 A special set of commands, which all have the string
3900 take raw string data as input, which means that the content of the
3901 command input line is passed completely unexpanded and otherwise
3902 unchanged: like this the effect of the actual codec is visible without
3903 any noise of possible shell quoting rules etc., i.e., the user can input
3904 one-to-one the desired or questionable data.
3905 To gain a level of expansion, the entire command line can be
3907 uated first, for example
3909 .Bd -literal -offset indent
3910 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3912 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3914 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3915 ? eval shcodec d $res
3916 /usr/Sch\[:o]nes Wetter/heute.txt
3920 .\" .Ss "Filename transformations" {{{
3921 .Ss "Filename transformations"
3923 Filenames, where expected, and unless documented otherwise, are
3924 subsequently subject to the following filename transformations, in
3927 .Bl -bullet -offset indent
3929 If the given name is a registered
3931 it will be replaced with the expanded shortcut.
3932 This step is mostly taken for
3937 The filename is matched against the following patterns or strings.
3941 expansion this step is mostly taken for
3947 .Bl -hang -compact -width ".Ar %user"
3949 (Number sign) is expanded to the previous file.
3952 (Percent sign) is replaced by the invoking
3953 .Mx -ix "primary system mailbox"
3954 user's primary system mailbox, which either is the (itself expandable)
3956 if that is set, the standardized absolute pathname indicated by
3958 if that is set, or a built-in compile-time default otherwise.
3961 the used name is actively checked for being a primary mailbox, first
3968 Expands to the primary system mailbox of
3970 (and never the value of
3972 regardless of its actual setting).
3975 (Ampersand) is replaced with the invoking user's
3976 .Mx -ix "secondary mailbox"
3977 secondary mailbox, the
3985 directory (if that variable is set).
3988 Expands to the same value as
3990 but has special meaning when used with, for example, the command
3992 the file will be treated as a primary system mailbox by, among others, the
3996 commands, meaning that messages that have been read in the current
3997 session will be moved to the
3999 mailbox instead of simply being flagged as read.
4004 Meta expansions may be applied to the resulting filename, as allowed by
4005 the operation and applicable to the resulting access protocol (also see
4006 .Sx "On URL syntax and credential lookup" ) .
4007 For the file-protocol, a leading tilde
4009 character will be replaced by the expansion of
4011 except when followed by a valid user name, in which case the home
4012 directory of the given user is used instead.
4014 A shell expansion as if specified in double-quotes (see
4015 .Sx "Shell-style argument quoting" )
4016 may be applied, so that any occurrence of
4020 will be replaced by the expansion of the variable, if possible;
4021 .Sx "INTERNAL VARIABLES"
4024 (shell) variables can be accessed through this mechanism.
4026 Shell pathname wildcard pattern expansions
4028 may be applied as documented.
4029 If the fully expanded filename results in multiple pathnames and the
4030 command is expecting only one file, an error results.
4032 In interactive context, in order to allow simple value acceptance (via
4034 arguments will usually be displayed in a properly quoted form, so a file
4035 .Ql diet\e is \ecurd.txt
4037 .Ql 'diet\e is \ecurd.txt' .
4041 .\" .Ss "Commands" {{{
4044 The following commands are available:
4046 .Bl -tag -width ".It Ic BaNg"
4053 command which follows, replacing unescaped exclamation marks with the
4054 previously executed command if the internal variable
4057 This command supports
4060 .Sx "Command modifiers" ,
4061 and manages the error number
4063 A 0 or positive exit status
4065 reflects the exit status of the command, negative ones that
4066 an error happened before the command was executed, or that the program
4067 did not exit cleanly, but maybe due to a signal: the error number is
4068 .Va ^ERR Ns -CHILD ,
4072 In conjunction with the
4074 modifier the following special cases exist:
4075 a negative exit status occurs if the collected data could not be stored
4076 in the given variable, which is a
4078 error that should otherwise not occur.
4079 .Va ^ERR Ns -CANCELED
4080 indicates that no temporary file could be created to collect the command
4081 output at first glance.
4082 In case of catchable out-of-memory situations
4084 will occur and \*(UA will try to store the empty string, just like with
4085 all other detected error conditions.
4090 The comment-command causes the entire line to be ignored.
4092 this really is a normal command which' purpose is to discard its
4095 indicating special character, which means that for example trailing
4096 comments on a line are not possible (except for commands which use
4097 .Sx "Shell-style argument quoting" ) .
4101 Goes to the next message in sequence and types it
4107 Display the preceding message, or the n'th previous message if given
4108 a numeric argument n.
4112 Shows the message number of the current message (the
4114 when used without arguments, that of the given list otherwise.
4115 Output numbers will be separated from each other with the first
4118 and followed by the first character of
4120 if that is not empty and not identical to the first.
4121 If that results in no separation at all a
4124 This command supports
4127 .Sx "Command modifiers" ) ,
4128 and manages the error number
4133 \*(OP Show a brief summary of commands.
4134 \*(OP Given an argument a synopsis for the command in question is
4135 shown instead; commands can be abbreviated in general and this command
4136 can be used to see the full expansion of an abbreviation including the
4137 synopsis, try, for example
4142 and see how the output changes.
4143 To avoid that aliases are resolved the modifier
4145 can be prepended to the argument, but note it must be quoted.
4146 This mode also supports a more
4148 output, which will provide the information documented for
4159 .It Ic account , unaccount
4160 (ac, una) Creates, selects or lists (an) account(s).
4161 Accounts are special incarnations of
4163 macros and group commands and variable settings which together usually
4164 arrange the environment for the purpose of creating an email account.
4165 Different to normal macros settings which are covered by
4167 \(en here by default enabled! \(en will not be reverted before the
4172 (case-insensitive) always exists, and all but it can be deleted by the
4173 latter command, and in one operation with the special name
4175 Also for all but it a possibly set
4176 .Va on-account-cleanup
4177 hook is called once they are left, also for program exit.
4179 Without arguments a listing of all defined accounts is shown.
4180 With one argument the given account is activated: the system
4182 of that account will be activated (as via
4184 a possibly installed
4186 will be run, and the internal variable
4189 The two argument form behaves identical to defining a macro as via
4191 Important settings for accounts include
4192 .Va folder , from , hostname , inbox , mta , password
4195 .Pf ( Sx "On URL syntax and credential lookup" ) ,
4196 as well as things like
4197 .Va tls-config-pairs
4198 .Pf ( Sx "Encrypted network communication" ) ,
4199 and protocol specifics like
4200 .Va imap-auth , pop3-auth , smtp-auth .
4201 .Bd -literal -offset indent
4203 set folder=~/mail inbox=+syste.mbox record=+sent.mbox
4204 set from='(My Name) myname@myisp.example'
4205 set mta=smtp://mylogin@smtp.myisp.example
4212 Perform email address codec transformations on raw-data argument, rather
4213 according to email standards (RFC 5322; \*(ID will furtherly improve).
4217 .Sx "Command modifiers" ) ,
4218 and manages the error number
4220 The first argument must be either
4221 .Ar [+[+[+]]]e[ncode] ,
4226 and specifies the operation to perform on the rest of the line.
4229 Decoding will show how a standard-compliant MUA will display the given
4230 argument, which should be an email address.
4231 Please be aware that most MUAs have difficulties with the address
4232 standards, and vary wildly when (comments) in parenthesis,
4234 strings, or quoted-pairs, as below, become involved.
4235 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4238 Skinning is identical to decoding but only outputs the plain address,
4239 without any string, comment etc. components.
4240 Another difference is that it may fail with the error number
4244 if decoding fails to find a(n) (valid) email address, in which case the
4245 unmodified input will be output again.
4249 first performs a skin operation, and thereafter checks a valid
4250 address for whether it is a registered mailing list (see
4254 eventually reporting that state in the error number
4257 .Va ^ERR Ns -EXIST .
4258 (This state could later become overwritten by an I/O error, though.)
4261 Encoding supports four different modes, lesser automated versions can be
4262 chosen by prefixing one, two or three plus signs: the standard imposes
4263 a special meaning on some characters, which thus have to be transformed
4264 to so-called quoted-pairs by pairing them with a reverse solidus
4266 in order to remove the special meaning; this might change interpretation
4267 of the entire argument from what has been desired, however!
4268 Specify one plus sign to remark that parenthesis shall be left alone,
4269 two for not turning double quotation marks into quoted-pairs, and three
4270 for also leaving any user-specified reverse solidus alone.
4271 The result will always be valid, if a successful exit status is reported
4272 (\*(ID the current parser fails this assertion for some constructs).
4273 \*(ID Addresses need to be specified in between angle brackets
4276 if the construct becomes more difficult, otherwise the current parser
4277 will fail; it is not smart enough to guess right.
4279 .Bd -literal -offset indent
4280 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4281 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4282 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4283 "Hey, you", \e out\e there <diet@exam.ple>
4284 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4291 .It Ic alias , unalias
4292 \*(NQ(a, una) Define or list, and remove, respectively, address aliases,
4293 which are a method of creating personal distribution lists that map
4294 a single name to none to multiple receivers, to be expanded after
4296 is left; the expansion correlates with
4298 The latter command removes all given aliases, the special name asterisk
4300 will remove all existing aliases.
4301 When used without arguments the former shows a list of all currently
4302 known aliases, with one argument only the target(s) of the given one.
4303 When given two arguments, hyphen-minus
4305 being the first, the target(s) of the second is/are expanded recursively.
4308 In all other cases the given alias is newly defined, or will be appended
4309 to: arguments must either be themselves valid alias names, or any
4310 other address type (see
4311 .Sx "On sending mail, and non-interactive mode" ) .
4312 Recursive expansion of aliases can be prevented by prefixing the desired
4313 argument with the modifier reverse solidus
4315 A valid alias name conforms to
4317 syntax, but follow-up characters can also be the number sign
4328 .Dq any character that has the high bit set .
4331 may be the last character.
4335 .Sx "Shell-style argument quoting" .
4338 .\" ALIASCOLON next sentence
4339 \*(ID Unfortunately the colon is currently not supported, as it
4340 interferes with normal address parsing rules.
4341 .\" ALIASCOLON next sentence
4342 \*(ID Such high bit characters will likely cause warnings at the moment
4343 for the same reasons why colon is unsupported; also, in the future
4344 locale dependent character set validity checks will be performed.
4346 .Bd -literal -offset indent
4347 ? alias cohorts bill jkf mark kridle@ucbcory ~/cohorts.mbox
4348 ? alias mark mark@exam.ple
4349 ? set mta-aliases=/etc/aliases
4355 .It Ic alternates , unalternates
4356 \*(NQ (alt) Manage a list of alternate addresses or names of the active
4357 user, members of which will be removed from recipient lists (except one).
4358 There is a set of implicit alternates which is formed of the values of
4368 The latter command removes the given list of alternates, the special name
4370 will discard all existing alternate names.
4372 The former command manages the error number
4374 It shows the current set of alternates when used without arguments; in
4375 this mode only it also supports
4378 .Sx "Command modifiers" ) .
4379 Otherwise the given arguments (after being checked for validity) are
4380 appended to the list of alternate names; in
4382 mode they replace that list instead.
4386 .It Ic answered , unanswered
4387 Take a message lists and mark each message as (not) having been answered.
4388 Messages will be marked answered when being
4390 to automatically if the
4394 .Sx "Message states" .
4399 .It Ic bind , unbind
4400 \*(OP\*(NQ The bind command extends the MLE (see
4401 .Sx "On terminal control and line editor" )
4402 with freely configurable key bindings.
4403 The latter command removes from the given context the given key binding,
4404 both of which may be specified as a wildcard
4408 will remove all bindings of all contexts.
4409 Due to initialization order unbinding will not work for built-in key
4410 bindings upon program startup, however: please use
4411 .Va line-editor-no-defaults
4412 for this purpose instead.
4415 With zero arguments, or with a context name the former command shows
4416 all key bindings (of the given context; an asterisk
4418 will iterate over all contexts); a more verbose listing will be
4419 produced if either of
4424 With two or more arguments a specific binding is shown, or
4425 (re)established: the first argument is the context to which the binding
4426 shall apply, the second argument is a comma-separated list of the
4428 which form the binding.
4429 Further arguments will be joined to form the expansion, and cause the
4430 binding to be created or updated.
4431 To indicate that a binding shall not be auto-committed, but that the
4432 expansion shall instead be furtherly editable by the user, a commercial at
4434 (that will be removed) can be placed last in the expansion, from which
4435 leading and trailing whitespace will finally be removed.
4436 Reverse solidus cannot be used as the last character of expansion.
4437 An empty expansion will be rejected.
4440 Contexts define when a binding applies, i.e., a binding will not be seen
4441 unless the context for which it is defined for is currently active.
4442 This is not true for the shared binding
4444 which is the foundation for all other bindings and as such always
4445 applies, its bindings, however, only apply secondarily.
4446 The available contexts are the shared
4450 context which is used in all not otherwise documented situations, and
4452 which applies only to
4453 .Sx "Compose mode" .
4456 Bindings are specified as a comma-separated list of byte-sequences,
4457 where each list entry corresponds to one
4460 Byte sequence boundaries will be forcefully terminated after
4461 .Va bind-inter-byte-timeout
4462 milliseconds, whereas key sequences can be timed out via
4463 .Va bind-inter-key-timeout .
4464 A list entry may, indicated by a leading colon character
4466 also refer to the name of a terminal capability; several dozen names
4467 are compiled in and may be specified either by their
4469 or, if existing, by their
4471 name, regardless of the actually used \*(OPal terminal control library.
4472 But any capability may be used, as long as the name is resolvable by the
4473 \*(OPal control library, or was defined via the internal variable
4475 Input sequences are not case-normalized, an exact match is required to
4476 update or remove a binding.
4477 It is advisable to use an initial escape or other control character (like
4479 for user (as opposed to purely terminal capability based) bindings in
4480 order to avoid ambiguities; it also reduces search time.
4483 .Bd -literal -offset indent
4484 ? bind base a,b echo one
4485 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4486 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc,Delete
4487 ? bind default $'\ecA',:khome,w 'echo Editable binding@'
4488 ? bind default a,b,c rm -irf / @ # Also editable
4489 ? bind default :kf1 File %
4490 ? bind compose :kf1 ~v
4494 Note that the entire comma-separated list is first parsed (over) as a
4495 shell-token with whitespace as the field separator, then parsed and
4496 expanded for real with comma as the field separator, therefore
4497 whitespace needs to be properly quoted, see
4498 .Sx "Shell-style argument quoting" .
4499 Using Unicode reverse solidus escape sequences renders a binding
4500 defunctional if the locale does not support Unicode (see
4501 .Sx "Character sets" ) ,
4502 and using terminal capabilities does so if no (corresponding) terminal
4503 control support is (currently) available.
4504 Adding, deleting or modifying a key binding invalidates the internal
4505 prebuilt lookup tree, it will be recreated as necessary: this process
4506 will be visualized in most
4513 The following terminal capability names are built-in and can be used in
4515 or (if available) the two-letter
4518 See the respective manual for a list of capabilities.
4521 can be used to show all the capabilities of
4523 or the given terminal type;
4526 flag will also show supported (non-standard) extensions.
4529 .Bl -tag -compact -width kcuuf_or_kcuuf
4530 .It Cd kbs Ns \0or Cd kb
4532 .It Cd kdch1 Ns \0or Cd kD
4534 .It Cd kDC Ns \0or Cd *4
4535 \(em shifted variant.
4536 .It Cd kel Ns \0or Cd kE
4537 Clear to end of line.
4538 .It Cd kext Ns \0or Cd @9
4540 .It Cd kich1 Ns \0or Cd kI
4542 .It Cd kIC Ns \0or Cd #3
4543 \(em shifted variant.
4544 .It Cd khome Ns \0or Cd kh
4546 .It Cd kHOM Ns \0or Cd #2
4547 \(em shifted variant.
4548 .It Cd kend Ns \0or Cd @7
4550 .It Cd knp Ns \0or Cd kN
4552 .It Cd kpp Ns \0or Cd kP
4554 .It Cd kcub1 Ns \0or Cd kl
4555 Left cursor (with more modifiers: see below).
4556 .It Cd kLFT Ns \0or Cd #4
4557 \(em shifted variant.
4558 .It Cd kcuf1 Ns \0or Cd kr
4559 Right cursor (ditto).
4560 .It Cd kRIT Ns \0or Cd %i
4561 \(em shifted variant.
4562 .It Cd kcud1 Ns \0or Cd kd
4563 Down cursor (ditto).
4565 \(em shifted variant (only terminfo).
4566 .It Cd kcuu1 Ns \0or Cd ku
4569 \(em shifted variant (only terminfo).
4570 .It Cd kf0 Ns \0or Cd k0
4572 Add one for each function key up to
4577 .It Cd kf10 Ns \0or Cd k;
4579 .It Cd kf11 Ns \0or Cd F1
4581 Add one for each function key up to
4589 Some terminals support key-modifier combination extensions, e.g.,
4591 For example, the delete key,
4593 in its shifted variant, the name is mutated to
4595 then a number is appended for the states
4607 .Ql Shift+Alt+Control
4609 The same for the left cursor key,
4611 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4616 \*(NQ Calls the given macro, which must have been created via
4618 (see there for more), otherwise an
4621 Calling macros recursively will at some time excess the stack size
4622 limit, causing a hard program abortion; if recursively calling a macro
4623 is the last command of the current macro, consider to use the command
4625 which will first release all resources of the current macro before
4626 replacing the current macro with the called one.
4633 if the given macro has been created via
4635 but does not fail nor warn if the macro does not exist.
4644 \*(OP Only applicable to S/MIME signed messages.
4645 Takes an optional message list and a filename and saves the certificates
4646 contained within the message signatures to the named file in both
4647 human-readable and PEM format.
4648 The certificates can later be used to send encrypted messages to the
4649 respective message senders by setting
4650 .Va smime-encrypt-USER@HOST
4655 .It Ic charsetalias , uncharsetalias
4656 \*(NQ Manage alias mappings for (conversion of)
4657 .Sx "Character sets" .
4658 Alias processing is not performed for
4659 .Sx "INTERNAL VARIABLES" ,
4662 and mappings are ineffective if character set conversion is not available
4666 Expansion happens recursively for cases where aliases point to other
4667 aliases (built-in loop limit: 8).
4669 The latter command deletes all aliases given as arguments,
4670 or all at once when given the asterisk
4672 The former shows the list of all currently defined aliases if used
4673 without arguments, or the target of the given single argument;
4674 when given two arguments, hyphen-minus
4676 being the first, the second is instead expanded recursively.
4677 In all other cases the given arguments are treated as pairs of character
4678 sets and their desired target alias name, creating new or updating
4679 already existing aliases.
4683 \*(NQ(ch) Change the working directory to
4685 or the given argument.
4691 .It Ic collapse , uncollapse
4697 Takes a message list and makes all replies to these messages invisible
4698 in header summaries, except for
4702 Also when a message with collapsed replies is displayed,
4703 all of these are automatically uncollapsed.
4704 The latter command undoes collapsing.
4707 .\" FIXME review until this point
4710 .It Ic colour , uncolour
4711 \*(OP\*(NQ Manage colour mappings of and for a
4712 .Sx "Coloured display" .
4713 Without arguments the former shows all currently defined mappings.
4714 Otherwise a colour type is expected (case-insensitively),
4717 for 256-colour terminals,
4722 for the standard 8-colour ANSI / ISO 6429 colour palette, and
4726 for monochrome terminals, which only support (some) font attributes.
4727 Without further arguments the list of all currently defined mappings
4728 of the given type is shown (here the special
4732 also show all currently defined mappings).
4735 Otherwise the second argument defines the mappable slot, the third
4736 argument a (comma-separated list of) colour and font attribute
4737 specification(s), and the optionally supported fourth argument can be
4738 used to specify a precondition: if conditioned mappings exist they are
4739 tested in (creation) order unless a (case-insensitive) match has been
4740 found, and the default mapping (if any has been established) will only
4741 be chosen as a last resort.
4742 The types of available preconditions depend on the mappable slot,
4743 the following of which exist:
4746 Mappings prefixed with
4748 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4749 .Sx "On terminal control and line editor" )
4750 and do not support preconditions.
4752 .Bl -tag -compact -width view-partinfo
4754 This mapping is used for the position indicator that is visible when
4755 a line cannot be fully displayed on the screen.
4760 Used for the occasionally appearing error indicator that is joined onto
4762 \*(ID Also used for error messages written on standard error .
4766 Mappings prefixed with
4768 are used in header summaries, and they all understand the preconditions
4770 (the current message) and
4772 for elder messages (only honoured in conjunction with
4773 .Va datefield-markout-older ) .
4775 .Bl -tag -compact -width view-partinfo
4777 This mapping is used for the
4779 that can be created with the
4783 formats of the variable
4786 For the complete header summary line except the
4788 and the thread structure.
4790 For the thread structure which can be created with the
4792 format of the variable
4797 Mappings prefixed with
4799 are used when displaying messages.
4801 .Bl -tag -compact -width view-partinfo
4803 This mapping is used for so-called
4805 lines, which are MBOX file format specific header lines (also see
4806 .Va mbox-rfc4155 ) .
4809 A comma-separated list of headers to which the mapping applies may be
4810 given as a precondition; if the \*(OPal regular expression support is
4811 available then if any of the
4813 .Sx "magic regular expression characters"
4814 is seen the precondition will be evaluated as (an extended) one.
4816 For the introductional message info line.
4817 .It Ar view-partinfo
4818 For MIME part info lines.
4822 The following (case-insensitive) colour definitions and font attributes
4823 are understood, multiple of which can be specified in a comma-separated
4833 It is possible (and often applicable) to specify multiple font
4834 attributes for a single mapping.
4837 foreground colour attribute, in order (numbers 0 - 7)
4847 To specify a 256-colour mode a decimal number colour specification in
4848 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4850 .Bl -tag -compact -width "999 - 999"
4852 the standard ISO 6429 colours, as above.
4854 high intensity variants of the standard colours.
4856 216 colours in tuples of 6.
4858 grayscale from black to white in 24 steps.
4860 .Bd -literal -offset indent
4862 fg() { printf "\e033[38;5;${1}m($1)"; }
4863 bg() { printf "\e033[48;5;${1}m($1)"; }
4865 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4866 printf "\e033[0m\en"
4868 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4869 printf "\e033[0m\en"
4873 background colour attribute (see
4875 for possible values).
4881 will remove for the given colour type (the special type
4883 selects all) the given mapping; if the optional precondition argument is
4884 given only the exact tuple of mapping and precondition is removed.
4887 will remove all mappings (no precondition allowed), thus
4889 will remove all established mappings.
4894 .It Ic commandalias , uncommandalias
4895 \*(NQ Define or list, and remove, respectively, command aliases.
4896 An (command)alias can be used everywhere a normal command can be used,
4897 but always takes precedence: any arguments that are given to the command
4898 alias are joined onto the alias expansion, and the resulting string
4899 forms the command line that is, in effect, executed.
4900 The latter command removes all given aliases, the special name asterisk
4902 will remove all existing aliases.
4903 When used without arguments the former shows a list of all currently
4904 known aliases, with one argument only the expansion of the given one.
4906 With two or more arguments a command alias is defined or updated: the
4907 first argument is the name under which the remaining command line should
4908 be accessible, the content of which can be just about anything.
4909 An alias may itself expand to another alias, but to avoid expansion loops
4910 further expansion will be prevented if an alias refers to itself or if
4911 an expansion depth limit is reached.
4912 Explicit expansion prevention is available via reverse solidus
4915 .Sx "Command modifiers" .
4916 .Bd -literal -offset indent
4918 \*(uA: `commandalias': no such alias: xx
4919 ? commandalias xx echo hello,
4921 commandalias xx 'echo hello,'
4932 but copy the messages to a file named after the local part of the
4933 sender of the first message instead of taking a filename argument;
4935 is inspected to decide on the actual storage location.
4939 (c) Copy messages to the named file and do not mark them as being saved;
4940 otherwise identical to
4946 \*(NQ A multiplexer command which provides C-style string operations on
4947 8-bit bytes without a notion of locale settings and character sets,
4948 effectively assuming ASCII data.
4949 For numeric and other operations refer to
4953 .Sx "Command modifiers" ,
4957 for usage errors and numeric results, the empty string otherwise;
4958 missing data errors, as for unsuccessful searches, result in the
4960 error number being set to
4961 .Va ^ERR Ns -NODATA .
4962 Where the question mark
4964 modifier suffix is supported, a case-insensitive (ASCII mapping)
4965 operation mode is supported; the keyword
4973 .Bl -hang -width ".It Cm length"
4975 Queries the length of the given argument.
4977 .It Cm hash , Cm hash32
4978 Calculates a hash value of the given argument.
4979 The latter will return a 32-bit result regardless of host environment.
4981 modifier suffix is supported.
4982 These use Chris Torek's hash algorithm, the resulting hash value is
4983 bit mixed as shown by Bret Mulvey.
4986 Search for the second in the first argument.
4987 Shows the resulting 0-based offset shall it have been found.
4989 modifier suffix is supported.
4992 Creates a substring of its first argument.
4993 The optional second argument is the 0-based starting offset,
4994 a negative one counts from the end;
4995 the optional third argument specifies the length of the desired result,
4996 a negative length leaves off the given number of bytes at the end of the
4997 original string; by default the entire string is used.
4998 This operation tries to work around faulty arguments (set
5000 for error logs), but reports them via the error number
5003 .Va ^ERR Ns -OVERFLOW .
5006 Trim away whitespace characters from both ends of the argument.
5009 Trim away whitespace characters from the begin of the argument.
5012 Trim away whitespace characters from the end of the argument.
5018 Show the name of the current working directory, as reported by
5023 .Sx "Command modifiers" ) .
5024 The return status is tracked via
5029 \*(OP For unencrypted messages this command is identical to
5031 Encrypted messages are first decrypted, if possible, and then copied.
5035 \*(OP For unencrypted messages this command is identical to
5037 Encrypted messages are first decrypted, if possible, and then copied.
5042 .It Ic define , undefine
5043 The latter command deletes the given macro, the special name
5045 will discard all existing macros.
5046 Deletion of (a) macro(s) can be performed from within running (a)
5047 macro(s), including self-deletion.
5048 Without arguments the former command prints the current list of macros,
5049 including their content, otherwise it defines a macro, replacing an
5050 existing one of the same name as applicable.
5053 A defined macro can be invoked explicitly by using the
5058 commands, or implicitly if a macro hook is triggered, for example a
5060 Execution of a macro body can be stopped from within by calling
5064 Temporary macro block-scope variables can be created or deleted with the
5066 command modifier in conjunction with the commands
5071 To enforce unrolling of changes made to (global)
5072 .Sx "INTERNAL VARIABLES"
5075 can be used instead; its covered scope depends on how (i.e.,
5077 normal macro, folder hook, hook,
5079 switch) the macro is invoked.
5084 ed macro, the given positional parameters are implicitly local
5085 to the macro's scope, and may be accessed via the variables
5091 and any other positive unsigned decimal number less than or equal to
5093 Positional parameters can be
5095 ed, or become completely replaced, removed etc. via
5097 A helpful command for numeric computation and string evaluations is
5100 offers C-style byte string operations.
5102 .Bd -literal -offset indent
5111 echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
5114 call exmac Hello macro exmac!
5115 echo ${?}/${!}/${^ERRNAME}
5121 .It Ic delete , undelete
5122 (d, u) Marks the given message list as being or not being
5124 respectively; if no argument has been specified then the usual search
5125 for a visible message is performed, as documented for
5126 .Sx "Message list arguments" ,
5127 showing only the next input prompt if the search fails.
5128 Deleted messages will neither be saved in the
5130 .Sx "secondary mailbox"
5132 nor will they be available for most other commands.
5135 variable is set, the new
5137 or the last message restored, respectively, is automatically
5146 \*(NQ Digging (information out of) messages is possible through
5148 objects, which can be
5150 d for the given message number; in
5154 will instead open the message that is being composed.
5155 If a hyphen-minus is given as the optional third argument then output
5156 will be generated on the standard output channel instead of being
5157 subject to consumption by the
5164 Note: output must be consumed before normal processing can continue; for
5166 objects this means each command output has to be read until the end of
5167 file (EOF) state occurs.
5172 d again by giving the same identifier used for creation;
5173 this step could be omitted: objects will be automatically closed
5176 (mailbox) or the compose mode is left, respectively.
5177 In all other use cases the second argument is an object identifier,
5178 and the third and all following arguments are interpreted as via
5181 .Sx "COMMAND ESCAPES" ) :
5183 .Bd -literal -offset indent
5184 ? vput = msgno; digmsg create $msgno
5185 ? digmsg $msgno header list; readall x; echon $x
5186 210 Subject From To Message-ID References In-Reply-To
5187 ? digmsg $msgno header show Subject;readall x;echon $x
5191 ? digmsg remove $msgno
5199 Superseded by the multiplexer
5205 Delete the given messages and automatically
5209 if one exists, regardless of the setting of
5216 up or down by one message when given
5220 argument, respectively.
5224 .It Ic draft , undraft
5225 Take message lists and mark each given message as being draft, or not
5226 being draft, respectively, as documented in the section
5227 .Sx "Message states" .
5231 \*(NQ(ec) Print the given strings, equivalent to the shell utility
5234 .Sx "Shell-style argument quoting"
5235 expansion is performed and, different to the otherwise identical
5237 a trailing newline is echoed.
5240 .Sx "Command modifiers"
5241 is supported, and the error number
5243 is managed: if data is stored in a variable then the return value
5244 reflects the length of the result string in case of success and is
5249 this command traditionally (in BSD Mail) also performed
5250 .Sx "Filename transformations" ,
5251 which is standard incompatible and hard to handle because quoting
5252 transformation patterns is not possible; the subcommand
5256 can be used to expand filenames.
5262 but the message is written to standard error, and prefixed by
5266 In interactive sessions the \*(OPal message ring queue for
5268 will be used instead, if available and
5276 but does not write or store a trailing newline.
5282 but does not write or store a trailing newline.
5288 at each message from the given list in turn.
5289 Modified contents are discarded unless the
5291 variable is set, and are not used unless the mailbox can be written to
5292 and the editor returns a successful exit status.
5294 can be used instead for a more display oriented editor.
5300 (see there for more),
5301 .Ic elif , else , endif
5302 conditional \(em if the condition of a preceding
5304 was false, check the following condition and execute the following block
5305 if it evaluates true.
5311 (see there for more),
5312 .Ic elif , else , endif
5313 conditional \(em if none of the conditions of the preceding
5317 commands was true, the
5323 (en) Marks the end of an
5325 (see there for more),
5326 .Ic elif , else , endif
5327 conditional execution block.
5332 \*(NQ There is a strict separation in between
5333 .Sx "INTERNAL VARIABLES"
5336 which is inherited by child processes.
5337 Some variables of the latter are however vivid for program operation,
5338 their purpose is known, therefore they have been integrated
5339 transparently into handling of the former, as accessible via
5343 To integrate any other environment variable, and/or to export internal
5344 variables into the process environment where they normally are not, a
5346 needs to become established with this command, for example
5349 .Dl environ link PERL5LIB TZ
5352 Afterwards changing such variables with
5354 will cause automatic updates of the environment, too.
5355 Sufficient system support provided (it was in BSD as early as 1987, and
5356 is standardized since Y2K) removing such variables with
5358 will remove them also from the environment, but in any way the knowledge
5364 may cause loss of such links.
5369 removes an existing link without otherwise touching variables, the
5373 subcommands are identical to
5377 but additionally update the program environment accordingly; removing
5378 a variable breaks any freely established
5384 \*(OP As console user interfaces at times scroll error messages by too
5385 fast and/or out of scope, data can additionally be sent to an error queue
5386 manageable by this command:
5388 or no argument will display and clear the queue,
5391 As the queue becomes filled with
5393 entries the eldest entries are being dropped.
5394 There are also the variables
5397 .Va ^ERRQUEUE-EXISTS .
5401 \*(NQ Construct a command by concatenating the arguments, separated with
5402 a single space character, and then evaluate the result.
5403 This command passes through the exit status
5407 of the evaluated command; also see
5409 .Bd -literal -offset indent
5420 call yyy '\ecall xxx' "b\e$'\et'u ' "
5428 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5429 any saving of messages in the
5431 .Sx "secondary mailbox"
5433 as well as a possibly tracked line editor
5436 .Va on-account-cleanup
5437 will be invoked, however.
5438 The optional status number argument will be passed through to
5440 \*(ID For now it can happen that the given status will be overwritten,
5441 later this will only occur if a later error needs to be reported onto an
5442 otherwise success indicating status.
5448 but open the mailbox read-only.
5457 .It Ic filetype , unfiletype
5458 \*(NQ Define, list, and remove, respectively, file handler hooks,
5459 which provide (shell) commands that enable \*(UA to load and save MBOX
5460 files from and to files with the registered file extensions, as shown
5463 The extensions are used case-insensitively, yet the auto-completion
5464 feature of for example
5466 will only work case-sensitively.
5467 An intermediate temporary file will be used to store the expanded data.
5468 The latter command will remove hooks for all given extensions, asterisk
5470 will remove all existing handlers.
5472 When used without arguments the former shows a list of all currently
5473 defined file hooks, with one argument the expansion of the given alias.
5474 Otherwise three arguments are expected, the first specifying the file
5475 extension for which the hook is meant, and the second and third defining
5476 the load- and save commands to deal with the file type, respectively,
5477 both of which must read from standard input and write to standard
5479 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5480 \*(ID For now too much work is done, and files are oftened read in twice
5481 where once would be sufficient: this can cause problems if a filetype is
5482 changed while such a file is opened; this was already so with the
5483 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5484 \*(ID For now all handler strings are passed to the
5485 .Ev SHELL for evaluation purposes; in the future a
5487 prefix to load and save commands may mean to bypass this shell instance:
5488 placing a leading space will avoid any possible misinterpretations.
5489 .Bd -literal -offset indent
5490 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5491 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
5492 zst 'zstd -dc' 'zstd -19 -zc' \e
5493 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5494 ? set record=+sent.zst.pgp
5499 .It Ic flag , unflag
5500 Take message lists and mark the messages as being flagged, or not being
5501 flagged, respectively, for urgent/special attention.
5503 .Sx "Message states" .
5509 but open the mailbox read-only.
5514 (fold) Open a new, or show status information of the current mailbox.
5515 If an argument is given, changes (such as deletions) will be written
5516 out, a new mailbox will be opened, the internal variables
5517 .Va mailbox-resolved
5520 will be updated, a set according
5522 is executed, and optionally a summary of
5524 is displayed if the variable
5529 .Sx "Filename transformations"
5530 will be applied to the
5534 prefixes are, i.e., URL (see
5535 .Sx "On URL syntax and credential lookup" )
5536 syntax is understood, as in
5537 .Ql mbox:///tmp/somefolder .
5538 If a protocol prefix is used the mailbox type is fixated, otherwise
5539 opening none-existing
5541 uses the protocol defined in
5549 (MBOX database), as well as
5551 (electronic mail message \*(ID read-only) the list of all registered
5553 s is traversed to check whether hooks shall be used to load (and save)
5554 data from (and to) the given
5556 Changing hooks will not affect already opened mailboxes.
5557 For example, the following creates hooks for the
5559 compression tool and a combined compressed and encrypted format:
5561 .Bd -literal -offset indent
5563 gzip 'gzip -dc' 'gzip -c' \e
5564 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5568 For historic reasons
5570 s provide limited (case-sensitive) auto-completion capabilities.
5575 provided that corresponding handlers are installed.
5576 It will neither find
5580 however, but an explicit
5581 .Ql \&? file mbox.GZ
5582 will find and use the handler for
5584 \*(ID The latter mode can only be used for MBOX files.
5587 EML files consist of only one mail message,
5588 \*(ID and can only be opened read-only.
5589 When reading MBOX files tolerant POSIX rules are used by default.
5590 Invalid message boundaries that can be found quite often in historic
5591 MBOX files will be complained about (even more with
5593 in this case the method described for
5595 can be used to create a valid MBOX database from the invalid input.
5598 MBOX databases and EML files will always be protected via file-region locks
5600 during file operations to protect against concurrent modifications.
5601 .Mx -ix "dotlock files"
5607 .Sx "primary system mailbox"
5608 will also be protected by so-called dotlock files,
5609 the traditional way of mail spool file locking: for any file
5613 will be created during the synchronization, in the same directory and
5614 with the same user and group identities as the file of interest \(em
5615 as necessary created by an external privileged dotlock helper.
5617 disables dotlock files.
5620 .Sx "Howto handle stale dotlock files" .
5623 \*(OP If no protocol has been fixated, and
5625 refers to a directory with the subdirectories
5630 then it is treated as a folder in
5633 The maildir format stores each message in its own file, and has been
5634 designed so that file locking is not necessary when reading or writing
5638 \*(OPally URLs can be used to access network resources, securely via
5639 .Sx "Encrypted network communication" ,
5641 Network communication socket timeouts are configurable via
5642 .Va socket-connect-timeout .
5643 All network traffic may be proxied over a SOCKS server via
5647 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5648 .Dl \*(OU protocol://[user@]host[:port][/path]
5651 \*(OPally supported network protocols are
5655 (POP3 with TLS encrypted transport),
5661 part is valid only for IMAP; there it defaults to
5663 Network URLs require a special encoding as documented in the section
5664 .Sx "On URL syntax and credential lookup" .
5669 Lists the names of all folders below the given argument or
5671 For file-based protocols
5673 will be used for display purposes.
5677 .It Ic Followup , followup
5678 \*(CM(F,fo) Similar to
5682 respectively, but save the message in a file named after the local part
5683 of the (first) recipient's address, possibly overwriting
5696 but saves the message in a file named after the local part of the
5697 recipient's address (instead of in
5702 \*(CM Take a message list and the address of a recipient, subject to
5704 to whom the messages are sent.
5705 The text of the original message is included in the new one,
5706 enclosed by the values of
5707 .Va forward-inject-head
5709 .Va forward-inject-tail .
5710 .Va content-description-forwarded-message
5712 The list of included headers can be filtered with the
5714 slot of the white- and blacklisting command
5716 Only the first part of a multipart message is included but for
5717 .Va forward-as-attachment .
5719 This may generate the errors
5720 .Va ^ERR Ns -DESTADDRREQ
5721 if no receiver has been specified, or was rejected by
5725 if an I/O error occurs,
5727 if a necessary character set conversion fails, and
5730 It can also fail with errors of
5731 .Sx "Specifying messages" .
5732 Any error stops processing of further messages.
5736 (f) Takes a list of message specifications and displays a summary of
5737 their message headers, exactly as via
5739 making the first message of the result the new
5741 (the last message if
5744 An alias of this command is
5747 .Sx "Specifying messages" .
5758 \*(OB Superseded by the multiplexer
5762 \*(OB Superseded by the multiplexer
5765 .It Ic ghost , unghost
5768 .Ic uncommandalias .
5772 .It Ic headerpick , unheaderpick
5773 \*(NQ Multiplexer command to manage white- and blacklisting
5774 selections of header fields for a variety of applications.
5775 Without arguments the set of contexts that have settings is displayed.
5776 When given arguments, the first argument is the context to which the
5777 command applies, one of (case-insensitive)
5779 for display purposes (for example
5782 for selecting which headers shall be stored persistently when
5788 ing messages (note that MIME related etc. header fields should not be
5789 ignored in order to not destroy usability of the message in this case),
5791 for stripping down messages when
5793 ing message (has no effect if
5794 .Va forward-as-attachment
5797 for defining user-defined set of fields for the command
5800 The current settings of the given context are displayed if it is the
5802 A second argument denotes the type of restriction that is to be chosen,
5803 it may be (a case-insensitive prefix of)
5807 for white- and blacklisting purposes, respectively.
5808 Establishing a whitelist suppresses inspection of the corresponding
5811 If no further argument is given the current settings of the given type
5812 will be displayed, otherwise the remaining arguments specify header
5813 fields, which \*(OPally may be given as regular expressions, to be added
5815 The special wildcard field (asterisk,
5817 will establish a (fast) shorthand setting which covers all fields.
5819 The latter command always takes three or more arguments and can be used
5820 to remove selections, i.e., from the given context, the given type of
5821 list, all the given headers will be removed, the special argument
5823 will remove all headers.
5827 (h) Show the current group of headers, the size of which depends on
5830 in interactive mode, and the format of which can be defined with
5832 If a message-specification is given the group of headers containing the
5833 first message therein is shown and the message at the top of the screen
5836 the last message is targeted if
5847 \*(OP Without arguments or when given
5849 all history entries are shown (this mode also supports a more
5853 will replace the list of entries with the content of
5857 will dump all entries to said file, replacing former content, and
5859 will delete all entries.
5860 The argument can also be a signed decimal
5862 which will select and evaluate the respective history entry, and move it
5863 to the top of the history; a negative number is used as an offset to the
5864 current command so that
5866 will select the last command, the history top, whereas
5868 will delete all given entries
5869 .Pf ( Ar :NUMBER: ) .
5871 .Sx "On terminal control and line editor" .
5877 Takes a message list and marks each message therein to be saved in the
5882 .Sx "secondary mailbox"
5884 Does not override the
5887 \*(UA deviates from the POSIX standard with this command, because a
5889 command issued after
5891 will display the following message, not the current one.
5897 .Ic \&\&if , Ic elif , else , endif
5898 conditional execution construct \(em if the given condition is true then
5899 the encapsulated block is executed.
5900 The POSIX standard only supports the (case-insensitive) conditions
5905 end, the remaining are non-portable extensions.
5906 \*(ID In conjunction with the
5909 .Sx "Shell-style argument quoting"
5910 and more test operators are available.
5912 .Bd -literal -offset indent
5921 Further (case-insensitive) one-argument conditions are
5923 erminal which evaluates to true in interactive terminal sessions
5924 (running with standard input or standard output attached to a terminal,
5927 command line options
5932 have been used), as well as any boolean value (see
5933 .Sx "INTERNAL VARIABLES"
5934 for textual boolean representations) to mark an enwrapped block as
5937 .Dq always execute .
5938 (Remarks: condition syntax errors skip all branches until
5944 It is possible to check
5945 .Sx "INTERNAL VARIABLES"
5948 variables for existence or compare their expansion against a user given
5949 value or another variable by using the
5951 .Pf ( Dq variable next )
5952 conditional trigger character;
5953 a variable on the right hand side may be signalled using the same
5955 Variable names may be enclosed in a pair of matching braces.
5956 When this mode has been triggered, several operators are available
5959 they are always available, and there is no trigger: variables will have
5960 been expanded by the shell-compatible parser before the
5962 etc. command sees them).
5965 \*(IN Two argument conditions.
5966 Variables can be tested for existence and expansion:
5968 will test whether the given variable exists, so that
5970 will evaluate to true when
5975 .Ql -n """$editalong"""
5976 will be true if the variable is set and expands to a non-empty string,
5977 .Ql -z $'\e$editalong'
5978 only if the expansion is empty, whether the variable exists or not.
5979 The remaining conditions take three arguments.
5982 Integer operators treat the arguments on the left and right hand side of
5983 the operator as integral numbers and compare them arithmetically.
5984 It is an error if any of the operands is not a valid integer, an empty
5985 argument (which implies it had been quoted) is treated as if it were 0.
5986 Via the question mark
5988 modifier suffix a saturated operation mode is available where numbers
5989 will linger at the minimum or maximum possible value, instead of
5990 overflowing (or trapping), the keyword
5997 are therefore identical.
5998 Available operators are
6002 (less than or equal to),
6008 (greater than or equal to), and
6013 String and regular expression data operators compare the left and right
6014 hand side according to their textual content.
6015 Unset variables are treated as the empty string.
6016 Via the question mark
6018 modifier suffix a case-insensitive operation mode is available, the keyword
6027 Available string operators are
6031 (less than or equal to),
6037 (greater than or equal to),
6041 (is substring of) and
6043 (is not substring of).
6044 By default these operators work on bytes and (therefore) do not take
6045 into account character set specifics.
6046 If the case-insensitivity modifier has been used, case is ignored
6047 according to the rules of the US-ASCII encoding, i.e., bytes are
6051 When the \*(OPal regular expression support is available, the additional
6057 They treat the right hand side as an extended regular expression that is
6058 matched according to the active locale (see
6059 .Sx "Character sets" ) ,
6060 i.e., character sets should be honoured correctly.
6063 Conditions can be joined via AND-OR lists (where the AND operator is
6065 and the OR operator is
6067 which have equal precedence and will be evaluated with left
6068 associativity, thus using the same syntax that is known for the
6070 It is also possible to form groups of conditions and lists by enclosing
6071 them in pairs of brackets
6072 .Ql [\ \&.\&.\&.\ ] ,
6073 which may be interlocked within each other, and also be joined via
6077 The results of individual conditions and entire groups may be modified
6078 via unary operators: the unary operator
6080 will reverse the result.
6082 .Bd -literal -offset indent
6083 wysh set v15-compat=yes # with value: automatic "wysh"!
6084 if -N debug;echo *debug* set;else;echo not;endif
6085 if "$ttycharset" == UTF-8 || "$ttycharset" ==?cas UTF8
6086 echo ttycharset is UTF-8, the former case-sensitive!
6089 if [ "${t1}" == "${t2}" ]
6090 echo These two variables are equal
6092 if "$features" =% ,+regex, && "$TERM" =~?case ^xterm\&.*
6093 echo ..in an X terminal
6095 if [ [ true ] && [ [ "${debug}" != '' ] || \e
6096 [ "$verbose" != '' ] ] ]
6099 if true && [ -n "$debug" || -n "${verbose}" ]
6100 echo Left associativity, as is known from the shell
6109 Superseded by the multiplexer
6114 Shows the names of all available commands, in command lookup order.
6115 \*(OP In conjunction with a set variable
6117 additional information will be provided for each command: the argument
6118 type will be indicated, the documentation string will be shown,
6119 and the set of command flags will show up:
6121 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
6123 command supports the command modifier
6126 command supports the command modifier
6129 the error number is tracked in
6132 whether the command needs an active mailbox, a
6135 indicators whether command is \&.\h'.3m'.\h'.3m'.
6136 .Bl -tag -compact -width ".It Ql SUBPROCESS"
6137 .It Ql batch/interactive
6138 usable in interactive or batch mode
6141 usable in send mode.
6143 allowed to be used when running in a subprocess instance,
6144 for example from within a macro that is called via
6145 .Va on-compose-splice .
6148 indicators whether command is not \&.\h'.3m'.\h'.3m'.
6149 .Bl -tag -compact -width ".It Ql COMPOSE_MODE"
6154 available during program startup, like in
6155 .Sx "Resource files" .
6158 The command produces
6167 Enforce change localization of
6172 .Sx "INTERNAL VARIABLES" ,
6173 meaning that their state will be reverted to the former one once the
6176 Just like the command modifier
6178 which provides block-scope localization for some commands (instead),
6179 it can only be used inside of macro definition blocks introduced by
6183 The covered scope of an
6185 is left once a different account is activated, and some macros, notably
6186 .Va folder-hook Ns s ,
6187 use their own specific notion of covered scope, here it will be extended
6188 until the folder is left again.
6191 This setting stacks up: i.e., if
6193 enables change localization and calls
6195 which explicitly resets localization, then any value changes within
6197 will still be reverted when the scope of
6200 (Caveats: if in this example
6202 changes to a different
6204 which sets some variables that are already covered by localizations,
6205 their scope will be extended, and in fact leaving the
6207 will (thus) restore settings in (likely) global scope which actually
6208 were defined in a local, macro private context!)
6211 This command takes one or two arguments, the optional first one
6212 specifies an attribute that may be one of
6214 which refers to the current scope and is thus the default,
6216 which causes any macro that is being
6218 ed to be started with localization enabled by default, as well as
6220 which (if enabled) disallows any called macro to turn off localization:
6221 like this it can be ensured that once the current scope regains control,
6222 any changes made in deeper levels have been reverted.
6223 The latter two are mutually exclusive, and neither affects
6225 The (second) argument is interpreted as a boolean (string, see
6226 .Sx "INTERNAL VARIABLES" )
6227 and states whether the given attribute shall be turned on or off.
6229 .Bd -literal -offset indent
6230 define temporary_settings {
6231 set possibly_global_option1
6233 set localized_option1
6234 set localized_option2
6236 set possibly_global_option2
6243 .It Ic Lfollowup , Lreply
6244 \*(CM Reply to messages that come in via known
6247 .Pf ( Ic mlsubscribe )
6248 mailing lists, or pretend to do so (see
6249 .Sx "Mailing lists" ) :
6254 respectively, functionality this will actively resort and even remove
6255 message recipients in order to generate a message that is supposed to be
6256 sent to a mailing list.
6257 For example it will also implicitly generate a
6258 .Ql Mail-Followup-To:
6259 header if that seems useful, regardless of the setting of the variable
6261 For more documentation please refer to
6262 .Sx "On sending mail, and non-interactive mode" .
6264 This may generate the errors
6265 .Va ^ERR Ns -DESTADDRREQ
6266 if no receiver has been specified,
6268 if some addressees where rejected by
6271 if an I/O error occurs,
6273 if a necessary character set conversion fails, and
6276 It can also fail with errors of
6277 .Sx "Specifying messages" .
6278 Occurrence of some of the errors depend on the value of
6280 Any error stops processing of further messages.
6286 but saves the message in a file named after the local part of the first
6287 recipient's address (instead of in
6292 \*(CM(m) Takes a (list of) recipient address(es) as (an) argument(s),
6293 or asks on standard input if none were given;
6294 then collects the remaining mail content and sends it out.
6295 Unless the internal variable
6297 is set recipient addresses will be stripped from comments, names etc.
6298 For more documentation please refer to
6299 .Sx "On sending mail, and non-interactive mode" .
6301 This may generate the errors
6302 .Va ^ERR Ns -DESTADDRREQ
6303 if no receiver has been specified,
6305 if some addressees where rejected by
6308 if multiple messages have been specified,
6310 if an I/O error occurs,
6312 if a necessary character set conversion fails, and
6315 It can also fail with errors of
6316 .Sx "Specifying messages" .
6317 Occurrence of some of the errors depend on the value of
6322 \*(OP When used without arguments or if
6324 has been given the content of
6325 .Sx "The Mailcap files"
6326 cache is shown, (re-)initializing it first (as necessary.
6329 then the cache will only be (re-)initialized, and
6331 will remove its contents.
6332 Note that \*(UA will try to load the files only once, use
6333 .Ql Ic \&\&mailcap Ns \:\0\:clear
6334 to unlock further attempts.
6335 Loading and parsing can be made more
6340 (mb) The given message list is to be sent to the
6342 .Sx "secondary mailbox"
6344 when \*(UA is quit; this is the default action unless the variable
6347 \*(ID This command can only be used in a
6349 .Sx "primary system mailbox" .
6353 .It Ic mimetype , unmimetype
6354 \*(NQ Without arguments the content of the MIME type cache will displayed;
6355 a more verbose listing will be produced if either of
6360 When given arguments they will be joined, interpreted as shown in
6361 .Sx "The mime.types files"
6363 .Sx "HTML mail and MIME attachments" ) ,
6364 and the resulting entry will be added (prepended) to the cache.
6365 In any event MIME type sources are loaded first as necessary \(en
6366 .Va mimetypes-load-control
6367 can be used to fine-tune which sources are actually loaded.
6369 The latter command deletes all specifications of the given MIME type, thus
6370 .Ql \&? unmimetype text/plain
6371 will remove all registered specifications for the MIME type
6375 will discard all existing MIME types, just as will
6377 but which also reenables cache initialization via
6378 .Va mimetypes-load-control .
6382 \*(ID Only available in interactive mode, this command allows execution
6383 of external MIME type handlers which do not integrate into the normal
6386 .Sx "HTML mail and MIME attachments" ) .
6387 (\*(ID No syntax to directly address parts, this restriction may vanish.)
6388 The user will be asked for each non-text part of the given message in
6389 turn whether the registered handler shall be used to display the part.
6393 .It Ic mlist , unmlist
6394 \*(NQ Manage the list of known
6395 .Sx "Mailing lists" ;
6396 subscriptions are controlled via
6398 The latter command deletes all given arguments,
6399 or all at once when given the asterisk
6401 The former shows the list of all currently known lists if used
6402 without arguments, otherwise the given arguments will become known.
6403 \*(OP In the latter case, arguments which contain any of the
6405 .Sx "magic regular expression characters"
6406 will be interpreted as one, possibly matching many addresses;
6407 these will be sequentially matched via linked lists instead of being
6408 looked up in a dictionary.
6412 .It Ic mlsubscribe , unmlsubscribe
6413 Building upon the command pair
6414 .Ic mlist , unmlist ,
6415 but only managing the subscription attribute of mailing lists.
6416 (The former will also create not yet existing mailing lists.)
6422 but move the messages to a file named after the local part of the
6423 sender of the first message instead of taking a filename argument;
6425 is inspected to decide on the actual storage location.
6431 but marks the messages for deletion if they were transferred
6438 but also displays header fields which would not pass the
6440 selection, and all MIME parts.
6448 on the given messages, even in non-interactive mode and as long as the
6449 standard output is a terminal.
6455 \*(OP When used without arguments or if
6457 has been given the content of the
6459 cache is shown, (re-)initializing it first (as necessary).
6462 then the cache will only be (re-)initialized, and
6464 will remove its contents.
6468 \*(OP When used without arguments, or when the argument was
6472 cache is shown, initializing it as necessary.
6475 then the cache will be (re)loaded, whereas
6478 Loading and parsing can be made more
6481 will query the cache for the URL given as the second argument
6482 .Pf ( Ql [USER@]HOST ) .
6487 .Sx "On URL syntax and credential lookup" ;
6489 .Sx "The .netrc file"
6490 documents the file format in detail.
6494 Checks for new mail in the current folder without committing any changes
6496 If new mail is present, a message is shown.
6500 the headers of each new message are also shown.
6501 This command is not available for all mailbox types.
6509 Goes to the next message in sequence and types it.
6510 With an argument list, types the next matching message.
6524 If the current folder is accessed via a network connection, a
6526 command is sent, otherwise no operation is performed.
6532 but also displays header fields which would not pass the
6534 selection, and all MIME parts.
6542 on the given messages, even in non-interactive mode and as long as the
6543 standard output is a terminal.
6551 but also pipes header fields which would not pass the
6553 selection, and all parts of MIME
6554 .Ql multipart/alternative
6559 (pi) Takes an optional message list and shell command (that defaults to
6561 and pipes the messages through the command.
6565 every message is followed by a formfeed character.
6586 (q) Terminates the session, saving all undeleted, unsaved messages in
6589 .Sx "secondary mailbox"
6591 preserving all messages marked with
6595 or never referenced in the system
6597 and removing all other messages from the
6599 .Sx "primary system mailbox" .
6600 If new mail has arrived during the session,
6602 .Dq You have new mail
6604 If given while editing a mailbox file with the command line option
6606 then the edit file is rewritten.
6607 A return to the shell is effected,
6608 unless the rewrite of edit file fails,
6609 in which case the user can escape with the exit command.
6610 The optional status number argument will be passed through to
6612 \*(ID For now it can happen that the given status will be overwritten,
6613 later this will only occur if a later error needs to be reported onto an
6614 otherwise success indicating status.
6618 \*(NQ Read a line from standard input, or the channel set active via
6620 and assign the data, which will be split as indicated by
6622 to the given variables.
6623 The variable names are checked by the same rules as documented for
6625 and the same error codes will be seen in
6629 indicates the number of bytes read, it will be
6631 with the error number
6635 in case of I/O errors, or
6638 If there are more fields than variables, assigns successive fields to the
6639 last given variable.
6640 If there are less fields than variables, assigns the empty string to the
6642 .Bd -literal -offset indent
6645 ? echo "<$a> <$b> <$c>"
6647 ? wysh set ifs=:; read a b c;unset ifs
6648 hey2.0,:"'you ",:world!:mars.:
6649 ? echo $?/$^ERRNAME / <$a><$b><$c>
6650 0/NONE / <hey2.0,><"'you ",><world!:mars.:><><>
6657 but splits on shell token boundaries (see
6658 .Sx "Shell-style argument quoting" )
6661 \*(ID Could become a
6664 .Ql read --tokenize -- .
6668 \*(NQ Read anything from standard input, or the channel set active via
6670 and assign the data to the given variable.
6671 The variable name is checked by the same rules as documented for
6673 and the same error codes will be seen in
6677 indicates the number of bytes read, it will be
6679 with the error number
6683 in case of I/O errors, or
6686 \*(ID The input data length is restricted to 31-bits.
6690 \*(NQ Manages input channels for
6695 to be used to avoid complicated or impracticable code, like calling
6697 from within a macro in non-interactive mode.
6698 Without arguments, or when the first argument is
6700 a listing of all known channels is printed.
6701 Channels can otherwise be
6703 d, and existing channels can be
6707 d by giving the string used for creation.
6709 The channel name is expected to be a file descriptor number, or,
6710 if parsing the numeric fails, an input file name that undergoes minimal
6711 .Sx "Filename transformations"
6712 (no meta expansion are performed).
6713 For example (this example requires a modern shell):
6714 .Bd -literal -offset indent
6715 $ printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6718 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6719 LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6725 \*(NQ Removes the named files or directories.
6726 If a name refers to a mailbox, say a Maildir mailbox, then a mailbox
6727 type specific removal will be performed, deleting the complete mailbox.
6728 In interactive mode the user is asked for confirmation.
6732 \*(NQ Takes the name of an existing folder
6733 and the name for the new folder
6734 and renames the first to the second one.
6735 .Sx "Filename transformations"
6736 including shell pathname wildcard pattern expansions
6738 are performed on both arguments.
6739 Both folders must be of the same type.
6743 .It Ic Reply , Respond
6744 \*(CM(R) Identical to
6746 except that it replies to only the sender of each message of the given
6747 list, by using the first message as the template to quote, for the
6751 will exchange this command with
6756 .It Ic reply , respond
6757 \*(CM(r) Take a message (list) and group-respond (to each in turn)
6758 by addressing the sender and all recipients, subject to
6764 .Va followup-to-honour ,
6767 .Va recipients-in-cc
6768 influence response behaviour.
6771 .Va quote-as-attachment
6772 configure whether responded-to message shall be quoted etc.,
6773 .Va content-description-quote-attachment
6777 will exchange this command with
6781 offers special support for replying to mailing lists.
6782 For more documentation please refer to
6783 .Sx "On sending mail, and non-interactive mode" .
6785 This may generate the errors
6786 .Va ^ERR Ns -DESTADDRREQ
6787 if no receiver has been specified, or was rejected by
6791 if an I/O error occurs,
6793 if a necessary character set conversion fails, and
6796 It can also fail with errors of
6797 .Sx "Specifying messages" .
6798 Any error stops processing of further messages.
6804 but does not add any header lines.
6805 This is not a way to hide the sender's identity,
6806 but useful for sending a message again to the same recipients.
6810 Takes a list of messages and a name,
6811 and sends each message to the given addressee, which is subject to
6814 and related header fields are prepended to the new copy of the message.
6817 is only performed if
6820 \*(ID\*(CM is not entered, the only supported hooks are
6823 .Va on-resend-cleanup .
6825 This may generate the errors
6826 .Va ^ERR Ns -DESTADDRREQ
6827 if no receiver has been specified, or was rejected by
6831 if an I/O error occurs,
6833 if a necessary character set conversion fails, and
6836 It can also fail with errors of
6837 .Sx "Specifying messages" .
6838 Any error stops processing of further messages.
6842 (ret) Superseded by the multiplexer
6847 Only available inside of a
6851 this command returns control of execution to the outer scope.
6852 The two optional parameters are positive decimal numbers and default to 0:
6853 the first specifies the 32-bit return value (stored in
6855 \*(ID and later extended to 64-bit),
6856 the second the 32-bit error number (stored in
6860 a non-0 exit status may cause the program to exit.
6866 but saves the messages in a file named after the local part of the
6867 sender of the first message instead of taking a filename argument;
6869 is inspected to decide on the actual storage location.
6873 (s) Takes a message list and a filename and appends each message in turn
6874 to the end of the file.
6875 .Sx "Filename transformations"
6876 including shell pathname wildcard pattern expansions
6878 is performed on the filename.
6879 If no filename is given, the
6881 .Sx "secondary mailbox"
6884 The filename in quotes, followed by the generated character count
6885 is echoed on the user's terminal.
6888 .Sx "primary system mailbox"
6889 the messages are marked for deletion.
6890 To filter the saved header fields to the desired subset use the
6892 slot of the white- and blacklisting command
6898 \*(OB Superseded by the multiplexer
6902 \*(OB Superseded by the multiplexer
6906 \*(OB Superseded by the multiplexer
6911 Takes a message specification (list) and displays a header summary of
6912 all matching messages, as via
6914 This command is an alias of
6917 .Sx "Specifying messages" .
6921 Takes a message list and marks all messages as having been read.
6927 (se, \*(NQ uns) The latter command will delete all given global
6928 variables, or only block-scope local ones if the
6930 command modifier has been used.
6931 The former, when used without arguments, will show all
6932 currently known variables, being more verbose if either of
6937 Remarks: this list mode will not automatically link-in (known)
6939 variables, this only happens for explicit addressing, examples are
6941 using a variable in an
6943 condition or a string passed to
6947 ting, as well as some program-internal use cases (look-ups).
6950 Otherwise the given variables (and arguments) are set or adjusted.
6951 Arguments are of the form
6953 (no space before or after
6957 if there is no value, i.e., a boolean variable.
6958 If a name begins with
6962 the effect is the same as invoking the
6964 command with the remaining part of the variable
6965 .Pf ( Ql unset save ) .
6966 \*(ID In conjunction with the
6968 .Pf (or\0 Cm local )
6970 .Sx "Shell-style argument quoting"
6971 can be used to quote arguments as necessary.
6972 \*(ID Otherwise quotation marks may be placed around any part of the
6973 assignment statement to quote blanks or tabs.
6976 When operating in global scope any
6978 that is known to map to an environment variable will automatically cause
6979 updates in the program environment (unsetting a variable in the
6980 environment requires corresponding system support) \(em use the command
6982 for further environmental control.
6983 If the command modifier
6985 has been used to enforce local scoping then the given user variables
6986 will be garbage collected when the local scope is left;
6988 .Sx "INTERNAL VARIABLES" ,
6991 behaves the same as if
6993 would have been set (temporarily), which means that changes are
6994 inherited by deeper scopes.
6998 .Sx "INTERNAL VARIABLES"
7002 .Bd -literal -offset indent
7003 ? wysh set indentprefix=' -> '
7004 ? wysh set atab=$'\t' aspace=' ' zero=0
7010 Apply shell quoting rules to the given raw-data arguments.
7014 .Sx "Command modifiers" ) .
7015 The first argument specifies the operation:
7019 cause shell quoting to be applied to the remains of the line, and
7020 expanded away thereof, respectively.
7021 If the former is prefixed with a plus-sign, the quoted result will not
7022 be roundtrip enabled, and thus can be decoded only in the very same
7023 environment that was used to perform the encode; also see
7024 .Cd mle-quote-rndtrip .
7025 If the coding operation fails the error number
7028 .Va ^ERR Ns -CANCELED ,
7029 and the unmodified input is used as the result; the error number may
7030 change again due to output or result storage errors.
7034 \*(NQ (sh) Invokes an interactive version of the shell,
7035 and returns its exit status.
7039 .It Ic shortcut , unshortcut
7040 \*(NQ Manage the file- or pathname shortcuts as documented for
7042 The latter command deletes all shortcuts given as arguments,
7043 or all at once when given the asterisk
7045 The former shows the list of all currently defined shortcuts if used
7046 without arguments, the target of the given with a single argument.
7047 Otherwise arguments are treated as pairs of shortcuts and their desired
7048 expansion, creating new or updating already existing ones.
7052 \*(NQ Shift the positional parameter stack (starting at
7054 by the given number (which must be a positive decimal),
7055 or 1 if no argument has been given.
7056 It is an error if the value exceeds the number of positional parameters.
7057 If the given number is 0, no action is performed, successfully.
7058 The stack as such can be managed via
7060 Note this command will fail in
7062 and hook macros unless the positional parameter stack has been
7063 explicitly created in the current context via
7070 but performs neither MIME decoding nor decryption, so that the raw
7071 message text is shown.
7075 (si) Shows the size in characters of each message of the given
7080 \*(NQ Sleep for the specified number of seconds (and optionally
7081 milliseconds), by default interruptible.
7082 If a third argument is given the sleep will be uninterruptible,
7083 otherwise the error number
7087 if the sleep has been interrupted.
7088 The command will fail and the error number will be
7089 .Va ^ERR Ns -OVERFLOW
7090 if the given duration(s) overflow the time datatype, and
7092 if the given durations are no valid integers.
7097 .It Ic sort , unsort
7098 The latter command disables sorted or threaded mode, returns to normal
7099 message order and, if the
7102 displays a header summary.
7103 The former command shows the current sorting criterion when used without
7104 an argument, but creates a sorted representation of the current folder
7105 otherwise, and changes the
7107 command and the addressing modes such that they refer to messages in
7109 Message numbers are the same as in regular mode.
7113 a header summary in the new order is also displayed.
7114 Automatic folder sorting can be enabled by setting the
7117 .Ql set autosort=thread .
7118 Possible sorting criterions are:
7121 .Bl -tag -compact -width "subject"
7123 Sort the messages by their
7125 field, that is by the time they were sent.
7127 Sort messages by the value of their
7129 field, that is by the address of the sender.
7132 variable is set, the sender's real name (if any) is used.
7134 Sort the messages by their size.
7136 \*(OP Sort the message by their spam score, as has been classified by
7139 Sort the messages by their message status.
7141 Sort the messages by their subject.
7143 Create a threaded display.
7145 Sort messages by the value of their
7147 field, that is by the address of the recipient.
7150 variable is set, the recipient's real name (if any) is used.
7156 \*(NQ (so) The source command reads commands from the given file.
7157 .Sx "Filename transformations"
7159 If the given expanded argument ends with a vertical bar
7161 then the argument will instead be interpreted as a shell command and
7162 \*(UA will read the output generated by it.
7163 Dependent on the settings of
7167 and also dependent on whether the command modifier
7169 had been used, encountering errors will stop sourcing of the given input.
7172 cannot be used from within macros that execute as
7173 .Va folder-hook Ns s
7176 i.e., it can only be called from macros that were
7181 \*(NQ The difference to
7183 (beside not supporting pipe syntax aka shell command input) is that
7184 this command will not generate an error nor warn if the given file
7185 argument cannot be opened successfully.
7189 \*(OP Takes a list of messages and clears their
7195 \*(OP Takes a list of messages and causes the
7197 to forget it has ever used them to train its Bayesian filter.
7198 Unless otherwise noted the
7200 flag of the message is inspected to chose whether a message shall be
7208 \*(OP Takes a list of messages and informs the Bayesian filter of the
7212 This also clears the
7214 flag of the messages in question.
7218 \*(OP Takes a list of messages and rates them using the configured
7219 .Va spam-interface ,
7220 without modifying the messages, but setting their
7222 flag as appropriate; because the spam rating headers are lost the rate
7223 will be forgotten once the mailbox is left.
7224 Refer to the manual section
7226 for the complete picture of spam handling in \*(UA.
7230 \*(OP Takes a list of messages and sets their
7236 \*(OP Takes a list of messages and informs the Bayesian filter of the
7242 flag of the messages in question.
7254 \*(NQ TLS information and management command multiplexer to aid in
7255 .Sx "Encrypted network communication" ,
7256 mostly available only if the term
7262 if so documented (see
7263 .Sx "Command modifiers" ) .
7264 The result that is shown in case of errors is always the empty string,
7265 errors can be identified via the error number
7267 For example, string length overflows are caught and set
7270 .Va ^ERR Ns -OVERFLOW .
7271 The TLS configuration is honoured, especially
7274 .Bd -literal -offset indent
7275 ? vput tls result fingerprint pop3s://ex.am.ple
7276 ? echo $?/$!/$^ERRNAME: $result
7279 .Bl -hang -width ".It Cm random"
7281 Show the complete verified peer certificate chain.
7282 Includes informational fields in conjunction with
7285 Show only the peer certificate, without any signers.
7286 Includes informational fields in conjunction with
7290 .Va tls-fingerprint-digest Ns
7291 ed fingerprint of the certificate of the given HOST
7292 .Pf ( Ql server:port ,
7293 where the port defaults to the HTTPS port, 443).
7295 is actively ignored for the runtime of this command.
7306 slot for white- and blacklisting header fields.
7310 (to) Takes a message list and types out the first
7312 lines of each message on the user's terminal.
7313 Unless a special selection has been established for the
7317 command, the only header fields that are displayed are
7328 It is possible to apply compression to what is displayed by setting
7330 Messages are decrypted and converted to the terminal character set
7335 (tou) Takes a message list and marks the messages for saving in the
7337 .Sx "secondary mailbox"
7339 \*(UA deviates from the POSIX standard with this command,
7342 command will display the following message instead of the current one.
7348 but also displays header fields which would not pass the
7350 selection, and all visualizable parts of MIME
7351 .Ql multipart/alternative
7356 (t) Takes a message list and types out each message on the user's terminal.
7357 The display of message headers is selectable via
7359 For MIME multipart messages, all parts with a content type of
7361 all parts which have a registered MIME type handler (see
7362 .Sx "HTML mail and MIME attachments" )
7363 which produces plain text output, and all
7365 parts are shown, others are hidden except for their headers.
7366 Messages are decrypted and converted to the terminal character set
7370 can be used to display parts which are not displayable as plain text.
7413 \*(OB Superseded by the multiplexer
7417 \*(OB Superseded by the multiplexer
7422 Superseded by the multiplexer
7433 .It Ic unmlsubscribe
7444 Takes a message list and marks each message as not having been read.
7448 Superseded by the multiplexer
7452 \*(OB Superseded by the multiplexer
7456 \*(OB Superseded by the multiplexer
7478 Perform URL percent codec operations on the raw-data argument, rather
7479 according to RFC 3986.
7480 The first argument specifies the operation:
7484 perform plain URL percent en- and decoding, respectively.
7488 perform a slightly modified operation which should be better for
7489 pathnames: it does not allow a tilde
7491 and will neither accept hyphen-minus
7495 as an initial character.
7496 The remains of the line form the URL data which is to be converted.
7497 This is a character set agnostic operation,
7498 and it may thus decode bytes which are invalid in the current
7504 .Sx "Command modifiers" ) ,
7505 and manages the error number
7507 If the coding operation fails the error number
7510 .Va ^ERR Ns -CANCELED ,
7511 and the unmodified input is used as the result; the error number may
7512 change again due to output or result storage errors.
7513 \*(ID This command does not know about URLs beside what is documented.
7517 subcommand, shall the URL be displayed.)
7521 \*(NQ This command produces the same output as the listing mode of
7525 ity adjustments, but only for the given variables.
7529 \*(OP Takes a message list and verifies each message.
7530 If a message is not a S/MIME signed message,
7531 verification will fail for it.
7532 The verification process checks if the message was signed using a valid
7534 if the message sender's email address matches one of those contained
7535 within the certificate,
7536 and if the message content has been altered.
7544 of \*(UA, optionally in a more
7546 form which also includes the build and running system environment.
7547 This command supports
7550 .Sx "Command modifiers" ) .
7555 \*(NQ A multiplexer command which offers signed 64-bit numeric
7556 calculations, as well as other, mostly string-based operations.
7557 C-style byte string operations are available via
7559 The first argument defines the number, type, and meaning of the
7560 remaining arguments.
7561 An empty number argument is treated as 0.
7565 .Sx "Command modifiers" ) .
7566 The result shown in case of errors is
7568 for usage errors and numeric operations, the empty string otherwise;
7570 errors, like when a search operation failed, will also set the
7573 .Va ^ERR Ns -NODATA .
7574 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7575 numbers, and errors will be reported in the error number
7577 as the numeric error
7578 .Va ^ERR Ns -RANGE .
7581 Numeric operations work on one or two signed 64-bit integers.
7582 Numbers prefixed with
7586 are interpreted as hexadecimal (base 16) numbers, whereas
7588 indicates octal (base 8), and
7592 denote binary (base 2) numbers.
7593 It is possible to use any base in between 2 and 36, inclusive, with the
7595 notation, where the base is given as an unsigned decimal number, so
7597 is a different way of specifying a hexadecimal number.
7598 Unsigned interpretation of a number can be enforced by prefixing an
7600 (case-insensitively), as in
7602 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7603 which will be interpreted as unsigned by default, but it still makes
7604 a difference regarding overflow detection and overflow constant.
7605 It is possible to enforce signed interpretation by (instead) prefixing a
7607 (case-insensitively).
7608 The number sign notation uses a permissive parse mode and as such
7609 supports complicated conditions out of the box:
7610 .Bd -literal -offset indent
7611 ? wysh set ifs=:;read i;unset ifs;echo $i;vexpr pb 2 10#$i
7618 One integer is expected by assignment (equals sign
7620 which does nothing but parsing the argument, thus detecting validity and
7621 possible overflow conditions, unary not (tilde
7623 which creates the bitwise complement, and unary plus and minus.
7624 Two integers are used by addition (plus sign
7626 subtraction (hyphen-minus
7628 multiplication (asterisk
7632 and modulo (percent sign
7634 as well as for the bitwise operators logical or (vertical bar
7637 bitwise and (ampersand
7640 bitwise xor (circumflex
7642 the bitwise signed left- and right shifts
7645 as well as for the unsigned right shift
7649 Another numeric operation is
7651 which takes a number base in between 2 and 36, inclusive, and will act
7652 on the second number given just the same as what equals sign
7654 does, but the number result will be formatted in the base given, as
7655 a signed 64-bit number unless unsigned interpretation of the input
7656 number had been forced (with an u prefix).
7659 Numeric operations support a saturated mode via the question mark
7661 modifier suffix; the keyword
7668 are therefore identical.
7669 In saturated mode overflow errors and division and modulo by zero are no
7670 longer reported via the exit status, but the result will linger at the
7671 minimum or maximum possible value, instead of overflowing (or trapping).
7672 This is true also for the argument parse step.
7673 For the bitwise shifts, the saturated maximum is 63.
7674 Any caught overflow will be reported via the error number
7677 .Va ^ERR Ns -OVERFLOW .
7679 .Bd -literal -offset indent
7680 ? vput vexpr res -? +1 -9223372036854775808
7681 ? echo $?/$!/$^ERRNAME:$res
7682 0/75/OVERFLOW:-9223372036854775808
7686 Character set agnostic string functions have no notion of locale
7687 settings and character sets.
7689 .Bl -hang -width ".It Cm random"
7691 Outputs the current date and time in UTC (Coordinated Universal Time)
7692 with values named such that
7693 .Ql vput vexpr x date-utc; eval wysh set $x
7694 creates accessible variables.
7695 .It Cm date-stamp-utc
7696 Outputs a RFC 3339 internet date/time format of UTC.
7698 The seconds and nanoseconds since the Unix epoch (1970-01-01T00:00:00)
7704 .Ql vput vexpr x epoch; eval wysh set $x
7705 creates accessible variables.
7708 .Sx "Filename transformations"
7710 .It Cm file-stat , file-lstat
7712 .Sx "Filename transformations"
7713 on the argument, then call
7717 respectively, and output values such that
7718 .Ql vput vexpr x file-stat FILE; eval wysh set $x
7719 creates accessible variables.
7724 to denote directories, commercial at
7726 for links, number sign
7728 for block devices, percent sign
7730 for for character devices, vertical bar
7732 for FIFOs, equal sign
7734 for sockets, and the period
7738 Generates a random string of the given length, or of
7740 bytes (a constant from
7742 if the value 0 is given; the random string will be base64url encoded
7743 according to RFC 4648, and thus be usable as a (portable) filename.
7747 String operations work, sufficient support provided, according to the
7748 active user's locale encoding and character set (see
7749 .Sx "Character sets" ) .
7750 Where the question mark
7752 modifier suffix is supported, a case-insensitive operation mode is
7753 available; the keyword
7759 are therefore identical.
7761 .Bl -hang -width ".It Cm regex"
7763 (One-way) Converts the argument to something safely printable on the
7767 \*(OP A string operation that will try to match the first argument with
7768 the regular expression given as the second argument.
7770 modifier suffix is supported.
7771 If the optional third argument has been given then instead of showing
7772 the match offset a replacement operation is performed: the third
7773 argument is treated as if specified within dollar-single-quote (see
7774 .Sx "Shell-style argument quoting" ) ,
7775 and any occurrence of a positional parameter, for example
7777 etc. is replaced with the according match group of the regular expression:
7778 .Bd -literal -offset indent
7779 ? vput vexpr res regex bananarama \e
7780 (.*)NanA(.*) '\e${1}au\e$2'
7781 ? echo $?/$!/$^ERRNAME:$res:
7783 ? vput vexpr res regex?case bananarama \e
7784 (.*)NanA(.*) '\e${1}uauf\e$2'
7785 ? echo $?/$!/$^ERRNAME:$res:
7786 0/0/NONE:bauauframa:
7793 \*(NQ Manage the positional parameter stack (see
7797 If the first argument is
7799 then the positional parameter stack of the current context, or the
7800 global one, if there is none, is cleared.
7803 then the remaining arguments will be used to (re)create the stack,
7804 if the parameter stack size limit is excessed an
7805 .Va ^ERR Ns -OVERFLOW
7809 If the first argument is
7811 a round-trip capable representation of the stack contents is created,
7812 with each quoted parameter separated from each other with the first
7815 and followed by the first character of
7817 if that is not empty and not identical to the first.
7818 If that results in no separation at all a
7824 .Sx "Command modifiers" ) .
7825 I.e., the subcommands
7829 can be used (in conjunction with
7831 to (re)create an argument stack from and to a single variable losslessly.
7833 .Bd -literal -offset indent
7834 ? vpospar set hey, "'you ", world!
7835 ? echo $#: <${1}><${2}><${3}>
7836 ? vput vpospar x quote
7838 ? echo $#: <${1}><${2}><${3}>
7839 ? eval vpospar set ${x}
7840 ? echo $#: <${1}><${2}><${3}>
7846 (v) Takes a message list and invokes the
7848 display editor on each message.
7849 Modified contents are discarded unless the
7851 variable is set, and are not used unless the mailbox can be written to
7852 and the editor returns a successful exit status.
7854 can be used instead for a less display oriented editor.
7858 (w) For conventional messages the body without all headers is written.
7859 The original message is never marked for deletion in the originating
7861 The output is decrypted and converted to its native format as necessary.
7862 If the output file exists, the text is appended.
7863 If a message is in MIME multipart format its first part is written to
7864 the specified file as for conventional messages, handling of the remains
7865 depends on the execution mode.
7866 No special handling of compressed files is performed.
7868 In interactive mode the user is consecutively asked for the filenames of
7869 the processed parts.
7870 For convenience saving of each part may be skipped by giving an empty
7871 value, the same result as writing it to
7873 Shell piping the part content by specifying a leading vertical bar
7875 character for the filename is supported.
7876 Other user input undergoes the usual
7877 .Sx "Filename transformations" ,
7878 including shell pathname wildcard pattern expansions
7880 and shell variable expansion for the message as such, not the individual
7881 parts, and contents of the destination file are overwritten if the file
7883 Character set conversion to
7885 is performed when saving text data.
7887 \*(ID In non-interactive mode any part which does not specify a filename
7888 is ignored, and suspicious parts of filenames of the remaining parts are
7889 URL percent encoded (as via
7891 to prevent injection of malicious character sequences, resulting in
7892 a filename that will be written into the current directory.
7893 Existing files will not be overwritten, instead the part number or
7894 a dot are appended after a number sign
7896 to the name until file creation succeeds (or fails due to other
7901 \*(NQ The sole difference to
7903 is that the new macro is executed in place of the current one, which
7904 will not regain control: all resources of the current macro will be
7906 This implies that any setting covered by
7908 will be forgotten and covered variables will become cleaned up.
7909 If this command is not used from within a
7911 ed macro it will silently be (a more expensive variant of)
7921 \*(NQ \*(UA presents message headers in
7923 fuls as described under the
7926 Without arguments this command scrolls to the next window of messages,
7927 likewise if the argument is
7931 scrolls to the last,
7933 scrolls to the first, and
7938 A number argument prefixed by
7942 indicates that the window is calculated in relation to the current
7943 position, and a number without a prefix specifies an absolute position.
7949 but scrolls to the next or previous window that contains at least one
7960 .\" .Sh COMMAND ESCAPES {{{
7961 .Sh "COMMAND ESCAPES"
7963 Command escapes are available in
7965 during interactive usage, when explicitly requested via
7969 They perform special functions, like editing headers of the message
7970 being composed, calling normal
7972 yielding a shell, etc.
7973 Command escapes are only recognized at the beginning of lines, and
7974 consist of an escape followed by a command character.
7977 character is the tilde
7981 Unless otherwise documented command escapes ensure proper updates of
7988 controls whether a failed operation errors out message compose mode and
7989 causes program exit.
7990 Escapes may be prefixed by none to multiple single character command
7991 modifiers, interspersed whitespace is ignored:
7995 An effect equivalent to the command modifier
7997 can be achieved with hyphen-minus
8005 uates the remains of the line; also see
8006 .Sx "Shell-style argument quoting" .
8007 \*(ID For now the entire input line is evaluated as a whole; to avoid
8008 that control operators like semicolon
8010 are interpreted unintentionally, they must be quoted.
8014 Addition of the command line to the \*(OPal history can be prevented by
8015 placing whitespace directly after
8019 ings support a compose mode specific context.
8020 The following command escapes are supported:
8023 .Bl -tag -width ".It Ic BaNg"
8026 Insert the string of text in the message prefaced by a single
8028 (If the escape character has been changed,
8029 that character must be doubled instead.)
8032 .It Ic ~! Ar command
8033 Execute the indicated shell
8035 which follows, replacing unescaped exclamation marks with the previously
8036 executed command if the internal variable
8038 is set, then return to the message.
8042 End compose mode and send the message.
8044 .Va on-compose-splice-shell
8046 .Va on-compose-splice ,
8047 in order, will be called when set, after which, in interactive mode
8050 .Va askcc , askbcc )
8053 will be checked as well as
8056 .Va on-compose-leave
8057 hook will be called,
8061 will be joined in if set,
8063 .Va message-inject-tail
8064 will be incorporated, after which the compose mode is left.
8067 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
8068 Can be used to execute
8070 (which are allowed in compose mode).
8073 .It Ic ~< Ar filename
8078 .It Ic ~<! Ar command
8080 is executed using the shell.
8081 Its standard output is inserted into the message.
8085 \*(OP Write a summary of command escapes.
8088 .It Ic ~@ Op Ar filename...
8089 Append or edit the list of attachments.
8090 Does not manage the error number
8096 if error handling is necessary).
8097 The append mode expects a list of
8099 arguments as shell tokens (see
8100 .Sx "Shell-style argument quoting" ;
8101 token-separating commas are ignored, too), to be
8102 interpreted as documented for the command line option
8104 with the message number exception as below.
8108 arguments the attachment list is edited, entry by entry;
8109 if a filename is left empty, that attachment is deleted from the list;
8110 once the end of the list is reached either new attachments may be
8111 entered or the session can be quit by committing an empty
8114 In non-interactive mode or in batch mode
8116 the list of attachments is effectively not edited but instead recreated;
8117 again, an empty input ends list creation.
8119 For all modes, if a given filename solely consists of the number sign
8121 followed by either a valid message number of the currently active
8122 mailbox, or by a period
8124 referring to the current message of the active mailbox, the so-called
8126 then the given message is attached as a
8129 The number sign must be quoted to avoid misinterpretation as a shell
8133 .It Ic ~| Ar command
8134 Pipe the message text through the specified filter command.
8135 If the command gives no output or terminates abnormally,
8136 retain the original text of the message.
8139 is often used as a rejustifying filter.
8141 If the first character of the command is a vertical bar, then the entire
8142 message including header fields is subject to the filter command, so
8143 .Ql ~|| echo Fcc: /tmp/test; cat
8144 will prepend a file-carbon-copy message header.
8150 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
8151 Inspect and modify the message using the semantics of
8153 therefore arguments are evaluated according to
8154 .Sx "Shell-style argument quoting" .
8159 are not managed: errors are handled via the protocol,
8160 and hard errors like I/O failures cannot be handled.
8163 The protocol consists of command lines followed by (a) response line(s).
8164 The first field of the response line represents a status code
8165 which specifies whether a command was successful or not, whether result
8166 data is to be expected, and if, the format of the result data.
8167 Response data will be shell quoted as necessary for consumption by
8174 Error status code lines may optionally contain additional context:
8178 .Bl -tag -compact -width ".It Ql 210"
8180 Status ok; the remains of the line are the result.
8183 Status ok; the rest of the line is optionally used for more status.
8184 What follows are lines of result addresses, terminated by an empty line.
8185 All the input, including the empty line, must be consumed before further
8186 commands can be issued.
8187 Address lines consist of two token, first the plain network address, e.g.,
8189 followed by the (quoted) full address as known:
8190 .Ql '(Lovely) Bob <bob@exam.ple>' .
8191 Non-network addresses use the first field to indicate the type (hyphen-minus
8193 for files, vertical bar
8195 for pipes, and number sign
8197 for names which will undergo
8199 processing) instead, the actual value will be in the second field.
8202 Status ok; the rest of the line is optionally used for more status.
8203 What follows are lines of furtherly unspecified (quoted) string content,
8204 terminated by an empty line.
8205 All the input, including the empty line, must be consumed before further
8206 commands can be issued.
8209 Syntax error; invalid command.
8212 Syntax error or otherwise invalid parameters or arguments.
8215 Error: an argument fails verification.
8216 For example an invalid address has been specified (also see
8218 or an attempt was made to modify anything in \*(UA's own namespace,
8219 or a modifying subcommand has been used on a read-only message.
8222 Error: an otherwise valid argument is rendered invalid due to context.
8223 For example, a second address is added to a header which may consist of
8224 a single address only.
8229 If a command indicates failure then the message will have remained
8231 Most commands can fail with
8233 if required arguments are missing, or excessive arguments have been
8234 given (false command usage).
8235 (\*(ID The latter does not yet occur regularly, because as stated in
8236 .Sx "Shell-style argument quoting"
8237 our argument parser is not yet smart enough to work on subcommand base;
8238 for example one might get excess argument error for a three argument
8239 subcommand that receives four arguments, but not for a four argument
8240 subcommand which receives six arguments: here excess will be joined.)
8241 The following (case-insensitive) commands are supported:
8244 .Bl -hang -width ".It Cm version"
8246 This command allows listing, removal and addition of message attachments.
8247 The second argument specifies the subcommand to apply, one of:
8249 .Bl -hang -width ".It Cm remove"
8251 This uses the same search mechanism as described for
8253 and prints any known attributes of the first found attachment via
8257 if no such attachment can be found.
8258 The attributes are written as lines with a keyword and a value token.
8261 This uses the same search mechanism as described for
8263 and is otherwise identical to
8266 .It Cm attribute-set
8267 This uses the same search mechanism as described for
8269 and will set the attribute given as the fourth to the value given as
8270 the fifth token argument.
8271 If the value is an empty token, then the given attribute is removed,
8272 or reset to a default value if existence of the attribute is crucial.
8276 upon success, with the index of the found attachment following,
8278 for message attachments or if the given keyword is invalid, and
8280 if no such attachment can be found.
8281 The following keywords may be used (case-insensitively):
8283 .Bl -hang -compact -width ".It Ql filename"
8285 Sets the filename of the MIME part, i.e., the name that is used for
8286 display and when (suggesting a name for) saving (purposes).
8287 .It Ql content-description
8288 Associate some descriptive information to the attachment's content, used
8289 in favour of the plain filename by some MUAs.
8291 May be used for uniquely identifying MIME entities in several contexts;
8292 this expects a special reference address format as defined in RFC 2045
8295 upon address content verification failure.
8297 Defines the media type/subtype of the part, which is managed
8298 automatically, but can be overwritten.
8299 .It Ql content-disposition
8300 Automatically set to the string
8304 .It Cm attribute-set-at
8305 This uses the same search mechanism as described for
8307 and is otherwise identical to
8311 Adds the attachment given as the third argument, specified exactly as
8312 documented for the command line option
8314 and supporting the message number extension as documented for
8318 upon success, with the index of the new attachment following,
8320 if the given file cannot be opened,
8322 if an on-the-fly performed character set conversion fails, otherwise
8324 is reported; this is also reported if character set conversion is
8325 requested but not available.
8328 List all attachments via
8332 if no attachments exist.
8333 This command is the default command of
8335 if no second argument has been given.
8338 This will remove the attachment given as the third argument, and report
8342 if no such attachment can be found.
8343 If there exists any path component in the given argument, then an exact
8344 match of the path which has been used to create the attachment is used
8345 directly, but if only the basename of that path matches then all
8346 attachments are traversed to find an exact match first, and the removal
8347 occurs afterwards; if multiple basenames match, a
8350 Message attachments are treated as absolute pathnames.
8352 If no path component exists in the given argument, then all attachments
8353 will be searched for
8355 parameter matches as well as for matches of the basename of the path
8356 which has been used when the attachment has been created; multiple
8361 This will interpret the third argument as a number and remove the
8362 attachment at that list position (counting from one!), reporting
8366 if the argument is not a number or
8368 if no such attachment exists.
8373 This command allows listing, inspection, and editing of message headers.
8374 Header name case is not normalized, so that case-insensitive comparison
8375 should be used when matching names.
8376 The second argument specifies the subcommand to apply, one of:
8379 .Bl -hang -width ".It Cm remove"
8381 Create a new or an additional instance of the header given in the third
8382 argument, with the header body content as given in the fourth token.
8385 if the third argument specifies a free-form header field name that is
8386 invalid, or if body content extraction fails to succeed,
8388 if any extracted address does not pass syntax and/or security checks or
8389 on \*(UA namespace violations, and
8391 to indicate prevention of excessing a single-instance header \(em note that
8393 can be appended to (a space separator will be added automatically first).
8400 modifier to enforce treatment as a single addressee, for example
8401 .Ql header insert To?single: 'exa, <m@ple>' ;
8407 is returned upon success, followed by the name of the header and the list
8408 position of the newly inserted instance.
8409 The list position is always 1 for single-instance header fields.
8410 All free-form header fields are managed in a single list; also see
8414 Without a third argument a list of all yet existing headers is given via
8416 this command is the default command of
8418 if no second argument has been given.
8419 A third argument restricts output to the given header only, which may
8422 if no such field is defined.
8425 This will remove all instances of the header given as the third
8430 if no such header can be found, and
8432 on \*(UA namespace violations.
8435 This will remove from the header given as the third argument the
8436 instance at the list position (counting from one!) given with the fourth
8441 if the list position argument is not a number or on \*(UA namespace
8444 if no such header instance exists.
8447 Shows the content of the header given as the third argument.
8448 Dependent on the header type this may respond with
8452 any failure results in
8458 In compose-mode read-only access to optional pseudo headers in the \*(UA
8459 private namespace is available:
8463 .Bl -tag -compact -width ".It Va BaNg"
8464 .It Ql Mailx-Command:
8465 The name of the command that generates the message, one of
8472 This pseudo header always exists (in compose-mode).
8474 .It Ql Mailx-Raw-To:
8475 .It Ql Mailx-Raw-Cc:
8476 .It Ql Mailx-Raw-Bcc:
8477 Represent the frozen initial state of these headers before any
8481 .Va recipients-in-cc
8484 .It Ql Mailx-Orig-Sender:
8485 .It Ql Mailx-Orig-From:
8486 .It Ql Mailx-Orig-To:
8487 .It Ql Mailx-Orig-Cc:
8488 .It Ql Mailx-Orig-Bcc:
8489 The values of said headers of the original message which has been
8491 .Ic reply , forward , resend .
8492 The sender field is special as it is filled in with the sole sender
8493 according to RFC 5322 rules, it may thus be equal to the from field.
8498 Show an abstract of the above commands via
8502 This command will print the protocol version via
8510 .Ql Ic ~i Ns \| Va Sign .
8515 .Ql Ic ~i Ns \| Va sign .
8518 .It Ic ~b Ar name ...
8519 Add the given names to the list of blind carbon copy recipients.
8522 .It Ic ~c Ar name ...
8523 Add the given names to the list of carbon copy recipients.
8527 Read the file specified by the
8529 variable into the message.
8535 on the message collected so far, then return to compose mode.
8537 can be used for a more display oriented editor, and
8539 offers a pipe-based editing approach.
8542 .It Ic ~F Ar messages
8543 Read the named messages into the message being sent, including all
8544 message headers and MIME parts, and honouring
8547 .Va forward-inject-head
8549 .Va forward-inject-tail .
8550 If no messages are specified, read in the current message, the
8554 .It Ic ~f Ar messages
8555 Read the named messages into the message being sent.
8556 If no messages are specified, read in the current message, the
8558 Strips down the list of header fields according to the
8563 white- and blacklist selection of
8568 .Va forward-inject-head
8570 .Va forward-inject-tail .
8571 For MIME multipart messages,
8572 only the first displayable part is included.
8576 In interactive mode, edit the message header fields
8581 by typing each one in turn and allowing the user to edit the field.
8582 The default values for these fields originate from the
8587 In non-interactive mode this sets
8588 .Va ^ERR Ns -NOTTY .
8592 In interactive mode, edit the message header fields
8598 by typing each one in turn and allowing the user to edit the field.
8599 In non-interactive mode this sets
8600 .Va ^ERR Ns -NOTTY .
8603 .It Ic ~I Ar variable
8604 Insert the value of the specified variable into the message.
8605 The message remains unaltered if the variable is unset or empty.
8606 Any embedded character sequences
8608 horizontal tabulator and
8610 line feed are expanded in
8612 mode; otherwise the expansion should occur at
8614 time (\*(ID by using the command modifier
8618 .It Ic ~i Ar variable
8621 but appends a newline character.
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
8633 .Va forward-inject-head
8635 .Va forward-inject-tail .
8638 .It Ic ~m Ar messages
8639 Read the named messages into the message being sent,
8642 If no messages are specified, read the current message, the
8644 Strips down the list of header fields according to the
8646 white- and blacklist selection of
8651 .Va forward-inject-head
8653 .Va forward-inject-tail .
8654 For MIME multipart messages,
8655 only the first displayable part is included.
8659 Display the message collected so far,
8660 prefaced by the message header fields
8661 and followed by the attachment list, if any.
8665 Read in the given / current message(s) using the algorithm of
8667 (except that is implicitly assumed, even if not set), honouring
8672 Abort the message being sent,
8673 copying it to the file specified by the
8680 .It Ic ~R Ar filename
8683 but indent each line that has been read by
8687 .It Ic ~r Ar filename Op Ar HERE-delimiter
8688 Read the named file, object to
8689 .Sx "Filename transformations"
8690 excluding shell globs and variable expansions, into the message; if
8694 then standard input is used (for pasting, for example).
8695 Only in this latter mode
8697 may be given: if it is data will be read in until the given
8699 is seen on a line by itself, and encountering EOF is an error; the
8701 is a required argument in non-interactive mode; if it is single-quote
8702 quoted then the pasted content will not be expanded, \*(ID otherwise
8703 a future version of \*(UA may perform shell-style expansion on the content.
8707 Cause the named string to become the current subject field.
8708 Newline (NL) and carriage-return (CR) bytes are invalid and will be
8709 normalized to space (SP) characters.
8712 .It Ic ~t Ar name ...
8713 Add the given name(s) to the direct recipient list.
8716 .It Ic ~U Ar messages
8717 Read in the given / current message(s) excluding all headers, indented by
8722 .Va forward-inject-head
8724 .Va forward-inject-tail .
8727 .It Ic ~u Ar messages
8728 Read in the given / current message(s), excluding all headers.
8732 .Va forward-inject-head
8734 .Va forward-inject-tail .
8740 editor on the message collected so far, then return to compose mode.
8742 can be used for a less display oriented editor, and
8744 offers a pipe-based editing approach.
8747 .It Ic ~w Ar filename
8748 Write the message onto the named file, which is object to the usual
8749 .Sx "Filename transformations" .
8751 the message is appended to it.
8757 except that the message is not saved at all.
8763 .\" .Sh INTERNAL VARIABLES {{{
8764 .Sh "INTERNAL VARIABLES"
8766 Internal \*(UA variables are controlled via the
8770 commands; prefixing a variable name with the string
8774 has the same effect as using
8781 will give more insight on the given variable(s), and
8783 when called without arguments, will show a listing of all variables.
8784 Both commands support a more
8787 Some well-known variables will also become inherited from the
8790 implicitly, others can be imported explicitly with the command
8792 and henceforth share said properties.
8795 Two different kinds of internal variables exist, and both of which can
8797 There are boolean variables, which can only be in one of the two states
8801 and value variables with a(n optional) string value.
8802 For the latter proper quoting is necessary upon assignment time, the
8803 introduction of the section
8805 documents the supported quoting rules.
8807 .Bd -literal -offset indent
8808 ? wysh set one=val\e 1 two="val 2" \e
8809 three='val "3"' four=$'val \e'4\e''; \e
8810 varshow one two three four; \e
8811 unset one two three four
8815 Dependent upon the actual option string values may become interpreted as
8816 colour names, command specifications, normal text, etc.
8817 They may be treated as numbers, in which case decimal values are
8818 expected if so documented, but otherwise any numeric format and
8819 base that is valid and understood by the
8821 command may be used, too.
8824 There also exists a special kind of string value, the
8825 .Dq boolean string ,
8826 which must either be a decimal integer (in which case
8830 and any other value is true) or any of the (case-insensitive) strings
8836 for a false boolean and
8844 a special kind of boolean string is the
8846 it can optionally be prefixed with the (case-insensitive) term
8850 in interactive mode the user will be prompted, otherwise the actual
8854 Variable chains extend a plain
8859 .Ql variable-USER@HOST
8863 will be converted to all lowercase when looked up (but not when the
8864 variable is set or unset!), \*(OPally IDNA converted, and indeed means
8868 had been specified in the contextual Uniform Resource Locator URL, see
8869 .Sx "On URL syntax and credential lookup" .
8870 Even though this mechanism is based on URLs no URL percent encoding may
8871 be applied to neither of
8875 variable chains need to be specified using raw data;
8876 the mentioned section contains examples.
8877 Variables which support chains are explicitly documented as such, and
8878 \*(UA treats the base name of any such variable special, meaning that
8879 users should not create custom names like
8881 in order to avoid false classifications and treatment of such variables.
8883 .\" .Ss "Initial settings" {{{
8884 .\" (Keep in SYNC: mx/nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
8885 .Ss "Initial settings"
8887 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8893 .Pf no Va autoprint ,
8907 .Pf no Va ignoreeof ,
8909 .Pf no Va keepsave ,
8911 .Pf no Va outfolder ,
8919 .Pf no Va sendwait ,
8928 However, \*(UA has built-in some initial (and some default) settings
8929 which (may) diverge, others may become adjusted by one of the
8930 .Sx "Resource files" .
8931 Displaying the former is accomplished via
8933 .Ql $ \*(uA -:/ -v -Xset -Xx .
8934 In general this implementation sets (and has extended the meaning of)
8936 and does not support the
8938 variable \(en use command line options or
8940 to pass options through to a
8942 The default global resource file sets, among others, the variables
8947 establishes a default
8949 selection etc., and should thus be taken into account.
8952 .\" .Ss "Variables" {{{
8955 .Bl -tag -width ".It Va BaNg"
8959 \*(RO The exit status of the last command, or the
8964 This status has a meaning in the state machine: in conjunction with
8966 any non-0 exit status will cause a program exit, and in
8968 mode any error while loading (any of the) resource files will have the
8972 .Sx "Command modifiers" ,
8973 can be used to instruct the state machine to ignore errors.
8977 \*(RO The current error number
8978 .Pf ( Xr errno 3 ) ,
8979 which is set after an error occurred; it is also available via
8981 and the error name and documentation string can be queried via
8985 \*(ID This machinery is new and the error number is only really usable
8986 if a command explicitly states that it manages the variable
8988 for others errno will be used in case of errors, or
8990 if that is 0: it thus may or may not reflect the real error.
8991 The error number may be set with the command
8997 \*(RO This is a multiplexer variable which performs dynamic expansion of
8998 the requested state or condition, of which there are:
9000 .Bl -tag -width ".It Va BaNg"
9004 .It Va ^ERR , ^ERRDOC , ^ERRNAME
9005 The number, documentation, and name of the current
9007 respectively, which is usually set after an error occurred.
9008 The documentation is an \*(OP, the name is used if not available.
9009 \*(ID This machinery is new and is usually reliable only if a command
9010 explicitly states that it manages the variable
9012 which is effectively identical to
9014 Each of those variables can be suffixed with a hyphen minus followed by
9015 a name or number, in which case the expansion refers to the given error.
9016 Note this is a direct mapping of (a subset of) the system error values:
9017 .Bd -literal -offset indent
9019 eval echo \e$1: \e$^ERR-$1:\e
9020 \e$^ERRNAME-$1: \e$^ERRDOC-$1
9021 vput vexpr i + "$1" 1
9031 .It Va ^ERRQUEUE-COUNT , ^ERRQUEUE-EXISTS
9032 The number of messages in the \*(OPal queue of
9034 and a string indicating queue state: empty or (translated)
9036 Always 0 and the empty string, respectively, unless
9045 \*(RO Expands all positional parameters (see
9047 separated by the first character of the value of
9049 \*(ID The special semantics of the equally named special parameter of the
9051 are not yet supported.
9055 \*(RO Expands all positional parameters (see
9057 separated by a space character.
9058 If placed in double quotation marks, each positional parameter is
9059 properly quoted to expand to a single parameter again.
9063 \*(RO Expands to the number of positional parameters, i.e., the size of
9064 the positional parameter stack in decimal.
9068 \*(RO Inside the scope of a
9072 ed macro this expands to the name of the calling macro, or to the empty
9073 string if the macro is running from top-level.
9074 For the \*(OPal regular expression search and replace operator of
9076 this expands to the entire matching expression.
9077 It represents the program name in global context.
9081 \*(RO Access of the positional parameter stack.
9082 All further parameters can be accessed with this syntax, too,
9085 etc.; positional parameters can be shifted off the stack by calling
9087 The parameter stack contains, for example, the arguments of a
9091 d macro, the matching groups of the \*(OPal regular expression search
9092 and replace expression of
9094 and can be explicitly created or overwritten with the command
9099 \*(RO Is set to the active
9103 .It Va add-file-recipients
9104 \*(BO When file or pipe recipients have been specified,
9105 mention them in the corresponding address fields of the message instead
9106 of silently stripping them from their recipient list.
9107 By default such addressees are not mentioned.
9111 \*(BO Causes only the local part to be evaluated
9112 when comparing addresses.
9116 \*(BO Causes messages saved in the
9118 .Sx "secondary mailbox"
9120 to be appended to the end rather than prepended.
9121 This should always be set.
9125 \*(BO Causes the prompts for
9129 lists to appear after the message has been edited.
9133 \*(BO If set, \*(UA asks an interactive user for files to attach at the
9134 end of each message; An empty line finalizes the list.
9138 \*(BO Causes the interactive user to be prompted for carbon copy
9139 recipients (at the end of each message if
9147 \*(BO Causes the interactive user to be prompted for blind carbon copy
9148 recipients (at the end of each message if
9156 \*(BO Causes the interactive user to be prompted for confirmation to
9157 send the message or reenter compose mode after having been shown
9158 a preliminary envelope summary.
9162 \*(BO\*(OP Causes the interactive user to be prompted if the message is
9163 to be signed at the end of each message.
9166 variable is ignored when this variable is set.
9170 .\" The alternative *ask* is not documented on purpose
9171 \*(BO Causes \*(UA to prompt the interactive user for the subject upon
9172 entering compose mode unless a subject already exists.
9176 A sequence of characters to display in the
9180 as shown in the display of
9182 each for one type of messages (see
9183 .Sx "Message states" ) ,
9184 with the default being
9187 .Ql NU\ \ *HMFAT+\-$~
9190 variable is set, in the following order:
9192 .Bl -tag -compact -width ".It Ql _"
9214 \*(ID start of a (collapsed) thread in threaded mode (see
9218 \*(ID an uncollapsed thread in threaded mode; only used in conjunction with
9223 classified as possible spam.
9229 Specifies a list of recipients to which a blind carbon copy of each
9230 outgoing message will be sent automatically.
9234 Specifies a list of recipients to which a carbon copy of each outgoing
9235 message will be sent automatically.
9239 \*(BO Causes threads to be collapsed automatically when .Ql thread Ns
9242 mode is entered (see the
9248 \*(BO Enable automatic
9250 ing of a(n existing)
9256 commands: the message that becomes the new
9258 is shown automatically, as via
9265 Causes sorted mode (see the
9267 command) to be entered automatically with the value of this variable as
9268 sorting method when a folder is opened, for example
9269 .Ql set autosort=thread .
9273 \*(BO Enables the substitution of all not (reverse-solidus) escaped
9276 characters by the contents of the last executed command for the
9278 shell escape command and
9280 one of the compose mode
9281 .Sx "COMMAND ESCAPES" .
9282 If this variable is not set no reverse solidus stripping is performed.
9286 \*(OB Predecessor of
9287 .Va bind-inter-byte-timeout .
9288 \*(ID Setting this automatically sets the successor.
9291 .It Va bind-inter-byte-timeout
9292 \*(OP Terminals may generate multi-byte sequences for special function
9293 keys, for example, but these sequences may not become read as a unit.
9294 And multi-byte sequences can be defined freely via
9296 This variable specifies the timeout in milliseconds that the MLE (see
9297 .Sx "On terminal control and line editor" )
9298 waits for more bytes to arrive unless it considers a sequence
9300 The default is 200, the maximum is about 10 seconds.
9301 In the following example the comments state which sequences are
9302 affected by this timeout:
9303 .Bd -literal -offset indent
9304 ? bind base abc echo 0 # abc
9305 ? bind base ab,c echo 1 # ab
9306 ? bind base abc,d echo 2 # abc
9307 ? bind base ac,d echo 3 # ac
9308 ? bind base a,b,c echo 4
9309 ? bind base a,b,c,d echo 5
9310 ? bind base a,b,cc,dd echo 6 # cc and dd
9314 .It Va bind-inter-key-timeout
9317 sequences do not time out by default.
9318 If this variable is set, then the current key sequence is forcefully
9319 terminated once the timeout (in milliseconds) triggers.
9320 The value should be (maybe significantly) larger than
9321 .Va bind-inter-byte-timeout ,
9322 but may not excess the maximum, too.
9326 \*(BO Sets some cosmetical features to traditional BSD style;
9327 has the same affect as setting
9329 and all other variables prefixed with
9331 it also changes the behaviour of
9333 (which does not exist in BSD).
9337 \*(BO Changes the letters shown in the first column of a header
9338 summary to traditional BSD style.
9342 \*(BO Changes the display of columns in a header summary to traditional
9347 \*(BO Changes some informational messages to traditional BSD style.
9353 field to appear immediately after the
9355 field in message headers and with the
9357 .Sx "COMMAND ESCAPES" .
9363 .It Va build-cc , build-ld , build-os , build-rest
9364 \*(RO The build environment, including the compiler, the linker, the
9365 operating system \*(UA has been build for, usually taken from
9369 and then lowercased, as well as all the possibly interesting rest of the
9370 configuration and build environment.
9371 This information is also available in the
9373 output of the command
9378 The value that should appear in the
9382 MIME header fields when no character set conversion of the message data
9384 This defaults to US-ASCII, and the chosen character set should be
9385 US-ASCII compatible.
9389 \*(OP The default 8-bit character set that is used as an implicit last
9390 member of the variable
9392 This defaults to UTF-8 if character set conversion capabilities are
9393 available, and to ISO-8859-1 otherwise (unless the operating system
9394 environment is known to always and exclusively support UTF-8 locales),
9395 in which case the only supported character set is
9397 and this variable is effectively ignored.
9400 .It Va charset-unknown-8bit
9401 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
9403 the content of a mail message by using a character set with the name
9405 Because of the unclassified nature of this character set \*(UA will not
9406 be capable to convert this character set to any other character set.
9407 If this variable is set any message part which uses the character set
9409 is assumed to really be in the character set given in the value,
9410 otherwise the (final) value of
9412 is used for this purpose.
9414 This variable will also be taken into account if a MIME type (see
9415 .Sx "The mime.types files" )
9416 of a MIME message part that uses the
9418 character set is forcefully treated as text.
9422 The default value for the
9427 .It Va colour-disable
9428 \*(BO\*(OP Forcefully disable usage of colours.
9429 Also see the section
9430 .Sx "Coloured display" .
9434 \*(BO\*(OP Whether colour shall be used for output that is paged through
9436 Note that pagers may need special command line options, for example
9444 in order to support colours.
9445 Often doing manual adjustments is unnecessary since \*(UA may perform
9446 adjustments dependent on the value of the environment variable
9448 (see there for more).
9452 .It Va contact-mail , contact-web
9453 \*(RO Addresses for contact per email and web, respectively, for
9454 bug reports, suggestions, or anything else regarding \*(UA.
9455 The former can be used directly:
9456 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
9462 .It Va content-description-forwarded-message , \
9463 content-description-quote-attachment , \
9464 content-description-smime-message , \
9465 content-description-smime-signature
9466 \*(OP(partially) Strings which will be placed in according
9467 .Ql Content-Description:
9468 headers if non-empty.
9469 They all have default values, for example
9470 .Ql Forwarded message .
9474 In a(n interactive) terminal session, then if this valued variable is
9475 set it will be used as a threshold to determine how many lines the given
9476 output has to span before it will be displayed via the configured
9480 can be forced by setting this to the value
9482 setting it without a value will deduce the current height of the
9483 terminal screen to compute the threshold (see
9488 \*(ID At the moment this uses the count of lines of the message in wire
9489 format, which, dependent on the
9491 of the message, is unrelated to the number of display lines.
9492 (The software is old and historically the relation was a given thing.)
9496 Define a set of custom headers to be injected into newly composed or
9498 A custom header consists of the field name followed by a colon
9500 and the field content body.
9501 Standard header field names cannot be overwritten by a custom header,
9502 with the exception of
9506 Different to the command line option
9508 the variable value is interpreted as a comma-separated list of custom
9509 headers: to include commas in header bodies they need to become escaped
9510 with reverse solidus
9512 Headers can be managed more freely in
9517 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2, Hdr2: Body2'
9521 Controls the appearance of the
9523 date and time format specification of the
9525 variable, that is used, for example, when viewing the summary of
9527 If unset, then the local receiving date is used and displayed
9528 unformatted, otherwise the message sending
9530 It is possible to assign a
9532 format string and control formatting, but embedding newlines via the
9534 format is not supported, and will result in display errors.
9536 .Ql %Y-%m-%d %H:%M ,
9538 .Va datefield-markout-older .
9541 .It Va datefield-markout-older
9542 Only used in conjunction with
9544 Can be used to create a visible distinction of messages dated more than
9545 a day in the future, or older than six months, a concept comparable to the
9547 option of the POSIX utility
9549 If set to the empty string, then the plain month, day and year of the
9551 will be displayed, but a
9553 format string to control formatting can be assigned.
9559 \*(BO (Almost) Enter a debug-only sandbox mode which generates many
9560 log messages, disables the actual delivery of messages, and also implies
9568 .It Va disposition-notification-send
9570 .Ql Disposition-Notification-To:
9571 header (RFC 3798) with the message.
9575 .\" TODO .It Va disposition-notification-send-HOST
9577 .\".Va disposition-notification-send
9578 .\" for SMTP accounts on a specific host.
9579 .\" TODO .It Va disposition-notification-send-USER@HOST
9581 .\".Va disposition-notification-send
9582 .\"for a specific account.
9586 \*(BO When dot is set, a period
9588 on a line by itself during message input in (interactive or batch
9591 will be treated as end-of-message (in addition to the
9592 normal end-of-file condition).
9593 This behaviour is implied in
9599 .It Va dotlock-disable
9600 \*(BO\*(OP Disable creation of
9605 .It Va dotlock-ignore-error
9606 \*(OB\*(BO\*(OP Ignore failures when creating
9608 .Sx "dotlock files" .
9615 If this variable is set then the editor is started automatically when
9616 a message is composed in interactive mode.
9617 If the value starts with the letter
9619 then this acts as if
9623 .Pf (see\0 Sx "COMMAND ESCAPES" )
9627 variable is implied for this automatically spawned editor session.
9631 \*(BO When a message is edited while being composed,
9632 its header is included in the editable text.
9636 \*(BO When entering interactive mode \*(UA normally writes
9637 .Dq \&No mail for user
9638 and exits immediately if a mailbox is empty or does not exist.
9639 If this variable is set \*(UA starts even with an empty or non-existent
9640 mailbox (the latter behaviour furtherly depends upon
9646 \*(BO Let each command with a non-0 exit status, including every
9650 s a non-0 status, cause a program exit unless prefixed by
9653 .Sx "Command modifiers" ) .
9655 .Sx "COMMAND ESCAPES" ,
9656 but which use a different modifier for ignoring the error.
9657 Please refer to the variable
9659 for more on this topic.
9663 \*(OP Maximum number of entries in the
9669 The first character of this value defines the escape character for
9670 .Sx "COMMAND ESCAPES"
9672 .Sx "Compose mode" .
9673 The default value is the character tilde
9675 If set to the empty string, command escapes are disabled.
9680 If unset only user name and email address recipients are allowed
9681 .Sx "On sending mail, and non-interactive mode" .
9682 If set without value all possible recipient types will be accepted.
9683 A value is parsed as a comma-separated list of case-insensitive strings,
9684 and if that contains
9686 behaviour equals the former except when in interactive mode or if
9687 .Sx "COMMAND ESCAPES"
9692 in which case it equals the latter, allowing all address types.
9695 .Ql restrict,\:-all,\:+name,\:+addr ,
9696 so care for ordering issues must be taken.
9699 Recipient types can be added and removed with a plus sign
9703 prefix, respectively.
9704 By default invalid or disallowed types are filtered out and
9705 cause a warning, hard send errors need to be enforced by including
9713 header targets regardless of other settings,
9715 file targets (it includes
9718 command pipeline targets,
9720 user names still unexpanded after
9724 processing and thus left for expansion by the
9726 (invalid for the built-in SMTP one), and
9729 Targets are interpreted in the given order, so that
9730 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
9731 will cause hard errors for any non-network address recipient address
9732 unless running interactively or having been started with the option
9736 in the latter case(s) any type may be used.
9739 User name receivers addressing valid local users can be expanded to
9740 fully qualified network addresses (also see
9745 Historically invalid recipients were stripped off without causing
9746 errors, this can be changed by making
9748 an entry of the list (it really acts like
9749 .Ql failinvaddr,\:+addr ) .
9752 .Pf (really\0\: Ql domaincheck,\:+addr )
9753 compares address domain names against a whitelist and strips off
9755 for hard errors) addressees which fail this test; the domain name
9757 and the non-empty value of
9759 (the real hostname otherwise) are always whitelisted,
9760 .Va expandaddr-domaincheck
9761 can be set to extend this list.
9762 Finally some address providers (for example
9764 and all other command line recipients) will be evaluated as
9765 if specified within dollar-single-quotes (see
9766 .Sx "Shell-style argument quoting" )
9767 if the value list contains the string
9772 .It Va expandaddr-domaincheck
9773 Can be set to a comma-separated list of domain names which should be
9774 whitelisted for the evaluation of the
9778 IDNA encoding is not automatically performed,
9780 can be used to prepare the domain (of an address).
9784 Unless this variable is set additional
9786 (Mail-Transfer-Agent)
9787 arguments from the command line, as can be given after a
9789 separator, results in a program termination with failure status.
9790 The same can be accomplished by using the special (case-insensitive) value
9792 A lesser strict variant is the otherwise identical
9794 which does accept such arguments in interactive mode, or if tilde
9795 commands were enabled explicitly by using one of the command line options
9799 The empty value will allow unconditional usage.
9803 \*(RO String giving a list of optional features.
9804 Features are preceded with a plus sign
9806 if they are available, with a hyphen-minus
9809 To ease substring matching the string starts and ends with a comma.
9810 The output of the command
9812 includes this information in a more pleasant output.
9816 \*(BO This setting reverses the meanings of a set of reply commands,
9817 turning the lowercase variants, which by default address all recipients
9818 included in the header of a message
9819 .Pf ( Ic reply , respond , followup )
9820 into the uppercase variants, which by default address the sender only
9821 .Pf ( Ic Reply , Respond , Followup )
9826 The default path under which mailboxes are to be saved:
9827 filenames that begin with the plus sign
9829 will have the plus sign replaced with the value of this variable if set,
9830 otherwise the plus sign will remain unchanged when doing
9831 .Sx "Filename transformations" ;
9834 for more on this topic, and know about standard imposed implications of
9836 The value supports a subset of transformations itself, and if the
9837 non-empty value does not start with a solidus
9841 will be prefixed automatically.
9842 Once the actual value is evaluated first, the internal variable
9844 will be updated for caching purposes.
9847 .It Va folder-hook-FOLDER , Va folder-hook
9850 macro which will be called whenever a
9853 The macro will also be invoked when new mail arrives,
9854 but message lists for commands executed from the macro
9855 only include newly arrived messages then.
9857 are activated by default in a folder hook, causing the covered settings
9858 to be reverted once the folder is left again.
9860 The specialized form will override the generic one if
9862 matches the file that is opened.
9863 Unlike other folder specifications, the fully expanded name of a folder,
9864 without metacharacters, is used to avoid ambiguities.
9865 However, if the mailbox resides under
9869 specification is tried in addition, so that if
9873 (and thus relative to the user's home directory) then
9874 .Pa /home/usr1/mail/sent
9876 .Ql folder-hook-/home/usr1/mail/sent
9877 first, but then followed by
9878 .Ql folder-hook-+sent .
9881 .It Va folder-resolved
9882 \*(RO Set to the fully resolved path of
9884 once that evaluation has occurred; rather internal.
9888 \*(BO Controls whether a
9889 .Ql Mail-Followup-To:
9890 header is generated when sending messages to known mailing lists.
9891 The user as determined via
9893 (or, if that contains multiple addresses,
9895 will be placed in there if any list addressee is not a subscribed list.
9897 .Va followup-to-honour
9899 .Ic mlist , mlsubscribe , reply
9904 .It Va followup-to-add-cc
9905 \*(BO Controls whether the user will be added to the messages'
9907 list in addition to placing an entry in
9908 .Ql Mail-Followup-To:
9913 .It Va followup-to-honour
9915 .Ql Mail-Followup-To:
9916 header is honoured when group-replying to a message via
9923 if set without a value it defaults to
9929 .It Va forward-add-cc
9930 \*(BO Whether senders of messages forwarded via
9931 .Ic ~F , ~f , ~m , ~U
9934 shall be made members of the carbon copies
9939 .It Va forward-as-attachment
9940 \*(BO Original messages are normally sent as inline text with the
9943 and only the first part of a multipart message is included.
9944 With this setting enabled messages are sent as unmodified MIME
9946 attachments with all of their parts included.
9950 .It Va forward-inject-head , forward-inject-tail
9951 The strings to put before and after the text of a message with the
9953 command, respectively.
9954 The former defaults to
9955 .Ql -------- Original Message --------\en .
9956 Special format directives in these strings will be expanded if possible,
9957 and if so configured the output will be folded according to
9959 for more please refer to
9960 .Va quote-inject-head .
9961 Injections will not be performed by
9964 .Va forward-as-attachment
9966 .Sx "COMMAND ESCAPES"
9967 .Ic ~F , ~f , ~M , ~m , ~U , ~u
9973 The address (or a list of addresses) to put into the
9975 field of the message header, quoting RFC 5322:
9976 the author(s) of the message, that is, the mailbox(es) of the person(s)
9977 or system(s) responsible for the writing of the message.
9978 According to that RFC setting the
9980 variable is required if
9982 contains more than one address.
9983 \*(ID Please expect automatic management of the
9988 Dependent on the context these addresses are handled as if they were in
9993 If a file-based MTA is used, then
9995 (or, if that contains multiple addresses,
9997 can nonetheless be used as the envelope sender address at the MTA
9998 protocol level (the RFC 5321 reverse-path), either via the
10000 command line option (without argument; see there for more), or by setting
10001 .Va r-option-implicit .
10004 If the machine's hostname is not valid at the Internet (for example at
10005 a dialup machine), then either this variable or
10007 (\*(IN a SMTP-based
10009 adds even more fine-tuning capabilities with
10010 .Va smtp-hostname )
10011 have to be set: if so the message and MIME part related unique ID fields
10015 will be created (except when disallowed by
10016 .Va message-id-disable
10023 \*(BO Due to historical reasons comments and name parts of email
10024 addresses are removed by default when sending mail, replying to or
10025 forwarding a message.
10026 If this variable is set such stripping is not performed.
10029 \*(OB Predecessor of
10030 .Va forward-inject-head .
10034 \*(BO Causes the header summary to be written at startup and after
10035 commands that affect the number of messages or the order of messages in
10040 mode a header summary will also be displayed on folder changes.
10041 The command line option
10049 A format string to use for the summary of
10051 Format specifiers in the given string start with a percent sign
10053 and may be followed by an optional decimal number indicating the field
10054 width \(em if that is negative, the field is to be left-aligned.
10055 Names and addresses are subject to modifications according to
10059 Valid format specifiers are:
10062 .Bl -tag -compact -width ".It Ql _%%_"
10064 A plain percent sign.
10067 a space character but for the current message
10069 for which it expands to
10072 .Va headline-plain ) .
10075 a space character but for the current message
10077 for which it expands to
10080 .Va headline-plain ) .
10082 \*(OP The spam score of the message, as has been classified via the
10085 Shows only a replacement character if there is no spam support.
10087 Message attribute character (status flag); the actual content can be
10088 adjusted by setting
10091 The date found in the
10093 header of the message when
10095 is set (the default), otherwise the date when the message was received.
10096 Formatting can be controlled by assigning a
10101 .Va datefield-markout-older ) .
10103 The indenting level in
10109 The address of the message sender.
10111 The message thread tree structure.
10112 (Note that this format does not support a field width, and honours
10113 .Va headline-plain . )
10115 Mailing list status: is the addressee of the message a known
10124 announces the presence of a RFC 2369
10126 header, which makes a message a valuable target of
10129 The number of lines of the message, if available.
10133 The number of octets (bytes) in the message, if available.
10135 Message subject (if any) in double quotes.
10137 Message subject (if any).
10139 The position in threaded/sorted order.
10141 The value 0 except in an IMAP mailbox,
10142 where it expands to the UID of the message.
10146 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
10148 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
10156 .Va headline-bidi .
10160 .It Va headline-bidi
10161 Bidirectional text requires special treatment when displaying headers,
10162 because numbers (in dates or for file sizes etc.) will not affect the
10163 current text direction, in effect resulting in ugly line layouts when
10164 arabic or other right-to-left text is to be displayed.
10165 On the other hand only a minority of terminals is capable to correctly
10166 handle direction changes, so that user interaction is necessary for
10167 acceptable results.
10168 Note that extended host system support is required nonetheless, e.g.,
10169 detection of the terminal character set is one precondition;
10170 and this feature only works in an Unicode (i.e., UTF-8) locale.
10172 In general setting this variable will cause \*(UA to encapsulate text
10173 fields that may occur when displaying
10175 (and some other fields, like dynamic expansions in
10177 with special Unicode control sequences;
10178 it is possible to fine-tune the terminal support level by assigning
10180 no value (or any value other than
10185 will make \*(UA assume that the terminal is capable to properly deal
10186 with Unicode version 6.3, in which case text is embedded in a pair of
10187 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
10189 In addition no space on the line is reserved for these characters.
10191 Weaker support is chosen by using the value
10193 (Unicode 6.3, but reserve the room of two spaces for writing the control
10194 sequences onto the line).
10199 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
10200 again reserves room for two spaces in addition.
10203 .It Va headline-plain
10204 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
10205 used by default for certain entries of
10207 If this variable is set only basic US-ASCII symbols will be used.
10210 .It Va history-file
10211 \*(OP The (expandable) location of a permanent
10213 file for the MLE line editor
10214 .Pf ( Sx "On terminal control and line editor" ) .
10219 .It Va history-gabby
10220 \*(OP Add more entries to the MLE
10222 as is normally done.
10223 A comma-separated list of case-insensitive strings can be used to
10224 fine-tune which gabby entries shall be allowed.
10227 erroneous commands will also be added.
10229 adds all optional entries, and is the fallback chattiness identifier of
10230 .Va on-history-addition .
10233 .It Va history-gabby-persist
10236 entries will not be saved in persistent storage unless this variable is set.
10237 The knowledge of whether a persistent entry was gabby is not lost.
10242 .It Va history-size
10243 \*(OP Setting this variable imposes a limit on the number of concurrent
10246 If set to the value 0 then no further history entries will be added,
10247 and loading and incorporation of the
10249 upon program startup can also be suppressed by doing this.
10250 Runtime changes will not be reflected before the
10252 is saved or loaded (again).
10256 \*(BO This setting controls whether messages are held in the system
10258 and it is set by default.
10262 Used instead of the value obtained from
10266 as the hostname when expanding local addresses, for example in
10269 .Sx "On sending mail, and non-interactive mode" ,
10270 for expansion of addresses that have a valid user-, but no domain
10271 name in angle brackets).
10274 or this variable is set the message and MIME part related unique ID fields
10278 will be created (except when disallowed by
10279 .Va message-id-disable
10282 If the \*(OPal IDNA support is available (see
10284 variable assignment is aborted when a necessary conversion fails.
10286 Setting it to the empty string will cause the normal hostname to be
10287 used, but nonetheless enables creation of said ID fields.
10288 \*(IN in conjunction with the built-in SMTP
10291 also influences the results:
10292 one should produce some test messages with the desired combination of
10300 .It Va idna-disable
10301 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
10302 names according to the rules of IDNA (internationalized domain names
10304 Since the IDNA code assumes that domain names are specified with the
10306 character set, an UTF-8 locale charset is required to represent all
10307 possible international domain names (before conversion, that is).
10311 The input field separator that is used (\*(ID by some functions) to
10312 determine where to split input data.
10314 .Bl -tag -compact -width ".It MMM"
10316 Unsetting is treated as assigning the default value,
10319 If set to the empty value, no field splitting will be performed.
10321 If set to a non-empty value, all whitespace characters are extracted
10322 and assigned to the variable
10326 .Bl -tag -compact -width ".It MMM"
10329 will be ignored at the beginning and end of input.
10330 Diverging from POSIX shells default whitespace is removed in addition,
10331 which is owed to the entirely different line content extraction rules.
10333 Each occurrence of a character of
10335 will cause field-splitting, any adjacent
10337 characters will be skipped.
10342 \*(RO Automatically deduced from the whitespace characters in
10347 \*(BO Ignore interrupt signals from the terminal while entering
10348 messages; instead echo them as
10350 characters and discard the current line.
10354 \*(BO Ignore end-of-file conditions
10355 .Pf ( Ql control-D )
10358 on message input and in interactive command input.
10359 If set an interactive command input session can only be left by
10360 explicitly using one of the commands
10364 and message input in compose mode can only be terminated by entering
10367 on a line by itself or by using the
10369 .Sx "COMMAND ESCAPES" ;
10370 Setting this implies the behaviour that
10378 If this is set to a non-empty string it will specify the user's
10380 .Sx "primary system mailbox" ,
10383 and the system-dependent default, and (thus) be used to replace
10386 .Sx "Filename transformations" ;
10389 for more on this topic.
10390 The value supports a subset of transformations itself.
10392 .It Va indentprefix
10397 .Sx "COMMAND ESCAPES"
10400 option for indenting messages,
10401 in place of the POSIX mandated default tabulator character
10408 \*(BO If set, an empty
10410 .Sx "primary system mailbox"
10411 file is not removed.
10412 Note that, in conjunction with
10414 mode any empty file will be removed unless this variable is set.
10415 This may improve the interoperability with other mail user agents
10416 when using a common folder directory, and prevents malicious users
10417 from creating fake mailboxes in a world-writable spool directory.
10418 \*(ID Only local regular (MBOX) files are covered, Maildir and other
10419 mailbox types will never be removed, even if empty.
10422 .It Va keep-content-length
10423 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
10424 be told to keep the
10425 .Ql Content-Length:
10428 header fields that some MUAs generate by setting this variable.
10429 Since \*(UA does neither use nor update these non-standardized header
10430 fields (which in itself shows one of their conceptual problems),
10431 stripping them should increase interoperability in between MUAs that
10432 work with with same mailbox files.
10433 Note that, if this is not set but
10434 .Va writebackedited ,
10435 as below, is, a possibly performed automatic stripping of these header
10436 fields already marks the message as being modified.
10437 \*(ID At some future time \*(UA will be capable to rewrite and apply an
10439 to modified messages, and then those fields will be stripped silently.
10443 \*(BO When a message is saved it is usually discarded from the
10444 originating folder when \*(UA is quit.
10445 This setting causes all saved message to be retained.
10448 .It Va line-editor-cpl-word-breaks
10449 \*(OP List of bytes which are used by the
10451 tabulator completion to decide where word boundaries exist, by default
10453 \*(ID This mechanism is yet restricted.
10456 .It Va line-editor-disable
10457 \*(BO Turn off any line editing capabilities (from \*(UAs POW, see
10458 .Sx "On terminal control and line editor"
10462 .It Va line-editor-no-defaults
10463 \*(BO\*(OP Do not establish any default key binding.
10467 Error log message prefix string
10468 .Pf ( Ql "\*(uA: " ) .
10471 .It Va mailbox-display
10472 \*(RO The name of the current mailbox
10473 .Pf ( Ic folder ) ,
10474 possibly abbreviated for display purposes.
10477 .It Va mailbox-resolved
10478 \*(RO The fully resolved path of the current mailbox.
10481 .It Va mailcap-disable
10482 \*(BO\*(OP Turn off consideration of MIME type handlers from,
10483 and implicit loading of
10484 .Sx "The Mailcap files" .
10487 .It Va mailx-extra-rc
10488 An additional startup file that is loaded as the last of the
10489 .Sx "Resource files" .
10490 Use this file for commands that are not understood by other POSIX
10492 implementations, i.e., mostly anything which is not covered by
10493 .Sx "Initial settings" .
10496 .It Va markanswered
10497 \*(BO When a message is replied to and this variable is set,
10498 it is marked as having been
10501 .Sx "Message states" .
10504 .It Va mbox-fcc-and-pcc
10505 \*(BO By default all file and pipe message receivers (see
10507 will be fed valid MBOX database entry message data (see
10509 .Va mbox-rfc4155 ) ,
10510 and existing file targets will become extended in compliance to RFC 4155.
10511 If this variable is unset then a plain standalone RFC 5322 message will
10512 be written, and existing file targets will be overwritten.
10515 .It Va mbox-rfc4155
10516 \*(BO When opening MBOX mailbox databases, and in order to achieve
10517 compatibility with old software, the very tolerant POSIX standard rules
10518 for detecting message boundaries (so-called
10520 lines) are used instead of the stricter rules from the standard RFC 4155.
10521 This behaviour can be switched by setting this variable.
10523 This may temporarily be handy when \*(UA complains about invalid
10525 lines when opening a MBOX: in this case setting this variable and
10526 re-opening the mailbox in question may correct the result.
10527 If so, copying the entire mailbox to some other file, as in
10528 .Ql copy * SOME-FILE ,
10529 will perform proper, all-compatible
10531 quoting for all detected messages, resulting in a valid MBOX mailbox.
10532 (\*(ID The better and non-destructive approach is to re-encode invalid
10533 messages, as if it would be created anew, instead of mangling the
10535 lines; this requires the structural code changes of the v15 rewrite.)
10536 Finally the variable can be unset again:
10537 .Bd -literal -offset indent
10539 localopts yes; wysh set mbox-rfc4155;\e
10540 wysh File "${1}"; copy * "${2}"
10542 call mboxfix /tmp/bad.mbox /tmp/good.mbox
10547 \*(BO Internal development variable.
10548 (Keeps memory debug enabled even if
10553 .It Va message-id-disable
10554 \*(BO By setting this variable the generation of
10558 message and MIME part headers can be completely suppressed, effectively
10559 leaving this task up to the
10561 (Mail-Transfer-Agent) or the SMTP server.
10562 Note that according to RFC 5321 a SMTP server is not required to add this
10563 field by itself, so it should be ensured that it accepts messages without
10567 .It Va message-inject-head
10568 A string to put at the beginning of each new message, followed by a newline.
10569 \*(OB The escape sequences tabulator
10573 are understood (use the
10577 ting the variable(s) instead).
10580 .It Va message-inject-tail
10581 A string to put at the end of each new message, followed by a newline.
10582 \*(OB The escape sequences tabulator
10586 are understood (use the
10590 ting the variable(s) instead).
10592 .Va on-compose-leave .
10596 \*(BO Usually, when an
10598 expansion contains the sender, the sender is removed from the expansion.
10599 Setting this option suppresses these removals.
10604 option to be passed through to the
10606 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
10607 this flag, no MTA is known which does not support it (for historical
10611 .It Va mime-allow-text-controls
10612 \*(BO When sending messages, each part of the message is MIME-inspected
10613 in order to classify the
10616 .Ql Content-Transfer-Encoding:
10618 .Va mime-encoding )
10619 that is required to send this part over mail transport, i.e.,
10620 a computation rather similar to what the
10622 command produces when used with the
10626 This classification however treats text files which are encoded in
10627 UTF-16 (seen for HTML files) and similar character sets as binary
10628 octet-streams, forcefully changing any
10633 .Ql application/octet-stream :
10634 If that actually happens a yet unset charset MIME parameter is set to
10636 effectively making it impossible for the receiving MUA to automatically
10637 interpret the contents of the part.
10639 If this variable is set, and the data was unambiguously identified as
10640 text data at first glance (by a
10644 file extension), then the original
10646 will not be overwritten.
10649 .It Va mime-alternative-favour-rich
10650 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
10651 HTML) will be preferred in favour of included plain text versions when
10652 displaying messages, provided that a handler exists which produces
10653 output that can be (re)integrated into \*(UA's normal visual display.
10656 .It Va mime-counter-evidence
10659 field is used to decide how to handle MIME parts.
10660 Some MUAs, however, do not use
10661 .Sx "The mime.types files"
10663 .Sx "HTML mail and MIME attachments" )
10664 or a similar mechanism to correctly classify content, but specify an
10665 unspecific MIME type
10666 .Pf ( Ql application/octet-stream )
10667 even for plain text attachments.
10668 If this variable is set then \*(UA will try to re-classify such MIME
10669 message parts, if possible, for example via a possibly existing
10670 attachment filename.
10671 A non-empty value may also be given, in which case a number is expected,
10672 actually a carrier of bits, best specified as a binary value, like
10675 .Bl -bullet -compact
10677 If bit two is set (counting from 1, decimal 2) then the detected
10679 will be carried along with the message and be used for deciding which
10680 MIME handler is to be used, for example;
10681 when displaying such a MIME part the part-info will indicate the
10682 overridden content-type by showing a plus sign
10685 If bit three is set (decimal 4) then the counter-evidence is always
10686 produced and a positive result will be used as the MIME type, even
10687 forcefully overriding the parts given MIME type.
10689 If bit four is set (decimal 8) as a last resort the actual content of
10690 .Ql application/octet-stream
10691 parts will be inspected, so that data which looks like plain text can be
10693 This mode is even more relaxed when data is to be displayed to the user
10694 or used as a message quote (data consumers which mangle data for display
10695 purposes, which includes masking of control characters, for example).
10700 .It Va mime-encoding
10702 .Ql Content-Transfer-Encoding
10703 to use in outgoing text messages and message parts, where applicable
10704 (7-bit clean text messages are without an encoding if possible):
10707 .Bl -tag -compact -width ".It Ql _%%_"
10709 .Pf (Or\0 Ql 8b . )
10710 8-bit transport effectively causes the raw data be passed through
10711 unchanged, but may cause problems when transferring mail messages over
10712 channels that are not ESMTP (RFC 1869) compliant.
10713 Also, several input data constructs are not allowed by the
10714 specifications and may cause a different transfer-encoding to be used.
10715 By established rules and popular demand occurrences of
10719 will be MBOXO quoted (prefixed with greater-than sign
10721 instead of causing a non-destructive encoding like
10722 .Ql quoted-printable
10723 to be chosen, unless context (like message signing) requires otherwise.
10725 .It Ql quoted-printable
10726 .Pf (Or\0 Ql qp . )
10727 Quoted-printable encoding is 7-bit clean and has the property that ASCII
10728 characters are passed through unchanged, so that an english message can
10729 be read as-is; it is also acceptable for other single-byte locales that
10730 share many characters with ASCII, for example ISO-8859-1.
10731 The encoding will cause a large overhead for messages in other character
10732 sets: for example it will require up to twelve (12) bytes to encode
10733 a single UTF-8 character of four (4) bytes.
10734 It is the default encoding.
10737 .Pf (Or\0 Ql b64 . )
10738 This encoding is 7-bit clean and will always be used for binary data.
10739 This encoding has a constant input:output ratio of 3:4, regardless of
10740 the character set of the input data it will encode three bytes of input
10741 to four bytes of output.
10742 This transfer-encoding is not human readable without performing
10748 .It Va mime-force-sendout
10749 \*(BO\*(OP Whenever it is not acceptable to fail sending out messages
10750 because of non-convertible character content this variable may be set.
10751 It will, as a last resort, classify the part content as
10752 .Ql application/octet-stream .
10753 Please refer to the section
10754 .Sx "Character sets"
10755 for the complete picture of character set conversion, and
10756 .Sx "HTML mail and MIME attachments"
10757 for how to internally or externally handle part content.
10760 .It Va mimetypes-load-control
10761 Can be used to control which of
10762 .Sx "The mime.types files"
10763 are loaded: if the letter
10765 is part of the option value, then the user's personal
10767 file will be loaded (if it exists); likewise the letter
10769 controls loading of the system wide
10771 directives found in the user file take precedence, letter matching is
10773 If this variable is not set \*(UA will try to load both files.
10774 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
10775 but they will be matched last (the order can be listed via
10778 More sources can be specified by using a different syntax: if the
10779 value string contains an equals sign
10781 then it is instead parsed as a comma-separated list of the described
10784 pairs; the given filenames will be expanded and loaded, and their
10785 content may use the extended syntax that is described in the section
10786 .Sx "The mime.types files" .
10787 Directives found in such files always take precedence (are prepended to
10788 the MIME type cache).
10793 Select an alternate Mail-Transfer-Agent by either specifying the full
10794 pathname of an executable (a
10796 prefix may be given), or \*(OPally a SMTP aka SUBMISSION protocol URL \*(IN:
10798 .Dl submissions://[user[:password]@]server[:port]
10801 .Ql [smtp://]server[:port] . )
10802 The default has been chosen at compile time.
10803 MTA data transfers are always performed in asynchronous child processes,
10804 and without supervision unless either the
10811 \*(OPally expansion of
10813 can be performed by setting
10817 For testing purposes there is the
10819 pseudo-MTA, which dumps to standard output or optionally to a file,
10821 .Va mbox-fcc-and-pcc :
10823 .Bd -literal -offset indent
10824 $ echo text | \*(uA -:/ -Smta=test -s ubject ex@am.ple
10825 $ </dev/null \*(uA -:/ -Smta=test://./xy ex@am.ple
10829 For a file-based MTA it may be necessary to set
10831 in in order to choose the right target of a modern
10834 It will be passed command line arguments from several possible sources:
10837 if set, from the command line if given and the variable
10840 Argument processing of the MTA will be terminated with a
10845 The otherwise occurring implicit usage of the following MTA command
10846 line arguments can be disabled by setting the boolean variable
10847 .Va mta-no-default-arguments
10848 (which will also disable passing
10852 (for not treating a line with only a dot
10854 character as the end of input),
10856 (shall the variable
10862 variable is set); in conjunction with the
10864 command line option or
10865 .Va r-option-implicit
10867 as well as possibly
10869 will (not) be passed.
10872 \*(OPally \*(UA can send mail over SMTP aka SUBMISSION network
10873 connections to a single defined smart host by setting this variable to
10874 a SMTP or SUBMISSION URL (see
10875 .Sx "On URL syntax and credential lookup" ) .
10876 An authentication scheme can be specified via the variable chain
10878 Encrypted network connections are \*(OPally available, the section
10879 .Sx "Encrypted network communication"
10880 should give an overview and provide links to more information on this.
10881 Note that with some mail providers it may be necessary to set the
10883 variable in order to use a specific combination of
10888 Network communication socket timeouts are configurable via
10889 .Va socket-connect-timeout .
10890 All generated network traffic may be proxied over a SOCKS
10892 it can be logged by setting
10895 The following SMTP variants may be used:
10899 The plain SMTP protocol (RFC 5321) that normally lives on the
10900 server port 25 and requires setting the
10901 .Va smtp-use-starttls
10902 variable to enter a TLS encrypted session state.
10903 Assign a value like \*(IN
10904 .Ql smtp://[user[:password]@]server[:port]
10906 .Ql smtp://server[:port] )
10907 to choose this protocol.
10909 The so-called SMTPS which is supposed to live on server port 465
10910 and is automatically TLS secured.
10911 Unfortunately it never became a standardized protocol and may thus not
10912 be supported by your hosts network service database
10913 \(en in fact the port number has already been reassigned to other
10916 SMTPS is nonetheless a commonly offered protocol and thus can be
10917 chosen by assigning a value like \*(IN
10918 .Ql smtps://[user[:password]@]server[:port]
10920 .Ql smtps://server[:port] ) ;
10921 due to the mentioned problems it is usually necessary to explicitly
10922 specify the port as
10926 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
10927 is identically to the SMTP protocol from \*(UA's point of view;
10928 it requires setting
10929 .Va smtp-use-starttls
10930 to enter a TLS secured session state; e.g., \*(IN
10931 .Ql submission://[user[:password]@]server[:port] .
10933 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
10934 TLS secured by default.
10935 It can be chosen by assigning a value like \*(IN
10936 .Ql submissions://[user[:password]@]server[:port] .
10937 Due to the problems mentioned for SMTPS above and the fact that
10938 SUBMISSIONS is new and a successor that lives on the same port as the
10939 historical engineering mismanagement named SMTPS, it is usually
10940 necessary to explicitly specify the port as
10947 \*(OP If set to a path pointing to a text file in valid MTA (Postfix)
10949 format, the file is loaded and cached (manageable with
10951 and henceforth plain
10955 message receiver names are recursively expanded as a last expansion
10956 step, after the distribution lists which can be created with
10960 content support: only local addresses (names) which are valid usernames
10961 .Pf ( Ql [a-z_][a-z0-9_-]*[$]? )
10962 are treated as expandable aliases, and \*(ID
10963 .Ql :include:/file/name
10964 directives are not supported.
10969 it can be asserted that only expanded names (mail addresses) are passed
10970 through to the MTA.
10973 .It Va mta-arguments
10974 Arguments to pass through to a file-based
10976 (Mail-Transfer-Agent), parsed according to
10977 .Sx "Shell-style argument quoting"
10978 into an array of arguments which will be joined onto MTA options
10979 from other sources, for example
10980 .Ql \&? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
10983 .It Va mta-no-default-arguments
10984 \*(BO Avoids passing standard command line options to a file-based
10986 (please see there).
10989 .It Va mta-no-receiver-arguments
10990 \*(BO By default all receiver addresses will be passed as command line
10991 options to a file-based
10993 Setting this variable disables this behaviour to aid those MTAs which
10994 employ special treatment of such arguments.
10995 Doing so can make it necessary to pass a
10998 .Va mta-arguments ,
10999 to testify the MTA that it should use the passed message as a template.
11003 Many systems use a so-called
11005 environment to ensure compatibility with
11007 This works by inspecting the name that was used to invoke the mail
11009 If this variable is set then the mailwrapper (the program that is
11010 actually executed when calling the file-based
11012 will treat its contents as that name.
11016 \*(BO In violation of RFC 5322 some MTAs do not remove
11018 header lines from transported messages after having noted the respective
11019 receivers for addressing purposes.
11020 (The MTAs Exim and Courier for example require the command line option
11022 to enforce removal.)
11023 Unless this is set corresponding receivers are addressed by
11024 protocol-specific means or MTA command line options only, the header
11025 itself is stripped before being sent over the wire.
11027 .Mx Va netrc-lookup
11028 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
11029 \*(BO\*(IN\*(OP Used to control usage of the user's
11031 file for lookup of account credentials, as documented in the section
11032 .Sx "On URL syntax and credential lookup"
11033 and for the command
11036 .Sx "The .netrc file"
11037 documents the file format.
11049 then \*(UA will read the output of a shell pipe instead of the user's
11051 file if this variable is set (to the desired shell command).
11052 This can be used to, for example, store
11055 .Ql \&? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
11059 \*(OP If this variable has the value
11061 newly created local folders will be in Maildir instead of MBOX format.
11065 Checks for new mail in the current folder each time the prompt is shown.
11066 A Maildir folder must be re-scanned to determine if new mail has arrived.
11067 If this variable is set to the special value
11069 then a Maildir folder will not be rescanned completely, but only
11070 timestamp changes are detected.
11071 Maildir folders are \*(OPal.
11075 \*(BO Causes a non-absolute filename specified in
11077 as well as the sender-based filenames of the
11083 commands to be interpreted relative to the
11085 directory rather than relative to the current directory.
11087 .Mx Va on-account-cleanup
11088 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
11089 Macro hook which will be called once an
11091 is left, as the very last step before unrolling per-account
11093 This hook is run even in case of fatal errors, including those generated
11094 by switching to the account as such, and it is advisable to perform only
11095 absolutely necessary actions, like cleaning up
11098 The specialized form is used in favour of the generic one if found.
11101 .It Va on-compose-cleanup
11102 Macro hook which will be called after the message has been sent (or not,
11103 in case of failures), as the very last step before unrolling compose mode
11105 This hook is run even in case of fatal errors, and it is advisable to
11106 perform only absolutely necessary actions, like cleaning up
11110 For compose mode hooks that may affect the message content please see
11111 .Va on-compose-enter , on-compose-leave , on-compose-splice .
11112 \*(ID This hook exists because
11113 .Ic alias , alternates , commandalias , shortcut ,
11114 to name a few, are neither covered by
11118 changes applied in compose mode will continue to be in effect thereafter.
11123 .It Va on-compose-enter , on-compose-leave
11124 Macro hooks which will be called once compose mode is entered,
11125 and after composing has been finished, respectively;
11126 the exact order of the steps taken is documented for
11129 .Sx "COMMAND ESCAPES" .
11130 Context about the message being worked on can be queried via
11133 are enabled for these hooks, and changes on variables will be forgotten
11134 after the message has been sent.
11135 .Va on-compose-cleanup
11136 can be used to perform other necessary cleanup steps.
11139 Here is an example that injects a signature via
11140 .Va message-inject-tail ;
11142 .Va on-compose-splice
11143 to simply inject the file of desire via
11147 may be a better approach.
11149 .Bd -literal -offset indent
11151 vput ! i cat ~/.mysig
11153 vput csop message-inject-tail trim-end $i
11157 readctl create ~/.mysig
11161 vput csop message-inject-tail trim-end $i
11163 readctl remove ~/.mysig
11166 set on-compose-leave=t_ocl
11172 .It Va on-compose-splice , on-compose-splice-shell
11173 These hooks run once the normal compose mode is finished, but before the
11174 .Va on-compose-leave
11175 macro hook is called etc.
11176 Both hooks will be executed in a subprocess, with their input and output
11177 connected to \*(UA such that they can act as if they would be an
11179 The difference in between them is that the latter is a
11181 command, whereas the former is a normal
11183 d macro, but which is restricted to a small set of commands (the
11185 output of for example
11187 will indicate said capability).
11189 are enabled for these hooks (in the parent process), causing any setting
11190 to be forgotten after the message has been sent;
11191 .Va on-compose-cleanup
11192 can be used to perform other cleanup as necessary.
11195 During execution of these hooks \*(UA will temporarily forget whether it
11196 has been started in interactive mode, (a restricted set of)
11197 .Sx "COMMAND ESCAPES"
11198 will always be available, and for guaranteed reproducibilities sake
11202 will be set to their defaults.
11203 The compose mode command
11205 has been especially designed for scriptability (via these hooks).
11206 The first line the hook will read on its standard input is the protocol
11207 version of said command escape, currently
11209 backward incompatible protocol changes have to be expected.
11212 Care must be taken to avoid deadlocks and other false control flow:
11213 if both involved processes wait for more input to happen at the
11214 same time, or one does not expect more input but the other is stuck
11215 waiting for consumption of its output, etc.
11216 There is no automatic synchronization of the hook: it will not be
11217 stopped automatically just because it, e.g., emits
11219 The hooks will however receive a termination signal if the parent enters
11220 an error condition.
11221 \*(ID Protection against and interaction with signals is not yet given;
11222 it is likely that in the future these scripts will be placed in an
11223 isolated session, which is signalled in its entirety as necessary.
11225 .Bd -literal -offset indent
11226 define ocs_signature {
11228 echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
11230 set on-compose-splice=ocs_signature
11232 wysh set on-compose-splice-shell=$'\e
11234 printf "hello $version! Headers: ";\e
11235 echo \e'~^header list\e';\e
11236 read status result;\e
11237 echo "status=$status result=$result";\e
11242 echo Splice protocol version is $version
11243 echo '~^h l'; read hl; vput csop es subs "${hl}" 0 1
11245 echoerr 'Cannot read header list'; echo '~x'; xit
11247 if "$hl" !%?case ' cc'
11248 echo '~^h i cc "Diet is your <mirr.or>"'; read es;\e
11249 vput csop es substring "${es}" 0 1
11251 echoerr 'Cannot insert Cc: header'; echo '~x'
11252 # (no xit, macro finishes anyway)
11256 set on-compose-splice=ocsm
11261 .It Va on-history-addition
11262 This hook will be called if an entry is about to be added to the
11264 of the MLE, as documented in
11265 .Sx "On terminal control and line editor" .
11266 It will be called with three arguments: the first is the name of the
11269 the second is either an empty string or the matching
11271 type, and the third being the complete command line to be added.
11272 The entry will not be added to history if the hook uses a non-0
11274 \*(ID A future version will give the expanded command name as the third
11275 argument, followed by the tokenized command line as parsed in the
11276 remaining arguments, the first of which is the original unexpanded
11277 command name; i.e., one may do
11278 .Ql Ic shift Ns \| 4
11279 and will then be able to access the positional parameters as usual via
11284 .It Va on-main-loop-tick
11285 This hook will be called whenever the program's main event loop is
11286 about to read the next input line.
11287 Note variable and other changes it performs are not scoped as via
11291 .It Va on-program-exit
11292 This hook will be called when the program exits, whether via
11296 or because the send mode is done.
11298 this runs late and so terminal settings etc. are already teared down.
11301 .It Va on-resend-cleanup
11303 .Va on-compose-cleanup ,
11304 but is only triggered by
11308 .It Va on-resend-enter
11310 .Va on-compose-enter ,
11311 but is only triggered by
11313 currently there is no
11315 support, for example.
11319 \*(BO If set, each message feed through the command given for
11321 is followed by a formfeed character
11325 .It Va password-USER@HOST , password-HOST , password
11326 \*(IN Variable chain that sets a password, which is used in case none has
11327 been given in the protocol and account-specific URL;
11328 as a last resort \*(UA will ask for a password on the user's terminal if
11329 the authentication method requires a password.
11330 Specifying passwords in a startup file is generally a security risk;
11331 the file should be readable by the invoking user only.
11333 .It Va password-USER@HOST
11334 \*(OU (see the chain above for \*(IN)
11335 Set the password for
11339 If no such variable is defined for a host,
11340 the user will be asked for a password on standard input.
11341 Specifying passwords in a startup file is generally a security risk;
11342 the file should be readable by the invoking user only.
11346 \*(BO Send messages to the
11348 command without performing MIME and character set conversions.
11351 .It Va pipe-EXTENSION
11353 .Va pipe-TYPE/SUBTYPE
11356 (normalized to lowercase using character mappings of the ASCII charset)
11357 denotes a file extension, for example
11359 Handlers registered using this method take precedence.
11363 .It Va pipe-TYPE/SUBTYPE
11364 A MIME message part identified as
11366 (case-insensitive, normalized to lowercase using character mappings of
11367 the ASCII charset) is displayed or quoted,
11368 its text is filtered through the value of this variable interpreted as
11370 Unless noted only parts displayable as inline plain text (see
11371 .Cd copiousoutput )
11372 are covered, other MIME parts will only be considered by and for
11376 The special value question mark
11378 forces interpretation of the message part as plain text, for example
11379 .Ql set pipe-application/xml=? .
11380 (This can also be achieved by adding a MIME type-marker via
11382 \*(OPally MIME type handlers may be defined via
11383 .Sx "The Mailcap files"
11384 to which should be referred to for documentation of flags like
11385 .Cd copiousoutput .
11386 Question mark is indeed a trigger character to indicate flags that
11387 adjust behaviour and usage of the rest of the value, the shell command,
11390 .Bd -literal -offset indent
11391 ? set pipe-X/Y='?!++=? vim ${MAILX_FILENAME_TEMPORARY}'
11395 .Bl -tag -compact -width ".It Ql __"
11397 The command output can be reintegrated into this MUA's normal processing:
11398 .Cd copiousoutput .
11399 Implied when using a plain
11403 Only use this handler for display, not for quoting a message:
11404 .Cd x-mailx-noquote .
11407 Run the command asynchronously, do not wait for the handler to exit:
11408 .Cd x-mailx-async .
11409 The standard output of the command will go to
11413 The command must be run on an interactive terminal, the terminal will
11414 temporarily be released for it to run:
11415 .Cd needsterminal .
11418 Request creation of a zero-sized temporary file, the absolute pathname
11419 of which will be made accessible via the environment variable
11420 .Ev MAILX_FILENAME_TEMPORARY :
11421 .Cd x-mailx-tmpfile .
11422 If given twice then the file will be unlinked automatically by \*(UA
11423 when the command loop is entered again at latest:
11424 .Cd x-mailx-tmpfile-unlink ;
11425 it is an error to use automatic deletion in conjunction with
11426 .Cd x-mailx-async .
11429 Normally the MIME part content is passed to the handler via standard
11430 input; with this the data will instead be written into
11431 .Ev MAILX_FILENAME_TEMPORARY
11432 .Pf ( Cd x-mailx-tmpfile-fill ) ,
11433 the creation of which is implied; in order to cause automatic deletion
11434 of the temporary file two plus signs
11436 still have to be used.
11439 Text type-marker: display this as normal plain text (for type-markers:
11440 .Sx "The mime.types files" ) .
11441 Identical to only giving plain
11444 .Cd copiousoutput .
11447 \*(OP HTML type-marker: display via built-in HTML-to-text filter.
11449 .Cd copiousoutput .
11452 To avoid ambiguities with normal shell command content another
11453 question mark can be used to forcefully terminate interpretation of
11454 remaining characters.
11455 (Any character not in this list will have the same effect.)
11459 Some information about the MIME part to be displayed is embedded into
11460 the environment of the shell command:
11463 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
11465 .It Ev MAILX_CONTENT
11466 The MIME content-type of the part, if known, the empty string otherwise.
11469 .It Ev MAILX_CONTENT_EVIDENCE
11471 .Va mime-counter-evidence
11472 includes the carry-around-bit (2), then this will be set to the detected
11473 MIME content-type; not only then identical to
11474 .Ev \&\&MAILX_CONTENT
11478 .It Ev MAILX_EXTERNAL_BODY_URL
11480 .Ql message/external-body access-type=url
11481 will store the access URL in this variable, it is empty otherwise.
11482 URL targets should not be activated automatically, without supervision.
11485 .It Ev MAILX_FILENAME
11486 The filename, if any is set, the empty string otherwise.
11489 .It Ev MAILX_FILENAME_GENERATED
11493 .It Ev MAILX_FILENAME_TEMPORARY
11494 If temporary file creation has been requested through the command prefix
11495 this variable will be set and contain the absolute pathname of the
11501 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
11502 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
11503 Supported are the default
11510 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
11515 for TLS secured connections which pass a client certificate via
11516 .Va tls-config-pairs .
11517 There may be the \*(OPal method \*(IN
11520 does not need any user credentials,
11526 the remains also require a
11529 solely builds upon the credentials passed via a client certificate,
11530 and is usually the way to go since tested servers do not actually follow
11531 RFC 4422, and fail if additional credentials are actually passed.
11536 method will \*(OPally be replaced with APOP if possible (see there).
11538 .Mx Va pop3-bulk-load
11539 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
11540 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
11541 the messages, and only requests the message bodies on user request.
11542 For the POP3 protocol this means that the message headers will be
11544 If this variable is set then \*(UA will download only complete messages
11545 from the given POP3 server(s) instead.
11547 .Mx Va pop3-keepalive
11548 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
11549 \*(OP POP3 servers close the connection after a period of inactivity;
11550 the standard requires this to be at least 10 minutes,
11551 but practical experience may vary.
11552 Setting this variable to a numeric value greater than
11556 command to be sent each value seconds if no other operation is performed.
11558 .Mx Va pop3-no-apop
11559 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
11560 \*(BO\*(OP Unless this variable is set the MD5 based
11562 authentication method will be used instead of a chosen
11565 when connecting to a POP3 server that advertises support.
11568 is that only a single packet is sent for the user/password tuple.
11569 (Originally also that the password is not sent in clear text over the
11570 wire, but for one MD5 does not any longer offer sufficient security,
11571 and then today transport is almost ever TLS secured.)
11573 .Va pop3-no-apop-HOST
11576 .Mx Va pop3-use-starttls
11577 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
11578 \*(BO\*(OP Causes \*(UA to issue a
11580 command to make an unencrypted POP3 session TLS encrypted.
11581 This functionality is not supported by all servers,
11582 and is not used if the session is already encrypted by the POP3S method.
11584 .Va pop3-use-starttls-HOST
11590 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
11591 where that deviates from standardized behaviour.
11592 It is automatically squared with the environment variable
11593 .Ev POSIXLY_CORRECT ,
11594 changing the one will adjust the other.
11595 The following behaviour is covered and enforced by this mechanism:
11598 .Bl -bullet -compact
11600 In non-interactive mode, any error encountered while loading resource
11601 files during program startup will cause a program exit, whereas in
11602 interactive mode such errors will stop loading of the currently loaded
11603 (stack of) file(s, i.e., recursively).
11604 These exits can be circumvented on a per-command base by using
11607 .Sx "Command modifiers" ,
11608 for each command which shall be allowed to fail.
11612 will replace the list of alternate addresses instead of appending to it.
11613 In addition alternates will only be honoured for any sort of message
11618 The variable inserting
11619 .Sx "COMMAND ESCAPES"
11625 will expand embedded character sequences
11627 horizontal tabulator and
11630 \*(ID For compatibility reasons this step will always be performed.
11633 Reading in messages via
11635 .Pf ( Sx "COMMAND ESCAPES" )
11644 Upon changing the active
11648 will be displayed even if
11655 implies the behaviour described by
11661 is extended to cover any empty mailbox, not only empty
11663 .Sx "primary system mailbox" Ns
11664 es: they will be removed when they are left in empty state otherwise.
11667 Each command has an exit
11671 status that overwrites that of the last command.
11672 In POSIX mode the program exit status will signal failure regardless
11673 unless all messages were successfully sent out to the
11681 .It Va print-alternatives
11682 \*(BO When a MIME message part of type
11683 .Ql multipart/alternative
11684 is displayed and it contains a subpart of type
11686 other parts are normally discarded.
11687 Setting this variable causes all subparts to be displayed,
11688 just as if the surrounding part was of type
11689 .Ql multipart/mixed .
11693 The string used as a prompt in interactive mode.
11694 Whenever the variable is evaluated the value is treated as if specified
11695 within dollar-single-quotes (see
11696 .Sx "Shell-style argument quoting" ) .
11697 This (post-assignment, i.e., second) expansion can be used to embed
11698 status information, for example
11703 .Va mailbox-display .
11705 In order to embed characters which should not be counted when
11706 calculating the visual width of the resulting string, enclose the
11707 characters of interest in a pair of reverse solidus escaped brackets:
11709 a slot for coloured prompts is also available with the \*(OPal command
11711 Prompting may be prevented by setting this to the null string
11713 .Ql set noprompt ) .
11717 This string is used for secondary prompts, but is otherwise identical to
11724 \*(BO Suppresses the printing of the version when first invoked.
11728 If set messages processed by variants of
11732 will start with the original message, lines of which prefixed by
11734 taking into account
11738 No headers will be quoted when set without value or for
11745 selection will be included in the quote,
11747 embeds the (body) contents of all MIME parts, and
11749 also includes all headers.
11750 The quoted message will be enclosed by the expansions of
11751 .Va quote-inject-head
11753 .Va quote-inject-tail .
11756 .Va quote-as-attachment
11760 .Sx "COMMAND ESCAPES" .
11763 .It Va quote-add-cc
11764 \*(BO Whether senders of messages quoted via
11766 shall be made members of the carbon copies
11771 .It Va quote-as-attachment
11772 \*(BO Add the original message in its entirety as a
11774 MIME attachment when replying to a message.
11775 Note this works regardless of the setting of
11780 Can be set to a string consisting of non-whitespace ASCII characters
11781 which shall be treated as quotation leaders, the default being
11786 \*(OP Can be set in addition to
11788 and creates a more fancy quotation in that leading quotation characters
11789 .Pf ( Va quote-chars )
11790 are compressed and overlong lines are folded.
11792 can be set to either one, two or three (space separated) numeric values,
11793 which are interpreted as the maximum (goal) and the minimum line length,
11794 respectively, in a spirit rather equal to the
11796 program, but line- instead of paragraph-based.
11797 The third value is used as the maximum line length instead of the first
11798 if no better break point can be found; it is ignored unless it is larger
11799 than the minimum and smaller than the maximum.
11800 If not set explicitly the minimum will reflect the goal algorithmically.
11801 The goal cannot be smaller than the length of
11803 plus some additional pad; necessary adjustments take place silently.
11808 .It Va quote-inject-head , quote-inject-tail
11809 The strings to put before and after the text of a
11811 d message, if non-empty, and respectively.
11812 The former defaults to
11813 .Ql %f wrote:\en\en .
11814 Special format directives will be expanded if possible, and if so
11815 configured the output will be folded according to
11817 Format specifiers in the given strings start with a percent sign
11819 and expand values of the original message, unless noted otherwise.
11820 Note that names and addresses are not subject to the setting of
11822 Valid format specifiers are:
11825 .Bl -tag -compact -width ".It Ql _%%_"
11827 A plain percent sign.
11829 The address(es) of the sender(s).
11831 The date found in the
11833 header of the message when
11835 is set (the default), otherwise the date when the message was received.
11836 Formatting can be controlled by assigning a
11841 .Va datefield-markout-older ) .
11843 The full name(s) (name and address, as given) of the sender(s).
11848 The real name(s) of the sender(s) if there is one and
11850 allows usage, the address(es) otherwise.
11852 The senders real name(s) if there is one, the address(es) otherwise.
11857 .It Va r-option-implicit
11858 \*(BO Setting this option evaluates the contents of
11860 (or, if that contains multiple addresses,
11862 and passes the results onto the used (file-based) MTA as described for the
11864 option (empty argument case).
11867 .It Va recipients-in-cc
11874 as well as addressees which possibly came in via
11877 .Ql Mail-Followup-To:
11878 are by default merged into the new
11880 If this variable is set a sensitive algorithm tries to place in
11882 only the sender of the message being replied to, others are placed in
11887 Unless this variable is defined, no copies of outgoing mail will be saved.
11888 If defined it gives the pathname, subject to the usual
11889 .Sx "Filename transformations" ,
11890 of a folder where all new, replied-to or forwarded messages are saved:
11891 when saving to this folder fails the message is not sent, but instead
11895 The standard defines that relative (fully expanded) paths are to be
11896 interpreted relative to the current directory
11898 to force interpretation relative to
11901 needs to be set in addition.
11904 .It Va record-files
11905 \*(BO If this variable is set the meaning of
11907 will be extended to cover messages which target only file and pipe
11910 These address types will not appear in recipient lists unless
11911 .Va add-file-recipients
11915 .It Va record-resent
11916 \*(BO If this variable is set the meaning of
11918 will be extended to also cover the
11925 .It Va reply-in-same-charset
11926 \*(BO If this variable is set \*(UA first tries to use the same
11927 character set of the original message for replies.
11928 If this fails, the mechanism described in
11929 .Sx "Character sets"
11930 is evaluated as usual.
11933 .It Va reply-strings
11934 Can be set to a comma-separated list of (case-insensitive according to
11935 ASCII rules) strings which shall be recognized in addition to the
11936 built-in strings as
11938 reply message indicators \(en built-in are
11940 which is mandated by RFC 5322, as well as the german
11945 which often has been seen in the wild;
11946 I.e., the separating colon has to be specified explicitly.
11950 A list of addresses to put into the
11952 field of the message header.
11953 Members of this list are handled as if they were in the
11962 .It Va reply-to-honour
11965 header is honoured when replying to a message via
11972 if set without a value it defaults to
11976 .It Va reply-to-swap-in
11977 Standards like DKIM and (in conjunction with) DMARC caused many
11978 .Sx "Mailing lists"
11979 to use sender address rewriting in the style of
11980 .Ql Name via List <list@address> ,
11981 where the original sender address often being placed in
11983 If this is set and a
11985 exists, and consists of only one addressee (!), then that is used in
11986 place of the pretended sender.
11987 This works independently from
11988 .Va reply-to-honour .
11989 The optional value, a comma-separated list of strings, offers more
11990 fine-grained control on when swapping shall be used; for now supported is
11992 here swapping occurs if the sender is a mailing-list as defined by
11996 .It Va rfc822-body-from_
11997 \*(BO This variable can be used to force displaying a so-called
11999 line for messages that are embedded into an envelope mail via the
12001 MIME mechanism, for more visual convenience, also see
12006 \*(BO Enable saving of (partial) messages in
12008 upon interrupt or delivery error.
12012 The number of lines that represents a
12021 line display and scrolling via
12023 If this variable is not set \*(UA falls back to a calculation based upon
12024 the detected terminal window size and the baud rate: the faster the
12025 terminal, the more will be shown.
12026 Overall screen dimensions and pager usage is influenced by the
12027 environment variables
12035 .It Va searchheaders
12036 \*(BO Expand message list specifiers in the form
12038 to all messages containing the substring
12040 in the header field
12042 The string search is case insensitive.
12045 .It Va sendcharsets
12046 \*(OP A comma-separated list of character set names that can be used in
12047 outgoing internet mail.
12048 The value of the variable
12050 is automatically appended to this list of character sets.
12051 If no character set conversion capabilities are compiled into \*(UA then
12052 the only supported charset is
12055 .Va sendcharsets-else-ttycharset
12056 and refer to the section
12057 .Sx "Character sets"
12058 for the complete picture of character set conversion in \*(UA.
12061 .It Va sendcharsets-else-ttycharset
12062 \*(BO\*(OP If this variable is set, but
12064 is not, then \*(UA acts as if
12066 had been set to the value of the variable
12068 In effect this combination passes through the message data in the
12069 character set of the current locale encoding:
12070 therefore mail message text will be (assumed to be) in ISO-8859-1
12071 encoding when send from within a ISO-8859-1 locale, and in UTF-8
12072 encoding when send from within an UTF-8 locale.
12076 never comes into play as
12078 is implicitly assumed to be 8-bit and capable to represent all files the
12079 user may specify (as is the case when no character set conversion
12080 support is available in \*(UA and the only supported character set is
12083 .Sx "Character sets" ) .
12084 This might be a problem for scripts which use the suggested
12086 setting, since in this case the character set is US-ASCII by definition,
12087 so that it is better to also override
12089 then; and/or do something like the following in the resource file:
12090 .Bd -literal -offset indent
12091 # Avoid ASCII "propagates to 8-bit" when scripting
12092 \eif ! t && "$LC_ALL" != C && "$LC_CTYPE" != C
12093 \eset sendcharsets-else-ttycharset
12099 An address that is put into the
12101 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
12102 responsible for the actual transmission of the message.
12103 This field should normally not be used unless the
12105 field contains more than one address, on which case it is required.
12106 \*(ID Please expect automatic management of the
12111 Dependent on the context this address is handled as if it were in
12116 .Va r-option-implicit .
12119 \*(OB Predecessor of
12122 .It Va sendmail-arguments
12123 \*(OB Predecessor of
12124 .Va mta-arguments .
12126 .It Va sendmail-no-default-arguments
12127 \*(OB\*(BO Predecessor of
12128 .Va mta-no-default-arguments .
12130 .It Va sendmail-progname
12131 \*(OB Predecessor of
12136 Sending messages to the chosen
12138 or to command-pipe receivers (see
12139 .Sx "On sending mail, and non-interactive mode" )
12140 will be performed asynchronously.
12141 This means that only startup errors of the respective program will be
12142 recognizable, but no delivery errors.
12143 Also, no guarantees can be made as to when the respective program will
12144 actually run, as well as to when they will have produced output.
12146 If this variable is set then child program exit is waited for, and its
12147 exit status code is used to decide about success.
12148 Remarks: in conflict with the POSIX standard this variable is built-in
12149 to be initially set.
12150 Another difference is that it can have a value, which is interpreted as
12151 a comma-separated list of case-insensitive strings naming specific
12152 subsystems for which synchronousness shall be ensured (only).
12153 Possible values are
12159 for command-pipe receivers.
12163 \*(BO This setting causes \*(UA to start at the last message
12164 instead of the first one when opening a mail folder, as well as with
12171 \*(BO Causes \*(UA to use the sender's real name instead of the plain
12172 address in the header field summary and in message specifications.
12176 \*(BO Causes the recipient of the message to be shown in the header
12177 summary if the message was sent by the user.
12184 .Sx "COMMAND ESCAPES" .
12186 .Va message-inject-tail ,
12187 .Va on-compose-leave
12189 .Va on-compose-splice .
12196 .Sx "COMMAND ESCAPES" .
12198 .Va message-inject-tail ,
12199 .Va on-compose-leave
12201 .Va on-compose-splice .
12206 .Va on-compose-splice
12208 .Va on-compose-splice-shell
12210 .Va on-compose-leave
12212 .Va message-inject-tail
12216 .It Va skipemptybody
12217 \*(BO If an outgoing message has an empty first or only message part, do
12218 not send, but discard it, successfully (also see the command line option
12223 .It Va smime-ca-dir , smime-ca-file
12224 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
12225 Enhanced Mail) for the purpose of verification of S/MIME signed messages.
12227 documents the necessary preparation steps to use the former.
12228 The set of CA certificates which are built into the TLS library can
12229 be explicitly turned off by setting
12230 .Va smime-ca-no-defaults ,
12231 and further fine-tuning is possible via
12232 .Va smime-ca-flags .
12235 .It Va smime-ca-flags
12236 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
12237 storage, and the certificate verification that is used.
12238 The actual values and their meanings are documented for
12242 .It Va smime-ca-no-defaults
12243 \*(BO\*(OP Do not load the default CA locations that are built into the
12244 used to TLS library to verify S/MIME signed messages.
12246 .Mx Va smime-cipher
12247 .It Va smime-cipher-USER@HOST , smime-cipher
12248 \*(OP Specifies the cipher to use when generating S/MIME encrypted
12249 messages (for the specified account).
12250 RFC 5751 mandates a default of
12253 Possible values are (case-insensitive and) in decreasing cipher strength:
12261 (DES EDE3 CBC, 168 bits; default if
12263 is not available) and
12265 (DES CBC, 56 bits).
12267 The actually available cipher algorithms depend on the cryptographic
12268 library that \*(UA uses.
12269 \*(OP Support for more cipher algorithms may be available through
12270 dynamic loading via
12271 .Xr EVP_get_cipherbyname 3
12272 (OpenSSL) if \*(UA has been compiled to support this.
12275 .It Va smime-crl-dir
12276 \*(OP Specifies a directory that contains files with CRLs in PEM format
12277 to use when verifying S/MIME messages.
12280 .It Va smime-crl-file
12281 \*(OP Specifies a file that contains a CRL in PEM format to use when
12282 verifying S/MIME messages.
12285 .It Va smime-encrypt-USER@HOST
12286 \*(OP If this variable is set, messages send to the given receiver are
12287 encrypted before sending.
12288 The value of the variable must be set to the name of a file that
12289 contains a certificate in PEM format.
12291 If a message is sent to multiple recipients,
12292 each of them for whom a corresponding variable is set will receive an
12293 individually encrypted message;
12294 other recipients will continue to receive the message in plain text
12296 .Va smime-force-encryption
12298 It is recommended to sign encrypted messages, i.e., to also set the
12301 .Va content-description-smime-message
12302 will be inspected for messages which become encrypted.
12305 .It Va smime-force-encryption
12306 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
12310 \*(BO\*(OP S/MIME sign outgoing messages with the user's
12312 private key and include the users certificate as a MIME attachment.
12313 Signing a message enables a recipient to verify that the sender used
12314 a valid certificate,
12315 that the email addresses in the certificate match those in the message
12316 header and that the message content has not been altered.
12317 It does not change the message text,
12318 and people will be able to read the message as usual.
12319 .Va content-description-smime-signature
12322 .Va smime-sign-cert , smime-sign-include-certs
12324 .Va smime-sign-digest .
12326 .Mx Va smime-sign-cert
12327 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
12328 \*(OP Points to a file in PEM format.
12329 For the purpose of signing and decryption this file needs to contain the
12330 user's private key, followed by his certificate.
12332 For message signing
12334 is always derived from the value of
12336 (or, if that contains multiple addresses,
12338 For the purpose of encryption the recipients public encryption key
12339 (certificate) is expected; the command
12341 can be used to save certificates of signed messages (the section
12342 .Sx "Signed and encrypted messages with S/MIME"
12343 gives some details).
12344 This mode of operation is usually driven by the specialized form.
12346 When decrypting messages the account is derived from the recipient
12351 of the message, which are searched for addresses for which such
12353 \*(UA always uses the first address that matches,
12354 so if the same message is sent to more than one of the user addresses
12355 using different encryption keys, decryption might fail.
12357 Password-encrypted keys may be used for signing and decryption.
12358 Automated password lookup is possible via the
12360 .Ql USER@HOST.smime-cert-key
12361 for the private key, and
12362 .Ql USER@HOST.smime-cert-cert
12363 for the certificate stored in the same file.
12364 For example, the hypothetical address
12366 could be driven with a private key / certificate pair path defined in
12367 .Va \&\&smime-sign-cert-bob@exam.ple ,
12368 and the needed passwords would then be looked up as
12369 .Ql bob@exam.ple.smime-cert-key
12371 .Ql bob@exam.ple.smime-cert-cert .
12372 When decrypting the value of
12374 will be tried as a fallback to provide the necessary
12376 To include intermediate certificates, use
12377 .Va smime-sign-include-certs .
12378 The possible password sources are documented in
12379 .Sx "On URL syntax and credential lookup" .
12381 .Mx Va smime-sign-digest
12382 .It Va smime-sign-digest-USER@HOST , smime-sign-digest
12383 \*(OP Specifies the message digest to use when signing S/MIME messages.
12384 Please remember that for this use case
12386 refers to the variable
12388 (or, if that contains multiple addresses,
12390 The available algorithms depend on the used cryptographic library, but
12391 at least one usable built-in algorithm is ensured as a default.
12392 If possible the standard RFC 5751 will be violated by using
12394 instead of the mandated
12396 due to security concerns.
12397 This variable is ignored for very old (released before 2010)
12398 cryptographic libraries which do not offer the necessary interface:
12399 it will be logged if that happened.
12401 \*(UA will try to add built-in support for the following message
12402 digests, names are case-insensitive:
12409 as well as the widely available
12414 and the proposed insecure
12418 More digests may \*(OPally be available through dynamic loading via the
12420 .Xr EVP_get_digestbyname 3 .
12422 .Mx Va smime-sign-include-certs
12423 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
12424 \*(OP If used, this is supposed to a consist of a comma-separated list
12425 of files, each of which containing a single certificate in PEM format to
12426 be included in the S/MIME message in addition to the
12427 .Va smime-sign-cert
12429 This can be used to include intermediate certificates of the certificate
12430 authority, in order to allow the receiver's S/MIME implementation to
12431 perform a verification of the entire certificate chain, starting from
12432 a local root certificate, over the intermediate certificates, down to the
12433 .Va smime-sign-cert .
12434 Even though top level certificates may also be included in the chain,
12435 they will not be used for the verification on the receiver's side.
12437 For the purpose of the mechanisms involved here,
12439 refers to the content of the internal variable
12441 (or, if that contains multiple addresses,
12444 .Ql USER@HOST.smime-include-certs
12445 will be used for performing password lookups for these certificates,
12446 shall they have been given one, therefore the lookup can be automated
12447 via the mechanisms described in
12448 .Sx "On URL syntax and credential lookup" .
12450 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
12451 \*(OB\*(OP Predecessor(s) of
12452 .Va smime-sign-digest .
12455 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
12457 \*(ID For compatibility reasons a set
12459 is used in preference of
12463 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
12464 \*(OP Variable chain that controls the SMTP
12466 authentication method, possible values are
12477 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" )
12482 for TLS secured connections which pass a client certificate via
12483 .Va tls-config-pairs .
12484 There may be the \*(OPal methods
12491 do not need any user credentials,
12495 require a user name, and all other methods require a
12500 solely builds upon the credentials passed via a client certificate,
12501 and is usually the way to go since tested servers do not actually follow
12502 RFC 4422 aka RFC 4954, and fail if additional credentials are passed.
12509 .Va smtp-auth-password
12511 .Va smtp-auth-user .
12513 .Va smtp-auth-USER@HOST :
12514 may override dependent on sender address in the variable
12517 .It Va smtp-auth-password
12518 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
12519 If the authentication method requires a password, but neither
12520 .Va smtp-auth-password
12522 .Va smtp-auth-password-USER@HOST
12524 \*(UA will ask for a password on the user's terminal.
12526 .It Va smtp-auth-password-USER@HOST
12528 .Va smtp-auth-password
12529 for specific values of sender addresses, dependent upon the variable
12532 .It Va smtp-auth-user
12533 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
12534 If the authentication method requires a user name, but neither
12537 .Va smtp-auth-user-USER@HOST
12539 \*(UA will ask for a user name on the user's terminal.
12541 .It Va smtp-auth-user-USER@HOST
12544 for specific values of sender addresses, dependent upon the variable
12548 .It Va smtp-hostname
12549 \*(OP\*(IN Normally \*(UA uses the variable
12551 to derive the necessary
12553 information in order to issue a
12560 can be used to use the
12562 from the SMTP account
12570 if the empty string is given, or the local hostname as a last resort).
12571 This often allows using an address that is itself valid but hosted by
12572 a provider other than from which (in
12574 the message is sent.
12575 Setting this variable also influences generated
12580 If the \*(OPal IDNA support is available (see
12582 variable assignment is aborted when a necessary conversion fails.
12584 .Mx Va smtp-use-starttls
12585 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
12586 \*(BO\*(OP Causes \*(UA to issue a
12588 command to make an SMTP
12590 session TLS encrypted, i.e., to enable transport layer security.
12593 .It Va socket-connect-timeout
12594 \*(OP A positive number that defines the timeout to wait for
12595 establishing a socket connection before forcing
12596 .Va ^ERR Ns -TIMEDOUT .
12599 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
12600 \*(OP If set to the URL of a SOCKS5 server then all network activities
12601 are proxied through it, except for the single DNS name lookup necessary
12602 to resolve the proxy URL (unnecessary when given an already resolved IP
12604 It is automatically squared with the environment variable
12606 changing the one will adjust the other.
12607 This example creates a local SOCKS5 proxy on port 10000 that forwards to
12612 and from which actual network traffic happens:
12613 .Bd -literal -offset indent
12614 $ ssh -D 10000 USER@HOST
12615 $ \*(uA -Ssocks-proxy=[socks5://]localhost:10000
12616 # or =localhost:10000; no local DNS: =127.0.0.1:10000
12620 .It Va spam-interface
12621 \*(OP In order to use any of the spam-related commands (like
12623 the desired spam interface must be defined by setting this variable.
12624 Please refer to the manual section
12625 .Sx "Handling spam"
12626 for the complete picture of spam handling in \*(UA.
12627 All or none of the following interfaces may be available:
12629 .Bl -tag -width ".It Ql _ilte_"
12635 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
12637 Different to the generic filter interface \*(UA will automatically add
12638 the correct arguments for a given command and has the necessary
12639 knowledge to parse the program's output.
12640 A default value for
12642 will have been compiled into the \*(UA binary if
12646 during compilation.
12647 Shall it be necessary to define a specific connection type (rather than
12648 using a configuration file for that), the variable
12649 .Va spamc-arguments
12650 can be used as in for example
12651 .Ql -d server.example.com -p 783 .
12652 It is also possible to specify a per-user configuration via
12654 Note that this interface does not inspect the
12656 flag of a message for the command
12660 generic spam filter support via freely configurable hooks.
12661 This interface is meant for programs like
12663 and requires according behaviour in respect to the hooks' exit
12664 status for at least the command
12667 meaning a message is spam,
12671 for unsure and any other return value indicating a hard error);
12672 since the hooks can include shell code snippets diverting behaviour
12673 can be intercepted as necessary.
12675 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
12678 .Va spamfilter-spam ;
12680 .Sx "Handling spam"
12681 contains examples for some programs.
12682 The process environment of the hooks will have the variable
12683 .Ev MAILX_FILENAME_GENERATED
12685 Note that spam score support for
12687 is not supported unless the \*(OPtional regular expression support is
12689 .Va spamfilter-rate-scanscore
12695 .It Va spam-maxsize
12696 \*(OP Messages that exceed this size will not be passed through to the
12698 .Va spam-interface .
12699 If unset or 0, the default of 420000 bytes is used.
12702 .It Va spamc-command
12703 \*(OP The path to the
12707 .Va spam-interface .
12708 Note that the path is not expanded, but used
12710 A fallback path will have been compiled into the \*(UA binary if the
12711 executable had been found during compilation.
12714 .It Va spamc-arguments
12715 \*(OP Even though \*(UA deals with most arguments for the
12718 automatically, it may at least sometimes be desirable to specify
12719 connection-related ones via this variable, for example
12720 .Ql -d server.example.com -p 783 .
12724 \*(OP Specify a username for per-user configuration files for the
12726 .Va spam-interface .
12727 If this is set to the empty string then \*(UA will use the name of the
12736 .It Va spamfilter-ham , spamfilter-noham , \
12737 spamfilter-nospam , spamfilter-rate , spamfilter-spam
12738 \*(OP Command and argument hooks for the
12740 .Va spam-interface .
12742 .Sx "Handling spam"
12743 contains examples for some programs.
12746 .It Va spamfilter-rate-scanscore
12747 \*(OP Because of the generic nature of the
12750 spam scores are not supported for it by default, but if the \*(OPnal
12751 regular expression support is available then setting this variable can
12752 be used to overcome this restriction.
12753 It is interpreted as follows: first a number (digits) is parsed that
12754 must be followed by a semicolon
12756 and an extended regular expression.
12757 Then the latter is used to parse the first output line of the
12758 .Va spamfilter-rate
12759 hook, and, in case the evaluation is successful, the group that has been
12760 specified via the number is interpreted as a floating point scan score.
12762 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
12763 ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
12764 \*(OB\*(OP Predecessors of
12768 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
12769 \*(OB\*(OP Predecessor of
12772 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
12774 \*(OB\*(BO\*(OP Predecessor of
12775 .Va tls-ca-no-defaults .
12777 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
12778 \*(OB\*(OP Please use the
12781 .Va tls-config-pairs .
12783 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
12784 \*(OB\*(OP Please use the
12787 .Va tls-config-pairs .
12789 .It Va ssl-config-file
12790 \*(OB\*(OP Predecessor of
12791 .Va tls-config-file .
12793 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
12795 \*(OB\*(OP Predecessor of
12796 .Va tls-config-module .
12798 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
12799 \*(OB\*(OP Predecessor of
12800 .Va tls-config-pairs .
12802 .It Va ssl-crl-dir , ssl-crl-file
12803 \*(OB\*(OP Predecessors of
12807 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
12808 \*(OB\*(OP Please use the
12811 .Va tls-config-pairs .
12813 .It Va ssl-features
12814 \*(OB\*(OP\*(RO Predecessor of
12817 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
12818 \*(OB\*(OP Please use the
12821 .Va tls-config-pairs .
12823 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
12824 \*(OB\*(OP Please use the
12827 .Va tls-config-pairs .
12829 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
12830 \*(OB\*(OP Please use the
12833 .Va tls-config-pairs .
12835 .It Va ssl-rand-file
12836 \*(OB\*(OP Predecessor of
12837 .Va tls-rand-file .
12839 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
12840 \*(OB\*(OP Predecessor of
12845 If only set without an assigned value, then this setting inhibits the
12851 header fields that include obvious references to \*(UA.
12852 There are two pitfalls associated with this:
12853 First, the message id of outgoing messages is not known anymore.
12854 Second, an expert may still use the remaining information in the header
12855 to track down the originating mail user agent.
12856 If set to the value
12862 suppression does not occur.
12865 .It Va system-mailrc
12866 \*(RO The compiled in path of the system wide initialization file
12868 .Sx "Resource files" :
12874 (\*(OP) This specifies a comma-separated list of
12879 .Sx "On terminal control and line editor" ,
12880 escape commas with reverse solidus
12882 to be used to overwrite or define entries.
12884 this variable will only be queried once at program startup and can
12885 thus only be specified in resource files or on the command line.
12886 It will always be inspected, regardless of whether
12888 denotes termcap/terminfo library support via
12892 String capabilities form
12894 pairs and are expected unless noted otherwise.
12895 Numerics have to be notated as
12897 where the number is expected in normal decimal notation.
12898 Finally, booleans do not have any value but indicate a true or false
12899 state simply by being defined or not; this indeed means that \*(UA
12900 does not support undefining an existing boolean.
12901 String capability values will undergo some expansions before use:
12902 for one notations like
12905 .Ql control-LETTER ,
12906 and for clarification purposes
12908 can be used to specify
12910 (the control notation
12912 could lead to misreadings when a left bracket follows, which it does for
12913 the standard CSI sequence);
12914 finally three letter octal sequences, as in
12917 To specify that a terminal supports 256-colours, and to define sequences
12918 that home the cursor and produce an audible bell, one might write:
12920 .Bd -literal -offset indent
12921 ? set termcap='Co#256,home=\eE[H,bel=^G'
12925 The following terminal capabilities are or may be meaningful for the
12926 operation of the built-in line editor or \*(UA in general:
12929 .Bl -tag -compact -width ".It Cd yay"
12931 .Cd auto_right_margin :
12932 boolean which indicates if the right margin needs special treatment; the
12934 capability is related, for more see
12936 This capability is only used when backed by library support.
12938 .It Cd clear Ns \0or Cd cl
12940 clear the screen and home cursor.
12941 (Will be simulated via
12947 .It Cd colors Ns \0or Cd Co
12949 numeric capability specifying the maximum number of colours.
12950 Note that \*(UA does not actually care about the terminal beside that,
12951 but always emits ANSI / ISO 6429 escape sequences; also see
12955 .Cd carriage_return :
12956 move to the first column in the current row.
12957 The default built-in fallback is
12960 .It Cd cub1 Ns \0or Cd le
12962 move the cursor left one space (non-destructively).
12963 The default built-in fallback is
12966 .It Cd cuf1 Ns \0or Cd nd
12968 move the cursor right one space (non-destructively).
12969 The default built-in fallback is
12971 which is used by most terminals.
12977 .It Cd ed Ns \0or Cd cd
12982 .It Cd el Ns \0or Cd ce
12984 clear to the end of line.
12985 (Will be simulated via
12987 plus repetitions of space characters.)
12989 .It Cd home Ns \0or Cd ho
12993 .It Cd hpa Ns \0or Cd ch
12994 .Cd column_address :
12995 move the cursor (to the given column parameter) in the current row.
12996 (Will be simulated via
13001 .\" mx_HAVE_TERMCAP
13002 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
13005 .Cd enter_ca_mode ,
13006 respectively: exit and enter the alternative screen ca-mode,
13007 effectively turning \*(UA into a fullscreen application.
13008 This must be enabled explicitly by setting
13009 .Va termcap-ca-mode .
13011 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
13015 respectively: enable and disable the keypad.
13016 This is always enabled if available, because it seems even keyboards
13017 without keypads generate other key codes for, e.g., cursor keys in that
13018 case, and only if enabled we see the codes that we are interested in.
13020 .It Cd xenl Ns \0or Cd xn
13021 .Cd eat_newline_glitch :
13022 boolean which indicates whether a newline written in the last column of an
13023 .Cd auto_right_margin
13024 indicating terminal is ignored.
13025 With it the full terminal width is available even on autowrap terminals.
13026 This will be inspected even without
13032 Many more capabilities which describe key-sequences are documented for
13037 .It Va termcap-ca-mode
13038 \*(OP Allow usage of the
13043 abilities in order to enter an alternative exclusive screen, the
13044 so-called ca-mode; this usually requires special configuration of the
13046 also dependent on the value of
13049 this variable will only be queried once at program startup and can
13050 thus only be specified in resource files or on the command line.
13053 .It Va termcap-disable
13054 \*(OP Disable any interaction with a terminal control library.
13055 If set only some generic fallback built-ins and possibly the content of
13057 describe the terminal to \*(UA.
13059 this variable will only be queried once at program startup and can
13060 thus only be specified in resource files or on the command line.
13064 .It Va tls-ca-dir-USER@HOST , tls-ca-dir-HOST , tls-ca-dir ,\
13065 tls-ca-file-USER@HOST , tls-ca-file-HOST , tls-ca-file
13066 \*(OP Directory and file, respectively, for pools of trusted CA
13067 certificates in PEM (Privacy Enhanced Mail) format, for the purpose of
13068 verification of TLS server certificates.
13069 Concurrent use is possible, the file is loaded once needed first, the
13070 directory lookup is performed anew as a last resort whenever necessary.
13071 The CA certificate pool built into the TLS library can be disabled via
13072 .Va tls-ca-no-defaults ,
13073 further fine-tuning is possible via
13075 The directory search requires special filename conventions, please see
13076 .Xr SSL_CTX_load_verify_locations 3
13083 .Mx Va tls-ca-flags
13084 .It Va tls-ca-flags-USER@HOST , tls-ca-flags-HOST , tls-ca-flags
13085 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
13086 storage, and the certificate verification that is used (also see
13088 The value is expected to consist of a comma-separated list of
13089 configuration directives, with any intervening whitespace being ignored.
13090 The directives directly map to flags that can be passed to
13091 .Xr X509_STORE_set_flags 3 ,
13092 which are usually defined in a file
13093 .Pa openssl/x509_vfy.h ,
13094 and the availability of which depends on the used TLS library
13095 version: a directive without mapping is ignored (error log subject to
13097 Directives currently understood (case-insensitively) include:
13100 .Bl -tag -compact -width ".It Cd BaNg"
13101 .It Cd no-alt-chains
13102 If the initial chain is not trusted, do not attempt to build an
13104 Setting this flag will make OpenSSL certificate verification match that
13105 of older OpenSSL versions, before automatic building and checking of
13106 alternative chains has been implemented; also see
13107 .Cd trusted-first .
13108 .It Cd no-check-time
13109 Do not check certificate/CRL validity against current time.
13110 .It Cd partial-chain
13111 By default partial, incomplete chains which cannot be verified up to the
13112 chain top, a self-signed root certificate, will not verify.
13113 With this flag set, a chain succeeds to verify if at least one signing
13114 certificate of the chain is in any of the configured trusted stores of
13116 The OpenSSL manual page
13117 .Xr SSL_CTX_load_verify_locations 3
13118 gives some advise how to manage your own trusted store of CA certificates.
13120 Disable workarounds for broken certificates.
13121 .It Cd trusted-first
13122 Try building a chain using issuers in the trusted store first to avoid
13123 problems with server-sent legacy intermediate certificates.
13124 Newer versions of OpenSSL support alternative chain checking and enable
13125 it by default, resulting in the same behaviour; also see
13126 .Cd no-alt-chains .
13130 .Mx Va tls-ca-no-defaults
13131 .It Va tls-ca-no-defaults-USER@HOST , tls-ca-no-defaults-HOST ,\
13133 \*(BO\*(OP Do not load the default CA locations that are built into the
13134 used to TLS library to verify TLS server certificates.
13137 .It Va tls-config-file
13138 \*(OP If this variable is set
13139 .Xr CONF_modules_load_file 3
13141 .Ql ,+modules-load-file,
13144 is used to allow resource file based configuration of the TLS library.
13145 This happens once the library is used first, which may also be early
13146 during startup (logged with
13148 If a non-empty value is given then the given file, after performing
13149 .Sx "Filename transformations" ,
13150 will be used instead of the TLS libraries global default, and it is an
13151 error if the file cannot be loaded.
13152 The application name will always be passed as
13154 Some TLS libraries support application-specific configuration via
13155 resource files loaded like this, please see
13156 .Va tls-config-module .
13158 .Mx Va tls-config-module
13159 .It Va tls-config-module-USER@HOST , tls-config-module-HOST ,\
13161 \*(OP If file based application-specific configuration via
13162 .Va tls-config-file
13163 is available, announced as
13167 indicating availability of
13168 .Xr SSL_CTX_config 3 ,
13169 then, it becomes possible to use a central TLS configuration file
13170 for all programs, including \*(uA, for example
13171 .Bd -literal -offset indent
13172 # Register a configuration section for \*(uA
13173 \*(uA = mailx_master
13174 # The top configuration section creates a relation
13175 # in between dynamic SSL configuration and an actual
13176 # program specific configuration section
13178 ssl_conf = mailx_tls_config
13179 # And that program specific configuration section now
13180 # can map diverse tls-config-module names to sections,
13181 # as in: tls-config-module=account_xy
13183 account_xy = mailx_account_xy
13184 account_yz = mailx_account_yz
13186 MinProtocol = TLSv1.2
13189 CipherString = TLSv1.2:!aNULL:!eNULL:
13190 MinProtocol = TLSv1.1
13195 .Mx Va tls-config-pairs
13196 .It Va tls-config-pairs-USER@HOST , tls-config-pairs-HOST , tls-config-pairs
13197 \*(OP The value of this variable chain will be interpreted as
13198 a comma-separated list of directive/value pairs.
13199 Directives and values need to be separated by equals signs
13201 any whitespace surrounding pair members is removed.
13202 Keys are (usually) case-insensitive.
13203 Different to when placing these pairs in a
13204 .Va tls-config-module
13206 .Va tls-config-file ,
13209 need to be escaped with a reverse solidus
13211 when included in pairs; also different: if the equals sign
13213 is preceded with an asterisk
13215 .Sx "Filename transformations"
13216 will be performed on the value; it is an error if these fail.
13217 Unless proper support is announced by
13219 .Pf ( Ql ,+conf-ctx, )
13220 only the keys below are supported, otherwise the pairs will be used
13221 directly as arguments to the function
13222 .Xr SSL_CONF_cmd 3 .
13225 .Bl -tag -compact -width ".It Cd C_rtificate_"
13227 Filename of a TLS client certificate (chain) required by some servers.
13228 Fallback support via
13229 .Xr SSL_CTX_use_certificate_chain_file 3 .
13230 .Sx "Filename transformations"
13233 will be set to the same value if not initialized explicitly.
13234 Some services support so-called
13236 authentication if a TLS client certificate was successfully presented
13237 during connection establishment
13238 .Pf ( Dq connecting is authenticating ) .
13240 .It Cd CipherString
13241 A list of ciphers for TLS connections, see
13243 By default no list of ciphers is set, resulting in a
13244 .Cd Protocol Ns - Ns
13245 specific list of ciphers (the protocol standards define lists of
13246 acceptable ciphers; possibly cramped by the used TLS library).
13247 Fallback support via
13248 .Xr SSL_CTX_set_cipher_list 3 .
13250 .It Cd Ciphersuites
13251 A list of ciphers used for TLSv1.3 connections, see
13253 These will be joined onto the list of ciphers from
13258 .Ql ,+ctx-set-ciphersuites, ,
13260 .Xr SSL_CTX_set_ciphersuites 3 .
13263 A list of supported elliptic curves, if applicable.
13264 By default no curves are set.
13265 Fallback support via
13266 .Xr SSL_CTX_set1_curves_list 3 ,
13269 .It Cd MaxProtocol , MinProtocol
13270 The maximum and minimum supported TLS versions, respectively.
13274 .Ql ,+ctx-set-maxmin-proto, ,
13276 .Xr SSL_CTX_set_max_proto_version 3
13278 .Xr SSL_CTX_set_min_proto_version 3 ;
13279 these fallbacks use an internal parser which understands the strings
13285 and the special value
13287 which disables the given limit.
13290 Various flags to set.
13292 .Xr SSL_CTX_set_options 3 ,
13293 in which case any other value but (exactly)
13295 results in an error.
13298 Filename of the private key in PEM format of a TLS client certificate.
13299 If unset, the value of
13302 .Sx "Filename transformations"
13305 .Xr SSL_CTX_use_PrivateKey_file 3 .
13308 The used TLS protocol.
13314 .Ql ctx-set-maxmin-proto
13321 .Xr SSL_CTX_set_options 3 ,
13322 driven via an internal parser which understands the strings
13328 and the special value
13330 Multiple protocols may be given as a comma-separated list, any
13331 whitespace is ignored, an optional plus sign
13333 prefix enables, a hyphen-minus
13335 prefix disables a protocol, so that
13337 enables only the TLSv1.2 protocol.
13343 .It Va tls-crl-dir , tls-crl-file
13344 \*(OP Specify a directory / a file, respectively, that contains a CRL in
13345 PEM format to use when verifying TLS server certificates.
13348 .It Va tls-features
13349 \*(OP\*(RO This expands to a comma-separated list of the TLS library
13350 identity and optional features.
13351 To ease substring matching the string starts and ends with a comma.
13352 Currently supported identities are
13356 (OpenSSL v3.0.0 series),
13358 (OpenSSL v1.1.x series)
13361 (elder OpenSSL series, other clones).
13362 Optional features are preceded with a plus sign
13364 when available, and with a hyphen-minus
13368 Currently known features are
13370 .Pf ( Va tls-config-pairs ) ,
13372 .Pf ( Va tls-config-module ) ,
13373 .Ql ctx-set-ciphersuites
13374 .Pf ( Cd Ciphersuites
13376 .Va tls-config-pairs ) ,
13377 .Ql ctx-set-maxmin-proto
13378 .Pf ( Va tls-config-pairs ) ,
13379 .Ql modules-load-file
13380 .Pf ( Va tls-config-file ) ,
13383 .Pf ( Va tls-rand-file ) .
13385 .Mx Va tls-fingerprint
13386 .It Va tls-fingerprint-USER@HOST , tls-fingerprint-HOST , tls-fingerprint
13387 \*(OP It is possible to replace the verification of the connection
13388 peer certificate against the entire local pool of CAs (for more see
13389 .Sx "Encrypted network communication" )
13390 with the comparison against a precalculated certificate message digest,
13391 the so-called fingerprint, to be specified as the used
13392 .Va tls-fingerprint-digest .
13393 This fingerprint can for example be calculated with
13394 .Ql Ic tls Ns \:\0\:fingerprint HOST .
13396 .Mx Va tls-fingerprint-digest
13397 .It Va tls-fingerprint-digest-USER@HOST , tls-fingerprint-digest-HOST , \
13398 tls-fingerprint-digest
13399 \*(OP The message digest to be used when creating TLS certificate
13400 fingerprints, the defaults, if available, in test order, being
13403 For the complete list of digest algorithms refer to
13404 .Va smime-sign-digest .
13407 .It Va tls-rand-file
13411 .Ql ,+tls-rand-file,
13412 then this will be queried to find a file with random entropy data which
13413 can be used to seed the P(seudo)R(andom)N(umber)G(enerator), see
13414 .Xr RAND_load_file 3 .
13415 The default filename
13416 .Pf ( Xr RAND_file_name 3 ,
13419 will be used if this variable is not set or empty, or if the
13420 .Sx "Filename transformations"
13422 Shall seeding the PRNG have been successful,
13423 .Xr RAND_write_file 3
13424 will be called to update the entropy.
13425 Remarks: libraries which do not announce this feature seed the PRNG by
13429 .It Va tls-verify-USER@HOST , tls-verify-HOST , tls-verify
13430 \*(OP Variable chain that sets the action to be performed if an error
13431 occurs during TLS server certificate validation against the
13432 specified or default trust stores
13435 or the TLS library built-in defaults (unless usage disallowed via
13436 .Va tls-ca-no-defaults ) ,
13437 and as fine-tuned via
13439 Valid (case-insensitive) values are
13441 (fail and close connection immediately),
13443 (ask whether to continue on standard input),
13445 (show a warning and continue),
13447 (do not perform validation).
13452 If defined, gives the number of lines of a message to be displayed
13455 if unset, the first five lines are printed, if set to 0 the variable
13458 If the value is negative then its absolute value will be used for
13459 unsigned right shifting (see
13467 \*(BO If set then the
13469 command series will strip adjacent empty lines and quotations.
13473 The character set of the terminal \*(UA operates on,
13474 and the one and only supported character set that \*(UA can use if no
13475 character set conversion capabilities have been compiled into it,
13476 in which case it defaults to ISO-8859-1.
13477 Otherwise it defaults to UTF-8.
13478 Sufficient locale support provided the default will be preferably
13479 deduced from the locale environment if that is set (for example
13481 see there for more); runtime locale changes will be reflected by
13483 except during the program startup phase and if
13485 had been used to freeze the given value.
13486 Refer to the section
13487 .Sx "Character sets"
13488 for the complete picture about character sets.
13491 .It Va typescript-mode
13492 \*(BO A special multiplex variable that disables all variables and
13493 settings which result in behaviour that interferes with running \*(UA in
13496 .Va colour-disable ,
13497 .Va line-editor-disable
13498 and (before startup completed only)
13499 .Va termcap-disable .
13500 Unsetting it does not restore the former state of the covered settings.
13504 For a safe-by-default policy the process file mode creation mask
13508 on program startup after the resource files have been loaded,
13509 and unless this variable is set.
13510 By assigning this an empty value the active setting will not be changed,
13511 otherwise the given value will be made the new file mode creation mask.
13512 Child processes inherit the file mode creation mask of their parent.
13515 .It Va user-HOST , user
13516 \*(IN Variable chain that sets a global fallback user name, used in case
13517 none has been given in the protocol and account-specific URL.
13518 This variable defaults to the name of the user who runs \*(UA.
13522 Enable upward compatibility with \*(UA version 15.0 in respect to which
13523 configuration options are available and how they are handled.
13524 If set to a non-empty value the command modifier
13526 is implied and thus enforces
13527 .Sx "Shell-style argument quoting"
13529 .Sx "Old-style argument quoting"
13530 for all commands which support both.
13531 This manual uses \*(IN and \*(OU to refer to the new and the old way of
13532 doing things, respectively.
13536 Verbose mode enables logging of informational context messages.
13537 Historically a \*(BO variable, this can either be set multiple times
13538 (what the command line option
13540 uses), or be assigned a numeric value in order to increase verbosity.
13541 Assigning the value 0 disables verbosity and thus (almost) equals
13543 The maximum number is 3.
13553 .It Va version , version-date , \
13554 version-hexnum , version-major , version-minor , version-update
13555 \*(RO \*(UA version information: the first variable is a string with
13556 the complete version identification, the second the release date in ISO
13557 8601 notation without time.
13558 The third is a 32-bit hexadecimal number with the upper 8 bits storing
13559 the major, followed by the minor and update version numbers which occupy
13561 The latter three variables contain only decimal digits: the major, minor
13562 and update version numbers.
13563 The output of the command
13565 will include this information.
13568 .It Va writebackedited
13569 If this variable is set messages modified using the
13573 commands are written back to the current folder when it is quit;
13574 it is only honoured for writable folders in MBOX format, though.
13575 Note that the editor will be pointed to the raw message content in that
13576 case, i.e., neither MIME decoding nor decryption will have been
13577 performed, and proper
13580 quoting of newly added or edited content is also left as an exercise
13583 .\" }}} (Variables)
13585 .\" }}} (INTERNAL VARIABLES)
13588 .\" .Sh ENVIRONMENT {{{
13592 .Dq environment variable
13593 should be considered an indication that these variables are either
13594 standardized as vivid parts of process environments, or that they are
13595 commonly found in there.
13596 The process environment is inherited from the
13598 once \*(UA is started, and unless otherwise explicitly noted handling of
13599 the following variables transparently integrates into that of the
13600 .Sx "INTERNAL VARIABLES"
13601 from \*(UA's point of view.
13602 This means they can be managed via
13606 causing automatic program environment updates (to be inherited by
13607 newly created child processes).
13610 In order to integrate other environment variables equally they need to
13611 be imported (linked) with the command
13613 This command can also be used to set and unset non-integrated
13614 environment variables from scratch, sufficient system support provided.
13615 The following example, applicable to a POSIX shell, sets the
13617 environment variable for \*(UA only, and beforehand exports the
13619 in order to affect any further processing in the running shell:
13621 .Bd -literal -offset indent
13622 $ EDITOR="vim -u ${HOME}/.vimrc"
13624 $ COLUMNS=80 \*(uA -R
13627 .Bl -tag -width ".It Ev BaNg"
13630 The user's preferred width in column positions for the terminal screen.
13631 Queried and used once on program startup in interactive or batch
13633 mode, actively managed for child processes and the MLE (see
13634 .Sx "On terminal control and line editor" )
13635 in interactive mode thereafter.
13636 Non-interactive mode always uses, and the fallback default is
13637 a compile-time constant, by default 80 columns.
13642 are both set but not both are usable (empty, not a number, or 0) at
13643 program startup, then the real terminal screen size will be (tried to
13644 be) determined once.
13647 manages these variables, and unsets them for pipe specifications etc.)
13651 The name of the (mailbox)
13653 to use for saving aborted messages if
13655 is set; this defaults to
13659 is set no output will be generated, otherwise the contents of the file
13662 .Sx "Filename transformations"
13669 Pathname of the text editor to use for the
13673 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13675 is used for a more display oriented editor.
13679 The user's home directory.
13680 This variable is only used when it resides in the process environment.
13681 The calling user's home directory will be used instead if this directory
13682 does not exist, is not accessible or cannot be read;
13683 it will always be used for the root user.
13684 (No test for being writable is performed to allow usage by
13685 non-privileged users within read-only jails, but dependent on settings
13686 this directory is a default write target for, for example,
13694 .It Ev LC_ALL , LC_CTYPE , LANG
13695 \*(OP The (names in lookup order of the)
13699 which indicates the used
13700 .Sx "Character sets" .
13701 Runtime changes trigger automatic updates of the entire locale system,
13702 which includes updating
13704 (except during startup if the variable has been frozen via
13709 The user's preferred number of lines for the terminal screen.
13710 The behaviour is as described for
13712 yet the compile-time constant used in non-interactive mode and as
13713 a fallback defaults to 24 (lines).
13717 Pathname of the directory lister to use in the
13719 command when operating on local mailboxes.
13722 (path search through
13727 Upon startup \*(UA will actively ensure that this variable refers to the
13728 name of the user who runs \*(UA, in order to be able to pass a verified
13729 name to any newly created child process.
13733 Is used as the user's
13735 .Sx "primary system mailbox"
13739 If the environmental fallback is also not set, a built-in compile-time
13741 This is assumed to be an absolute pathname.
13745 \*(OP Override the default path search of
13746 .Sx "The Mailcap files" :
13747 any existing file therein will be loaded in sequence, appending any
13748 content to the list of MIME type handler directives.
13749 The RFC 1524 standard imposed default value is assigned otherwise:
13750 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
13751 (The default value is a compile-time \*(OP.)
13755 Is used as a startup file instead of
13758 In order to avoid side-effects from configuration files scripts should
13759 either set this variable to
13763 command line option should be used.
13766 .It Ev MAILX_NO_SYSTEM_RC
13767 If this variable is set then reading of
13770 .Va system-mailrc )
13771 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
13772 had been started up with the option
13774 (and according argument) or
13776 This variable is only used when it resides in the process environment.
13780 The name of the user's
13782 .Sx "secondary mailbox"
13784 A logical subset of the special
13785 .Sx "Filename transformations"
13791 Traditionally this MBOX is used as the file to save messages from the
13793 .Sx "primary system mailbox"
13794 that have been read.
13796 .Sx "Message states" .
13800 \*(IN\*(OP This variable overrides the default location of the user's
13806 Pathname of the program to use for backing the command
13810 variable enforces usage of a pager for output.
13811 The default paginator is
13813 (path search through
13816 \*(UA inspects the contents of this variable: if its contains the string
13818 then a non-existing environment variable
13820 will be set to (the portable)
13825 will optionally be set to
13832 A colon-separated list of directories that is searched by the shell when
13833 looking for commands, for example
13834 .Ql /bin:/usr/bin:/usr/local/bin .
13837 .It Ev POSIXLY_CORRECT
13838 This environment entry is automatically squared with
13843 The shell to use for the commands
13848 .Sx "COMMAND ESCAPES"
13849 and when starting subprocesses.
13850 A default shell is used if this environment variable is not defined.
13853 .It Ev SOCKS5_PROXY
13854 This environment entry is automatically squared with
13858 .It Ev SOURCE_DATE_EPOCH
13859 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
13860 used in place of the current time.
13861 This variable is looked up upon program startup, and its existence will
13862 switch \*(UA to a reproducible mode
13863 .Pf ( Lk https://reproducible-builds.org )
13864 which uses deterministic random numbers, a special fixated pseudo
13867 This operation mode is used for development and by software packagers.
13868 \*(ID Currently an invalid setting is only ignored, rather than causing
13869 a program abortion.
13871 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
13875 \*(OP The terminal type for which output is to be prepared.
13876 For extended colour and font control please refer to
13877 .Sx "Coloured display" ,
13878 and for terminal management in general to
13879 .Sx "On terminal control and line editor" .
13883 Except for the root user this variable defines the directory for
13884 temporary files to be used instead of
13886 (or the given compile-time constant) if set, existent, accessible as
13887 well as read- and writable.
13888 This variable is only used when it resides in the process environment,
13889 but \*(UA will ensure at startup that this environment variable is
13890 updated to contain a usable temporary directory.
13896 (see there), but this variable is not standardized, should therefore not
13897 be used, and is only corrected if already set.
13901 Pathname of the text editor to use for the
13905 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13907 is used for a less display oriented editor.
13917 .Bl -tag -width ".It Pa BaNg"
13920 .It Pa ~/.mailcap , /etc/mailcap
13921 \*(OP Personal and system-wide MIME type handler definition files, see
13922 .Sx "The Mailcap files" .
13923 (The shown names are part of the RFC 1524 standard search path
13926 .It Pa \*(ur , \*(UR
13927 User-specific and system-wide files giving initial commands, the
13928 .Sx "Resource files" .
13929 (The used filenames come from
13932 .Va system-mailrc ,
13937 The default value for
13942 .It Pa \*(vU , \*(vS
13943 Personal and system-wide MIME types, see
13944 .Sx "The mime.types files" .
13948 \*(IN\*(OP The default location of the user's
13950 file \(en the section
13951 .Sx "The .netrc file"
13952 documents the file format.
13953 The used path can be set via
13963 \*(OP Possible location for persistent random entropy seed storage, see
13964 .Va tls-rand-file .
13968 .\" .Ss "Resource files" {{{
13969 .Ss "Resource files"
13971 Upon startup \*(UA reads in several resource files, in order:
13973 .Bl -tag -width ".It Pa BaNg"
13976 System wide initialization file
13977 .Pf ( Va system-mailrc ) .
13978 Reading of this file can be suppressed, either by using the
13980 (and according argument) or
13982 command line options, or by setting the
13985 .Ev MAILX_NO_SYSTEM_RC .
13989 File giving initial commands.
13990 A different file can be chosen by setting the
13994 Reading of this file can be suppressed with the
13996 command line option.
13998 .It Va mailx-extra-rc
13999 Defines a startup file to be read after all other resource files.
14000 It can be used to specify settings that are not understood by other
14002 implementations, for example.
14006 The content of these files is interpreted as follows:
14009 .Bl -bullet -compact
14011 The whitespace characters space, tabulator and newline,
14012 as well as those defined by the variable
14014 are removed from the beginning and end of input lines.
14016 Empty lines are ignored.
14018 Any other line is interpreted as a command.
14019 It may be spread over multiple input lines if the newline character is
14021 by placing a reverse solidus character
14023 as the last character of the line; whereas any leading whitespace of
14024 follow lines is ignored, trailing whitespace before a escaped newline
14025 remains in the input.
14027 If the line (content) starts with the number sign
14029 then it is a comment-command and also ignored.
14030 (The comment-command is a real command, which does nothing, and
14031 therefore the usual follow lines mechanism applies!)
14035 Errors while loading these files are subject to the settings of
14039 More files with syntactically equal content can be
14041 The following, saved in a file, would be an examplary content:
14043 .Bd -literal -offset indent
14044 # This line is a comment command. And y\e
14045 es, it is really continued here.
14052 .\" .Ss "The mime.types files" {{{
14053 .Ss "The mime.types files"
14056 .Sx "HTML mail and MIME attachments"
14057 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
14058 media types in order to classify message and attachment content.
14059 One source for them are
14061 files, the loading of which can be controlled by setting the variable
14062 .Va mimetypes-load-control .
14063 Another is the command
14065 which also offers access to \*(UAs MIME type cache.
14067 files have the following syntax:
14069 .Bd -literal -offset indent
14070 type/subtype extension [extension ...]
14071 # For example text/html html htm
14077 define the MIME media type, as standardized in RFC 2046:
14079 is used to declare the general type of data, while the
14081 specifies a specific format for that type of data.
14082 One or multiple filename
14084 s, separated by whitespace, can be bound to the media type format.
14085 Comments may be introduced anywhere on a line with a number sign
14087 causing the remaining line to be discarded.
14089 \*(UA also supports an extended, non-portable syntax in especially
14090 crafted files, which can be loaded via the alternative value syntax of
14091 .Va mimetypes-load-control ,
14092 and prepends an optional
14096 .Dl [type-marker ]type/subtype extension [extension ...]
14099 The following type markers are supported:
14102 .Bl -tag -compact -width ".It Ar _n_u"
14104 Treat message parts with this content as plain text.
14109 Treat message parts with this content as HTML tagsoup.
14110 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
14111 the content as plain text instead.
14115 but instead of falling back to plain text require an explicit content
14116 handler to be defined.
14118 If no handler can be found a text message is displayed which says so.
14119 This can be annoying, for example signatures serve a contextual purpose,
14120 their content is of no use by itself.
14121 This marker will avoid displaying the text message.
14126 for sending messages:
14128 .Va mime-allow-text-controls ,
14129 .Va mimetypes-load-control .
14130 For reading etc. messages:
14131 .Sx "HTML mail and MIME attachments" ,
14132 .Sx "The Mailcap files" ,
14134 .Va mime-counter-evidence ,
14135 .Va mimetypes-load-control ,
14136 .Va pipe-TYPE/SUBTYPE ,
14137 .Va pipe-EXTENSION .
14140 .\" .Ss "The Mailcap files" {{{ review
14141 .Ss "The Mailcap files"
14143 \*(OP RFC 1524 defines a
14144 .Dq User Agent Configuration Mechanism
14145 to be used to inform mail user agent programs about the locally
14146 installed facilities for handling various data formats, i.e., about
14147 commands and how they can be used to display, edit et cetera MIME part
14148 contents, as well as a default path search that includes multiple
14149 possible locations of resource files, and the
14151 environment variable to overwrite that.
14152 Handlers found from doing the path search will be cached, the command
14154 operates on that cache, and the variable
14155 .Va mailcap-disable
14156 will suppress automatic loading, and usage of any mailcap handlers.
14157 .Sx "HTML mail and MIME attachments"
14158 gives a general overview of how MIME types are handled.
14162 files consist of a set of newline separated entries.
14163 Comment lines start with a number sign
14165 (in the first column!) and are ignored.
14166 Empty lines are ignored.
14167 All other lines are interpreted as mailcap entries.
14168 An entry definition may be split over multiple lines by placing the
14169 reverse solidus character
14171 last in all but the final line.
14172 The standard does not specify how leading whitespace of successive lines
14173 is to be treated, therefore they are retained.
14177 entries consist of a number of semicolon
14180 The first two fields are mandatory and must occur in the specified
14181 order, the remaining fields are optional and may appear in any order.
14182 Leading and trailing whitespace of field content is ignored (removed).
14183 The reverse solidus
14185 character can be used to escape any following character including
14186 semicolon and itself in the content of the second field, and in value
14187 parts of any optional key/value field.
14190 The first field defines the MIME
14192 the entry is about to handle (case-insensitively).
14193 If the subtype is specified as an asterisk
14195 the entry is meant to match all subtypes of the named type, e.g.,
14197 would match any audio type.
14198 The second field is the
14200 shell command used to display MIME parts of the given type.
14203 Data consuming shell commands will be fed message (MIME part) data on
14204 standard input unless one or more instances of the (unquoted) string
14206 are used: these formats will be replaced with a temporary file(name)
14207 that has been prefilled with the parts data.
14208 Data producing shell commands are expected to generata data on their
14209 standard output unless that format is used.
14210 In all cases any given
14212 format is replaced with a properly shell quoted filename.
14213 When a command requests a temporary file via
14215 then that will be removed again, as if the
14216 .Cd x-mailx-tmpfile
14218 .Cd x-mailx-tmpfile-fill
14219 flags had been set; unless the command requests
14222 .Cd x-mailx-tmpfile-unlink
14223 flag is also implied; see below for more.
14226 Optional fields define single-word flags (case-insensitive), or key
14227 / value pairs consisting of a case-insensitive keyword, an equals sign
14229 and a shell command; whitespace surrounding the equals sign is removed.
14230 Optional fields include the following:
14233 .Bl -tag -width ".It Cd BaNg"
14235 A program that can be used to compose a new body or body part in the
14237 (Currently unused.)
14239 .It Cd composetyped
14242 field, but is to be used when the composing program needs to specify the
14244 header field to be applied to the composed data.
14245 (Currently unused.)
14248 .It Cd copiousoutput
14249 A flag field which indicates that the output of the
14251 command is integrable into \*(UAs normal visual display.
14252 It is mutually exclusive with
14253 .Cd needsterminal .
14256 A textual description that describes this type of data.
14257 The text may optionally be enclosed within double quotation marks
14261 A program that can be used to edit a body or body part in the given
14263 (Currently unused.)
14265 .It Cd nametemplate
14266 This field specifies a filename format for the
14268 format used in the shell command fields, in which
14270 will be replaced by a random string.
14271 (The filename is also stored in and passed to subprocesses via
14272 .Ev MAILX_FILENAME_TEMPORARY . )
14273 The standard says this is
14274 .Dq only expected to be relevant in environments \
14275 where filename extensions are meaningful ,
14276 and so this field is ignored unless the
14278 is a prefix, optionally followed by (ASCII) alphabetic and numeric
14279 characters, the underscore and the period.
14280 For example, to specify that a JPG file is to be passed to an image
14281 viewer with a name ending in
14283 .Ql nametemplate=%s.jpg
14287 .It Cd needsterminal
14288 This flag field indicates that the given shell command must be run on
14289 an interactive terminal.
14290 \*(UA will temporarily release the terminal to the given command in
14291 interactive mode, in non-interactive mode this entry will be entirely
14292 ignored; this flag implies
14293 .Cd x-mailx-noquote .
14296 A program that can be used to print a message or body part in the given
14298 (Currently unused.)
14301 Specifies a program to be run to test some condition, for example, the
14302 machine architecture, or the window system in use, to determine whether
14303 or not this mailcap entry applies.
14304 If the test fails, a subsequent mailcap entry should be sought; also see
14305 .Cd x-mailx-test-once .
14306 Standard I/O of the test program is redirected from and to
14310 is not supported (the data does not yet exist).
14312 .It Cd textualnewlines
14313 A flag field which indicates that this type of data is line-oriented and
14314 that, if encoded in
14316 all newlines should be converted to canonical form (CRLF) before
14317 encoding, and will be in that form after decoding.
14318 (Currently unused.)
14321 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
14322 icon to be used to visually denote the presence of this kind of data.
14323 This field is not used by \*(UA.
14326 .It Cd x-mailx-async
14327 Extension flag field that denotes that the given
14329 command shall be executed asynchronously, without blocking \*(UA.
14330 Cannot be used in conjunction with
14331 .Cd needsterminal ;
14332 the standard output of the command will go to
14336 .It Cd x-mailx-noquote
14337 An extension flag field that indicates that even a
14340 command shall not be used when
14342 ing messages, as it would by default.
14345 .It Cd x-mailx-test-once
14346 Extension flag which denotes whether the given
14348 command shall be evaluated once only with its exit status being cached.
14349 This is handy if some global unchanging condition is to be queried, like
14350 .Dq running under the X Window System .
14353 .It Cd x-mailx-tmpfile
14354 Extension flag field that requests creation of a zero-sized temporary
14355 file, the name of which is to be placed in the environment variable
14356 .Ev MAILX_FILENAME_TEMPORARY .
14357 It is an error to use this flag with commands that include a
14359 format (because that is implemented by means of this temporary file).
14362 .It Cd x-mailx-tmpfile-fill
14363 Normally the MIME part content is passed to the handler via standard
14364 input; if this flag is set then the data will instead be written into
14366 .Cd x-mailx-tmpfile .
14367 In order to cause deletion of the temporary file you will have to set
14368 .Cd x-mailx-tmpfile-unlink
14370 It is an error to use this flag with commands that include a
14375 .It Cd x-mailx-tmpfile-unlink
14376 Extension flag field that requests that the temporary file shall be
14377 deleted automatically when the command loop is entered again at latest.
14378 It is an error to use this flag with commands that include a
14380 format, or in conjunction with
14381 .Cd x-mailx-async .
14382 .Cd x-mailx-tmpfile
14386 .It Cd x-mailx-last-resort
14387 An extension flag that indicates that this handler shall only be used
14388 as a last resort, when no other source (see
14389 .Sx "HTML mail and MIME attachments" )
14390 provides a MIME handler.
14393 .It Cd x-mailx-ignore
14394 An extension that enforces that this handler is not used at all.
14399 The standard includes the possibility to define any number of additional
14400 fields, prefixed by
14402 Flag fields apply to the entire
14404 entry \(em in some unusual cases, this may not be desirable, but
14405 differentiation can be accomplished via separate entries, taking
14406 advantage of the fact that subsequent entries are searched if an earlier
14407 one does not provide enough information.
14410 command needs to specify the
14414 command shall not, the following will help out the latter:
14416 .Bd -literal -offset indent
14417 application/postscript; ps-to-terminal %s; needsterminal
14418 application/postscript; ps-to-terminal %s; compose=idraw %s
14422 In value parts of command fields any occurrence of the format string
14424 will be replaced by the
14427 Any named parameter from a messages'
14429 field may be embedded into the command line using the format
14431 followed by the parameter name and a closing brace
14434 The entire parameter should appear as a single command line argument,
14435 regardless of embedded spaces, shell quoting will be performed by the
14436 RFC 1524 processor, thus:
14438 .Bd -literal -offset indent
14440 Content-type: multipart/mixed; boundary=42
14443 multipart/*; /usr/local/bin/showmulti \e
14444 %t %{boundary} ; composetyped = /usr/local/bin/makemulti
14446 # Executed shell command
14447 /usr/local/bin/showmulti multipart/mixed 42
14451 Note that \*(UA does not support handlers for multipart MIME parts as
14452 shown in this example (as of today).
14453 It does not support the additional formats
14457 An example file, also showing how to properly deal with the expansion of
14459 which includes any quotes that are necessary to make it a valid shell
14460 argument by itself and thus will cause undesired behaviour when placed
14461 in additional user-provided quotes:
14463 .Bd -literal -offset indent
14465 text/richtext; richtext %s; copiousoutput
14467 text/x-perl; perl -cWT %s; nametemplate = %s.pl
14469 # Exit EX_TEMPFAIL=75 on signal
14470 application/pdf; \e
14472 trap "rm -f ${infile}" EXIT\e; \e
14473 trap "exit 75" INT QUIT TERM\e; \e
14474 mupdf "${infile}"; \e
14475 test = [ -n "${DISPLAY}" ]; \e
14476 nametemplate = %s.pdf; x-mailx-async
14477 application/pdf; pdftotext -layout - -; copiousoutput
14479 application/*; echo "This is \e\e"%t\e\e" but \e
14480 is 50 \e% Greek to me" \e; < %s head -c 512 | cat -vet; \e
14481 copiousoutput; x-mailx-noquote; x-mailx-last-resort
14486 .Sx "HTML mail and MIME attachments" ,
14487 .Sx "The mime.types files" ,
14490 .Va mime-counter-evidence ,
14491 .Va pipe-TYPE/SUBTYPE ,
14492 .Va pipe-EXTENSION .
14495 .\" .Ss "The .netrc file" {{{ review
14496 .Ss "The .netrc file"
14498 User credentials for machine accounts (see
14499 .Sx "On URL syntax and credential lookup" )
14500 can be placed in the
14502 file, which will be loaded and cached when requested by
14504 The default location
14506 may be overridden by the
14508 environment variable.
14509 As long as syntax constraints are honoured the file source may be
14510 replaced with the output of the shell command set in
14512 to load an encrypted file, for example.
14513 The cache can be managed with the command
14517 The file consists of space, tabulator or newline separated tokens.
14518 This parser implements a superset of the original BSD syntax, but users
14519 should nonetheless be aware of portability glitches, shall their
14521 be usable across multiple programs and platforms:
14524 .Bl -bullet -compact
14526 BSD only supports double quotation marks, for example
14527 .Ql password """pass with spaces""" .
14529 BSD (only?) supports escaping of single characters via a reverse solidus
14530 (a space could be escaped via
14532 in- as well as outside of a quoted string.
14533 This method is assumed to be present, and will actively be used to quote
14534 double quotation marks
14536 and reverse solidus
14538 characters inside the
14542 tokens, for example for display purposes.
14544 BSD does not require a final quotation mark of the last user input token.
14546 The original BSD (Berknet) parser also supported a format which allowed
14547 tokens to be separated with commas \(en whereas at least Hewlett-Packard
14548 still seems to support this syntax, this parser does not!
14550 As a non-portable extension some widely-used programs support
14551 shell-style comments: if an input line starts, after any amount of
14552 whitespace, with a number sign
14554 then the rest of the line is ignored.
14556 Whereas other programs may require that the
14558 file is accessible by only the user if it contains a
14560 token for any other
14564 this parser will always require these strict permissions.
14568 Of the following list of supported tokens this parser uses (and caches)
14575 entry will not be used.
14577 .Bl -tag -width ".It Cd BaNg"
14578 .It Cd machine Ar name
14579 The hostname of the entries' machine, lowercase-normalized before use.
14580 Any further file content, until either end-of-file or the occurrence
14585 first-class token is bound (only related) to the machine
14588 As an extension that should not be the cause of any worries this parser
14589 supports a single wildcard prefix for
14591 .Bd -literal -offset indent
14592 machine *.example.com login USER password PASS
14593 machine pop3.example.com login USER password PASS
14594 machine smtp.example.com login USER password PASS
14600 .Ql pop3.example.com ,
14604 .Ql local.smtp.example.com .
14605 In the example neither
14606 .Ql pop3.example.com
14608 .Ql smtp.example.com
14609 will be matched by the wildcard, since the exact matches take
14610 precedence (it is however faster to specify it the other way around).
14613 This is the same as
14615 except that it is a fallback entry that is used shall none of the
14616 specified machines match; only one default token may be specified,
14617 and it must be the last first-class token.
14619 .It Cd login Ar name
14620 The user name on the remote machine.
14622 .It Cd password Ar string
14623 The user's password on the remote machine.
14625 .It Cd account Ar string
14626 Supply an additional account password.
14627 This is merely for FTP purposes.
14629 .It Cd macdef Ar name
14631 A macro is defined with the specified
14633 it is formed from all lines beginning with the next line and continuing
14634 until a blank line is (consecutive newline characters are) encountered.
14637 entries cannot be utilized by multiple machines, too, but must be
14638 defined following the
14640 they are intended to be used with.)
14643 exists, it is automatically run as the last step of the login process.
14644 This is merely for FTP purposes.
14651 .\" .Sh EXAMPLES {{{
14654 .\" .Ss "An example configuration" {{{
14655 .Ss "An example configuration"
14657 .Bd -literal -offset indent
14658 # This example assumes v15.0 compatibility mode
14661 # Request strict TLL transport layer security checks
14662 set tls-verify=strict
14664 # Where are the up-to-date TLS certificates?
14665 # (Since we manage up-to-date ones explicitly, do not use any,
14666 # possibly outdated, default certificates shipped with OpenSSL)
14667 #set tls-ca-dir=/etc/ssl/certs
14668 set tls-ca-file=/etc/ssl/certs/ca-certificates.crt
14669 set tls-ca-no-defaults
14670 #set tls-ca-flags=partial-chain
14671 wysh set smime-ca-file="${tls-ca-file}" \e
14672 smime-ca-no-defaults #smime-ca-flags="${tls-ca-flags}"
14674 # This could be outsourced to a central configuration file via
14675 # tls-config-file plus tls-config-module if the used library allows.
14676 # CipherString: explicitly define the list of ciphers, which may
14677 # improve security, especially with protocols older than TLS v1.2.
14678 # See ciphers(1). Possibly best to only use tls-config-pairs-HOST
14679 # (or -USER@HOST), as necessary, again..
14680 # Note that TLSv1.3 uses Ciphersuites= instead, which will join
14681 # with CipherString (if protocols older than v1.3 are allowed)
14682 # Curves: especially with TLSv1.3 curves selection may be desired.
14683 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
14684 # Change this only when the remote server does not support it:
14685 # maybe use chain support via tls-config-pairs-HOST / -USER@HOST
14686 # to define such explicit exceptions, then, e.g.,
14687 # MinProtocol=TLSv1.1
14688 if "$tls-features" =% ,+ctx-set-maxmin-proto,
14689 wysh set tls-config-pairs='\e
14690 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14691 Curves=P-521:P-384:P-256,\e
14692 MinProtocol=TLSv1.1'
14694 wysh set tls-config-pairs='\e
14695 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14696 Curves=P-521:P-384:P-256,\e
14697 Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2\e, +TLSv1.3'
14700 # Essential setting: select allowed character sets
14701 set sendcharsets=utf-8,iso-8859-1
14703 # A very kind option: when replying to a message, first try to
14704 # use the same encoding that the original poster used herself!
14705 set reply-in-same-charset
14707 # When replying, do not merge From: and To: of the original message
14708 # into To:. Instead old From: -> new To:, old To: -> merge Cc:.
14709 set recipients-in-cc
14711 # When sending messages, wait until the Mail-Transfer-Agent finishs.
14712 # Only like this you will be able to see errors reported through the
14713 # exit status of the MTA (including the built-in SMTP one)!
14716 # Only use built-in MIME types, no mime.types(5) files
14717 set mimetypes-load-control
14719 # Default directory where we act in (relative to $HOME)
14721 # A leading "+" (often) means: under *folder*
14722 # *record* is used to save copies of sent messages
14723 set MBOX=+mbox.mbox DEAD=+dead.txt \e
14724 record=+sent.mbox record-files record-resent
14726 # Make "file mymbox" and "file myrec" go to..
14727 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
14729 # Not really optional, e.g., for S/MIME
14730 set from='Your Name <address@exam.ple>'
14732 # It may be necessary to set hostname and/or smtp-hostname
14733 # if the "SERVER" of mta and "domain" of from do not match.
14734 # The `urlencode' command can be used to encode USER and PASS
14735 set mta=(smtps?|submissions?)://[USER[:PASS]@]SERVER[:PORT] \e
14736 smtp-auth=login/plain... \e
14739 # Never refuse to start into interactive mode, and more
14741 colour-pager crt= \e
14742 followup-to followup-to-honour=ask-yes fullnames \e
14743 history-file=+.\*(uAhist history-size=-1 history-gabby \e
14744 mime-counter-evidence=0b1111 \e
14745 prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
14746 reply-to-honour=ask-yes \e
14749 # Only include the selected header fields when typing messages
14750 headerpick type retain from_ date from to cc subject \e
14751 message-id mail-followup-to reply-to
14752 # ...when forwarding messages
14753 headerpick forward retain subject date from to cc
14754 # ...when saving message, etc.
14755 #headerpick save ignore ^Original-.*$ ^X-.*$
14757 # Some mailing lists
14758 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
14759 mlsubscribe '^xfans@xfans\e.xyz$'
14761 # Handle a few file extensions (to store MBOX databases)
14762 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
14763 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
14764 zst 'zstd -dc' 'zstd -19 -zc' \e
14765 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
14767 # A real life example of a very huge free mail provider
14768 # Instead of directly placing content inside `account',
14769 # we `define' a macro: like that we can switch "accounts"
14770 # from within *on-compose-splice*, for example!
14772 set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
14773 set from='Your Name <address@examp.ple>'
14775 set pop3-no-apop-pop.gmXil.com
14776 shortcut pop %:pop3s://pop.gmXil.com
14777 shortcut imap %:imaps://imap.gmXil.com
14778 # Or, entirely IMAP based setup
14779 #set folder=imaps://imap.gmail.com record="+[Gmail]/Sent Mail" \e
14780 # imap-cache=~/spool/cache
14782 set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
14784 set mta=smtps://USER:PASS@smtp.gmail.com:465
14790 # Here is a pretty large one which does not allow sending mails
14791 # if there is a domain name mismatch on the SMTP protocol level,
14792 # which would bite us if the value of from does not match, e.g.,
14793 # for people who have a sXXXXeforge project and want to speak
14794 # with the mailing list under their project account (in from),
14795 # still sending the message through their normal mail provider
14797 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14798 set from='Your Name <address@exam.ple>'
14800 shortcut pop %:pop3s://pop.yaXXex.com
14801 shortcut imap %:imaps://imap.yaXXex.com
14803 set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
14804 hostname=yaXXex.com smtp-hostname=
14810 # Create some new commands so that, e.g., `ls /tmp' will..
14811 commandalias lls '!ls ${LS_COLOUR_FLAG} -aFlrS'
14812 commandalias llS '!ls ${LS_COLOUR_FLAG} -aFlS'
14814 set pipe-message/external-body='?* echo $MAILX_EXTERNAL_BODY_URL'
14816 # We do not support gpg(1) directly yet. But simple --clearsign'd
14817 # message parts can be dealt with as follows:
14820 wysh set pipe-text/plain=$'?*#++=?\e
14821 < "${MAILX_FILENAME_TEMPORARY}" awk \e
14822 -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
14824 /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
14827 print "--- GPG --verify ---";\e
14828 system("gpg --verify " TMPFILE " 2>&1");\e
14829 print "--- GPG --verify ---";\e
14833 /^-----BEGIN PGP SIGNATURE-----/,\e
14834 /^-----END PGP SIGNATURE-----/{\e
14841 commandalias V '\e'call V
14845 When storing passwords in
14847 appropriate permissions should be set on this file with
14848 .Ql $ chmod 0600 \*(ur .
14851 is available user credentials can be stored in the central
14853 file instead; e.g., here is a different version of the example account
14854 that sets up SMTP and POP3:
14856 .Bd -literal -offset indent
14858 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14859 set from='Your Name <address@exam.ple>'
14861 # Load an encrypted ~/.netrc by uncommenting the next line
14862 #set netrc-pipe='gpg -qd ~/.netrc.pgp'
14864 set mta=smtps://smtp.yXXXXx.ru:465 \e
14865 smtp-hostname= hostname=yXXXXx.com
14866 set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
14867 commandalias xp fi pop3s://pop.yXXXXx.ru
14879 .Bd -literal -offset indent
14880 machine *.yXXXXx.ru login USER password PASS
14884 This configuration should now work just fine:
14887 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
14890 .\" .Ss "S/MIME step by step" {{{
14891 .Ss "S/MIME step by step"
14893 \*(OP The first thing that is needed for
14894 .Sx "Signed and encrypted messages with S/MIME"
14895 is a personal certificate, and a private key.
14896 The certificate contains public information, in particular a name and
14897 email address(es), and the public key that can be used by others to
14898 encrypt messages for the certificate holder (the owner of the private
14901 signed messages generated with that certificate('s private key).
14902 Whereas the certificate is included in each signed message, the private
14903 key must be kept secret.
14904 It is used to decrypt messages that were previously encrypted with the
14905 public key, and to sign messages.
14908 For personal use it is recommended to get a S/MIME certificate from
14909 one of the major CAs on the Internet.
14910 Many CAs offer such certificates for free.
14911 Usually offered is a combined certificate and private key in PKCS#12
14912 format which \*(UA does not accept directly.
14913 To convert it to PEM format, the following shell command can be used;
14914 please read on for how to use these PEM files.
14916 .Bd -literal -offset indent
14917 $ openssl pkcs12 -in cert.p12 -out certpem.pem -clcerts -nodes
14919 $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
14920 $ openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
14925 .Lk https://www.CAcert.org
14926 which issues client and server certificates to members of their
14927 community for free; their root certificate
14928 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
14929 is often not in the default set of trusted CA root certificates, though,
14930 which means their root certificate has to be downloaded separately,
14931 and needs to be part of the S/MIME certificate validation chain by
14934 or as a vivid member of the
14935 .Va smime-ca-file .
14936 But let us take a step-by-step tour on how to setup S/MIME with
14937 a certificate from CAcert.org despite this situation!
14940 First of all you will have to become a member of the CAcert.org
14941 community, simply by registrating yourself via the web interface.
14942 Once you are, create and verify all email addresses you want to be able
14943 to create signed and encrypted messages for/with using the corresponding
14944 entries of the web interface.
14945 Now ready to create S/MIME certificates, so let us create a new
14946 .Dq client certificate ,
14947 ensure to include all email addresses that should be covered by the
14948 certificate in the following web form, and also to use your name as the
14952 Create a private key and a certificate request on your local computer
14953 (please see the manual pages of the used commands for more in-depth
14954 knowledge on what the used arguments etc. do):
14957 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
14960 Afterwards copy-and-paste the content of
14962 into the certificate-request (CSR) field of the web form on the
14963 CAcert.org website (you may need to unfold some
14964 .Dq advanced options
14965 to see the corresponding text field).
14966 This last step will ensure that your private key (which never left your
14967 box) and the certificate belong together (through the public key that
14968 will find its way into the certificate via the certificate-request).
14969 You are now ready and can create your CAcert certified certificate.
14970 Download and store or copy-and-paste it as
14975 In order to use your new S/MIME setup a combined private key/public key
14976 (certificate) file has to be created:
14979 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
14982 This is the file \*(UA will work with.
14983 If you have created your private key with a passphrase then \*(UA will
14984 ask you for it whenever a message is signed or decrypted, unless this
14985 operation has been automated as described in
14986 .Sx "Signed and encrypted messages with S/MIME" .
14987 Set the following variables to henceforth use S/MIME (setting
14989 is of interest for verification only):
14991 .Bd -literal -offset indent
14992 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
14993 smime-sign-cert=ME@HERE.com.paired \e
14994 smime-sign-digest=SHA512 \e
14995 smime-sign from=myname@my.host
15000 .\" .Ss "Using CRLs with S/MIME or TLS" {{{
15001 .Ss "Using CRLs with S/MIME or TLS"
15003 \*(OP Certification authorities (CAs) issue certificate revocation
15004 lists (CRLs) on a regular basis.
15005 These lists contain the serial numbers of certificates that have been
15006 declared invalid after they have been issued.
15007 Such usually happens because the private key for the certificate has
15009 because the owner of the certificate has left the organization that is
15010 mentioned in the certificate, etc.
15011 To seriously use S/MIME or TLS verification,
15012 an up-to-date CRL is required for each trusted CA.
15013 There is otherwise no method to distinguish between valid and
15014 invalidated certificates.
15015 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
15016 the Internet, so they have to be retrieved by some external mechanism.
15019 \*(UA accepts CRLs in PEM format only;
15020 CRLs in DER format must be converted, like, e.\|g.:
15023 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
15026 To tell \*(UA about the CRLs, a directory that contains all CRL files
15027 (and no other files) must be created.
15032 variables, respectively, must then be set to point to that directory.
15033 After that, \*(UA requires a CRL to be present for each CA that is used
15034 to verify a certificate.
15043 In general it is a good idea to turn on
15049 twice) if something does not work well.
15050 Very often a diagnostic message can be produced that leads to the
15051 problems' solution.
15053 .\" .Ss "\*(UA shortly hangs on startup" {{{
15054 .Ss "\*(UA shortly hangs on startup"
15056 This can have two reasons, one is the necessity to wait for a file lock
15057 and cannot be helped, the other being that \*(UA calls the function
15059 in order to query the nodename of the box (sometimes the real one is
15060 needed instead of the one represented by the internal variable
15062 One may have varying success by ensuring that the real hostname and
15066 or, more generally, that the name service is properly setup \(en
15069 return the expected value?
15070 Does this local hostname have a domain suffix?
15071 RFC 6762 standardized the link-local top-level domain
15073 try again after adding an (additional) entry with this extension.
15076 .\" .Ss "I cannot login to Google mail (via OAuth)" {{{
15077 .Ss "I cannot login to Google mail \&(via OAuth\&)"
15079 Since 2014 some free service providers classify programs as
15081 unless they use a special authentication method (OAuth 2.0) which
15082 was not standardized for non-HTTP protocol authentication token query
15083 until August 2015 (RFC 7628).
15086 Different to Kerberos / GSSAPI, which is developed since the mid of the
15087 1980s, where a user can easily create a local authentication ticket for
15088 her- and himself with the locally installed
15090 program, that protocol has no such local part but instead requires
15091 a world-wide-web query to create or fetch a token; since there is no
15092 local cache this query would have to be performed whenever \*(UA is
15093 invoked (in interactive sessions situation may differ).
15096 \*(UA does not directly support OAuth.
15097 It, however, supports XOAUTH2 / OAUTHBEARER, see
15098 .Sx "But, how about XOAUTH2 / OAUTHBEARER?"
15099 If that is not used it is necessary to declare \*(UA a
15100 .Dq less secure app
15101 (on the providers account web page) in order to read and send mail.
15102 However, it also seems possible to take the following steps instead:
15107 give the provider the number of a mobile phone,
15110 .Dq 2-Step Verification ,
15112 create an application specific password (16 characters), and
15114 use that special password instead of the real Google account password in
15115 \*(UA (for more on that see the section
15116 .Sx "On URL syntax and credential lookup" ) .
15120 .\" .Ss "But, how about XOAUTH2 / OAUTHBEARER?" {{{
15121 .Ss "But, how about XOAUTH2 / OAUTHBEARER?"
15124 .Sx "I cannot login to Google mail \&(via OAuth\&)"
15125 one OAuth-based authentication method is available:
15126 the OAuth 2.0 bearer token usage as standardized in RFC 6750 (according
15127 SASL mechanism in RFC 7628), also known as XOAUTH2 and OAUTHBEARER,
15128 allows fetching a temporary access token via the web that can locally be
15131 The protocol is simple and extendable, token updates or even password
15132 changes via a simple TLS secured server login would be possible in
15133 theory, but today a web browser and an external support tool are
15134 prerequisites for using this authentication method.
15135 The token times out and must be periodically refreshed via the web.
15138 Some hurdles must be taken before being able to use this method.
15139 Using GMail as an example, an application (that is a name) must be
15140 registered, for which credentials, a
15143 .Dq client secret ,
15144 need to be created and saved locally (in a secure way).
15145 These initial configuration steps can be performed at
15146 .Lk https://console.developers.google.com/apis/credentials .
15147 Thereafter a refresh token can be requested;
15148 a python program to do this for GMail accounts is
15149 .Lk https://github.com/google/\:gmail-oauth2-tools/\:raw/\:\
15150 master/\:python/\:oauth2.py :
15152 .Bd -literal -offset indent
15153 $ python oauth2.py --user=EMAIL \e
15154 --client-id=THE-ID --client-secret=THE-SECRET \e
15155 --generate_oauth2_token
15156 To authorize token, visit this url and follow the directions:
15157 https://accounts.google.com/o/oauth2/auth?client_id=...
15158 Enter verification code: ...
15161 Access Token Expiration Seconds: 3600
15162 $ # Of which the last three are actual token responses.
15163 $ # Thereafter access tokens can regularly be refreshed
15164 $ # via the created refresh token (read on)
15168 The generated refresh token must also be saved locally (securely).
15169 The procedure as a whole can be read at
15170 .Lk https://github.com/google/\:gmail-oauth2-tools/\:wiki/\:\
15171 OAuth2DotPyRunThrough .
15172 Since periodic timers are not yet supported, keeping an access token
15173 up-to-date (from within \*(UA) can only be performed via the hook
15174 .Va on-main-loop-tick ,
15175 or (for sending only)
15176 .Va on-compose-enter
15177 (for more on authentication please see the section
15178 .Sx "On URL syntax and credential lookup" ) :
15180 .Bd -literal -offset indent
15181 set on-main-loop-tick=o-m-l-t on-compose-enter=o-c-e
15183 xcall update_access_token
15186 xcall update_access_token
15189 set access_token_=0
15190 define update_access_token {
15191 local set i epoch_sec epoch_nsec
15193 eval set $i # set epoch_sec/_nsec of vexpr epoch
15194 vput vexpr i + $access_token_ 2100
15195 if $epoch_sec -ge $i
15196 vput ! password python oauth2.py --user=EMAIL \e
15197 --client-id=THE-ID --client-secret=THE-SECRET \e
15198 --refresh-token=THE-REFRESH-TOKEN |\e
15199 sed '1b PASS;d; :PASS s/^.\e{1,\e}:\e(.\e{1,\e}\e)$/\e1/'
15200 vput csop password trim "$password"
15202 echo password is <$password>
15204 set access_token_=$epoch_sec
15210 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{ review
15211 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
15213 Two thinkable situations: the first is a shadowed sequence; setting
15215 or the most possible
15217 mode, causes a printout of the
15219 tree after that is built; being a cache, this happens only upon startup
15220 or after modifying bindings.
15223 Or second, terminal libraries (see
15224 .Sx "On terminal control and line editor",
15227 may report different codes than the terminal really sends, rendering
15228 bindings dysfunctional because expected and received data do not match; the
15232 ings will show the byte sequences that are expected.
15233 (One common source of problems is that the \(em possibly even
15234 non-existing \(em keypad is not turned on, and the resulting layout
15235 reports the keypad control codes for the normal keyboard keys.)
15238 To overcome the situation use for example the program
15242 if available, to see the byte sequences which are actually produced
15243 by keypresses, and use the variable
15245 to make \*(UA aware of them.
15246 The terminal this is typed on produces some unexpected sequences,
15247 here for an example the shifted home key:
15249 .Bd -literal -offset indent
15252 # 1B 5B=[ 31=1 3B=; 32=2 48=H
15257 $ \*(uA -v -Stermcap='kHOM=\eE[H'
15264 .\" .Ss "Can \*(UA git-send-email?" {{{
15265 .Ss "Can \*(UA git-send-email?"
15268 Put (at least parts of) the following in your
15271 .Bd -literal -offset indent
15273 smtpserver = /usr/bin/\*(uA
15274 smtpserveroption = -t
15275 #smtpserveroption = -Sexpandaddr
15276 smtpserveroption = -Athe-account-you-need
15279 suppressfrom = false
15280 assume8bitEncoding = UTF-8
15283 chainreplyto = true
15293 versions (v2.33.0) added the option
15295 Patches can also be send directly, for example:
15297 .Bd -literal -offset indent
15298 $ git format-patch -M --stdout HEAD^ |
15299 \*(uA -A the-account-you-need -t RECEIVER
15303 .\" .Ss "Howto handle stale dotlock files" {{{
15304 .Ss "Howto handle stale dotlock files"
15307 sometimes fails to open MBOX mail databases because creation of
15309 .Sx "dotlock files"
15310 is impossible due to existing but unowned lock files.
15311 \*(UA does not offer an option to deal with those files, because it is
15312 considered a site policy what counts as unowned, and what not.
15313 The site policy is usually defined by administrator(s), and expressed in
15314 the configuration of a locally installed MTA (for example Postfix
15315 .Ql stale_lock_time=500s ) .
15316 Therefore the suggestion:
15318 .Bd -literal -offset indent
15319 $ </dev/null \*(uA -s 'MTA: be no frog, handle lock' $LOGNAME
15323 By sending a mail to yourself the local MTA can use its normal queue
15324 mechanism to try the delivery multiple times, finally decide a lock file
15325 has become stale, and remove it.
15331 .\" .Sh "IMAP CLIENT" {{{
15334 \*(OPally there is IMAP client support available.
15335 This part of the program is obsolete and will vanish in v15 with the
15336 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
15337 and makes excessive use of signal based long code jumps.
15338 Support can hopefully be readded later based on a new-style I/O, with
15339 SysV signal handling.
15340 In fact the IMAP support had already been removed from the codebase, but
15341 was reinstantiated on user demand: in effect the IMAP code is at the
15342 level of \*(UA v14.8.16 (with
15344 being the sole exception), and should be treated with some care.
15351 protocol prefixes, and an IMAP-based
15354 IMAP URLs (paths) undergo inspections and possible transformations
15355 before use (and the command
15357 can be used to manually apply them to any given argument).
15358 Hierarchy delimiters are normalized, a step which is configurable via the
15360 variable chain, but defaults to the first seen delimiter otherwise.
15361 \*(UA supports internationalised IMAP names, and en- and decodes the
15362 names from and to the
15364 as necessary and possible.
15365 If a mailbox name is expanded (see
15366 .Sx "Filename transformations" )
15367 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
15368 mailboxes below the
15370 target box, while folder names prefixed by `@' refer to folders below
15371 the hierarchy base, so the following will list all folders below the
15372 current one when in an IMAP mailbox:
15376 Note: some IMAP servers do not accept the creation of mailboxes in
15377 the hierarchy base, but require that they are created as subfolders of
15378 `INBOX' \(en with such servers a folder name of the form
15380 .Dl imaps://mylogin@imap.myisp.example/INBOX.
15382 should be used (the last character is the server's hierarchy
15384 The following IMAP-specific commands exist:
15387 .Bl -tag -width ".It Ic BaNg"
15390 Only applicable to cached IMAP mailboxes;
15391 takes a message list and reads the specified messages into the IMAP
15396 If operating in disconnected mode on an IMAP mailbox,
15397 switch to online mode and connect to the mail server while retaining
15398 the mailbox status.
15399 See the description of the
15401 variable for more information.
15405 If operating in online mode on an IMAP mailbox,
15406 switch to disconnected mode while retaining the mailbox status.
15407 See the description of the
15410 A list of messages may optionally be given as argument;
15411 the respective messages are then read into the cache before the
15412 connection is closed, thus
15414 makes the entire mailbox available for disconnected use.
15418 Sends command strings directly to the current IMAP server.
15419 \*(UA operates always in IMAP `selected state' on the current mailbox;
15420 commands that change this will produce undesirable results and should be
15422 Useful IMAP commands are:
15423 .Bl -tag -offset indent -width ".Ic getquotearoot"
15425 Takes the name of an IMAP mailbox as an argument and creates it.
15427 (RFC 2087) Takes the name of an IMAP mailbox as an argument
15428 and prints the quotas that apply to the mailbox.
15429 Not all IMAP servers support this command.
15431 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
15432 the Other User's Namespaces and the Shared Namespaces.
15433 Each namespace type is printed in parentheses;
15434 if there are multiple namespaces of the same type,
15435 inner parentheses separate them.
15436 For each namespace a prefix and a hierarchy separator is listed.
15437 Not all IMAP servers support this command.
15442 Perform IMAP path transformations.
15446 .Sx "Command modifiers" ) ,
15447 and manages the error number
15449 The first argument specifies the operation:
15451 normalizes hierarchy delimiters (see
15453 and converts the strings from the locale
15455 to the internationalized variant used by IMAP,
15457 performs the reverse operation.
15458 Encoding will honour the (global) value of
15464 The following IMAP-specific internal variables exist:
15467 .Bl -tag -width ".It Va BaNg"
15469 .It Va disconnected
15470 \*(BO When an IMAP mailbox is selected and this variable is set,
15471 no connection to the server is initiated.
15472 Instead, data is obtained from the local cache (see
15475 Mailboxes that are not present in the cache
15476 and messages that have not yet entirely been fetched from the server
15478 to fetch all messages in a mailbox at once,
15480 .No ` Ns Li copy * /dev/null Ns '
15481 can be used while still in connected mode.
15482 Changes that are made to IMAP mailboxes in disconnected mode are queued
15483 and committed later when a connection to that server is made.
15484 This procedure is not completely reliable since it cannot be guaranteed
15485 that the IMAP unique identifiers (UIDs) on the server still match the
15486 ones in the cache at that time.
15489 when this problem occurs.
15491 .It Va disconnected-USER@HOST
15492 The specified account is handled as described for the
15495 but other accounts are not affected.
15498 .It Va imap-auth-USER@HOST , imap-auth
15499 Sets the IMAP authentication method.
15500 Supported are the default
15510 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
15515 (for TLS secured connections which pass a client certificate via
15516 .Va tls-config-pairs ) ,
15517 as well as the \*(OPal
15529 which only need the former.
15531 solely builds upon the credentials passed via a client certificate,
15532 and is usually the way to go since tested servers do not actually follow
15533 RFC 4422, and fail if additional credentials are actually passed.
15537 Enables caching of IMAP mailboxes.
15538 The value of this variable must point to a directory that is either
15539 existent or can be created by \*(UA.
15540 All contents of the cache can be deleted by \*(UA at any time;
15541 it is not safe to make assumptions about them.
15544 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
15545 The hierarchy separator used by the IMAP server.
15546 Whenever an IMAP path is specified it will undergo normalization.
15547 One of the normalization steps is the squeezing and adjustment of
15548 hierarchy separators.
15549 If this variable is set, any occurrence of any character of the given
15550 value that exists in the path will be replaced by the first member of
15551 the value; an empty value will cause the default to be used, it is
15553 If not set, we will reuse the first hierarchy separator character that
15554 is discovered in a user-given mailbox name.
15556 .Mx Va imap-keepalive
15557 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
15558 IMAP servers may close the connection after a period of
15559 inactivity; the standard requires this to be at least 30 minutes,
15560 but practical experience may vary.
15561 Setting this variable to a numeric `value' greater than 0 causes
15562 a `NOOP' command to be sent each `value' seconds if no other operation
15566 .It Va imap-list-depth
15567 When retrieving the list of folders on an IMAP server, the
15569 command stops after it has reached a certain depth to avoid possible
15571 The value of this variable sets the maximum depth allowed.
15573 If the folder separator on the current IMAP server is a slash `/',
15574 this variable has no effect and the
15576 command does not descend to subfolders.
15578 .Mx Va imap-use-starttls
15579 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
15580 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
15581 IMAP session TLS encrypted.
15582 This functionality is not supported by all servers,
15583 and is not used if the session is already encrypted by the IMAPS method.
15589 .\" .Sh "SEE ALSO" {{{
15599 .Xr spamassassin 1 ,
15608 .Pf (or\0 Xr regex 7 ) ,
15609 .Xr mailwrapper 8 ,
15615 .\" .Sh HISTORY {{{
15618 M. Douglas McIlroy writes in his article
15619 .Dq A Research UNIX Reader: Annotated Excerpts \
15620 from the Programmer's Manual, 1971-1986
15623 command already appeared in First Edition
15627 .Bd -ragged -offset indent
15628 Electronic mail was there from the start.
15629 Never satisfied with its exact behavior, everybody touched it at one
15630 time or another: to assure the safety of simultaneous access, to improve
15631 privacy, to survive crashes, to exploit uucp, to screen out foreign
15632 freeloaders, or whatever.
15633 Not until v7 did the interface change (Thompson).
15634 Later, as mail became global in its reach, Dave Presotto took charge and
15635 brought order to communications with a grab-bag of external networks
15641 Mail, in large parts compatible with
15643 mail, was written in 1978 by Kurt Shoens and developed as part of the
15646 distribution until 1995.
15647 This manual page is derived from
15648 .Dq The Mail Reference Manual
15649 that Kurt Shoens wrote for Mail 1.3, included in 3BSD in 1980.
15654 denominator became standardized as
15656 in the X/Open Portability Guide Issue 2 (January 1987).
15657 After the rise of Open Source
15660 Mail saw continuous development in the individual code forks,
15661 noticeably by Christos Zoulas in
15663 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
15664 Ritter in the years 2000 until 2008.
15665 Since 2012 S-nail is maintained by Steffen Nurpmeso.
15668 Electronic mail exchange in general is a concept even older.
15669 The earliest well documented electronic mail system was part of the
15670 Compatible Time Sharing System (CTSS) at MIT, its MAIL command had been
15671 proposed in a staff planning memo at the end of 1964 and was implemented
15672 in mid-1965 when Tom Van Vleck and Noel Morris wrote the necessary code.
15673 Similar communication programs were built for other timesharing systems.
15674 One of the most ambitious and influential was Murray Turoff's EMISARI.
15675 Created in 1971 for the United States Office of Emergency Preparedness,
15676 EMISARI combined private electronic messages with a chat system, public
15677 postings, voting, and a user directory.
15680 During the 1960s it was common to connect a large number of terminals to
15681 a single, central computer.
15682 Connecting two computers together was relatively unusual.
15683 This began to change with the development of the ARPANET, the ancestor
15684 of today's Internet.
15685 In 1971 Ray Tomlinson adapted the SNDMSG program, originally developed
15686 for the University of California at Berkeley timesharing system, to give
15687 it the ability to transmit a message across the network into the mailbox
15688 of a user on a different computer.
15689 For the first time it was necessary to specify the recipient's computer
15690 as well as an account name.
15691 Tomlinson decided that the underused commercial at
15693 would work to separate the two.
15696 Sending a message across the network was originally treated as a special
15697 instance of transmitting a file, and so a MAIL command was included in
15698 RFC 385 on file transfer in 1972.
15699 Because it was not always clear when or where a message had come from,
15700 RFC 561 in 1973 aimed to formalize electronic mail headers, including
15705 In 1975 RFC 680 described fields to help with the transmission of
15706 messages to multiple users, including
15711 In 1977 these features and others went from best practices to a binding
15712 standard in RFC 733.
15713 Queen Elizabeth II of England became the first head of state to send
15714 electronic mail on March 26 1976 while ceremonially opening a building
15715 in the British Royal Signals and Radar Establishment (RSRE) in Malvern.
15722 .An "Kurt Shoens" ,
15723 .An "Edward Wang" ,
15724 .An "Keith Bostic" ,
15725 .An "Christos Zoulas" ,
15726 .An "Gunnar Ritter" .
15727 \*(UA is developed by
15728 .An "Steffen Nurpmeso" Aq s-mailx@lists.sdaoden.eu .
15731 .\" .Sh CAVEATS {{{
15734 \*(ID Interrupting an operation via
15738 from anywhere else but a command prompt is very problematic and likely
15739 to leave the program in an undefined state: many library functions
15740 cannot deal with the
15742 that this software (still) performs; even though efforts have been taken
15743 to address this, no sooner but in v15 it will have been worked out:
15744 interruptions have not been disabled in order to allow forceful breakage
15745 of hanging network connections, for example (all this is unrelated to
15749 The SMTP and POP3 protocol support of \*(UA is very basic.
15750 Also, if it fails to contact its upstream SMTP server, it will not make
15751 further attempts to transfer the message at a later time (setting
15756 If this is a concern, it might be better to set up a local SMTP server
15757 that is capable of message queuing.
15764 When a network-based mailbox is open, directly changing to another
15765 network-based mailbox of a different protocol (i.e., from POP3 to IMAP
15766 or vice versa) will cause a
15770 After deleting some message of a POP3 mailbox the header summary falsely
15771 claims that there are no messages to display, one needs to perform
15772 a scroll or dot movement to restore proper state.
15779 mode a power user may encounter crashes very occasionally (this is may
15783 Please report bugs to the
15785 address, for example from within \*(uA:
15786 .\" v15-compat: drop eval as `mail' will expand variable?
15787 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
15790 output of the command
15794 .Bd -literal -offset indent
15795 ? wysh set escape=! verbose; vput version xy; unset verbose;\e
15796 eval mail $contact-mail
15803 Information on the web at
15804 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ; x' .