1 .\"@ nail.1 - S-nail(1) reference manual.
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2018 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
6 .\" Copyright (c) 1980, 1990, 1993
7 .\" The Regents of the University of California. All rights reserved.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\" may be used to endorse or promote products derived from this software
19 .\" without specific prior written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\"@ S-nail v14.9.11 / 2018-08-08
44 .ds VD \\%~/dead.letter
48 .ds vS /etc/mime.types
56 .ds OU [no v15-compat]
57 .ds ID [v15 behaviour may differ]
58 .ds NQ [Only new quoting rules]
62 .if !d str-Lb-libterminfo \
63 .ds str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo)
72 .Nd send and receive Internet mail
78 .\" Keep in SYNC: ./nail.1:"SYNOPSIS, main()
84 .Op : Ns Fl a Ar attachment Ns \&:
85 .Op : Ns Fl b Ar bcc-addr Ns \&:
86 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
87 .Op : Ns Fl c Ar cc-addr Ns \&:
88 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
91 .Fl S\0 Ns Ar var Ns Op Ns = Ns Ar value Ns
94 .Op : Ns Fl X Ar cmd Ns \&:
96 .Pf : Ar to-addr Ns \&:
97 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
105 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
107 .Op Fl r Ar from-addr
109 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
112 .Op : Ns Fl X Ar cmd Ns \&:
113 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
120 .Op : Ns Fl C Ar """custom:\0header""" Ns \&:
123 .Op Fl r Ar from-addr
125 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
127 .Op : Ns Fl X Ar cmd Ns \&:
129 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
135 .Fl V | Fl Fl version
140 .Mx -toc -tree html pdf ps xhtml
143 .\" .Sh DESCRIPTION {{{
146 .Bd -filled -compact -offset indent
147 .Sy Compatibility note:
148 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2020).
149 Backward incompatibility has to be expected \(en
152 .Sx "Shell-style argument quoting"
153 rules, for example, and shell metacharacters will become meaningful.
154 Many old-style commands accept new syntax via
157 .Sx "Command modifiers" .
158 New and old behaviour is flagged \*(IN and \*(OU, and setting
161 .Sx "INTERNAL VARIABLES" ,
162 will choose new behaviour when applicable.
163 \*(OB flags what will vanish, and enabling
167 enables obsoletion warnings.
171 \*(UA provides a simple and friendly environment for sending and
173 It is intended to provide the functionality of the POSIX
175 command, but is MIME capable and optionally offers extensions for
176 line editing, S/MIME, SMTP and POP3, among others.
177 \*(UA divides incoming mail into its constituent messages and allows
178 the user to deal with them in any order.
182 .Sx "INTERNAL VARIABLES"
183 for manipulating messages and sending mail.
184 It provides the user simple editing capabilities to ease the composition
185 of outgoing messages, and increasingly powerful and reliable
186 non-interactive scripting capabilities.
188 .\" .Ss "Options" {{{
191 .Bl -tag -width ".It Fl BaNg"
194 Explicitly control which of the
198 d (loaded): if the letter
200 is (case-insensitively) part of the
204 is sourced, likewise the letter
206 controls sourcing of the user's personal
208 file, whereas the letters
212 explicitly forbid sourcing of any resource files.
213 Scripts should use this option: to avoid environmental noise they should
215 from any configuration and create a script-specific environment, setting
217 .Sx "INTERNAL VARIABLES"
220 and running configurating commands via
222 This option overrides
229 command for the given user email
231 after program startup is complete (all resource files are loaded, any
233 setting is being established; only
235 commands have not been evaluated yet).
236 Being a special incarnation of
238 macros for the purpose of bundling longer-lived
240 tings, activating such an email account also switches to the accounts
242 .Sx "primary system mailbox"
245 If the operation fails the program will exit if it is used
246 non-interactively, or if any of
253 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
256 to the message (for compose mode opportunities refer to
260 .Sx "Filename transformations"
263 will be performed, except that shell variables are not expanded.
266 not be accessible but contain a
268 character, then anything before the last
270 will be used as the filename, anything thereafter as a character set
273 If an input character set is specified,
274 .Mx -ix "character set specification"
275 but no output character set, then the given input character set is fixed
276 as-is, and no conversion will be applied;
277 giving the empty string or the special string hyphen-minus
279 will be treated as if
281 has been specified (the default).
283 If an output character set has also been given then the conversion will
284 be performed exactly as specified and on-the-fly, not considering the
285 file type and content.
286 As an exception, if the output character set is specified as the empty
287 string or hyphen-minus
289 then the default conversion algorithm (see
290 .Sx "Character sets" )
291 is applied (therefore no conversion is performed on-the-fly,
293 will be MIME-classified and its contents will be inspected first) \(em
294 without support for character set conversions
296 does not include the term
298 only this argument is supported.
301 (\*(OB: \*(UA will always use line-buffered output, to gain
302 line-buffered input even in batch mode enable batch mode via
307 Send a blind carbon copy to
314 .Sx "INTERNAL VARIABLES" ,
319 The option may be used multiple times.
321 .Sx "On sending mail, and non-interactive mode" .
324 .It Fl C Ar """field: body"""
325 Create a custom header which persists for an entire session.
326 A custom header consists of the field name followed by a colon
328 and the field content body, e.g.,
329 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" .
330 Standard header field names cannot be overwritten by custom headers.
331 Runtime adjustable custom headers are available via the variable
336 .Sx "COMMAND ESCAPES" ,
339 are the most flexible and powerful options to manage message headers.
340 This option may be used multiple times.
346 except it places the argument in the list of carbon copies.
356 Almost enable a sandbox mode with the internal variable
358 the same can be achieved via
359 .Ql Fl S Va \&\&debug
361 .Ql Ic set Va \&\&debug .
367 and thus discard messages with an empty message part body.
371 Just check if mail is present (in the system
373 or the one specified via
375 if yes, return an exit status of zero, a non-zero value otherwise.
376 To restrict the set of mails to consider in this evaluation a message
377 specification can be added with the option
382 Save the message to send in a file named after the local part of the
383 first recipient's address (instead of in
388 Read in the contents of the user's
390 .Sx "secondary mailbox"
392 (or the specified file) for processing;
393 when \*(UA is quit, it writes undeleted messages back to this file
399 argument will undergo some special
400 .Sx "Filename transformations"
405 is not an argument to the flag
407 but is instead taken from the command line after option processing has
411 that starts with a hyphen-minus, prefix with a relative path, as in
412 .Ql ./-hyphenbox.mbox .
427 A configurable summary view is available via the option
429 This mode does not honour
434 Show a short usage summary.
440 to ignore tty interrupt signals.
446 of all messages that match the given
450 found by the same algorithm used by
454 .Sx "Specifying messages"
457 This mode does not honour
462 option has been given in addition no header summary is produced,
463 but \*(UA will instead indicate via its exit status whether
469 note that any verbose output is suppressed in this mode and must instead
470 be enabled explicitly (e.g., by using the option
475 Special send mode that will flag standard input with the MIME
479 and use it as the main message body.
480 \*(ID Using this option will bypass processing of
481 .Va message-inject-head
483 .Va message-inject-tail .
489 Special send mode that will MIME classify the specified
491 and use it as the main message body.
492 \*(ID Using this option will bypass processing of
493 .Va message-inject-head
495 .Va message-inject-tail .
501 inhibit the initial display of message headers when reading mail or
506 for the internal variable
511 Standard flag that inhibits reading the system wide
516 allows more control over the startup sequence; also see
517 .Sx "Resource files" .
521 Special send mode that will initialize the message body with the
522 contents of the specified
524 which may be standard input
526 only in non-interactive context.
536 opened will be in read-only mode.
540 .It Fl r Ar from-addr
541 Whereas the source address that appears in the
543 header of a message (or in the
545 header if the former contains multiple addresses) is honoured by the
546 built-in SMTP transport, it is not used by a file-based
548 (Mail-Transfer-Agent) for the RFC 5321 reverse-path used for relaying
549 and delegating a message to its destination(s), for delivery errors
550 etc., but it instead uses the local identity of the initiating user.
553 When this command line option is used the given
555 will be assigned to the internal variable
557 but in addition the command line option
558 .Fl \&\&f Ar from-addr
559 will be passed to a file-based
561 whenever a message is sent.
564 include a user name the address components will be separated and
565 the name part will be passed to a file-based
571 If an empty string is passed as
573 then the content of the variable
575 (or, if that contains multiple addresses,
577 will be evaluated and used for this purpose whenever the file-based
586 command line options are used when contacting a file-based MTA, unless
587 this automatic deduction is enforced by
589 ing the internal variable
590 .Va r-option-implicit .
593 Remarks: many default installations and sites disallow overriding the
594 local user identity like this unless either the MTA has been configured
595 accordingly or the user is member of a group with special privileges.
596 Passing an invalid address will cause an error.
600 .It Fl S Ar var Ns Op = Ns value
602 (or, with a prefix string
605 .Sx "INTERNAL VARIABLES" ,
608 iable and optionally assign
610 if supported; \*(ID the entire expression is evaluated as if specified
611 within dollar-single-quotes (see
612 .Sx "Shell-style argument quoting" )
613 if the internal variable
616 If the operation fails the program will exit if any of
621 Settings established via
623 cannot be changed from within
625 or an account switch initiated by
627 They will become mutable again before commands registered via
633 Specify the subject of the message to be sent.
634 Newline (NL) and carriage-return (CR) bytes are invalid and will be
635 normalized to space (SP) characters.
639 The message given (on standard input) is expected to contain, separated
640 from the message body by an empty line, one or multiple message headers.
641 Headers can span multiple consecutive lines if follow lines start with
642 any amount of whitespace.
643 A line starting with the number sign
645 in the first column is ignored.
646 Message recipients can be given via the message headers
652 they will be added to any recipients specified on the command line,
653 and are likewise subject to
656 If a message subject is specified via
658 then it will be used in favour of one given on the command line.
660 More optional headers are
674 .Ql Mail-Followup-To: ,
675 by default created automatically dependent on message context, will
676 be used if specified (a special address massage will however still occur
678 Any other custom header field (also see
683 is passed through entirely
684 unchanged, and in conjunction with the options
688 it is possible to embed
689 .Sx "COMMAND ESCAPES" .
697 .Sx "primary system mailbox"
700 appropriate privileges presumed; effectively identical to
701 .Ql Fl \&\&f Ns \0%user .
710 will also show the list of
712 .Ql $ \*(uA -Xversion -Xx .
717 ting the internal variable
719 enables display of some informational context messages.
720 Using it twice increases the level of verbosity.
724 Add the given (or multiple for a multiline argument)
726 to the list of commands to be executed,
727 as a last step of program startup, before normal operation starts.
728 This is the only possibility to execute commands in non-interactive mode
729 when reading startup files has been disabled.
730 The commands will be evaluated as a unit, just as via
740 .Sx "COMMAND ESCAPES"
741 in compose mode even in non-interactive use cases.
742 This can be used to, e.g., automatically format the composed message
743 text before sending the message:
744 .Bd -literal -offset indent
745 $ ( echo 'line one. Word. Word2.';\e
746 echo '~| /usr/bin/fmt -tuw66' ) |\e
747 LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
752 Enables batch mode: standard input is made line buffered, the complete
753 set of (interactive) commands is available, processing of
754 .Sx "COMMAND ESCAPES"
755 is enabled in compose mode, and diverse
756 .Sx "INTERNAL VARIABLES"
757 are adjusted for batch necessities, exactly as if done via
777 are looked up, and acted upon.
778 The following prepares an email message in a batched dry run:
779 .Bd -literal -offset indent
780 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
781 LC_ALL=C \*(uA -d#:/ -X'alias bob bob@exam.ple'
786 This flag forces termination of option processing in order to prevent
789 It also forcefully puts \*(UA into send mode, see
790 .Sx "On sending mail, and non-interactive mode" .
796 arguments and all receivers established via
800 are subject to the checks established by
803 .Sx "INTERNAL VARIABLES" ;
804 they all support the flag
808 allows their recognition all
810 arguments given at the end of the command line after a
812 separator will be passed through to a file-based
814 (Mail-Transfer-Agent) and persist for the entire session.
816 constraints do not apply to the content of
820 .\" .Ss "A starter" {{{
823 \*(UA is a direct descendant of
825 Mail, itself a successor to the Research
828 .Dq was there from the start
831 It thus represents the user side of the
833 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
834 traditionally taken by
836 and most MTAs provide a binary of this name for compatibility purposes.
841 of \*(UA then the system side is not a mandatory precondition for mail
845 Because \*(UA strives for compliance with POSIX
847 it is likely that some configuration settings have to be adjusted before
848 using it is a smooth experience.
849 (Rather complete configuration examples can be found in the section
854 .Sx "Resource files" )
855 template bends those standard imposed settings of the
856 .Sx "INTERNAL VARIABLES"
857 a bit towards more user friendliness and safety, however.
865 in order to suppress the automatic moving of messages to the
867 .Sx "secondary mailbox"
869 that would otherwise occur (see
870 .Sx "Message states" ) ,
873 to not remove empty system MBOX mailbox files (or all empty such files if
875 .Pf a.k.a.\0 Ev POSIXLY_CORRECT
876 mode has been enabled) to avoid mangling of file permissions when files
877 eventually get recreated.
881 in order to synchronize \*(UA with the exit status report of the used
888 to enter interactive startup even if the initial mailbox is empty,
890 to allow editing of headers as well as
892 to not strip down addresses in compose mode, and
894 to include the message that is being responded to when
896 ing, which is indented by an
898 that also deviates from standard imposed settings.
899 .Va mime-counter-evidence
900 is fully enabled, too.
904 The file mode creation mask can be managed explicitly via the variable
906 Sufficient system support provided symbolic links will not be followed
907 when files are opened for writing.
908 Files and shell pipe output can be
910 d for evaluation, also during startup from within the
911 .Sx "Resource files" .
914 .\" .Ss "On sending mail, and non-interactive mode" {{{
915 .Ss "On sending mail, and non-interactive mode"
917 To send a message to one or more people, using a local or built-in
919 (Mail-Transfer-Agent) transport to actually deliver the generated mail
920 message, \*(UA can be invoked with arguments which are the names of
921 people to whom the mail will be sent, and the command line options
925 can be used to add (blind) carbon copy receivers:
927 .Bd -literal -offset indent
929 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
931 # But... try it in an isolated dry-run mode (-d) first
932 $ LC_ALL=C \*(uA -d -:/ -Ssendwait -Sttycharset=utf8 \e
933 -b bcc@exam.ple -c cc@exam.ple \e
935 '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
938 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
939 -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
940 -S from=scriptreply@exam.ple \e
942 -. eric@exam.ple < /tmp/letter.txt
946 If standard input is a terminal rather than the message to be sent,
947 the user is expected to type in the message contents.
948 In this compose mode \*(UA treats lines beginning with the character
950 special \(en these are so-called
951 .Sx "COMMAND ESCAPES" ,
952 which can be used to read in files, process shell commands, add and edit
953 attachments and more; e.g.,
961 respectively, to revise the message in its current state,
963 allows editing of the most important message headers, with the potent
965 custom headers can be created, for example (more specifically than with
971 gives an overview of most other available command escapes.
976 (see there) will call hooks, insert automatic injections and receivers,
977 leave compose mode and send the message once it is completed.
978 Aborting letter composition is possible with either of
982 the latter of which will save the message in the file denoted by
991 can also be achieved by typing end-of-transmission (EOT) via
994 at the beginning of an empty line, and
996 is always reachable by typing end-of-text (ETX) twice via
1004 .Sx "INTERNAL VARIABLES"
1005 can be used to alter default behavior.
1006 E.g., messages are sent asynchronously, without supervision, unless the
1009 is set, therefore send errors will not be recognizable until then.
1014 will automatically startup an editor when compose mode is entered, and
1015 editing of headers additionally to plain body content can be enabled via
1017 \*(ID some, but not all headers can be created, edited or deleted in an
1022 will cause the user to be prompted actively for (blind) carbon-copy
1023 recipients, respectively, and (the default)
1025 will request confirmation whether the message shall be sent.
1028 The envelope sender address is defined by
1030 explicitly defining an originating
1032 may be desirable, especially with the built-in SMTP Mail-Transfer-Agent
1034 .Sx "Character sets"
1035 for outgoing message and MIME part content are configurable via
1037 whereas input data is assumed to be in
1039 Message data will be passed over the wire in a
1041 MIME parts a.k.a. attachments need to be assigned a
1043 usually taken out of
1044 .Sx "The mime.types files" .
1045 Saving a copy of sent messages in a
1047 mailbox may be desirable \(en as for most mailbox
1049 targets the value will undergo
1050 .Sx "Filename transformations" .
1055 sandbox dry-run tests will prove correctness.
1058 Message recipients (as specified on the command line or defined in
1065 filtering, and may not only be email addressees but can also be names of
1066 mailboxes and even complete shell command pipe specifications.
1069 is not set then only network addresses (see
1071 for a description of mail addresses) and plain user names (including MTA
1072 aliases) may be used, other types will be filtered out, giving a warning
1074 A network address that contains no domain-, but only a valid local user
1076 in angle brackets will be automatically expanded to a valid address when
1078 is set to a non-empty value; setting it to the empty value instructs
1081 will perform the necessary expansion.
1084 may help to generate standard compliant network addresses.
1086 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
1087 .\" grep the latter for the complete picture
1091 is set then an extended set of recipient addresses will be accepted:
1092 Any name that starts with a vertical bar
1094 character specifies a command pipe \(en the command string following the
1096 is executed and the message is sent to its standard input;
1097 Likewise, any name that consists only of hyphen-minus
1099 or starts with the character solidus
1101 or the character sequence dot solidus
1103 is treated as a file, regardless of the remaining content.
1104 Any other name which contains a commercial at
1106 character is a network address;
1107 Any other name which starts with a plus sign
1109 character is a mailbox name;
1110 Any other name which contains a solidus
1112 character but no exclamation mark
1116 character before is also a mailbox name;
1117 What remains is treated as a network address.
1119 .Bd -literal -offset indent
1120 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1121 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1122 $ echo safe | LC_ALL=C \e
1123 \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1124 -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1129 To create file-carbon-copies the special recipient header
1131 may be used as often as desired.
1132 Its entire value (or body in standard terms) is interpreted as a
1134 target, after having been subject to
1135 .Sx "Filename transformations" .
1136 Beside using the command escape
1140 header) this is the only way to create a file-carbon-copy without
1141 introducing an ambiguity regarding the interpretation of the address,
1142 e.g., to use file names with leading vertical bars or commercial ats.
1143 Like all other recipients
1145 is subject to the checks of
1149 It is possible to create personal distribution lists via the
1151 command, so that, for instance, the user can send mail to
1153 and have it go to a group of people.
1154 Different to the alias mechanism of a local
1156 which is often tracked in a file
1160 and the names of which are subject to the
1164 personal aliases will be expanded by \*(UA before the message is sent.
1165 They are thus a convenient alternative to specifying each addressee by
1166 itself, correlate with the active set of
1172 .Bd -literal -offset indent
1173 ? alias cohorts bill jkf mark kridle@ucbcory ~/cohorts.mbox
1174 ? alias mark mark@exam.ple
1178 For the purpose of arranging a complete environment of settings that can
1179 be switched to with a single command or command line option there are
1181 Alternatively it is also possible to use a flat configuration, making use
1182 of so-called variable chains which automatically pick
1186 context-dependent variable variants: for example addressing
1187 .Ql Ic File Ns \& pop3://yaa@exam.ple
1189 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1190 .Va \&\&pop3-no-apop-exam.ple
1195 .Sx "On URL syntax and credential lookup"
1197 .Sx "INTERNAL VARIABLES" .
1200 The compose mode hooks
1201 .Va on-compose-enter , on-compose-splice , on-compose-leave
1203 .Va on-compose-cleanup
1206 d macros and provide reliable and increasingly powerful mechanisms to
1207 perform automated message adjustments dependent on message context,
1208 for example addition of message signatures
1209 .Pf ( Va message-inject-head , message-inject-tail )
1210 or creation of additional receiver lists (also by setting
1211 .Va autocc , autobcc ) .
1212 To achieve that the command
1214 may be used in order to query and adjust status of message(s).
1215 The splice hook can also make use of
1216 .Sx "COMMAND ESCAPES" .
1217 (\*(ID The compose mode hooks work for
1218 .Ic forward , mail , reply
1223 only provide the hooks
1226 .Va on-resend-cleanup ,
1227 which are pretty restricted due to the nature of the operation.)
1230 To avoid environmental noise scripts should
1232 \*(UA from any configuration files and create a script-local
1233 environment, ideally with the command line options
1235 to disable any configuration file in conjunction with repetitions of
1237 to specify variables:
1239 .Bd -literal -offset indent
1240 $ env LC_ALL=C \*(uA -:/ \e
1241 -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1242 -Sexpandaddr=fail,-all,failinvaddr \e
1243 -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1244 -S from=scriptreply@exam.ple \e
1245 -s 'Subject to go' -a attachment_file \e
1247 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1252 As shown, scripts can
1254 a locale environment, the above specifies the all-compatible 7-bit clean
1257 but will nonetheless take and send UTF-8 in the message text by using
1259 In interactive mode, which is introduced in the next section, messages
1260 can be sent by calling the
1262 command with a list of recipient addresses:
1264 .Bd -literal -offset indent
1265 $ \*(uA -d -Squiet -Semptystart
1266 "/var/spool/mail/user": 0 messages
1267 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1269 ? # Will do the right thing (tm)
1270 ? m rec1@exam.ple rec2@exam.ple
1274 .\" .Ss "On reading mail, and interactive mode" {{{
1275 .Ss "On reading mail, and interactive mode"
1277 When invoked without addressees \*(UA enters interactive mode in which
1279 When used like that the user's system
1281 (for more on mailbox types please see the command
1283 is read in and a one line header of each message therein is displayed if
1287 The visual style of this summary of
1289 can be adjusted through the variable
1291 and the possible sorting criterion via
1297 can be performed with the command
1299 If the initially opened mailbox is empty \*(UA will instead exit
1300 immediately (after displaying a message) unless the variable
1309 will give a listing of all available commands and
1311 will \*(OPally give a summary of some common ones.
1312 If the \*(OPal documentation strings are available (see
1317 and see the actual expansion of
1319 and what its purpose is, i.e., commands can be abbreviated
1320 (note that POSIX defines some abbreviations, so that the alphabetical
1321 order of commands does not necessarily relate to the abbreviations; it is
1322 however possible to define overwrites with
1323 .Ic commandalias ) .
1324 These commands can also produce a more
1329 Messages are given numbers (starting at 1) which uniquely identify
1330 messages; the current message \(en the
1332 \(en will either be the first new message, or the first unread message,
1333 or the first message of the mailbox; the internal variable
1335 will instead cause usage of the last message for this purpose.
1340 ful of header summaries containing the
1344 will display only the summaries of the given messages, defaulting to the
1348 Message content can be displayed with the command
1355 controls whether and when \*(UA will use the configured
1357 for display instead of directly writing to the user terminal
1359 the sole difference to the command
1361 which will always use the
1365 will instead only show the first
1367 of a message (maybe even compressed if
1370 Message display experience may improve by setting and adjusting
1371 .Va mime-counter-evidence ,
1373 .Sx "HTML mail and MIME attachments" .
1376 By default the current message
1378 is displayed, but like with many other commands it is possible to give
1379 a fancy message specification (see
1380 .Sx "Specifying messages" ) ,
1383 will display all unread messages,
1388 will type the messages 1 and 5,
1390 will type the messages 1 through 5, and
1394 will display the previous and the next message, respectively.
1397 (a more substantial alias for
1399 will display a header summary of the given message specification list
1400 instead of their content, e.g., the following will search for subjects:
1403 .Dl ? from "'@Some subject to search for'"
1406 In the default setup all header fields of a message will be
1408 d, but fields can be white- or blacklisted for a variety of
1409 applications by using the command
1411 e.g., to restrict their display to a very restricted set for
1413 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1414 In order to display all header fields of a message regardless of
1415 currently active ignore or retain lists, use the commands
1420 will show the raw message content.
1421 Note that historically the global
1423 not only adjusts the list of displayed headers, but also sets
1425 (\*(ID A yet somewhat restricted) Reliable scriptable message
1426 inspection is available via
1430 Dependent upon the configuration a line editor (see the section
1431 .Sx "On terminal control and line editor" )
1432 aims at making the user experience with the many
1435 When reading the system
1441 specified a mailbox explicitly prefixed with the special
1443 modifier (to propagate it to a
1445 .Sx "primary system mailbox" ) ,
1446 then messages which have been read
1447 .Pf (see\0 Sx "Message states" )
1448 will be automatically moved to a
1450 .Sx "secondary mailbox" ,
1453 file, when the mailbox is left, either by changing the active mailbox or
1454 by quitting \*(UA \(en this automatic moving from a system- or primary-
1455 to the secondary mailbox is not performed when the variable
1458 Messages can also be explicitly
1460 d to other mailboxes, whereas
1462 keeps the original message.
1464 can be used to write out data content of specific parts of messages.
1467 After examining a message the user can
1469 to the sender and all recipients (which will also be placed in
1472 .Va recipients-in-cc
1475 exclusively to the sender(s).
1478 knows how to apply a special addressee massage, see
1479 .Sx "Mailing lists" .
1480 Dependent on the presence and value of
1482 the message being replied to will be included in a quoted form.
1484 ing a message will allow editing the new message: the original message
1485 will be contained in the message body, adjusted according to
1491 messages: the former will add a series of
1493 headers, whereas the latter will not; different to newly created
1494 messages editing is not possible and no copy will be saved even with
1496 unless the additional variable
1499 When sending, replying or forwarding messages comments and full names
1500 will be stripped from recipient addresses unless the internal variable
1505 Of course messages can be
1507 and they can spring into existence again via
1509 or when the \*(UA session is ended via the
1513 commands to perform a quick program termation.
1514 To end a mail processing session regulary and perform a full program
1515 exit one may issue the command
1517 It will, among others, move read messages to the
1519 .Sx "secondary mailbox"
1521 as necessary, discard deleted messages in the current mailbox,
1522 and update the \*(OPal (see
1528 .\" .Ss "HTML mail and MIME attachments" {{{
1529 .Ss "HTML mail and MIME attachments"
1531 Messages which are HTML-only become more and more common, and of course
1532 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1533 Mail Extensions) parts.
1534 To get a notion of MIME types \*(UA has a default set of types built-in,
1535 onto which the content of
1536 .Sx "The mime.types files"
1537 will be added (as configured and allowed by
1538 .Va mimetypes-load-control ) .
1539 Types can also become registered with the command
1541 To improve interaction with faulty MIME part declarations which are
1542 often seen in real-life messages, setting
1543 .Va mime-counter-evidence
1544 will allow verification of the given assertion, and possible provision
1545 of an alternative, better MIME type.
1548 Whereas \*(UA \*(OPally supports a simple HTML-to-text filter for
1549 displaying HTML messages, it cannot handle MIME types other than plain
1551 Instead programs need to become registered to deal with specific MIME
1552 types or file extensions.
1553 These programs may either prepare plain text versions of their input in
1554 order to enable \*(UA to integrate their output neatlessly in its own
1555 message visualization (a mode which is called
1556 .Cd copiousoutput ) ,
1557 or display the content themselves, for example in an external graphical
1558 window: such handlers will only be considered by and for the command
1562 To install a handler program for a specific MIME type an according
1563 .Va pipe-TYPE/SUBTYPE
1564 variable needs to be set; to instead define a handler for a specific
1565 file extension the respective
1567 variable can be used \(en these handlers take precedence.
1568 \*(OPally \*(UA supports mail user agent configuration as defined in
1569 RFC 1524; this mechanism (see
1570 .Sx "The Mailcap files" )
1571 will be queried for display or quote handlers if none of the former two
1572 .\" TODO v15-compat "will be" -> "is"
1573 did; it will be the sole source for handlers of other purpose.
1574 A last source for handlers is the MIME type definition itself, if
1575 a type-marker has been registered with the command
1577 which many of the built-in MIME types do.
1580 For example, to display a HTML message inline (converted to a more fancy
1581 plain text representation than the built-in filter is capable to produce)
1582 with either of the text-mode browsers
1586 teach \*(UA about MathML documents and make it display them as plain
1587 text, and to open PDF attachments in an external PDF viewer,
1588 asynchronously and with some other magic attached:
1590 .Bd -literal -offset indent
1591 ? if [ "$features" !% +filter-html-tagsoup ]
1592 ? #set pipe-text/html='@* elinks -force-html -dump 1'
1593 ? set pipe-text/html='@* lynx -stdin -dump -force_html'
1594 ? # Display HTML as plain text instead
1595 ? #set pipe-text/html=@
1597 ? mimetype @ application/mathml+xml mathml
1598 ? wysh set pipe-application/pdf='@&=@ \e
1599 trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1600 trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1601 mupdf "${MAILX_FILENAME_TEMPORARY}"'
1605 .\" .Ss "Mailing lists" {{{
1608 \*(UA offers some support to ease handling of mailing lists.
1611 promotes all given arguments to known mailing lists, and
1613 sets their subscription attribute, creating them first as necessary.
1618 automatically, but only resets the subscription attribute.)
1619 Using the commands without arguments will show (a subset of) all
1620 currently defined mailing lists.
1625 can be used to mark out messages with configured list addresses
1630 If the \*(OPal regular expression support is available a mailing list
1631 specification that contains any of the
1633 regular expression characters
1637 will be interpreted as one, which allows matching of many addresses with
1638 a single expression.
1639 However, all fully qualified list addresses are matched via a fast
1640 dictionary, whereas expressions are placed in (a) list(s) which is
1641 (are) matched sequentially.
1643 .Bd -literal -offset indent
1644 ? set followup-to followup-to-honour=ask-yes \e
1645 reply-to-honour=ask-yes
1646 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1647 ? mlsubscribe a4@b4.c4 exact@lists.c3
1652 .Va followup-to-honour
1654 .Ql Mail-\:Followup-\:To:
1655 header is honoured when the message is being replied to (via
1661 controls whether this header is created when sending mails; it will be
1662 created automatically for a couple of reasons, too, like when the
1664 .Dq mailing list specific
1669 is used to respond to a message with its
1670 .Ql Mail-Followup-To:
1674 A difference in between the handling of known and subscribed lists is
1675 that the address of the user is usually not part of a generated
1676 .Ql Mail-Followup-To:
1677 when addressing the latter, whereas it is for the former kind of lists.
1678 Usually because there are exceptions: say, if multiple lists are
1679 addressed and not all of them are subscribed lists.
1681 For convenience \*(UA will, temporarily, automatically add a list
1682 address that is presented in the
1684 header of a message that is being responded to to the list of known
1686 Shall that header have existed \*(UA will instead, dependent on the
1688 .Va reply-to-honour ,
1691 for this purpose (if it provides a single address which resides on the
1692 same domain as what is stated in
1694 in order to accept a list administrator's wish that is supposed to have
1695 been manifested like that.
1698 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1699 .Ss "Signed and encrypted messages with S/MIME"
1701 \*(OP S/MIME provides two central mechanisms:
1702 message signing and message encryption.
1703 A signed message contains some data in addition to the regular text.
1704 The data can be used to verify that the message has been sent using
1705 a valid certificate, that the sender address matches that in the
1706 certificate, and that the message text has not been altered.
1707 Signing a message does not change its regular text;
1708 it can be read regardless of whether the recipients software is able to
1710 It is thus usually possible to sign all outgoing messages if so desired.
1713 Encryption, in contrast, makes the message text invisible for all people
1714 except those who have access to the secret decryption key.
1715 To encrypt a message, the specific recipients public encryption key
1717 It is therefore not possible to send encrypted mail to people unless their
1718 key has been retrieved from either previous communication or public key
1720 Because signing is performed with private keys, and encryption with
1721 public keys, messages should always be signed before becoming encrypted.
1724 A central concept to S/MIME is that of the certification authority (CA).
1725 A CA is a trusted institution that issues certificates.
1726 For each of these certificates it can be verified that it really
1727 originates from the CA, provided that the CA's own certificate is
1729 A set of CA certificates is usually delivered and installed together
1730 with the cryptographical library that is used on the local system.
1731 Therefore reasonable security for S/MIME on the Internet is provided if
1732 the source that provides that library installation is trusted.
1733 It is also possible to use a specific pool of trusted certificates.
1735 .Va smime-ca-no-defaults
1736 should be set to avoid using the default certificate pool, and
1740 should be pointed to a trusted pool of certificates.
1741 A certificate cannot be more secure than the method its CA certificate
1742 has been retrieved with.
1745 This trusted pool of certificates is used by the command
1747 to ensure that the given S/MIME messages can be trusted.
1748 If so, verified sender certificates that were embedded in signed
1749 messages can be saved locally with the command
1751 and used by \*(UA to encrypt further communication with these senders:
1753 .Bd -literal -offset indent
1755 ? set smime-encrypt-USER@HOST=FILENAME \e
1756 smime-cipher-USER@HOST=AES256
1760 To sign outgoing messages, in order to allow receivers to verify the
1761 origin of these messages, a personal S/MIME certificate is required.
1762 \*(UA supports password-protected personal certificates (and keys), see
1763 .Va smime-sign-cert .
1765 .Sx "On URL syntax and credential lookup"
1766 gives an overview of the possible sources of user credentials, and
1767 .Sx "S/MIME step by step"
1768 shows examplarily how a private S/MIME certificate can be obtained.
1769 In general, if such a private key plus certificate
1771 is available, all that needs to be done is to set some variables:
1773 .Bd -literal -offset indent
1774 ? set smime-sign-cert=ME@exam.ple.paired \e
1775 smime-sign-digest=SHA512 \e
1780 Variables of interest for S/MIME in general are
1783 .Va smime-ca-flags ,
1784 .Va smime-ca-no-defaults ,
1786 .Va smime-crl-file .
1787 For S/MIME signing of interest are
1789 .Va smime-sign-cert ,
1790 .Va smime-sign-include-certs
1792 .Va smime-sign-digest .
1793 Additional variables of interest for S/MIME en- and decryption:
1796 .Va smime-encrypt-USER@HOST .
1799 \*(ID Note that neither S/MIME signing nor encryption applies to
1800 message subjects or other header fields yet.
1801 Thus they may not contain sensitive information for encrypted messages,
1802 and cannot be trusted even if the message content has been verified.
1803 When sending signed messages,
1804 it is recommended to repeat any important header information in the
1808 .\" .Ss "On URL syntax and credential lookup" {{{
1809 .Ss "On URL syntax and credential lookup"
1811 \*(IN For accessing protocol-specific resources usage of Uniform
1812 Resource Locators (URL, RFC 1738) has become omnipresent.
1813 \*(UA expects and understands URLs in the following form;
1816 denote optional parts, optional either because there also exist other
1817 ways to define the information in question or because support of the
1818 part is protocol-specific, e.g.,
1820 is used by the \*(OPal Maildir directory and the IMAP protocol, but not
1825 are specified they must be given in URL percent encoded form (RFC 3986;
1831 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1834 Note that these \*(UA URLs most often do not conform to any real
1835 standard, but instead represent a normalized variant of RFC 1738 \(en
1836 they are not used in data exchange but only meant as a compact,
1837 easy-to-use way of defining and representing information in
1838 a well-known notation.
1841 Many internal variables of \*(UA exist in multiple versions, called
1842 variable chains for the rest of this document: the plain
1847 .Ql variable-USER@HOST .
1854 had been specified in the respective URL, otherwise it refers to the plain
1860 that had been found when doing the user chain lookup as is described
1863 will never be in URL percent encoded form, whether it came from an URL
1864 or not; i.e., variable chain name extensions of
1865 .Sx "INTERNAL VARIABLES"
1866 must not be URL percent encoded.
1869 For example, whether an hypothetical URL
1870 .Ql smtp://hey%3Ayou@our.house
1871 had been given that includes a user, or whether the URL was
1872 .Ql smtp://our.house
1873 and the user had been found differently, to lookup the variable chain
1874 .Va smtp-use-starttls
1875 \*(UA first looks for whether
1876 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1877 is defined, then whether
1878 .Ql smtp-\:use-\:starttls-\:our.house
1879 exists before finally ending up looking at the plain variable itself.
1882 \*(UA obeys the following logic scheme when dealing with the
1883 necessary credential information of an account:
1889 has been given in the URL the variables
1894 If no such variable(s) can be found then \*(UA will,
1895 when enforced by the \*(OPal variables
1896 .Va netrc-lookup-HOST
1900 .Sx "The .netrc file"
1903 specific entry which provides a
1905 name: this lookup will only succeed if unambiguous (one possible matching
1909 If there is still no
1911 then \*(UA will fall back to the user who is supposed to run \*(UA,
1912 the identity of which has been fixated during \*(UA startup and is
1913 known to be a valid user on the current host.
1916 Authentication: unless otherwise noted this will lookup the
1917 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1918 variable chain, falling back to a protocol-specific default should this
1924 has been given in the URL, then if the
1926 has been found through the \*(OPal
1928 that may have already provided the password, too.
1929 Otherwise the variable chain
1930 .Va password-USER@HOST , password-HOST , password
1931 is looked up and used if existent.
1933 Afterwards the complete \*(OPal variable chain
1934 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1938 cache is searched for a password only (multiple user accounts for
1939 a single machine may exist as well as a fallback entry without user
1940 but with a password).
1942 If at that point there is still no password available, but the
1943 (protocols') chosen authentication type requires a password, then in
1944 interactive mode the user will be prompted on the terminal.
1949 S/MIME verification works relative to the values found in the
1953 header field(s), which means that the values of
1954 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1956 .Va smime-sign-digest
1957 will not be looked up using the
1961 chains from above but instead use the corresponding values from the
1962 message that is being worked on.
1963 In unusual cases multiple and different
1967 combinations may therefore be involved \(en on the other hand those
1968 unusual cases become possible.
1969 The usual case is as short as:
1971 .Bd -literal -offset indent
1972 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1973 smime-sign smime-sign-cert=+smime.pair
1979 contains complete example configurations.
1982 .\" .Ss "Encrypted network communication" {{{
1983 .Ss "Encrypted network communication"
1985 SSL (Secure Sockets Layer) a.k.a. its successor TLS (Transport Layer
1986 Security) are protocols which aid in securing communication by providing
1987 a safely initiated and encrypted network connection.
1988 A central concept of TLS is that of certificates: as part of each
1989 network connection setup a (set of) certificates will be exchanged, and
1990 by using those the identity of the network peer can be cryptographically
1991 verified; if possible the TLS/SNI (ServerNameIndication) extension will
1992 be enabled in order to allow servers fine-grained control over the
1993 certificates being used.
1994 TLS works by using a locally installed pool of trusted certificates,
1995 and verifying the connection peer succeeds if that provides
1996 a certificate which has been issued or is trusted by any certificate in
1997 the trusted local pool.
2000 The local pool of trusted so-called CA (Certification Authority)
2001 certificates is usually delivered with the used TLS library, and
2002 will be selected automatically.
2003 It is also possible to use a specific pool of trusted certificates.
2005 .Va tls-ca-no-defaults
2006 should be set to avoid using the default certificate pool, and
2008 and/or (with special preparation)
2010 should be pointed to a trusted pool of certificates.
2011 A certificate cannot be more secure than the method its CA certificate
2012 has been retrieved with.
2013 For inspection or other purposes, the certificate of a server (as seen
2014 when connecting to it) can be fetched like this:
2016 .Bd -literal -offset indent
2017 $ </dev/null openssl s_client -showcerts -connect \e
2018 the-server.example:pop3s 2>&1 | tee log.txt
2022 \*(UA also supports a mode of operation in which certificates are not
2023 at all matched against a local pool of CA certificates.
2024 Instead a message digest will be calculated for the certificate
2025 presented by the connection peer, and be compared against
2027 (a variable chain that picks up
2031 context-dependent variable variants), and the connection will succeed if
2032 the calculated digest equals the expected one.
2033 The used message digest can be configured via (the chain)
2034 .Va tls-fingerprint-digest .
2040 It depends on the used protocol whether encrypted communication is
2041 possible, and which configuration steps have to be taken to enable it.
2042 Some protocols, e.g., POP3S, are implicitly encrypted, others, like
2043 POP3, can upgrade a plain text connection if so requested.
2044 For example, to use the
2046 that POP3 offers (a member of) the variable (chain)
2047 .Va pop3-use-starttls
2050 .Bd -literal -offset indent
2051 shortcut encpop1 pop3s://pop1.exam.ple
2053 shortcut encpop2 pop3://pop2.exam.ple
2054 set pop3-use-starttls-pop2.exam.ple
2056 set mta=smtps://smtp.exam.ple:465
2057 set mta=smtp://smtp.exam.ple smtp-use-starttls
2061 Normally that is all there is to do, given that TLS libraries try to
2062 provide safe defaults, plenty of knobs however exist to adjust settings.
2063 For example certificate verification settings can be fine-tuned via
2065 and the TLS configuration basics are accessible via
2066 .Va tls-config-pairs ,
2067 for example to specify the allowed protocols or cipher lists that
2068 a communication channel may use.
2069 In the past hints on how to restrict the set of protocols to highly
2070 secure ones were indicated, but as of the time of this writing the list
2071 of protocols or ciphers may need to become relaxed in order to be able
2072 to connect to some servers; the following example allows connecting to a
2074 that uses OpenSSL 0.9.8za from June 2014 (refer to
2075 .Sx "INTERNAL VARIABLES"
2076 for more on variable chains):
2078 .Bd -literal -offset indent
2079 wysh set tls-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
2080 CipherString=TLSv1.2:!aNULL:!eNULL:\e
2081 ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
2082 DHE-RSA-AES256-SHA:@STRENGTH'
2088 can be used and should be referred to when creating a custom cipher list.
2089 Variables of interest for TLS in general are
2093 .Va tls-ca-no-defaults ,
2094 .Va tls-config-file ,
2095 .Va tls-config-module ,
2096 .Va tls-config-pairs ,
2104 .\" .Ss "Character sets" {{{
2105 .Ss "Character sets"
2107 \*(OP \*(UA detects the character set of the terminal by using
2108 mechanisms that are controlled by the
2110 environment variable
2115 in that order, see there).
2116 The internal variable
2118 will be set to the detected terminal character set accordingly,
2119 and will thus show up in the output of commands like, e.g.,
2125 However, the user may give
2127 a value during startup, making it possible to send mail in a completely
2129 locale environment, an option which can be used to generate and send,
2130 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2132 environment (an example of this can be found in the section
2133 .Sx "On sending mail, and non-interactive mode" ) .
2134 Changing the value does not mean much beside that, because several
2135 aspects of the real character set are implied by the locale environment
2136 of the system, which stays unaffected by
2140 Messages and attachments which consist of 7-bit clean data will be
2141 classified as consisting of
2144 This is a problem if the
2146 character set is a multibyte character set that is also 7-bit clean.
2147 For example, the Japanese character set ISO-2022-JP is 7-bit clean but
2148 capable to encode the rich set of Japanese Kanji, Hiragana and Katakana
2149 characters: in order to notify receivers of this character set the mail
2150 message must be MIME encoded so that the character set ISO-2022-JP can
2152 To achieve this, the variable
2154 must be set to ISO-2022-JP.
2155 (Today a better approach regarding email is the usage of UTF-8, which
2156 uses 8-bit bytes for non-US-ASCII data.)
2159 If the \*(OPal character set conversion capabilities are not available
2161 does not include the term
2165 will be the only supported character set,
2166 it is simply assumed that it can be used to exchange 8-bit messages
2167 (over the wire an intermediate, configurable
2170 and the rest of this section does not apply;
2171 it may however still be necessary to explicitly set it if automatic
2172 detection fails, since in that case it defaults to
2173 .\" (Keep in SYNC: ./nail.1:"Character sets", ./config.h:CHARSET_*!)
2174 LATIN1 a.k.a. ISO-8859-1 unless the operating system environment is
2175 known to always and exclusively support UTF-8 locales.
2178 \*(OP When reading messages, their text is converted into
2180 as necessary in order to display them on the user's terminal.
2181 Unprintable characters and invalid byte sequences are detected
2182 and replaced by proper substitution characters.
2183 Character set mappings for source character sets can be established with
2186 which may be handy to work around faulty character set catalogues (e.g.,
2187 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
2188 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
2190 .Va charset-unknown-8bit
2191 to deal with another hairy aspect of message interpretation.
2194 When sending messages their parts and attachments are classified.
2195 Whereas no character set conversion is performed on those parts which
2196 appear to be binary data,
2197 the character set being used must be declared within the MIME header of
2198 an outgoing text part if it contains characters that do not conform to
2199 the set of characters that are allowed by the email standards.
2200 Permissible values for character sets used in outgoing messages can be
2205 which defines a catch-all last-resort fallback character set that is
2206 implicitly appended to the list of character sets in
2210 When replying to a message and the variable
2211 .Va reply-in-same-charset
2212 is set, then the character set of the message being replied to
2213 is tried first (still being a subject of
2214 .Ic charsetalias ) .
2215 And it is also possible to make \*(UA work even more closely related to
2216 the current locale setting automatically by using the variable
2217 .Va sendcharsets-else-ttycharset ,
2218 please see there for more information.
2221 All the specified character sets are tried in order unless the
2222 conversion of the part or attachment succeeds.
2223 If none of the tried (8-bit) character sets is capable to represent the
2224 content of the part or attachment,
2225 then the message will not be send and its text will optionally be
2229 In general, if a message saying
2230 .Dq cannot convert from a to b
2231 appears, either some characters are not appropriate for the currently
2232 selected (terminal) character set,
2233 or the needed conversion is not supported by the system.
2234 In the first case, it is necessary to set an appropriate
2236 locale and/or the variable
2240 The best results are usually achieved when \*(UA is run in a UTF-8
2241 locale on an 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"
2415 \*(NQ Commands which take
2416 .Sx "Message list arguments" ,
2424 can be given a list of message numbers as arguments to apply to a number
2425 of messages at once.
2428 deletes messages 1 and 2,
2431 will delete the messages 1 through 5.
2432 In sorted or threaded mode (see the
2436 will delete the messages that are located between (and including)
2437 messages 1 through 5 in the sorted/threaded order, as shown in the
2440 The following special message names exist:
2443 .Bl -tag -width ".It Ar BaNg"
2445 The current message, the so-called
2449 The message that was previously the current message; needs to be quoted.
2452 The parent message of the current message,
2453 that is the message with the Message-ID given in the
2455 field or the last entry of the
2457 field of the current message.
2460 The previous undeleted message, or the previous deleted message for the
2466 ed mode, the previous such message in the according order.
2469 The next undeleted message, or the next deleted message for the
2475 ed mode, the next such message in the according order.
2478 The first undeleted message,
2479 or the first deleted message for the
2485 ed mode, the first such message in the according order.
2488 The last message; In
2492 ed mode, the last such message in the according order.
2500 mode, selects the message addressed with
2504 is any other message specification,
2505 and all messages from the thread that begins at it.
2506 Otherwise it is identical to
2511 the thread beginning with the current message is selected.
2517 All messages that were included in the
2518 .Sx "Message list arguments"
2519 of the previous command; needs to be quoted.
2522 An inclusive range of message numbers.
2523 Selectors that may also be used as endpoints include any of
2528 .Dq any substring matches
2531 header, which will match addresses (too) even if
2533 is set (and POSIX says
2534 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2537 variable is set, only the local part of the address is evaluated
2538 for the comparison, not ignoring case, and the setting of
2540 is completely ignored.
2541 For finer control and match boundaries use the
2545 .It Ar / Ns Ar string
2546 All messages that contain
2548 in the subject field (case ignored according to locale).
2555 the string from the previous specification of that type is used again.
2558 .It Xo Op Ar @ Ns Ar name-list Ns
2561 All messages that contain the given case-insensitive search
2563 ession; If the \*(OPal regular expression support is available
2565 will be interpreted as (an extended) one if any of the
2567 regular expression characters
2572 .Ar @ Ns Ar name-list
2573 part is missing the search is restricted to the subject field body,
2576 specifies a comma-separated list of header fields to search, e.g.,
2579 .Dl '@to,from,cc@Someone i ought to know'
2582 In order to search for a string that includes a
2584 (commercial at) character the
2586 is effectively non-optional, but may be given as the empty string.
2587 Also, specifying an empty search
2589 ession will effectively test for existence of the given header fields.
2590 Some special header fields may be abbreviated:
2604 respectively and case-insensitively.
2605 \*(OPally, and just like
2608 will be interpreted as (an extended) regular expression if any of the
2610 regular expression characters is seen.
2617 can be used to search in (all of) the header(s) of the message, and the
2626 will perform full text searches \(en whereas the former searches only
2627 the body, the latter also searches the message header (\*(ID this mode
2628 yet brute force searches over the entire decoded content of messages,
2629 including administrativa strings).
2632 This specification performs full text comparison, but even with
2633 regular expression support it is almost impossible to write a search
2634 expression that safely matches only a specific address domain.
2635 To request that the body content of the header is treated as a list of
2636 addresses, and to strip those down to the plain email address which the
2637 search expression is to be matched against, prefix the effective
2643 .Dl '@~f,c@@a\e.safe\e.domain\e.match$'
2647 All messages of state or with matching condition
2651 is one or multiple of the following colon modifiers:
2653 .Bl -tag -compact -width ".It Ar :M"
2656 messages (cf. the variable
2657 .Va markanswered ) .
2669 Messages with receivers that match
2673 Messages with receivers that match
2680 Old messages (any not in state
2688 \*(OP Messages with unsure spam classification (see
2689 .Sx "Handling spam" ) .
2691 \*(OP Messages classified as spam.
2703 \*(OP IMAP-style SEARCH expressions may also be used.
2704 These consist of keywords and criterions, and because
2705 .Sx "Message list arguments"
2706 are split into tokens according to
2707 .Sx "Shell-style argument quoting"
2708 it is necessary to quote the entire IMAP search expression in order to
2709 ensure that it remains a single token.
2710 This addressing mode is available with all types of mailbox
2712 s; \*(UA will perform the search locally as necessary.
2713 Strings must be enclosed by double quotes
2715 in their entirety if they contain whitespace or parentheses;
2716 within the quotes, only reverse solidus
2718 is recognized as an escape character.
2719 All string searches are case-insensitive.
2720 When the description indicates that the
2722 representation of an address field is used,
2723 this means that the search string is checked against both a list
2726 .Bd -literal -offset indent
2727 \&'(\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)'
2732 and the addresses without real names from the respective header field.
2733 These search expressions can be nested using parentheses, see below for
2737 .Bl -tag -compact -width ".It Ar _n_u"
2738 .It Ar ( criterion )
2739 All messages that satisfy the given
2741 .It Ar ( criterion1 criterion2 ... criterionN )
2742 All messages that satisfy all of the given criteria.
2744 .It Ar ( or criterion1 criterion2 )
2745 All messages that satisfy either
2750 To connect more than two criteria using
2752 specifications have to be nested using additional parentheses,
2754 .Ql (or a (or b c)) ,
2758 .Ql ((a or b) and c) .
2761 operation of independent criteria on the lowest nesting level,
2762 it is possible to achieve similar effects by using three separate
2766 .It Ar ( not criterion )
2767 All messages that do not satisfy
2769 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2770 All messages that contain
2772 in the envelope representation of the
2775 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2776 All messages that contain
2778 in the envelope representation of the
2781 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2782 All messages that contain
2784 in the envelope representation of the
2787 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2788 All messages that contain
2793 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2794 All messages that contain
2796 in the envelope representation of the
2799 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2800 All messages that contain
2805 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2806 All messages that contain
2809 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2810 All messages that contain
2812 in their header or body.
2813 .It Ar ( larger size )
2814 All messages that are larger than
2817 .It Ar ( smaller size )
2818 All messages that are smaller than
2822 .It Ar ( before date )
2823 All messages that were received before
2825 which must be in the form
2829 denotes the day of the month as one or two digits,
2831 is the name of the month \(en one of
2832 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2835 is the year as four digits, e.g.,
2839 All messages that were received on the specified date.
2840 .It Ar ( since date )
2841 All messages that were received since the specified date.
2842 .It Ar ( sentbefore date )
2843 All messages that were sent on the specified date.
2844 .It Ar ( senton date )
2845 All messages that were sent on the specified date.
2846 .It Ar ( sentsince date )
2847 All messages that were sent since the specified date.
2849 The same criterion as for the previous search.
2850 This specification cannot be used as part of another criterion.
2851 If the previous command line contained more than one independent
2852 criterion then the last of those criteria is used.
2856 .\" .Ss "On terminal control and line editor" {{{
2857 .Ss "On terminal control and line editor"
2859 \*(OP Terminal control will be realized through one of the standard
2861 libraries, either the
2863 or, alternatively, the
2865 both of which will be initialized to work with the environment variable
2867 Terminal control will enhance or enable interactive usage aspects, e.g.,
2868 .Sx "Coloured display" ,
2869 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2870 byte-sequences of keys like the cursor- and function-keys.
2873 The internal variable
2875 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2876 Actual library interaction can be disabled completely by setting
2877 .Va termcap-disable ;
2879 will be queried regardless, which is true even if the \*(OPal library
2880 support has not been enabled at configuration time as long as some other
2881 \*(OP which (may) query terminal control sequences has been enabled.
2882 \*(UA can be told to enter an alternative exclusive screen, the
2883 so-called ca-mode, by setting
2884 .Va termcap-ca-mode ;
2885 this requires sufficient terminal support, and the used
2887 may also need special configuration, dependent on the value of
2891 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2892 environments which comply to the ISO C standard
2894 and will support wide glyphs if possible (the necessary functionality
2895 had been removed from ISO C, but was included in
2897 Usage of a line editor in interactive mode can be prevented by setting
2898 .Va line-editor-disable .
2899 Especially if the \*(OPal terminal control support is missing setting
2900 entries in the internal variable
2902 will help shall the MLE misbehave, see there for more.
2903 The MLE can support a little bit of
2909 feature is available then input from line editor prompts will be saved
2910 in a history list that can be searched in and be expanded from.
2911 Such saving can be prevented by prefixing input with any amount of
2913 Aspects of history, like allowed content and maximum size, as well as
2914 whether history shall be saved persistently, can be configured with the
2918 .Va history-gabby-persist
2923 The MLE supports a set of editing and control commands.
2924 By default (as) many (as possible) of these will be assigned to a set of
2925 single-letter control codes, which should work on any terminal (and can
2926 be generated by holding the
2928 key while pressing the key of desire, e.g.,
2932 command is available then the MLE commands can also be accessed freely
2933 by assigning the command name, which is shown in parenthesis in the list
2934 below, to any desired key-sequence, and the MLE will instead and also use
2936 to establish its built-in key bindings
2937 (more of them if the \*(OPal terminal control is available),
2938 an action which can then be suppressed completely by setting
2939 .Va line-editor-no-defaults .
2940 .Sx "Shell-style argument quoting"
2941 notation is used in the following;
2942 combinations not mentioned either cause job control signals or do not
2943 generate a (unique) keycode:
2947 .Bl -tag -compact -width ".It Ql \eBa"
2949 Go to the start of the line
2951 .Pf ( Cd mle-go-home ) .
2954 Move the cursor backward one character
2956 .Pf ( Cd mle-go-bwd ) .
2959 Forward delete the character under the cursor;
2960 quits \*(UA if used on the empty line unless the internal variable
2964 .Pf ( Cd mle-del-fwd ) .
2967 Go to the end of the line
2969 .Pf ( Cd mle-go-end ) .
2972 Move the cursor forward one character
2974 .Pf ( Cd mle-go-fwd ) .
2977 Cancel current operation, full reset.
2978 If there is an active history search or tabulator expansion then this
2979 command will first reset that, reverting to the former line content;
2980 thus a second reset is needed for a full reset in this case
2982 .Pf ( Cd mle-reset ) .
2985 Backspace: backward delete one character
2987 .Pf ( Cd mle-del-bwd ) .
2991 Horizontal tabulator:
2992 try to expand the word before the cursor, supporting the usual
2993 .Sx "Filename transformations"
2995 .Pf ( Cd mle-complete ;
2997 .Cd mle-quote-rndtrip ) .
3001 commit the current line
3003 .Pf ( Cd mle-commit ) .
3006 Cut all characters from the cursor to the end of the line
3008 .Pf ( Cd mle-snarf-end ) .
3013 .Pf ( Cd mle-repaint ) .
3016 \*(OP Go to the next history entry
3018 .Pf ( Cd mle-hist-fwd ) .
3021 (\*(OPally context-dependent) Invokes the command
3025 \*(OP Go to the previous history entry
3027 .Pf ( Cd mle-hist-bwd ) .
3030 Toggle roundtrip mode shell quotes, where produced,
3033 .Pf ( Cd mle-quote-rndtrip ) .
3034 This setting is temporary, and will be forgotten once the command line
3035 is committed; also see
3039 \*(OP Complete the current line from (the remaining) older history entries
3041 .Pf ( Cd mle-hist-srch-bwd ) .
3044 \*(OP Complete the current line from (the remaining) newer history entries
3046 .Pf ( Cd mle-hist-srch-fwd ) .
3049 Paste the snarf buffer
3051 .Pf ( Cd mle-paste ) .
3059 .Pf ( Cd mle-snarf-line ) .
3062 Prompts for a Unicode character (hexadecimal number without prefix, see
3066 .Pf ( Cd mle-prompt-char ) .
3067 Note this command needs to be assigned to a single-letter control code
3068 in order to become recognized and executed during input of
3069 a key-sequence (only three single-letter control codes can be used for
3070 that shortcut purpose); this control code is then special-treated and
3071 thus cannot be part of any other sequence (because it will trigger the
3073 function immediately).
3076 Cut the characters from the one preceding the cursor to the preceding
3079 .Pf ( Cd mle-snarf-word-bwd ) .
3082 Move the cursor forward one word boundary
3084 .Pf ( Cd mle-go-word-fwd ) .
3087 Move the cursor backward one word boundary
3089 .Pf ( Cd mle-go-word-bwd ) .
3092 Escape: reset a possibly used multibyte character input state machine
3093 and \*(OPally a lingering, incomplete key binding
3095 .Pf ( Cd mle-cancel ) .
3096 This command needs to be assigned to a single-letter control code in
3097 order to become recognized and executed during input of a key-sequence
3098 (only three single-letter control codes can be used for that shortcut
3100 This control code may also be part of a multi-byte sequence, but if
3101 a sequence is active and the very control code is currently also an
3102 expected input, then the active sequence takes precedence and will
3103 consume the control code.
3106 (\*(OPally context-dependent) Invokes the command
3110 (\*(OPally context-dependent) Invokes the command
3114 (\*(OPally context-dependent) Invokes the command
3118 Cut the characters from the one after the cursor to the succeeding word
3121 .Pf ( Cd mle-snarf-word-fwd ) .
3128 Move the cursor forward one screen width
3130 .Pf ( Cd mle-go-screen-fwd ) .
3133 Move the cursor backward one screen width
3135 .Pf ( Cd mle-go-screen-bwd ) .
3138 \*(OP Move the cursor home and clear the screen
3140 .Pf ( Cd mle-clear-screen ) .
3147 this will immediately reset a possibly active search etc.
3152 ring the audible bell.
3156 .\" .Ss "Coloured display" {{{
3157 .Ss "Coloured display"
3159 \*(OP \*(UA can be configured to support a coloured display and font
3160 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
3161 rendition) escape sequences.
3162 Usage of colours and font attributes solely depends upon the
3163 capability of the detected terminal type that is defined by the
3164 environment variable
3166 and which can be fine-tuned by the user via the internal variable
3170 On top of what \*(UA knows about the terminal the boolean variable
3172 defines whether the actually applicable colour and font attribute
3173 sequences should also be generated when output is going to be paged
3174 through the external program defined by the environment variable
3179 This is not enabled by default because different pager programs need
3180 different command line switches or other configuration in order to
3181 support those sequences.
3182 \*(UA however knows about some widely used pagers and in a clean
3183 environment it is often enough to simply set
3185 please refer to that variable for more on this topic.
3188 Colours and font attributes can be managed with the multiplexer command
3192 can be used to remove mappings of a given colour type.
3195 is set then any active usage of colour and font attribute sequences
3196 is suppressed without affecting possibly established
3199 Since colours are only available in interactive mode, it may make
3200 sense to conditionalize the colour setup by encapsulating it with
3203 .Bd -literal -offset indent
3204 if terminal && [ "$features" =% +colour ]
3205 colour iso view-msginfo ft=bold,fg=green
3206 colour iso view-header ft=bold,fg=red from,subject
3207 colour iso view-header fg=red
3209 uncolour iso view-header from,subject
3210 colour iso view-header ft=bold,fg=magenta,bg=cyan
3211 colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3212 colour mono view-header ft=bold
3213 colour mono view-header ft=bold,ft=reverse subject,from
3218 .\" .Ss "Handling spam" {{{
3221 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3222 identification of, and, in general, dealing with spam messages.
3223 A precondition of most commands in order to function is that the
3225 variable is set to one of the supported interfaces.
3226 .Sx "Specifying messages"
3227 that have been identified as spam is possible via their (volatile)
3233 specifications, and their
3235 entries will be used when displaying the
3243 rates the given messages and sets their
3246 If the spam interface offers spam scores these can be shown in
3255 will interact with the Bayesian filter of the chosen interface and learn
3256 the given messages as
3260 respectively; the last command can be used to cause
3262 of messages; it adheres to their current
3264 state and thus reverts previous teachings.
3269 will simply set and clear, respectively, the mentioned volatile
3271 message flag, without any interface interaction.
3280 requires a running instance of the
3282 server in order to function, started with the option
3284 shall Bayesian filter learning be possible.
3286 .Bd -literal -offset indent
3287 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3288 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3289 --daemonize [--local] [--allow-tell]
3293 Thereafter \*(UA can make use of these interfaces:
3295 .Bd -literal -offset indent
3296 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3297 -Sspamc-command=/usr/local/bin/spamc \e
3298 -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3300 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3301 -Sspamc-command=/usr/local/bin/spamc \e
3302 -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3306 Using the generic filter approach allows usage of programs like
3308 Here is an example, requiring it to be accessible via
3311 .Bd -literal -offset indent
3312 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3313 -Sspamfilter-ham="bogofilter -n" \e
3314 -Sspamfilter-noham="bogofilter -N" \e
3315 -Sspamfilter-nospam="bogofilter -S" \e
3316 -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3317 -Sspamfilter-spam="bogofilter -s" \e
3318 -Sspamfilter-rate-scanscore="1;^(.+)$"
3322 Because messages must exist on local storage in order to be scored (or
3323 used for Bayesian filter training), it is possibly a good idea to
3324 perform the local spam check last.
3325 Spam can be checked automatically when opening specific folders by
3326 setting a specialized form of the internal variable
3329 .Bd -literal -offset indent
3330 define spamdelhook {
3332 spamset (header x-dcc-brand-metrics "bulk")
3333 # Server-side spamassassin(1)
3334 spamset (header x-spam-flag "YES")
3335 del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3341 set folder-hook-SOMEFOLDER=spamdelhook
3345 See also the documentation for the variables
3346 .Va spam-interface , spam-maxsize ,
3347 .Va spamc-command , spamc-arguments , spamc-user ,
3348 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3351 .Va spamfilter-rate-scanscore .
3354 .\" }}} (DESCRIPTION)
3357 .\" .Sh COMMANDS {{{
3360 \*(UA reads input in lines.
3361 An unquoted reverse solidus
3363 at the end of a command line
3365 the newline character: it is discarded and the next line of input is
3366 used as a follow-up line, with all leading whitespace removed;
3367 once an entire line is completed, the whitespace characters
3368 .Cm space , tabulator , newline
3369 as well as those defined by the variable
3371 are removed from the beginning and end.
3372 Placing any whitespace characters at the beginning of a line will
3373 prevent a possible addition of the command line to the \*(OPal
3377 The beginning of such input lines is then scanned for the name of
3378 a known command: command names may be abbreviated, in which case the
3379 first command that matches the given prefix will be used.
3380 .Sx "Command modifiers"
3381 may prefix a command in order to modify its behaviour.
3382 A name may also be a
3384 which will become expanded until no more expansion is possible.
3385 Once the command that shall be executed is known, the remains of the
3386 input line will be interpreted according to command-specific rules,
3387 documented in the following.
3390 This behaviour is different to the
3392 ell, which is a programming language with syntactic elements of clearly
3393 defined semantics, and therefore capable to sequentially expand and
3394 evaluate individual elements of a line.
3395 \*(UA will never be able to handle
3396 .Ql ? set one=value two=$one
3397 in a single statement, because the variable assignment is performed by
3405 can be used to show the list of all commands, either alphabetically
3406 sorted or in prefix search order (these do not match, also because the
3407 POSIX standard prescribes a set of abbreviations).
3408 \*(OPally the command
3412 when given an argument, will show a documentation string for the
3413 command matching the expanded argument, as in
3415 which should be a shorthand of
3417 with these documentation strings both commands support a more
3419 listing mode which includes the argument type of the command and other
3420 information which applies; a handy suggestion might thus be:
3422 .Bd -literal -offset indent
3424 # Before v15: need to enable sh(1)ell-style on _entire_ line!
3425 localopts yes;wysh set verbose;ignerr eval "${@}";return ${?}
3427 ? commandalias xv '\ecall __xv'
3431 .\" .Ss "Command modifiers" {{{
3432 .Ss "Command modifiers"
3434 Commands may be prefixed by one or multiple command modifiers.
3435 Some command modifiers can be used with a restricted set of commands
3440 will (\*(OPally) show which modifiers apply.
3444 The modifier reverse solidus
3447 to be placed first, prevents
3449 expansions on the remains of the line, e.g.,
3451 will always evaluate the command
3453 even if an (command)alias of the same name exists.
3455 content may itself contain further command modifiers, including
3456 an initial reverse solidus to prevent further expansions.
3462 indicates that any error generated by the following command should be
3463 ignored by the state machine and not cause a program exit with enabled
3465 or for the standardized exit cases in
3470 .Sx "INTERNAL VARIABLES" ,
3471 will be set to the real exit status of the command regardless.
3476 will alter the called command to apply changes only temporarily,
3477 local to block-scope, and can thus only be used inside of a
3482 Specifying it implies the modifier
3484 Block-scope settings will not be inherited by macros deeper in the
3486 chain, and will be garbage collected once the current block is left.
3487 To record and unroll changes in the global scope use the command
3493 does yet not implement any functionality.
3498 does yet not implement any functionality.
3501 Some commands support the
3504 modifier: if used, they expect the name of a variable, which can itself
3505 be a variable, i.e., shell expansion is applied, as their first
3506 argument, and will place their computation result in it instead of the
3507 default location (it is usually written to standard output).
3509 The given name will be tested for being a valid
3511 variable name, and may therefore only consist of upper- and lowercase
3512 characters, digits, and the underscore; the hyphen-minus may be used as
3513 a non-portable extension; digits may not be used as first, hyphen-minus
3514 may not be used as last characters.
3515 In addition the name may either not be one of the known
3516 .Sx "INTERNAL VARIABLES" ,
3517 or must otherwise refer to a writable (non-boolean) value variable.
3518 The actual put operation may fail nonetheless, e.g., if the variable
3519 expects a number argument only a number will be accepted.
3520 Any error during these operations causes the command as such to fail,
3521 and the error number
3524 .Va ^ERR Ns -NOTSUP ,
3529 but some commands deviate from the latter, which is documented.
3532 Last, but not least, the modifier
3535 can be used for some old and established commands to choose the new
3536 .Sx "Shell-style argument quoting"
3537 rules over the traditional
3538 .Sx "Old-style argument quoting" .
3542 .\" .Ss "Old-style argument quoting" {{{
3543 .Ss "Old-style argument quoting"
3545 \*(ID This section documents the old, traditional style of quoting
3546 non-message-list arguments to commands which expect this type of
3547 arguments: whereas still used by the majority of such commands, the new
3548 .Sx "Shell-style argument quoting"
3549 may be available even for those via
3552 .Sx "Command modifiers" .
3553 Nonetheless care must be taken, because only new commands have been
3554 designed with all the capabilities of the new quoting rules in mind,
3555 which can, e.g., generate control characters.
3558 .Bl -bullet -offset indent
3560 An argument can be enclosed between paired double-quotes
3565 any whitespace, shell word expansion, or reverse solidus characters
3566 (except as described next) within the quotes are treated literally as
3567 part of the argument.
3568 A double-quote will be treated literally within single-quotes and vice
3570 Inside such a quoted string the actually used quote character can be
3571 used nonetheless by escaping it with a reverse solidus
3577 An argument that is not enclosed in quotes, as above, can usually still
3578 contain space characters if those spaces are reverse solidus escaped, as in
3582 A reverse solidus outside of the enclosing quotes is discarded
3583 and the following character is treated literally as part of the argument.
3587 .\" .Ss "Shell-style argument quoting" {{{
3588 .Ss "Shell-style argument quoting"
3591 ell-style, and therefore POSIX standardized, argument parsing and
3592 quoting rules are used by most commands.
3593 \*(ID Most new commands only support these new rules and are flagged
3594 \*(NQ, some elder ones can use them with the command modifier
3596 in the future only this type of argument quoting will remain.
3599 A command line is parsed from left to right and an input token is
3600 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3601 Metacharacters are vertical bar
3607 as well as all characters from the variable
3610 .Cm space , tabulator , newline .
3611 The additional metacharacters left and right parenthesis
3613 and less-than and greater-than signs
3617 supports are not used, and are treated as ordinary characters: for one
3618 these characters are a vivid part of email addresses, and it seems
3619 highly unlikely that their function will become meaningful to \*(UA.
3621 .Bd -filled -offset indent
3622 .Sy Compatibility note:
3623 \*(ID Please note that even many new-style commands do not yet honour
3625 to parse their arguments: whereas the
3627 ell is a language with syntactic elements of clearly defined semantics,
3628 \*(UA parses entire input lines and decides on a per-command base what
3629 to do with the rest of the line.
3630 This also means that whenever an unknown command is seen all that \*(UA
3631 can do is cancellation of the processing of the remains of the line.
3633 It also often depends on an actual subcommand of a multiplexer command
3634 how the rest of the line should be treated, and until v15 we are not
3635 capable to perform this deep inspection of arguments.
3636 Nonetheless, at least the following commands which work with positional
3637 parameters fully support
3639 for an almost shell-compatible field splitting:
3640 .Ic call , call_if , read , vpospar , xcall .
3644 Any unquoted number sign
3646 at the beginning of a new token starts a comment that extends to the end
3647 of the line, and therefore ends argument processing.
3648 An unquoted dollar sign
3650 will cause variable expansion of the given name, which must be a valid
3652 ell-style variable name (see
3654 .Sx "INTERNAL VARIABLES"
3657 (shell) variables can be accessed through this mechanism, brace
3658 enclosing the name is supported (i.e., to subdivide a token).
3661 Whereas the metacharacters
3662 .Cm space , tabulator , newline
3663 only complete an input token, vertical bar
3669 also act as control operators and perform control functions.
3670 For now supported is semicolon
3672 which terminates a single command, therefore sequencing the command line
3673 and making the remainder of the line a subject to reevaluation.
3674 With sequencing, multiple command argument types and quoting rules may
3675 therefore apply to a single line, which can become problematic before
3676 v15: e.g., the first of the following will cause surprising results.
3679 .Dl ? echo one; set verbose; echo verbose=$verbose.
3680 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3683 Quoting is a mechanism that will remove the special meaning of
3684 metacharacters and reserved words, and will prevent expansion.
3685 There are four quoting mechanisms: the escape character, single-quotes,
3686 double-quotes and dollar-single-quotes:
3689 .Bl -bullet -offset indent
3691 The literal value of any character can be preserved by preceding it
3692 with the escape character reverse solidus
3696 Arguments which are enclosed in
3697 .Ql 'single-\:quotes'
3698 retain their literal value.
3699 A single-quote cannot occur within single-quotes.
3702 The literal value of all characters enclosed in
3703 .Ql \(dqdouble-\:quotes\(dq
3704 is retained, with the exception of dollar sign
3706 which will cause variable expansion, as above, backquote (grave accent)
3708 (which not yet means anything special), reverse solidus
3710 which will escape any of the characters dollar sign
3712 (to prevent variable expansion), backquote (grave accent)
3716 (to prevent ending the quote) and reverse solidus
3718 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3719 but has no special meaning otherwise.
3722 Arguments enclosed in
3723 .Ql $'dollar-\:single-\:quotes'
3724 extend normal single quotes in that reverse solidus escape sequences are
3725 expanded as follows:
3727 .Bl -tag -compact -width ".Ql \eNNN"
3729 bell control character (ASCII and ISO-10646 BEL).
3731 backspace control character (ASCII and ISO-10646 BS).
3733 escape control character (ASCII and ISO-10646 ESC).
3737 form feed control character (ASCII and ISO-10646 FF).
3739 line feed control character (ASCII and ISO-10646 LF).
3741 carriage return control character (ASCII and ISO-10646 CR).
3743 horizontal tabulator control character (ASCII and ISO-10646 HT).
3745 vertical tabulator control character (ASCII and ISO-10646 VT).
3747 emits a reverse solidus character.
3751 double quote (escaping is optional).
3753 eight-bit byte with the octal value
3755 (one to three octal digits), optionally prefixed by an additional
3757 A 0 byte will suppress further output for the quoted argument.
3759 eight-bit byte with the hexadecimal value
3761 (one or two hexadecimal characters, no prefix, see
3763 A 0 byte will suppress further output for the quoted argument.
3765 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3767 (one to eight hexadecimal characters) \(em note that Unicode defines the
3768 maximum codepoint ever to be supported as
3773 This escape is only supported in locales that support Unicode (see
3774 .Sx "Character sets" ) ,
3775 in other cases the sequence will remain unexpanded unless the given code
3776 point is ASCII compatible or (if the \*(OPal character set conversion is
3777 available) can be represented in the current locale.
3778 The character NUL will suppress further output for the quoted argument.
3782 except it takes only one to four hexadecimal characters.
3784 Emits the non-printable (ASCII and compatible) C0 control codes
3785 0 (NUL) to 31 (US), and 127 (DEL).
3786 Printable representations of ASCII control codes can be created by
3787 mapping them to a different, visible part of the ASCII character set.
3788 Adding the number 64 achieves this for the codes 0 to 31, e.g., 7 (BEL):
3789 .Ql 7 + 64 = 71 = G .
3790 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3792 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3793 .Ql ? vexpr ^ 127 64 .
3795 Whereas historically circumflex notation has often been used for
3796 visualization purposes of control codes, e.g.,
3798 the reverse solidus notation has been standardized:
3800 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3801 as shown above (e.g.,
3805 whenever such an alias exists it will be used for display purposes.
3806 The control code NUL
3808 a non-standard extension) will suppress further output for the remains
3809 of the token (which may extend beyond the current quote), or, depending
3810 on the context, the remains of all arguments for the current command.
3812 Non-standard extension: expand the given variable name, as above.
3813 Brace enclosing the name is supported.
3815 Not yet supported, just to raise awareness: Non-standard extension.
3822 .Bd -literal -offset indent
3823 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3824 ? echo Quotes ${HOME} and tokens differ! # comment
3825 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3829 .\" .Ss "Message list arguments" {{{
3830 .Ss "Message list arguments"
3832 Many commands operate on message list specifications, as documented in
3833 .Sx "Specifying messages" .
3834 The argument input is first split into individual tokens via
3835 .Sx "Shell-style argument quoting" ,
3836 which are then interpreted as the mentioned specifications.
3837 If no explicit message list has been specified, many commands will
3838 search for and use the next message forward that satisfies the commands'
3839 requirements, and if there are no messages forward of the current
3840 message, the search proceeds backwards;
3841 if there are no good messages at all to be found, an error message is
3842 shown and the command is aborted.
3845 output of the command
3847 will indicate whether a command searches for a default message, or not.
3850 .\" .Ss "Raw data arguments for codec commands" {{{
3851 .Ss "Raw data arguments for codec commands"
3853 A special set of commands, which all have the string
3855 in their name, e.g.,
3859 take raw string data as input, which means that the content of the
3860 command input line is passed completely unexpanded and otherwise
3861 unchanged: like this the effect of the actual codec is visible without
3862 any noise of possible shell quoting rules etc., i.e., the user can input
3863 one-to-one the desired or questionable data.
3864 To gain a level of expansion, the entire command line can be
3868 .Bd -literal -offset indent
3869 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3871 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3873 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3874 ? eval shcodec d $res
3875 /usr/Sch\[:o]nes Wetter/heute.txt
3879 .\" .Ss "Filename transformations" {{{
3880 .Ss "Filename transformations"
3882 Filenames, where expected, and unless documented otherwise, are
3883 subsequently subject to the following filename transformations, in
3886 .Bl -bullet -offset indent
3888 If the given name is a registered
3890 it will be replaced with the expanded shortcut.
3893 The filename is matched against the following patterns or strings:
3895 .Bl -hang -compact -width ".Ar %user"
3897 (Number sign) is expanded to the previous file.
3899 (Percent sign) is replaced by the invoking
3900 .Mx -ix "primary system mailbox"
3901 user's primary system mailbox, which either is the (itself expandable)
3903 if that is set, the standardized absolute pathname indicated by
3905 if that is set, or a built-in compile-time default otherwise.
3907 Expands to the primary system mailbox of
3909 (and never the value of
3911 regardless of its actual setting).
3913 (Ampersand) is replaced with the invoking user's
3914 .Mx -ix "secondary mailbox"
3915 secondary mailbox, the
3922 directory (if that variable is set).
3924 Expands to the same value as
3926 but has special meaning when used with, e.g., the command
3928 the file will be treated as a primary system mailbox by, e.g., the
3932 commands, meaning that messages that have been read in the current
3933 session will be moved to the
3935 mailbox instead of simply being flagged as read.
3939 Meta expansions may be applied to the resulting filename, as allowed by
3940 the operation and applicable to the resulting access protocol (also see
3941 .Sx "On URL syntax and credential lookup" ) .
3942 For the file-protocol, a leading tilde
3944 character will be replaced by the expansion of
3946 except when followed by a valid user name, in which case the home
3947 directory of the given user is used instead.
3949 A shell expansion as if specified in double-quotes (see
3950 .Sx "Shell-style argument quoting" )
3951 may be applied, so that any occurrence of
3955 will be replaced by the expansion of the variable, if possible;
3956 .Sx "INTERNAL VARIABLES"
3959 (shell) variables can be accessed through this mechanism.
3961 Shell pathname wildcard pattern expansions
3963 may be applied as documented.
3964 If the fully expanded filename results in multiple pathnames and the
3965 command is expecting only one file, an error results.
3967 In interactive context, in order to allow simple value acceptance (via
3969 arguments will usually be displayed in a properly quoted form, e.g., a file
3970 .Ql diet\e is \ecurd.txt
3972 .Ql 'diet\e is \ecurd.txt' .
3976 .\" .Ss "Commands" {{{
3979 The following commands are available:
3981 .Bl -tag -width ".It Ic BaNg"
3988 command which follows, replacing unescaped exclamation marks with the
3989 previously executed command if the internal variable
3992 This command supports
3995 .Sx "Command modifiers" ,
3996 and manages the error number
3998 A 0 or positive exit status
4000 reflects the exit status of the command, negative ones that
4001 an error happened before the command was executed, or that the program
4002 did not exit cleanly, but, e.g., due to a signal: the error number is
4003 .Va ^ERR Ns -CHILD ,
4007 In conjunction with the
4009 modifier the following special cases exist:
4010 a negative exit status occurs if the collected data could not be stored
4011 in the given variable, which is a
4013 error that should otherwise not occur.
4014 .Va ^ERR Ns -CANCELED
4015 indicates that no temporary file could be created to collect the command
4016 output at first glance.
4017 In case of catchable out-of-memory situations
4019 will occur and \*(UA will try to store the empty string, just like with
4020 all other detected error conditions.
4025 The comment-command causes the entire line to be ignored.
4027 this really is a normal command which' purpose is to discard its
4030 indicating special character, which means that, e.g., trailing comments
4031 on a line are not possible (except for commands which use
4032 .Sx "Shell-style argument quoting" ) .
4036 Goes to the next message in sequence and types it
4042 Display the preceding message, or the n'th previous message if given
4043 a numeric argument n.
4047 Shows the message number of the current message (the
4049 when used without arguments, that of the given list otherwise.
4050 Output numbers will be separated from each other with the first
4053 and followed by the first character of
4055 if that is not empty and not identical to the first.
4056 If that results in no separation at all a
4059 This command supports
4062 .Sx "Command modifiers" ) ,
4063 and manages the error number
4068 \*(OP Show a brief summary of commands.
4069 \*(OP Given an argument a synopsis for the command in question is
4070 shown instead; commands can be abbreviated in general and this command
4071 can be used to see the full expansion of an abbreviation including the
4072 synopsis, try, e.g.,
4077 and see how the output changes.
4078 This mode also supports a more
4080 output, which will provide the information documented for
4091 .It Ic account , unaccount
4092 (ac, una) Creates, selects or lists (an) account(s).
4093 Accounts are special incarnations of
4095 macros and group commands and variable settings which together usually
4096 arrange the environment for the purpose of creating an email account.
4097 Different to normal macros settings which are covered by
4099 \(en here by default enabled! \(en will not be reverted before the
4104 (case-insensitive) always exists, and all but it can be deleted by the
4105 latter command, and in one operation with the special name
4107 Also for all but it a possibly set
4108 .Va on-account-cleanup
4109 hook is called once they are left.
4111 Without arguments a listing of all defined accounts is shown.
4112 With one argument the given account is activated: the system
4114 of that account will be activated (as via
4116 a possibly installed
4118 will be run, and the internal variable
4121 The two argument form is identical to defining a macro as via
4123 .Bd -literal -offset indent
4125 set folder=~/mail inbox=+syste.mbox record=+sent.mbox
4126 set from='(My Name) myname@myisp.example'
4127 set mta=smtp://mylogin@smtp.myisp.example
4134 Perform email address codec transformations on raw-data argument, rather
4135 according to email standards (RFC 5322; \*(ID will furtherly improve).
4139 .Sx "Command modifiers" ) ,
4140 and manages the error number
4142 The first argument must be either
4143 .Ar [+[+[+]]]e[ncode] ,
4148 and specifies the operation to perform on the rest of the line.
4151 Decoding will show how a standard-compliant MUA will display the given
4152 argument, which should be an email address.
4153 Please be aware that most MUAs have difficulties with the address
4154 standards, and vary wildly when (comments) in parenthesis,
4156 strings, or quoted-pairs, as below, become involved.
4157 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4160 Skinning is identical to decoding but only outputs the plain address,
4161 without any string, comment etc. components.
4162 Another difference is that it may fail with the error number
4166 if decoding fails to find a(n) (valid) email address, in which case the
4167 unmodified input will be output again.
4171 first performs a skin operation, and thereafter checks a valid
4172 address for whether it is a registered mailing list (see
4176 eventually reporting that state in the error number
4179 .Va ^ERR Ns -EXIST .
4180 (This state could later become overwritten by an I/O error, though.)
4183 Encoding supports four different modes, lesser automated versions can be
4184 chosen by prefixing one, two or three plus signs: the standard imposes
4185 a special meaning on some characters, which thus have to be transformed
4186 to so-called quoted-pairs by pairing them with a reverse solidus
4188 in order to remove the special meaning; this might change interpretation
4189 of the entire argument from what has been desired, however!
4190 Specify one plus sign to remark that parenthesis shall be left alone,
4191 two for not turning double quotation marks into quoted-pairs, and three
4192 for also leaving any user-specified reverse solidus alone.
4193 The result will always be valid, if a successful exit status is reported
4194 (\*(ID the current parser fails this assertion for some constructs).
4195 \*(ID Addresses need to be specified in between angle brackets
4198 if the construct becomes more difficult, otherwise the current parser
4199 will fail; it is not smart enough to guess right.
4201 .Bd -literal -offset indent
4202 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4203 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4204 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4205 "Hey, you", \e out\e there <diet@exam.ple>
4206 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4213 .It Ic alias , unalias
4214 (a, una) Aliases are a method of creating personal distribution lists
4215 that map a single alias name to none to multiple real receivers;
4216 these aliases become expanded after message composing is completed.
4217 The latter command removes the given list of aliases, the special name
4219 will discard all existing aliases.
4221 The former command shows all currently defined aliases when used without
4222 arguments, and with one argument the expansion of the given alias.
4223 With more than one argument, creates or appends to the alias name given
4224 as the first argument the remaining arguments.
4225 Alias names adhere to the Postfix MTA
4227 rules and are thus restricted to alphabetic characters, digits, the
4228 underscore, hyphen-minus, the number sign, colon and commercial at,
4229 a dollar sign is allowed but in the first position;
4230 As extensions the exclamation mark
4235 .Dq any haracter that has the high bit set
4237 .Ql [[:alnum:]_#:@-][[:alnum:]_#:@$;.-]* .
4239 .\" ALIASCOLON next sentence
4240 \*(ID Unfortunately the colon is currently not supported, as it
4241 interferes with normal address parsing rules.
4242 .\" ALIASCOLON next sentence
4243 \*(ID Such high bit characters will likely cause warnings at the moment
4244 for the same reasons why colon is unsupported; also, in the future
4245 locale dependent character set validity checks will be performed.
4249 .It Ic alternates , unalternates
4250 \*(NQ (alt) Manage a list of alternate addresses or names of the active
4251 user, members of which will be removed from recipient lists (except one).
4252 There is a set of implicit alternates which is formed of the values of
4262 The latter command removes the given list of alternates, the special name
4264 will discard all existing alternate names.
4266 The former command manages the error number
4268 It shows the current set of alternates when used without arguments; in
4269 this mode only it also supports
4272 .Sx "Command modifiers" ) .
4273 Otherwise the given arguments (after being checked for validity) are
4274 appended to the list of alternate names; in
4276 mode they replace that list instead.
4280 .It Ic answered , unanswered
4281 Take a message lists and mark each message as (not) having been answered.
4282 Messages will be marked answered when being
4284 to automatically if the
4288 .Sx "Message states" .
4293 .It Ic bind , unbind
4294 \*(OP\*(NQ The bind command extends the MLE (see
4295 .Sx "On terminal control and line editor" )
4296 with freely configurable key bindings.
4297 The latter command removes from the given context the given key binding,
4298 both of which may be specified as a wildcard
4302 will remove all bindings of all contexts.
4303 Due to initialization order unbinding will not work for built-in key
4304 bindings upon program startup, however: please use
4305 .Va line-editor-no-defaults
4306 for this purpose instead.
4309 With one argument the former command shows all key bindings for the
4310 given context, specifying an asterisk
4312 will show the bindings of all contexts; a more verbose listing will be
4313 produced if either of
4318 With two or more arguments a binding is (re)established:
4319 the first argument is the context to which the binding shall apply,
4320 the second argument is a comma-separated list of the
4322 which form the binding, and any remaining arguments form the expansion.
4323 To indicate that a binding shall not be auto-committed, but that the
4324 expansion shall instead be furtherly editable by the user, a commercial at
4326 (that will be removed) can be placed last in the expansion, from which
4327 leading and trailing whitespace will finally be removed.
4328 Reverse solidus cannot be used as the last character of expansion.
4331 Contexts define when a binding applies, i.e., a binding will not be seen
4332 unless the context for which it is defined for is currently active.
4333 This is not true for the shared binding
4335 which is the foundation for all other bindings and as such always
4336 applies, its bindings, however, only apply secondarily.
4337 The available contexts are the shared
4341 context which is used in all not otherwise documented situations, and
4343 which applies to compose mode only.
4347 which form the binding are specified as a comma-separated list of
4348 byte-sequences, where each list entry corresponds to one key(press).
4349 A list entry may, indicated by a leading colon character
4351 also refer to the name of a terminal capability; several dozen names
4352 will be compiled in and may be specified either by their
4354 or, if existing, by their
4356 name, regardless of the actually used \*(OPal terminal control library.
4357 It is possible to use any capability, as long as the name is resolvable
4358 by the \*(OPal control library or was defined via the internal variable
4360 Input sequences are not case-normalized, so that an exact match is
4361 required to update or remove a binding.
4364 .Bd -literal -offset indent
4365 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4366 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc,Delete
4367 ? bind default $'\ecA',:khome,w 'echo Editable binding@'
4368 ? bind default a,b,c rm -irf / @ # Also editable
4369 ? bind default :kf1 File %
4370 ? bind compose :kf1 ~v
4374 Note that the entire comma-separated list is first parsed (over) as a
4375 shell-token with whitespace as the field separator, before being parsed
4376 and expanded for real with comma as the field separator, therefore
4377 whitespace needs to be properly quoted, see
4378 .Sx "Shell-style argument quoting" .
4379 Using Unicode reverse solidus escape sequences renders a binding
4380 defunctional if the locale does not support Unicode (see
4381 .Sx "Character sets" ) ,
4382 and using terminal capabilities does so if no (corresponding) terminal
4383 control support is (currently) available.
4386 The following terminal capability names are built-in and can be used in
4388 or (if available) the two-letter
4391 See the respective manual for a list of capabilities.
4394 can be used to show all the capabilities of
4396 or the given terminal type;
4399 flag will also show supported (non-standard) extensions.
4402 .Bl -tag -compact -width kcuuf_or_kcuuf
4403 .It Cd kbs Ns \0or Cd kb
4405 .It Cd kdch1 Ns \0or Cd kD
4407 .It Cd kDC Ns \0or Cd *4
4408 \(em shifted variant.
4409 .It Cd kel Ns \0or Cd kE
4410 Clear to end of line.
4411 .It Cd kext Ns \0or Cd @9
4413 .It Cd kich1 Ns \0or Cd kI
4415 .It Cd kIC Ns \0or Cd #3
4416 \(em shifted variant.
4417 .It Cd khome Ns \0or Cd kh
4419 .It Cd kHOM Ns \0or Cd #2
4420 \(em shifted variant.
4421 .It Cd kend Ns \0or Cd @7
4423 .It Cd knp Ns \0or Cd kN
4425 .It Cd kpp Ns \0or Cd kP
4427 .It Cd kcub1 Ns \0or Cd kl
4428 Left cursor (with more modifiers: see below).
4429 .It Cd kLFT Ns \0or Cd #4
4430 \(em shifted variant.
4431 .It Cd kcuf1 Ns \0or Cd kr
4432 Right cursor (ditto).
4433 .It Cd kRIT Ns \0or Cd %i
4434 \(em shifted variant.
4435 .It Cd kcud1 Ns \0or Cd kd
4436 Down cursor (ditto).
4438 \(em shifted variant (only terminfo).
4439 .It Cd kcuu1 Ns \0or Cd ku
4442 \(em shifted variant (only terminfo).
4443 .It Cd kf0 Ns \0or Cd k0
4445 Add one for each function key up to
4450 .It Cd kf10 Ns \0or Cd k;
4452 .It Cd kf11 Ns \0or Cd F1
4454 Add one for each function key up to
4462 Some terminals support key-modifier combination extensions, e.g.,
4464 For example, the delete key,
4466 in its shifted variant, the name is mutated to
4468 then a number is appended for the states
4480 .Ql Shift+Alt+Control
4482 The same for the left cursor key,
4484 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4487 It is advisable to use an initial escape or other control character (e.g.,
4489 for bindings which describe user key combinations (as opposed to purely
4490 terminal capability based ones), in order to avoid ambiguities whether
4491 input belongs to key sequences or not; it also reduces search time.
4494 may help shall keys and sequences be falsely recognized.
4499 \*(NQ Calls the given macro, which must have been created via
4501 (see there for more), otherwise an
4504 Calling macros recursively will at some time excess the stack size
4505 limit, causing a hard program abortion; if recursively calling a macro
4506 is the last command of the current macro, consider to use the command
4508 which will first release all resources of the current macro before
4509 replacing the current macro with the called one.
4516 if the given macro has been created via
4518 but does not fail nor warn if the macro does not exist.
4522 (ch) Change the working directory to
4524 or the given argument.
4530 \*(OP Only applicable to S/MIME signed messages.
4531 Takes an optional message list and a filename and saves the certificates
4532 contained within the message signatures to the named file in both
4533 human-readable and PEM format.
4534 The certificates can later be used to send encrypted messages to the
4535 respective message senders by setting
4536 .Va smime-encrypt-USER@HOST
4541 .It Ic charsetalias , uncharsetalias
4542 \*(NQ Manage alias mappings for (conversion of)
4543 .Sx "Character sets" .
4544 Mappings are ineffective if character set conversion is not available
4548 Expansion happens recursively, but expansion is not performed for
4549 .Sx "INTERNAL VARIABLES" ,
4553 The latter command deletes all aliases given as arguments,
4554 all aliases can be deleted at once with the special argument
4556 The former shows the list of all currently defined aliases if used
4557 without arguments, the expansion of the given alias with one argument.
4558 Otherwise all given arguments are treated as pairs of character sets and
4559 their desired target alias name, creating new or changing already
4560 existing aliases, as necessary.
4564 (ch) Change the working directory to
4566 or the given argument.
4572 .It Ic collapse , uncollapse
4578 Takes a message list and makes all replies to these messages invisible
4579 in header summaries, except for
4583 Also when a message with collapsed replies is displayed,
4584 all of these are automatically uncollapsed.
4585 The latter command undoes collapsing.
4588 .\" FIXME review until this point
4591 .It Ic colour , uncolour
4592 \*(OP\*(NQ Manage colour mappings of and for a
4593 .Sx "Coloured display" .
4594 The type of colour is given as the (case-insensitive) first argument,
4595 which must be one of
4597 for 256-colour terminals,
4602 for the standard 8-colour ANSI / ISO 6429 colour palette and
4606 for monochrome terminals.
4607 Monochrome terminals cannot deal with colours, but only (some) font
4611 Without further arguments the list of all currently defined mappings
4612 for the given colour type is shown (as a special case giving
4616 will show the mappings of all types).
4617 Otherwise the second argument defines the mappable slot, and the third
4618 argument a (comma-separated list of) colour and font attribute
4619 specification(s), and the optional fourth argument can be used to
4620 specify a precondition: if conditioned mappings exist they are tested in
4621 (creation) order unless a (case-insensitive) match has been found, and
4622 the default mapping (if any has been established) will only be chosen as
4624 The types of precondition available depend on the mappable slot (see
4625 .Sx "Coloured display"
4626 for some examples), the following of which exist:
4629 Mappings prefixed with
4631 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4632 .Sx "On terminal control and line editor" )
4633 and do not support preconditions.
4635 .Bl -tag -compact -width view-partinfo
4637 This mapping is used for the position indicator that is visible when
4638 a line cannot be fully displayed on the screen.
4645 Mappings prefixed with
4647 are used in header summaries, and they all understand the preconditions
4649 (the current message) and
4651 for elder messages (only honoured in conjunction with
4652 .Va datefield-markout-older ) .
4654 .Bl -tag -compact -width view-partinfo
4656 This mapping is used for the
4658 that can be created with the
4662 formats of the variable
4665 For the complete header summary line except the
4667 and the thread structure.
4669 For the thread structure which can be created with the
4671 format of the variable
4676 Mappings prefixed with
4678 are used when displaying messages.
4680 .Bl -tag -compact -width view-partinfo
4682 This mapping is used for so-called
4684 lines, which are MBOX file format specific header lines.
4687 A comma-separated list of headers to which the mapping applies may be
4688 given as a precondition; if the \*(OPal regular expression support is
4689 available then if any of the
4691 (extended) regular expression characters is seen the precondition will
4692 be evaluated as (an extended) one.
4694 For the introductional message info line.
4695 .It Ar view-partinfo
4696 For MIME part info lines.
4700 The following (case-insensitive) colour definitions and font attributes
4701 are understood, multiple of which can be specified in a comma-separated
4711 It is possible (and often applicable) to specify multiple font
4712 attributes for a single mapping.
4715 foreground colour attribute:
4725 To specify a 256-colour mode a decimal number colour specification in
4726 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4728 .Bl -tag -compact -width "999 - 999"
4730 the standard ISO 6429 colours, as above.
4732 high intensity variants of the standard colours.
4734 216 colours in tuples of 6.
4736 grayscale from black to white in 24 steps.
4738 .Bd -literal -offset indent
4740 fg() { printf "\e033[38;5;${1}m($1)"; }
4741 bg() { printf "\e033[48;5;${1}m($1)"; }
4743 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4744 printf "\e033[0m\en"
4746 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4747 printf "\e033[0m\en"
4751 background colour attribute (see
4753 for possible values).
4759 will remove for the given colour type (the special type
4761 selects all) the given mapping; if the optional precondition argument is
4762 given only the exact tuple of mapping and precondition is removed.
4765 will remove all mappings (no precondition allowed), thus
4767 will remove all established mappings.
4772 .It Ic commandalias , uncommandalias
4773 \*(NQ Define or list, and remove, respectively, command aliases.
4774 An (command)alias can be used everywhere a normal command can be used,
4775 but always takes precedence: any arguments that are given to the command
4776 alias are joined onto the alias expansion, and the resulting string
4777 forms the command line that is, in effect, executed.
4778 The latter command removes all given aliases, the special name
4780 will remove all existing aliases.
4781 When used without arguments the former shows a list of all currently
4782 known aliases, with one argument only the expansion of the given one.
4784 With two or more arguments a command alias is defined or updated: the
4785 first argument is the name under which the remaining command line should
4786 be accessible, the content of which can be just about anything.
4787 An alias may itself expand to another alias, but to avoid expansion loops
4788 further expansion will be prevented if an alias refers to itself or if
4789 an expansion depth limit is reached.
4790 Explicit expansion prevention is available via reverse solidus
4793 .Sx "Command modifiers" .
4794 .Bd -literal -offset indent
4796 \*(uA: `commandalias': no such alias: xx
4797 ? commandalias xx echo hello,
4799 commandalias xx 'echo hello,'
4808 (C) Copy messages to files whose names are derived from the author of
4809 the respective message and do not mark them as being saved;
4810 otherwise identical to
4815 (c) Copy messages to the named file and do not mark them as being saved;
4816 otherwise identical to
4821 Show the name of the current working directory, as reported by
4826 .Sx "Command modifiers" ) .
4827 The return status is tracked via
4832 \*(OP For unencrypted messages this command is identical to
4834 Encrypted messages are first decrypted, if possible, and then copied.
4838 \*(OP For unencrypted messages this command is identical to
4840 Encrypted messages are first decrypted, if possible, and then copied.
4845 .It Ic define , undefine
4846 The latter command deletes the given macro, the special name
4848 will discard all existing macros.
4849 Deletion of (a) macro(s) can be performed from within running (a)
4850 macro(s), including self-deletion.
4851 Without arguments the former command prints the current list of macros,
4852 including their content, otherwise it defines a macro, replacing an
4853 existing one of the same name as applicable.
4856 A defined macro can be invoked explicitly by using the
4861 commands, or implicitly if a macro hook is triggered, e.g., a
4863 Execution of a macro body can be stopped from within by calling
4867 Temporary macro block-scope variables can be created or deleted with the
4869 command modifier in conjunction with the commands
4874 To enforce unrolling of changes made to (global)
4875 .Sx "INTERNAL VARIABLES"
4878 can be used instead; its covered scope depends on how (i.e.,
4880 normal macro, folder hook, hook,
4882 switch) the macro is invoked.
4887 ed macro, the given positional parameters are implicitly local
4888 to the macro's scope, and may be accessed via the variables
4894 and any other positive unsigned decimal number less than or equal to
4896 Positional parameters can be
4898 ed, or become completely replaced, removed etc. via
4900 A helpful command to perform many sorts of number and string evaluations is
4903 .Bd -literal -offset indent
4913 echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4916 call exmac Hello macro exmac!
4917 echo ${?}/${!}/${^ERRNAME}
4923 .It Ic delete , undelete
4924 (d, u) Marks the given message list as being or not being
4926 respectively; if no argument has been specified then the usual search
4927 for a visible message is performed, as documented for
4928 .Sx "Message list arguments" ,
4929 showing only the next input prompt if the search fails.
4930 Deleted messages will neither be saved in the
4932 .Sx "secondary mailbox"
4934 nor will they be available for most other commands.
4937 variable is set, the new
4939 or the last message restored, respectively, is automatically
4948 \*(NQ Digging (information out of) messages is possible through
4950 objects, which can be
4952 d for the given message number; in compose mode the hyphen-minus
4954 will instead open the message that is being composed.
4955 If a hyphen-minus is given as the optional third argument then output
4956 will be generated on the standard output channel instead of being
4957 subject to consumation by the
4965 d again by giving the same identifier used for creation;
4966 this step could be omitted: objects will be automatically closed
4967 when the active mailbox or the compose mode is left, respectively.
4968 In all other cases the second argument is an object identifier,
4969 and the third and all following arguments are interpreted as via
4972 .Sx "COMMAND ESCAPES" ) :
4973 .Bd -literal -offset indent
4974 ? vput = msgno; digmsg create $msgno
4975 ? digmsg $msgno header list; readall x; echon $x
4976 210 Subject From To Message-ID References In-Reply-To Status
4977 ? digmsg $msgno header show Status;readall x;echon $x
4981 ? digmsg remove $msgno
4989 Superseded by the multiplexer
4995 Delete the given messages and automatically
4999 if one exists, regardless of the setting of
5006 up or down by one message when given
5010 argument, respectively.
5014 .It Ic draft , undraft
5015 Take message lists and mark each given message as being draft, or not
5016 being draft, respectively, as documented in the section
5017 .Sx "Message states" .
5021 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
5022 newline, whereas the otherwise identical
5025 .Sx "Shell-style argument quoting"
5027 .Sx "Filename transformations"
5028 are applied to the expanded arguments.
5029 This command also supports
5032 .Sx "Command modifiers" ,
5033 and manages the error number
5035 if data is stored in a variable then the return value reflects the
5036 length of the result string in case of success and is
5044 except that is echoes to standard error.
5047 In interactive sessions the \*(OPal message ring queue for
5049 will be used instead, if available and
5057 but does not write or store a trailing newline.
5063 but does not write or store a trailing newline.
5069 at each message from the given list in turn.
5070 Modified contents are discarded unless the
5072 variable is set, and are not used unless the mailbox can be written to
5073 and the editor returns a successful exit status.
5075 can be used instead for a more display oriented editor.
5081 (see there for more),
5082 .Ic elif , else , endif
5083 conditional \(em if the condition of a preceding
5085 was false, check the following condition and execute the following block
5086 if it evaluates true.
5092 (see there for more),
5093 .Ic elif , else , endif
5094 conditional \(em if none of the conditions of the preceding
5098 commands was true, the
5104 (en) Marks the end of an
5106 (see there for more),
5107 .Ic elif , else , endif
5108 conditional execution block.
5113 \*(NQ \*(UA has a strict notion about which variables are
5114 .Sx "INTERNAL VARIABLES"
5115 and which are managed in the program
5117 Since some of the latter are a vivid part of \*(UAs functioning,
5118 however, they are transparently integrated into the normal handling of
5119 internal variables via
5123 To integrate other environment variables of choice into this
5124 transparent handling, and also to export internal variables into the
5125 process environment where they normally are not, a
5127 needs to become established with this command, as in, e.g.,
5130 .Dl environ link PERL5LIB TZ
5133 Afterwards changing such variables with
5135 will cause automatic updates of the program environment, and therefore
5136 be inherited by newly created child processes.
5137 Sufficient system support provided (it was in BSD as early as 1987, and
5138 is standardized since Y2K) removing such variables with
5140 will remove them also from the program environment, but in any way
5141 the knowledge they ever have been
5144 Note that this implies that
5146 may cause loss of such links.
5151 will remove an existing link, but leaves the variables as such intact.
5152 Additionally the subcommands
5156 are provided, which work exactly the same as the documented commands
5160 but (additionally un)link the variable(s) with the program environment
5161 and thus immediately export them to, or remove them from (if possible),
5162 respectively, the program environment.
5167 \*(OP Since \*(UA uses the console as a user interface it can happen
5168 that messages scroll by too fast to become recognized.
5169 An error message ring queue is available which stores duplicates of any
5170 error message and notifies the user in interactive sessions whenever
5171 a new error has occurred.
5172 The queue is finite: if its maximum size is reached any new message
5173 replaces the eldest.
5176 can be used to manage this message queue: if given
5178 or no argument the queue will be displayed and cleared,
5180 will only clear all messages from the queue.
5184 \*(NQ Construct a command by concatenating the arguments, separated with
5185 a single space character, and then evaluate the result.
5186 This command passes through the exit status
5190 of the evaluated command; also see
5192 .Bd -literal -offset indent
5203 call yyy '\ecall xxx' "b\e$'\et'u ' "
5211 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5212 any saving of messages in the
5214 .Sx "secondary mailbox"
5216 as well as a possibly tracked line editor
5218 The optional status number argument will be passed through to
5220 \*(ID For now it can happen that the given status will be overwritten,
5221 later this will only occur if a later error needs to be reported onto an
5222 otherwise success indicating status.
5228 but open the mailbox read-only.
5233 (fi) The file command switches to a new mailbox.
5234 Without arguments it shows status information of the current mailbox.
5235 If an argument is given, it will write out changes (such as deletions)
5236 the user has made, open a new mailbox, update the internal variables
5237 .Va mailbox-resolved
5239 .Va mailbox-display ,
5240 execute an according
5242 if one is installed, and optionally display a summary of
5249 .Sx "Filename transformations"
5250 will be applied to the
5254 prefixes are, i.e., URL syntax is understood, e.g.,
5255 .Ql mbox:///tmp/mdirbox :
5256 if a protocol prefix is used the mailbox type is fixated and neither
5257 the auto-detection (read on) nor the
5260 \*(OPally URLs can also be used to access network resources, which may
5261 be accessed securely via
5262 .Sx "Encrypted network communication"
5263 if so supported, and it is possible to proxy all network traffic over
5264 a SOCKS5 server given via
5268 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5269 .Dl \*(OU protocol://[user@]host[:port][/path]
5272 \*(OPally supported network protocols are
5276 (POP3 with TLS encrypted transport),
5282 part is valid only for IMAP; there it defaults to
5284 Network URLs require a special encoding as documented in the section
5285 .Sx "On URL syntax and credential lookup" .
5288 If the resulting file protocol (MBOX database)
5290 is located on a local filesystem then the list of all registered
5292 s is traversed in order to see whether a transparent intermediate
5293 conversion step is necessary to handle the given mailbox, in which case
5294 \*(UA will use the found hook to load and save data into and from
5295 a temporary file, respectively.
5296 Changing hooks will not affect already opened mailboxes.
5297 For example, the following creates hooks for the
5299 compression tool and a combined compressed and encrypted format:
5301 .Bd -literal -offset indent
5303 gzip 'gzip -dc' 'gzip -c' \e
5304 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5308 MBOX databases will always be protected via file-region locks
5310 during file operations in order to avoid inconsistencies due to
5311 concurrent modifications.
5312 .Mx -ix "dotlock files"
5313 \*(OP In addition mailbox files treated as the system
5318 .Sx "primary system mailbox" Ns
5319 es in general will also be protected by so-called dotlock files,
5320 the traditional way of mail spool file locking: for any file
5324 will be created for the duration of the synchronization \(em
5325 as necessary an external privileged dotlock helper will be used
5326 to create the dotlock file in the same directory and with the same user
5327 and group identities as the file of interest.
5329 can be used to turn off additional dotlock files, shall the need arise.
5332 \*(UA by default uses tolerant POSIX rules when reading MBOX database
5333 files, but it will detect invalid message boundaries in this mode and
5334 complain (even more with
5336 if any is seen: in this case
5338 can be used to create a valid MBOX database from the invalid input.
5341 \*(OP If no protocol has been fixated, and
5343 refers to a directory with the subdirectories
5348 then it is treated as a folder in
5351 The maildir format stores each message in its own file, and has been
5352 designed so that file locking is not necessary when reading or writing
5356 \*(ID If no protocol has been fixated and no existing file has
5357 been found, the variable
5359 controls the format of mailboxes yet to be created.
5364 .It Ic filetype , unfiletype
5365 \*(NQ Define or list, and remove, respectively, file handler hooks,
5366 which provide (shell) commands that enable \*(UA to load and save MBOX
5367 files from and to files with the registered file extensions;
5368 it will use an intermediate temporary file to store the plain data.
5369 The latter command removes the hooks for all given extensions,
5371 will remove all existing handlers.
5373 When used without arguments the former shows a list of all currently
5374 defined file hooks, with one argument the expansion of the given alias.
5375 Otherwise three arguments are expected, the first specifying the file
5376 extension for which the hook is meant, and the second and third defining
5377 the load- and save commands, respectively, to deal with the file type,
5378 both of which must read from standard input and write to standard
5380 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5381 \*(ID For now too much work is done, and files are oftened read in twice
5382 where once would be sufficient: this can cause problems if a filetype is
5383 changed while such a file is opened; this was already so with the
5384 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5385 \*(ID For now all handler strings are passed to the
5386 .Ev SHELL for evaluation purposes; in the future a
5388 prefix to load and save commands may mean to bypass this shell instance:
5389 placing a leading space will avoid any possible misinterpretations.
5390 .Bd -literal -offset indent
5391 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5392 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
5393 zst 'zstd -dc' 'zstd -19 -zc' \e
5394 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5395 ? set record=+sent.zst.pgp
5400 .It Ic flag , unflag
5401 Take message lists and mark the messages as being flagged, or not being
5402 flagged, respectively, for urgent/special attention.
5404 .Sx "Message states" .
5413 With no arguments, list the names of the folders in the folder directory.
5414 With an existing folder as an argument,
5415 lists the names of folders below the named folder.
5421 but saves the message in a file named after the local part of the first
5422 recipient's address (instead of in
5429 but saves the message in a file named after the local part of the first
5430 recipient's address (instead of in
5437 but responds to all recipients regardless of the
5442 .It Ic followupsender
5445 but responds to the sender only regardless of the
5453 but saves the message in a file named after the local part of the
5454 recipient's address (instead of in
5459 Takes a message and the address of a recipient
5460 and forwards the message to him.
5461 The text of the original message is included in the new one,
5462 with the value of the
5463 .Va forward-inject-head
5464 variable preceding, and the value of
5465 .Va forward-inject-tail
5467 To filter the included header fields to the desired subset use the
5469 slot of the white- and blacklisting command
5471 Only the first part of a multipart message is included unless
5472 .Va forward-as-attachment ,
5473 and recipient addresses will be stripped from comments, names
5474 etc. unless the internal variable
5478 This may generate the errors
5479 .Va ^ERR Ns -DESTADDRREQ
5480 if no receiver has been specified,
5482 if some addressees where rejected by
5485 if no applicable messages have been given,
5487 if multiple messages have been specified,
5489 if an I/O error occurs,
5491 if a necessary character set conversion fails, and
5497 (f) Takes a list of message specifications and displays a summary of
5498 their message headers, exactly as via
5500 making the first message of the result the new
5502 (the last message if
5505 An alias of this command is
5508 .Sx "Specifying messages" .
5519 \*(OB Superseded by the multiplexer
5523 \*(OB Superseded by the multiplexer
5526 .It Ic ghost , unghost
5529 .Ic uncommandalias .
5533 .It Ic headerpick , unheaderpick
5534 \*(NQ Multiplexer command to manage white- and blacklisting
5535 selections of header fields for a variety of applications.
5536 Without arguments the set of contexts that have settings is displayed.
5537 When given arguments, the first argument is the context to which the
5538 command applies, one of (case-insensitive)
5540 for display purposes (via, e.g.,
5543 for selecting which headers shall be stored persistently when
5549 ing messages (note that MIME related etc. header fields should not be
5550 ignored in order to not destroy usability of the message in this case),
5552 for stripping down messages when
5554 ing message (has no effect if
5555 .Va forward-as-attachment
5558 for defining user-defined set of fields for the command
5561 The current settings of the given context are displayed if it is the
5563 A second argument denotes the type of restriction that is to be chosen,
5564 it may be (a case-insensitive prefix of)
5568 for white- and blacklisting purposes, respectively.
5569 Establishing a whitelist suppresses inspection of the corresponding
5572 If no further argument is given the current settings of the given type
5573 will be displayed, otherwise the remaining arguments specify header
5574 fields, which \*(OPally may be given as regular expressions, to be added
5576 The special wildcard field (asterisk,
5578 will establish a (fast) shorthand setting which covers all fields.
5580 The latter command always takes three or more arguments and can be used
5581 to remove selections, i.e., from the given context, the given type of
5582 list, all the given headers will be removed, the special argument
5584 will remove all headers.
5588 (h) Show the current group of headers, the size of which depends on
5591 in interactive mode, and the format of which can be defined with
5593 If a message-specification is given the group of headers containing the
5594 first message therein is shown and the message at the top of the screen
5597 the last message is targeted if
5608 \*(OP Without arguments or when given
5610 all history entries are shown (this mode also supports a more
5614 will replace the list of entries with the content of
5618 will dump the current list to said file, replacing former content.
5620 will delete all history entries.
5621 The argument can also be a signed decimal
5623 which will select and evaluate the respective history entry, and move it
5624 to the top of the history; a negative number is used as an offset to the
5625 current command, e.g.,
5627 will select the last command, the history top.
5629 .Sx "On terminal control and line editor"
5630 for more on this topic.
5636 Takes a message list and marks each message therein to be saved in the
5641 .Sx "secondary mailbox"
5643 Does not override the
5646 \*(UA deviates from the POSIX standard with this command, because a
5648 command issued after
5650 will display the following message, not the current one.
5656 .Ic \&\&if , Ic elif , else , endif
5657 conditional execution construct \(em if the given condition is true then
5658 the encapsulated block is executed.
5659 The POSIX standard only supports the (case-insensitive) conditions
5664 end, the remaining are non-portable extensions.
5665 \*(ID These commands do not yet use
5666 .Sx "Shell-style argument quoting"
5667 and therefore do not know about input tokens, so that syntax
5668 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5669 all conditions bracket group wise and consider the tokens, representing
5670 values and operators, therein, which also means that variables will
5671 already have been expanded at that time (just like in the shell).
5673 .Bd -literal -offset indent
5682 The (case-insensitive) condition
5684 erminal will evaluate to true if the standard input is a terminal, i.e.,
5685 in interactive sessions.
5686 Another condition can be any boolean value (see the section
5687 .Sx "INTERNAL VARIABLES"
5688 for textual boolean representations) to mark an enwrapped block as
5691 .Dq always execute .
5692 (It shall be remarked that a faulty condition skips all branches until
5697 .Sx "Shell-style argument quoting"
5698 will be used, and this command will simply interpret expanded tokens.)
5699 It is possible to check
5700 .Sx "INTERNAL VARIABLES"
5703 variables for existence or compare their expansion against a user given
5704 value or another variable by using the
5706 .Pf ( Dq variable next )
5707 conditional trigger character;
5708 a variable on the right hand side may be signalled using the same
5710 Variable names may be enclosed in a pair of matching braces.
5711 When this mode has been triggered, several operators are available:
5714 Integer operators treat the arguments on the left and right hand side of
5715 the operator as integral numbers and compare them arithmetically.
5716 It is an error if any of the operands is not a valid integer, an empty
5717 argument (which implies it had been quoted) is treated as if it were 0.
5718 Available operators are
5722 (less than or equal to),
5728 (greater than or equal to), and
5733 String data operators compare the left and right hand side according to
5734 their textual content.
5735 Unset variables are treated as the empty string.
5736 The behaviour of string operators can be adjusted by prefixing the
5737 operator with the modifier trigger commercial at
5739 followed by none to multiple modifiers: for now supported is
5741 which turns the comparison into a case-insensitive one: this is
5742 implied if no modifier follows the trigger.
5745 Available string operators are
5749 (less than or equal to),
5755 (greater than or equal to),
5759 (is substring of) and
5761 (is not substring of).
5762 By default these operators work on bytes and (therefore) do not take
5763 into account character set specifics.
5764 If the case-insensitivity modifier has been used, case is ignored
5765 according to the rules of the US-ASCII encoding, i.e., bytes are
5769 When the \*(OPal regular expression support is available, the additional
5775 They treat the right hand side as an extended regular expression that is
5776 matched according to the active locale (see
5777 .Sx "Character sets" ) ,
5778 i.e., character sets should be honoured correctly.
5781 Conditions can be joined via AND-OR lists (where the AND operator is
5783 and the OR operator is
5785 which have equal precedence and will be evaluated with left
5786 associativity, thus using the same syntax that is known for the
5788 It is also possible to form groups of conditions and lists by enclosing
5789 them in pairs of brackets
5790 .Ql [\ \&.\&.\&.\ ] ,
5791 which may be interlocked within each other, and also be joined via
5795 The results of individual conditions and entire groups may be modified
5796 via unary operators: the unary operator
5798 will reverse the result.
5800 .Bd -literal -offset indent
5801 # (This not in v15, there [ -n "$debug"]!)
5805 if [ "$ttycharset" == UTF-8 ] || \e
5806 [ "$ttycharset" @i== UTF8 ]
5807 echo *ttycharset* is UTF-8, the former case-sensitive!
5810 if [ "${t1}" == "${t2}" ]
5811 echo These two variables are equal
5813 if [ "$features" =% +regex ] && \e
5814 [ "$TERM" @i=~ "^xterm\&.*" ]
5815 echo ..in an X terminal
5817 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5818 [ "$verbose" != '' ] ] ]
5821 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5822 echo Left associativity, as is known from the shell
5831 Superseded by the multiplexer
5836 Shows the names of all available commands, alphabetically sorted.
5837 If given any non-whitespace argument the list will be shown in the order
5838 in which command prefixes are searched.
5839 \*(OP In conjunction with a set variable
5841 additional information will be provided for each command: the argument
5842 type will be indicated, the documentation string will be shown,
5843 and the set of command flags will show up:
5845 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
5847 command supports the command modifier
5850 command supports the command modifier
5853 the error number is tracked in
5856 whether the command needs an active mailbox, a
5859 indicators whether command is \&.\h'.3m'.\h'.3m'.
5860 .Bl -tag -compact -width ".It Ql SUBPROCESS"
5861 .It Ql batch/interactive
5862 usable in interactive or batch mode
5865 usable in send mode.
5867 allowed to be used when running in a subprocess instance,
5868 e.g., from within a macro that is called via
5869 .Va on-compose-splice .
5872 indicators whether command is not \&.\h'.3m'.\h'.3m'.
5873 .Bl -tag -compact -width ".It Ql COMPOSE_MODE"
5875 available in compose mode.
5877 available during program startup, e.g., in
5878 .Sx "Resource files" .
5881 The command produces
5890 This command can be used to localize changes to (linked)
5893 .Sx "INTERNAL VARIABLES" ,
5894 meaning that their state will be reverted to the former one once the
5897 Just like the command modifier
5899 which provides block-scope localization for some commands (instead),
5900 it can only be used inside of macro definition blocks introduced by
5904 The covered scope of an
5906 is left once a different account is activated, and some macros, notably
5907 .Va folder-hook Ns s ,
5908 use their own specific notion of covered scope, here it will be extended
5909 until the folder is left again.
5912 This setting stacks up: i.e., if
5914 enables change localization and calls
5916 which explicitly resets localization, then any value changes within
5918 will still be reverted when the scope of
5921 (Caveats: if in this example
5923 changes to a different
5925 which sets some variables that are already covered by localizations,
5926 their scope will be extended, and in fact leaving the
5928 will (thus) restore settings in (likely) global scope which actually
5929 were defined in a local, macro private context!)
5932 This command takes one or two arguments, the optional first one
5933 specifies an attribute that may be one of
5935 which refers to the current scope and is thus the default,
5937 which causes any macro that is being
5939 ed to be started with localization enabled by default, as well as
5941 which (if enabled) disallows any called macro to turn off localization:
5942 like this it can be ensured that once the current scope regains control,
5943 any changes made in deeper levels have been reverted.
5944 The latter two are mutually exclusive, and neither affects
5946 The (second) argument is interpreted as a boolean (string, see
5947 .Sx "INTERNAL VARIABLES" )
5948 and states whether the given attribute shall be turned on or off.
5950 .Bd -literal -offset indent
5951 define temporary_settings {
5952 set possibly_global_option1
5954 set localized_option1
5955 set localized_option2
5957 set possibly_global_option2
5964 Reply to messages that come in via known
5967 .Pf ( Ic mlsubscribe )
5968 mailing lists, or pretend to do so (see
5969 .Sx "Mailing lists" ) :
5972 functionality this will actively resort and even remove message
5973 recipients in order to generate a message that is supposed to be sent to
5975 For example it will also implicitly generate a
5976 .Ql Mail-Followup-To:
5977 header if that seems useful, regardless of the setting of the variable
5979 For more documentation please refer to
5980 .Sx "On sending mail, and non-interactive mode" .
5982 This may generate the errors
5983 .Va ^ERR Ns -DESTADDRREQ
5984 if no receiver has been specified,
5986 if some addressees where rejected by
5989 if no applicable messages have been given,
5991 if an I/O error occurs,
5993 if a necessary character set conversion fails, and
5996 Occurrence of some of the errors depend on the value of
5998 Any error stops processing of further messages.
6004 but saves the message in a file named after the local part of the first
6005 recipient's address (instead of in
6010 (m) Takes a (list of) recipient address(es) as (an) argument(s),
6011 or asks on standard input if none were given;
6012 then collects the remaining mail content and sends it out.
6013 Unless the internal variable
6015 is set recipient addresses will be stripped from comments, names etc.
6016 For more documentation please refer to
6017 .Sx "On sending mail, and non-interactive mode" .
6019 This may generate the errors
6020 .Va ^ERR Ns -DESTADDRREQ
6021 if no receiver has been specified,
6023 if some addressees where rejected by
6026 if no applicable messages have been given,
6028 if multiple messages have been specified,
6030 if an I/O error occurs,
6032 if a necessary character set conversion fails, and
6035 Occurrence of some of the errors depend on the value of
6040 (mb) The given message list is to be sent to the
6042 .Sx "secondary mailbox"
6044 when \*(UA is quit; this is the default action unless the variable
6047 \*(ID This command can only be used in a
6049 .Sx "primary system mailbox" .
6053 .It Ic mimetype , unmimetype
6054 Without arguments the content of the MIME type cache will displayed;
6055 a more verbose listing will be produced if either of
6060 When given arguments they will be joined, interpreted as shown in
6061 .Sx "The mime.types files"
6063 .Sx "HTML mail and MIME attachments" ) ,
6064 and the resulting entry will be added (prepended) to the cache.
6065 In any event MIME type sources are loaded first as necessary \(en
6066 .Va mimetypes-load-control
6067 can be used to fine-tune which sources are actually loaded.
6069 The latter command deletes all specifications of the given MIME type, thus
6070 .Ql ? unmimetype text/plain
6071 will remove all registered specifications for the MIME type
6075 will discard all existing MIME types, just as will
6077 but which also reenables cache initialization via
6078 .Va mimetypes-load-control .
6082 .It Ic mlist , unmlist
6083 The latter command removes all given mailing lists, the special name
6085 can be used to remove all registered lists.
6086 The former will list all currently defined mailing lists (and their
6087 attributes, if any) when used without arguments; a more verbose listing
6088 will be produced if either of
6093 Otherwise all given arguments will be added and henceforth be recognized
6095 If the \*(OPal regular expression support is available then any argument
6096 which contains any of the
6098 regular expression characters
6102 will be interpreted as one, which allows matching of many addresses with
6103 a single expression.
6106 pair of commands manages subscription attributes of mailing lists.
6110 \*(ID Only available in interactive mode, this command allows one to
6111 display MIME parts which require external MIME handler programs to run
6112 which do not integrate in \*(UAs normal
6115 .Sx "HTML mail and MIME attachments" ) .
6116 (\*(ID No syntax to directly address parts, this restriction may vanish.)
6117 The user will be asked for each non-text part of the given message in
6118 turn whether the registered handler shall be used to display the part.
6122 .It Ic mlsubscribe , unmlsubscribe
6123 The latter command removes the subscription attribute from all given
6124 mailing lists, the special name
6126 can be used to do so for any registered list.
6127 The former will list all currently defined mailing lists which have
6128 a subscription attribute when used without arguments; a more verbose
6129 listing will be produced if either of
6134 Otherwise this attribute will be set for all given mailing lists,
6135 newly creating them as necessary (as via
6144 but moves the messages to a file named after the local part of the
6145 sender address of the first message (instead of in
6152 but marks the messages for deletion if they were transferred
6159 but also displays header fields which would not pass the
6161 selection, and all MIME parts.
6169 on the given messages, even in non-interactive mode and as long as the
6170 standard output is a terminal.
6176 \*(OP When used without arguments or if
6178 has been given the content of the
6180 cache is shown, loading it first as necessary.
6183 then the cache will only be initialized and
6185 will remove its contents.
6186 Note that \*(UA will try to load the file only once, use
6187 .Ql Ic \&\&netrc Ns \:\0\:clear
6188 to unlock further attempts.
6193 .Sx "On URL syntax and credential lookup" ;
6195 .Sx "The .netrc file"
6196 documents the file format in detail.
6200 Checks for new mail in the current folder without committing any changes
6202 If new mail is present, a message is shown.
6206 the headers of each new message are also shown.
6207 This command is not available for all mailbox types.
6215 Goes to the next message in sequence and types it.
6216 With an argument list, types the next matching message.
6230 If the current folder is accessed via a network connection, a
6232 command is sent, otherwise no operation is performed.
6238 but also displays header fields which would not pass the
6240 selection, and all MIME parts.
6248 on the given messages, even in non-interactive mode and as long as the
6249 standard output is a terminal.
6257 but also pipes header fields which would not pass the
6259 selection, and all parts of MIME
6260 .Ql multipart/alternative
6265 (pi) Takes an optional message list and shell command (that defaults to
6267 and pipes the messages through the command.
6271 every message is followed by a formfeed character.
6292 (q) Terminates the session, saving all undeleted, unsaved messages in
6295 .Sx "secondary mailbox"
6297 preserving all messages marked with
6301 or never referenced in the system
6303 and removing all other messages from the
6305 .Sx "primary system mailbox" .
6306 If new mail has arrived during the session,
6308 .Dq You have new mail
6310 If given while editing a mailbox file with the command line option
6312 then the edit file is rewritten.
6313 A return to the shell is effected,
6314 unless the rewrite of edit file fails,
6315 in which case the user can escape with the exit command.
6316 The optional status number argument will be passed through to
6318 \*(ID For now it can happen that the given status will be overwritten,
6319 later this will only occur if a later error needs to be reported onto an
6320 otherwise success indicating status.
6324 \*(NQ Read a line from standard input, or the channel set active via
6326 and assign the data, which will be split as indicated by
6328 to the given variables.
6329 The variable names are checked by the same rules as documented for
6331 and the same error codes will be seen in
6335 indicates the number of bytes read, it will be
6337 with the error number
6341 in case of I/O errors, or
6344 If there are more fields than variables, assigns successive fields to the
6345 last given variable.
6346 If there are less fields than variables, assigns the empty string to the
6348 .Bd -literal -offset indent
6351 ? echo "<$a> <$b> <$c>"
6353 ? wysh set ifs=:; read a b c;unset ifs
6354 hey2.0,:"'you ",:world!:mars.:
6355 ? echo $?/$^ERRNAME / <$a><$b><$c>
6356 0/NONE / <hey2.0,><"'you ",><world!:mars.:><><>
6361 \*(NQ Read anything from standard input, or the channel set active via
6363 and assign the data to the given variable.
6364 The variable name is checked by the same rules as documented for
6366 and the same error codes will be seen in
6370 indicates the number of bytes read, it will be
6372 with the error number
6376 in case of I/O errors, or
6379 \*(ID The input data length is restricted to 31-bits.
6383 \*(NQ Manages input channels for
6387 to be used to avoid complicated or impracticable code, like calling
6389 from within a macro in non-interactive mode.
6390 Without arguments, or when the first argument is
6392 a listing of all known channels is printed.
6393 Channels can otherwise be
6395 d, and existing channels can be
6399 d by giving the string used for creation.
6401 The channel name is expected to be a file descriptor number, or,
6402 if parsing the numeric fails, an input file name that undergoes
6403 .Sx "Filename transformations" .
6404 E.g. (this example requires a modern shell):
6405 .Bd -literal -offset indent
6406 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6409 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6410 LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6416 Removes the named files or directories.
6417 .Sx "Filename transformations"
6418 including shell pathname wildcard pattern expansions
6420 are performed on the arguments.
6421 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
6422 type specific removal will be performed, deleting the complete mailbox.
6423 The user is asked for confirmation in interactive mode.
6427 Takes the name of an existing folder
6428 and the name for the new folder
6429 and renames the first to the second one.
6430 .Sx "Filename transformations"
6431 including shell pathname wildcard pattern expansions
6433 are performed on both arguments.
6434 Both folders must be of the same type.
6440 except that it replies to only the sender of each message of the given
6441 list, by using the first message as the template to quote, for the
6445 will exchange this command with
6450 (r) Take a message and group-responds to it by addressing the sender
6451 and all recipients, subject to
6455 .Va followup-to-honour ,
6458 .Va recipients-in-cc
6459 influence response behaviour.
6460 Unless the internal variable
6462 is set recipient addresses will be stripped from comments, names etc.
6465 .Va quote-as-attachment
6466 configure whether responded-to message shall be quoted etc.; setting
6468 will exchange this command with
6472 offers special support for replying to mailing lists.
6473 For more documentation please refer to
6474 .Sx "On sending mail, and non-interactive mode" .
6476 This may generate the errors
6477 .Va ^ERR Ns -DESTADDRREQ
6478 if no receiver has been specified,
6480 if some addressees where rejected by
6483 if no applicable messages have been given,
6485 if an I/O error occurs,
6487 if a necessary character set conversion fails, and
6490 Occurrence of some of the errors depend on the value of
6492 Any error stops processing of further messages.
6498 but initiates a group-reply regardless of the value of
6505 but responds to the sender only regardless of the value of
6512 but does not add any header lines.
6513 This is not a way to hide the sender's identity,
6514 but useful for sending a message again to the same recipients.
6518 Takes a list of messages and a user name
6519 and sends each message to the named user.
6521 and related header fields are prepended to the new copy of the message.
6524 is only performed if
6528 This may generate the errors
6529 .Va ^ERR Ns -DESTADDRREQ
6530 if no receiver has been specified,
6532 if some addressees where rejected by
6535 if no applicable messages have been given,
6537 if an I/O error occurs,
6539 if a necessary character set conversion fails, and
6542 Occurrence of some of the errors depend on the value of
6544 Any error stops processing of further messages.
6562 .It Ic respondsender
6568 (ret) Superseded by the multiplexer
6573 Only available inside the scope of a
6577 this will stop evaluation of any further macro content, and return
6578 execution control to the caller.
6579 The two optional parameters must be specified as positive decimal
6580 numbers and default to the value 0:
6581 the first argument specifies the signed 32-bit return value (stored in
6583 \*(ID and later extended to signed 64-bit),
6584 the second the signed 32-bit error number (stored in
6588 a non-0 exit status may cause the program to exit.
6594 but saves the messages in a file named after the local part of the
6595 sender of the first message instead of (in
6597 and) taking a filename argument; the variable
6599 is inspected to decide on the actual storage location.
6603 (s) Takes a message list and a filename and appends each message in turn
6604 to the end of the file.
6605 .Sx "Filename transformations"
6606 including shell pathname wildcard pattern expansions
6608 is performed on the filename.
6609 If no filename is given, the
6611 .Sx "secondary mailbox"
6614 The filename in quotes, followed by the generated character count
6615 is echoed on the user's terminal.
6618 .Sx "primary system mailbox"
6619 the messages are marked for deletion.
6620 .Sx "Filename transformations"
6622 To filter the saved header fields to the desired subset use the
6624 slot of the white- and blacklisting command
6628 \*(OB Superseded by the multiplexer
6632 \*(OB Superseded by the multiplexer
6636 \*(OB Superseded by the multiplexer
6641 Takes a message specification (list) and displays a header summary of
6642 all matching messages, as via
6644 This command is an alias of
6647 .Sx "Specifying messages" .
6651 Takes a message list and marks all messages as having been read.
6657 (se, \*(NQ uns) The latter command will delete all given global
6658 variables, or only block-scope local ones if the
6660 command modifier has been used.
6661 The former, when used without arguments, will show all
6662 currently known variables, being more verbose if either of
6667 Remarks: this list mode will not automatically link-in known
6669 variables, but only explicit addressing will, e.g., via
6671 using a variable in an
6673 condition or a string passed to
6677 ting, as well as some program-internal use cases.
6680 Otherwise the given variables (and arguments) are set or adjusted.
6681 Arguments are of the form
6683 (no space before or after
6687 if there is no value, i.e., a boolean variable.
6688 If a name begins with
6692 the effect is the same as invoking the
6694 command with the remaining part of the variable
6695 .Pf ( Ql unset save ) .
6696 \*(ID In conjunction with the
6698 .Pf (or\0 Cm local )
6700 .Sx "Shell-style argument quoting"
6701 can be used to quote arguments as necessary.
6702 \*(ID Otherwise quotation marks may be placed around any part of the
6703 assignment statement to quote blanks or tabs.
6706 When operating in global scope any
6708 that is known to map to an environment variable will automatically cause
6709 updates in the program environment (unsetting a variable in the
6710 environment requires corresponding system support) \(em use the command
6712 for further environmental control.
6713 If the command modifier
6715 has been used to alter the command to work in block-scope all variables
6716 have values (may they be empty), and creation of names which shadow
6717 .Sx "INTERNAL VARIABLES"
6718 is actively prevented (\*(ID shadowing of linked
6720 variables and free-form versions of variable chains is not yet detected).
6724 .Sx "INTERNAL VARIABLES"
6728 .Bd -literal -offset indent
6729 ? wysh set indentprefix=' -> '
6730 ? wysh set atab=$'\t' aspace=' ' zero=0
6736 Apply shell quoting rules to the given raw-data arguments.
6740 .Sx "Command modifiers" ) .
6741 The first argument specifies the operation:
6745 cause shell quoting to be applied to the remains of the line, and
6746 expanded away thereof, respectively.
6747 If the former is prefixed with a plus-sign, the quoted result will not
6748 be roundtrip enabled, and thus can be decoded only in the very same
6749 environment that was used to perform the encode; also see
6750 .Cd mle-quote-rndtrip .
6751 If the coding operation fails the error number
6754 .Va ^ERR Ns -CANCELED ,
6755 and the unmodified input is used as the result; the error number may
6756 change again due to output or result storage errors.
6760 \*(NQ (sh) Invokes an interactive version of the shell,
6761 and returns its exit status.
6765 .It Ic shortcut , unshortcut
6766 Without arguments the list of all currently defined shortcuts is
6767 shown, with one argument the expansion of the given shortcut.
6768 Otherwise all given arguments are treated as pairs of shortcuts and
6769 their expansions, creating new or changing already existing shortcuts,
6771 The latter command will remove all given shortcuts, the special name
6773 will remove all registered shortcuts.
6777 \*(NQ Shift the positional parameter stack (starting at
6779 by the given number (which must be a positive decimal),
6780 or 1 if no argument has been given.
6781 It is an error if the value exceeds the number of positional parameters.
6782 If the given number is 0, no action is performed, successfully.
6783 The stack as such can be managed via
6785 Note this command will fail in
6787 and hook macros unless the positional parameter stack has been
6788 explicitly created in the current context via
6795 but performs neither MIME decoding nor decryption, so that the raw
6796 message text is shown.
6800 (si) Shows the size in characters of each message of the given
6805 \*(NQ Sleep for the specified number of seconds (and optionally
6806 milliseconds), by default interruptable.
6807 If a third argument is given the sleep will be uninterruptible,
6808 otherwise the error number
6812 if the sleep has been interrupted.
6813 The command will fail and the error number will be
6814 .Va ^ERR Ns -OVERFLOW
6815 if the given duration(s) overflow the time datatype, and
6817 if the given durations are no valid integers.
6822 .It Ic sort , unsort
6823 The latter command disables sorted or threaded mode, returns to normal
6824 message order and, if the
6827 displays a header summary.
6828 The former command shows the current sorting criterion when used without
6829 an argument, but creates a sorted representation of the current folder
6830 otherwise, and changes the
6832 command and the addressing modes such that they refer to messages in
6834 Message numbers are the same as in regular mode.
6838 a header summary in the new order is also displayed.
6839 Automatic folder sorting can be enabled by setting the
6841 variable, as in, e.g.,
6842 .Ql set autosort=thread .
6843 Possible sorting criterions are:
6846 .Bl -tag -compact -width "subject"
6848 Sort the messages by their
6850 field, that is by the time they were sent.
6852 Sort messages by the value of their
6854 field, that is by the address of the sender.
6857 variable is set, the sender's real name (if any) is used.
6859 Sort the messages by their size.
6861 \*(OP Sort the message by their spam score, as has been classified by
6864 Sort the messages by their message status.
6866 Sort the messages by their subject.
6868 Create a threaded display.
6870 Sort messages by the value of their
6872 field, that is by the address of the recipient.
6875 variable is set, the recipient's real name (if any) is used.
6881 \*(NQ (so) The source command reads commands from the given file.
6882 .Sx "Filename transformations"
6884 If the given expanded argument ends with a vertical bar
6886 then the argument will instead be interpreted as a shell command and
6887 \*(UA will read the output generated by it.
6888 Dependent on the settings of
6892 and also dependent on whether the command modifier
6894 had been used, encountering errors will stop sourcing of the given input.
6897 cannot be used from within macros that execute as
6898 .Va folder-hook Ns s
6901 i.e., it can only be called from macros that were
6906 \*(NQ The difference to
6908 (beside not supporting pipe syntax aka shell command input) is that
6909 this command will not generate an error nor warn if the given file
6910 argument cannot be opened successfully.
6914 \*(OP Takes a list of messages and clears their
6920 \*(OP Takes a list of messages and causes the
6922 to forget it has ever used them to train its Bayesian filter.
6923 Unless otherwise noted the
6925 flag of the message is inspected to chose whether a message shall be
6933 \*(OP Takes a list of messages and informs the Bayesian filter of the
6937 This also clears the
6939 flag of the messages in question.
6943 \*(OP Takes a list of messages and rates them using the configured
6944 .Va spam-interface ,
6945 without modifying the messages, but setting their
6947 flag as appropriate; because the spam rating headers are lost the rate
6948 will be forgotten once the mailbox is left.
6949 Refer to the manual section
6951 for the complete picture of spam handling in \*(UA.
6955 \*(OP Takes a list of messages and sets their
6961 \*(OP Takes a list of messages and informs the Bayesian filter of the
6967 flag of the messages in question.
6979 \*(NQ TLS information and management command multiplexer to aid in
6980 .Sx "Encrypted network communication" .
6983 if so documented (see
6984 .Sx "Command modifiers" ) .
6985 The result that is shown in case of errors is always the empty string,
6986 errors can be identified via the error number
6988 For example, string length overflows are caught and set
6991 .Va ^ERR Ns -OVERFLOW .
6992 Note this command of course honours the overall TLS configuration.
6993 .Bd -literal -offset indent
6994 ? vput tls result fingerprint pop3s://ex.am.ple
6995 ? echo $?/$!/$^ERRNAME: $result
6998 .Bl -hang -width ".It Cm random"
7001 .Va tls-fingerprint-digest Ns
7002 ed fingerprint of the certificate of the given HOST
7003 .Pf ( Ql server:port ,
7004 where the port defaults to the HTTPS port, 443).
7006 is actively ignored for the runtime of this command.
7007 Only available if the term
7021 slot for white- and blacklisting header fields.
7025 (to) Takes a message list and types out the first
7027 lines of each message on the user's terminal.
7028 Unless a special selection has been established for the
7032 command, the only header fields that are displayed are
7043 It is possible to apply compression to what is displayed by setting
7045 Messages are decrypted and converted to the terminal character set
7050 (tou) Takes a message list and marks the messages for saving in the
7052 .Sx "secondary mailbox"
7054 \*(UA deviates from the POSIX standard with this command,
7057 command will display the following message instead of the current one.
7063 but also displays header fields which would not pass the
7065 selection, and all visualizable parts of MIME
7066 .Ql multipart/alternative
7071 (t) Takes a message list and types out each message on the user's terminal.
7072 The display of message headers is selectable via
7074 For MIME multipart messages, all parts with a content type of
7076 all parts which have a registered MIME type handler (see
7077 .Sx "HTML mail and MIME attachments" )
7078 which produces plain text output, and all
7080 parts are shown, others are hidden except for their headers.
7081 Messages are decrypted and converted to the terminal character set
7085 can be used to display parts which are not displayable as plain text.
7128 \*(OB Superseded by the multiplexer
7132 \*(OB Superseded by the multiplexer
7137 Superseded by the multiplexer
7148 .It Ic unmlsubscribe
7159 Takes a message list and marks each message as not having been read.
7163 Superseded by the multiplexer
7167 \*(OB Superseded by the multiplexer
7171 \*(OB Superseded by the multiplexer
7193 Perform URL percent codec operations on the raw-data argument, rather
7194 according to RFC 3986.
7198 .Sx "Command modifiers" ) ,
7199 and manages the error number
7201 This is a character set agnostic and thus locale dependent operation,
7202 and it may decode bytes which are invalid in the current
7204 \*(ID This command does not know about URLs beside that.
7206 The first argument specifies the operation:
7210 perform plain URL percent en- and decoding, respectively.
7214 perform a slightly modified operation which should be better for
7215 pathnames: it does not allow a tilde
7217 and will neither accept hyphen-minus
7221 as an initial character.
7222 The remains of the line form the URL data which is to be converted.
7223 If the coding operation fails the error number
7226 .Va ^ERR Ns -CANCELED ,
7227 and the unmodified input is used as the result; the error number may
7228 change again due to output or result storage errors.
7232 \*(NQ This command produces the same output as the listing mode of
7236 ity adjustments, but only for the given variables.
7240 \*(OP Takes a message list and verifies each message.
7241 If a message is not a S/MIME signed message,
7242 verification will fail for it.
7243 The verification process checks if the message was signed using a valid
7245 if the message sender's email address matches one of those contained
7246 within the certificate,
7247 and if the message content has been altered.
7255 of \*(UA, as well as the build and running system environment.
7256 This command can produce a more
7258 output, and supports
7261 .Sx "Command modifiers" ) .
7266 \*(NQ Evaluate arguments according to a given operator.
7267 This is a multiplexer command which can be used to perform signed 64-bit
7268 numeric calculations as well as byte string and string operations.
7269 It uses polish notation, i.e., the operator is the first argument and
7270 defines the number and type, and the meaning of the remaining arguments.
7271 An empty argument is replaced with a 0 if a number is expected.
7275 .Sx "Command modifiers" ) .
7278 The result that is shown in case of errors is always
7280 for usage errors and numeric operations, and the empty string for byte
7281 string and string operations;
7282 if the latter two fail to provide result data for
7284 errors, e.g., when a search operation failed, they also set the
7287 .Va ^ERR Ns -NODATA .
7288 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7289 numbers, and errors will be reported in the error number
7291 as the numeric error
7292 .Va ^ERR Ns -RANGE .
7295 Numeric operations work on one or two signed 64-bit integers.
7296 Numbers prefixed with
7300 are interpreted as hexadecimal (base 16) numbers, whereas
7302 indicates octal (base 8), and
7306 denote binary (base 2) numbers.
7307 It is possible to use any base in between 2 and 36, inclusive, with the
7309 notation, where the base is given as an unsigned decimal number, e.g.,
7311 is a different way of specifying a hexadecimal number.
7312 Unsigned interpretation of a number can be enforced by prefixing an
7314 (case-insensitively), e.g.,
7316 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7317 which will be interpreted as unsigned by default, but it still makes
7318 a difference regarding overflow detection and overflow constant.
7319 It is possible to enforce signed interpretation by (instead) prefixing a
7321 (case-insensitively).
7324 One integer is expected by assignment (equals sign
7326 which does nothing but parsing the argument, thus detecting validity and
7327 possible overflow conditions, and unary not (tilde
7329 which creates the bitwise complement.
7330 Two integers are used by addition (plus sign
7332 subtraction (hyphen-minus
7334 multiplication (asterisk
7338 and modulo (percent sign
7340 as well as for the bitwise operators logical or (vertical bar
7343 bitwise and (ampersand
7346 bitwise xor (circumflex
7348 the bitwise signed left- and right shifts
7351 as well as for the unsigned right shift
7355 Another numeric operation is
7357 which takes a number base in between 2 and 36, inclusive, and will act
7358 on the second number given just the same as what equals sign
7360 does, but the number result will be formatted in the base given.
7363 All numeric operators can be prefixed with a commercial at
7367 this will turn the operation into a saturated one, which means that
7368 overflow errors and division and modulo by zero are no longer reported
7369 via the exit status, but the result will linger at the minimum or
7370 maximum possible value, instead of overflowing (or trapping).
7371 This is true also for the argument parse step.
7372 For the bitwise shifts, the saturated maximum is 63.
7373 Any caught overflow will be reported via the error number
7376 .Va ^ERR Ns -OVERFLOW .
7377 .Bd -literal -offset indent
7378 ? vexpr @- +1 -9223372036854775808
7379 ? echo $?/$!/$^ERRNAME
7383 Character set agnostic string functions have no notion of locale
7384 settings and character sets.
7386 .Bl -hang -width ".It Cm random"
7389 .Sx "Filename transformations"
7392 Generates a random string of the given length, or of
7394 bytes (a constant from
7396 if the value 0 is given; the random string will be base64url encoded
7397 according to RFC 4648, and thus be usable as a (portable) filename.
7401 Byte string operations work on 8-bit bytes and have no notion of locale
7402 settings and character sets, effectively assuming ASCII data.
7405 .Bl -hang -width ".It Cm length"
7407 Queries the length of the given argument.
7410 Calculates the Chris Torek hash of the given argument.
7413 Byte-searches in the first for the second argument.
7414 Shows the resulting 0-based offset shall it have been found.
7419 but works case-insensitively according to the rules of the ASCII
7423 Creates a substring of its first argument.
7424 The second argument is the 0-based starting offset, a negative one
7425 counts from the end;
7426 the optional third argument specifies the length of the desired result,
7427 a negative length leaves off the given number of bytes at the end of the
7428 original string, by default the entire string is used;
7429 this operation tries to work around faulty arguments (set
7431 for error logs), but reports them via the error number
7434 .Va ^ERR Ns -OVERFLOW .
7437 Trim away whitespace characters from both ends of the argument.
7440 Trim away whitespace characters from the begin of the argument.
7443 Trim away whitespace characters from the end of the argument.
7448 String operations work, sufficient support provided, according to the
7449 active user's locale encoding and character set (see
7450 .Sx "Character sets" ) .
7453 .Bl -hang -width ".It Cm regex"
7455 (One-way) Converts the argument to something safely printable on the
7459 \*(OP A string operation that will try to match the first argument with
7460 the regular expression given as the second argument.
7461 If the optional third argument has been given then instead of showing
7462 the match offset a replacement operation is performed: the third
7463 argument is treated as if specified within dollar-single-quote (see
7464 .Sx "Shell-style argument quoting" ) ,
7465 and any occurrence of a positional parameter, e.g.,
7467 is replaced by the corresponding match group of the regular expression:
7468 .Bd -literal -offset indent
7469 ? vput vexpr res regex bananarama \e
7470 (.*)NanA(.*) '\e${1}au\e$2'
7471 ? echo $?/$!/$^ERRNAME: $res
7475 On otherwise identical case-insensitive equivalent to
7477 .Bd -literal -offset indent
7478 ? vput vexpr res ire bananarama \e
7479 (.*)NanA(.*) '\e${1}au\e$2'
7480 ? echo $?/$!/$^ERRNAME: $res
7487 \*(NQ Manage the positional parameter stack (see
7491 If the first argument is
7493 then the positional parameter stack of the current context, or the
7494 global one, if there is none, is cleared.
7497 then the remaining arguments will be used to (re)create the stack,
7498 if the parameter stack size limit is excessed an
7499 .Va ^ERR Ns -OVERFLOW
7503 If the first argument is
7505 a round-trip capable representation of the stack contents is created,
7506 with each quoted parameter separated from each other with the first
7509 and followed by the first character of
7511 if that is not empty and not identical to the first.
7512 If that results in no separation at all a
7518 .Sx "Command modifiers" ) .
7519 I.e., the subcommands
7523 can be used (in conjunction with
7525 to (re)create an argument stack from and to a single variable losslessly.
7527 .Bd -literal -offset indent
7528 ? vpospar set hey, "'you ", world!
7529 ? echo $#: <${1}><${2}><${3}>
7530 ? vput vpospar x quote
7532 ? echo $#: <${1}><${2}><${3}>
7533 ? eval vpospar set ${x}
7534 ? echo $#: <${1}><${2}><${3}>
7540 (v) Takes a message list and invokes the
7542 display editor on each message.
7543 Modified contents are discarded unless the
7545 variable is set, and are not used unless the mailbox can be written to
7546 and the editor returns a successful exit status.
7548 can be used instead for a less display oriented editor.
7552 (w) For conventional messages the body without all headers is written.
7553 The original message is never marked for deletion in the originating
7555 The output is decrypted and converted to its native format as necessary.
7556 If the output file exists, the text is appended.
7557 If a message is in MIME multipart format its first part is written to
7558 the specified file as for conventional messages, handling of the remains
7559 depends on the execution mode.
7560 No special handling of compressed files is performed.
7562 In interactive mode the user is consecutively asked for the filenames of
7563 the processed parts.
7564 For convience saving of each part may be skipped by giving an empty
7565 value, the same result as writing it to
7567 Shell piping the part content by specifying a leading vertical bar
7569 character for the filename is supported.
7570 Other user input undergoes the usual
7571 .Sx "Filename transformations" ,
7572 including shell pathname wildcard pattern expansions
7574 and shell variable expansion for the message as such, not the individual
7575 parts, and contents of the destination file are overwritten if the file
7578 \*(ID In non-interactive mode any part which does not specify a filename
7579 is ignored, and suspicious parts of filenames of the remaining parts are
7580 URL percent encoded (as via
7582 to prevent injection of malicious character sequences, resulting in
7583 a filename that will be written into the current directory.
7584 Existing files will not be overwritten, instead the part number or
7585 a dot are appended after a number sign
7587 to the name until file creation succeeds (or fails due to other
7592 \*(NQ The sole difference to
7594 is that the new macro is executed in place of the current one, which
7595 will not regain control: all resources of the current macro will be
7597 This implies that any setting covered by
7599 will be forgotten and covered variables will become cleaned up.
7600 If this command is not used from within a
7602 ed macro it will silently be (a more expensive variant of)
7612 \*(NQ \*(UA presents message headers in
7614 fuls as described under the
7617 Without arguments this command scrolls to the next window of messages,
7618 likewise if the argument is
7622 scrolls to the last,
7624 scrolls to the first, and
7629 A number argument prefixed by
7633 indicates that the window is calculated in relation to the current
7634 position, and a number without a prefix specifies an absolute position.
7640 but scrolls to the next or previous window that contains at least one
7651 .\" .Sh COMMAND ESCAPES {{{
7652 .Sh "COMMAND ESCAPES"
7654 Command escapes are available in compose mode, and are used to perform
7655 special functions when composing messages.
7656 Command escapes are only recognized at the beginning of lines, and
7657 consist of a trigger (escape), and a command character.
7658 The actual escape character can be set via the internal variable
7660 it defaults to the tilde
7662 Otherwise ignored whitespace characters following the escape character
7663 will prevent a possible addition of the command line to the \*(OPal
7667 Unless otherwise noted all compose mode command escapes ensure proper
7668 updates of the variables which represent the error number
7674 is set they will, unless stated otherwise, error out message compose mode
7675 and cause a program exit if an operation fails;
7676 an effect equivalent to the command modifier
7678 can however be achieved by placing a hyphen-minus
7680 after (possible whitespace following) the escape character.
7681 If the \*(OPal key bindings are available it is possible to create
7683 ings specifically for the compose mode.
7686 .Bl -tag -width ".It Ic BaNg"
7689 Insert the string of text in the message prefaced by a single
7691 (If the escape character has been changed,
7692 that character must be doubled instead.)
7695 .It Ic ~! Ar command
7696 Execute the indicated shell
7698 which follows, replacing unescaped exclamation marks with the previously
7699 executed command if the internal variable
7701 is set, then return to the message.
7705 End compose mode and send the message.
7707 .Va on-compose-splice-shell
7709 .Va on-compose-splice ,
7710 in order, will be called when set, after which, in interactive mode
7713 .Va askcc , askbcc )
7716 will be checked as well as
7719 .Va on-compose-leave
7720 hook will be called,
7724 will be joined in if set,
7726 .Va message-inject-tail
7727 will be incorporated, after which the compose mode is left.
7730 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
7731 Execute the given \*(UA command.
7732 Not all commands, however, are allowed.
7735 .It Ic ~< Ar filename
7740 .It Ic ~<! Ar command
7742 is executed using the shell.
7743 Its standard output is inserted into the message.
7747 \*(OP Write a summary of command escapes.
7750 .It Ic ~@ Op Ar filename...
7751 Append or edit the list of attachments.
7752 Does not manage the error number
7758 instead if this is a concern).
7759 The append mode expects a list of
7761 arguments as shell tokens (see
7762 .Sx "Shell-style argument quoting" ;
7763 token-separating commas are ignored, too), to be
7764 interpreted as documented for the command line option
7766 with the message number exception as below.
7770 arguments the attachment list is edited, entry by entry;
7771 if a filename is left empty, that attachment is deleted from the list;
7772 once the end of the list is reached either new attachments may be
7773 entered or the session can be quit by committing an empty
7776 In non-interactive mode or in batch mode
7778 the list of attachments is effectively not edited but instead recreated;
7779 again, an empty input ends list creation.
7781 For all modes, if a given filename solely consists of the number sign
7783 followed by either a valid message number of the currently active
7784 mailbox, or by a period
7786 referring to the current message of the active mailbox, the so-called
7788 then the given message is attached as a
7791 The number sign must be quoted to avoid misinterpretation with the shell
7795 .It Ic ~| Ar command
7796 Pipe the message text through the specified filter command.
7797 If the command gives no output or terminates abnormally,
7798 retain the original text of the message.
7801 is often used as a rejustifying filter.
7803 If the first character of the command is a vertical bar, then the entire
7804 message including header fields is subject to the filter command, e.g.,
7805 .Ql ~|| echo Fcc: /tmp/test; cat
7806 will prepend a file-carbon-copy message header.
7812 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7813 Low-level compose mode command which shares semantic with
7815 In general the first field of a response line represents a status code
7816 which specifies whether a command was successful or not, whether result
7817 data is to be expected, and if, the format of the result data.
7818 Does not manage the error number
7822 because errors are reported via the protocol
7823 (hard errors like I/O failures cannot be handled).
7826 This command has read-only access to several virtual pseudo headers in
7827 the \*(UA private namespace which optionally (except for the
7828 non-optional first) exist in compose mode:
7832 .Bl -tag -compact -width ".It Va BaNg"
7833 .It Ql Mailx-Command:
7834 The name of the command that generates the message, one of
7842 .It Ql Mailx-Raw-To:
7843 .It Ql Mailx-Raw-Cc:
7844 .It Ql Mailx-Raw-Bcc:
7845 Represent the frozen initial state of these headers before any
7846 transformation (e.g.,
7849 .Va recipients-in-cc
7852 .It Ql Mailx-Orig-From:
7853 .It Ql Mailx-Orig-To:
7854 .It Ql Mailx-Orig-Cc:
7855 .It Ql Mailx-Orig-Bcc:
7856 The values of said headers of the original message which has been
7858 .Ic reply , forward , resend .
7863 Error status code lines may optionally contain additional context.
7864 The status codes are:
7868 .Bl -tag -compact -width ".It Ql 210"
7870 Status ok; the remains of the line are the result.
7873 Status ok; the rest of the line is optionally used for more status.
7874 What follows are lines of result addresses, terminated by an empty line.
7875 The address lines consist of two fields, the first of which is the
7876 plain address, e.g.,
7878 separated by a single ASCII SP space from the second which contains the
7879 unstripped address, even if that is identical to the first field, e.g.,
7880 .Ql (Lovely) Bob <bob@exam.ple> .
7881 Non-network addressees, however, place a single-letter indicating
7882 the address type in the first field (hyphen-minus
7884 for files, vertical bar
7886 for pipes, and number sign
7888 for names: what is supposed to become expanded via
7890 ), and only the second field contains a value.
7891 All the input, including the empty line, must be consumed before further
7892 commands can be issued.
7895 Status ok; the rest of the line is optionally used for more status.
7896 What follows are lines of furtherly unspecified string content,
7897 terminated by an empty line.
7898 All the input, including the empty line, must be consumed before further
7899 commands can be issued.
7902 Syntax error; invalid command.
7905 Syntax error in parameters or arguments.
7908 Error: an argument fails verification.
7909 For example an invalid address has been specified (also see
7911 or an attempt was made to modify anything in \*(UA's own namespace,
7912 or a modifying subcommand has been used on a read-only message.
7915 Error: an otherwise valid argument is rendered invalid due to context.
7916 For example, a second address is added to a header which may consist of
7917 a single address only.
7922 If a command indicates failure then the message will have remained
7924 Most commands can fail with
7926 if required arguments are missing (false command usage).
7927 The following (case-insensitive) commands are supported:
7930 .Bl -hang -width ".It Cm version"
7932 This command will print the protocol version via 210.
7935 This command allows listing, inspection, and editing of message headers.
7936 Header name case is not normalized, and case-insensitive comparison
7937 should be used when matching names.
7938 The second argument specifies the subcommand to apply, one of:
7940 .Bl -hang -width ".It Cm remove"
7942 Without a third argument a list of all yet existing headers is given via
7944 this command is the default command of
7946 if no second argument has been given.
7947 A third argument restricts output to the given header only, which may
7950 if no such field is defined.
7953 Shows the content of the header given as the third argument.
7954 Dependent on the header type this may respond with
7958 any failure results in
7962 This will remove all instances of the header given as the third
7967 if no such header can be found, and
7969 on \*(UA namespace violations.
7972 This will remove from the header given as the third argument the
7973 instance at the list position (counting from one!) given with the fourth
7978 if the list position argument is not a number or on \*(UA namespace
7981 if no such header instance exists.
7984 Create a new or an additional instance of the header given in the third
7985 argument, with the header body content as given in the fourth argument
7986 (the remains of the line).
7989 if the third argument specifies a free-form header field name that is
7990 invalid, or if body content extraction fails to succeed,
7992 if any extracted address does not pass syntax and/or security checks or
7993 on \*(UA namespace violations, and
7995 to indicate prevention of excessing a single-instance header \(em note that
7997 can be appended to (a space separator will be added automatically first).
8000 is returned upon success, followed by the name of the header and the list
8001 position of the newly inserted instance.
8002 The list position is always 1 for single-instance header fields.
8003 All free-form header fields are managed in a single list.
8008 This command allows listing, removal and addition of message attachments.
8009 The second argument specifies the subcommand to apply, one of:
8011 .Bl -hang -width ".It Cm remove"
8013 List all attachments via
8017 if no attachments exist.
8018 This command is the default command of
8020 if no second argument has been given.
8023 This will remove the attachment given as the third argument, and report
8027 if no such attachment can be found.
8028 If there exists any path component in the given argument, then an exact
8029 match of the path which has been used to create the attachment is used
8030 directly, but if only the basename of that path matches then all
8031 attachments are traversed to find an exact match first, and the removal
8032 occurs afterwards; if multiple basenames match, a
8035 Message attachments are treated as absolute pathnames.
8037 If no path component exists in the given argument, then all attachments
8038 will be searched for
8040 parameter matches as well as for matches of the basename of the path
8041 which has been used when the attachment has been created; multiple
8046 This will interpret the third argument as a number and remove the
8047 attachment at that list position (counting from one!), reporting
8051 if the argument is not a number or
8053 if no such attachment exists.
8056 Adds the attachment given as the third argument, specified exactly as
8057 documented for the command line option
8059 and supporting the message number extension as documented for
8063 upon success, with the index of the new attachment following,
8065 if the given file cannot be opened,
8067 if an on-the-fly performed character set conversion fails, otherwise
8069 is reported; this is also reported if character set conversion is
8070 requested but not available.
8073 This uses the same search mechanism as described for
8075 and prints any known attributes of the first found attachment via
8079 if no such attachment can be found.
8080 The attributes are written as lines of keyword and value tuples, the
8081 keyword being separated from the rest of the line with an ASCII SP space
8085 This uses the same search mechanism as described for
8087 and is otherwise identical to
8090 .It Cm attribute-set
8091 This uses the same search mechanism as described for
8093 and will assign the attribute given as the fourth argument, which is
8094 expected to be a value tuple of keyword and other data, separated by
8095 a ASCII SP space or TAB tabulator character.
8096 If the value part is empty, then the given attribute is removed, or
8097 reset to a default value if existence of the attribute is crucial.
8101 upon success, with the index of the found attachment following,
8103 for message attachments or if the given keyword is invalid, and
8105 if no such attachment can be found.
8106 The following keywords may be used (case-insensitively):
8108 .Bl -hang -compact -width ".It Ql filename"
8110 Sets the filename of the MIME part, i.e., the name that is used for
8111 display and when (suggesting a name for) saving (purposes).
8112 .It Ql content-description
8113 Associate some descriptive information to the attachment's content, used
8114 in favour of the plain filename by some MUAs.
8116 May be used for uniquely identifying MIME entities in several contexts;
8117 this expects a special reference address format as defined in RFC 2045
8120 upon address content verification failure.
8122 Defines the media type/subtype of the part, which is managed
8123 automatically, but can be overwritten.
8124 .It Ql content-disposition
8125 Automatically set to the string
8129 .It Cm attribute-set-at
8130 This uses the same search mechanism as described for
8132 and is otherwise identical to
8141 .Ql Ic ~i Ns \| Va Sign .
8146 .Ql Ic ~i Ns \| Va sign .
8149 .It Ic ~b Ar name ...
8150 Add the given names to the list of blind carbon copy recipients.
8153 .It Ic ~c Ar name ...
8154 Add the given names to the list of carbon copy recipients.
8158 Read the file specified by the
8160 variable into the message.
8166 on the message collected so far, then return to compose mode.
8168 can be used for a more display oriented editor, and
8170 offers a pipe-based editing approach.
8173 .It Ic ~F Ar messages
8174 Read the named messages into the message being sent, including all
8175 message headers and MIME parts.
8176 If no messages are specified, read in the current message, the
8180 .It Ic ~f Ar messages
8181 Read the named messages into the message being sent.
8182 If no messages are specified, read in the current message, the
8184 Strips down the list of header fields according to the
8186 white- and blacklist selection of
8188 For MIME multipart messages,
8189 only the first displayable part is included.
8193 Edit the message header fields
8198 by typing each one in turn and allowing the user to edit the field.
8199 The default values for these fields originate from the
8207 Edit the message header fields
8213 by typing each one in turn and allowing the user to edit the field.
8216 .It Ic ~I Ar variable
8217 Insert the value of the specified variable into the message.
8218 The message remains unaltered if the variable is unset or empty.
8219 Any embedded character sequences
8221 horizontal tabulator and
8223 line feed are expanded in
8225 mode; otherwise the expansion should occur at
8227 time (\*(ID by using the command modifier
8231 .It Ic ~i Ar variable
8234 but appends a newline character.
8237 .It Ic ~M Ar messages
8238 Read the named messages into the message being sent,
8241 If no messages are specified, read the current message, the
8245 .It Ic ~m Ar messages
8246 Read the named messages into the message being sent,
8249 If no messages are specified, read the current message, the
8251 Strips down the list of header fields according to the
8253 white- and blacklist selection of
8255 For MIME multipart messages,
8256 only the first displayable part is included.
8260 Display the message collected so far,
8261 prefaced by the message header fields
8262 and followed by the attachment list, if any.
8266 Read in the given / current message(s) according to the algorithm of
8271 Abort the message being sent,
8272 copying it to the file specified by the
8279 .It Ic ~R Ar filename
8282 but indent each line that has been read by
8286 .It Ic ~r Ar filename Op Ar HERE-delimiter
8287 Read the named file, object to the usual
8288 .Sx "Filename transformations" ,
8289 into the message; if (the expanded)
8293 then standard input is used, e.g., for pasting purposes.
8294 Only in this latter mode
8296 may be given: if it is data will be read in until the given
8298 is seen on a line by itself, and encountering EOF is an error; the
8300 is a required argument in non-interactive mode; if it is single-quote
8301 quoted then the pasted content will not be expanded, \*(ID otherwise
8302 a future version of \*(UA may perform shell-style expansion on the content.
8306 Cause the named string to become the current subject field.
8307 Newline (NL) and carriage-return (CR) bytes are invalid and will be
8308 normalized to space (SP) characters.
8311 .It Ic ~t Ar name ...
8312 Add the given name(s) to the direct recipient list.
8315 .It Ic ~U Ar messages
8316 Read in the given / current message(s) excluding all headers, indented by
8320 .It Ic ~u Ar messages
8321 Read in the given / current message(s), excluding all headers.
8327 editor on the message collected so far, then return to compose mode.
8329 can be used for a less display oriented editor, and
8331 offers a pipe-based editing approach.
8334 .It Ic ~w Ar filename
8335 Write the message onto the named file, which is object to the usual
8336 .Sx "Filename transformations" .
8338 the message is appended to it.
8344 except that the message is not saved at all.
8350 .\" .Sh INTERNAL VARIABLES {{{
8351 .Sh "INTERNAL VARIABLES"
8353 Internal \*(UA variables are controlled via the
8357 commands; prefixing a variable name with the string
8361 has the same effect as using
8368 will give more insight on the given variable(s), and
8370 when called without arguments, will show a listing of all variables.
8371 Both commands support a more
8374 Some well-known variables will also become inherited from the
8377 implicitly, others can be imported explicitly with the command
8379 and henceforth share said properties.
8382 Two different kinds of internal variables exist, and both of which can
8384 There are boolean variables, which can only be in one of the two states
8388 and value variables with a(n optional) string value.
8389 For the latter proper quoting is necessary upon assignment time, the
8390 introduction of the section
8392 documents the supported quoting rules.
8394 .Bd -literal -offset indent
8395 ? wysh set one=val\e 1 two="val 2" \e
8396 three='val "3"' four=$'val \e'4\e''; \e
8397 varshow one two three four; \e
8398 unset one two three four
8402 Dependent upon the actual option string values may become interpreted as
8403 colour names, command specifications, normal text, etc.
8404 They may be treated as numbers, in which case decimal values are
8405 expected if so documented, but otherwise any numeric format and
8406 base that is valid and understood by the
8408 command may be used, too.
8411 There also exists a special kind of string value, the
8412 .Dq boolean string ,
8413 which must either be a decimal integer (in which case
8417 and any other value is true) or any of the (case-insensitive) strings
8423 for a false boolean and
8429 for a true boolean; a special kind of boolean string is the
8431 which is a boolean string that can optionally be prefixed with the
8432 (case-insensitive) term
8436 which causes prompting of the user in interactive mode, with the given
8437 boolean as the default value.
8440 Variable chains extend a plain
8445 .Ql variable-USER@HOST
8449 will be converted to all lowercase when looked up (but not when the
8450 variable is set or unset!), \*(OPally IDNA converted, and indeed means
8454 had been specified in the contextual Uniform Resource Locator URL, see
8455 .Sx "On URL syntax and credential lookup" .
8456 Even though this mechanism is based on URLs no URL percent encoding may
8457 be applied to neither of
8461 variable chains need to be specified using raw data;
8462 the mentioned section contains examples.
8463 Variables which support chains are explicitly documented as such, and
8464 \*(UA treats the base name of any such variable special, meaning that
8465 users should not create custom names like
8467 in order to avoid false classifications and treatment of such variables.
8469 .\" .Ss "Initial settings" {{{
8470 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
8471 .Ss "Initial settings"
8473 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8479 .Pf no Va autoprint ,
8493 .Pf no Va ignoreeof ,
8495 .Pf no Va keepsave ,
8497 .Pf no Va outfolder ,
8505 .Pf no Va sendwait ,
8514 Notes: \*(UA does not support the
8516 variable \(en use command line options or
8518 to pass options through to a
8520 And the default global
8522 file, which is loaded unless the
8524 (with according argument) or
8526 command line options have been used, or the
8527 .Ev MAILX_NO_SYSTEM_RC
8528 environment variable is set (see
8529 .Sx "Resource files" )
8530 bends those initial settings a bit, e.g., it sets the variables
8535 to name a few, establishes a default
8537 selection etc., and should thus be taken into account.
8540 .\" .Ss "Variables" {{{
8543 .Bl -tag -width ".It Va BaNg"
8547 \*(RO The exit status of the last command, or the
8552 This status has a meaning in the state machine: in conjunction with
8554 any non-0 exit status will cause a program exit, and in
8556 mode any error while loading (any of the) resource files will have the
8560 .Sx "Command modifiers" ,
8561 can be used to instruct the state machine to ignore errors.
8565 \*(RO The current error number
8566 .Pf ( Xr errno 3 ) ,
8567 which is set after an error occurred; it is also available via
8569 and the error name and documentation string can be queried via
8573 \*(ID This machinery is new and the error number is only really usable
8574 if a command explicitly states that it manages the variable
8576 for others errno will be used in case of errors, or
8578 if that is 0: it thus may or may not reflect the real error.
8579 The error number may be set with the command
8585 \*(RO This is a multiplexer variable which performs dynamic expansion of
8586 the requested state or condition, of which there are:
8589 .Bl -tag -compact -width ".It Va BaNg"
8593 .It Va ^ERR , ^ERRDOC , ^ERRNAME
8594 The number, documentation, and name of the current
8596 respectively, which is usually set after an error occurred.
8597 The documentation is an \*(OP, the name is used if not available.
8598 \*(ID This machinery is new and is usually reliable only if a command
8599 explicitly states that it manages the variable
8601 which is effectively identical to
8603 Each of those variables can be suffixed with a hyphen minus followed by
8604 a name or number, in which case the expansion refers to the given error.
8605 Note this is a direct mapping of (a subset of) the system error values:
8606 .Bd -literal -offset indent
8608 eval echo \e$1: \e$^ERR-$1:\e
8609 \e$^ERRNAME-$1: \e$^ERRDOC-$1
8610 vput vexpr i + "$1" 1
8622 \*(RO Expands all positional parameters (see
8624 separated by the first character of the value of
8626 \*(ID The special semantics of the equally named special parameter of the
8628 are not yet supported.
8632 \*(RO Expands all positional parameters (see
8634 separated by a space character.
8635 If placed in double quotation marks, each positional parameter is
8636 properly quoted to expand to a single parameter again.
8640 \*(RO Expands to the number of positional parameters, i.e., the size of
8641 the positional parameter stack in decimal.
8645 \*(RO Inside the scope of a
8649 ed macro this expands to the name of the calling macro, or to the empty
8650 string if the macro is running from top-level.
8651 For the \*(OPal regular expression search and replace operator of
8653 this expands to the entire matching expression.
8654 It represents the program name in global context.
8658 \*(RO Access of the positional parameter stack.
8659 All further parameters can be accessed with this syntax, too, e.g.,
8662 etc.; positional parameters can be shifted off the stack by calling
8664 The parameter stack contains, e.g., the arguments of a
8668 d macro, the matching groups of the \*(OPal regular expression search
8669 and replace expression of
8671 and can be explicitly created or overwritten with the command
8676 \*(RO Is set to the active
8680 .It Va add-file-recipients
8681 \*(BO When file or pipe recipients have been specified,
8682 mention them in the corresponding address fields of the message instead
8683 of silently stripping them from their recipient list.
8684 By default such addressees are not mentioned.
8688 \*(BO Causes only the local part to be evaluated
8689 when comparing addresses.
8693 \*(BO Causes messages saved in the
8695 .Sx "secondary mailbox"
8697 to be appended to the end rather than prepended.
8698 This should always be set.
8702 \*(BO Causes the prompts for
8706 lists to appear after the message has been edited.
8710 \*(BO If set, \*(UA asks for files to attach at the end of each message.
8711 An empty line finalizes the list.
8715 \*(BO Causes the user to be prompted for carbon copy recipients
8716 (at the end of each message if
8724 \*(BO Causes the user to be prompted for blind carbon copy
8725 recipients (at the end of each message if
8733 \*(BO Causes the user to be prompted for confirmation to send the
8734 message or reenter compose mode after having been shown an envelope
8736 This is by default enabled.
8740 \*(BO\*(OP Causes the user to be prompted if the message is to be
8741 signed at the end of each message.
8744 variable is ignored when this variable is set.
8748 .\" The alternative *ask* is not documented on purpose
8749 \*(BO Causes \*(UA to prompt for the subject upon entering compose mode
8750 unless a subject already exists.
8754 A sequence of characters to display in the
8758 as shown in the display of
8760 each for one type of messages (see
8761 .Sx "Message states" ) ,
8762 with the default being
8765 .Ql NU\ \ *HMFAT+\-$~
8768 variable is set, in the following order:
8770 .Bl -tag -compact -width ".It Ql _"
8792 \*(ID start of a (collapsed) thread in threaded mode (see
8796 \*(ID an uncollapsed thread in threaded mode; only used in conjunction with
8801 classified as possible spam.
8807 Specifies a list of recipients to which a blind carbon copy of each
8808 outgoing message will be sent automatically.
8812 Specifies a list of recipients to which a carbon copy of each outgoing
8813 message will be sent automatically.
8817 \*(BO Causes threads to be collapsed automatically when .Ql thread Ns
8820 mode is entered (see the
8826 \*(BO Enable automatic
8828 ing of a(n existing)
8834 commands, e.g., the message that becomes the new
8836 is shown automatically, as via
8843 Causes sorted mode (see the
8845 command) to be entered automatically with the value of this variable as
8846 sorting method when a folder is opened, e.g.,
8847 .Ql set autosort=thread .
8851 \*(BO Enables the substitution of all not (reverse-solidus) escaped
8854 characters by the contents of the last executed command for the
8856 shell escape command and
8858 one of the compose mode
8859 .Sx "COMMAND ESCAPES" .
8860 If this variable is not set no reverse solidus stripping is performed.
8864 \*(OP Terminals generate multi-byte sequences for certain forms of
8865 input, for example for function and other special keys.
8866 Some terminals however do not write these multi-byte sequences as
8867 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
8868 This variable specifies the timeout in milliseconds that the MLE (see
8869 .Sx "On terminal control and line editor" )
8870 waits for more bytes to arrive unless it considers a sequence
8876 \*(BO Sets some cosmetical features to traditional BSD style;
8877 has the same affect as setting
8879 and all other variables prefixed with
8881 it also changes the behaviour of
8883 (which does not exist in BSD).
8887 \*(BO Changes the letters shown in the first column of a header
8888 summary to traditional BSD style.
8892 \*(BO Changes the display of columns in a header summary to traditional
8897 \*(BO Changes some informational messages to traditional BSD style.
8903 field to appear immediately after the
8905 field in message headers and with the
8907 .Sx "COMMAND ESCAPES" .
8913 .It Va build-cc , build-ld , build-os , build-rest
8914 \*(RO The build environment, including the compiler, the linker, the
8915 operating system \*(UA has been build for, usually taken from
8919 and then lowercased, as well as all the rest that may possibly be useful
8920 to include in a bug report, respectively.
8924 The value that should appear in the
8928 MIME header fields when no character set conversion of the message data
8930 This defaults to US-ASCII, and the chosen character set should be
8931 US-ASCII compatible.
8935 \*(OP The default 8-bit character set that is used as an implicit last
8936 member of the variable
8938 This defaults to UTF-8 if character set conversion capabilities are
8939 available, and to ISO-8859-1 otherwise (unless the operating system
8940 environment is known to always and exclusively support UTF-8 locales),
8941 in which case the only supported character set is
8943 and this variable is effectively ignored.
8944 Refer to the section
8945 .Sx "Character sets"
8946 for the complete picture of character set conversion in \*(UA.
8949 .It Va charset-unknown-8bit
8950 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
8952 the content of a mail message by using a character set with the name
8954 Because of the unclassified nature of this character set \*(UA will not
8955 be capable to convert this character set to any other character set.
8956 If this variable is set any message part which uses the character set
8958 is assumed to really be in the character set given in the value,
8959 otherwise the (final) value of
8961 is used for this purpose.
8963 This variable will also be taken into account if a MIME type (see
8964 .Sx "The mime.types files" )
8965 of a MIME message part that uses the
8967 character set is forcefully treated as text.
8971 The default value for the
8976 .It Va colour-disable
8977 \*(BO\*(OP Forcefully disable usage of colours.
8978 Also see the section
8979 .Sx "Coloured display" .
8983 \*(BO\*(OP Whether colour shall be used for output that is paged through
8985 Note that pagers may need special command line options, e.g.,
8993 in order to support colours.
8994 Often doing manual adjustments is unnecessary since \*(UA may perform
8995 adjustments dependent on the value of the environment variable
8997 (see there for more).
9001 .It Va contact-mail , contact-web
9002 \*(RO Addresses for contact per email and web, respectively, e.g., for
9003 bug reports, suggestions, or help regarding \*(UA.
9004 The former can be used directly:
9005 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
9009 In a(n interactive) terminal session, then if this valued variable is
9010 set it will be used as a threshold to determine how many lines the given
9011 output has to span before it will be displayed via the configured
9015 can be forced by setting this to the value
9017 setting it without a value will deduce the current height of the
9018 terminal screen to compute the threshold (see
9023 \*(ID At the moment this uses the count of lines of the message in wire
9024 format, which, dependent on the
9026 of the message, is unrelated to the number of display lines.
9027 (The software is old and historically the relation was a given thing.)
9031 Define a set of custom headers to be injected into newly composed or
9033 A custom header consists of the field name followed by a colon
9035 and the field content body.
9036 Standard header field names cannot be overwritten by a custom header.
9037 Different to the command line option
9039 the variable value is interpreted as a comma-separated list of custom
9040 headers: to include commas in header bodies they need to become escaped
9041 with reverse solidus
9043 Headers can be managed more freely in compose mode via
9046 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2, Hdr2: Body2'
9050 Controls the appearance of the
9052 date and time format specification of the
9054 variable, that is used, for example, when viewing the summary of
9056 If unset, then the local receiving date is used and displayed
9057 unformatted, otherwise the message sending
9059 It is possible to assign a
9061 format string and control formatting, but embedding newlines via the
9063 format is not supported, and will result in display errors.
9065 .Ql %Y-%m-%d %H:%M ,
9067 .Va datefield-markout-older .
9070 .It Va datefield-markout-older
9071 Only used in conjunction with
9073 Can be used to create a visible distinction of messages dated more than
9074 a day in the future, or older than six months, a concept comparable to the
9076 option of the POSIX utility
9078 If set to the empty string, then the plain month, day and year of the
9080 will be displayed, but a
9082 format string to control formatting can be assigned.
9088 \*(BO Enables debug messages and obsoletion warnings, disables the
9089 actual delivery of messages and also implies
9095 .It Va disposition-notification-send
9097 .Ql Disposition-Notification-To:
9098 header (RFC 3798) with the message.
9102 .\" TODO .It Va disposition-notification-send-HOST
9104 .\".Va disposition-notification-send
9105 .\" for SMTP accounts on a specific host.
9106 .\" TODO .It Va disposition-notification-send-USER@HOST
9108 .\".Va disposition-notification-send
9109 .\"for a specific account.
9113 \*(BO When dot is set, a period
9115 on a line by itself during message input in (interactive or batch
9117 compose mode will be treated as end-of-message (in addition to the
9118 normal end-of-file condition).
9119 This behaviour is implied in
9125 .It Va dotlock-disable
9126 \*(BO\*(OP Disable creation of
9131 .It Va dotlock-ignore-error
9132 \*(OB\*(BO\*(OP Ignore failures when creating
9134 .Sx "dotlock files" .
9141 If this variable is set then the editor is started automatically when
9142 a message is composed in interactive mode.
9143 If the value starts with the letter
9145 then this acts as if
9149 .Pf (see\0 Sx "COMMAND ESCAPES" )
9153 variable is implied for this automatically spawned editor session.
9157 \*(BO When a message is edited while being composed,
9158 its header is included in the editable text.
9162 \*(BO When entering interactive mode \*(UA normally writes
9163 .Dq \&No mail for user
9164 and exits immediately if a mailbox is empty or does not exist.
9165 If this variable is set \*(UA starts even with an empty or non-existent
9166 mailbox (the latter behaviour furtherly depends upon
9172 \*(BO Let each command with a non-0 exit status, including every
9176 s a non-0 status, cause a program exit unless prefixed by
9179 .Sx "Command modifiers" ) .
9181 .Sx "COMMAND ESCAPES" ,
9182 but which use a different modifier for ignoring the error.
9183 Please refer to the variable
9185 for more on this topic.
9189 The first character of this value defines the escape character for
9190 .Sx "COMMAND ESCAPES"
9192 The default value is the character tilde
9194 If set to the empty string, command escapes are disabled.
9198 If unset then file and command pipeline address targets are not allowed,
9199 and any such address will be filtered out, giving a warning message.
9200 If set then all possible recipient address specifications will be
9201 accepted unless a possible value content is more specific (also see
9202 .Sx "On sending mail, and non-interactive mode" ) ;
9203 if desired so only in interactive mode, or when tilde commands were
9204 enabled explicitly via
9208 the (case-insensitive) value
9210 can be used (this really acts like
9211 .Ql restrict,-all,+name,+addr ,
9212 so that care for ordering issues must be taken).
9214 The value is actually interpreted as a comma-separated list.
9217 the existence of disallowed addressees is treated as a hard send error
9218 instead of only causing them to be filtered out.
9219 Address targets can be added and subtracted by prefixing with a plus sign
9225 addresses all possible address specifications,
9229 command pipeline targets,
9231 plain user names and (MTA) aliases and
9234 Targets are interpreted in the given order, so that
9235 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
9236 will cause hard errors for any non-network address recipient address
9237 unless \*(UA is in interactive mode or has been started with the
9241 command line option; in the latter case(s) any address may be used, then.
9243 Historically invalid network addressees were silently stripped off.
9244 To change this so that any encountered invalid email address causes
9245 a hard error it must be ensured that
9247 is an entry in the above list, which automatically enables network
9248 addressees; it really acts like
9249 .Ql failinvaddr,+addr ,
9250 so that care for ordering issues must be taken.
9253 is present a few address providers (for example
9255 and all recipients given on the command line) will be will evaluated as
9256 if specified within dollar-single-quotes (see
9257 .Sx "Shell-style argument quoting" ) .
9261 Unless this variable is set additional
9263 (Mail-Transfer-Agent)
9264 arguments from the command line, as can be given after a
9266 separator, results in a program termination with failure status.
9267 The same can be accomplished by using the special (case-insensitive) value
9269 A lesser strict variant is the otherwise identical
9271 which does accept such arguments in interactive mode, or if tilde
9272 commands were enabled explicitly by using one of the command line options
9276 The empty value will allow unconditional usage.
9280 \*(RO String giving a list of optional features.
9281 Features are preceded with a plus sign
9283 if they are available, with a hyphen-minus
9286 The output of the command
9288 will include this information in a more pleasant output.
9292 \*(BO This setting reverses the meanings of a set of reply commands,
9293 turning the lowercase variants, which by default address all recipients
9294 included in the header of a message
9295 .Pf ( Ic reply , respond , followup )
9296 into the uppercase variants, which by default address the sender only
9297 .Pf ( Ic Reply , Respond , Followup )
9300 .Ic replysender , respondsender , followupsender
9302 .Ic replyall , respondall , followupall
9303 are not affected by the current setting of
9308 The default path under which mailboxes are to be saved:
9309 filenames that begin with the plus sign
9311 will have the plus sign replaced with the value of this variable if set,
9312 otherwise the plus sign will remain unchanged when doing
9313 .Sx "Filename transformations" ;
9316 for more on this topic, and know about standard imposed implications of
9318 The value supports a subset of transformations itself, and if the
9319 non-empty value does not start with a solidus
9323 will be prefixed automatically.
9324 Once the actual value is evaluated first, the internal variable
9326 will be updated for caching purposes.
9329 .It Va folder-hook-FOLDER , Va folder-hook
9332 macro which will be called whenever a
9335 The macro will also be invoked when new mail arrives,
9336 but message lists for commands executed from the macro
9337 only include newly arrived messages then.
9339 are activated by default in a folder hook, causing the covered settings
9340 to be reverted once the folder is left again.
9342 The specialized form will override the generic one if
9344 matches the file that is opened.
9345 Unlike other folder specifications, the fully expanded name of a folder,
9346 without metacharacters, is used to avoid ambiguities.
9347 However, if the mailbox resides under
9351 specification is tried in addition, e.g., if
9355 (and thus relative to the user's home directory) then
9356 .Pa /home/usr1/mail/sent
9358 .Ql folder-hook-/home/usr1/mail/sent
9359 first, but then followed by
9360 .Ql folder-hook-+sent .
9363 .It Va folder-resolved
9364 \*(RO Set to the fully resolved path of
9366 once that evaluation has occurred; rather internal.
9370 \*(BO Controls whether a
9371 .Ql Mail-Followup-To:
9372 header is generated when sending messages to known mailing lists.
9374 .Va followup-to-honour
9376 .Ic mlist , mlsubscribe , reply
9381 .It Va followup-to-honour
9383 .Ql Mail-Followup-To:
9384 header is honoured when group-replying to a message via
9388 This is a quadoption; if set without a value it defaults to
9398 .It Va forward-as-attachment
9399 \*(BO Original messages are normally sent as inline text with the
9402 and only the first part of a multipart message is included.
9403 With this setting enabled messages are sent as unmodified MIME
9405 attachments with all of their parts included.
9409 .It Va forward-inject-head , forward-inject-tail
9410 The strings to put before and after the text of a message with the
9412 command, respectively.
9413 The former defaults to
9414 .Ql -------- Original Message --------\en .
9415 Special format directives in these strings will be expanded if possible,
9416 and if so configured the output will be folded according to
9418 for more please refer to
9419 .Va quote-inject-head .
9420 These variables are ignored if the
9421 .Va forward-as-attachment
9427 The address (or a list of addresses) to put into the
9429 field of the message header, quoting RFC 5322:
9430 the author(s) of the message, that is, the mailbox(es) of the person(s)
9431 or system(s) responsible for the writing of the message.
9432 According to that RFC setting the
9434 variable is required if
9436 contains more than one address.
9437 Dependent on the context these addresses are handled as if they were in
9442 If a file-based MTA is used, then
9444 (or, if that contains multiple addresses,
9446 can nonetheless be enforced to appear as the envelope sender address at
9447 the MTA protocol level (the RFC 5321 reverse-path), either by using the
9449 command line option (with an empty argument; see there for the complete
9450 picture on this topic), or by setting the internal variable
9451 .Va r-option-implicit .
9454 If the machine's hostname is not valid at the Internet (for example at
9455 a dialup machine) then either this variable or
9459 adds even more fine-tuning capabilities with
9461 have to be set: if so the message and MIME part related unique ID fields
9465 will be created (except when disallowed by
9466 .Va message-id-disable
9473 \*(BO Due to historical reasons comments and name parts of email
9474 addresses are removed by default when sending mail, replying to or
9475 forwarding a message.
9476 If this variable is set such stripping is not performed.
9479 \*(OB Predecessor of
9480 .Va forward-inject-head .
9484 \*(BO Causes the header summary to be written at startup and after
9485 commands that affect the number of messages or the order of messages in
9490 mode a header summary will also be displayed on folder changes.
9491 The command line option
9499 A format string to use for the summary of
9501 Format specifiers in the given string start with a percent sign
9503 and may be followed by an optional decimal number indicating the field
9504 width \(em if that is negative, the field is to be left-aligned.
9505 Names and addresses are subject to modifications according to
9509 Valid format specifiers are:
9512 .Bl -tag -compact -width ".It Ql _%%_"
9514 A plain percent sign.
9517 a space character but for the current message
9519 for which it expands to
9522 .Va headline-plain ) .
9525 a space character but for the current message
9527 for which it expands to
9530 .Va headline-plain ) .
9532 \*(OP The spam score of the message, as has been classified via the
9535 Shows only a replacement character if there is no spam support.
9537 Message attribute character (status flag); the actual content can be
9541 The date found in the
9543 header of the message when
9545 is set (the default), otherwise the date when the message was received.
9546 Formatting can be controlled by assigning a
9551 .Va datefield-markout-older ) .
9553 The indenting level in
9559 The address of the message sender.
9561 The message thread tree structure.
9562 (Note that this format does not support a field width, and honours
9563 .Va headline-plain . )
9565 The number of lines of the message, if available.
9569 The number of octets (bytes) in the message, if available.
9571 Message subject (if any).
9573 Message subject (if any) in double quotes.
9575 Message recipient flags: is the addressee of the message a known or
9576 subscribed mailing list \(en see
9581 The position in threaded/sorted order.
9583 The value 0 except in an IMAP mailbox,
9584 where it expands to the UID of the message.
9588 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
9590 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
9602 .It Va headline-bidi
9603 Bidirectional text requires special treatment when displaying headers,
9604 because numbers (in dates or for file sizes etc.) will not affect the
9605 current text direction, in effect resulting in ugly line layouts when
9606 arabic or other right-to-left text is to be displayed.
9607 On the other hand only a minority of terminals is capable to correctly
9608 handle direction changes, so that user interaction is necessary for
9610 Note that extended host system support is required nonetheless, e.g.,
9611 detection of the terminal character set is one precondition;
9612 and this feature only works in an Unicode (i.e., UTF-8) locale.
9614 In general setting this variable will cause \*(UA to encapsulate text
9615 fields that may occur when displaying
9617 (and some other fields, like dynamic expansions in
9619 with special Unicode control sequences;
9620 it is possible to fine-tune the terminal support level by assigning
9622 no value (or any value other than
9627 will make \*(UA assume that the terminal is capable to properly deal
9628 with Unicode version 6.3, in which case text is embedded in a pair of
9629 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
9631 In addition no space on the line is reserved for these characters.
9633 Weaker support is chosen by using the value
9635 (Unicode 6.3, but reserve the room of two spaces for writing the control
9636 sequences onto the line).
9641 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
9642 again reserves room for two spaces in addition.
9645 .It Va headline-plain
9646 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
9647 used by default for certain entries of
9649 If this variable is set only basic US-ASCII symbols will be used.
9653 \*(OP If a line editor is available then this can be set to
9654 name the (expandable) path of the location of a permanent
9660 .It Va history-gabby
9661 \*(BO\*(OP Add more entries to the
9663 as is normally done.
9666 .It Va history-gabby-persist
9667 \*(BO\*(OP \*(UA's own MLE will not save the additional
9669 entries in persistent storage unless this variable is set.
9670 On the other hand it will not loose the knowledge of whether
9671 a persistent entry was gabby or not.
9677 \*(OP Setting this variable imposes a limit on the number of concurrent
9680 If set to the value 0 then no further history entries will be added,
9681 and loading and incorporation of the
9683 upon program startup can also be suppressed by doing this.
9684 Runtime changes will not be reflected before the
9686 is saved or loaded (again).
9690 \*(BO This setting controls whether messages are held in the system
9692 and it is set by default.
9696 Used instead of the value obtained from
9700 as the hostname when expanding local addresses, e.g., in
9703 .Sx "On sending mail, and non-interactive mode" ,
9704 especially for expansion of network addresses that contain domain-less
9705 valid user names in angle brackets).
9708 or this variable Is set the message and MIME part related unique ID fields
9712 will be created (except when disallowed by
9713 .Va message-id-disable
9716 If the \*(OPal IDNA support is available (see
9718 variable assignment is aborted when a necessary conversion fails.
9720 Setting it to the empty string will cause the normal hostname to be
9721 used, but nonetheless enables creation of said ID fields.
9722 \*(IN in conjunction with the built-in SMTP
9725 also influences the results:
9726 one should produce some test messages with the desired combination of
9735 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
9736 names according to the rules of IDNA (internationalized domain names
9738 Since the IDNA code assumes that domain names are specified with the
9740 character set, an UTF-8 locale charset is required to represent all
9741 possible international domain names (before conversion, that is).
9745 The input field separator that is used (\*(ID by some functions) to
9746 determine where to split input data.
9748 .Bl -tag -compact -width ".It MMM"
9750 Unsetting is treated as assigning the default value,
9753 If set to the empty value, no field splitting will be performed.
9755 If set to a non-empty value, all whitespace characters are extracted
9756 and assigned to the variable
9760 .Bl -tag -compact -width ".It MMM"
9763 will be ignored at the beginning and end of input.
9764 Diverging from POSIX shells default whitespace is removed in addition,
9765 which is owed to the entirely different line content extraction rules.
9767 Each occurrence of a character of
9769 will cause field-splitting, any adjacent
9771 characters will be skipped.
9776 \*(RO Automatically deduced from the whitespace characters in
9781 \*(BO Ignore interrupt signals from the terminal while entering
9782 messages; instead echo them as
9784 characters and discard the current line.
9788 \*(BO Ignore end-of-file conditions
9789 .Pf ( Ql control-D )
9790 in compose mode on message input and in interactive command input.
9791 If set an interactive command input session can only be left by
9792 explicitly using one of the commands
9796 and message input in compose mode can only be terminated by entering
9799 on a line by itself or by using the
9801 .Sx "COMMAND ESCAPES" ;
9802 Setting this implies the behaviour that
9810 If this is set to a non-empty string it will specify the user's
9812 .Sx "primary system mailbox" ,
9815 and the system-dependent default, and (thus) be used to replace
9818 .Sx "Filename transformations" ;
9821 for more on this topic.
9822 The value supports a subset of transformations itself.
9830 .Sx "COMMAND ESCAPES"
9833 option for indenting messages,
9834 in place of the POSIX mandated default tabulator character
9841 \*(BO If set, an empty
9843 .Sx "primary system mailbox"
9844 file is not removed.
9845 Note that, in conjunction with
9847 mode any empty file will be removed unless this variable is set.
9848 This may improve the interoperability with other mail user agents
9849 when using a common folder directory, and prevents malicious users
9850 from creating fake mailboxes in a world-writable spool directory.
9851 \*(ID Only local regular (MBOX) files are covered, Maildir and other
9852 mailbox types will never be removed, even if empty.
9855 .It Va keep-content-length
9856 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
9861 header fields that some MUAs generate by setting this variable.
9862 Since \*(UA does neither use nor update these non-standardized header
9863 fields (which in itself shows one of their conceptual problems),
9864 stripping them should increase interoperability in between MUAs that
9865 work with with same mailbox files.
9866 Note that, if this is not set but
9867 .Va writebackedited ,
9868 as below, is, a possibly performed automatic stripping of these header
9869 fields already marks the message as being modified.
9870 \*(ID At some future time \*(UA will be capable to rewrite and apply an
9872 to modified messages, and then those fields will be stripped silently.
9876 \*(BO When a message is saved it is usually discarded from the
9877 originating folder when \*(UA is quit.
9878 This setting causes all saved message to be retained.
9881 .It Va line-editor-disable
9882 \*(BO Turn off any enhanced line editing capabilities (see
9883 .Sx "On terminal control and line editor"
9887 .It Va line-editor-no-defaults
9888 \*(BO\*(OP Do not establish any default key binding.
9892 Error log message prefix string
9893 .Pf ( Ql "\*(uA: " ) .
9896 .It Va mailbox-display
9897 \*(RO The name of the current mailbox
9899 possibly abbreviated for display purposes.
9902 .It Va mailbox-resolved
9903 \*(RO The fully resolved path of the current mailbox.
9906 .It Va mailx-extra-rc
9907 An additional startup file that is loaded as the last of the
9908 .Sx "Resource files" .
9909 Use this file for commands that are not understood by other POSIX
9911 implementations, i.e., mostly anything which is not covered by
9912 .Sx "Initial settings" .
9916 \*(BO When a message is replied to and this variable is set,
9917 it is marked as having been
9920 .Sx "Message states" .
9924 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
9925 POSIX rules for detecting message boundaries (so-called
9927 lines) due to compatibility reasons, instead of the stricter rules that
9928 have been standardized in RFC 4155.
9929 This behaviour can be switched to the stricter RFC 4155 rules by
9930 setting this variable.
9931 (This is never necessary for any message newly generated by \*(UA,
9932 it only applies to messages generated by buggy or malicious MUAs, or may
9933 occur in old MBOX databases: \*(UA itself will choose a proper
9935 to avoid false interpretation of
9937 content lines in the MBOX database.)
9939 This may temporarily be handy when \*(UA complains about invalid
9941 lines when opening a MBOX: in this case setting this variable and
9942 re-opening the mailbox in question may correct the result.
9943 If so, copying the entire mailbox to some other file, as in
9944 .Ql copy * SOME-FILE ,
9945 will perform proper, all-compatible
9947 quoting for all detected messages, resulting in a valid MBOX mailbox.
9948 Finally the variable can be unset again:
9949 .Bd -literal -offset indent
9951 localopts yes; wysh set mbox-rfc4155;\e
9952 wysh File "${1}"; eval copy * "${2}"
9954 call mboxfix /tmp/bad.mbox /tmp/good.mbox
9959 \*(BO Internal development variable.
9962 .It Va message-id-disable
9963 \*(BO By setting this variable the generation of
9967 message and MIME part headers can be completely suppressed, effectively
9968 leaving this task up to the
9970 (Mail-Transfer-Agent) or the SMTP server.
9971 Note that according to RFC 5321 a SMTP server is not required to add this
9972 field by itself, so it should be ensured that it accepts messages without
9976 .It Va message-inject-head
9977 A string to put at the beginning of each new message, followed by a newline.
9978 \*(OB The escape sequences tabulator
9982 are understood (use the
9986 ting the variable(s) instead).
9989 .It Va message-inject-tail
9990 A string to put at the end of each new message, followed by a newline.
9991 \*(OB The escape sequences tabulator
9995 are understood (use the
9999 ting the variable(s) instead).
10003 \*(BO Usually, when an
10005 expansion contains the sender, the sender is removed from the expansion.
10006 Setting this option suppresses these removals.
10011 option to be passed through to the
10013 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
10014 this flag, no MTA is known which does not support it (for historical
10018 .It Va mime-allow-text-controls
10019 \*(BO When sending messages, each part of the message is MIME-inspected
10020 in order to classify the
10023 .Ql Content-Transfer-Encoding:
10025 .Va mime-encoding )
10026 that is required to send this part over mail transport, i.e.,
10027 a computation rather similar to what the
10029 command produces when used with the
10033 This classification however treats text files which are encoded in
10034 UTF-16 (seen for HTML files) and similar character sets as binary
10035 octet-streams, forcefully changing any
10040 .Ql application/octet-stream :
10041 If that actually happens a yet unset charset MIME parameter is set to
10043 effectively making it impossible for the receiving MUA to automatically
10044 interpret the contents of the part.
10046 If this variable is set, and the data was unambiguously identified as
10047 text data at first glance (by a
10051 file extension), then the original
10053 will not be overwritten.
10056 .It Va mime-alternative-favour-rich
10057 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
10058 HTML) will be preferred in favour of included plain text versions when
10059 displaying messages, provided that a handler exists which produces
10060 output that can be (re)integrated into \*(UA's normal visual display.
10061 (E.g., at the time of this writing some newsletters ship their full
10062 content only in the rich HTML part, whereas the plain text part only
10063 contains topic subjects.)
10066 .It Va mime-counter-evidence
10069 field is used to decide how to handle MIME parts.
10070 Some MUAs, however, do not use
10071 .Sx "The mime.types files"
10073 .Sx "HTML mail and MIME attachments" )
10074 or a similar mechanism to correctly classify content, but specify an
10075 unspecific MIME type
10076 .Pf ( Ql application/octet-stream )
10077 even for plain text attachments.
10078 If this variable is set then \*(UA will try to re-classify such MIME
10079 message parts, if possible, for example via a possibly existing
10080 attachment filename.
10081 A non-empty value may also be given, in which case a number is expected,
10082 actually a carrier of bits, best specified as a binary value, e.g.,
10085 .Bl -bullet -compact
10087 If bit two is set (counting from 1, decimal 2) then the detected
10089 will be carried along with the message and be used for deciding which
10090 MIME handler is to be used, for example;
10091 when displaying such a MIME part the part-info will indicate the
10092 overridden content-type by showing a plus sign
10095 If bit three is set (decimal 4) then the counter-evidence is always
10096 produced and a positive result will be used as the MIME type, even
10097 forcefully overriding the parts given MIME type.
10099 If bit four is set (decimal 8) as a last resort the actual content of
10100 .Ql application/octet-stream
10101 parts will be inspected, so that data which looks like plain text can be
10103 This mode is even more relaxed when data is to be displayed to the user
10104 or used as a message quote (data consumers which mangle data for display
10105 purposes, which includes masking of control characters, for example).
10109 .It Va mime-encoding
10111 .Ql Content-Transfer-Encoding
10112 to use in outgoing text messages and message parts, where applicable.
10113 (7-bit clean text messages are sent as-is, without a transfer encoding.)
10116 .Bl -tag -compact -width ".It Ql _%%_"
10118 .Pf (Or\0 Ql 8b . )
10119 8-bit transport effectively causes the raw data be passed through
10120 unchanged, but may cause problems when transferring mail messages over
10121 channels that are not ESMTP (RFC 1869) compliant.
10122 Also, several input data constructs are not allowed by the
10123 specifications and may cause a different transfer-encoding to be used.
10124 .It Ql quoted-printable
10125 .Pf (Or\0 Ql qp . )
10126 Quoted-printable encoding is 7-bit clean and has the property that ASCII
10127 characters are passed through unchanged, so that an english message can
10128 be read as-is; it is also acceptable for other single-byte locales that
10129 share many characters with ASCII, like, e.g., ISO-8859-1.
10130 The encoding will cause a large overhead for messages in other character
10131 sets: e.g., it will require up to twelve (12) bytes to encode a single
10132 UTF-8 character of four (4) bytes.
10133 It is the default encoding.
10135 .Pf (Or\0 Ql b64 . )
10136 This encoding is 7-bit clean and will always be used for binary data.
10137 This encoding has a constant input:output ratio of 3:4, regardless of
10138 the character set of the input data it will encode three bytes of input
10139 to four bytes of output.
10140 This transfer-encoding is not human readable without performing
10145 .It Va mimetypes-load-control
10146 Can be used to control which of
10147 .Sx "The mime.types files"
10148 are loaded: if the letter
10150 is part of the option value, then the user's personal
10152 file will be loaded (if it exists); likewise the letter
10154 controls loading of the system wide
10156 directives found in the user file take precedence, letter matching is
10158 If this variable is not set \*(UA will try to load both files.
10159 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
10160 but they will be matched last (the order can be listed via
10163 More sources can be specified by using a different syntax: if the
10164 value string contains an equals sign
10166 then it is instead parsed as a comma-separated list of the described
10169 pairs; the given filenames will be expanded and loaded, and their
10170 content may use the extended syntax that is described in the section
10171 .Sx "The mime.types files" .
10172 Directives found in such files always take precedence (are prepended to
10173 the MIME type cache).
10178 To choose an alternate Mail-Transfer-Agent, set this option to either
10179 the full pathname of an executable (optionally prefixed with the protocol
10181 or \*(OPally a SMTP a.k.a. SUBMISSION protocol URL, e.g., \*(IN
10183 .Dl submissions://[user[:password]@]server[:port]
10186 .Ql [smtp://]server[:port] . )
10187 The default has been chosen at compile time.
10188 All supported data transfers are executed in child processes, which
10189 run asynchronously and without supervision unless either the
10194 If such a child receives a TERM signal, it will abort and
10201 For a file-based MTA it may be necessary to set
10203 in in order to choose the right target of a modern
10206 It will be passed command line arguments from several possible sources:
10209 if set, from the command line if given and the variable
10212 Argument processing of the MTA will be terminated with a
10217 The otherwise occurring implicit usage of the following MTA command
10218 line arguments can be disabled by setting the boolean variable
10219 .Va mta-no-default-arguments
10220 (which will also disable passing
10224 (for not treating a line with only a dot
10226 character as the end of input),
10228 (shall the variable
10234 variable is set); in conjunction with the
10236 command line option \*(UA will also (not) pass
10238 as well as possibly
10242 \*(OPally \*(UA can send mail over SMTP a.k.a. SUBMISSION network
10243 connections to a single defined smart host by setting this variable to
10244 a SMTP or SUBMISSION URL (see
10245 .Sx "On URL syntax and credential lookup" ) .
10246 An authentication scheme can be specified via the variable chain
10248 Encrypted network connections are \*(OPally available, the section
10249 .Sx "Encrypted network communication"
10250 should give an overview and provide links to more information on this.
10251 Note that with some mail providers it may be necessary to set the
10253 variable in order to use a specific combination of
10258 \*(UA also supports forwarding of all network traffic over a specified
10260 The following SMTP variants may be used:
10264 The plain SMTP protocol (RFC 5321) that normally lives on the
10265 server port 25 and requires setting the
10266 .Va smtp-use-starttls
10267 variable to enter a TLS encrypted session state.
10268 Assign a value like \*(IN
10269 .Ql smtp://[user[:password]@]server[:port]
10271 .Ql smtp://server[:port] )
10272 to choose this protocol.
10274 The so-called SMTPS which is supposed to live on server port 465
10275 and is automatically TLS secured.
10276 Unfortunately it never became a standardized protocol and may thus not
10277 be supported by your hosts network service database
10278 \(en in fact the port number has already been reassigned to other
10281 SMTPS is nonetheless a commonly offered protocol and thus can be
10282 chosen by assigning a value like \*(IN
10283 .Ql smtps://[user[:password]@]server[:port]
10285 .Ql smtps://server[:port] ) ;
10286 due to the mentioned problems it is usually necessary to explicitly
10287 specify the port as
10291 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
10292 is identically to the SMTP protocol from \*(UA's point of view;
10293 it requires setting
10294 .Va smtp-use-starttls
10295 to enter a TLS secured session state; e.g., \*(IN
10296 .Ql submission://[user[:password]@]server[:port] .
10298 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
10299 TLS secured by default.
10300 It can be chosen by assigning a value like \*(IN
10301 .Ql submissions://[user[:password]@]server[:port] .
10302 Due to the problems mentioned for SMTPS above and the fact that
10303 SUBMISSIONS is new and a successor that lives on the same port as the
10304 historical engineering mismanagement named SMTPS, it is usually
10305 necessary to explicitly specify the port as
10311 .It Va mta-arguments
10312 Arguments to pass through to a file-based
10314 can be given via this variable, which is parsed according to
10315 .Sx "Shell-style argument quoting"
10316 into an array of arguments, and which will be joined onto MTA options
10317 from other sources, and then passed individually to the MTA:
10318 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
10321 .It Va mta-no-default-arguments
10322 \*(BO Unless this variable is set \*(UA will pass some well known
10323 standard command line options to a file-based
10325 (Mail-Transfer-Agent), see there for more.
10328 .It Va mta-no-receiver-arguments
10329 \*(BO By default a file-based
10331 will be passed all receiver addresses on the command line.
10332 This variable can be set to suppress any such argument.
10336 Many systems use a so-called
10338 environment to ensure compatibility with
10340 This works by inspecting the name that was used to invoke the mail
10342 If this variable is set then the mailwrapper (the program that is
10343 actually executed when calling the file-based
10345 will treat its contents as that name.
10347 .Mx Va netrc-lookup
10348 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
10349 \*(BO\*(IN\*(OP Used to control usage of the user's
10351 file for lookup of account credentials, as documented in the section
10352 .Sx "On URL syntax and credential lookup"
10353 and for the command
10356 .Sx "The .netrc file"
10357 documents the file format.
10369 then \*(UA will read the output of a shell pipe instead of the user's
10371 file if this variable is set (to the desired shell command).
10372 This can be used to, e.g., store
10375 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
10379 \*(OP If this variable has the value
10381 newly created local folders will be in Maildir instead of MBOX format.
10385 Checks for new mail in the current folder each time the prompt is shown.
10386 A Maildir folder must be re-scanned to determine if new mail has arrived.
10387 If this variable is set to the special value
10389 then a Maildir folder will not be rescanned completely, but only
10390 timestamp changes are detected.
10391 Maildir folders are \*(OPal.
10395 \*(BO Unless specified as absolute pathnames, causes the filename given
10399 and the sender-based filenames for the
10403 commands to be interpreted relative to the directory given in the
10405 variable rather than relative to the current directory.
10407 .Mx Va on-account-cleanup
10408 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
10409 Macro hook which will be called once an
10411 is left, as the very last step before unrolling per-account
10413 This hook is run even in case of fatal errors, and it is advisable to
10414 perform only absolutely necessary actions, like cleaning up
10417 The specialized form is used in favour of the generic one if found.
10420 .It Va on-compose-cleanup
10421 Macro hook which will be called after the message has been sent (or not,
10422 in case of failures), as the very last step before unrolling compose mode
10424 This hook is run even in case of fatal errors, and it is advisable to
10425 perform only absolutely necessary actions, like cleaning up
10429 For compose mode hooks that may affect the message content please see
10430 .Va on-compose-enter , on-compose-leave , on-compose-splice .
10431 \*(ID This hook exists because
10432 .Ic alias , alternates , commandalias , shortcut ,
10433 to name a few, are neither covered by
10437 changes applied in compose mode will continue to be in effect thereafter.
10442 .It Va on-compose-enter , on-compose-leave
10443 Macro hooks which will be called once compose mode is entered,
10444 and after composing has been finished, respectively;
10445 the exact order of the steps taken is documented for
10448 .Sx "COMMAND ESCAPES" .
10449 Context about the message being worked on can be queried via
10452 are enabled for these hooks, and changes on variables will be forgotten
10453 after the message has been sent.
10454 .Va on-compose-cleanup
10455 can be used to perform other necessary cleanup steps.
10458 Here is am example that injects a signature via
10459 .Va message-inject-tail ;
10461 .Va on-compose-splice
10462 to simply inject the file of desire via
10466 may be a better approach.
10468 .Bd -literal -offset indent
10470 vput ! i cat ~/.mysig
10472 vput vexpr message-inject-tail trim-end $i
10476 readctl create ~/.mysig
10480 vput vexpr message-inject-tail trim-end $i
10482 readctl remove ~/.mysig
10485 set on-compose-leave=t_ocl
10491 .It Va on-compose-splice , on-compose-splice-shell
10492 These hooks run once the normal compose mode is finished, but before the
10493 .Va on-compose-leave
10494 macro hook is called etc.
10495 Both hooks will be executed in a subprocess, with their input and output
10496 connected to \*(UA such that they can act as if they would be an
10498 The difference in between them is that the latter is a
10500 command, whereas the former is a normal
10502 d macro, but which is restricted to a small set of commands (the
10506 will indicate said capability).
10508 are enabled for these hooks (in the parent process), causing any setting
10509 to be forgotten after the message has been sent;
10510 .Va on-compose-cleanup
10511 can be used to perform other cleanup as necessary.
10514 During execution of these hooks \*(UA will temporarily forget whether it
10515 has been started in interactive mode, (a restricted set of)
10516 .Sx "COMMAND ESCAPES"
10517 will always be available, and for guaranteed reproducibilities sake
10521 will be set to their defaults.
10522 The compose mode command
10524 has been especially designed for scriptability (via these hooks).
10525 The first line the hook will read on its standard input is the protocol
10526 version of said command escape, currently
10528 backward incompatible protocol changes have to be expected.
10531 Care must be taken to avoid deadlocks and other false control flow:
10532 if both involved processes wait for more input to happen at the
10533 same time, or one does not expect more input but the other is stuck
10534 waiting for consumption of its output, etc.
10535 There is no automatic synchronization of the hook: it will not be
10536 stopped automatically just because it, e.g., emits
10538 The hooks will however receive a termination signal if the parent enters
10539 an error condition.
10540 \*(ID Protection against and interaction with signals is not yet given;
10541 it is likely that in the future these scripts will be placed in an
10542 isolated session, which is signalled in its entirety as necessary.
10544 .Bd -literal -offset indent
10545 define ocs_signature {
10547 echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
10549 set on-compose-splice=ocs_signature
10551 wysh set on-compose-splice-shell=$'\e
10553 printf "hello $version! Headers: ";\e
10554 echo \e'~^header list\e';\e
10555 read status result;\e
10556 echo "status=$status result=$result";\e
10561 echo Splice protocol version is $version
10562 echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
10564 echoerr 'Cannot read header list'; echo '~x'; xit
10566 if [ "$hl" @i!% ' cc' ]
10567 echo '~^h i cc Diet is your <mirr.or>'; read es;\e
10568 vput vexpr es substring "${es}" 0 1
10570 echoerr 'Cannot insert Cc: header'; echo '~x'
10571 # (no xit, macro finishs anyway)
10575 set on-compose-splice=ocsm
10580 .It Va on-resend-cleanup
10582 .Va on-compose-cleanup ,
10583 but is only triggered by
10587 .It Va on-resend-enter
10589 .Va on-compose-enter ,
10590 but is only triggered by
10592 currently there is no
10594 support, for example.
10598 \*(BO If set, each message feed through the command given for
10600 is followed by a formfeed character
10604 .It Va password-USER@HOST , password-HOST , password
10605 \*(IN Variable chain that sets a password, which is used in case none has
10606 been given in the protocol and account-specific URL;
10607 as a last resort \*(UA will ask for a password on the user's terminal if
10608 the authentication method requires a password.
10609 Specifying passwords in a startup file is generally a security risk;
10610 the file should be readable by the invoking user only.
10612 .It Va password-USER@HOST
10613 \*(OU (see the chain above for \*(IN)
10614 Set the password for
10618 If no such variable is defined for a host,
10619 the user will be asked for a password on standard input.
10620 Specifying passwords in a startup file is generally a security risk;
10621 the file should be readable by the invoking user only.
10625 \*(BO Send messages to the
10627 command without performing MIME and character set conversions.
10631 .It Va pipe-TYPE/SUBTYPE
10632 When a MIME message part of type
10634 (case-insensitive) is displayed or quoted,
10635 its text is filtered through the value of this variable interpreted as
10637 Note that only parts which can be displayed inline as plain text (see
10638 .Cd copiousoutput )
10639 are displayed unless otherwise noted, other MIME parts will only be
10640 considered by and for the command
10644 The special value commercial at
10646 forces interpretation of the message part as plain text, e.g.,
10647 .Ql set pipe-application/xml=@
10648 will henceforth display XML
10650 (The same could also be achieved by adding a MIME type marker with the
10653 And \*(OPally MIME type handlers may be defined via
10654 .Sx "The Mailcap files"
10655 \(em these directives,
10657 has already been used, should be referred to for further documentation.
10662 can in fact be used as a trigger character to adjust usage and behaviour
10663 of a following shell command specification more thoroughly by appending
10664 more special characters which refer to further mailcap directives, e.g.,
10665 the following hypothetical command specification could be used:
10667 .Bd -literal -offset indent
10668 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
10672 .Bl -tag -compact -width ".It Ql __"
10674 The command produces plain text to be integrated in \*(UAs output:
10675 .Cd copiousoutput .
10678 If set the handler will not be invoked when a message is to be quoted,
10679 but only when it will be displayed:
10680 .Cd x-mailx-noquote .
10683 Run the command asynchronously, i.e., without blocking \*(UA:
10684 .Cd x-mailx-async .
10687 The command must be run on an interactive terminal, \*(UA will
10688 temporarily release the terminal to it:
10689 .Cd needsterminal .
10692 Request creation of a zero-sized temporary file, the absolute pathname
10693 of which will be made accessible via the environment variable
10694 .Ev MAILX_FILENAME_TEMPORARY :
10695 .Cd x-mailx-tmpfile .
10696 If given twice then the file will be unlinked automatically by \*(UA
10697 when the command loop is entered again at latest:
10698 .Cd x-mailx-tmpfile-unlink .
10701 Normally the MIME part content is passed to the handler via standard
10702 input; if this flag is set then the data will instead be written into
10703 .Ev MAILX_FILENAME_TEMPORARY
10704 .Pf ( Cd x-mailx-tmpfile-fill ) ,
10705 the creation of which is implied; note however that in order to cause
10706 deletion of the temporary file you still have to use two plus signs
10711 To avoid ambiguities with normal shell command content you can use
10712 another commercial at to forcefully terminate interpretation of
10713 remaining characters.
10714 (Any character not in this list will have the same effect.)
10718 Some information about the MIME part to be displayed is embedded into
10719 the environment of the shell command:
10722 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
10724 .It Ev MAILX_CONTENT
10725 The MIME content-type of the part, if known, the empty string otherwise.
10728 .It Ev MAILX_CONTENT_EVIDENCE
10730 .Va mime-counter-evidence
10731 includes the carry-around-bit (2), then this will be set to the detected
10732 MIME content-type; not only then identical to
10733 .Ev \&\&MAILX_CONTENT
10737 .It Ev MAILX_EXTERNAL_BODY_URL
10739 .Ql message/external-body access-type=url
10740 will store the access URL in this variable, it is empty otherwise.
10741 URL targets should not be activated automatically, without supervision.
10744 .It Ev MAILX_FILENAME
10745 The filename, if any is set, the empty string otherwise.
10748 .It Ev MAILX_FILENAME_GENERATED
10752 .It Ev MAILX_FILENAME_TEMPORARY
10753 If temporary file creation has been requested through the command prefix
10754 this variable will be set and contain the absolute pathname of the
10760 .It Va pipe-EXTENSION
10761 This is identical to
10762 .Va pipe-TYPE/SUBTYPE
10765 (normalized to lowercase using character mappings of the ASCII charset)
10766 names a file extension, e.g.,
10768 Handlers registered using this method take precedence.
10771 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
10772 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
10773 The only possible value as of now is
10775 which is thus the default.
10777 .Mx Va pop3-bulk-load
10778 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
10779 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
10780 the messages, and only requests the message bodies on user request.
10781 For the POP3 protocol this means that the message headers will be
10783 If this variable is set then \*(UA will download only complete messages
10784 from the given POP3 server(s) instead.
10786 .Mx Va pop3-keepalive
10787 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
10788 \*(OP POP3 servers close the connection after a period of inactivity;
10789 the standard requires this to be at least 10 minutes,
10790 but practical experience may vary.
10791 Setting this variable to a numeric value greater than
10795 command to be sent each value seconds if no other operation is performed.
10797 .Mx Va pop3-no-apop
10798 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
10799 \*(BO\*(OP Unless this variable is set the
10801 authentication method will be used when connecting to a POP3 server that
10802 advertises support.
10805 is that the password is not sent in clear text over the wire and that
10806 only a single packet is sent for the user/password tuple.
10808 .Va pop3-no-apop-HOST
10811 .Mx Va pop3-use-starttls
10812 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
10813 \*(BO\*(OP Causes \*(UA to issue a
10815 command to make an unencrypted POP3 session TLS encrypted.
10816 This functionality is not supported by all servers,
10817 and is not used if the session is already encrypted by the POP3S method.
10819 .Va pop3-use-starttls-HOST
10825 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
10826 where that deviates from standardized behaviour.
10827 It will be set implicitly before the
10828 .Sx "Resource files"
10829 are loaded if the environment variable
10830 .Ev POSIXLY_CORRECT
10831 is set, and adjusting any of those two will be reflected by the other
10833 The following behaviour is covered and enforced by this mechanism:
10836 .Bl -bullet -compact
10838 In non-interactive mode, any error encountered while loading resource
10839 files during program startup will cause a program exit, whereas in
10840 interactive mode such errors will stop loading of the currently loaded
10841 (stack of) file(s, i.e., recursively).
10842 These exits can be circumvented on a per-command base by using
10845 .Sx "Command modifiers" ,
10846 for each command which shall be allowed to fail.
10850 will replace the list of alternate addresses instead of appending to it.
10851 In addition alternates will only be honoured for any sort of message
10856 The variable inserting
10857 .Sx "COMMAND ESCAPES"
10863 will expand embedded character sequences
10865 horizontal tabulator and
10868 \*(ID For compatibility reasons this step will always be performed.
10871 Upon changing the active
10875 will be displayed even if
10882 implies the behaviour described by
10888 is extended to cover any empty mailbox, not only empty
10890 .Sx "primary system mailbox" Ns
10891 es: they will be removed when they are left in empty state otherwise.
10896 .It Va print-alternatives
10897 \*(BO When a MIME message part of type
10898 .Ql multipart/alternative
10899 is displayed and it contains a subpart of type
10901 other parts are normally discarded.
10902 Setting this variable causes all subparts to be displayed,
10903 just as if the surrounding part was of type
10904 .Ql multipart/mixed .
10908 The string used as a prompt in interactive mode.
10909 Whenever the variable is evaluated the value is treated as if specified
10910 within dollar-single-quotes (see
10911 .Sx "Shell-style argument quoting" ) .
10912 This (post-assignment, i.e., second) expansion can be used to embed
10913 status information, for example
10918 .Va mailbox-display .
10920 In order to embed characters which should not be counted when
10921 calculating the visual width of the resulting string, enclose the
10922 characters of interest in a pair of reverse solidus escaped brackets:
10924 a slot for coloured prompts is also available with the \*(OPal command
10926 Prompting may be prevented by setting this to the null string
10928 .Ql set noprompt ) .
10932 This string is used for secondary prompts, but is otherwise identical to
10939 \*(BO Suppresses the printing of the version when first invoked.
10945 message is started with the quoted original message,
10946 the lines of which are prefixed by the value of the variable
10948 taking into account
10952 If set to the empty value, the quoted message will be preceded and
10953 followed by the expansions of the values of
10954 .Va quote-inject-head
10956 .Va quote-inject-tail ,
10958 None of the headers of the quoted message is included in the quote if
10961 and only the headers selected by the
10964 selection are put above the message body for
10966 whereas all headers and all MIME parts are included for
10969 .Va quote-as-attachment
10973 .Sx "COMMAND ESCAPES" .
10976 .It Va quote-as-attachment
10977 \*(BO Add the original message in its entirety as a
10979 MIME attachment when replying to a message.
10980 Note this works regardless of the setting of
10985 Can be set to a string consisting of non-whitespace ASCII characters
10986 which shall be treated as quotation leaders, the default being
10991 \*(OP Can be set in addition to
10993 and creates a more fancy quotation in that leading quotation characters
10994 .Pf ( Va quote-chars )
10995 are compressed and overlong lines are folded.
10997 can be set to either one, two or three (space separated) numeric values,
10998 which are interpreted as the maximum (goal) and the minimum line length,
10999 respectively, in a spirit rather equal to the
11001 program, but line- instead of paragraph-based.
11002 The third value is used as the maximum line length instead of the first
11003 if no better break point can be found; it is ignored unless it is larger
11004 than the minimum and smaller than the maximum.
11005 If not set explicitly the minimum will reflect the goal algorithmically.
11006 The goal cannot be smaller than the length of
11008 plus some additional pad; necessary adjustments take place silently.
11013 .It Va quote-inject-head , quote-inject-tail
11014 The strings to put before and after the text of a
11016 d message, respectively.
11017 The former defaults to
11018 .Ql %f wrote:\en\en .
11019 Special format directives will be expanded if possible, and if so
11020 configured the output will be folded according to
11022 Format specifiers in the given strings start with a percent sign
11024 and expand values of the original message, unless noted otherwise.
11025 Note that names and addresses are not subject to the setting of
11027 Valid format specifiers are:
11030 .Bl -tag -compact -width ".It Ql _%%_"
11032 A plain percent sign.
11034 The address(es) of the sender(s).
11036 The date found in the
11038 header of the message when
11040 is set (the default), otherwise the date when the message was received.
11041 Formatting can be controlled by assigning a
11046 .Va datefield-markout-older ) .
11048 The full name(s) (name and address, as given) of the sender(s).
11053 The real name(s) of the sender(s) if there is one and
11055 allows usage, the address(es) otherwise.
11057 The senders real name(s) if there is one, the address(es) otherwise.
11062 .It Va r-option-implicit
11063 \*(BO Setting this option evaluates the contents of
11065 (or, if that contains multiple addresses,
11067 and passes the results onto the used (file-based) MTA as described for the
11069 option (empty argument case).
11072 .It Va recipients-in-cc
11079 are by default merged into the new
11081 If this variable is set, only the original
11085 the rest is merged into
11090 Unless this variable is defined, no copies of outgoing mail will be saved.
11091 If defined it gives the pathname, subject to the usual
11092 .Sx "Filename transformations" ,
11093 of a folder where all new, replied-to or forwarded messages are saved:
11094 when saving to this folder fails the message is not sent, but instead
11098 The standard defines that relative (fully expanded) paths are to be
11099 interpreted relative to the current directory
11101 to force interpretation relative to
11104 needs to be set in addition.
11107 .It Va record-files
11108 \*(BO If this variable is set the meaning of
11110 will be extended to cover messages which target only file and pipe
11113 These address types will not appear in recipient lists unless
11114 .Va add-file-recipients
11118 .It Va record-resent
11119 \*(BO If this variable is set the meaning of
11121 will be extended to also cover the
11128 .It Va reply-in-same-charset
11129 \*(BO If this variable is set \*(UA first tries to use the same
11130 character set of the original message for replies.
11131 If this fails, the mechanism described in
11132 .Sx "Character sets"
11133 is evaluated as usual.
11136 .It Va reply-strings
11137 Can be set to a comma-separated list of (case-insensitive according to
11138 ASCII rules) strings which shall be recognized in addition to the
11139 built-in strings as
11141 reply message indicators \(en built-in are
11143 which is mandated by RFC 5322, as well as the german
11148 which often has been seen in the wild;
11149 I.e., the separating colon has to be specified explicitly.
11153 A list of addresses to put into the
11155 field of the message header.
11156 Members of this list are handled as if they were in the
11165 .It Va reply-to-honour
11168 header is honoured when replying to a message via
11172 This is a quadoption; if set without a value it defaults to
11176 .It Va rfc822-body-from_
11177 \*(BO This variable can be used to force displaying a so-called
11179 line for messages that are embedded into an envelope mail via the
11181 MIME mechanism, for more visual convenience.
11185 \*(BO Enable saving of (partial) messages in
11187 upon interrupt or delivery error.
11191 The number of lines that represents a
11200 line display and scrolling via
11202 If this variable is not set \*(UA falls back to a calculation based upon
11203 the detected terminal window size and the baud rate: the faster the
11204 terminal, the more will be shown.
11205 Overall screen dimensions and pager usage is influenced by the
11206 environment variables
11214 .It Va searchheaders
11215 \*(BO Expand message-list specifiers in the form
11217 to all messages containing the substring
11219 in the header field
11221 The string search is case insensitive.
11224 .It Va sendcharsets
11225 \*(OP A comma-separated list of character set names that can be used in
11226 outgoing internet mail.
11227 The value of the variable
11229 is automatically appended to this list of character sets.
11230 If no character set conversion capabilities are compiled into \*(UA then
11231 the only supported charset is
11234 .Va sendcharsets-else-ttycharset
11235 and refer to the section
11236 .Sx "Character sets"
11237 for the complete picture of character set conversion in \*(UA.
11240 .It Va sendcharsets-else-ttycharset
11241 \*(BO\*(OP If this variable is set, but
11243 is not, then \*(UA acts as if
11245 had been set to the value of the variable
11247 In effect this combination passes through the message data in the
11248 character set of the current locale encoding:
11249 therefore mail message text will be (assumed to be) in ISO-8859-1
11250 encoding when send from within a ISO-8859-1 locale, and in UTF-8
11251 encoding when send from within an UTF-8 locale.
11255 never comes into play as
11257 is implicitly assumed to be 8-bit and capable to represent all files the
11258 user may specify (as is the case when no character set conversion
11259 support is available in \*(UA and the only supported character set is
11261 .Sx "Character sets" ) .
11262 This might be a problem for scripts which use the suggested
11264 setting, since in this case the character set is US-ASCII by definition,
11265 so that it is better to also override
11271 An address that is put into the
11273 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
11274 responsible for the actual transmission of the message.
11275 This field should normally not be used unless the
11277 field contains more than one address, on which case it is required.
11278 Dependent on the context this address is handled as if it were in
11283 .Va r-option-implicit .
11286 \*(OB Predecessor of
11289 .It Va sendmail-arguments
11290 \*(OB Predecessor of
11291 .Va mta-arguments .
11293 .It Va sendmail-no-default-arguments
11294 \*(OB\*(BO Predecessor of
11295 .Va mta-no-default-arguments .
11297 .It Va sendmail-progname
11298 \*(OB Predecessor of
11303 \*(BO When sending a message wait until the
11305 (including the built-in SMTP one) exits before accepting further commands.
11307 with this variable set errors reported by the MTA will be recognizable!
11308 If the MTA returns a non-zero exit status,
11309 the exit status of \*(UA will also be non-zero.
11313 \*(BO This setting causes \*(UA to start at the last message
11314 instead of the first one when opening a mail folder, as well as with
11321 \*(BO Causes \*(UA to use the sender's real name instead of the plain
11322 address in the header field summary and in message specifications.
11326 \*(BO Causes the recipient of the message to be shown in the header
11327 summary if the message was sent by the user.
11334 .Sx "COMMAND ESCAPES" .
11336 .Va message-inject-tail ,
11337 .Va on-compose-leave
11339 .Va on-compose-splice .
11346 .Sx "COMMAND ESCAPES" .
11348 .Va message-inject-tail ,
11349 .Va on-compose-leave
11351 .Va on-compose-splice .
11356 .Va on-compose-splice
11358 .Va on-compose-splice-shell
11360 .Va on-compose-leave
11362 .Va message-inject-tail
11366 .It Va skipemptybody
11367 \*(BO If an outgoing message does not contain any text in its first or
11368 only message part, do not send it but discard it silently (see also the
11369 command line option
11374 .It Va smime-ca-dir , smime-ca-file
11375 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
11376 Enhanced Mail) for the purpose of verification of S/MIME signed messages.
11378 documents the necessary preparation steps to use the former.
11379 The set of CA certificates which are built into the TLS library can
11380 be explicitly turned off by setting
11381 .Va smime-ca-no-defaults ,
11382 and further fine-tuning is possible via
11383 .Va smime-ca-flags .
11386 .It Va smime-ca-flags
11387 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
11388 storage, and the certificate verification that is used.
11389 The actual values and their meanings are documented for
11393 .It Va smime-ca-no-defaults
11394 \*(BO\*(OP Do not load the default CA locations that are built into the
11395 used to TLS library to verify S/MIME signed messages.
11397 .Mx Va smime-cipher
11398 .It Va smime-cipher-USER@HOST , smime-cipher
11399 \*(OP Specifies the cipher to use when generating S/MIME encrypted
11400 messages (for the specified account).
11401 RFC 5751 mandates a default of
11404 Possible values are (case-insensitive and) in decreasing cipher strength:
11412 (DES EDE3 CBC, 168 bits; default if
11414 is not available) and
11416 (DES CBC, 56 bits).
11418 The actually available cipher algorithms depend on the cryptographic
11419 library that \*(UA uses.
11420 \*(OP Support for more cipher algorithms may be available through
11421 dynamic loading via, e.g.,
11422 .Xr EVP_get_cipherbyname 3
11423 (OpenSSL) if \*(UA has been compiled to support this.
11426 .It Va smime-crl-dir
11427 \*(OP Specifies a directory that contains files with CRLs in PEM format
11428 to use when verifying S/MIME messages.
11431 .It Va smime-crl-file
11432 \*(OP Specifies a file that contains a CRL in PEM format to use when
11433 verifying S/MIME messages.
11436 .It Va smime-encrypt-USER@HOST
11437 \*(OP If this variable is set, messages send to the given receiver are
11438 encrypted before sending.
11439 The value of the variable must be set to the name of a file that
11440 contains a certificate in PEM format.
11442 If a message is sent to multiple recipients,
11443 each of them for whom a corresponding variable is set will receive an
11444 individually encrypted message;
11445 other recipients will continue to receive the message in plain text
11447 .Va smime-force-encryption
11449 It is recommended to sign encrypted messages, i.e., to also set the
11454 .It Va smime-force-encryption
11455 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
11459 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
11460 and include the user's certificate as a MIME attachment.
11461 Signing a message enables a recipient to verify that the sender used
11462 a valid certificate,
11463 that the email addresses in the certificate match those in the message
11464 header and that the message content has not been altered.
11465 It does not change the message text,
11466 and people will be able to read the message as usual.
11468 .Va smime-sign-cert , smime-sign-include-certs
11470 .Va smime-sign-digest .
11472 .Mx Va smime-sign-cert
11473 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
11474 \*(OP Points to a file in PEM format.
11475 For the purpose of signing and decryption this file needs to contain the
11476 user's private key, followed by his certificate.
11478 For message signing
11480 is always derived from the value of
11482 (or, if that contains multiple addresses,
11484 For the purpose of encryption the recipient's public encryption key
11485 (certificate) is expected; the command
11487 can be used to save certificates of signed messages (the section
11488 .Sx "Signed and encrypted messages with S/MIME"
11489 gives some details).
11490 This mode of operation is usually driven by the specialized form.
11492 When decrypting messages the account is derived from the recipient
11497 of the message, which are searched for addresses for which such
11499 \*(UA always uses the first address that matches,
11500 so if the same message is sent to more than one of the user's addresses
11501 using different encryption keys, decryption might fail.
11503 For signing and decryption purposes it is possible to use encrypted
11504 keys, and the pseudo-host(s)
11505 .Ql USER@HOST.smime-cert-key
11506 for the private key
11508 .Ql USER@HOST.smime-cert-cert
11509 for the certificate stored in the same file)
11510 will be used for performing any necessary password lookup,
11511 therefore the lookup can be automated via the mechanisms described in
11512 .Sx "On URL syntax and credential lookup" .
11513 For example, the hypothetical address
11515 could be driven with a private key / certificate pair path defined in
11516 .Va \&\&smime-sign-cert-bob@exam.ple ,
11517 and needed passwords would then be looked up via the pseudo hosts
11518 .Ql bob@exam.ple.smime-cert-key
11520 .Ql bob@exam.ple.smime-cert-cert ) .
11521 To include intermediate certificates, use
11522 .Va smime-sign-include-certs .
11524 .Mx Va smime-sign-digest
11525 .It Va smime-sign-digest-USER@HOST , smime-sign-digest
11526 \*(OP Specifies the message digestto use when signing S/MIME messages.
11527 Please remember that for this use case
11529 refers to the variable
11531 (or, if that contains multiple addresses,
11533 The available algorithms depend on the used cryptographic library, but
11534 at least one usable builtin algorithm is ensured as a default.
11535 If possible the standard RFC 5751 will be violated by using
11537 instead of the mandated
11539 due to security concerns.
11541 \*(UA will try to add built-in support for the following message
11542 digests, names are case-insensitive:
11549 as well as the widely available
11554 and the proposed insecure
11558 More digests may \*(OPally be available through dynamic loading via,
11559 e.g., the OpenSSL function
11560 .Xr EVP_get_digestbyname 3 .
11562 .Mx Va smime-sign-include-certs
11563 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
11564 \*(OP If used, this is supposed to a consist of a comma-separated list
11565 of files, each of which containing a single certificate in PEM format to
11566 be included in the S/MIME message in addition to the
11567 .Va smime-sign-cert
11569 This can be used to include intermediate certificates of the certificate
11570 authority, in order to allow the receiver's S/MIME implementation to
11571 perform a verification of the entire certificate chain, starting from
11572 a local root certificate, over the intermediate certificates, down to the
11573 .Va smime-sign-cert .
11574 Even though top level certificates may also be included in the chain,
11575 they won't be used for the verification on the receiver's side.
11577 For the purpose of the mechanisms involved here,
11579 refers to the content of the internal variable
11581 (or, if that contains multiple addresses,
11584 .Ql USER@HOST.smime-include-certs
11585 will be used for performing password lookups for these certificates,
11586 shall they have been given one, therefore the lookup can be automated
11587 via the mechanisms described in
11588 .Sx "On URL syntax and credential lookup" .
11590 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
11591 \*(OB\*(OP Predecessor(s) of
11592 .Va smime-sign-digest .
11595 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
11597 \*(ID For compatibility reasons a set
11599 is used in preference of
11603 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
11604 \*(OP Variable chain that controls the SMTP
11606 authentication method, possible values are
11612 as well as the \*(OPal methods
11618 method does not need any user credentials,
11620 requires a user name and all other methods require a user name and
11628 .Va smtp-auth-password
11630 .Va smtp-auth-user ) .
11635 .Va smtp-auth-USER@HOST :
11636 may override dependent on sender address in the variable
11639 .It Va smtp-auth-password
11640 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
11641 If the authentication method requires a password, but neither
11642 .Va smtp-auth-password
11644 .Va smtp-auth-password-USER@HOST
11646 \*(UA will ask for a password on the user's terminal.
11648 .It Va smtp-auth-password-USER@HOST
11650 .Va smtp-auth-password
11651 for specific values of sender addresses, dependent upon the variable
11654 .It Va smtp-auth-user
11655 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
11656 If the authentication method requires a user name, but neither
11659 .Va smtp-auth-user-USER@HOST
11661 \*(UA will ask for a user name on the user's terminal.
11663 .It Va smtp-auth-user-USER@HOST
11666 for specific values of sender addresses, dependent upon the variable
11670 .It Va smtp-hostname
11671 \*(OP\*(IN Normally \*(UA uses the variable
11673 to derive the necessary
11675 information in order to issue a
11682 can be used to use the
11684 from the SMTP account
11691 from the content of this variable (or, if that is the empty string,
11693 or the local hostname as a last resort).
11694 This often allows using an address that is itself valid but hosted by
11695 a provider other than which (in
11697 is about to send the message.
11698 Setting this variable also influences generated
11703 If the \*(OPal IDNA support is available (see
11705 variable assignment is aborted when a necessary conversion fails.
11707 .Mx Va smtp-use-starttls
11708 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
11709 \*(BO\*(OP Causes \*(UA to issue a
11711 command to make an SMTP
11713 session TLS encrypted, i.e., to enable transport layer security.
11716 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
11717 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
11718 \*(UA will proxy all of its network activities through it.
11719 This can be used to proxy SMTP, POP3 etc. network traffic through the
11720 Tor anonymizer, for example.
11721 The following would create a local SOCKS proxy on port 10000 that
11722 forwards to the machine
11724 and from which the network traffic is actually instantiated:
11725 .Bd -literal -offset indent
11726 # Create local proxy server in terminal 1 forwarding to HOST
11727 $ ssh -D 10000 USER@HOST
11728 # Then, start a client that uses it in terminal 2
11729 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
11733 .It Va spam-interface
11734 \*(OP In order to use any of the spam-related commands (like, e.g.,
11736 the desired spam interface must be defined by setting this variable.
11737 Please refer to the manual section
11738 .Sx "Handling spam"
11739 for the complete picture of spam handling in \*(UA.
11740 All or none of the following interfaces may be available:
11742 .Bl -tag -width ".It Ql _ilte_"
11748 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
11750 Different to the generic filter interface \*(UA will automatically add
11751 the correct arguments for a given command and has the necessary
11752 knowledge to parse the program's output.
11753 A default value for
11755 will have been compiled into the \*(UA binary if
11759 during compilation.
11760 Shall it be necessary to define a specific connection type (rather than
11761 using a configuration file for that), the variable
11762 .Va spamc-arguments
11763 can be used as in, e.g.,
11764 .Ql -d server.example.com -p 783 .
11765 It is also possible to specify a per-user configuration via
11767 Note that this interface does not inspect the
11769 flag of a message for the command
11773 generic spam filter support via freely configurable hooks.
11774 This interface is meant for programs like
11776 and requires according behaviour in respect to the hooks' exit
11777 status for at least the command
11780 meaning a message is spam,
11784 for unsure and any other return value indicating a hard error);
11785 since the hooks can include shell code snippets diverting behaviour
11786 can be intercepted as necessary.
11788 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
11791 .Va spamfilter-spam ;
11793 .Sx "Handling spam"
11794 contains examples for some programs.
11795 The process environment of the hooks will have the variable
11796 .Ev MAILX_FILENAME_GENERATED
11798 Note that spam score support for
11800 is not supported unless the \*(OPtional regular expression support is
11802 .Va spamfilter-rate-scanscore
11808 .It Va spam-maxsize
11809 \*(OP Messages that exceed this size will not be passed through to the
11811 .Va spam-interface .
11812 If unset or 0, the default of 420000 bytes is used.
11815 .It Va spamc-command
11816 \*(OP The path to the
11820 .Va spam-interface .
11821 Note that the path is not expanded, but used
11823 A fallback path will have been compiled into the \*(UA binary if the
11824 executable had been found during compilation.
11827 .It Va spamc-arguments
11828 \*(OP Even though \*(UA deals with most arguments for the
11831 automatically, it may at least sometimes be desirable to specify
11832 connection-related ones via this variable, e.g.,
11833 .Ql -d server.example.com -p 783 .
11837 \*(OP Specify a username for per-user configuration files for the
11839 .Va spam-interface .
11840 If this is set to the empty string then \*(UA will use the name of the
11849 .It Va spamfilter-ham , spamfilter-noham , \
11850 spamfilter-nospam , spamfilter-rate , spamfilter-spam
11851 \*(OP Command and argument hooks for the
11853 .Va spam-interface .
11855 .Sx "Handling spam"
11856 contains examples for some programs.
11859 .It Va spamfilter-rate-scanscore
11860 \*(OP Because of the generic nature of the
11863 spam scores are not supported for it by default, but if the \*(OPnal
11864 regular expression support is available then setting this variable can
11865 be used to overcome this restriction.
11866 It is interpreted as follows: first a number (digits) is parsed that
11867 must be followed by a semicolon
11869 and an extended regular expression.
11870 Then the latter is used to parse the first output line of the
11871 .Va spamfilter-rate
11872 hook, and, in case the evaluation is successful, the group that has been
11873 specified via the number is interpreted as a floating point scan score.
11875 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
11876 ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
11877 \*(OB\*(OP Predecessors of
11881 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
11882 \*(OB\*(OP Predecessor of
11885 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
11887 \*(OB\*(BO\*(OP Predecessor of
11888 .Va tls-ca-no-defaults .
11890 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
11891 \*(OB\*(OP Please use the
11894 .Va tls-config-pairs .
11896 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
11897 \*(OB\*(OP Please use the
11900 .Va tls-config-pairs .
11902 .It Va ssl-config-file
11903 \*(OB\*(OP Predecessor of
11904 .Va tls-config-file .
11906 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
11908 \*(OB\*(OP Predecessor of
11909 .Va tls-config-module .
11911 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
11912 \*(OB\*(OP Predecessor of
11913 .Va tls-config-pairs .
11915 .It Va ssl-crl-dir , ssl-crl-file
11916 \*(OB\*(OP Predecessors of
11920 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
11921 \*(OB\*(OP Please use the
11924 .Va tls-config-pairs .
11926 .It Va ssl-features
11927 \*(OB\*(OP\*(RO Predecessor of
11930 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
11931 \*(OB\*(OP Please use the
11934 .Va tls-config-pairs .
11936 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
11937 \*(OB\*(OP Please use the
11940 .Va tls-config-pairs .
11942 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
11943 \*(OB\*(OP Please use the
11946 .Va tls-config-pairs .
11948 .It Va ssl-rand-file
11949 \*(OB\*(OP Predecessor of
11950 .Va tls-rand-file .
11952 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
11953 \*(OB\*(OP Predecessor of
11958 If only set without an assigned value, then this setting inhibits the
11964 header fields that include obvious references to \*(UA.
11965 There are two pitfalls associated with this:
11966 First, the message id of outgoing messages is not known anymore.
11967 Second, an expert may still use the remaining information in the header
11968 to track down the originating mail user agent.
11969 If set to the value
11975 suppression does not occur.
11978 .It Va system-mailrc
11979 \*(RO The compiled in path of the system wide initialization file
11981 .Sx "Resource files" :
11987 (\*(OP) This specifies a comma-separated list of
11992 .Sx "On terminal control and line editor" ,
11993 escape commas with reverse solidus) to be used to overwrite or define
11996 this variable will only be queried once at program startup and can
11997 thus only be specified in resource files or on the command line.
12000 String capabilities form
12002 pairs and are expected unless noted otherwise.
12003 Numerics have to be notated as
12005 where the number is expected in normal decimal notation.
12006 Finally, booleans do not have any value but indicate a true or false
12007 state simply by being defined or not; this indeed means that \*(UA
12008 does not support undefining an existing boolean.
12009 String capability values will undergo some expansions before use:
12010 for one notations like
12013 .Ql control-LETTER ,
12014 and for clarification purposes
12016 can be used to specify
12018 (the control notation
12020 could lead to misreadings when a left bracket follows, which it does for
12021 the standard CSI sequence);
12022 finally three letter octal sequences, as in
12025 To specify that a terminal supports 256-colours, and to define sequences
12026 that home the cursor and produce an audible bell, one might write:
12028 .Bd -literal -offset indent
12029 ? set termcap='Co#256,home=\eE[H,bel=^G'
12033 The following terminal capabilities are or may be meaningful for the
12034 operation of the built-in line editor or \*(UA in general:
12037 .Bl -tag -compact -width ".It Cd yay"
12039 .It Cd colors Ns \0or Cd Co
12041 numeric capability specifying the maximum number of colours.
12042 Note that \*(UA does not actually care about the terminal beside that,
12043 but always emits ANSI / ISO 6429 escape sequences.
12046 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
12049 .Cd enter_ca_mode ,
12050 respectively: exit and enter the alternative screen ca-mode,
12051 effectively turning \*(UA into a fullscreen application.
12052 This must be enabled explicitly by setting
12053 .Va termcap-ca-mode .
12055 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
12059 respectively: enable and disable the keypad.
12060 This is always enabled if available, because it seems even keyboards
12061 without keypads generate other key codes for, e.g., cursor keys in that
12062 case, and only if enabled we see the codes that we are interested in.
12064 .It Cd ed Ns \0or Cd cd
12068 .It Cd clear Ns \0or Cd cl
12070 clear the screen and home cursor.
12071 (Will be simulated via
12076 .It Cd home Ns \0or Cd ho
12081 .It Cd el Ns \0or Cd ce
12083 clear to the end of line.
12084 (Will be simulated via
12086 plus repetitions of space characters.)
12088 .It Cd hpa Ns \0or Cd ch
12089 .Cd column_address :
12090 move the cursor (to the given column parameter) in the current row.
12091 (Will be simulated via
12097 .Cd carriage_return :
12098 move to the first column in the current row.
12099 The default built-in fallback is
12102 .It Cd cub1 Ns \0or Cd le
12104 move the cursor left one space (non-destructively).
12105 The default built-in fallback is
12108 .It Cd cuf1 Ns \0or Cd nd
12110 move the cursor right one space (non-destructively).
12111 The default built-in fallback is
12113 which is used by most terminals.
12121 Many more capabilities which describe key-sequences are documented for
12126 .It Va termcap-ca-mode
12127 \*(OP Allow usage of the
12131 terminal capabilities, see
12134 this variable will only be queried once at program startup and can
12135 thus only be specified in resource files or on the command line.
12138 .It Va termcap-disable
12139 \*(OP Disable any interaction with a terminal control library.
12140 If set only some generic fallback built-ins and possibly the content of
12142 describe the terminal to \*(UA.
12144 this variable will only be queried once at program startup and can
12145 thus only be specified in resource files or on the command line.
12149 .It Va tls-ca-dir-USER@HOST , tls-ca-dir-HOST , tls-ca-dir ,\
12150 tls-ca-file-USER@HOST , tls-ca-file-HOST , tls-ca-file
12151 \*(OP Directory and file, respectively, for pools of trusted CA
12152 certificates in PEM (Privacy Enhanced Mail) format, for the purpose of
12153 verification of TLS server certificates.
12154 Concurrent use is possible, the file is loaded once needed first, the
12155 directory lookup is performed anew as a last resort whenever necessary.
12156 The CA certificate pool built into the TLS library can be disabled via
12157 .Va tls-ca-no-defaults ,
12158 further fine-tuning is possible via
12160 Note the directory search variant requires the certificate files to
12161 adhere special filename conventions, please see
12162 .Xr SSL_CTX_load_verify_locations 3
12169 .Mx Va tls-ca-flags
12170 .It Va tls-ca-flags-USER@HOST , tls-ca-flags-HOST , tls-ca-flags
12171 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
12172 storage, and the certificate verification that is used (also see
12174 The value is expected to consist of a comma-separated list of
12175 configuration directives, with any intervening whitespace being ignored.
12176 The directives directly map to flags that can be passed to
12177 .Xr X509_STORE_set_flags 3 ,
12178 which are usually defined in a file
12179 .Pa openssl/x509_vfy.h ,
12180 and the availability of which depends on the used TLS library
12181 version: a directive without mapping is ignored (error log subject to
12183 Directives currently understood (case-insensitively) include:
12186 .Bl -tag -compact -width ".It Cd BaNg"
12187 .It Cd no-alt-chains
12188 If the initial chain is not trusted, do not attempt to build an
12190 Setting this flag will make OpenSSL certificate verification match that
12191 of older OpenSSL versions, before automatic building and checking of
12192 alternative chains has been implemented; also see
12193 .Cd trusted-first .
12194 .It Cd no-check-time
12195 Do not check certificate/CRL validity against current time.
12196 .It Cd partial-chain
12197 By default partial, incomplete chains which cannot be verified up to the
12198 chain top, a self-signed root certificate, will not verify.
12199 With this flag set, a chain succeeds to verify if at least one signing
12200 certificate of the chain is in any of the configured trusted stores of
12202 The OpenSSL manual page
12203 .Xr SSL_CTX_load_verify_locations 3
12204 gives some advise how to manage your own trusted store of CA certificates.
12206 Disable workarounds for broken certificates.
12207 .It Cd trusted-first
12208 Try building a chain using issuers in the trusted store first to avoid
12209 problems with server-sent legacy intermediate certificates.
12210 Newer versions of OpenSSL support alternative chain checking and enable
12211 it by default, resulting in the same behaviour; also see
12212 .Cd no-alt-chains .
12216 .Mx Va tls-ca-no-defaults
12217 .It Va tls-ca-no-defaults-USER@HOST , tls-ca-no-defaults-HOST ,\
12219 \*(BO\*(OP Do not load the default CA locations that are built into the
12220 used to TLS library to verify TLS server certificates.
12223 .It Va tls-config-file
12224 \*(OP If this variable is set
12225 .Xr CONF_modules_load_file 3
12227 .Ql +modules-load-file
12230 is used to allow resource file based configuration of the TLS library.
12231 This happens once the library is used first, which may also be early
12232 during startup (logged with
12234 If a non-empty value is given then the given file, after performing
12235 .Sx "Filename transformations" ,
12236 will be used instead of the TLS libraries global default, and it is an
12237 error if the file cannot be loaded.
12238 The application name will always be passed as
12240 Some TLS libraries support application-specific configuration via
12241 resource files loaded like this, please see
12242 .Va tls-config-module .
12244 .Mx Va tls-config-module
12245 .It Va tls-config-module-USER@HOST , tls-config-module-HOST ,\
12247 \*(OP If file based application-specific configuration via
12248 .Va tls-config-file
12249 is available, announced as
12253 indicating availability of
12254 .Xr SSL_CTX_config 3 ,
12255 then, it becomes possible to use a central TLS configuration file
12256 for all programs, including \*(uA, e.g.:
12257 .Bd -literal -offset indent
12258 # Register a configuration section for \*(uA
12259 \*(uA = mailx_master
12260 # The top configuration section creates a relation
12261 # in between dynamic SSL configuration and an actual
12262 # program specific configuration section
12264 ssl_conf = mailx_tls_config
12265 # Well that actual program specific configuration section
12266 # now can map individual tls-config-module names to sections,
12267 # e.g., tls-config-module=account_xy
12269 account_xy = mailx_account_xy
12270 account_yz = mailx_account_yz
12272 MinProtocol = TLSv1.2
12275 CipherString = TLSv1.2:!aNULL:!eNULL:
12276 MinProtocol = TLSv1.1
12281 .Mx Va tls-config-pairs
12282 .It Va tls-config-pairs-USER@HOST , tls-config-pairs-HOST , tls-config-pairs
12283 \*(OP The value of this variable chain will be interpreted as
12284 a comma-separated list of directive/value pairs.
12285 Directives and values need to be separated by equals signs
12287 any whitespace surrounding pair members is removed.
12288 Keys are (usually) case-insensitive.
12289 Different to when placing these pairs in a
12290 .Va tls-config-module
12292 .Va tls-config-file ,
12295 need to be escaped with a reverse solidus
12297 when included in pairs; also different: if the equals sign
12299 is preceded with an asterisk
12301 .Sx "Filename transformations"
12302 will be performed on the value; it is an error if these fail.
12303 Unless proper support is announced by
12305 .Pf ( Ql +conf-ctx )
12306 only the keys below are supported, otherwise the pairs will be used
12307 directly as arguments to the function
12308 .Xr SSL_CONF_cmd 3 .
12311 .Bl -tag -compact -width ".It Cd C_rtificate_"
12313 Filename of a TLS client certificate (chain) required by some servers.
12314 Fallback support via
12315 .Xr SSL_CTX_use_certificate_chain_file 3 .
12316 .Sx "Filename transformations"
12318 .\" v15compat: remove the next sentence
12320 if you use this you need to specify the private key via
12325 .It Cd CipherString
12326 A list of ciphers for TLS connections, see
12328 By default no list of ciphers is set, resulting in a
12329 .Cd Protocol Ns - Ns
12330 specific list of ciphers (the protocol standards define lists of
12331 acceptable ciphers; possibly cramped by the used TLS library).
12332 Fallback support via
12333 .Xr SSL_CTX_set_cipher_list 3 .
12335 .It Cd Ciphersuites
12336 A list of ciphers used for TLSv1.3 connections, see
12338 These will be joined onto the list of ciphers from
12343 .Ql +ctx-set-ciphersuites ,
12345 .Xr SSL_CTX_set_ciphersuites 3 .
12348 A list of supported elliptic curves, if applicable.
12349 By default no curves are set.
12350 Fallback support via
12351 .Xr SSL_CTX_set1_curves_list 3 ,
12354 .It Cd MaxProtocol , MinProtocol
12355 The maximum and minimum supported TLS versions, respectively.
12359 .Ql +ctx-set-maxmin-proto ,
12361 .Xr SSL_CTX_set_max_proto_version 3
12363 .Xr SSL_CTX_set_min_proto_version 3 ;
12364 these fallbacks use an internal parser which understands the strings
12370 and the special value
12372 which disables the given limit.
12375 Various flags to set.
12377 .Xr SSL_CTX_set_options 3 ,
12378 in which case any other value but (exactly)
12380 results in an error.
12383 Filename of the private key in PEM format of a TLS client certificate.
12384 If unset, the name of the certificate file is used.
12385 .Sx "Filename transformations"
12388 .Xr SSL_CTX_use_PrivateKey_file 3 .
12389 .\" v15compat: remove the next sentence
12391 if you use this you need to specify the certificate (chain) via
12397 The used TLS protocol.
12403 .Ql ctx-set-maxmin-proto
12410 .Xr SSL_CTX_set_options 3 ,
12411 driven via an internal parser which understands the strings
12417 and the special value
12419 Multiple protocols may be given as a comma-separated list, any
12420 whitespace is ignored, an optional plus sign
12422 prefix enables, a hyphen-minus
12424 prefix disables a protocol, so that
12426 enables only the TLSv1.2 protocol.
12432 .It Va tls-crl-dir , tls-crl-file
12433 \*(OP Specify a directory / a file, respectively, that contains a CRL in
12434 PEM format to use when verifying TLS server certificates.
12437 .It Va tls-features
12438 \*(OP\*(RO This expands to a comma separated list of the TLS library
12439 identity and optional SSL library features.
12440 Currently supported identities are
12444 (OpenSSL v1.1.x series)
12447 (elder OpenSSL series, other clones).
12448 Optional features are preceded with a plus sign
12450 when available, and with a hyphen-minus
12454 Currently known features are
12455 .Ql modules-load-file
12456 .Pf ( Va tls-config-file ) ,
12458 .Pf ( Va tls-config-pairs ) ,
12460 .Pf ( Va tls-config-module ) ,
12461 .Ql ctx-set-maxmin-proto
12462 .Pf ( Va tls-config-pairs ) ,
12463 .Ql ctx-set-ciphersuites
12467 .Va tls-config-pairs ) .
12469 .Mx Va tls-fingerprint
12470 .It Va tls-fingerprint-USER@HOST , tls-fingerprint-HOST , tls-fingerprint
12471 \*(OP It is possible to replace the verification of the connection
12472 peer certificate against the entire local pool of CAs (for more see
12473 .Sx "Encrypted network communication" )
12474 with the comparison against a precalculated certificate message digest,
12475 the so-called fingerprint, to be specified as the used
12476 .Va tls-fingerprint-digest .
12477 This fingerprint can be calculated with, e.g.,
12478 .Ql Ic tls Ns \:\0\:fingerprint HOST .
12480 .Mx Va tls-fingerprint-digest
12481 .It Va tls-fingerprint-digest-USER@HOST , tls-fingerprint-digest-HOST , \
12482 tls-fingerprint-digest
12483 \*(OP The message digest to be used when creating TLS certificate
12484 fingerprints, the defaults, if available, in test order, being
12487 For the complete list of digest algorithms refer to
12488 .Va smime-sign-digest .
12491 .It Va tls-rand-file
12492 \*(OP Gives the filename to a file with random entropy data, see
12493 .Xr RAND_load_file 3 .
12494 If this variable is not set, or set to the empty string, or if the
12495 .Sx "Filename transformations"
12497 .Xr RAND_file_name 3
12498 will be used to create the filename.
12499 If the SSL PRNG was seeded successfully
12500 The file will be updated
12501 .Pf ( Xr RAND_write_file 3 )
12502 if and only if seeding and buffer stirring succeeds.
12505 .It Va tls-verify-USER@HOST , tls-verify-HOST , tls-verify
12506 \*(OP Variable chain that sets the action to be performed if an error
12507 occurs during TLS server certificate validation against the
12508 specified or default trust stores
12511 or the TLS library built-in defaults (unless usage disallowed via
12512 .Va tls-ca-no-defaults ) ,
12513 and as fine-tuned via
12515 Valid (case-insensitive) values are
12517 (fail and close connection immediately),
12519 (ask whether to continue on standard input),
12521 (show a warning and continue),
12523 (do not perform validation).
12528 If defined, gives the number of lines of a message to be displayed
12531 if unset, the first five lines are printed, if set to 0 the variable
12534 If the value is negative then its absolute value will be used for
12535 unsigned right shifting (see
12543 \*(BO If set then the
12545 command series will strip adjacent empty lines and quotations.
12549 The character set of the terminal \*(UA operates on,
12550 and the one and only supported character set that \*(UA can use if no
12551 character set conversion capabilities have been compiled into it,
12552 in which case it defaults to ISO-8859-1.
12553 Otherwise it defaults to UTF-8.
12554 Sufficient locale support provided the default will be preferably
12555 deduced from the locale environment if that is set (e.g.,
12557 see there for more); runtime locale changes will be reflected by
12559 except during the program startup phase and if
12561 had been used to freeze the given value.
12562 Refer to the section
12563 .Sx "Character sets"
12564 for the complete picture about character sets.
12567 .It Va typescript-mode
12568 \*(BO A special multiplex variable that disables all variables and
12569 settings which result in behaviour that interferes with running \*(UA in
12572 .Va colour-disable ,
12573 .Va line-editor-disable
12574 and (before startup completed only)
12575 .Va termcap-disable .
12576 Unsetting it does not restore the former state of the covered settings.
12580 For a safe-by-default policy the process file mode creation mask
12584 on program startup by default.
12585 Child processes inherit the file mode creation mask of their parent, and
12586 by setting this variable to an empty value no change will be applied,
12587 and the inherited value will be used.
12588 Otherwise the given value will be made the new file mode creation mask.
12591 .It Va user-HOST , user
12592 \*(IN Variable chain that sets a global fallback user name, which is
12593 used in case none has been given in the protocol and account-specific
12595 This variable defaults to the name of the user who runs \*(UA.
12599 \*(BO Setting this enables upward compatibility with \*(UA
12600 version 15.0 in respect to which configuration options are available and
12601 how they are handled.
12602 This manual uses \*(IN and \*(OU to refer to the new and the old way of
12603 doing things, respectively.
12607 \*(BO This setting, also controllable via the command line option
12609 causes \*(UA to be more verbose, e.g., it will display obsoletion
12610 warnings and TLS certificate chains.
12611 Even though marked \*(BO this option may be set twice in order to
12612 increase the level of verbosity even more, in which case even details of
12613 the actual message delivery and protocol conversations are shown.
12616 is sufficient to disable verbosity as such.
12623 .It Va version , version-date , \
12624 version-hexnum , version-major , version-minor , version-update
12625 \*(RO \*(UA version information: the first variable is a string with
12626 the complete version identification, the second the release date in ISO
12627 8601 notation without time.
12628 The third is a 32-bit hexadecimal number with the upper 8 bits storing
12629 the major, followed by the minor and update version numbers which occupy
12631 The latter three variables contain only decimal digits: the major, minor
12632 and update version numbers.
12633 The output of the command
12635 will include this information.
12638 .It Va writebackedited
12639 If this variable is set messages modified using the
12643 commands are written back to the current folder when it is quit;
12644 it is only honoured for writable folders in MBOX format, though.
12645 Note that the editor will be pointed to the raw message content in that
12646 case, i.e., neither MIME decoding nor decryption will have been
12647 performed, and proper RFC 4155
12649 quoting of newly added or edited content is also left as an exercise to
12652 .\" }}} (Variables)
12654 .\" }}} (INTERNAL VARIABLES)
12657 .\" .Sh ENVIRONMENT {{{
12661 .Dq environment variable
12662 should be considered an indication that these variables are either
12663 standardized as vivid parts of process environments, or that they are
12664 commonly found in there.
12665 The process environment is inherited from the
12667 once \*(UA is started, and unless otherwise explicitly noted handling of
12668 the following variables transparently integrates into that of the
12669 .Sx "INTERNAL VARIABLES"
12670 from \*(UA's point of view.
12671 This means that, e.g., they can be managed via
12675 causing automatic program environment updates (to be inherited by
12676 newly created child processes).
12679 In order to integrate other environment variables equally they need to
12680 be imported (linked) with the command
12682 This command can also be used to set and unset non-integrated
12683 environment variables from scratch, sufficient system support provided.
12684 The following example, applicable to a POSIX shell, sets the
12686 environment variable for \*(UA only, and beforehand exports the
12688 in order to affect any further processing in the running shell:
12690 .Bd -literal -offset indent
12691 $ EDITOR="vim -u ${HOME}/.vimrc"
12693 $ COLUMNS=80 \*(uA -R
12696 .Bl -tag -width ".It Ev BaNg"
12699 The user's preferred width in column positions for the terminal screen.
12700 Queried and used once on program startup in interactive or batch
12702 mode, actively managed for child processes and the MLE (see
12703 .Sx "On terminal control and line editor" )
12704 in interactive mode thereafter.
12705 Non-interactive mode always uses, and the fallback default is 80 columns.
12710 are both set but not both are usable (empty, not a number, or 0) at
12711 program startup, then the real terminal screen size will be (tried to
12712 be) determined once.
12715 manages these variables, and unsets them for pipe specifications etc.)
12719 The name of the (mailbox)
12721 to use for saving aborted messages if
12723 is set; this defaults to
12727 is set no output will be generated, otherwise the contents of the file
12732 Pathname of the text editor to use for the
12736 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
12738 is used for a more display oriented editor.
12742 The user's home directory.
12743 This variable is only used when it resides in the process environment.
12744 The calling user's home directory will be used instead if this directory
12745 does not exist, is not accessible or cannot be read;
12746 it will always be used for the root user.
12747 (No test for being writable is performed to allow usage by
12748 non-privileged users within read-only jails, but dependent on the
12749 variable settings this directory is a default write target, e.g. for
12757 .It Ev LC_ALL , LC_CTYPE , LANG
12758 \*(OP The (names in lookup order of the)
12762 which indicates the used
12763 .Sx "Character sets" .
12764 Runtime changes trigger automatic updates of the entire locale system,
12765 which includes updating
12767 (except during startup if the variable has been frozen via
12772 The user's preferred number of lines for the terminal screen.
12773 The behaviour is as described for
12775 yet the non-interactive and fallback default is 24 (lines).
12779 Pathname of the directory lister to use in the
12781 command when operating on local mailboxes.
12784 (path search through
12789 Upon startup \*(UA will actively ensure that this variable refers to the
12790 name of the user who runs \*(UA, in order to be able to pass a verified
12791 name to any newly created child process.
12795 Is used as the user's
12797 .Sx "primary system mailbox"
12801 This is assumed to be an absolute pathname.
12802 If this environmental fallback is also not set, a built-in compile-time
12807 \*(OP Overrides the default path search for
12808 .Sx "The Mailcap files" ,
12809 which is defined in the standard RFC 1524 as
12810 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
12811 .\" TODO we should have a mailcaps-default virtual RDONLY option!
12812 (\*(UA makes it a configuration option, however.)
12813 Note this is not a search path, but a path search.
12817 Is used as a startup file instead of
12820 In order to avoid side-effects from configuration files scripts should
12821 either set this variable to
12825 command line option should be used.
12828 .It Ev MAILX_NO_SYSTEM_RC
12829 If this variable is set then reading of
12832 .Va system-mailrc )
12833 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
12834 had been started up with the option
12836 (and according argument) or
12838 This variable is only used when it resides in the process environment.
12842 The name of the user's
12844 .Sx "secondary mailbox"
12846 A logical subset of the special
12847 .Sx "Filename transformations"
12853 Traditionally this MBOX is used as the file to save messages from the
12855 .Sx "primary system mailbox"
12856 that have been read.
12858 .Sx "Message states" .
12862 \*(IN\*(OP This variable overrides the default location of the user's
12868 Pathname of the program to use for backing the command
12872 variable enforces usage of a pager for output.
12873 The default paginator is
12875 (path search through
12878 \*(UA inspects the contents of this variable: if its contains the string
12880 then a non-existing environment variable
12887 will optionally be set to
12894 A colon-separated list of directories that is searched by the shell when
12895 looking for commands, e.g.,
12896 .Ql /bin:/usr/bin:/usr/local/bin .
12899 .It Ev POSIXLY_CORRECT
12900 This variable is automatically looked for upon startup, see
12906 The shell to use for the commands
12911 .Sx "COMMAND ESCAPES"
12912 and when starting subprocesses.
12913 A default shell is used if this environment variable is not defined.
12916 .It Ev SOURCE_DATE_EPOCH
12917 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
12918 used in place of the current time.
12919 This variable is looked up upon program startup, and its existence will
12920 switch \*(UA to a reproducible mode
12921 .Pf ( Lk https://reproducible-builds.org )
12922 which uses deterministic random numbers, a special fixated pseudo
12925 This operation mode is used for development and by software packagers.
12926 \*(ID Currently an invalid setting is only ignored, rather than causing
12927 a program abortion.
12929 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
12933 \*(OP The terminal type for which output is to be prepared.
12934 For extended colour and font control please refer to
12935 .Sx "Coloured display" ,
12936 and for terminal management in general to
12937 .Sx "On terminal control and line editor" .
12941 Except for the root user this variable defines the directory for
12942 temporary files to be used instead of
12944 (or the given compile-time constant) if set, existent, accessible as
12945 well as read- and writable.
12946 This variable is only used when it resides in the process environment,
12947 but \*(UA will ensure at startup that this environment variable is
12948 updated to contain a usable temporary directory.
12954 (see there), but this variable is not standardized, should therefore not
12955 be used, and is only corrected if already set.
12959 Pathname of the text editor to use for the
12963 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
12965 is used for a less display oriented editor.
12975 .Bl -tag -width ".It Pa BaNg"
12977 User-specific file giving initial commands, one of the
12978 .Sx "Resource files" .
12979 The actual value is read from
12983 System wide initialization file, one of the
12984 .Sx "Resource files" .
12985 The actual value is read from
12986 .Va system-mailrc .
12990 \*(OP Personal MIME type handler definition file, see
12991 .Sx "The Mailcap files" .
12992 This location is part of the RFC 1524 standard search path, which is
12993 a configuration option and can be overridden via
12997 .It Pa /etc/mailcap
12998 \*(OP System wide MIME type handler definition file, see
12999 .Sx "The Mailcap files" .
13000 This location is part of the RFC 1524 standard search path, which is
13001 a configuration option and can be overridden via
13005 The default value for
13010 Personal MIME types, see
13011 .Sx "The mime.types files" .
13015 System wide MIME types, see
13016 .Sx "The mime.types files" .
13020 \*(IN\*(OP The default location of the user's
13022 file \(en the section
13023 .Sx "The .netrc file"
13024 documents the file format.
13025 The actually used path can be overridden via
13035 .\" .Ss "Resource files" {{{
13036 .Ss "Resource files"
13038 Upon startup \*(UA reads in several resource files, in order:
13040 .Bl -tag -width ".It Pa BaNg"
13043 System wide initialization file
13044 .Pf ( Va system-mailrc ) .
13045 Reading of this file can be suppressed, either by using the
13047 (and according argument) or
13049 command line options, or by setting the
13052 .Ev MAILX_NO_SYSTEM_RC .
13056 File giving initial commands.
13057 A different file can be chosen by setting the
13061 Reading of this file can be suppressed with the
13063 command line option.
13065 .It Va mailx-extra-rc
13066 Defines a startup file to be read after all other resource files.
13067 It can be used to specify settings that are not understood by other
13069 implementations, for example.
13070 This variable is only honoured when defined in a resource file, e.g.,
13072 .Sx "INTERNAL VARIABLES" .
13076 The content of these files is interpreted as follows:
13079 .Bl -bullet -compact
13081 The whitespace characters space, tabulator and newline,
13082 as well as those defined by the variable
13084 are removed from the beginning and end of input lines.
13086 Empty lines are ignored.
13088 Any other line is interpreted as a command.
13089 It may be spread over multiple input lines if the newline character is
13091 by placing a reverse solidus character
13093 as the last character of the line; whereas any leading whitespace of
13094 follow lines is ignored, trailing whitespace before a escaped newline
13095 remains in the input.
13097 If the line (content) starts with the number sign
13099 then it is a comment-command and also ignored.
13100 (The comment-command is a real command, which does nothing, and
13101 therefore the usual follow lines mechanism applies!)
13105 Unless \*(UA is about to enter interactive mode syntax errors that occur
13106 while loading these files are treated as errors and cause program exit.
13107 More files with syntactically equal content can be
13109 The following, saved in a file, would be an examplary content:
13111 .Bd -literal -offset indent
13112 # This line is a comment command. And y\e
13113 es, it is really continued here.
13120 .\" .Ss "The mime.types files" {{{
13121 .Ss "The mime.types files"
13124 .Sx "HTML mail and MIME attachments"
13125 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
13126 media types in order to classify message and attachment content.
13127 One source for them are
13129 files, the loading of which can be controlled by setting the variable
13130 .Va mimetypes-load-control .
13131 Another is the command
13133 which also offers access to \*(UAs MIME type cache.
13135 files have the following syntax:
13137 .Bd -literal -offset indent
13138 type/subtype extension [extension ...]
13139 # E.g., text/html html htm
13145 define the MIME media type, as standardized in RFC 2046:
13147 is used to declare the general type of data, while the
13149 specifies a specific format for that type of data.
13150 One or multiple filename
13152 s, separated by whitespace, can be bound to the media type format.
13153 Comments may be introduced anywhere on a line with a number sign
13155 causing the remaining line to be discarded.
13157 \*(UA also supports an extended, non-portable syntax in especially
13158 crafted files, which can be loaded via the alternative value syntax of
13159 .Va mimetypes-load-control ,
13160 and prepends an optional
13164 .Dl [type-marker ]type/subtype extension [extension ...]
13167 The following type markers are supported:
13170 .Bl -tag -compact -width ".It Ar _n_u"
13172 Treat message parts with this content as plain text.
13177 Treat message parts with this content as HTML tagsoup.
13178 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
13179 the content as plain text instead.
13183 but instead of falling back to plain text require an explicit content
13184 handler to be defined.
13186 If no handler can be found a text message is displayed which says so.
13187 This can be annoying, for example signatures serve a contextual purpose,
13188 their content is of no use by itself.
13189 This marker will avoid displaying the text message.
13194 for sending messages:
13196 .Va mime-allow-text-controls ,
13197 .Va mimetypes-load-control .
13198 For reading etc. messages:
13199 .Sx "HTML mail and MIME attachments" ,
13200 .Sx "The Mailcap files" ,
13202 .Va mime-counter-evidence ,
13203 .Va mimetypes-load-control ,
13204 .Va pipe-TYPE/SUBTYPE ,
13205 .Va pipe-EXTENSION .
13208 .\" .Ss "The Mailcap files" {{{
13209 .Ss "The Mailcap files"
13211 .\" TODO MAILCAP DISABLED
13212 .Sy This feature is not available in v14.9.0, sorry!
13214 .Dq User Agent Configuration Mechanism
13215 which \*(UA \*(OPally supports (see
13216 .Sx "HTML mail and MIME attachments" ) .
13217 It defines a file format to be used to inform mail user agent programs
13218 about the locally-installed facilities for handling various data
13219 formats, i.e., about commands and how they can be used to display, edit
13220 et cetera MIME part contents, as well as a default path search that
13221 includes multiple possible locations of
13225 environment variable that can be used to overwrite that (repeating here
13226 that it is not a search path, but instead a path search specification).
13227 Any existing files will be loaded in sequence, appending any content to
13228 the list of MIME type handler directives.
13232 files consist of a set of newline separated entries.
13233 Comment lines start with a number sign
13235 (in the first column!) and are ignored.
13236 Empty lines are also ignored.
13237 All other lines form individual entries that must adhere to the syntax
13239 To extend a single entry (not comment) its line can be continued on
13240 follow lines if newline characters are
13242 by preceding them with the reverse solidus character
13244 The standard does not specify how leading whitespace of follow lines
13245 is to be treated, therefore \*(UA retains it.
13249 entries consist of a number of semicolon
13251 separated fields, and the reverse solidus
13253 character can be used to escape any following character including
13254 semicolon and itself.
13255 The first two fields are mandatory and must occur in the specified
13256 order, the remaining fields are optional and may appear in any order.
13257 Leading and trailing whitespace of content is ignored (removed).
13260 The first field defines the MIME
13262 the entry is about to handle (case-insensitively, and no reverse solidus
13263 escaping is possible in this field).
13264 If the subtype is specified as an asterisk
13266 the entry is meant to match all subtypes of the named type, e.g.,
13268 would match any audio type.
13269 The second field defines the shell command which shall be used to
13271 MIME parts of the given type; it is implicitly called the
13278 shell commands message (MIME part) data is passed via standard input
13279 unless the given shell command includes one or more instances of the
13282 in which case these instances will be replaced with a temporary filename
13283 and the data will have been stored in the file that is being pointed to.
13286 shell commands data is assumed to be generated on standard output unless
13287 the given command includes (one ore multiple)
13289 In any case any given
13291 format is replaced with a(n already) properly quoted filename.
13292 Note that when a command makes use of a temporary file via
13294 then \*(UA will remove it again, as if the
13295 .Cd x-mailx-tmpfile ,
13296 .Cd x-mailx-tmpfile-fill
13298 .Cd x-mailx-tmpfile-unlink
13299 flags had been set; see below for more.
13302 The optional fields either define a shell command or an attribute (flag)
13303 value, the latter being a single word and the former being a keyword
13304 naming the field followed by an equals sign
13306 succeeded by a shell command, and as usual for any
13308 content any whitespace surrounding the equals sign will be removed, too.
13309 Optional fields include the following:
13312 .Bl -tag -width ".It Cd BaNg"
13314 A program that can be used to compose a new body or body part in the
13316 (Currently unused.)
13318 .It Cd composetyped
13321 field, but is to be used when the composing program needs to specify the
13323 header field to be applied to the composed data.
13324 (Currently unused.)
13327 A program that can be used to edit a body or body part in the given
13329 (Currently unused.)
13332 A program that can be used to print a message or body part in the given
13334 (Currently unused.)
13337 Specifies a program to be run to test some condition, e.g., the machine
13338 architecture, or the window system in use, to determine whether or not
13339 this mailcap entry applies.
13340 If the test fails, a subsequent mailcap entry should be sought; also see
13341 .Cd x-mailx-test-once .
13344 .It Cd needsterminal
13345 This flag field indicates that the given shell command must be run on
13346 an interactive terminal.
13347 \*(UA will temporarily release the terminal to the given command in
13348 interactive mode, in non-interactive mode this entry will be entirely
13349 ignored; this flag implies
13350 .Cd x-mailx-noquote .
13353 .It Cd copiousoutput
13354 A flag field which indicates that the output of the
13356 command will be an extended stream of textual output that can be
13357 (re)integrated into \*(UA's normal visual display.
13358 It is mutually exclusive with
13359 .Cd needsterminal .
13361 .It Cd textualnewlines
13362 A flag field which indicates that this type of data is line-oriented and
13363 that, if encoded in
13365 all newlines should be converted to canonical form (CRLF) before
13366 encoding, and will be in that form after decoding.
13367 (Currently unused.)
13369 .It Cd nametemplate
13370 This field gives a filename format, in which
13372 will be replaced by a random string, the joined combination of which
13373 will be used as the filename denoted by
13374 .Ev MAILX_FILENAME_TEMPORARY .
13375 One could specify that a GIF file being passed to an image viewer should
13376 have a name ending in
13379 .Ql nametemplate=%s.gif .
13380 Note that \*(UA ignores the name template unless that solely specifies
13381 a filename suffix that consists of (ASCII) alphabetic and numeric
13382 characters, the underscore and dot only.
13385 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
13386 icon to be used to visually denote the presence of this kind of data.
13387 This field is not used by \*(UA.
13390 A textual description that describes this type of data.
13393 .It Cd x-mailx-even-if-not-interactive
13394 An extension flag test field \(em by default handlers without
13396 are entirely ignored in non-interactive mode, but if this flag is set
13397 then their use will be considered.
13398 It is an error if this flag is set for commands that use the flag
13399 .Cd needsterminal .
13402 .It Cd x-mailx-noquote
13403 An extension flag field that indicates that even a
13406 command shall not be used to generate message quotes
13407 (as it would be by default).
13410 .It Cd x-mailx-async
13411 Extension flag field that denotes that the given
13413 command shall be executed asynchronously, without blocking \*(UA.
13414 Cannot be used in conjunction with
13415 .Cd needsterminal .
13418 .It Cd x-mailx-test-once
13419 Extension flag which denotes whether the given
13421 command shall be evaluated once only and the (boolean) result be cached.
13422 This is handy if some global unchanging condition is to be queried, like
13423 .Dq running under the X Window System .
13426 .It Cd x-mailx-tmpfile
13427 Extension flag field that requests creation of a zero-sized temporary
13428 file, the name of which is to be placed in the environment variable
13429 .Ev MAILX_FILENAME_TEMPORARY .
13430 It is an error to use this flag with commands that include a
13435 .It Cd x-mailx-tmpfile-fill
13436 Normally the MIME part content is passed to the handler via standard
13437 input; if this flag is set then the data will instead be written into
13439 .Cd x-mailx-tmpfile .
13440 In order to cause deletion of the temporary file you will have to set
13441 .Cd x-mailx-tmpfile-unlink
13443 It is an error to use this flag with commands that include a
13448 .It Cd x-mailx-tmpfile-unlink
13449 Extension flag field that requests that the temporary file shall be
13450 deleted automatically when the command loop is entered again at latest.
13451 (Do not use this for asynchronous handlers.)
13452 It is an error to use this flag with commands that include a
13454 format, or in conjunction with
13455 .Cd x-mailx-async ,
13456 or without also setting
13457 .Cd x-mailx-tmpfile
13459 .Cd x-mailx-tmpfile-fill .
13462 .It Cd x-mailx-tmpfile-keep
13465 implies the three tmpfile related flags above, but if you want, e.g.,
13467 and deal with the temporary file yourself, you can add in this flag to
13469 .Cd x-mailx-tmpfile-unlink .
13474 The standard includes the possibility to define any number of additional
13475 entry fields, prefixed by
13477 Flag fields apply to the entire
13479 entry \(em in some unusual cases, this may not be desirable, but
13480 differentiation can be accomplished via separate entries, taking
13481 advantage of the fact that subsequent entries are searched if an earlier
13482 one does not provide enough information.
13485 command needs to specify the
13489 command shall not, the following will help out the latter (with enabled
13493 level \*(UA will show information about handler evaluation):
13495 .Bd -literal -offset indent
13496 application/postscript; ps-to-terminal %s; needsterminal
13497 application/postscript; ps-to-terminal %s; compose=idraw %s
13501 In fields any occurrence of the format string
13503 will be replaced by the
13506 Named parameters from the
13508 field may be placed in the command execution line using
13510 followed by the parameter name and a closing
13513 The entire parameter should appear as a single command line argument,
13514 regardless of embedded spaces; thus:
13516 .Bd -literal -offset indent
13518 Content-type: multipart/mixed; boundary=42
13521 multipart/*; /usr/local/bin/showmulti \e
13522 %t %{boundary} ; composetyped = /usr/local/bin/makemulti
13524 # Executed shell command
13525 /usr/local/bin/showmulti multipart/mixed 42
13529 .\" TODO v15: Mailcap: %n,%F
13530 Note that \*(UA does not support handlers for multipart MIME parts as
13531 shown in this example (as of today).
13532 \*(UA does not support the additional formats
13536 An example file, also showing how to properly deal with the expansion of
13538 which includes any quotes that are necessary to make it a valid shell
13539 argument by itself and thus will cause undesired behaviour when placed
13540 in additional user-provided quotes:
13542 .Bd -literal -offset indent
13544 text/richtext; richtext %s; copiousoutput
13546 text/x-perl; perl -cWT %s
13548 application/pdf; \e
13550 trap "rm -f ${infile}" EXIT\e; \e
13551 trap "exit 75" INT QUIT TERM\e; \e
13553 x-mailx-async; x-mailx-tmpfile-keep
13555 application/*; echo "This is \e"%t\e" but \e
13556 is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vet; \e
13557 copiousoutput; x-mailx-noquote
13562 .Sx "HTML mail and MIME attachments" ,
13563 .Sx "The mime.types files" ,
13566 .Va mime-counter-evidence ,
13567 .Va pipe-TYPE/SUBTYPE ,
13568 .Va pipe-EXTENSION .
13571 .\" .Ss "The .netrc file" {{{
13572 .Ss "The .netrc file"
13576 file contains user credentials for machine accounts.
13577 The default location
13579 may be overridden by the
13581 environment variable.
13582 It is possible to load encrypted
13584 files by using an appropriate value in
13588 The file consists of space, tabulator or newline separated tokens.
13589 \*(UA implements a parser that supports a superset of the original BSD
13590 syntax, but users should nonetheless be aware of portability glitches
13591 of that file format, shall their
13593 be usable across multiple programs and platforms:
13596 .Bl -bullet -compact
13598 BSD does not support single, but only double quotation marks, e.g.,
13599 .Ql password="pass with spaces" .
13601 BSD (only?) supports escaping of single characters via a reverse solidus
13602 (e.g., a space can be escaped via
13604 in- as well as outside of a quoted string.
13606 BSD does not require a final quotation mark of the last user input token.
13608 The original BSD (Berknet) parser also supported a format which allowed
13609 tokens to be separated with commas \(en whereas at least Hewlett-Packard
13610 still seems to support this syntax, \*(UA does not!
13612 As a non-portable extension some widely-used programs support
13613 shell-style comments: if an input line starts, after any amount of
13614 whitespace, with a number sign
13616 then the rest of the line is ignored.
13618 Whereas other programs may require that the
13620 file is accessible by only the user if it contains a
13622 token for any other
13626 \*(UA will always require these strict permissions.
13630 Of the following list of supported tokens \*(UA only uses (and caches)
13635 At runtime the command
13637 can be used to control \*(UA's
13641 .Bl -tag -width ".It Cd BaNg"
13642 .It Cd machine Ar name
13643 The hostname of the entries' machine, lowercase-normalized by \*(UA
13645 Any further file content, until either end-of-file or the occurrence
13650 first-class token is bound (only related) to the machine
13653 As an extension that should not be the cause of any worries
13654 \*(UA supports a single wildcard prefix for
13656 .Bd -literal -offset indent
13657 machine *.example.com login USER password PASS
13658 machine pop3.example.com login USER password PASS
13659 machine smtp.example.com login USER password PASS
13665 .Ql pop3.example.com ,
13669 .Ql local.smtp.example.com .
13670 Note that in the example neither
13671 .Ql pop3.example.com
13673 .Ql smtp.example.com
13674 will be matched by the wildcard, since the exact matches take
13675 precedence (it is however faster to specify it the other way around).
13678 This is the same as
13680 except that it is a fallback entry that is used shall none of the
13681 specified machines match; only one default token may be specified,
13682 and it must be the last first-class token.
13684 .It Cd login Ar name
13685 The user name on the remote machine.
13687 .It Cd password Ar string
13688 The user's password on the remote machine.
13690 .It Cd account Ar string
13691 Supply an additional account password.
13692 This is merely for FTP purposes.
13694 .It Cd macdef Ar name
13696 A macro is defined with the specified
13698 it is formed from all lines beginning with the next line and continuing
13699 until a blank line is (consecutive newline characters are) encountered.
13702 entries cannot be utilized by multiple machines, too, but must be
13703 defined following the
13705 they are intended to be used with.)
13708 exists, it is automatically run as the last step of the login process.
13709 This is merely for FTP purposes.
13716 .\" .Sh EXAMPLES {{{
13719 .\" .Ss "An example configuration" {{{
13720 .Ss "An example configuration"
13722 .Bd -literal -offset indent
13723 # This example assumes v15.0 compatibility mode
13726 # Request strict TLL transport layer security checks
13727 set tls-verify=strict
13729 # Where are the up-to-date TLS certificates?
13730 # (Since we manage up-to-date ones explicitly, do not use any,
13731 # possibly outdated, default certificates shipped with OpenSSL)
13732 #set tls-ca-dir=/etc/ssl/certs
13733 set tls-ca-file=/etc/ssl/certs/ca-certificates.crt
13734 set tls-ca-no-defaults
13735 #set tls-ca-flags=partial-chain
13736 wysh set smime-ca-file="${tls-ca-file}" \e
13737 smime-ca-no-defaults #smime-ca-flags="${tls-ca-flags}"
13739 # This could be outsourced to a central configuration file via
13740 # tls-config-file plus tls-config-module if the used library allows.
13741 # CipherString: explicitly define the list of ciphers, which may
13742 # improve security, especially with protocols older than TLS v1.2.
13743 # See ciphers(1). Possibly best to only use tls-config-pairs-HOST
13744 # (or -USER@HOST), as necessary, again..
13745 # Note that TLSv1.3 uses Ciphersuites= instead, which will join
13746 # with CipherString (if protocols older than v1.3 are allowed)
13747 # Curves: especially with TLSv1.3 curves selection may be desired.
13748 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
13749 # Change this only when the remote server does not support it:
13750 # maybe use chain support via tls-config-pairs-HOST / -USER@HOST
13751 # to define such explicit exceptions, then, e.g.
13752 # MinProtocol=TLSv1.1
13753 if [ "$tls-features" =% +ctx-set-maxmin-proto ]
13754 wysh set tls-config-pairs='\e
13755 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
13756 Curves=P-521:P-384:P-256,\e
13757 MinProtocol=TLSv1.1'
13759 wysh set tls-config-pairs='\e
13760 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
13761 Curves=P-521:P-384:P-256,\e
13762 Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2\e, +TLSv1.3'
13765 # Essential setting: select allowed character sets
13766 set sendcharsets=utf-8,iso-8859-1
13768 # A very kind option: when replying to a message, first try to
13769 # use the same encoding that the original poster used herself!
13770 set reply-in-same-charset
13772 # When replying, do not merge From: and To: of the original message
13773 # into To:. Instead old From: -> new To:, old To: -> merge Cc:.
13774 set recipients-in-cc
13776 # When sending messages, wait until the Mail-Transfer-Agent finishs.
13777 # Only like this you will be able to see errors reported through the
13778 # exit status of the MTA (including the built-in SMTP one)!
13781 # Only use built-in MIME types, no mime.types(5) files
13782 set mimetypes-load-control
13784 # Default directory where we act in (relative to $HOME)
13786 # A leading "+" (often) means: under *folder*
13787 # *record* is used to save copies of sent messages
13788 set MBOX=+mbox.mbox DEAD=+dead.txt \e
13789 record=+sent.mbox record-files record-resent
13791 # Make "file mymbox" and "file myrec" go to..
13792 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
13794 # Not really optional, e.g., for S/MIME
13795 set from='Your Name <address@exam.ple>'
13797 # It may be necessary to set hostname and/or smtp-hostname
13798 # if the "SERVER" of mta and "domain" of from do not match.
13799 # The `urlencode' command can be used to encode USER and PASS
13800 set mta=(smtps?|submissions?)://[USER[:PASS]@]SERVER[:PORT] \e
13801 smtp-auth=login/plain... \e
13804 # Never refuse to start into interactive mode, and more
13806 colour-pager crt= \e
13807 followup-to followup-to-honour=ask-yes fullnames \e
13808 history-file=+.\*(uAhist history-size=-1 history-gabby \e
13809 mime-counter-evidence=0b1111 \e
13810 prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
13811 reply-to-honour=ask-yes \e
13814 # Only include the selected header fields when typing messages
13815 headerpick type retain from_ date from to cc subject \e
13816 message-id mail-followup-to reply-to
13817 # ...when forwarding messages
13818 headerpick forward retain subject date from to cc
13819 # ...when saving message, etc.
13820 #headerpick save ignore ^Original-.*$ ^X-.*$
13822 # Some mailing lists
13823 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
13824 mlsubscribe '^xfans@xfans\e.xyz$'
13826 # Handle a few file extensions (to store MBOX databases)
13827 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
13828 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
13829 zst 'zstd -dc' 'zstd -19 -zc' \e
13830 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
13832 # A real life example of a very huge free mail provider
13833 # Instead of directly placing content inside `account',
13834 # we `define' a macro: like that we can switch "accounts"
13835 # from within *on-compose-splice*, for example!
13837 set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
13838 set from='Your Name <address@examp.ple>'
13840 set pop3-no-apop-pop.gmXil.com
13841 shortcut pop %:pop3s://pop.gmXil.com
13842 shortcut imap %:imaps://imap.gmXil.com
13843 # Or, entirely IMAP based setup
13844 #set folder=imaps://imap.gmail.com record="+[Gmail]/Sent Mail" \e
13845 # imap-cache=~/spool/cache
13847 set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
13849 set mta=smtps://USER:PASS@smtp.gmail.com:465
13855 # Here is a pretty large one which does not allow sending mails
13856 # if there is a domain name mismatch on the SMTP protocol level,
13857 # which would bite us if the value of from does not match, e.g.,
13858 # for people who have a sXXXXeforge project and want to speak
13859 # with the mailing list under their project account (in from),
13860 # still sending the message through their normal mail provider
13862 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
13863 set from='Your Name <address@exam.ple>'
13865 shortcut pop %:pop3s://pop.yaXXex.com
13866 shortcut imap %:imaps://imap.yaXXex.com
13868 set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
13869 hostname=yaXXex.com smtp-hostname=
13875 # Create some new commands so that, e.g., `ls /tmp' will..
13876 commandalias lls '!ls ${LS_COLOUR_FLAG} -aFlrS'
13877 commandalias llS '!ls ${LS_COLOUR_FLAG} -aFlS'
13879 set pipe-message/external-body='@* echo $MAILX_EXTERNAL_BODY_URL'
13881 # We do not support gpg(1) directly yet. But simple --clearsign'd
13882 # message parts can be dealt with as follows:
13885 wysh set pipe-text/plain=$'@*#++=@\e
13886 < "${MAILX_FILENAME_TEMPORARY}" awk \e
13887 -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
13889 /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
13892 print "--- GPG --verify ---";\e
13893 system("gpg --verify " TMPFILE " 2>&1");\e
13894 print "--- GPG --verify ---";\e
13898 /^-----BEGIN PGP SIGNATURE-----/,\e
13899 /^-----END PGP SIGNATURE-----/{\e
13906 commandalias V '\e'call V
13910 When storing passwords in
13912 appropriate permissions should be set on this file with
13913 .Ql $ chmod 0600 \*(ur .
13916 is available user credentials can be stored in the central
13918 file instead; e.g., here is a different version of the example account
13919 that sets up SMTP and POP3:
13921 .Bd -literal -offset indent
13923 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
13924 set from='Your Name <address@exam.ple>'
13926 # Load an encrypted ~/.netrc by uncommenting the next line
13927 #set netrc-pipe='gpg -qd ~/.netrc.pgp'
13929 set mta=smtps://smtp.yXXXXx.ru:465 \e
13930 smtp-hostname= hostname=yXXXXx.com
13931 set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
13932 commandalias xp fi pop3s://pop.yXXXXx.ru
13944 .Bd -literal -offset indent
13945 machine *.yXXXXx.ru login USER password PASS
13949 This configuration should now work just fine:
13952 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
13955 .\" .Ss "S/MIME step by step" {{{
13956 .Ss "S/MIME step by step"
13958 \*(OP The first thing that is needed for
13959 .Sx "Signed and encrypted messages with S/MIME"
13960 is a personal certificate, and a private key.
13961 The certificate contains public information, in particular a name and
13962 email address(es), and the public key that can be used by others to
13963 encrypt messages for the certificate holder (the owner of the private
13966 signed messages generated with that certificate('s private key).
13967 Whereas the certificate is included in each signed message, the private
13968 key must be kept secret.
13969 It is used to decrypt messages that were previously encrypted with the
13970 public key, and to sign messages.
13973 For personal use it is recommended that get a S/MIME certificate from
13974 one of the major CAs on the Internet.
13975 Many CAs offer such certificates for free.
13976 Usually offered is a combined certificate and private key in PKCS#12
13977 format which \*(UA does not accept directly.
13978 To convert it to PEM format, the following shell command can be used;
13979 please read on for how to use these PEM files.
13981 .Bd -literal -offset indent
13982 $ openssl pkcs12 -in cert.p12 -out certpem.pem -clcerts -nodes
13984 $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
13985 $ openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
13990 .Lk https://www.CAcert.org
13991 which issues client and server certificates to members of their
13992 community for free; their root certificate
13993 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
13994 is often not in the default set of trusted CA root certificates, though,
13995 which means their root certificate has to be downloaded separately,
13996 and needs to be part of the S/MIME certificate validation chain by
13999 or as a vivid member of the
14000 .Va smime-ca-file .
14001 But let us take a step-by-step tour on how to setup S/MIME with
14002 a certificate from CAcert.org despite this situation!
14005 First of all you will have to become a member of the CAcert.org
14006 community, simply by registrating yourself via the web interface.
14007 Once you are, create and verify all email addresses you want to be able
14008 to create signed and encrypted messages for/with using the corresponding
14009 entries of the web interface.
14010 Now ready to create S/MIME certificates, so let us create a new
14011 .Dq client certificate ,
14012 ensure to include all email addresses that should be covered by the
14013 certificate in the following web form, and also to use your name as the
14017 Create a private key and a certificate request on your local computer
14018 (please see the manual pages of the used commands for more in-depth
14019 knowledge on what the used arguments etc. do):
14022 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
14025 Afterwards copy-and-paste the content of
14027 into the certificate-request (CSR) field of the web form on the
14028 CAcert.org website (you may need to unfold some
14029 .Dq advanced options
14030 to see the corresponding text field).
14031 This last step will ensure that your private key (which never left your
14032 box) and the certificate belong together (through the public key that
14033 will find its way into the certificate via the certificate-request).
14034 You are now ready and can create your CAcert certified certificate.
14035 Download and store or copy-and-paste it as
14040 In order to use your new S/MIME setup a combined private key/public key
14041 (certificate) file has to be created:
14044 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
14047 This is the file \*(UA will work with.
14048 If you have created your private key with a passphrase then \*(UA will
14049 ask you for it whenever a message is signed or decrypted, unless this
14050 operation has been automated as described in
14051 .Sx "Signed and encrypted messages with S/MIME" .
14052 Set the following variables to henceforth use S/MIME (setting
14054 is of interest for verification only):
14056 .Bd -literal -offset indent
14057 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
14058 smime-sign-cert=ME@HERE.com.paired \e
14059 smime-sign-digest=SHA512 \e
14065 .\" .Ss "Using CRLs with S/MIME or TLS" {{{
14066 .Ss "Using CRLs with S/MIME or TLS"
14068 \*(OP Certification authorities (CAs) issue certificate revocation
14069 lists (CRLs) on a regular basis.
14070 These lists contain the serial numbers of certificates that have been
14071 declared invalid after they have been issued.
14072 Such usually happens because the private key for the certificate has
14074 because the owner of the certificate has left the organization that is
14075 mentioned in the certificate, etc.
14076 To seriously use S/MIME or TLS verification,
14077 an up-to-date CRL is required for each trusted CA.
14078 There is otherwise no method to distinguish between valid and
14079 invalidated certificates.
14080 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
14081 the Internet, so they have to be retrieved by some external mechanism.
14084 \*(UA accepts CRLs in PEM format only;
14085 CRLs in DER format must be converted, like, e.\|g.:
14088 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
14091 To tell \*(UA about the CRLs, a directory that contains all CRL files
14092 (and no other files) must be created.
14097 variables, respectively, must then be set to point to that directory.
14098 After that, \*(UA requires a CRL to be present for each CA that is used
14099 to verify a certificate.
14108 In general it is a good idea to turn on
14114 twice) if something does not work well.
14115 Very often a diagnostic message can be produced that leads to the
14116 problems' solution.
14118 .\" .Ss "\*(UA shortly hangs on startup" {{{
14119 .Ss "\*(UA shortly hangs on startup"
14121 This can have two reasons, one is the necessity to wait for a file lock
14122 and cannot be helped, the other being that \*(UA calls the function
14124 in order to query the nodename of the box (sometimes the real one is
14125 needed instead of the one represented by the internal variable
14127 One may have varying success by ensuring that the real hostname and
14131 or, more generally, that the name service is properly setup \(en
14134 return the expected value?
14135 Does this local hostname have a domain suffix?
14136 RFC 6762 standardized the link-local top-level domain
14138 try again after adding an (additional) entry with this extension.
14141 .\" .Ss "I cannot login to Google mail aka GMail" {{{
14142 .Ss "I cannot login to Google mail aka GMail"
14144 Since 2014 some free service providers classify programs as
14146 unless they use a special authentication method (OAuth 2.0) which
14147 was not standardized for non-HTTP protocol authentication token query
14148 until August 2015 (RFC 7628).
14151 Different to Kerberos / GSSAPI, which is developed since the mid of the
14152 1980s, where a user can easily create a local authentication ticket for
14153 her- and himself with the locally installed
14155 program, that protocol has no such local part but instead requires
14156 a world-wide-web query to create or fetch a token; since there is no
14157 local cache this query would have to be performed whenever \*(UA is
14158 invoked (in interactive sessions situation may differ).
14161 \*(UA does not support OAuth.
14162 Because of this it is necessary to declare \*(UA a
14163 .Dq less secure app
14164 (on the providers account web page) in order to read and send mail.
14165 However, it also seems possible to take the following steps instead:
14170 give the provider the number of a mobile phone,
14173 .Dq 2-Step Verification ,
14175 create an application specific password (16 characters), and
14177 use that special password instead of the real Google account password in
14178 \*(UA (for more on that see the section
14179 .Sx "On URL syntax and credential lookup" ) .
14183 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
14184 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
14186 It can happen that the terminal library (see
14187 .Sx "On terminal control and line editor",
14190 reports different codes than the terminal really sends, in which case
14191 \*(UA will tell that a key binding is functional, but will not be able to
14192 recognize it because the received data does not match anything expected.
14193 Especially without the \*(OPal terminal capability library support one
14194 reason for this may be that the (possibly even non-existing) keypad
14195 is not turned on and the resulting layout reports the keypad control
14196 codes for the normal keyboard keys.
14201 ings will show the byte sequences that are expected.
14204 To overcome the situation, use, e.g., the program
14206 in conjunction with the command line option
14208 if available, to see the byte sequences which are actually produced
14209 by keypresses, and use the variable
14211 to make \*(UA aware of them.
14212 E.g., the terminal this is typed on produces some false sequences, here
14213 an example showing the shifted home key:
14215 .Bd -literal -offset indent
14218 # 1B 5B=[ 31=1 3B=; 32=2 48=H
14223 $ \*(uA -v -Stermcap='kHOM=\eE[H'
14230 .\" .Ss "Can \*(UA git-send-email?" {{{
14231 .Ss "Can \*(UA git-send-email?"
14234 Put (at least parts of) the following in your
14237 .Bd -literal -offset indent
14239 smtpserver = /usr/bin/s-mailx
14240 smtpserveroption = -t
14241 #smtpserveroption = -Sexpandaddr
14242 smtpserveroption = -Athe-account-you-need
14245 suppressfrom = false
14246 assume8bitEncoding = UTF-8
14249 chainreplyto = true
14260 .\" .Sh "IMAP CLIENT" {{{
14263 \*(OPally there is IMAP client support available.
14264 This part of the program is obsolete and will vanish in v15 with the
14265 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
14266 and makes excessive use of signal based long code jumps.
14267 Support can hopefully be readded later based on a new-style I/O, with
14268 SysV signal handling.
14269 In fact the IMAP support had already been removed from the codebase, but
14270 was reinstantiated on user demand: in effect the IMAP code is at the
14271 level of \*(UA v14.8.16 (with
14273 being the sole exception), and should be treated with some care.
14280 protocol prefixes, and an IMAP-based
14283 IMAP URLs (paths) undergo inspections and possible transformations
14284 before use (and the command
14286 can be used to manually apply them to any given argument).
14287 Hierarchy delimiters are normalized, a step which is configurable via the
14289 variable chain, but defaults to the first seen delimiter otherwise.
14290 \*(UA supports internationalised IMAP names, and en- and decodes the
14291 names from and to the
14293 as necessary and possible.
14294 If a mailbox name is expanded (see
14295 .Sx "Filename transformations" )
14296 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
14297 mailboxes below the
14299 target box, while folder names prefixed by `@' refer to folders below
14300 the hierarchy base, e.g., the following lists all folders below the
14301 current one when in an IMAP mailbox:
14305 Note: some IMAP servers do not accept the creation of mailboxes in
14306 the hierarchy base, but require that they are created as subfolders of
14307 `INBOX' \(en with such servers a folder name of the form
14309 .Dl imaps://mylogin@imap.myisp.example/INBOX.
14311 should be used (the last character is the server's hierarchy
14313 The following IMAP-specific commands exist:
14316 .Bl -tag -width ".It Ic BaNg"
14319 Only applicable to cached IMAP mailboxes;
14320 takes a message list and reads the specified messages into the IMAP
14325 If operating in disconnected mode on an IMAP mailbox,
14326 switch to online mode and connect to the mail server while retaining
14327 the mailbox status.
14328 See the description of the
14330 variable for more information.
14334 If operating in online mode on an IMAP mailbox,
14335 switch to disconnected mode while retaining the mailbox status.
14336 See the description of the
14339 A list of messages may optionally be given as argument;
14340 the respective messages are then read into the cache before the
14341 connection is closed, thus
14343 makes the entire mailbox available for disconnected use.
14347 Sends command strings directly to the current IMAP server.
14348 \*(UA operates always in IMAP `selected state' on the current mailbox;
14349 commands that change this will produce undesirable results and should be
14351 Useful IMAP commands are:
14352 .Bl -tag -offset indent -width ".Ic getquotearoot"
14354 Takes the name of an IMAP mailbox as an argument and creates it.
14356 (RFC 2087) Takes the name of an IMAP mailbox as an argument
14357 and prints the quotas that apply to the mailbox.
14358 Not all IMAP servers support this command.
14360 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
14361 the Other User's Namespaces and the Shared Namespaces.
14362 Each namespace type is printed in parentheses;
14363 if there are multiple namespaces of the same type,
14364 inner parentheses separate them.
14365 For each namespace a prefix and a hierarchy separator is listed.
14366 Not all IMAP servers support this command.
14371 Perform IMAP path transformations.
14375 .Sx "Command modifiers" ) ,
14376 and manages the error number
14378 The first argument specifies the operation:
14380 normalizes hierarchy delimiters (see
14382 and converts the strings from the locale
14384 to the internationalized variant used by IMAP,
14386 performs the reverse operation.
14391 The following IMAP-specific internal variables exist:
14394 .Bl -tag -width ".It Va BaNg"
14396 .It Va disconnected
14397 \*(BO When an IMAP mailbox is selected and this variable is set,
14398 no connection to the server is initiated.
14399 Instead, data is obtained from the local cache (see
14402 Mailboxes that are not present in the cache
14403 and messages that have not yet entirely been fetched from the server
14405 to fetch all messages in a mailbox at once,
14407 .No ` Ns Li copy * /dev/null Ns '
14408 can be used while still in connected mode.
14409 Changes that are made to IMAP mailboxes in disconnected mode are queued
14410 and committed later when a connection to that server is made.
14411 This procedure is not completely reliable since it cannot be guaranteed
14412 that the IMAP unique identifiers (UIDs) on the server still match the
14413 ones in the cache at that time.
14416 when this problem occurs.
14418 .It Va disconnected-USER@HOST
14419 The specified account is handled as described for the
14422 but other accounts are not affected.
14425 .It Va imap-auth-USER@HOST , imap-auth
14426 Sets the IMAP authentication method.
14427 Valid values are `login' for the usual password-based authentication
14429 `cram-md5', which is a password-based authentication that does not send
14430 the password over the network in clear text,
14431 and `gssapi' for GSS-API based authentication.
14435 Enables caching of IMAP mailboxes.
14436 The value of this variable must point to a directory that is either
14437 existent or can be created by \*(UA.
14438 All contents of the cache can be deleted by \*(UA at any time;
14439 it is not safe to make assumptions about them.
14442 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
14443 The hierarchy separator used by the IMAP server.
14444 Whenever an IMAP path is specified it will undergo normalization.
14445 One of the normalization steps is the squeezing and adjustment of
14446 hierarchy separators.
14447 If this variable is set, any occurrence of any character of the given
14448 value that exists in the path will be replaced by the first member of
14449 the value; an empty value will cause the default to be used, it is
14451 If not set, we will reuse the first hierarchy separator character that
14452 is discovered in a user-given mailbox name.
14454 .Mx Va imap-keepalive
14455 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
14456 IMAP servers may close the connection after a period of
14457 inactivity; the standard requires this to be at least 30 minutes,
14458 but practical experience may vary.
14459 Setting this variable to a numeric `value' greater than 0 causes
14460 a `NOOP' command to be sent each `value' seconds if no other operation
14464 .It Va imap-list-depth
14465 When retrieving the list of folders on an IMAP server, the
14467 command stops after it has reached a certain depth to avoid possible
14469 The value of this variable sets the maximum depth allowed.
14471 If the folder separator on the current IMAP server is a slash `/',
14472 this variable has no effect and the
14474 command does not descend to subfolders.
14476 .Mx Va imap-use-starttls
14477 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
14478 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
14479 IMAP session TLS encrypted.
14480 This functionality is not supported by all servers,
14481 and is not used if the session is already encrypted by the IMAPS method.
14487 .\" .Sh "SEE ALSO" {{{
14497 .Xr spamassassin 1 ,
14506 .Xr mailwrapper 8 ,
14512 .\" .Sh HISTORY {{{
14515 M. Douglas McIlroy writes in his article
14516 .Dq A Research UNIX Reader: Annotated Excerpts \
14517 from the Programmer's Manual, 1971-1986
14520 command already appeared in First Edition
14524 .Bd -ragged -offset indent
14525 Electronic mail was there from the start.
14526 Never satisfied with its exact behavior, everybody touched it at one
14527 time or another: to assure the safety of simultaneous access, to improve
14528 privacy, to survive crashes, to exploit uucp, to screen out foreign
14529 freeloaders, or whatever.
14530 Not until v7 did the interface change (Thompson).
14531 Later, as mail became global in its reach, Dave Presotto took charge and
14532 brought order to communications with a grab-bag of external networks
14538 Mail was written in 1978 by Kurt Shoens and developed as part of the
14541 distribution until 1995.
14542 Mail has then seen further development in open source
14544 variants, noticeably by Christos Zoulas in
14546 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
14547 Ritter in the years 2000 until 2008.
14548 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
14549 This man page is derived from
14550 .Dq The Mail Reference Manual
14551 that was originally written by Kurt Shoens.
14559 .An "Kurt Shoens" ,
14560 .An "Edward Wang" ,
14561 .An "Keith Bostic" ,
14562 .An "Christos Zoulas" ,
14563 .An "Gunnar Ritter" .
14564 \*(UA is developed by
14565 .An "Steffen Nurpmeso" Aq s-mailx@lists.sdaoden.eu .
14568 .\" .Sh CAVEATS {{{
14571 \*(ID Interrupting an operation via
14575 from anywhere else but a command prompt is very problematic and likely
14576 to leave the program in an undefined state: many library functions
14577 cannot deal with the
14579 that this software (still) performs; even though efforts have been taken
14580 to address this, no sooner but in v15 it will have been worked out:
14581 interruptions have not been disabled in order to allow forceful breakage
14582 of hanging network connections, for example (all this is unrelated to
14586 The SMTP and POP3 protocol support of \*(UA is very basic.
14587 Also, if it fails to contact its upstream SMTP server, it will not make
14588 further attempts to transfer the message at a later time (setting
14593 If this is a concern, it might be better to set up a local SMTP server
14594 that is capable of message queuing.
14601 After deleting some message of a POP3 mailbox the header summary falsely
14602 claims that there are no messages to display, one needs to perform
14603 a scroll or dot movement to restore proper state.
14609 mode a power user may encounter crashes very occasionally (this is may
14614 in the source repository lists future directions.
14617 Please report bugs to the
14619 address, e.g., from within \*(uA:
14620 .\" v15-compat: drop eval as `mail' will expand variable?
14621 .Ql ? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
14624 output of the command
14626 may be helpful, e.g.,
14628 .Bd -literal -offset indent
14629 ? wysh set escape=! verbose; vput version xy; unset verbose;\e
14630 eval mail $contact-mail
14637 Information on the web at
14638 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ' -Xx .