1 .\"@ nail.1 - S-nail(1) reference manual.
3 .\" Copyright (c) 2012 - 2020 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 .\" SPDX-License-Identifier: ISC
6 .\" Permission to use, copy, modify, and/or distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 .\"@ S-nail v14.9.18 / 2020-04-18
29 .ds VD \\%~/dead.letter
33 .ds vS /etc/mime.types
40 .ds ID [v15 behaviour may differ]
42 .ds NQ [Only new quoting rules]
45 .ds OU [no v15-compat]
48 .if !d str-Lb-libterminfo \
49 .ds str-Lb-libterminfo Terminal Information Library (libterminfo, \-lterminfo)
58 .Nd send and receive Internet mail
64 .\" Keep in SYNC: ./nail.1:"SYNOPSIS, main()
70 .Op : Ns Fl a Ar attachment Ns \&:
71 .Op : Ns Fl b Ar bcc-addr Ns \&:
72 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
73 .Op : Ns Fl c Ar cc-addr Ns \&:
74 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
76 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
78 .Op : Ns Fl T Ar """field:\0addr""" Ns \&:
79 .Op : Ns Fl X Ar cmd Ns \&:
80 .Op : Ns Fl Y Ar cmd Ns \&:
82 .Pf : Ar to-addr Ns \&:
83 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
91 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
94 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
96 .Op : Ns Fl X Ar cmd Ns \&:
97 .Op : Ns Fl Y Ar cmd Ns \&:
98 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
105 .Op : Ns Fl C Ar """field:\0body""" Ns \&:
108 .Op Fl r Ar from-addr
109 .Oo : Ns Fl S\0 Ns Ar var Ns Oo Ns = Ns Ar value Ns Oc Ns : Ns Oc
110 .Op : Ns Fl X Ar cmd Ns \&:
111 .Op : Ns Fl Y Ar cmd Ns \&:
113 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
119 .Fl V | Fl Fl version
124 .Mx -toc -tree html pdf ps xhtml
127 .\" .Sh DESCRIPTION {{{
130 .Bd -filled -compact -offset indent
132 S-nail (\*(UA) will see major changes in v15.0 (circa 2020).
133 Some backward incompatibilities cannot be avoided.
136 .Sx "Shell-style argument quoting" ,
137 and shell metacharacters will become (more) meaningful.
138 Some commands accept new syntax today via
140 .Pf ( Sx "Command modifiers" ) .
141 Behaviour is flagged \*(IN and \*(OU,
145 .Pf ( Sx "INTERNAL VARIABLES" )
146 will choose new behaviour when applicable;
147 giving it a value makes
150 \*(OB flags what will vanish.
154 (with value) will be a default in v14.10.0!
158 \*(UA provides a simple and friendly environment for sending and
160 It is intended to provide the functionality of the POSIX
162 command, but is MIME capable and optionally offers extensions for
163 line editing, S/MIME, SMTP and POP3, among others.
164 \*(UA divides incoming mail into its constituent messages and allows
165 the user to deal with them in any order.
169 .Sx "INTERNAL VARIABLES"
170 for manipulating messages and sending mail.
171 It provides the user simple editing capabilities to ease the composition
172 of outgoing messages, and increasingly powerful and reliable
173 non-interactive scripting capabilities.
175 .\" .Ss "Options" {{{
178 .Bl -tag -width ".It Fl BaNg"
180 .It Fl \&: Ar spec , Fl Fl resource-files Ns =..
181 Explicitly control which of the
185 d (loaded): if the letter
187 is (case-insensitively) part of
193 controls sourcing of the user's personal file
195 The (original, unmodified) system resource file content is also
196 available in the binary itself, and can be sourced without accessing
203 explicitly forbid sourcing of any resource files.
207 Scripts should use this option: to avoid environmental noise they should
209 from any configuration and create a script-specific environment, setting
211 .Sx "INTERNAL VARIABLES"
214 and running configurating commands via
216 This option overrides
220 .It Fl A Ar name , Fl Fl account Ns =..
223 command for the given user email account
225 after program startup is complete (all resource files are loaded, any
227 setting is being established, but
229 commands have not been evaluated yet).
230 Being a special incarnation of
232 macros for the purpose of bundling longer-lived
234 tings, activating such an email account also switches to the accounts
236 .Sx "primary system mailbox"
239 If the operation fails the program will exit if it is used
240 non-interactively, or if any of
247 .It Fl a Ar file Ns Oo Ar =input-charset Ns Oo Ar #output-charset Oc Oc , \
251 to the message (for compose mode opportunities refer to
255 after applying tilde expansion (see
256 .Sx "Filename transformations"
261 not be accessible but contain a
263 character, then anything before the last
265 will be used as the filename, anything thereafter as a character set
268 If an input character set is specified,
269 .Mx -ix "character set specification"
270 but no output character set, then the given input character set is fixed
271 as-is, and no conversion will be applied;
272 giving the empty string or the special string hyphen-minus
274 will be treated as if
276 has been specified (the default).
278 If an output character set has also been given then the conversion will
279 be performed exactly as specified and on-the-fly, not considering the
280 file type and content.
281 As an exception the empty string or hyphen-minus
283 select the default conversion algorithm (see
284 .Sx "Character sets" ) :
285 no conversion is performed on-the-fly,
287 and its contents will be MIME-classified
288 .Pf ( Sx "HTML mail and MIME attachments" , "The mime.types files") ;
289 Only this mode is available unless character set conversion is supported
295 (\*(OB: \*(UA will always use line-buffered output, to gain
296 line-buffered input even in batch mode enable batch mode via
300 .It Fl b Ar addr , Fl Fl bcc Ns =..
301 Send a blind carbon copy to recipient
308 .Sx "INTERNAL VARIABLES" ,
313 The option may be used multiple times.
315 .Sx "On sending mail, and non-interactive mode" .
318 .It Fl C Ar """field: body""" , Fl Fl custom-header Ns =..
319 Create a custom header which persists for an entire session.
320 A custom header consists of the field name followed by a colon
322 and the field content body, for example
323 .Ql -C """Blah: Neminem laede; imo omnes, quantum potes, juva""" .
324 Standard header field names cannot be overwritten by custom headers.
325 Runtime adjustable custom headers are available via the variable
330 .Sx "COMMAND ESCAPES" ,
333 are the most flexible and powerful options to manage message headers.
334 This option may be used multiple times.
337 .It Fl c Ar addr , Fl Fl cc Ns =..
340 except it places the argument in the list of carbon copies.
343 .It Fl D , Fl Fl disconnected
349 .It Fl d , Fl Fl debug
350 Enter a debug-only sandbox mode by setting the internal variable
352 the same can be achieved via
353 .Ql Fl S Va \&\&debug
355 .Ql Ic set Va \&\&debug .
360 .It Fl E , Fl Fl discard-empty-messages
363 and thus discard messages with an empty message part body.
366 .It Fl e , Fl Fl check-and-exit
367 Just check if mail is present (in the system
369 or the one specified via
371 if yes, return an exit status of zero, a non-zero value otherwise.
372 To restrict the set of mails to consider in this evaluation a message
373 specification can be added with the option
375 Quickrun: does not open an interactive session.
379 Save the message to send in a file named after the local part of the
380 first recipient's address (instead of in
384 .It Fl f , Fl Fl file
385 Read in the contents of the user's
387 .Sx "secondary mailbox"
389 (or the specified file) for processing;
390 when \*(UA is quit, it writes undeleted messages back to this file
396 argument will undergo some special
397 .Sx "Filename transformations"
402 is not an argument to the flag
404 but is instead taken from the command line after option processing has
408 that starts with a hyphen-minus, prefix with a relative path, as in
409 .Ql ./-hyphenbox.mbox .
412 .It Fl H , Fl Fl header-summary
425 A configurable summary view is available via the option
427 This mode does not honour
429 Quickrun: does not open an interactive session.
432 .It Fl h , Fl Fl help
433 Show a brief usage summary; use
435 for a list long options.
441 to ignore tty interrupt signals.
444 .It Fl L Ar spec , Fl Fl search Ns =..
447 of all messages that match the given
451 found by the same algorithm used by
455 .Sx "Specifying messages"
458 This mode does not honour
463 option has been given in addition no header summary is produced,
464 but \*(UA will instead indicate via its exit status whether
470 note that any verbose output is suppressed in this mode and must instead
471 be enabled explicitly (see
473 Quickrun: does not open an interactive session.
477 Special send mode that will flag standard input with the MIME
479 set to the given known
481 .Pf ( Sx "HTML mail and MIME attachments" , "The mime.types files" )
482 and use it as the main message body.
483 \*(ID Using this option will bypass processing of
484 .Va message-inject-head
486 .Va message-inject-tail .
492 Special send mode that will MIME classify the specified
494 and use it as the main message body.
495 \*(ID Using this option will bypass processing of
496 .Va message-inject-head
498 .Va message-inject-tail .
503 .It Fl N , Fl Fl no-header-summary
504 inhibit the initial display of message headers when reading mail or
509 for the internal variable
514 Standard flag that inhibits reading the system wide
519 allows more control over the startup sequence; also see
520 .Sx "Resource files" .
523 .It Fl q Ar file , Fl Fl quote-file Ns =..
524 Special send mode that will initialize the message body with the
525 contents of the specified
527 which may be standard input
529 only in non-interactive context.
534 .It Fl R , Fl Fl read-only
539 opened will be in read-only mode.
543 .It Fl r Ar from-addr , Fl Fl from-address Ns =..
544 The RFC 5321 reverse-path used for relaying and delegating messages to
545 its destination(s), for example to report delivery errors, is normally
546 derived from the address which appears in the
548 header (or, if that contains multiple addresses, in
550 A file-based aka local executable
552 (Mail-Transfer-Agent), however, instead uses the local identity of the
556 When this command line option is used the given single addressee
558 will be assigned to the internal variable
560 but in addition the command line option
561 .Fl \&\&f Ar from-addr
562 will be passed to a file-based
564 whenever a message is sent.
567 include a user name the address components will be separated and
568 the name part will be passed to a file-based
572 Even though not a recipient the
578 If an empty string is passed as
580 then the content of the variable
582 (or, if that contains multiple addresses,
584 will be evaluated and used for this purpose whenever the file-based
593 command line options are used when contacting a file-based MTA, unless
594 this automatic deduction is enforced by
596 ing the internal variable
597 .Va r-option-implicit .
600 Remarks: many default installations and sites disallow overriding the
601 local user identity like this unless either the MTA has been configured
602 accordingly or the user is member of a group with special privileges.
603 Passing an invalid address will cause an error.
607 .It Fl S Ar var Ns Oo = Ns value Oc , Fl Fl set Ns =..
609 (or, with a prefix string
612 .Sx "INTERNAL VARIABLES" ,
615 iable and optionally assign
617 if supported; \*(ID the entire expression is evaluated as if specified
618 within dollar-single-quotes (see
619 .Sx "Shell-style argument quoting" )
620 if the internal variable
623 If the operation fails the program will exit if any of
628 Settings established via
630 cannot be changed from within
632 or an account switch initiated by
634 They will become mutable again before commands registered via
639 .It Fl s Ar subject , Fl Fl subject Ns =..
640 Specify the subject of the message to be sent.
641 Newline (NL) and carriage-return (CR) bytes are invalid and will be
642 normalized to space (SP) characters.
645 .It Fl T Ar """field: addr""" , Fl Fl target Ns =..
648 to the list of receivers targeted by
650 for now supported are only
656 Field and body (address) are separated by a colon
658 and optionally blank (space, tabulator) characters.
664 is parsed like a message header address line, as if it would be part of
665 a template message fed in via
667 and the same modifier suffix is supported.
668 This option may be used multiple times.
671 .It Fl t , Fl Fl template
672 The text message given (on standard input) is expected to contain,
673 separated from the message body by an empty line, one or multiple
674 plain text message headers.
675 \*(ID Readily prepared MIME mail messages cannot be passed.
676 Headers can span multiple consecutive lines if follow lines start with
677 any amount of whitespace.
678 A line starting with the number sign
680 in the first column is ignored.
681 Message recipients can be given via the message headers
687 modifier enforces treatment as a single addressee, for example
688 .Ql To?single: exa, <m@ple> )
691 they will be added to any recipients specified on the command line,
692 and are likewise subject to
695 If a message subject is specified via
697 then it will be used in favour of one given on the command line.
699 More optional headers are
713 .Ql Mail-Followup-To: ,
714 by default created automatically dependent on message context, will
715 be used if specified (a special address massage will however still occur
717 Any other custom header field (also see
722 is passed through entirely
723 unchanged, and in conjunction with the options
727 it is possible to embed
728 .Sx "COMMAND ESCAPES" .
733 .It Fl u Ar user , Fl Fl inbox-of Ns =..
736 .Sx "primary system mailbox"
739 appropriate privileges presumed; effectively identical to
740 .Ql Fl \&\&f Ns \0%user .
743 .It Fl V , Fl Fl version
749 will also show the list of
751 .Ql $ \*(uA -:/ -Xversion -Xx .
754 .It Fl v , Fl Fl verbose
756 s the internal variable
758 to enable logging of informational context messages.
759 (Increases level of verbosity when used multiple times.)
764 .It Fl X Ar cmd , Fl Fl startup-cmd Ns =..
765 Add the given (or multiple for a multiline argument)
767 to a list of commands to be executed before normal operation starts.
768 The commands will be evaluated as a unit, just as via
776 .It Fl Y Ar cmd , Fl Fl cmd Ns =..
777 Add the given (or multiple for a multiline argument)
779 to a list of commands to be executed after normal operation has started.
780 The commands will be evaluated successively in the given order, and as
781 if given on the program's standard input \(em before interactive
782 prompting begins in interactive mode, after standard input has been
786 .It Fl ~ , Fl Fl enable-cmd-escapes
788 .Sx "COMMAND ESCAPES"
789 in compose mode even in non-interactive use cases.
790 This can for example be used to automatically format the composed
791 message text before sending the message:
792 .Bd -literal -offset indent
793 $ ( echo 'line one. Word. Word2.';\e
794 echo '~| /usr/bin/fmt -tuw66' ) |\e
795 LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
799 .It Fl # , Fl Fl batch-mode
800 Enables batch mode: standard input is made line buffered, the complete
801 set of (interactive) commands is available, processing of
802 .Sx "COMMAND ESCAPES"
803 is enabled in compose mode, and diverse
804 .Sx "INTERNAL VARIABLES"
805 are adjusted for batch necessities, exactly as if done via
825 are looked up, and acted upon.
826 The following prepares an email message in a batched dry run:
827 .Bd -literal -offset indent
828 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
829 LC_ALL=C \*(uA -d#:x -X'alias bob bob@exam.ple'
833 .It Fl \&. , Fl Fl end-options
834 This flag forces termination of option processing in order to prevent
837 It also forcefully puts \*(UA into send mode, see
838 .Sx "On sending mail, and non-interactive mode" .
844 arguments and all receivers established via
850 are subject to the checks established by
853 .Sx "INTERNAL VARIABLES" ;
854 they all support the flag
858 allows their recognition all
860 arguments given at the end of the command line after a
862 separator will be passed through to a file-based
864 (Mail-Transfer-Agent) and persist for the entire session.
866 constraints do not apply to the content of
870 .\" .Ss "A starter" {{{ review
873 \*(UA is a direct descendant of
875 Mail, itself a successor to the Research
878 .Dq was there from the start
881 It thus represents the user side of the
883 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
884 traditionally taken by
886 (and most MTAs provide a binary of this name for compatibility reasons).
891 of \*(UA then the system side is not a mandatory precondition for mail
895 \*(UA strives for compliance with the POSIX
900 .Sx "INTERNAL VARIABLES"
904 .Ev POSIXLY_CORRECT ) ,
905 needs to be set to adjust behaviour to be almost on par.
906 Almost, because there is one important difference: POSIX
907 .Sx "Shell-style argument quoting"
908 is (\*(ID increasingly) used instead of the
909 .Sx "Old-style argument quoting"
910 that the standard documents, which is believed to be a feature.
911 The builtin as well as the (default) global
914 already bend the standard imposed settings a bit.
923 in order to suppress the automatic moving of messages to the
925 .Sx "secondary mailbox"
927 that would otherwise occur (see
928 .Sx "Message states" ) ,
931 to not remove empty system MBOX mailbox files (or all empty such files in
933 mode) to avoid mangling of file permissions when files eventually get
937 To enter interactive mode even if the initial mailbox is empty
941 to allow editing of headers as well as
943 to not strip down addresses in compose mode, and
945 to include the message that is being responded to when
947 ing, which is indented by an
949 that also deviates from standard imposed settings.
950 .Va mime-counter-evidence
951 is fully enabled, too.
953 .Va followup-to-honour
956 to comply with reply address desires.
960 The file mode creation mask can be managed explicitly via the variable
962 Files and shell pipe output can be
966 uation, also during startup from within the
967 .Sx "Resource files" .
968 Informational context can be available by
978 .\" .Ss "On sending mail, and non-interactive mode" {{{
979 .Ss "On sending mail, and non-interactive mode"
981 To send a message to one or more people, using a local or built-in
983 (Mail-Transfer-Agent) transport to actually deliver the generated mail
984 message, \*(UA can be invoked with arguments which are the names of
985 people to whom the mail will be sent, and the command line options
989 can be used to add (blind) carbon copy receivers:
991 .Bd -literal -offset indent
993 $ echo Hello, world | \*(uA -:/ -Smta=test -s test $LOGNAME
995 # Via sendmail(1) MTA
996 $ </dev/null \*(uA -:x -s test $LOGNAME
998 # Debug dry-run mode:
999 $ </dev/null LC_ALL=C \*(uA -d -:/ \e
1000 -Sttycharset=utf8 -Sfullnames \e
1001 -b bcc@exam.ple -c cc@exam.ple -. \e
1002 '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
1004 # With SMTP (no real sending due to -d debug dry-run)
1005 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Sttycharset=utf8 \e
1006 -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
1007 -S from=scriptreply@exam.ple \e
1008 -a /etc/mail.rc --end-options \e
1009 eric@exam.ple < /tmp/letter.txt
1013 If standard input is a terminal rather than the message to be sent,
1014 the user is expected to type in the message contents.
1015 In this compose mode \*(UA treats lines beginning with the character
1017 special \(en these are so-called
1018 .Sx "COMMAND ESCAPES" ,
1019 which can be used to read in files, process shell commands, add and edit
1020 attachments and more; for example
1028 respectively, to revise the message in its current state,
1030 allows editing of the most important message headers, with the potent
1032 custom headers can be created, for example (more specifically than with
1038 gives an overview of most other available command escapes.
1043 (see there) will call hooks, insert automatic injections and receivers,
1044 leave compose mode and send the message once it is completed.
1045 Aborting letter composition is possible with either of
1049 the latter of which will save the message in the file denoted by
1056 is set the effect of
1058 can also be achieved by typing end-of-transmission (EOT) via
1061 at the beginning of an empty line, and
1063 is always reachable by typing end-of-text (ETX) twice via
1071 .Sx "INTERNAL VARIABLES"
1072 can be used to alter default behavior.
1077 will automatically startup an editor when compose mode is entered, and
1078 editing of headers additionally to plain body content can be enabled via
1080 \*(ID some, but not all headers can be created, edited or deleted in an
1085 will cause the user to be prompted actively for (blind) carbon-copy
1086 recipients, respectively, and (the default)
1088 will request confirmation whether the message shall be sent.
1091 The envelope sender address is defined by
1093 explicitly defining an originating
1095 may be desirable, especially with the built-in SMTP Mail-Transfer-Agent
1097 .Sx "Character sets"
1098 for outgoing message and MIME part content are configurable via
1100 whereas input data is assumed to be in
1102 Message data will be passed over the wire in a
1104 MIME parts aka attachments need to be assigned a
1106 usually taken out of
1107 .Sx "The mime.types files" .
1108 Saving a copy of sent messages in a
1110 mailbox may be desirable \(en as for most mailbox
1112 targets the value will undergo
1113 .Sx "Filename transformations" .
1118 sandbox dry-run tests will prove correctness.
1121 Message recipients are subject to
1123 filtering, and may not only be email addresses, but can also be names
1124 of mailboxes and even complete shell command pipe specifications.
1127 is not set then only email addresses like
1129 and plain user names (including MTA aliases) may be used, other types
1130 will be filtered out, giving a warning message.
1132 indeed allows further control over and adjustments of message recipients,
1133 for example user names can be expanded to network addresses by specifying
1135 A network address that contains no domain-, but only a valid local user
1137 in angle brackets will be automatically expanded to a valid address when
1139 is not set, or set to a non-empty value; setting it to the empty value
1140 instructs \*(UA that the used
1142 will perform the necessary expansion.
1145 may help to generate standard compliant network addresses.
1147 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
1148 .\" grep the latter for the complete picture
1152 is set then an extended set of recipient addresses will be accepted:
1153 Any name that starts with a vertical bar
1155 character specifies a command pipe \(en the command string following the
1157 is executed and the message is sent to its standard input;
1158 Likewise, any name that consists only of hyphen-minus
1160 or starts with the character solidus
1162 or the character sequence dot solidus
1164 is treated as a file, regardless of the remaining content.
1165 Any other name which contains a commercial at
1167 character is a network address;
1168 Any other name which starts with a plus sign
1170 character is a mailbox name;
1171 Any other name which contains a solidus
1173 character but no exclamation mark
1177 character before is also a mailbox name;
1178 What remains is treated as a network address.
1180 .Bd -literal -offset indent
1181 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1182 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1183 $ echo safe | LC_ALL=C \e
1184 \*(uA -:/ -Sv15-compat -Sttycharset=utf8 \e
1185 --set mime-force-sendout \e
1186 -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1187 --end-options bob@exam.ple
1191 To create file-carbon-copies the special recipient header
1193 may be used as often as desired.
1194 Its entire value (or body in standard terms) is interpreted as a
1196 target, after having been subject to
1197 .Sx "Filename transformations" .
1198 Beside using the command escape
1202 header) this is the only way to create a file-carbon-copy without
1203 introducing an ambiguity regarding the interpretation of the address,
1204 file names with leading vertical bars or commercial ats can be used.
1205 Like all other recipients
1207 is subject to the checks of
1209 Any local file and pipe command addressee honours the setting of
1210 .Va mbox-fcc-and-pcc .
1213 It is possible to create personal distribution lists via the
1215 command, so that, for instance, the user can send mail to
1217 and have it go to a group of people.
1218 Different to the alias mechanism of most local
1220 s, often documented in
1226 personal aliases will be expanded by \*(UA before the message is sent.
1227 They are thus a convenient alternative to specifying each addressee by
1228 itself, correlate with the active set of
1233 \*(OPally MTA aliases can be expanded before sending messages by setting
1236 .Bd -literal -offset indent
1237 ? alias cohorts bill jkf mark kridle@ucbcory ~/cohorts.mbox
1238 ? alias mark mark@exam.ple
1239 ? set mta-aliases=/etc/aliases
1243 For the purpose of arranging a complete environment of settings that can
1244 be switched to with a single command or command line option there are
1246 Alternatively it is also possible to use a flat configuration, making use
1247 of so-called variable chains which automatically pick
1251 context-dependent variable variants: for example addressing
1252 .Ql Ic Folder Ns \& pop3://yaa@exam.ple
1254 .Va \&\&pop3-no-apop-yaa@exam.ple ,
1255 .Va \&\&pop3-no-apop-exam.ple
1260 .Sx "On URL syntax and credential lookup"
1262 .Sx "INTERNAL VARIABLES" .
1265 The compose mode hooks
1266 .Va on-compose-enter , on-compose-splice , on-compose-leave
1268 .Va on-compose-cleanup
1271 d macros and provide reliable and increasingly powerful mechanisms to
1272 perform automated message adjustments dependent on message context,
1273 for example addition of message signatures
1274 .Pf ( Va message-inject-head , message-inject-tail )
1275 or creation of additional receiver lists (also by setting
1276 .Va autocc , autobcc ) .
1277 To achieve that the command
1279 may be used in order to query and adjust status of message(s).
1280 The splice hook can also make use of
1281 .Sx "COMMAND ESCAPES" .
1282 (\*(ID The compose mode hooks work for
1283 .Ic forward , mail , reply
1288 only provide the hooks
1291 .Va on-resend-cleanup ,
1292 which are pretty restricted due to the nature of the operation.)
1295 To avoid environmental noise scripts should
1297 \*(UA from any configuration files and create a script-local
1298 environment, ideally with the command line options
1300 to disable any configuration file in conjunction with repetitions of
1302 to specify variables:
1304 .Bd -literal -offset indent
1305 $ env LC_ALL=C \*(uA -:/ \e
1307 -Sttycharset=utf-8 -Smime-force-sendout \e
1308 -Sexpandaddr=fail,-all,failinvaddr \e
1309 -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1310 -S from=scriptreply@exam.ple \e
1311 -s 'Subject to go' -a attachment_file \e
1313 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1318 As shown, scripts can
1320 a locale environment, the above specifies the all-compatible 7-bit clean
1323 but will nonetheless take and send UTF-8 in the message text by using
1325 If character set conversion is compiled in
1329 invalid (according to
1331 character input data would normally cause errors; setting
1332 .Va mime-force-sendout
1333 will instead, as a last resort, classify the input as binary data, and
1334 therefore allow message creation to be successful.
1335 (Such content can then be inspected either by installing a
1336 .Va pipe-TYPE/SUBTYPE
1338 .Ql application/octet-stream ,
1339 or possibly automatically through
1340 .Va mime-counter-evidence ) .
1343 In interactive mode, which is introduced in the next section, messages
1344 can be sent by calling the
1346 command with a list of recipient addresses:
1348 .Bd -literal -offset indent
1349 $ \*(uA -d -Squiet -Semptystart
1350 "/var/spool/mail/user": 0 messages
1351 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1353 ? # Will do the right thing (tm)
1354 ? m rec1@exam.ple rec2@exam.ple
1358 .\" .Ss "On reading mail, and interactive mode" {{{
1359 .Ss "On reading mail, and interactive mode"
1361 When invoked without addressees \*(UA enters interactive mode in which
1363 When used like that the user's system
1365 (for more on mailbox types please see the command
1367 is read in and a one line header of each message therein is displayed if
1371 The visual style of this summary of
1373 can be adjusted through the variable
1375 and the possible sorting criterion via
1381 can be performed with the command
1383 If the initially opened mailbox is empty \*(UA will instead exit
1384 immediately (after displaying a message) unless the variable
1393 will give a listing of all available commands and
1395 will \*(OPally give a summary of some common ones.
1396 If the \*(OPal documentation strings are available (see
1400 .Pf "(or " Ql \&?X )
1401 and see the actual expansion of
1403 and what its purpose is, i.e., commands can be abbreviated
1404 (note that POSIX defines some abbreviations, so that the alphabetical
1405 order of commands does not necessarily relate to the abbreviations; it is
1406 however possible to define overwrites with
1407 .Ic commandalias ) .
1408 These commands can also produce a more
1413 Messages are given numbers (starting at 1) which uniquely identify
1414 messages; the current message \(en the
1416 \(en will either be the first new message, or the first unread message,
1417 or the first message of the mailbox; the internal variable
1419 will instead cause usage of the last message for this purpose.
1424 ful of header summaries containing the
1428 will display only the summaries of the given messages, defaulting to the
1432 Message content can be displayed with the command
1439 controls whether and when \*(UA will use the configured
1441 for display instead of directly writing to the user terminal
1443 the sole difference to the command
1445 which will always use the
1449 will instead only show the first
1451 of a message (maybe even compressed if
1454 Message display experience may improve by setting and adjusting
1455 .Va mime-counter-evidence ,
1457 .Sx "HTML mail and MIME attachments" .
1460 By default the current message
1462 is displayed, but like with many other commands it is possible to give
1463 a fancy message specification (see
1464 .Sx "Specifying messages" ) ,
1467 will display all unread messages,
1472 will type the messages 1 and 5,
1474 will type the messages 1 through 5, and
1478 will display the previous and the next message, respectively.
1481 (a more substantial alias for
1483 will display a header summary of the given message specification list
1484 instead of their content; the following will search for subjects:
1487 .Dl ? from "'@Some subject to search for'"
1490 In the default setup all header fields of a message will be
1492 d, but fields can be white- or blacklisted for a variety of
1493 applications by using the command
1495 e.g., to restrict their display to a very restricted set for
1497 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1498 In order to display all header fields of a message regardless of
1499 currently active ignore or retain lists, use the commands
1504 will show the raw message content.
1505 Note that historically the global
1507 not only adjusts the list of displayed headers, but also sets
1509 (\*(ID A yet somewhat restricted) Reliable scriptable message
1510 inspection is available via
1514 Dependent upon the configuration a line editor (see the section
1515 .Sx "On terminal control and line editor" )
1516 aims at making the user experience with the many
1519 When reading the system
1525 specified a mailbox explicitly prefixed with the special
1527 modifier (to propagate it to a
1529 .Sx "primary system mailbox" ) ,
1530 then messages which have been read
1531 .Pf (see\0 Sx "Message states" )
1532 will be automatically moved to a
1534 .Sx "secondary mailbox" ,
1537 file, when the mailbox is left, either by changing the active mailbox or
1538 by quitting \*(UA \(en this automatic moving from a system- or primary-
1539 to the secondary mailbox is not performed when the variable
1542 Messages can also be explicitly
1544 d to other mailboxes, whereas
1546 keeps the original message.
1548 can be used to write out data content of specific parts of messages.
1551 After examining a message the user can
1553 to the sender and all recipients (which will also be placed in
1556 .Va recipients-in-cc
1559 exclusively to the sender(s).
1560 To comply with with the receivers desired reply address the
1564 .Va followup-to-honour
1567 should usually be set.
1572 know how to apply a special addressee massage, see
1573 .Sx "Mailing lists" .
1574 Dependent on the presence and value of
1576 the message being replied to will be included in a quoted form.
1578 ing a message will allow editing the new message: the original message
1579 will be contained in the message body, adjusted according to
1585 messages: the former will add a series of
1587 headers, whereas the latter will not; different to newly created
1588 messages editing is not possible and no copy will be saved even with
1590 unless the additional variable
1593 When sending, replying or forwarding messages comments and full names
1594 will be stripped from recipient addresses unless the internal variable
1599 Of course messages can be
1601 and they can spring into existence again via
1603 or when the \*(UA session is ended via the
1607 commands to perform a quick program termation.
1608 To end a mail processing session regulary and perform a full program
1609 exit one may issue the command
1611 It will, among others, move read messages to the
1613 .Sx "secondary mailbox"
1615 as necessary, discard deleted messages in the current mailbox,
1616 and update the \*(OPal (see
1620 By the way, whenever the main event loop is about to look out for the
1621 next input line it will trigger the hook
1622 .Va on-main-loop-tick .
1625 .\" .Ss "HTML mail and MIME attachments" {{{ review
1626 .Ss "HTML mail and MIME attachments"
1628 HTML-only messages become more and more common, and many messages come
1629 bundled with a bouquet of MIME (Multipurpose Internet Mail Extensions)
1630 parts and attachments.
1631 To get a notion of MIME types \*(UA has a default set of types built-in,
1632 onto which the content of
1633 .Sx "The mime.types files"
1634 will be added (as configured and allowed by
1635 .Va mimetypes-load-control ) .
1636 Types can also become registered with the command
1638 To improve interaction with the faulty MIME part declarations of real life
1639 .Va mime-counter-evidence
1640 will allow verification of the given assertion, and the possible
1641 provision of an alternative, better MIME type.
1644 Whereas a simple HTML-to-text filter for displaying HTML messages is
1645 \*(OPally supported (indicated by
1646 .Ql +filter-html-tagsoup
1649 MIME types other than plain text cannot be handled directly.
1650 Instead programs need to become registered to deal with specific MIME
1651 types or file extensions, either to prepare (re-)integrable plain text
1652 versions of their input (a mode which is called
1653 .Cd copiousoutput ) ,
1654 or to display the content externally, for example in a graphical window:
1655 the latter type is only considered by and for the command
1659 To install a handler program for a MIME type an according
1660 .Va pipe-TYPE/SUBTYPE
1661 variable needs to be set; to define a handler for a file extension
1663 can be used \(en these handlers take precedence.
1664 \*(OPally mail user agent configuration is supported (see
1665 .Sx "The Mailcap files" ) ,
1666 and will be queried for display or quote handlers after the former ones.
1667 Type-markers registered via
1669 are the last possible source for information how to handle a MIME type.
1672 For example, to display HTML messages integrated via the text browsers
1676 register a MathML MIME type and enable its plain text display, and to
1677 open PDF attachments in an external PDF viewer, asynchronously and with
1678 some other magic attached:
1680 .Bd -literal -offset indent
1681 ? if "$features" !% +filter-html-tagsoup
1682 ? #set pipe-text/html='?* elinks -force-html -dump 1'
1683 ? set pipe-text/html='?* lynx -stdin -dump -force_html'
1684 ? # Display HTML as plain text instead
1685 ? #set pipe-text/html=?t
1687 ? mimetype ?t application/mathml+xml mathml
1688 ? wysh set pipe-application/pdf='?&=? \e
1689 trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1690 trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1691 mupdf "${MAILX_FILENAME_TEMPORARY}"'
1695 .\" .Ss "Mailing lists" {{{
1698 Known or subscribed-to mailing lists may be flagged in the summary of
1703 and will gain special treatment when sending mails: the variable
1704 .Va followup-to-honour
1706 .Ql Mail-\:Followup-\:To:
1707 header is honoured when a message is being replied to
1714 controls creation of this header when creating
1716 s, if the necessary user setup
1717 .Pf ( from , sender ) ;
1718 is available; then, it may also be created automatically, for example
1719 when list-replying via
1727 is used and the messages
1728 .Ql Mail-Followup-To:
1736 manage \*(UAs notion of which addresses are mailing lists.
1737 With the \*(OPal regular expression support any address
1738 .Mx -ix "magic regular expression characters"
1739 which contains any of the magic regular expression characters
1745 dependent on the host system)
1746 will be compiled and used as one, possibly matching many addresses.
1747 It is not possible to escape the
1749 in order to match special characters as-is, bracket expressions must be
1751 .Ql Ic search Li @subject@'[[]open bracket' .
1753 .Bd -literal -offset indent
1754 ? set followup-to followup-to-honour=ask-yes \e
1755 reply-to-honour=ask-yes
1756 ? mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1757 ? mlsubscribe a4@b4.c4 exact@lists.c3
1761 Known and subscribed lists differ in that for the latter the
1763 s address is not part of a generated
1764 .Ql Mail-Followup-To: .
1765 There are exceptions, for example if multiple lists are addressed and
1766 not all have the subscription attribute.
1767 When replying to a message its list address
1769 header) is automatically and temporarily treated like a known
1771 dependent on the variable
1775 is used instead (if it is a single address on the same domain as
1777 in order to accept a list administrator's wish that is supposed to have
1778 been manifested like that.
1781 For convenience and compatibility with mail programs that do not honour
1782 the non-standard M-F-T, an automatic user entry in the carbon-copy
1784 address list of generated message can be created by setting
1785 .Va followup-to-add-cc .
1786 This entry will be added whenever the user will be placed in the
1787 .Ql Mail-Followup-To:
1788 list, and is not a regular addressee already.
1789 .Va reply-to-swap-in
1790 tries to deal with the address rewriting that many mailing-lists nowadays
1791 perform to work around DKIM / DMARC etc. standard imposed problems.
1794 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1795 .Ss "Signed and encrypted messages with S/MIME"
1797 \*(OP S/MIME provides two central mechanisms:
1798 message signing and message encryption.
1799 A signed message contains some data in addition to the regular text.
1800 The data can be used to verify that the message has been sent using
1801 a valid certificate, that the sender address matches that in the
1802 certificate, and that the message text has not been altered.
1803 Signing a message does not change its regular text;
1804 it can be read regardless of whether the recipients software is able to
1806 It is thus usually possible to sign all outgoing messages if so desired.
1809 Encryption, in contrast, makes the message text invisible for all people
1810 except those who have access to the secret decryption key.
1811 To encrypt a message, the specific recipients public encryption key
1813 It is therefore not possible to send encrypted mail to people unless their
1814 key has been retrieved from either previous communication or public key
1816 Because signing is performed with private keys, and encryption with
1817 public keys, messages should always be signed before being encrypted.
1820 A central concept to S/MIME is that of the certification authority (CA).
1821 A CA is a trusted institution that issues certificates.
1822 For each of these certificates it can be verified that it really
1823 originates from the CA, provided that the CA's own certificate is
1825 A set of CA certificates is usually delivered and installed together
1826 with the cryptographical library that is used on the local system.
1827 Therefore reasonable security for S/MIME on the Internet is provided if
1828 the source that provides that library installation is trusted.
1829 It is also possible to use a specific pool of trusted certificates.
1831 .Va smime-ca-no-defaults
1832 should be set to avoid using the default certificate pool, and
1836 should be pointed to a trusted pool of certificates.
1837 A certificate cannot be more secure than the method its CA certificate
1838 has been retrieved with.
1841 This trusted pool of certificates is used by the command
1843 to ensure that the given S/MIME messages can be trusted.
1844 If so, verified sender certificates that were embedded in signed
1845 messages can be saved locally with the command
1847 and used by \*(UA to encrypt further communication with these senders:
1849 .Bd -literal -offset indent
1851 ? set smime-encrypt-USER@HOST=FILENAME \e
1852 smime-cipher-USER@HOST=AES256
1856 To sign outgoing messages, in order to allow receivers to verify the
1857 origin of these messages, a personal S/MIME certificate is required.
1858 \*(UA supports password-protected personal certificates (and keys), see
1859 .Va smime-sign-cert .
1861 .Sx "On URL syntax and credential lookup"
1862 gives an overview of the possible sources of user credentials, and
1863 .Sx "S/MIME step by step"
1864 shows examplarily how a private S/MIME certificate can be obtained.
1865 In general, if such a private key plus certificate
1867 is available, all that needs to be done is to set some variables:
1869 .Bd -literal -offset indent
1870 ? set smime-sign-cert=ME@exam.ple.paired \e
1871 smime-sign-digest=SHA512 \e
1872 smime-sign from=myname@my.host
1876 Variables of interest for S/MIME in general are
1879 .Va smime-ca-flags ,
1880 .Va smime-ca-no-defaults ,
1882 .Va smime-crl-file .
1883 For S/MIME signing of interest are
1885 .Va smime-sign-cert ,
1886 .Va smime-sign-include-certs
1888 .Va smime-sign-digest .
1889 Additional variables of interest for S/MIME en- and decryption:
1892 .Va smime-encrypt-USER@HOST .
1893 Variables of secondary interest may be
1894 .Va content-description-smime-message
1896 .Va content-description-smime-signature .
1897 S/MIME is available if
1903 \*(ID Note that neither S/MIME signing nor encryption applies to
1904 message subjects or other header fields yet.
1905 Thus they may not contain sensitive information for encrypted messages,
1906 and cannot be trusted even if the message content has been verified.
1907 When sending signed messages,
1908 it is recommended to repeat any important header information in the
1912 .\" .Ss "On URL syntax and credential lookup" {{{ review
1913 .Ss "On URL syntax and credential lookup"
1915 For accessing protocol-specific resources Uniform Resource Locators
1916 (URL, RFC 3986) have become omnipresent.
1917 Here they are expected in a
1919 variant, not used in data exchange, but only meant as a compact,
1920 easy-to-use way of defining and representing information in a well-known
1921 notation; as such they do not conform to any real standard.
1922 Optional parts are placed in brackets
1924 optional either because there also exist other ways to define the
1925 information, or because the part is protocol specific.
1927 for example is used by the \*(OPal Maildir
1929 type and the IMAP protocol, but not by POP3.
1934 are included in an URL server specification, URL percent encoded
1935 (RFC 3986) forms are needed, generable with
1939 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1943 .Sx "INTERNAL VARIABLES"
1944 exist in multiple versions, called
1946 in this document: the plain
1951 .Ql variable-USER@HOST .
1952 If a port was specified
1960 is never in URL percent encoded form.
1961 For example, whether the hypothetical
1962 .Ql smtp://\:wings\:%3A\:of\:@a.dove
1963 including user and password was used, or whether it was
1965 and it came from a different source, to lookup the chain
1966 .Va tls-config-pairs
1968 .Ql tls-\:config-\:pairs-\:wings:of@a.dove
1970 .Ql tls-\:config-pairs\-\:a.dove ,
1971 before finally looking up the plain variable.
1974 The logic to collect (an
1976 s) credential information is as follows:
1980 A user is always required.
1983 has been given in the URL the variables
1988 Afterwards, when enforced by the \*(OPal variables
1989 .Va netrc-lookup-HOST
1992 .Sx "The .netrc file"
1993 of the user will be searched for a
1995 specific entry which provides a
1997 name: only unambiguous entries are used (one possible matching entry for
2000 If there is still no
2004 known to be a valid user on the current host, is used.
2007 Authentication: unless otherwise noted the chain
2008 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2009 is checked, falling back to a protocol-specific default as necessary.
2014 has been given in the URL, then if the
2016 has been found through the \*(OPal
2018 that may have also provided the password.
2020 .Va password-USER@HOST , password-HOST , password
2023 Thereafter the (now complete) \*(OPal chain
2024 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2025 is checked, if set the
2027 cache is searched for a password only (multiple user accounts for
2028 a single machine may exist as well as a fallback entry without user
2029 but with a password).
2031 If at that point there is still no password available, but the
2032 (protocols') chosen authentication type requires a password, then in
2033 interactive mode the user will be prompted on the terminal.
2038 S/MIME verification works relative to the values found in the
2042 header field(s), which means the values of
2043 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2045 .Va smime-sign-digest
2046 will not be looked up using the
2050 chains from above, but instead use the corresponding values from the
2051 message that is being worked on.
2052 If no address matches we assume and use the setting of
2054 In unusual cases multiple and different
2058 combinations may therefore be involved \(en on the other hand those
2059 unusual cases become possible.
2060 The usual case is as short as:
2062 .Bd -literal -offset indent
2063 set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2064 smime-sign smime-sign-cert=+smime.pair \e
2071 contains complete example configurations.
2074 .\" .Ss "Encrypted network communication" {{{ review
2075 .Ss "Encrypted network communication"
2077 \*(OP SSL (Secure Sockets Layer) aka its successor TLS (Transport Layer
2078 Security) are protocols which aid in securing communication by providing
2079 a safely initiated and encrypted network connection.
2080 A central concept of TLS are certificates: as part of each network
2081 connection setup a (set of) certificates will be exchanged through which
2082 the identity of the network peer can be cryptographically verified;
2083 if possible the TLS/SNI (ServerNameIndication) extension will be enabled
2084 to allow servers fine-grained control over the certificates being used.
2085 A locally installed pool of trusted certificates will then be inspected,
2086 and verification will succeed if it contains a(n in)direct signer of the
2087 presented certificate(s).
2090 The local pool of trusted so-called CA (Certification Authority)
2091 certificates is usually delivered with and used along the TLS library.
2092 A custom pool of trusted certificates can be selected by pointing
2094 and/or (with special preparation)
2096 to the desired location; setting
2097 .Va tls-ca-no-defaults
2098 in addition will avoid additional inspection of the default pool.
2099 A certificate cannot be more secure than the method its CA certificate
2100 has been retrieved with.
2101 For inspection or other purposes, the certificate of a server (as seen
2102 when connecting to it) can be fetched with the command
2104 (port can usually be the protocol name, too, and
2106 is taken into account here):
2108 .Bd -literal -offset indent
2109 $ \*(uA -vX 'tls certchain SERVER-URL[:PORT]; x'
2113 A local pool of CA certificates is not strictly necessary, however,
2114 server certificates can also be verified via their fingerprint.
2115 For this a message digest will be calculated and compared against the
2117 .Va tls-fingerprint ,
2118 and verification will succeed if the fingerprint matches.
2119 The message digest (algorithm) can be configured via the variable chain
2120 .Va tls-fingerprint-digest ;
2124 .Bd -literal -offset indent
2125 $ \*(uA -X 'wysh set verbose; tls fingerprint SERVER-URL[:PORT]; x'
2129 It depends on the used protocol whether encrypted communication is
2130 possible, and which configuration steps have to be taken to enable it.
2131 Some protocols, like POP3S, are implicitly encrypted, others, like
2132 POP3, can upgrade a plain text connection if so requested.
2133 For example, to use the
2135 that POP3 offers (a member of) the variable (chain)
2136 .Va pop3-use-starttls
2137 needs to be set, with convenience via
2140 .Bd -literal -offset indent
2141 shortcut encpop1 pop3s://pop1.exam.ple
2143 shortcut encpop2 pop3://pop2.exam.ple
2144 set pop3-use-starttls-pop2.exam.ple
2146 set mta=smtps://smtp.exam.ple:465
2147 set mta=smtp://smtp.exam.ple smtp-use-starttls
2151 Normally that is all there is to do, given that TLS libraries try to
2152 provide safe defaults, plenty of knobs however exist to adjust settings.
2153 For example certificate verification settings can be fine-tuned via
2155 and the TLS configuration basics are accessible via
2156 .Va tls-config-pairs ,
2157 for example to control protocol versions or cipher lists.
2158 In the past hints on how to restrict the set of protocols to highly
2159 secure ones were indicated, but as of the time of this writing the list
2160 of protocols or ciphers may need to become relaxed in order to be able
2161 to connect to some servers; the following example allows connecting to a
2163 that uses OpenSSL 0.9.8za from June 2014 (refer to
2164 .Sx "INTERNAL VARIABLES"
2165 for more on variable chains):
2167 .Bd -literal -offset indent
2168 wysh set tls-config-pairs-lion@exam.ple='MinProtocol=TLSv1.1,\e
2169 CipherString=TLSv1.2:!aNULL:!eNULL:\e
2170 ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
2171 DHE-RSA-AES256-SHA:@STRENGTH'
2177 should be referred to when creating a custom cipher list.
2178 Variables of interest for TLS in general are
2182 .Va tls-ca-no-defaults ,
2183 .Va tls-config-file ,
2184 .Va tls-config-module ,
2185 .Va tls-config-pairs ,
2199 .\" .Ss "Character sets" {{{
2200 .Ss "Character sets"
2202 \*(OP \*(UA detects the character set of the terminal by using
2203 mechanisms that are controlled by the
2205 environment variable
2210 in that order, see there).
2211 The internal variable
2213 will be set to the detected terminal character set accordingly,
2214 and will thus show up in the output of commands like
2220 However, the user may give
2222 a value during startup, making it possible to send mail in a completely
2224 locale environment, an option which can be used to generate and send for
2225 example 8-bit UTF-8 input data in a pure 7-bit US-ASCII
2227 environment (an example of this can be found in the section
2228 .Sx "On sending mail, and non-interactive mode" ) .
2229 Changing the value does not mean much beside that, because several
2230 aspects of the real character set are implied by the locale environment
2231 of the system, which stays unaffected by
2235 Messages and attachments which consist of 7-bit clean data will be
2236 classified as consisting of
2239 This is a problem if the
2241 character set is a multibyte character set that is also 7-bit clean.
2242 For example, the Japanese character set ISO-2022-JP is 7-bit clean but
2243 capable to encode the rich set of Japanese Kanji, Hiragana and Katakana
2244 characters: in order to notify receivers of this character set the mail
2245 message must be MIME encoded so that the character set ISO-2022-JP can
2247 To achieve this, the variable
2249 must be set to ISO-2022-JP.
2250 (Today a better approach regarding email is the usage of UTF-8, which
2251 uses 8-bit bytes for non-US-ASCII data.)
2254 If the \*(OPal character set conversion capabilities are not available
2256 does not include the term
2260 will be the only supported character set,
2261 it is simply assumed that it can be used to exchange 8-bit messages
2262 (over the wire an intermediate, configurable
2265 and the rest of this section does not apply;
2266 it may however still be necessary to explicitly set it if automatic
2267 detection fails, since in that case it defaults to
2268 .\" (Keep in SYNC: ./nail.1:"Character sets", mx-config.h:CHARSET_*!)
2269 LATIN1 aka ISO-8859-1 unless the operating system environment is
2270 known to always and exclusively support UTF-8 locales.
2273 \*(OP When reading messages, their text is converted into
2275 as necessary in order to display them on the user's terminal.
2276 Unprintable characters and invalid byte sequences are detected
2277 and replaced by proper substitution characters.
2278 Character set mappings for source character sets can be established with
2281 which may be handy to work around faulty character set catalogues (one
2282 could add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
2283 of one character set as another one (maybe interpret LATIN1 as CP1252).
2285 .Va charset-unknown-8bit
2286 to deal with another hairy aspect of message interpretation.
2289 When sending messages their parts and attachments are classified.
2290 Whereas no character set conversion is performed on those parts which
2291 appear to be binary data,
2292 the character set being used must be declared within the MIME header of
2293 an outgoing text part if it contains characters that do not conform to
2294 the set of characters that are allowed by the email standards.
2295 Permissible values for character sets used in outgoing messages can be
2300 which defines a catch-all last-resort fallback character set that is
2301 implicitly appended to the list of character sets in
2305 When replying to a message and the variable
2306 .Va reply-in-same-charset
2307 is set, then the character set of the message being replied to
2308 is tried first (still being a subject of
2309 .Ic charsetalias ) .
2310 And it is also possible to make \*(UA work even more closely related to
2311 the current locale setting automatically by using the variable
2312 .Va sendcharsets-else-ttycharset ,
2313 please see there for more information.
2316 All the specified character sets are tried in order unless the
2317 conversion of the part or attachment succeeds.
2318 If none of the tried (8-bit) character sets is capable to represent the
2319 content of the part or attachment,
2320 then the message will not be send and its text will optionally be
2324 If that is not acceptable, the variable
2325 .Va mime-force-sendout
2326 can be set in order to force sending of non-convertible text as
2327 .Ql application/octet-stream
2328 classified binary content instead; like this receivers still have the
2329 option to inspect message content (for example by setting
2330 .Va mime-counter-evidence ) .
2333 In general, if a message saying
2334 .Dq cannot convert from a to b
2335 appears, either some characters are not appropriate for the currently
2336 selected (terminal) character set,
2337 or the needed conversion is not supported by the system.
2338 In the first case, it is necessary to set an appropriate
2340 locale and/or the variable
2342 The best results are usually achieved when \*(UA is run in a UTF-8
2343 locale on an UTF-8 capable terminal, in which case the full Unicode
2344 spectrum of characters is available.
2345 In this setup characters from various countries can be displayed,
2346 while it is still possible to use more simple character sets for sending
2347 to retain maximum compatibility with older mail clients.
2350 On the other hand the POSIX standard defines a locale-independent 7-bit
2351 .Dq portable character set
2352 that should be used when overall portability is an issue, the even more
2353 restricted subset named
2354 .Dq portable filename character set
2355 consists of A-Z, a-z, 0-9, period
2363 .\" .Ss "Message states" {{{
2364 .Ss "Message states"
2366 \*(UA differentiates in between several message states; the current
2367 state will be reflected in the summary of
2374 .Sx "Specifying messages"
2375 dependent on their state is possible.
2376 When operating on the system
2380 .Sx "primary system mailbox" ,
2381 special actions, like the automatic moving of messages to the
2383 .Sx "secondary mailbox"
2385 may be applied when the mailbox is left (also implicitly by program
2386 termination, unless the command
2388 was used) \(en however, because this may be irritating to users which
2391 mail-user-agents, the provided global
2393 template sets the internal
2397 variables in order to suppress this behaviour.
2399 .Bl -hang -width ".It Ql new"
2401 Message has neither been viewed nor moved to any other state.
2402 Such messages are retained even in the
2404 .Sx "primary system mailbox" .
2407 Message has neither been viewed nor moved to any other state, but the
2408 message was present already when the mailbox has been opened last:
2409 Such messages are retained even in the
2411 .Sx "primary system mailbox" .
2414 The message has been processed by one of the following commands:
2433 will always try to automatically
2439 logical message, and may thus mark multiple messages as read, the
2441 command will do so if the internal variable
2447 command is used, messages that are in a
2449 .Sx "primary system mailbox"
2452 state when the mailbox is left will be saved in the
2454 .Sx "secondary mailbox"
2456 unless the internal variable
2461 The message has been processed by one of the following commands:
2467 can be used to access such messages.
2470 The message has been processed by a
2472 command and it will be retained in its current location.
2475 The message has been processed by one of the following commands:
2481 command is used, messages that are in a
2483 .Sx "primary system mailbox"
2486 state when the mailbox is left will be deleted; they will be saved in the
2488 .Sx "secondary mailbox"
2490 when the internal variable
2496 In addition to these message states, flags which otherwise have no
2497 technical meaning in the mail system except allowing special ways of
2498 addressing them when
2499 .Sx "Specifying messages"
2500 can be set on messages.
2501 These flags are saved with messages and are thus persistent, and are
2502 portable between a set of widely used MUAs.
2504 .Bl -hang -width ".It Ic answered"
2506 Mark messages as having been answered.
2508 Mark messages as being a draft.
2510 Mark messages which need special attention.
2514 .\" .Ss "Specifying messages" {{{
2515 .Ss "Specifying messages"
2520 .Sx "Message list arguments" ,
2527 can perform actions on a number of messages at once.
2528 Specifying invalid messages, or using illegal syntax, will cause errors
2529 to be reported through the
2530 .Sx "INTERNAL VARIABLES"
2533 and companions, as well as the command exit status
2539 deletes the messages 1 and 2,
2542 will delete the messages 1 through 5.
2543 In sorted or threaded mode (see the
2547 will delete the messages that are located between (and including)
2548 messages 1 through 5 in the sorted/threaded order, as shown in the
2553 Errors can for example be
2555 when requesting an invalid message,
2557 if no applicable message can be found,
2558 .Va ^ERR Ns -CANCELED
2559 for missing informational data (mostly thread-related).
2561 for invalid syntax as well as
2563 for input/output errors can happen.
2564 The following special message names exist:
2567 .Bl -tag -width ".It Ar BaNg"
2569 The current message, the so-called
2573 The message that was previously the current message; needs to be quoted.
2576 The parent message of the current message,
2577 that is the message with the Message-ID given in the
2579 field or the last entry of the
2581 field of the current message.
2584 The previous undeleted message, or the previous deleted message for the
2590 ed mode, the previous such message in the according order.
2593 The next undeleted message, or the next deleted message for the
2599 ed mode, the next such message in the according order.
2602 The first undeleted message,
2603 or the first deleted message for the
2609 ed mode, the first such message in the according order.
2612 The last message; In
2616 ed mode, the last such message in the according order.
2624 mode, selects the message addressed with
2628 is any other message specification,
2629 and all messages from the thread that begins at it.
2630 Otherwise it is identical to
2635 the thread beginning with the current message is selected.
2641 All messages that were included in the
2642 .Sx "Message list arguments"
2643 of the previous command; needs to be quoted.
2644 (A convenient way to read all new messages is to select them via
2646 as below, and then to read them in order with the default command \(em
2648 \(em simply by successively typing
2655 An inclusive range of message numbers.
2656 Selectors that may also be used as endpoints include any of
2661 .Dq any substring matches
2664 header, which will match addresses (too) even if
2666 is set (and POSIX says
2667 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2670 variable is set, only the local part of the address is evaluated
2671 for the comparison, not ignoring case, and the setting of
2673 is completely ignored.
2674 For finer control and match boundaries use the
2678 .It Ar / Ns Ar string
2679 All messages that contain
2681 in the subject field (case ignored according to locale).
2688 the string from the previous specification of that type is used again.
2691 .It Xo Op Ar @ Ns Ar name-list Ns
2694 All messages that contain the given case-insensitive search
2696 ession; If the \*(OPal regular expression support is available
2698 will be interpreted as (an extended) one if any of the
2700 .Sx "magic regular expression characters"
2703 .Ar @ Ns Ar name-list
2704 part is missing the search is restricted to the subject field body,
2707 specifies a comma-separated list of header fields to search, for example
2710 .Dl '@to,from,cc@Someone i ought to know'
2713 In order to search for a string that includes a
2715 (commercial at) character the
2717 is effectively non-optional, but may be given as the empty string.
2718 Also, specifying an empty search
2720 ession will effectively test for existence of the given header fields.
2721 Some special header fields may be abbreviated:
2735 respectively and case-insensitively.
2736 \*(OPally, and just like
2739 will be interpreted as (an extended) regular expression if any of the
2741 .Sx "magic regular expression characters"
2749 can be used to search in (all of) the header(s) of the message, and the
2758 will perform full text searches \(en whereas the former searches only
2759 the body, the latter also searches the message header (\*(ID this mode
2760 yet brute force searches over the entire decoded content of messages,
2761 including administrativa strings).
2764 This specification performs full text comparison, but even with
2765 regular expression support it is almost impossible to write a search
2766 expression that safely matches only a specific address domain.
2767 To request that the body content of the header is treated as a list of
2768 addresses, and to strip those down to the plain email address which the
2769 search expression is to be matched against, prefix the effective
2775 .Dl '@~f,c@@a\e.safe\e.domain\e.match$'
2779 All messages of state or with matching condition
2783 is one or multiple of the following colon modifiers:
2785 .Bl -tag -compact -width ".It Ar :M"
2788 messages (cf. the variable
2789 .Va markanswered ) .
2801 Messages with receivers that match
2805 Messages with receivers that match
2812 Old messages (any not in state
2820 \*(OP Messages with unsure spam classification (see
2821 .Sx "Handling spam" ) .
2823 \*(OP Messages classified as spam.
2835 \*(OP IMAP-style SEARCH expressions may also be used.
2836 These consist of keywords and criterions, and because
2837 .Sx "Message list arguments"
2838 are split into tokens according to
2839 .Sx "Shell-style argument quoting"
2840 it is necessary to quote the entire IMAP search expression in order to
2841 ensure that it remains a single token.
2842 This addressing mode is available with all types of mailbox
2844 s; \*(UA will perform the search locally as necessary.
2845 Strings must be enclosed by double quotation marks
2847 in their entirety if they contain whitespace or parentheses;
2848 within the quotes, only reverse solidus
2850 is recognized as an escape character.
2851 All string searches are case-insensitive.
2852 When the description indicates that the
2854 representation of an address field is used,
2855 this means that the search string is checked against both a list
2858 .Bd -literal -offset indent
2859 \&'(\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)'
2864 and the addresses without real names from the respective header field.
2865 These search expressions can be nested using parentheses, see below for
2869 .Bl -tag -compact -width ".It Ar _n_u"
2870 .It Ar ( criterion )
2871 All messages that satisfy the given
2873 .It Ar ( criterion1 criterion2 ... criterionN )
2874 All messages that satisfy all of the given criteria.
2876 .It Ar ( or criterion1 criterion2 )
2877 All messages that satisfy either
2882 To connect more than two criteria using
2884 specifications have to be nested using additional parentheses,
2886 .Ql (or a (or b c)) ,
2890 .Ql ((a or b) and c) .
2893 operation of independent criteria on the lowest nesting level,
2894 it is possible to achieve similar effects by using three separate
2898 .It Ar ( not criterion )
2899 All messages that do not satisfy
2901 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2902 All messages that contain
2904 in the envelope representation of the
2907 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2908 All messages that contain
2910 in the envelope representation of the
2913 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2914 All messages that contain
2916 in the envelope representation of the
2919 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2920 All messages that contain
2925 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2926 All messages that contain
2928 in the envelope representation of the
2931 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2932 All messages that contain
2937 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2938 All messages that contain
2941 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2942 All messages that contain
2944 in their header or body.
2945 .It Ar ( larger size )
2946 All messages that are larger than
2949 .It Ar ( smaller size )
2950 All messages that are smaller than
2954 .It Ar ( before date )
2955 All messages that were received before
2957 which must be in the form
2961 denotes the day of the month as one or two digits,
2963 is the name of the month \(en one of
2964 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2967 is the year as four digits, for example
2971 All messages that were received on the specified date.
2972 .It Ar ( since date )
2973 All messages that were received since the specified date.
2974 .It Ar ( sentbefore date )
2975 All messages that were sent on the specified date.
2976 .It Ar ( senton date )
2977 All messages that were sent on the specified date.
2978 .It Ar ( sentsince date )
2979 All messages that were sent since the specified date.
2981 The same criterion as for the previous search.
2982 This specification cannot be used as part of another criterion.
2983 If the previous command line contained more than one independent
2984 criterion then the last of those criteria is used.
2988 .\" .Ss "On terminal control and line editor" {{{ review
2989 .Ss "On terminal control and line editor"
2991 \*(OP Terminal control through one of the standard
3000 inal defined in the environment interactive usage aspects, for example
3001 .Sx "Coloured display" ,
3002 and insight of cursor and function keys for the Mailx-Line-Editor
3003 (MLE), will be enhanced or enabled.
3004 Library interaction can be disabled on a per-invocation basis via
3005 .Va termcap-disable ,
3006 whereas the internal variable
3008 is always used as a preferred source of terminal capabilities.
3009 (For a usage example see the
3012 .Sx "Not \(dqdefunctional\(dq, but the editor key does not work" . )
3015 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
3016 environments which comply to the ISO C standard
3018 and will support wide glyphs if possible (the necessary functionality
3019 had been removed from ISO C, but was included in
3021 Usage of a line editor in interactive mode can be prevented by setting
3022 .Va line-editor-disable .
3023 Especially if the \*(OPal terminal control support is missing setting
3026 will help shall the MLE misbehave, see there for more.
3027 The MLE can support a little bit of
3033 feature is available then input from line editor prompts will be saved
3034 in a history list that can be searched in and be expanded from.
3035 Such saving can be prevented by prefixing input with any amount of
3037 Aspects of history, like allowed content and maximum size, as well as
3038 whether history shall be saved persistently, can be configured with the
3042 .Va history-gabby-persist
3045 There also exists the macro hook
3046 .Va on-history-addition
3047 which can be used to apply finer control on what enters history.
3050 The MLE supports a set of editing and control commands.
3051 By default (as) many (as possible) of these will be assigned to a set of
3052 single-letter control codes, which should work on any terminal (and can
3053 be generated by holding the
3055 key while pressing the key of desire, for example
3059 command is available then the MLE commands can also be accessed freely
3060 by assigning the command name, which is shown in parenthesis in the list
3061 below, to any desired key-sequence, and the MLE will instead and also use
3063 to establish its built-in key bindings
3064 (more of them if the \*(OPal terminal control is available),
3065 an action which can then be suppressed completely by setting
3066 .Va line-editor-no-defaults .
3067 .Sx "Shell-style argument quoting"
3068 notation is used in the following:
3072 .Bl -tag -compact -width ".It Ql \eBa"
3074 Go to the start of the line
3076 .Pf ( Cd mle-go-home ) .
3079 Move the cursor backward one character
3081 .Pf ( Cd mle-go-bwd ) .
3087 .Pf ( Cd mle-raise-int ) .
3090 Forward delete the character under the cursor;
3091 quits \*(UA if used on the empty line unless the internal variable
3095 .Pf ( Cd mle-del-fwd ) .
3098 Go to the end of the line
3100 .Pf ( Cd mle-go-end ) .
3103 Move the cursor forward one character
3105 .Pf ( Cd mle-go-fwd ) .
3108 Cancel current operation, full reset.
3109 If there is an active history search or tabulator expansion then this
3110 command will first reset that, reverting to the former line content;
3111 thus a second reset is needed for a full reset in this case
3113 .Pf ( Cd mle-reset ) .
3116 Backspace: backward delete one character
3118 .Pf ( Cd mle-del-bwd ) .
3122 Horizontal tabulator:
3123 try to expand the word before the cursor, supporting the usual
3124 .Sx "Filename transformations"
3126 .Pf ( Cd mle-complete ;
3128 .Cd mle-quote-rndtrip
3130 .Va line-editor-cpl-word-breaks ) .
3134 commit the current line
3136 .Pf ( Cd mle-commit ) .
3139 Cut all characters from the cursor to the end of the line
3141 .Pf ( Cd mle-snarf-end ) .
3146 .Pf ( Cd mle-repaint ) .
3149 \*(OP Go to the next history entry
3151 .Pf ( Cd mle-hist-fwd ) .
3154 (\*(OPally context-dependent) Invokes the command
3158 \*(OP Go to the previous history entry
3160 .Pf ( Cd mle-hist-bwd ) .
3163 Toggle roundtrip mode shell quotes, where produced,
3166 .Pf ( Cd mle-quote-rndtrip ) .
3167 This setting is temporary, and will be forgotten once the command line
3168 is committed; also see
3172 \*(OP Complete the current line from (the remaining) older history entries
3174 .Pf ( Cd mle-hist-srch-bwd ) .
3177 \*(OP Complete the current line from (the remaining) newer history entries
3179 .Pf ( Cd mle-hist-srch-fwd ) .
3182 Paste the snarf buffer
3184 .Pf ( Cd mle-paste ) .
3192 .Pf ( Cd mle-snarf-line ) .
3195 Prompts for a Unicode character (hexadecimal number without prefix, see
3199 .Pf ( Cd mle-prompt-char ) .
3200 Note this command needs to be assigned to a single-letter control code
3201 in order to become recognized and executed during input of
3202 a key-sequence (only three single-letter control codes can be used for
3203 that shortcut purpose); this control code is then special-treated and
3204 thus cannot be part of any other sequence (because it will trigger the
3205 .Cd \&\&mle-prompt-char
3206 function immediately).
3209 Cut the characters from the one preceding the cursor to the preceding
3212 .Pf ( Cd mle-snarf-word-bwd ) .
3215 Move the cursor forward one word boundary
3217 .Pf ( Cd mle-go-word-fwd ) .
3220 Move the cursor backward one word boundary
3222 .Pf ( Cd mle-go-word-bwd ) .
3228 .Pf ( Cd mle-raise-tstp ) .
3231 Escape: reset a possibly used multibyte character input state machine
3232 and \*(OPally a lingering, incomplete key binding
3234 .Pf ( Cd mle-cancel ) .
3235 This command needs to be assigned to a single-letter control code in
3236 order to become recognized and executed during input of a key-sequence
3237 (only three single-letter control codes can be used for that shortcut
3239 This control code may also be part of a multi-byte sequence, but if
3240 a sequence is active and the very control code is currently also an
3241 expected input, then the active sequence takes precedence and will
3242 consume the control code.
3245 (\*(OPally context-dependent) Invokes the command
3249 (\*(OPally context-dependent) Invokes the command
3253 (\*(OPally context-dependent) Invokes the command
3257 Cut the characters from the one after the cursor to the succeeding word
3260 .Pf ( Cd mle-snarf-word-fwd ) .
3269 ring the audible bell.
3274 .Cd mle-clear-screen :
3275 move the cursor home and clear the screen.
3282 this will immediately reset a possibly active search etc.
3286 .Cd mle-go-screen-bwd :
3287 move the cursor backward one screen width.
3291 .Cd mle-go-screen-fwd :
3292 move the cursor forward one screen width.
3302 .\" .Ss "Coloured display" {{{ review
3303 .Ss "Coloured display"
3305 \*(OP Colours and font attributes through ANSI a.k.a. ISO 6429 SGR
3306 (select graphic rendition) escape sequences are optionally supported.
3307 Usage of colours and font attributes solely depends upon the
3308 capability of the detected terminal type
3310 and as fine-tuned through
3312 Colours and font attributes can be managed with the multiplexer command
3316 removes the given mappings.
3319 suppresses usage of colour and font attribute sequences, while leaving
3320 established mappings unchanged.
3323 Whether actually applicable colour and font attribute sequences should
3324 also be generated when output is going to be paged through the external
3328 ) depends upon the setting of
3330 because pagers usually need to be configured in order to support ISO
3332 Knowledge of some widely used pagers is however built-in, and in a clean
3333 environment it is often enough to simply set
3335 please refer to that variable for more on this topic.
3338 It might make sense to conditionalize colour setup on interactive mode via
3344 .Bd -literal -offset indent
3345 if terminal && "$features" =% +colour
3346 colour iso view-msginfo ft=bold,fg=green
3347 colour iso view-header ft=bold,fg=red (from|subject) # regex
3348 colour iso view-header fg=red
3350 uncolour iso view-header from,subject
3351 colour iso view-header ft=bold,fg=magenta,bg=cyan
3352 colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
3353 colour mono view-header ft=bold
3354 colour mono view-header ft=bold,ft=reverse subject,from
3359 .\" .Ss "Handling spam" {{{
3362 \*(OP \*(UA can make use of several spam interfaces for the purpose of
3363 identification of, and, in general, dealing with spam messages.
3364 A precondition of most commands in order to function is that the
3366 variable is set to one of the supported interfaces.
3367 .Sx "Specifying messages"
3368 that have been identified as spam is possible via their (volatile)
3374 specifications, and their
3376 entries will be used when displaying the
3384 rates the given messages and sets their
3387 If the spam interface offers spam scores these can be shown in
3396 will interact with the Bayesian filter of the chosen interface and learn
3397 the given messages as
3401 respectively; the last command can be used to cause
3403 of messages; it adheres to their current
3405 state and thus reverts previous teachings.
3410 will simply set and clear, respectively, the mentioned volatile
3412 message flag, without any interface interaction.
3421 requires a running instance of the
3423 server in order to function, started with the option
3425 shall Bayesian filter learning be possible.
3427 .Bd -literal -offset indent
3428 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
3429 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
3430 --daemonize [--local] [--allow-tell]
3434 Thereafter \*(UA can make use of these interfaces:
3436 .Bd -literal -offset indent
3437 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3438 -Sspamc-command=/usr/local/bin/spamc \e
3439 -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
3441 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
3442 -Sspamc-command=/usr/local/bin/spamc \e
3443 -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
3447 Using the generic filter approach allows usage of programs like
3449 Here is an example, requiring it to be accessible via
3452 .Bd -literal -offset indent
3453 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
3454 -Sspamfilter-ham="bogofilter -n" \e
3455 -Sspamfilter-noham="bogofilter -N" \e
3456 -Sspamfilter-nospam="bogofilter -S" \e
3457 -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
3458 -Sspamfilter-spam="bogofilter -s" \e
3459 -Sspamfilter-rate-scanscore="1;^(.+)$"
3463 Because messages must exist on local storage in order to be scored (or
3464 used for Bayesian filter training), it is possibly a good idea to
3465 perform the local spam check last.
3466 Spam can be checked automatically when opening specific folders by
3467 setting a specialized form of the internal variable
3470 .Bd -literal -offset indent
3471 define spamdelhook {
3473 spamset (header x-dcc-brand-metrics "bulk")
3474 # Server-side spamassassin(1)
3475 spamset (header x-spam-flag "YES")
3476 del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
3482 set folder-hook-SOMEFOLDER=spamdelhook
3486 See also the documentation for the variables
3487 .Va spam-interface , spam-maxsize ,
3488 .Va spamc-command , spamc-arguments , spamc-user ,
3489 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
3492 .Va spamfilter-rate-scanscore .
3495 .\" }}} (DESCRIPTION)
3498 .\" .Sh COMMANDS {{{
3501 \*(UA reads input in lines.
3502 An unquoted reverse solidus
3504 at the end of a command line
3506 the newline character: it is discarded and the next line of input is
3507 used as a follow-up line, with all leading whitespace removed;
3508 once an entire line is completed, the whitespace characters
3509 .Cm space , tabulator , newline
3510 as well as those defined by the variable
3512 are removed from the beginning and end.
3513 Placing any whitespace characters at the beginning of a line will
3514 prevent a possible addition of the command line to the \*(OPal
3518 The beginning of such input lines is then scanned for the name of
3519 a known command: command names may be abbreviated, in which case the
3520 first command that matches the given prefix will be used.
3521 .Sx "Command modifiers"
3522 may prefix a command in order to modify its behaviour.
3523 A name may also be a
3525 which will become expanded until no more expansion is possible.
3526 Once the command that shall be executed is known, the remains of the
3527 input line will be interpreted according to command-specific rules,
3528 documented in the following.
3531 This behaviour is different to the
3533 ell, which is a programming language with syntactic elements of clearly
3534 defined semantics, and therefore capable to sequentially expand and
3535 evaluate individual elements of a line.
3536 \*(UA will never be able to handle
3537 .Ql \&? set one=value two=$one
3538 in a single statement, because the variable assignment is performed by
3544 A list of all commands in lookup order is dumped by the command
3546 \*(OPally the command
3550 when given an argument, will show a documentation string for the
3551 command matching the expanded argument, as in
3553 which should be a shorthand of
3555 with these documentation strings both commands support a more
3557 listing mode which includes the argument type of the command and other
3558 information which applies; a handy suggestion might thus be:
3560 .Bd -literal -offset indent
3562 # Before v15: need to enable sh(1)ell-style on _entire_ line!
3563 localopts yes;wysh set verbose;ignerr eval "${@}";return ${?}
3565 ? commandalias xv '\ecall __xv'
3569 .\" .Ss "Command modifiers" {{{
3570 .Ss "Command modifiers"
3572 Commands may be prefixed by none to multiple command modifiers.
3573 Some command modifiers can be used with a restricted set of commands
3578 will (\*(OPally) show which modifiers apply.
3582 The modifier reverse solidus
3585 to be placed first, prevents
3587 expansions on the remains of the line, for example
3589 will always evaluate the command
3591 even if an (command)alias of the same name exists.
3593 content may itself contain further command modifiers, including
3594 an initial reverse solidus to prevent further expansions.
3600 indicates that any error generated by the following command should be
3601 ignored by the state machine and not cause a program exit with enabled
3603 or for the standardized exit cases in
3608 .Sx "INTERNAL VARIABLES" ,
3609 will be set to the real exit status of the command regardless.
3614 will alter the called command to apply changes only temporarily,
3615 local to block-scope, and can thus only be used inside of a
3620 Specifying it implies the modifier
3622 Block-scope settings will not be inherited by macros deeper in the
3624 chain, and will be garbage collected once the current block is left.
3625 To record and unroll changes in the global scope use the command
3631 does yet not implement any functionality.
3636 does yet not implement any functionality.
3639 Some commands support the
3642 modifier: if used, they expect the name of a variable, which can itself
3643 be a variable, i.e., shell expansion is applied, as their first
3644 argument, and will place their computation result in it instead of the
3645 default location (it is usually written to standard output).
3647 The given name will be tested for being a valid
3649 variable name, and may therefore only consist of upper- and lowercase
3650 characters, digits, and the underscore; the hyphen-minus may be used as
3651 a non-portable extension; digits may not be used as first, hyphen-minus
3652 may not be used as last characters.
3653 In addition the name may either not be one of the known
3654 .Sx "INTERNAL VARIABLES" ,
3655 or must otherwise refer to a writable (non-boolean) value variable.
3656 The actual put operation may fail nonetheless, for example if the
3657 variable expects a number argument only a number will be accepted.
3658 Any error during these operations causes the command as such to fail,
3659 and the error number
3662 .Va ^ERR Ns -NOTSUP ,
3667 but some commands deviate from the latter, which is documented.
3670 Last, but not least, the modifier
3673 can be used for some old and established commands to choose the new
3674 .Sx "Shell-style argument quoting"
3675 rules over the traditional
3676 .Sx "Old-style argument quoting" .
3677 This modifier is implied if
3679 is set to a non-empty value.
3683 .\" .Ss "Old-style argument quoting" v15-compat: rename Obsolete.. {{{
3684 .Ss "Old-style argument quoting"
3686 \*(ID This section documents the traditional and POSIX standardized
3687 style of quoting non-message list arguments to commands which expect
3688 this type of arguments: whereas still used by the majority of such
3690 .Sx "Shell-style argument quoting"
3691 may be available even for those via
3694 .Sx "Command modifiers" .
3695 Nonetheless care must be taken, because only new commands have been
3696 designed with all the capabilities of the new quoting rules in mind,
3697 which can, for example generate control characters.
3700 .Bl -bullet -offset indent
3702 An argument can be enclosed between paired double-quotes
3707 any whitespace, shell word expansion, or reverse solidus characters
3708 (except as described next) within the quotes are treated literally as
3709 part of the argument.
3710 A double-quote will be treated literally within single-quotes and vice
3712 Inside such a quoted string the actually used quote character can be
3713 used nonetheless by escaping it with a reverse solidus
3719 An argument that is not enclosed in quotes, as above, can usually still
3720 contain space characters if those spaces are reverse solidus escaped, as in
3724 A reverse solidus outside of the enclosing quotes is discarded
3725 and the following character is treated literally as part of the argument.
3729 .\" .Ss "Shell-style argument quoting" {{{
3730 .Ss "Shell-style argument quoting"
3733 ell-style, and therefore POSIX standardized, argument parsing and
3734 quoting rules are used by most commands.
3735 \*(ID Most new commands only support these new rules and are flagged
3736 \*(NQ, some elder ones can use them with the command modifier
3738 in the future only this type of argument quoting will remain.
3741 A command line is parsed from left to right and an input token is
3742 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3743 Metacharacters are vertical bar
3749 as well as all characters from the variable
3752 .Cm space , tabulator , newline .
3753 The additional metacharacters left and right parenthesis
3755 and less-than and greater-than signs
3759 supports are not used, and are treated as ordinary characters: for one
3760 these characters are a vivid part of email addresses, and it seems
3761 highly unlikely that their function will become meaningful to \*(UA.
3763 .Bd -filled -offset indent
3764 .Sy Compatibility note:
3765 \*(ID Please note that even many new-style commands do not yet honour
3767 to parse their arguments: whereas the
3769 ell is a language with syntactic elements of clearly defined semantics,
3770 \*(UA parses entire input lines and decides on a per-command base what
3771 to do with the rest of the line.
3772 This also means that whenever an unknown command is seen all that \*(UA
3773 can do is cancellation of the processing of the remains of the line.
3775 It also often depends on an actual subcommand of a multiplexer command
3776 how the rest of the line should be treated, and until v15 we are not
3777 capable to perform this deep inspection of arguments.
3778 Nonetheless, at least the following commands which work with positional
3779 parameters fully support
3781 for an almost shell-compatible field splitting:
3782 .Ic call , call_if , read , vpospar , xcall .
3786 Any unquoted number sign
3788 at the beginning of a new token starts a comment that extends to the end
3789 of the line, and therefore ends argument processing.
3790 An unquoted dollar sign
3792 will cause variable expansion of the given name, which must be a valid
3794 ell-style variable name (see
3796 .Sx "INTERNAL VARIABLES"
3799 (shell) variables can be accessed through this mechanism, brace
3800 enclosing the name is supported (i.e., to subdivide a token).
3803 Whereas the metacharacters
3804 .Cm space , tabulator , newline
3805 only complete an input token, vertical bar
3811 also act as control operators and perform control functions.
3812 For now supported is semicolon
3814 which terminates a single command, therefore sequencing the command line
3815 and making the remainder of the line a subject to reevaluation.
3816 With sequencing, multiple command argument types and quoting rules may
3817 therefore apply to a single line, which can become problematic before
3818 v15: e.g., the first of the following will cause surprising results.
3821 .Dl ? echo one; set verbose; echo verbose=$verbose.
3822 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3825 Quoting is a mechanism that will remove the special meaning of
3826 metacharacters and reserved words, and will prevent expansion.
3827 There are four quoting mechanisms: the escape character, single-quotes,
3828 double-quotes and dollar-single-quotes:
3831 .Bl -bullet -offset indent
3833 The literal value of any character can be preserved by preceding it
3834 with the escape character reverse solidus
3838 Arguments which are enclosed in
3839 .Ql 'single-\:quotes'
3840 retain their literal value.
3841 A single-quote cannot occur within single-quotes.
3844 The literal value of all characters enclosed in
3845 .Ql \(dqdouble-\:quotes\(dq
3846 is retained, with the exception of dollar sign
3848 which will cause variable expansion, as above, backquote (grave accent)
3850 (which not yet means anything special), reverse solidus
3852 which will escape any of the characters dollar sign
3854 (to prevent variable expansion), backquote (grave accent)
3858 (to prevent ending the quote) and reverse solidus
3860 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3861 but has no special meaning otherwise.
3864 Arguments enclosed in
3865 .Ql $'dollar-\:single-\:quotes'
3866 extend normal single quotes in that reverse solidus escape sequences are
3867 expanded as follows:
3869 .Bl -tag -compact -width ".Ql \eNNN"
3871 bell control character (ASCII and ISO-10646 BEL).
3873 backspace control character (ASCII and ISO-10646 BS).
3875 escape control character (ASCII and ISO-10646 ESC).
3879 form feed control character (ASCII and ISO-10646 FF).
3881 line feed control character (ASCII and ISO-10646 LF).
3883 carriage return control character (ASCII and ISO-10646 CR).
3885 horizontal tabulator control character (ASCII and ISO-10646 HT).
3887 vertical tabulator control character (ASCII and ISO-10646 VT).
3889 emits a reverse solidus character.
3893 double quote (escaping is optional).
3895 eight-bit byte with the octal value
3897 (one to three octal digits), optionally prefixed by an additional
3899 A 0 byte will suppress further output for the quoted argument.
3901 eight-bit byte with the hexadecimal value
3903 (one or two hexadecimal characters, no prefix, see
3905 A 0 byte will suppress further output for the quoted argument.
3907 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3909 (one to eight hexadecimal characters) \(em note that Unicode defines the
3910 maximum codepoint ever to be supported as
3915 This escape is only supported in locales that support Unicode (see
3916 .Sx "Character sets" ) ,
3917 in other cases the sequence will remain unexpanded unless the given code
3918 point is ASCII compatible or (if the \*(OPal character set conversion is
3919 available) can be represented in the current locale.
3920 The character NUL will suppress further output for the quoted argument.
3924 except it takes only one to four hexadecimal characters.
3926 Emits the non-printable (ASCII and compatible) C0 control codes
3927 0 (NUL) to 31 (US), and 127 (DEL).
3928 Printable representations of ASCII control codes can be created by
3929 mapping them to a different, visible part of the ASCII character set.
3930 Adding the number 64 achieves this for the codes 0 to 31, here 7 (BEL):
3931 .Ql 7 + 64 = 71 = G .
3932 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3934 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3935 .Ql \&?\0vexpr\0^\0127\064 .
3937 Whereas historically circumflex notation has often been used for
3938 visualization purposes of control codes, as in
3940 the reverse solidus notation has been standardized:
3942 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3948 whenever such an alias exists it will be used for display purposes.
3949 The control code NUL
3951 a non-standard extension) will suppress further output for the remains
3952 of the token (which may extend beyond the current quote), or, depending
3953 on the context, the remains of all arguments for the current command.
3955 Non-standard extension: expand the given variable name, as above.
3956 Brace enclosing the name is supported.
3958 Not yet supported, just to raise awareness: Non-standard extension.
3965 .Bd -literal -offset indent
3966 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3967 ? echo Quotes ${HOME} and tokens differ! # comment
3968 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3972 .\" .Ss "Message list arguments" {{{
3973 .Ss "Message list arguments"
3975 Many commands operate on message list specifications, as documented in
3976 .Sx "Specifying messages" .
3977 The argument input is first split into individual tokens via
3978 .Sx "Shell-style argument quoting" ,
3979 which are then interpreted as the mentioned specifications.
3980 If no explicit message list has been specified, many commands will
3981 search for and use the next message forward that satisfies the commands'
3982 requirements, and if there are no messages forward of the current
3983 message, the search proceeds backwards;
3984 if there are no good messages at all to be found, an error message is
3985 shown and the command is aborted.
3988 output of the command
3990 will indicate whether a command searches for a default message, or not.
3993 .\" .Ss "Raw data arguments for codec commands" {{{
3994 .Ss "Raw data arguments for codec commands"
3996 A special set of commands, which all have the string
4002 take raw string data as input, which means that the content of the
4003 command input line is passed completely unexpanded and otherwise
4004 unchanged: like this the effect of the actual codec is visible without
4005 any noise of possible shell quoting rules etc., i.e., the user can input
4006 one-to-one the desired or questionable data.
4007 To gain a level of expansion, the entire command line can be
4009 uated first, for example
4011 .Bd -literal -offset indent
4012 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
4014 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
4016 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
4017 ? eval shcodec d $res
4018 /usr/Sch\[:o]nes Wetter/heute.txt
4022 .\" .Ss "Filename transformations" {{{
4023 .Ss "Filename transformations"
4025 Filenames, where expected, and unless documented otherwise, are
4026 subsequently subject to the following filename transformations, in
4029 .Bl -bullet -offset indent
4031 If the given name is a registered
4033 it will be replaced with the expanded shortcut.
4034 This step is mostly taken for
4039 The filename is matched against the following patterns or strings.
4043 expansion this step is mostly taken for
4049 .Bl -hang -compact -width ".Ar %user"
4051 (Number sign) is expanded to the previous file.
4054 (Percent sign) is replaced by the invoking
4055 .Mx -ix "primary system mailbox"
4056 user's primary system mailbox, which either is the (itself expandable)
4058 if that is set, the standardized absolute pathname indicated by
4060 if that is set, or a built-in compile-time default otherwise.
4063 the used name is actively checked for being a primary mailbox, first
4070 Expands to the primary system mailbox of
4072 (and never the value of
4074 regardless of its actual setting).
4077 (Ampersand) is replaced with the invoking user's
4078 .Mx -ix "secondary mailbox"
4079 secondary mailbox, the
4087 directory (if that variable is set).
4090 Expands to the same value as
4092 but has special meaning when used with, for example, the command
4094 the file will be treated as a primary system mailbox by, among others, the
4098 commands, meaning that messages that have been read in the current
4099 session will be moved to the
4101 mailbox instead of simply being flagged as read.
4106 Meta expansions may be applied to the resulting filename, as allowed by
4107 the operation and applicable to the resulting access protocol (also see
4108 .Sx "On URL syntax and credential lookup" ) .
4109 For the file-protocol, a leading tilde
4111 character will be replaced by the expansion of
4113 except when followed by a valid user name, in which case the home
4114 directory of the given user is used instead.
4116 A shell expansion as if specified in double-quotes (see
4117 .Sx "Shell-style argument quoting" )
4118 may be applied, so that any occurrence of
4122 will be replaced by the expansion of the variable, if possible;
4123 .Sx "INTERNAL VARIABLES"
4126 (shell) variables can be accessed through this mechanism.
4128 Shell pathname wildcard pattern expansions
4130 may be applied as documented.
4131 If the fully expanded filename results in multiple pathnames and the
4132 command is expecting only one file, an error results.
4134 In interactive context, in order to allow simple value acceptance (via
4136 arguments will usually be displayed in a properly quoted form, so a file
4137 .Ql diet\e is \ecurd.txt
4139 .Ql 'diet\e is \ecurd.txt' .
4143 .\" .Ss "Commands" {{{
4146 The following commands are available:
4148 .Bl -tag -width ".It Ic BaNg"
4155 command which follows, replacing unescaped exclamation marks with the
4156 previously executed command if the internal variable
4159 This command supports
4162 .Sx "Command modifiers" ,
4163 and manages the error number
4165 A 0 or positive exit status
4167 reflects the exit status of the command, negative ones that
4168 an error happened before the command was executed, or that the program
4169 did not exit cleanly, but maybe due to a signal: the error number is
4170 .Va ^ERR Ns -CHILD ,
4174 In conjunction with the
4176 modifier the following special cases exist:
4177 a negative exit status occurs if the collected data could not be stored
4178 in the given variable, which is a
4180 error that should otherwise not occur.
4181 .Va ^ERR Ns -CANCELED
4182 indicates that no temporary file could be created to collect the command
4183 output at first glance.
4184 In case of catchable out-of-memory situations
4186 will occur and \*(UA will try to store the empty string, just like with
4187 all other detected error conditions.
4192 The comment-command causes the entire line to be ignored.
4194 this really is a normal command which' purpose is to discard its
4197 indicating special character, which means that for example trailing
4198 comments on a line are not possible (except for commands which use
4199 .Sx "Shell-style argument quoting" ) .
4203 Goes to the next message in sequence and types it
4209 Display the preceding message, or the n'th previous message if given
4210 a numeric argument n.
4214 Shows the message number of the current message (the
4216 when used without arguments, that of the given list otherwise.
4217 Output numbers will be separated from each other with the first
4220 and followed by the first character of
4222 if that is not empty and not identical to the first.
4223 If that results in no separation at all a
4226 This command supports
4229 .Sx "Command modifiers" ) ,
4230 and manages the error number
4235 \*(OP Show a brief summary of commands.
4236 \*(OP Given an argument a synopsis for the command in question is
4237 shown instead; commands can be abbreviated in general and this command
4238 can be used to see the full expansion of an abbreviation including the
4239 synopsis, try, for example
4244 and see how the output changes.
4245 To avoid that aliases are resolved the modifier
4247 can be prepended to the argument, but note it must be quoted.
4248 This mode also supports a more
4250 output, which will provide the information documented for
4261 .It Ic account , unaccount
4262 (ac, una) Creates, selects or lists (an) account(s).
4263 Accounts are special incarnations of
4265 macros and group commands and variable settings which together usually
4266 arrange the environment for the purpose of creating an email account.
4267 Different to normal macros settings which are covered by
4269 \(en here by default enabled! \(en will not be reverted before the
4274 (case-insensitive) always exists, and all but it can be deleted by the
4275 latter command, and in one operation with the special name
4277 Also for all but it a possibly set
4278 .Va on-account-cleanup
4279 hook is called once they are left, including program exit.
4281 Without arguments a listing of all defined accounts is shown.
4282 With one argument the given account is activated: the system
4284 of that account will be activated (as via
4286 a possibly installed
4288 will be run, and the internal variable
4291 The two argument form is identical to defining a macro as via
4293 .Bd -literal -offset indent
4295 set folder=~/mail inbox=+syste.mbox record=+sent.mbox
4296 set from='(My Name) myname@myisp.example'
4297 set mta=smtp://mylogin@smtp.myisp.example
4304 Perform email address codec transformations on raw-data argument, rather
4305 according to email standards (RFC 5322; \*(ID will furtherly improve).
4309 .Sx "Command modifiers" ) ,
4310 and manages the error number
4312 The first argument must be either
4313 .Ar [+[+[+]]]e[ncode] ,
4318 and specifies the operation to perform on the rest of the line.
4321 Decoding will show how a standard-compliant MUA will display the given
4322 argument, which should be an email address.
4323 Please be aware that most MUAs have difficulties with the address
4324 standards, and vary wildly when (comments) in parenthesis,
4326 strings, or quoted-pairs, as below, become involved.
4327 \*(ID \*(UA currently does not perform decoding when displaying addresses.
4330 Skinning is identical to decoding but only outputs the plain address,
4331 without any string, comment etc. components.
4332 Another difference is that it may fail with the error number
4336 if decoding fails to find a(n) (valid) email address, in which case the
4337 unmodified input will be output again.
4341 first performs a skin operation, and thereafter checks a valid
4342 address for whether it is a registered mailing list (see
4346 eventually reporting that state in the error number
4349 .Va ^ERR Ns -EXIST .
4350 (This state could later become overwritten by an I/O error, though.)
4353 Encoding supports four different modes, lesser automated versions can be
4354 chosen by prefixing one, two or three plus signs: the standard imposes
4355 a special meaning on some characters, which thus have to be transformed
4356 to so-called quoted-pairs by pairing them with a reverse solidus
4358 in order to remove the special meaning; this might change interpretation
4359 of the entire argument from what has been desired, however!
4360 Specify one plus sign to remark that parenthesis shall be left alone,
4361 two for not turning double quotation marks into quoted-pairs, and three
4362 for also leaving any user-specified reverse solidus alone.
4363 The result will always be valid, if a successful exit status is reported
4364 (\*(ID the current parser fails this assertion for some constructs).
4365 \*(ID Addresses need to be specified in between angle brackets
4368 if the construct becomes more difficult, otherwise the current parser
4369 will fail; it is not smart enough to guess right.
4371 .Bd -literal -offset indent
4372 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
4373 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4374 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4375 "Hey, you", \e out\e there <diet@exam.ple>
4376 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
4383 .It Ic alias , unalias
4384 \*(NQ(a, una) Define or list, and remove, respectively, address aliases.
4385 Address aliases are a method of creating personal distribution lists
4386 that map a single alias name to none to multiple receivers;
4387 aliases are expanded after message composing is completed.
4388 The latter command removes all given aliases, the special name asterisk
4390 will remove all existing aliases.
4391 When used without arguments the former shows a list of all currently
4392 known aliases, with one argument only the target(s) of the given one.
4393 When given two arguments, hyphen-minus
4395 being the first, the target(s) of the second is/are expanded recursively.
4397 In all other cases the given address alias is newly defined or will be
4398 appended to: target arguments must either be valid alias names, or any
4400 Recursive expansion of (what looks like) alias name(s) targets can be
4401 prevented by prefixing the target with the modifier reverse solidus
4403 A valid alias name conforms to
4405 syntax, but follow-up characters can also be the number sign
4416 .Dq any character that has the high bit set .
4419 may be the last character.
4420 The number sign may need be quoted to avoid misinterpretation as the
4421 shell comment character.
4423 .\" ALIASCOLON next sentence
4424 \*(ID Unfortunately the colon is currently not supported, as it
4425 interferes with normal address parsing rules.
4426 .\" ALIASCOLON next sentence
4427 \*(ID Such high bit characters will likely cause warnings at the moment
4428 for the same reasons why colon is unsupported; also, in the future
4429 locale dependent character set validity checks will be performed.
4433 .It Ic alternates , unalternates
4434 \*(NQ (alt) Manage a list of alternate addresses or names of the active
4435 user, members of which will be removed from recipient lists (except one).
4436 There is a set of implicit alternates which is formed of the values of
4446 The latter command removes the given list of alternates, the special name
4448 will discard all existing alternate names.
4450 The former command manages the error number
4452 It shows the current set of alternates when used without arguments; in
4453 this mode only it also supports
4456 .Sx "Command modifiers" ) .
4457 Otherwise the given arguments (after being checked for validity) are
4458 appended to the list of alternate names; in
4460 mode they replace that list instead.
4464 .It Ic answered , unanswered
4465 Take a message lists and mark each message as (not) having been answered.
4466 Messages will be marked answered when being
4468 to automatically if the
4472 .Sx "Message states" .
4477 .It Ic bind , unbind
4478 \*(OP\*(NQ The bind command extends the MLE (see
4479 .Sx "On terminal control and line editor" )
4480 with freely configurable key bindings.
4481 The latter command removes from the given context the given key binding,
4482 both of which may be specified as a wildcard
4486 will remove all bindings of all contexts.
4487 Due to initialization order unbinding will not work for built-in key
4488 bindings upon program startup, however: please use
4489 .Va line-editor-no-defaults
4490 for this purpose instead.
4493 With zero arguments, or with a context name the former command shows
4494 all key bindings (of the given context; an asterisk
4496 will iterate over all contexts); a more verbose listing will be
4497 produced if either of
4502 With two or more arguments a specific binding is shown, or
4503 (re)established: the first argument is the context to which the binding
4504 shall apply, the second argument is a comma-separated list of the
4506 which form the binding.
4507 Further arguments will be joined to form the expansion, and cause the
4508 binding to be created or updated.
4509 To indicate that a binding shall not be auto-committed, but that the
4510 expansion shall instead be furtherly editable by the user, a commercial at
4512 (that will be removed) can be placed last in the expansion, from which
4513 leading and trailing whitespace will finally be removed.
4514 Reverse solidus cannot be used as the last character of expansion.
4515 An empty expansion will be rejected.
4518 Contexts define when a binding applies, i.e., a binding will not be seen
4519 unless the context for which it is defined for is currently active.
4520 This is not true for the shared binding
4522 which is the foundation for all other bindings and as such always
4523 applies, its bindings, however, only apply secondarily.
4524 The available contexts are the shared
4528 context which is used in all not otherwise documented situations, and
4530 which applies to compose mode only.
4533 Bindings are specified as a comma-separated list of byte-sequences,
4534 where each list entry corresponds to one
4537 Byte sequence boundaries will be forcefully terminated after
4538 .Va bind-inter-byte-timeout
4539 milliseconds, whereas key sequences can be timed out via
4540 .Va bind-inter-key-timeout .
4541 A list entry may, indicated by a leading colon character
4543 also refer to the name of a terminal capability; several dozen names
4544 are compiled in and may be specified either by their
4546 or, if existing, by their
4548 name, regardless of the actually used \*(OPal terminal control library.
4549 But any capability may be used, as long as the name is resolvable by the
4550 \*(OPal control library, or was defined via the internal variable
4552 Input sequences are not case-normalized, an exact match is required to
4553 update or remove a binding.
4554 It is advisable to use an initial escape or other control character (like
4556 for user (as opposed to purely terminal capability based) bindings in
4557 order to avoid ambiguities; it also reduces search time.
4560 .Bd -literal -offset indent
4561 ? bind base a,b echo one
4562 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
4563 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc,Delete
4564 ? bind default $'\ecA',:khome,w 'echo Editable binding@'
4565 ? bind default a,b,c rm -irf / @ # Also editable
4566 ? bind default :kf1 File %
4567 ? bind compose :kf1 ~v
4571 Note that the entire comma-separated list is first parsed (over) as a
4572 shell-token with whitespace as the field separator, then parsed and
4573 expanded for real with comma as the field separator, therefore
4574 whitespace needs to be properly quoted, see
4575 .Sx "Shell-style argument quoting" .
4576 Using Unicode reverse solidus escape sequences renders a binding
4577 defunctional if the locale does not support Unicode (see
4578 .Sx "Character sets" ) ,
4579 and using terminal capabilities does so if no (corresponding) terminal
4580 control support is (currently) available.
4581 Adding, deleting or modifying a key binding invalidates the internal
4582 prebuilt lookup tree, it will be recreated as necessary: this process
4583 will be visualized in most
4590 The following terminal capability names are built-in and can be used in
4592 or (if available) the two-letter
4595 See the respective manual for a list of capabilities.
4598 can be used to show all the capabilities of
4600 or the given terminal type;
4603 flag will also show supported (non-standard) extensions.
4606 .Bl -tag -compact -width kcuuf_or_kcuuf
4607 .It Cd kbs Ns \0or Cd kb
4609 .It Cd kdch1 Ns \0or Cd kD
4611 .It Cd kDC Ns \0or Cd *4
4612 \(em shifted variant.
4613 .It Cd kel Ns \0or Cd kE
4614 Clear to end of line.
4615 .It Cd kext Ns \0or Cd @9
4617 .It Cd kich1 Ns \0or Cd kI
4619 .It Cd kIC Ns \0or Cd #3
4620 \(em shifted variant.
4621 .It Cd khome Ns \0or Cd kh
4623 .It Cd kHOM Ns \0or Cd #2
4624 \(em shifted variant.
4625 .It Cd kend Ns \0or Cd @7
4627 .It Cd knp Ns \0or Cd kN
4629 .It Cd kpp Ns \0or Cd kP
4631 .It Cd kcub1 Ns \0or Cd kl
4632 Left cursor (with more modifiers: see below).
4633 .It Cd kLFT Ns \0or Cd #4
4634 \(em shifted variant.
4635 .It Cd kcuf1 Ns \0or Cd kr
4636 Right cursor (ditto).
4637 .It Cd kRIT Ns \0or Cd %i
4638 \(em shifted variant.
4639 .It Cd kcud1 Ns \0or Cd kd
4640 Down cursor (ditto).
4642 \(em shifted variant (only terminfo).
4643 .It Cd kcuu1 Ns \0or Cd ku
4646 \(em shifted variant (only terminfo).
4647 .It Cd kf0 Ns \0or Cd k0
4649 Add one for each function key up to
4654 .It Cd kf10 Ns \0or Cd k;
4656 .It Cd kf11 Ns \0or Cd F1
4658 Add one for each function key up to
4666 Some terminals support key-modifier combination extensions, e.g.,
4668 For example, the delete key,
4670 in its shifted variant, the name is mutated to
4672 then a number is appended for the states
4684 .Ql Shift+Alt+Control
4686 The same for the left cursor key,
4688 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4693 \*(NQ Calls the given macro, which must have been created via
4695 (see there for more), otherwise an
4698 Calling macros recursively will at some time excess the stack size
4699 limit, causing a hard program abortion; if recursively calling a macro
4700 is the last command of the current macro, consider to use the command
4702 which will first release all resources of the current macro before
4703 replacing the current macro with the called one.
4710 if the given macro has been created via
4712 but does not fail nor warn if the macro does not exist.
4721 \*(OP Only applicable to S/MIME signed messages.
4722 Takes an optional message list and a filename and saves the certificates
4723 contained within the message signatures to the named file in both
4724 human-readable and PEM format.
4725 The certificates can later be used to send encrypted messages to the
4726 respective message senders by setting
4727 .Va smime-encrypt-USER@HOST
4732 .It Ic charsetalias , uncharsetalias
4733 \*(NQ Manage alias mappings for (conversion of)
4734 .Sx "Character sets" .
4735 Alias processing is not performed for
4736 .Sx "INTERNAL VARIABLES" ,
4739 and mappings are ineffective if character set conversion is not available
4743 Expansion happens recursively for cases where aliases point to other
4744 aliases (built-in loop limit: 8).
4746 The latter command deletes all aliases given as arguments,
4747 or all at once when given the asterisk
4749 The former shows the list of all currently defined aliases if used
4750 without arguments, or the target of the given single argument;
4751 when given two arguments, hyphen-minus
4753 being the first, the second is instead expanded recursively.
4754 In all other cases the given arguments are treated as pairs of character
4755 sets and their desired target alias name, creating new or updating
4756 already existing aliases.
4760 \*(NQ(ch) Change the working directory to
4762 or the given argument.
4768 .It Ic collapse , uncollapse
4774 Takes a message list and makes all replies to these messages invisible
4775 in header summaries, except for
4779 Also when a message with collapsed replies is displayed,
4780 all of these are automatically uncollapsed.
4781 The latter command undoes collapsing.
4784 .\" FIXME review until this point
4787 .It Ic colour , uncolour
4788 \*(OP\*(NQ Manage colour mappings of and for a
4789 .Sx "Coloured display" .
4790 Without arguments the former shows all currently defined mappings.
4791 Otherwise a colour type is expected (case-insensitively),
4794 for 256-colour terminals,
4799 for the standard 8-colour ANSI / ISO 6429 colour palette, and
4803 for monochrome terminals, which only support (some) font attributes.
4804 Without further arguments the list of all currently defined mappings
4805 of the given type is shown (here the special
4809 also show all currently defined mappings).
4812 Otherwise the second argument defines the mappable slot, the third
4813 argument a (comma-separated list of) colour and font attribute
4814 specification(s), and the optionally supported fourth argument can be
4815 used to specify a precondition: if conditioned mappings exist they are
4816 tested in (creation) order unless a (case-insensitive) match has been
4817 found, and the default mapping (if any has been established) will only
4818 be chosen as a last resort.
4819 The types of available preconditions depend on the mappable slot,
4820 the following of which exist:
4823 Mappings prefixed with
4825 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4826 .Sx "On terminal control and line editor" )
4827 and do not support preconditions.
4829 .Bl -tag -compact -width view-partinfo
4831 This mapping is used for the position indicator that is visible when
4832 a line cannot be fully displayed on the screen.
4837 Used for the occasionally appearing error indicator that is joined onto
4839 \*(ID Also used for error messages written on standard error .
4843 Mappings prefixed with
4845 are used in header summaries, and they all understand the preconditions
4847 (the current message) and
4849 for elder messages (only honoured in conjunction with
4850 .Va datefield-markout-older ) .
4852 .Bl -tag -compact -width view-partinfo
4854 This mapping is used for the
4856 that can be created with the
4860 formats of the variable
4863 For the complete header summary line except the
4865 and the thread structure.
4867 For the thread structure which can be created with the
4869 format of the variable
4874 Mappings prefixed with
4876 are used when displaying messages.
4878 .Bl -tag -compact -width view-partinfo
4880 This mapping is used for so-called
4882 lines, which are MBOX file format specific header lines (also see
4883 .Va mbox-rfc4155 ) .
4886 A comma-separated list of headers to which the mapping applies may be
4887 given as a precondition; if the \*(OPal regular expression support is
4888 available then if any of the
4890 .Sx "magic regular expression characters"
4891 is seen the precondition will be evaluated as (an extended) one.
4893 For the introductional message info line.
4894 .It Ar view-partinfo
4895 For MIME part info lines.
4899 The following (case-insensitive) colour definitions and font attributes
4900 are understood, multiple of which can be specified in a comma-separated
4910 It is possible (and often applicable) to specify multiple font
4911 attributes for a single mapping.
4914 foreground colour attribute:
4924 To specify a 256-colour mode a decimal number colour specification in
4925 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4927 .Bl -tag -compact -width "999 - 999"
4929 the standard ISO 6429 colours, as above.
4931 high intensity variants of the standard colours.
4933 216 colours in tuples of 6.
4935 grayscale from black to white in 24 steps.
4937 .Bd -literal -offset indent
4939 fg() { printf "\e033[38;5;${1}m($1)"; }
4940 bg() { printf "\e033[48;5;${1}m($1)"; }
4942 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4943 printf "\e033[0m\en"
4945 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4946 printf "\e033[0m\en"
4950 background colour attribute (see
4952 for possible values).
4958 will remove for the given colour type (the special type
4960 selects all) the given mapping; if the optional precondition argument is
4961 given only the exact tuple of mapping and precondition is removed.
4964 will remove all mappings (no precondition allowed), thus
4966 will remove all established mappings.
4971 .It Ic commandalias , uncommandalias
4972 \*(NQ Define or list, and remove, respectively, command aliases.
4973 An (command)alias can be used everywhere a normal command can be used,
4974 but always takes precedence: any arguments that are given to the command
4975 alias are joined onto the alias expansion, and the resulting string
4976 forms the command line that is, in effect, executed.
4977 The latter command removes all given aliases, the special name asterisk
4979 will remove all existing aliases.
4980 When used without arguments the former shows a list of all currently
4981 known aliases, with one argument only the expansion of the given one.
4983 With two or more arguments a command alias is defined or updated: the
4984 first argument is the name under which the remaining command line should
4985 be accessible, the content of which can be just about anything.
4986 An alias may itself expand to another alias, but to avoid expansion loops
4987 further expansion will be prevented if an alias refers to itself or if
4988 an expansion depth limit is reached.
4989 Explicit expansion prevention is available via reverse solidus
4992 .Sx "Command modifiers" .
4993 .Bd -literal -offset indent
4995 \*(uA: `commandalias': no such alias: xx
4996 ? commandalias xx echo hello,
4998 commandalias xx 'echo hello,'
5009 but copy the messages to a file named after the local part of the
5010 sender of the first message instead of taking a filename argument;
5012 is inspected to decide on the actual storage location.
5016 (c) Copy messages to the named file and do not mark them as being saved;
5017 otherwise identical to
5023 \*(NQ A multiplexer command which provides C-style string operations on
5024 8-bit bytes without a notion of locale settings and character sets,
5025 effectively assuming ASCII data.
5026 For numeric and other operations refer to
5030 .Sx "Command modifiers" ,
5034 for usage errors and numeric results, the empty string otherwise;
5035 missing data errors, as for unsuccessful searches, result in the
5037 error number being set to
5038 .Va ^ERR Ns -NODATA .
5039 Where the question mark
5041 modifier suffix is supported, a case-insensitive (ASCII mapping)
5042 operation mode is supported; the keyword
5050 .Bl -hang -width ".It Cm length"
5052 Queries the length of the given argument.
5054 .It Cm hash , Cm hash32
5055 Calculates a hash value of the given argument.
5056 The latter will return a 32-bit result regardless of host environment.
5058 modifier suffix is supported.
5059 These use Chris Torek's hash algorithm, the resulting hash value is
5060 bit mixed as shown by Bret Mulvey.
5063 Search for the second in the first argument.
5064 Shows the resulting 0-based offset shall it have been found.
5066 modifier suffix is supported.
5069 Creates a substring of its first argument.
5070 The optional second argument is the 0-based starting offset,
5071 a negative one counts from the end;
5072 the optional third argument specifies the length of the desired result,
5073 a negative length leaves off the given number of bytes at the end of the
5074 original string; by default the entire string is used.
5075 This operation tries to work around faulty arguments (set
5077 for error logs), but reports them via the error number
5080 .Va ^ERR Ns -OVERFLOW .
5083 Trim away whitespace characters from both ends of the argument.
5086 Trim away whitespace characters from the begin of the argument.
5089 Trim away whitespace characters from the end of the argument.
5095 Show the name of the current working directory, as reported by
5100 .Sx "Command modifiers" ) .
5101 The return status is tracked via
5106 \*(OP For unencrypted messages this command is identical to
5108 Encrypted messages are first decrypted, if possible, and then copied.
5112 \*(OP For unencrypted messages this command is identical to
5114 Encrypted messages are first decrypted, if possible, and then copied.
5119 .It Ic define , undefine
5120 The latter command deletes the given macro, the special name
5122 will discard all existing macros.
5123 Deletion of (a) macro(s) can be performed from within running (a)
5124 macro(s), including self-deletion.
5125 Without arguments the former command prints the current list of macros,
5126 including their content, otherwise it defines a macro, replacing an
5127 existing one of the same name as applicable.
5130 A defined macro can be invoked explicitly by using the
5135 commands, or implicitly if a macro hook is triggered, for example a
5137 Execution of a macro body can be stopped from within by calling
5141 Temporary macro block-scope variables can be created or deleted with the
5143 command modifier in conjunction with the commands
5148 To enforce unrolling of changes made to (global)
5149 .Sx "INTERNAL VARIABLES"
5152 can be used instead; its covered scope depends on how (i.e.,
5154 normal macro, folder hook, hook,
5156 switch) the macro is invoked.
5161 ed macro, the given positional parameters are implicitly local
5162 to the macro's scope, and may be accessed via the variables
5168 and any other positive unsigned decimal number less than or equal to
5170 Positional parameters can be
5172 ed, or become completely replaced, removed etc. via
5174 A helpful command for numeric computation and string evaluations is
5177 offers C-style byte string operations.
5179 .Bd -literal -offset indent
5188 echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
5191 call exmac Hello macro exmac!
5192 echo ${?}/${!}/${^ERRNAME}
5198 .It Ic delete , undelete
5199 (d, u) Marks the given message list as being or not being
5201 respectively; if no argument has been specified then the usual search
5202 for a visible message is performed, as documented for
5203 .Sx "Message list arguments" ,
5204 showing only the next input prompt if the search fails.
5205 Deleted messages will neither be saved in the
5207 .Sx "secondary mailbox"
5209 nor will they be available for most other commands.
5212 variable is set, the new
5214 or the last message restored, respectively, is automatically
5223 \*(NQ Digging (information out of) messages is possible through
5225 objects, which can be
5227 d for the given message number; in compose mode the hyphen-minus
5229 will instead open the message that is being composed.
5230 If a hyphen-minus is given as the optional third argument then output
5231 will be generated on the standard output channel instead of being
5232 subject to consumation by the
5242 d again by giving the same identifier used for creation;
5243 this step could be omitted: objects will be automatically closed
5244 when the active mailbox or the compose mode is left, respectively.
5245 In all other use cases the second argument is an object identifier,
5246 and the third and all following arguments are interpreted as via
5249 .Sx "COMMAND ESCAPES" ) :
5250 .Bd -literal -offset indent
5251 ? vput = msgno; digmsg create $msgno
5252 ? digmsg $msgno header list; readall x; echon $x
5253 210 Subject From To Message-ID References In-Reply-To
5254 ? digmsg $msgno header show Subject;readall x;echon $x
5258 ? digmsg remove $msgno
5266 Superseded by the multiplexer
5272 Delete the given messages and automatically
5276 if one exists, regardless of the setting of
5283 up or down by one message when given
5287 argument, respectively.
5291 .It Ic draft , undraft
5292 Take message lists and mark each given message as being draft, or not
5293 being draft, respectively, as documented in the section
5294 .Sx "Message states" .
5298 \*(NQ(ec) Echoes arguments to standard output and writes a trailing
5299 newline, whereas the otherwise identical
5302 .Sx "Shell-style argument quoting"
5304 .Sx "Filename transformations"
5305 are applied to the expanded arguments.
5306 This command also supports
5309 .Sx "Command modifiers" ,
5310 and manages the error number
5312 if data is stored in a variable then the return value reflects the
5313 length of the result string in case of success and is
5321 but the message is written to standard error, and prefixed by
5325 In interactive sessions the \*(OPal message ring queue for
5327 will be used instead, if available and
5335 but does not write or store a trailing newline.
5341 but does not write or store a trailing newline.
5347 at each message from the given list in turn.
5348 Modified contents are discarded unless the
5350 variable is set, and are not used unless the mailbox can be written to
5351 and the editor returns a successful exit status.
5353 can be used instead for a more display oriented editor.
5359 (see there for more),
5360 .Ic elif , else , endif
5361 conditional \(em if the condition of a preceding
5363 was false, check the following condition and execute the following block
5364 if it evaluates true.
5370 (see there for more),
5371 .Ic elif , else , endif
5372 conditional \(em if none of the conditions of the preceding
5376 commands was true, the
5382 (en) Marks the end of an
5384 (see there for more),
5385 .Ic elif , else , endif
5386 conditional execution block.
5391 \*(NQ There is a strict separation in between
5392 .Sx "INTERNAL VARIABLES"
5395 which is inherited by child processes.
5396 Some variables of the latter are however vivid for program operation,
5397 their purpose is known, therefore they have been integrated
5398 transparently into handling of the former, as accessible via
5402 To integrate any other environment variable, and/or to export internal
5403 variables into the process environment where they normally are not, a
5405 needs to become established with this command, for example
5408 .Dl environ link PERL5LIB TZ
5411 Afterwards changing such variables with
5413 will cause automatic updates of the environment, too.
5414 Sufficient system support provided (it was in BSD as early as 1987, and
5415 is standardized since Y2K) removing such variables with
5417 will remove them also from the environment, but in any way the knowledge
5423 may cause loss of such links.
5428 removes an existing link without otherwise touching variables, the
5432 subcommands are identical to
5436 but additionally update the program environment accordingly; removing
5437 a variable breaks any freely established
5443 \*(OP Since \*(UA uses the console as a user interface it can happen
5444 that messages scroll by too fast to become recognized.
5445 Therefore an error log queue is available which can be managed by
5448 or no argument will display and clear the queue,
5450 will only clear the queue.
5451 The queue is finite: if its maximum size is reached any new message
5452 replaces the eldest.
5453 There are also the variables
5456 .Va ^ERRQUEUE-EXISTS .
5460 \*(NQ Construct a command by concatenating the arguments, separated with
5461 a single space character, and then evaluate the result.
5462 This command passes through the exit status
5466 of the evaluated command; also see
5468 .Bd -literal -offset indent
5479 call yyy '\ecall xxx' "b\e$'\et'u ' "
5487 (ex or x) Exit from \*(UA without changing the active mailbox and skip
5488 any saving of messages in the
5490 .Sx "secondary mailbox"
5492 as well as a possibly tracked line editor
5495 .Va on-account-cleanup
5496 will be invoked, however.
5497 The optional status number argument will be passed through to
5499 \*(ID For now it can happen that the given status will be overwritten,
5500 later this will only occur if a later error needs to be reported onto an
5501 otherwise success indicating status.
5507 but open the mailbox read-only.
5516 .It Ic filetype , unfiletype
5517 \*(NQ Define, list, and remove, respectively, file handler hooks,
5518 which provide (shell) commands that enable \*(UA to load and save MBOX
5519 files from and to files with the registered file extensions, as shown
5522 The extensions are used case-insensitively, yet the auto-completion
5523 feature of for example
5525 will only work case-sensitively.
5526 An intermediate temporary file will be used to store the expanded data.
5527 The latter command will remove hooks for all given extensions, asterisk
5529 will remove all existing handlers.
5531 When used without arguments the former shows a list of all currently
5532 defined file hooks, with one argument the expansion of the given alias.
5533 Otherwise three arguments are expected, the first specifying the file
5534 extension for which the hook is meant, and the second and third defining
5535 the load- and save commands to deal with the file type, respectively,
5536 both of which must read from standard input and write to standard
5538 Changing hooks will not affect already opened mailboxes (\*(ID except below).
5539 \*(ID For now too much work is done, and files are oftened read in twice
5540 where once would be sufficient: this can cause problems if a filetype is
5541 changed while such a file is opened; this was already so with the
5542 built-in support of .gz etc. in Heirloom, and will vanish in v15.
5543 \*(ID For now all handler strings are passed to the
5544 .Ev SHELL for evaluation purposes; in the future a
5546 prefix to load and save commands may mean to bypass this shell instance:
5547 placing a leading space will avoid any possible misinterpretations.
5548 .Bd -literal -offset indent
5549 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
5550 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
5551 zst 'zstd -dc' 'zstd -19 -zc' \e
5552 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5553 ? set record=+sent.zst.pgp
5558 .It Ic flag , unflag
5559 Take message lists and mark the messages as being flagged, or not being
5560 flagged, respectively, for urgent/special attention.
5562 .Sx "Message states" .
5568 but open the mailbox read-only.
5573 (fold) Open a new, or show status information of the current mailbox.
5574 If an argument is given, changes (such as deletions) will be written
5575 out, a new mailbox will be opened, the internal variables
5576 .Va mailbox-resolved
5579 will be updated, a set according
5581 is executed, and optionally a summary of
5583 is displayed if the variable
5588 .Sx "Filename transformations"
5589 will be applied to the
5593 prefixes are, i.e., URL (see
5594 .Sx "On URL syntax and credential lookup" )
5595 syntax is understood, as in
5596 .Ql mbox:///tmp/somefolder .
5597 If a protocol prefix is used the mailbox type is fixated, otherwise
5598 opening none-existing
5600 uses the protocol defined in
5608 (MBOX database), as well as
5610 (electronic mail message \*(ID read-only) the list of all registered
5612 s is traversed to check whether hooks shall be used to load (and save)
5613 data from (and to) the given
5615 Changing hooks will not affect already opened mailboxes.
5616 For example, the following creates hooks for the
5618 compression tool and a combined compressed and encrypted format:
5620 .Bd -literal -offset indent
5622 gzip 'gzip -dc' 'gzip -c' \e
5623 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
5627 For historic reasons
5629 s provide limited (case-sensitive) auto-completion capabilities.
5634 provided that corresponding handlers are installed.
5635 It will neither find
5639 however, but an explicit
5640 .Ql \&? file mbox.GZ
5641 will find and use the handler for
5643 \*(ID The latter mode can only be used for MBOX files.
5646 EML files consist of only one mail message,
5647 \*(ID and can only be opened read-only.
5648 When reading MBOX files tolerant POSIX rules are used by default.
5649 Invalid message boundaries that can be found quite often in historic
5650 MBOX files will be complained about (even more with
5652 in this case the method described for
5654 can be used to create a valid MBOX database from the invalid input.
5657 MBOX databases and EML files will always be protected via file-region locks
5659 during file operations to protect against concurrent modifications.
5660 .Mx -ix "dotlock files"
5666 .Sx "primary system mailbox"
5667 will also be protected by so-called dotlock files,
5668 the traditional way of mail spool file locking: for any file
5672 will be created during the synchronization, in the same directory and
5673 with the same user and group identities as the file of interest \(em
5674 as necessary created by an external privileged dotlock helper.
5676 disables dotlock files.
5679 .Sx "Howto handle stale dotlock files" .
5682 \*(OP If no protocol has been fixated, and
5684 refers to a directory with the subdirectories
5689 then it is treated as a folder in
5692 The maildir format stores each message in its own file, and has been
5693 designed so that file locking is not necessary when reading or writing
5697 \*(OPally URLs can be used to access network resources, securely via
5698 .Sx "Encrypted network communication" ,
5700 Network communication socket timeouts are configurable via
5701 .Va socket-connect-timeout .
5702 All network traffic may be proxied over a SOCKS server via
5706 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
5707 .Dl \*(OU protocol://[user@]host[:port][/path]
5710 \*(OPally supported network protocols are
5714 (POP3 with TLS encrypted transport),
5720 part is valid only for IMAP; there it defaults to
5722 Network URLs require a special encoding as documented in the section
5723 .Sx "On URL syntax and credential lookup" .
5728 Lists the names of all folders below the given argument or
5730 For file-based protocols
5732 will be used for display purposes.
5736 .It Ic Followup , followup
5737 \*(CM(F,fo) Similar to
5741 respectively, but save the message in a file named after the local part
5742 of the (first) recipient's address, possibly overwriting
5755 but saves the message in a file named after the local part of the
5756 recipient's address (instead of in
5761 \*(CM Take a message list and the address of a recipient, subject to
5763 to whom the messages are sent.
5764 The text of the original message is included in the new one,
5765 enclosed by the values of
5766 .Va forward-inject-head
5768 .Va forward-inject-tail .
5769 .Va content-description-forwarded-message
5771 The list of included headers can be filtered with the
5773 slot of the white- and blacklisting command
5775 Only the first part of a multipart message is included but for
5776 .Va forward-as-attachment .
5778 This may generate the errors
5779 .Va ^ERR Ns -DESTADDRREQ
5780 if no receiver has been specified, or was rejected by
5784 if an I/O error occurs,
5786 if a necessary character set conversion fails, and
5789 It can also fail with errors of
5790 .Sx "Specifying messages" .
5791 Any error stops processing of further messages.
5795 (f) Takes a list of message specifications and displays a summary of
5796 their message headers, exactly as via
5798 making the first message of the result the new
5800 (the last message if
5803 An alias of this command is
5806 .Sx "Specifying messages" .
5817 \*(OB Superseded by the multiplexer
5821 \*(OB Superseded by the multiplexer
5824 .It Ic ghost , unghost
5827 .Ic uncommandalias .
5831 .It Ic headerpick , unheaderpick
5832 \*(NQ Multiplexer command to manage white- and blacklisting
5833 selections of header fields for a variety of applications.
5834 Without arguments the set of contexts that have settings is displayed.
5835 When given arguments, the first argument is the context to which the
5836 command applies, one of (case-insensitive)
5838 for display purposes (for example
5841 for selecting which headers shall be stored persistently when
5847 ing messages (note that MIME related etc. header fields should not be
5848 ignored in order to not destroy usability of the message in this case),
5850 for stripping down messages when
5852 ing message (has no effect if
5853 .Va forward-as-attachment
5856 for defining user-defined set of fields for the command
5859 The current settings of the given context are displayed if it is the
5861 A second argument denotes the type of restriction that is to be chosen,
5862 it may be (a case-insensitive prefix of)
5866 for white- and blacklisting purposes, respectively.
5867 Establishing a whitelist suppresses inspection of the corresponding
5870 If no further argument is given the current settings of the given type
5871 will be displayed, otherwise the remaining arguments specify header
5872 fields, which \*(OPally may be given as regular expressions, to be added
5874 The special wildcard field (asterisk,
5876 will establish a (fast) shorthand setting which covers all fields.
5878 The latter command always takes three or more arguments and can be used
5879 to remove selections, i.e., from the given context, the given type of
5880 list, all the given headers will be removed, the special argument
5882 will remove all headers.
5886 (h) Show the current group of headers, the size of which depends on
5889 in interactive mode, and the format of which can be defined with
5891 If a message-specification is given the group of headers containing the
5892 first message therein is shown and the message at the top of the screen
5895 the last message is targeted if
5906 \*(OP Without arguments or when given
5908 all history entries are shown (this mode also supports a more
5912 will replace the list of entries with the content of
5916 will dump the current list to said file, replacing former content.
5918 will delete all history entries.
5919 The argument can also be a signed decimal
5921 which will select and evaluate the respective history entry, and move it
5922 to the top of the history; a negative number is used as an offset to the
5923 current command so that
5925 will select the last command, the history top.
5926 An entry may be deleted by giving
5931 .Sx "On terminal control and line editor" .
5937 Takes a message list and marks each message therein to be saved in the
5942 .Sx "secondary mailbox"
5944 Does not override the
5947 \*(UA deviates from the POSIX standard with this command, because a
5949 command issued after
5951 will display the following message, not the current one.
5957 .Ic \&\&if , Ic elif , else , endif
5958 conditional execution construct \(em if the given condition is true then
5959 the encapsulated block is executed.
5960 The POSIX standard only supports the (case-insensitive) conditions
5965 end, the remaining are non-portable extensions.
5966 \*(ID In conjunction with the
5969 .Sx "Shell-style argument quoting"
5970 and more test operators are available.
5972 .Bd -literal -offset indent
5981 Further (case-insensitive) one-argument conditions are
5983 erminal which evaluates to true in interactive terminal sessions
5984 (running with standard input or standard output attached to a terminal,
5987 command line options
5992 have been used), as well as any boolean value (see
5993 .Sx "INTERNAL VARIABLES"
5994 for textual boolean representations) to mark an enwrapped block as
5997 .Dq always execute .
5998 (Remarks: condition syntax errors skip all branches until
6004 It is possible to check
6005 .Sx "INTERNAL VARIABLES"
6008 variables for existence or compare their expansion against a user given
6009 value or another variable by using the
6011 .Pf ( Dq variable next )
6012 conditional trigger character;
6013 a variable on the right hand side may be signalled using the same
6015 Variable names may be enclosed in a pair of matching braces.
6016 When this mode has been triggered, several operators are available
6019 they are always available, and there is no trigger: variables will have
6020 been expanded by the shell-compatible parser before the
6022 etc. command sees them).
6025 \*(IN Two argument conditions.
6026 Variables can be tested for existence and expansion:
6028 will test whether the given variable exists, so that
6030 will evaluate to true when
6035 .Ql -n """$editalong"""
6036 will be true if the variable is set and expands to a non-empty string,
6037 .Ql -z $'\e$editalong'
6038 only if the expansion is empty, whether the variable exists or not.
6039 The remaining conditions take three arguments.
6042 Integer operators treat the arguments on the left and right hand side of
6043 the operator as integral numbers and compare them arithmetically.
6044 It is an error if any of the operands is not a valid integer, an empty
6045 argument (which implies it had been quoted) is treated as if it were 0.
6046 Via the question mark
6048 modifier suffix a saturated operation mode is available where numbers
6049 will linger at the minimum or maximum possible value, instead of
6050 overflowing (or trapping), the keyword
6057 are therefore identical.
6058 Available operators are
6062 (less than or equal to),
6068 (greater than or equal to), and
6073 String and regular expression data operators compare the left and right
6074 hand side according to their textual content.
6075 Unset variables are treated as the empty string.
6076 Via the question mark
6078 modifier suffix a case-insensitive operation mode is available, the keyword
6087 Available string operators are
6091 (less than or equal to),
6097 (greater than or equal to),
6101 (is substring of) and
6103 (is not substring of).
6104 By default these operators work on bytes and (therefore) do not take
6105 into account character set specifics.
6106 If the case-insensitivity modifier has been used, case is ignored
6107 according to the rules of the US-ASCII encoding, i.e., bytes are
6111 When the \*(OPal regular expression support is available, the additional
6117 They treat the right hand side as an extended regular expression that is
6118 matched according to the active locale (see
6119 .Sx "Character sets" ) ,
6120 i.e., character sets should be honoured correctly.
6123 Conditions can be joined via AND-OR lists (where the AND operator is
6125 and the OR operator is
6127 which have equal precedence and will be evaluated with left
6128 associativity, thus using the same syntax that is known for the
6130 It is also possible to form groups of conditions and lists by enclosing
6131 them in pairs of brackets
6132 .Ql [\ \&.\&.\&.\ ] ,
6133 which may be interlocked within each other, and also be joined via
6137 The results of individual conditions and entire groups may be modified
6138 via unary operators: the unary operator
6140 will reverse the result.
6142 .Bd -literal -offset indent
6143 wysh set v15-compat=yes # with value: automatic "wysh"!
6144 if -N debug;echo *debug* set;else;echo not;endif
6145 if [ "$ttycharset" == UTF-8 ] || \e
6146 [ "$ttycharset" ==?case UTF8 ]
6147 echo *ttycharset* is UTF-8, the former case-sensitive!
6150 if [ "${t1}" == "${t2}" ]
6151 echo These two variables are equal
6153 if "$features" =% +regex && "$TERM" =~?case "^xterm\&.*"
6154 echo ..in an X terminal
6156 if [ [ true ] && [ [ "${debug}" != '' ] || \e
6157 [ "$verbose" != '' ] ] ]
6160 if true && [ -n "$debug" || -n "${verbose}" ]
6161 echo Left associativity, as is known from the shell
6170 Superseded by the multiplexer
6175 Shows the names of all available commands, in command lookup order.
6176 \*(OP In conjunction with a set variable
6178 additional information will be provided for each command: the argument
6179 type will be indicated, the documentation string will be shown,
6180 and the set of command flags will show up:
6182 .Bl -tag -compact -width ".It Ql NEEDS_BOX"
6184 command supports the command modifier
6187 command supports the command modifier
6190 the error number is tracked in
6193 whether the command needs an active mailbox, a
6196 indicators whether command is \&.\h'.3m'.\h'.3m'.
6197 .Bl -tag -compact -width ".It Ql SUBPROCESS"
6198 .It Ql batch/interactive
6199 usable in interactive or batch mode
6202 usable in send mode.
6204 allowed to be used when running in a subprocess instance,
6205 for example from within a macro that is called via
6206 .Va on-compose-splice .
6209 indicators whether command is not \&.\h'.3m'.\h'.3m'.
6210 .Bl -tag -compact -width ".It Ql COMPOSE_MODE"
6212 available in compose mode.
6214 available during program startup, like in
6215 .Sx "Resource files" .
6218 The command produces
6227 Enforce change localization of
6232 .Sx "INTERNAL VARIABLES" ,
6233 meaning that their state will be reverted to the former one once the
6236 Just like the command modifier
6238 which provides block-scope localization for some commands (instead),
6239 it can only be used inside of macro definition blocks introduced by
6243 The covered scope of an
6245 is left once a different account is activated, and some macros, notably
6246 .Va folder-hook Ns s ,
6247 use their own specific notion of covered scope, here it will be extended
6248 until the folder is left again.
6251 This setting stacks up: i.e., if
6253 enables change localization and calls
6255 which explicitly resets localization, then any value changes within
6257 will still be reverted when the scope of
6260 (Caveats: if in this example
6262 changes to a different
6264 which sets some variables that are already covered by localizations,
6265 their scope will be extended, and in fact leaving the
6267 will (thus) restore settings in (likely) global scope which actually
6268 were defined in a local, macro private context!)
6271 This command takes one or two arguments, the optional first one
6272 specifies an attribute that may be one of
6274 which refers to the current scope and is thus the default,
6276 which causes any macro that is being
6278 ed to be started with localization enabled by default, as well as
6280 which (if enabled) disallows any called macro to turn off localization:
6281 like this it can be ensured that once the current scope regains control,
6282 any changes made in deeper levels have been reverted.
6283 The latter two are mutually exclusive, and neither affects
6285 The (second) argument is interpreted as a boolean (string, see
6286 .Sx "INTERNAL VARIABLES" )
6287 and states whether the given attribute shall be turned on or off.
6289 .Bd -literal -offset indent
6290 define temporary_settings {
6291 set possibly_global_option1
6293 set localized_option1
6294 set localized_option2
6296 set possibly_global_option2
6303 .It Ic Lfollowup , Lreply
6304 \*(CM Reply to messages that come in via known
6307 .Pf ( Ic mlsubscribe )
6308 mailing lists, or pretend to do so (see
6309 .Sx "Mailing lists" ) :
6314 respectively, functionality this will actively resort and even remove
6315 message recipients in order to generate a message that is supposed to be
6316 sent to a mailing list.
6317 For example it will also implicitly generate a
6318 .Ql Mail-Followup-To:
6319 header if that seems useful, regardless of the setting of the variable
6321 For more documentation please refer to
6322 .Sx "On sending mail, and non-interactive mode" .
6324 This may generate the errors
6325 .Va ^ERR Ns -DESTADDRREQ
6326 if no receiver has been specified,
6328 if some addressees where rejected by
6331 if an I/O error occurs,
6333 if a necessary character set conversion fails, and
6336 It can also fail with errors of
6337 .Sx "Specifying messages" .
6338 Occurrence of some of the errors depend on the value of
6340 Any error stops processing of further messages.
6346 but saves the message in a file named after the local part of the first
6347 recipient's address (instead of in
6352 \*(CM(m) Takes a (list of) recipient address(es) as (an) argument(s),
6353 or asks on standard input if none were given;
6354 then collects the remaining mail content and sends it out.
6355 Unless the internal variable
6357 is set recipient addresses will be stripped from comments, names etc.
6358 For more documentation please refer to
6359 .Sx "On sending mail, and non-interactive mode" .
6361 This may generate the errors
6362 .Va ^ERR Ns -DESTADDRREQ
6363 if no receiver has been specified,
6365 if some addressees where rejected by
6368 if multiple messages have been specified,
6370 if an I/O error occurs,
6372 if a necessary character set conversion fails, and
6375 It can also fail with errors of
6376 .Sx "Specifying messages" .
6377 Occurrence of some of the errors depend on the value of
6382 \*(OP When used without arguments or if
6384 has been given the content of
6385 .Sx "The Mailcap files"
6386 cache is shown, (re-)initializing it first (as necessary.
6389 then the cache will only be (re-)initialized, and
6391 will remove its contents.
6392 Note that \*(UA will try to load the files only once, use
6393 .Ql Ic \&\&mailcap Ns \:\0\:clear
6394 to unlock further attempts.
6395 Loading and parsing can be made more
6400 (mb) The given message list is to be sent to the
6402 .Sx "secondary mailbox"
6404 when \*(UA is quit; this is the default action unless the variable
6407 \*(ID This command can only be used in a
6409 .Sx "primary system mailbox" .
6413 .It Ic mimetype , unmimetype
6414 \*(NQ Without arguments the content of the MIME type cache will displayed;
6415 a more verbose listing will be produced if either of
6420 When given arguments they will be joined, interpreted as shown in
6421 .Sx "The mime.types files"
6423 .Sx "HTML mail and MIME attachments" ) ,
6424 and the resulting entry will be added (prepended) to the cache.
6425 In any event MIME type sources are loaded first as necessary \(en
6426 .Va mimetypes-load-control
6427 can be used to fine-tune which sources are actually loaded.
6429 The latter command deletes all specifications of the given MIME type, thus
6430 .Ql \&? unmimetype text/plain
6431 will remove all registered specifications for the MIME type
6435 will discard all existing MIME types, just as will
6437 but which also reenables cache initialization via
6438 .Va mimetypes-load-control .
6442 \*(ID Only available in interactive mode, this command allows execution
6443 of external MIME type handlers which do not integrate into the normal
6446 .Sx "HTML mail and MIME attachments" ) .
6447 (\*(ID No syntax to directly address parts, this restriction may vanish.)
6448 The user will be asked for each non-text part of the given message in
6449 turn whether the registered handler shall be used to display the part.
6453 .It Ic mlist , unmlist
6454 \*(NQ Manage the list of known
6455 .Sx "Mailing lists" ;
6456 subscriptions are controlled via
6458 The latter command deletes all given arguments,
6459 or all at once when given the asterisk
6461 The former shows the list of all currently known lists if used
6462 without arguments, otherwise the given arguments will become known.
6463 \*(OP In the latter case, arguments which contain any of the
6465 .Sx "magic regular expression characters"
6466 will be interpreted as one, possibly matching many addresses;
6467 these will be sequentially matched via linked lists instead of being
6468 looked up in a dictionary.
6472 .It Ic mlsubscribe , unmlsubscribe
6473 Building upon the command pair
6474 .Ic mlist , unmlist ,
6475 but only managing the subscription attribute of mailing lists.
6476 (The former will also create not yet existing mailing lists.)
6482 but move the messages to a file named after the local part of the
6483 sender of the first message instead of taking a filename argument;
6485 is inspected to decide on the actual storage location.
6491 but marks the messages for deletion if they were transferred
6498 but also displays header fields which would not pass the
6500 selection, and all MIME parts.
6508 on the given messages, even in non-interactive mode and as long as the
6509 standard output is a terminal.
6515 \*(OP When used without arguments or if
6517 has been given the content of the
6519 cache is shown, (re-)initializing it first (as necessary).
6522 then the cache will only be (re-)initialized, and
6524 will remove its contents.
6528 \*(OP When used without arguments, or when the argument was
6532 cache is shown, initializing it as necessary.
6535 then the cache will be (re)loaded, whereas
6538 Loading and parsing can be made more
6541 will query the cache for the URL given as the second argument
6542 .Pf ( Ql [USER@]HOST ) .
6547 .Sx "On URL syntax and credential lookup" ;
6549 .Sx "The .netrc file"
6550 documents the file format in detail.
6554 Checks for new mail in the current folder without committing any changes
6556 If new mail is present, a message is shown.
6560 the headers of each new message are also shown.
6561 This command is not available for all mailbox types.
6569 Goes to the next message in sequence and types it.
6570 With an argument list, types the next matching message.
6584 If the current folder is accessed via a network connection, a
6586 command is sent, otherwise no operation is performed.
6592 but also displays header fields which would not pass the
6594 selection, and all MIME parts.
6602 on the given messages, even in non-interactive mode and as long as the
6603 standard output is a terminal.
6611 but also pipes header fields which would not pass the
6613 selection, and all parts of MIME
6614 .Ql multipart/alternative
6619 (pi) Takes an optional message list and shell command (that defaults to
6621 and pipes the messages through the command.
6625 every message is followed by a formfeed character.
6646 (q) Terminates the session, saving all undeleted, unsaved messages in
6649 .Sx "secondary mailbox"
6651 preserving all messages marked with
6655 or never referenced in the system
6657 and removing all other messages from the
6659 .Sx "primary system mailbox" .
6660 If new mail has arrived during the session,
6662 .Dq You have new mail
6664 If given while editing a mailbox file with the command line option
6666 then the edit file is rewritten.
6667 A return to the shell is effected,
6668 unless the rewrite of edit file fails,
6669 in which case the user can escape with the exit command.
6670 The optional status number argument will be passed through to
6672 \*(ID For now it can happen that the given status will be overwritten,
6673 later this will only occur if a later error needs to be reported onto an
6674 otherwise success indicating status.
6678 \*(NQ Read a line from standard input, or the channel set active via
6680 and assign the data, which will be split as indicated by
6682 to the given variables.
6683 The variable names are checked by the same rules as documented for
6685 and the same error codes will be seen in
6689 indicates the number of bytes read, it will be
6691 with the error number
6695 in case of I/O errors, or
6698 If there are more fields than variables, assigns successive fields to the
6699 last given variable.
6700 If there are less fields than variables, assigns the empty string to the
6702 .Bd -literal -offset indent
6705 ? echo "<$a> <$b> <$c>"
6707 ? wysh set ifs=:; read a b c;unset ifs
6708 hey2.0,:"'you ",:world!:mars.:
6709 ? echo $?/$^ERRNAME / <$a><$b><$c>
6710 0/NONE / <hey2.0,><"'you ",><world!:mars.:><><>
6717 but splits on shell token boundaries (see
6718 .Sx "Shell-style argument quoting" )
6721 \*(ID Could become a
6724 .Ql read --tokenize -- .
6728 \*(NQ Read anything from standard input, or the channel set active via
6730 and assign the data to the given variable.
6731 The variable name is checked by the same rules as documented for
6733 and the same error codes will be seen in
6737 indicates the number of bytes read, it will be
6739 with the error number
6743 in case of I/O errors, or
6746 \*(ID The input data length is restricted to 31-bits.
6750 \*(NQ Manages input channels for
6755 to be used to avoid complicated or impracticable code, like calling
6757 from within a macro in non-interactive mode.
6758 Without arguments, or when the first argument is
6760 a listing of all known channels is printed.
6761 Channels can otherwise be
6763 d, and existing channels can be
6767 d by giving the string used for creation.
6769 The channel name is expected to be a file descriptor number, or,
6770 if parsing the numeric fails, an input file name that undergoes
6771 .Sx "Filename transformations" .
6772 For example (this example requires a modern shell):
6773 .Bd -literal -offset indent
6774 $ printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
6777 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
6778 LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
6784 \*(NQ Removes the named files or directories.
6785 If a name refers to a mailbox, say a Maildir mailbox, then a mailbox
6786 type specific removal will be performed, deleting the complete mailbox.
6787 In interactive mode the user is asked for confirmation.
6791 \*(NQ Takes the name of an existing folder
6792 and the name for the new folder
6793 and renames the first to the second one.
6794 .Sx "Filename transformations"
6795 including shell pathname wildcard pattern expansions
6797 are performed on both arguments.
6798 Both folders must be of the same type.
6802 .It Ic Reply , Respond
6803 \*(CM(R) Identical to
6805 except that it replies to only the sender of each message of the given
6806 list, by using the first message as the template to quote, for the
6810 will exchange this command with
6815 .It Ic reply , respond
6816 \*(CM(r) Take a message (list) and group-respond (to each in turn)
6817 by addressing the sender and all recipients, subject to
6823 .Va followup-to-honour ,
6826 .Va recipients-in-cc
6827 influence response behaviour.
6830 .Va quote-as-attachment
6831 configure whether responded-to message shall be quoted etc.,
6832 .Va content-description-quote-attachment
6836 will exchange this command with
6840 offers special support for replying to mailing lists.
6841 For more documentation please refer to
6842 .Sx "On sending mail, and non-interactive mode" .
6844 This may generate the errors
6845 .Va ^ERR Ns -DESTADDRREQ
6846 if no receiver has been specified, or was rejected by
6850 if an I/O error occurs,
6852 if a necessary character set conversion fails, and
6855 It can also fail with errors of
6856 .Sx "Specifying messages" .
6857 Any error stops processing of further messages.
6863 but does not add any header lines.
6864 This is not a way to hide the sender's identity,
6865 but useful for sending a message again to the same recipients.
6869 Takes a list of messages and a name,
6870 and sends each message to the given addressee, which is subject to
6873 and related header fields are prepended to the new copy of the message.
6876 is only performed if
6879 \*(ID\*(CM is not entered, the only supported hooks are
6882 .Va on-resend-cleanup .
6884 This may generate the errors
6885 .Va ^ERR Ns -DESTADDRREQ
6886 if no receiver has been specified, or was rejected by
6890 if an I/O error occurs,
6892 if a necessary character set conversion fails, and
6895 It can also fail with errors of
6896 .Sx "Specifying messages" .
6897 Any error stops processing of further messages.
6901 (ret) Superseded by the multiplexer
6906 Only available inside of a
6910 this command returns control of execution to the outer scope.
6911 The two optional parameters are positive decimal numbers and default to 0:
6912 the first specifies the 32-bit return value (stored in
6914 \*(ID and later extended to 64-bit),
6915 the second the 32-bit error number (stored in
6919 a non-0 exit status may cause the program to exit.
6925 but saves the messages in a file named after the local part of the
6926 sender of the first message instead of taking a filename argument;
6928 is inspected to decide on the actual storage location.
6932 (s) Takes a message list and a filename and appends each message in turn
6933 to the end of the file.
6934 .Sx "Filename transformations"
6935 including shell pathname wildcard pattern expansions
6937 is performed on the filename.
6938 If no filename is given, the
6940 .Sx "secondary mailbox"
6943 The filename in quotes, followed by the generated character count
6944 is echoed on the user's terminal.
6947 .Sx "primary system mailbox"
6948 the messages are marked for deletion.
6949 To filter the saved header fields to the desired subset use the
6951 slot of the white- and blacklisting command
6957 \*(OB Superseded by the multiplexer
6961 \*(OB Superseded by the multiplexer
6965 \*(OB Superseded by the multiplexer
6970 Takes a message specification (list) and displays a header summary of
6971 all matching messages, as via
6973 This command is an alias of
6976 .Sx "Specifying messages" .
6980 Takes a message list and marks all messages as having been read.
6986 (se, \*(NQ uns) The latter command will delete all given global
6987 variables, or only block-scope local ones if the
6989 command modifier has been used.
6990 The former, when used without arguments, will show all
6991 currently known variables, being more verbose if either of
6996 Remarks: this list mode will not automatically link-in known
6998 variables, but only explicit addressing will do so, examples are
7000 using a variable in an
7002 condition or a string passed to
7006 ting, as well as some program-internal use cases.
7009 Otherwise the given variables (and arguments) are set or adjusted.
7010 Arguments are of the form
7012 (no space before or after
7016 if there is no value, i.e., a boolean variable.
7017 If a name begins with
7021 the effect is the same as invoking the
7023 command with the remaining part of the variable
7024 .Pf ( Ql unset save ) .
7025 \*(ID In conjunction with the
7027 .Pf (or\0 Cm local )
7029 .Sx "Shell-style argument quoting"
7030 can be used to quote arguments as necessary.
7031 \*(ID Otherwise quotation marks may be placed around any part of the
7032 assignment statement to quote blanks or tabs.
7035 When operating in global scope any
7037 that is known to map to an environment variable will automatically cause
7038 updates in the program environment (unsetting a variable in the
7039 environment requires corresponding system support) \(em use the command
7041 for further environmental control.
7042 If the command modifier
7044 has been used to alter the command to work in block-scope all variables
7045 have values (may they be empty), and creation of names which shadow
7046 .Sx "INTERNAL VARIABLES"
7047 is actively prevented (\*(ID shadowing of linked
7049 variables and free-form versions of variable chains is not yet detected).
7053 .Sx "INTERNAL VARIABLES"
7057 .Bd -literal -offset indent
7058 ? wysh set indentprefix=' -> '
7059 ? wysh set atab=$'\t' aspace=' ' zero=0
7065 Apply shell quoting rules to the given raw-data arguments.
7069 .Sx "Command modifiers" ) .
7070 The first argument specifies the operation:
7074 cause shell quoting to be applied to the remains of the line, and
7075 expanded away thereof, respectively.
7076 If the former is prefixed with a plus-sign, the quoted result will not
7077 be roundtrip enabled, and thus can be decoded only in the very same
7078 environment that was used to perform the encode; also see
7079 .Cd mle-quote-rndtrip .
7080 If the coding operation fails the error number
7083 .Va ^ERR Ns -CANCELED ,
7084 and the unmodified input is used as the result; the error number may
7085 change again due to output or result storage errors.
7089 \*(NQ (sh) Invokes an interactive version of the shell,
7090 and returns its exit status.
7094 .It Ic shortcut , unshortcut
7095 \*(NQ Manage the file- or pathname shortcuts as documented for
7097 The latter command deletes all shortcuts given as arguments,
7098 or all at once when given the asterisk
7100 The former shows the list of all currently defined shortcuts if used
7101 without arguments, the target of the given with a single argument.
7102 Otherwise arguments are treated as pairs of shortcuts and their desired
7103 expansion, creating new or updating already existing ones.
7107 \*(NQ Shift the positional parameter stack (starting at
7109 by the given number (which must be a positive decimal),
7110 or 1 if no argument has been given.
7111 It is an error if the value exceeds the number of positional parameters.
7112 If the given number is 0, no action is performed, successfully.
7113 The stack as such can be managed via
7115 Note this command will fail in
7117 and hook macros unless the positional parameter stack has been
7118 explicitly created in the current context via
7125 but performs neither MIME decoding nor decryption, so that the raw
7126 message text is shown.
7130 (si) Shows the size in characters of each message of the given
7135 \*(NQ Sleep for the specified number of seconds (and optionally
7136 milliseconds), by default interruptible.
7137 If a third argument is given the sleep will be uninterruptible,
7138 otherwise the error number
7142 if the sleep has been interrupted.
7143 The command will fail and the error number will be
7144 .Va ^ERR Ns -OVERFLOW
7145 if the given duration(s) overflow the time datatype, and
7147 if the given durations are no valid integers.
7152 .It Ic sort , unsort
7153 The latter command disables sorted or threaded mode, returns to normal
7154 message order and, if the
7157 displays a header summary.
7158 The former command shows the current sorting criterion when used without
7159 an argument, but creates a sorted representation of the current folder
7160 otherwise, and changes the
7162 command and the addressing modes such that they refer to messages in
7164 Message numbers are the same as in regular mode.
7168 a header summary in the new order is also displayed.
7169 Automatic folder sorting can be enabled by setting the
7172 .Ql set autosort=thread .
7173 Possible sorting criterions are:
7176 .Bl -tag -compact -width "subject"
7178 Sort the messages by their
7180 field, that is by the time they were sent.
7182 Sort messages by the value of their
7184 field, that is by the address of the sender.
7187 variable is set, the sender's real name (if any) is used.
7189 Sort the messages by their size.
7191 \*(OP Sort the message by their spam score, as has been classified by
7194 Sort the messages by their message status.
7196 Sort the messages by their subject.
7198 Create a threaded display.
7200 Sort messages by the value of their
7202 field, that is by the address of the recipient.
7205 variable is set, the recipient's real name (if any) is used.
7211 \*(NQ (so) The source command reads commands from the given file.
7212 .Sx "Filename transformations"
7214 If the given expanded argument ends with a vertical bar
7216 then the argument will instead be interpreted as a shell command and
7217 \*(UA will read the output generated by it.
7218 Dependent on the settings of
7222 and also dependent on whether the command modifier
7224 had been used, encountering errors will stop sourcing of the given input.
7227 cannot be used from within macros that execute as
7228 .Va folder-hook Ns s
7231 i.e., it can only be called from macros that were
7236 \*(NQ The difference to
7238 (beside not supporting pipe syntax aka shell command input) is that
7239 this command will not generate an error nor warn if the given file
7240 argument cannot be opened successfully.
7244 \*(OP Takes a list of messages and clears their
7250 \*(OP Takes a list of messages and causes the
7252 to forget it has ever used them to train its Bayesian filter.
7253 Unless otherwise noted the
7255 flag of the message is inspected to chose whether a message shall be
7263 \*(OP Takes a list of messages and informs the Bayesian filter of the
7267 This also clears the
7269 flag of the messages in question.
7273 \*(OP Takes a list of messages and rates them using the configured
7274 .Va spam-interface ,
7275 without modifying the messages, but setting their
7277 flag as appropriate; because the spam rating headers are lost the rate
7278 will be forgotten once the mailbox is left.
7279 Refer to the manual section
7281 for the complete picture of spam handling in \*(UA.
7285 \*(OP Takes a list of messages and sets their
7291 \*(OP Takes a list of messages and informs the Bayesian filter of the
7297 flag of the messages in question.
7309 \*(NQ TLS information and management command multiplexer to aid in
7310 .Sx "Encrypted network communication" ,
7311 mostly available only if the term
7317 if so documented (see
7318 .Sx "Command modifiers" ) .
7319 The result that is shown in case of errors is always the empty string,
7320 errors can be identified via the error number
7322 For example, string length overflows are caught and set
7325 .Va ^ERR Ns -OVERFLOW .
7326 The TLS configuration is honoured, especially
7329 .Bd -literal -offset indent
7330 ? vput tls result fingerprint pop3s://ex.am.ple
7331 ? echo $?/$!/$^ERRNAME: $result
7334 .Bl -hang -width ".It Cm random"
7336 Show the complete verified peer certificate chain.
7337 Includes informational fields in conjunction with
7340 Show only the peer certificate, without any signers.
7341 Includes informational fields in conjunction with
7345 .Va tls-fingerprint-digest Ns
7346 ed fingerprint of the certificate of the given HOST
7347 .Pf ( Ql server:port ,
7348 where the port defaults to the HTTPS port, 443).
7350 is actively ignored for the runtime of this command.
7361 slot for white- and blacklisting header fields.
7365 (to) Takes a message list and types out the first
7367 lines of each message on the user's terminal.
7368 Unless a special selection has been established for the
7372 command, the only header fields that are displayed are
7383 It is possible to apply compression to what is displayed by setting
7385 Messages are decrypted and converted to the terminal character set
7390 (tou) Takes a message list and marks the messages for saving in the
7392 .Sx "secondary mailbox"
7394 \*(UA deviates from the POSIX standard with this command,
7397 command will display the following message instead of the current one.
7403 but also displays header fields which would not pass the
7405 selection, and all visualizable parts of MIME
7406 .Ql multipart/alternative
7411 (t) Takes a message list and types out each message on the user's terminal.
7412 The display of message headers is selectable via
7414 For MIME multipart messages, all parts with a content type of
7416 all parts which have a registered MIME type handler (see
7417 .Sx "HTML mail and MIME attachments" )
7418 which produces plain text output, and all
7420 parts are shown, others are hidden except for their headers.
7421 Messages are decrypted and converted to the terminal character set
7425 can be used to display parts which are not displayable as plain text.
7468 \*(OB Superseded by the multiplexer
7472 \*(OB Superseded by the multiplexer
7477 Superseded by the multiplexer
7488 .It Ic unmlsubscribe
7499 Takes a message list and marks each message as not having been read.
7503 Superseded by the multiplexer
7507 \*(OB Superseded by the multiplexer
7511 \*(OB Superseded by the multiplexer
7533 Perform URL percent codec operations on the raw-data argument, rather
7534 according to RFC 3986.
7535 The first argument specifies the operation:
7539 perform plain URL percent en- and decoding, respectively.
7543 perform a slightly modified operation which should be better for
7544 pathnames: it does not allow a tilde
7546 and will neither accept hyphen-minus
7550 as an initial character.
7551 The remains of the line form the URL data which is to be converted.
7552 This is a character set agnostic operation,
7553 and it may thus decode bytes which are invalid in the current
7559 .Sx "Command modifiers" ) ,
7560 and manages the error number
7562 If the coding operation fails the error number
7565 .Va ^ERR Ns -CANCELED ,
7566 and the unmodified input is used as the result; the error number may
7567 change again due to output or result storage errors.
7568 \*(ID This command does not know about URLs beside what is documented.
7572 subcommand, shall the URL be displayed.)
7576 \*(NQ This command produces the same output as the listing mode of
7580 ity adjustments, but only for the given variables.
7584 \*(OP Takes a message list and verifies each message.
7585 If a message is not a S/MIME signed message,
7586 verification will fail for it.
7587 The verification process checks if the message was signed using a valid
7589 if the message sender's email address matches one of those contained
7590 within the certificate,
7591 and if the message content has been altered.
7599 of \*(UA, optionally in a more
7601 form which also includes the build and running system environment.
7602 This command supports
7605 .Sx "Command modifiers" ) .
7610 \*(NQ A multiplexer command which offers signed 64-bit numeric
7611 calculations, as well as other, mostly string-based operations.
7612 C-style byte string operations are available via
7614 The first argument defines the number, type, and meaning of the
7615 remaining arguments.
7616 An empty number argument is treated as 0.
7620 .Sx "Command modifiers" ) .
7621 The result shown in case of errors is
7623 for usage errors and numeric operations, the empty string otherwise;
7625 errors, like when a search operation failed, will also set the
7628 .Va ^ERR Ns -NODATA .
7629 Except when otherwise noted numeric arguments are parsed as signed 64-bit
7630 numbers, and errors will be reported in the error number
7632 as the numeric error
7633 .Va ^ERR Ns -RANGE .
7636 Numeric operations work on one or two signed 64-bit integers.
7637 Numbers prefixed with
7641 are interpreted as hexadecimal (base 16) numbers, whereas
7643 indicates octal (base 8), and
7647 denote binary (base 2) numbers.
7648 It is possible to use any base in between 2 and 36, inclusive, with the
7650 notation, where the base is given as an unsigned decimal number, so
7652 is a different way of specifying a hexadecimal number.
7653 Unsigned interpretation of a number can be enforced by prefixing an
7655 (case-insensitively), as in
7657 this is not necessary for power-of-two bases (2, 4, 8, 16 and 32),
7658 which will be interpreted as unsigned by default, but it still makes
7659 a difference regarding overflow detection and overflow constant.
7660 It is possible to enforce signed interpretation by (instead) prefixing a
7662 (case-insensitively).
7663 The number sign notation uses a permissive parse mode and as such
7664 supports complicated conditions out of the box:
7665 .Bd -literal -offset indent
7666 ? wysh set ifs=:;read i;unset ifs;echo $i;vexpr pb 2 10#$i
7673 One integer is expected by assignment (equals sign
7675 which does nothing but parsing the argument, thus detecting validity and
7676 possible overflow conditions, unary not (tilde
7678 which creates the bitwise complement, and unary plus and minus.
7679 Two integers are used by addition (plus sign
7681 subtraction (hyphen-minus
7683 multiplication (asterisk
7687 and modulo (percent sign
7689 as well as for the bitwise operators logical or (vertical bar
7692 bitwise and (ampersand
7695 bitwise xor (circumflex
7697 the bitwise signed left- and right shifts
7700 as well as for the unsigned right shift
7704 Another numeric operation is
7706 which takes a number base in between 2 and 36, inclusive, and will act
7707 on the second number given just the same as what equals sign
7709 does, but the number result will be formatted in the base given, as
7710 a signed 64-bit number unless unsigned interpretation of the input
7711 number had been forced (with an u prefix).
7714 Numeric operations support a saturated mode via the question mark
7716 modifier suffix; the keyword
7723 are therefore identical.
7724 In saturated mode overflow errors and division and modulo by zero are no
7725 longer reported via the exit status, but the result will linger at the
7726 minimum or maximum possible value, instead of overflowing (or trapping).
7727 This is true also for the argument parse step.
7728 For the bitwise shifts, the saturated maximum is 63.
7729 Any caught overflow will be reported via the error number
7732 .Va ^ERR Ns -OVERFLOW .
7734 .Bd -literal -offset indent
7735 ? vput vexpr res -? +1 -9223372036854775808
7736 ? echo $?/$!/$^ERRNAME:$res
7737 0/75/OVERFLOW:-9223372036854775808
7741 Character set agnostic string functions have no notion of locale
7742 settings and character sets.
7744 .Bl -hang -width ".It Cm random"
7746 Outputs the current date and time in UTC (Coordinated Universal Time)
7747 with values named such that
7748 .Ql vput vexpr x date-utc; eval wysh set $x
7749 creates accessible variables.
7750 .It Cm date-stamp-utc
7751 Outputs a RFC 3339 internet date/time format of UTC.
7753 The seconds and nanoseconds since the Unix epoch (1970-01-01T00:00:00)
7759 .Ql vput vexpr x epoch; eval wysh set $x
7760 creates accessible variables.
7763 .Sx "Filename transformations"
7765 .It Cm file-stat , file-lstat
7767 .Sx "Filename transformations"
7768 on the argument, then call
7772 respectively, and output values such that
7773 .Ql vput vexpr x file-stat FILE; eval wysh set $x
7774 creates accessible variables.
7779 to denote directories, commercial at
7781 for links, number sign
7783 for block devices, percent sign
7785 for for character devices, vertical bar
7787 for FIFOs, equal sign
7789 for sockets, and the period
7793 Generates a random string of the given length, or of
7795 bytes (a constant from
7797 if the value 0 is given; the random string will be base64url encoded
7798 according to RFC 4648, and thus be usable as a (portable) filename.
7802 String operations work, sufficient support provided, according to the
7803 active user's locale encoding and character set (see
7804 .Sx "Character sets" ) .
7805 Where the question mark
7807 modifier suffix is supported, a case-insensitive operation mode is
7808 available; the keyword
7814 are therefore identical.
7816 .Bl -hang -width ".It Cm regex"
7818 (One-way) Converts the argument to something safely printable on the
7822 \*(OP A string operation that will try to match the first argument with
7823 the regular expression given as the second argument.
7825 modifier suffix is supported.
7826 If the optional third argument has been given then instead of showing
7827 the match offset a replacement operation is performed: the third
7828 argument is treated as if specified within dollar-single-quote (see
7829 .Sx "Shell-style argument quoting" ) ,
7830 and any occurrence of a positional parameter, for example
7832 etc. is replaced with the according match group of the regular expression:
7833 .Bd -literal -offset indent
7834 ? vput vexpr res regex bananarama \e
7835 (.*)NanA(.*) '\e${1}au\e$2'
7836 ? echo $?/$!/$^ERRNAME:$res:
7838 ? vput vexpr res regex?case bananarama \e
7839 (.*)NanA(.*) '\e${1}uauf\e$2'
7840 ? echo $?/$!/$^ERRNAME:$res:
7841 0/0/NONE:bauauframa:
7848 \*(NQ Manage the positional parameter stack (see
7852 If the first argument is
7854 then the positional parameter stack of the current context, or the
7855 global one, if there is none, is cleared.
7858 then the remaining arguments will be used to (re)create the stack,
7859 if the parameter stack size limit is excessed an
7860 .Va ^ERR Ns -OVERFLOW
7864 If the first argument is
7866 a round-trip capable representation of the stack contents is created,
7867 with each quoted parameter separated from each other with the first
7870 and followed by the first character of
7872 if that is not empty and not identical to the first.
7873 If that results in no separation at all a
7879 .Sx "Command modifiers" ) .
7880 I.e., the subcommands
7884 can be used (in conjunction with
7886 to (re)create an argument stack from and to a single variable losslessly.
7888 .Bd -literal -offset indent
7889 ? vpospar set hey, "'you ", world!
7890 ? echo $#: <${1}><${2}><${3}>
7891 ? vput vpospar x quote
7893 ? echo $#: <${1}><${2}><${3}>
7894 ? eval vpospar set ${x}
7895 ? echo $#: <${1}><${2}><${3}>
7901 (v) Takes a message list and invokes the
7903 display editor on each message.
7904 Modified contents are discarded unless the
7906 variable is set, and are not used unless the mailbox can be written to
7907 and the editor returns a successful exit status.
7909 can be used instead for a less display oriented editor.
7913 (w) For conventional messages the body without all headers is written.
7914 The original message is never marked for deletion in the originating
7916 The output is decrypted and converted to its native format as necessary.
7917 If the output file exists, the text is appended.
7918 If a message is in MIME multipart format its first part is written to
7919 the specified file as for conventional messages, handling of the remains
7920 depends on the execution mode.
7921 No special handling of compressed files is performed.
7923 In interactive mode the user is consecutively asked for the filenames of
7924 the processed parts.
7925 For convenience saving of each part may be skipped by giving an empty
7926 value, the same result as writing it to
7928 Shell piping the part content by specifying a leading vertical bar
7930 character for the filename is supported.
7931 Other user input undergoes the usual
7932 .Sx "Filename transformations" ,
7933 including shell pathname wildcard pattern expansions
7935 and shell variable expansion for the message as such, not the individual
7936 parts, and contents of the destination file are overwritten if the file
7938 Character set conversion to
7940 is performed when saving text data.
7942 \*(ID In non-interactive mode any part which does not specify a filename
7943 is ignored, and suspicious parts of filenames of the remaining parts are
7944 URL percent encoded (as via
7946 to prevent injection of malicious character sequences, resulting in
7947 a filename that will be written into the current directory.
7948 Existing files will not be overwritten, instead the part number or
7949 a dot are appended after a number sign
7951 to the name until file creation succeeds (or fails due to other
7956 \*(NQ The sole difference to
7958 is that the new macro is executed in place of the current one, which
7959 will not regain control: all resources of the current macro will be
7961 This implies that any setting covered by
7963 will be forgotten and covered variables will become cleaned up.
7964 If this command is not used from within a
7966 ed macro it will silently be (a more expensive variant of)
7976 \*(NQ \*(UA presents message headers in
7978 fuls as described under the
7981 Without arguments this command scrolls to the next window of messages,
7982 likewise if the argument is
7986 scrolls to the last,
7988 scrolls to the first, and
7993 A number argument prefixed by
7997 indicates that the window is calculated in relation to the current
7998 position, and a number without a prefix specifies an absolute position.
8004 but scrolls to the next or previous window that contains at least one
8015 .\" .Sh COMMAND ESCAPES {{{
8016 .Sh "COMMAND ESCAPES"
8018 When composing messages command escapes are available in interactive
8019 mode, when explicitly requested via
8021 as well as in batch mode
8023 They perform special functions, like editing headers of the message
8024 being composed, calling normal
8026 yielding a shell, etc.
8027 Command escapes are only recognized at the beginning of lines, and
8028 consist of an escape followed by a command character.
8031 character is the tilde
8035 Unless otherwise documented command escapes ensure proper updates of
8042 controls whether a failed operation errors out message compose mode and
8043 causes program exit.
8044 Escapes may be prefixed by none to multiple single character command
8045 modifiers, interspersed whitespace is ignored:
8049 An effect equivalent to the command modifier
8051 can be achieved with hyphen-minus
8059 uates the remains of the line; also see
8060 .Sx "Shell-style argument quoting" .
8061 \*(ID For now the entire input line is evaluated as a whole; to avoid
8062 that control operators like semicolon
8064 are interpreted unintentionally, they must be quoted.
8068 Addition of the command line to the \*(OPal history can be prevented by
8069 placing whitespace directly after
8073 ings support a compose mode specific context.
8074 The following command escapes are supported:
8077 .Bl -tag -width ".It Ic BaNg"
8080 Insert the string of text in the message prefaced by a single
8082 (If the escape character has been changed,
8083 that character must be doubled instead.)
8086 .It Ic ~! Ar command
8087 Execute the indicated shell
8089 which follows, replacing unescaped exclamation marks with the previously
8090 executed command if the internal variable
8092 is set, then return to the message.
8096 End compose mode and send the message.
8098 .Va on-compose-splice-shell
8100 .Va on-compose-splice ,
8101 in order, will be called when set, after which, in interactive mode
8104 .Va askcc , askbcc )
8107 will be checked as well as
8110 .Va on-compose-leave
8111 hook will be called,
8115 will be joined in if set,
8117 .Va message-inject-tail
8118 will be incorporated, after which the compose mode is left.
8121 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
8122 Can be used to execute
8124 (which are allowed in compose mode).
8127 .It Ic ~< Ar filename
8132 .It Ic ~<! Ar command
8134 is executed using the shell.
8135 Its standard output is inserted into the message.
8139 \*(OP Write a summary of command escapes.
8142 .It Ic ~@ Op Ar filename...
8143 Append or edit the list of attachments.
8144 Does not manage the error number
8150 if error handling is necessary).
8151 The append mode expects a list of
8153 arguments as shell tokens (see
8154 .Sx "Shell-style argument quoting" ;
8155 token-separating commas are ignored, too), to be
8156 interpreted as documented for the command line option
8158 with the message number exception as below.
8162 arguments the attachment list is edited, entry by entry;
8163 if a filename is left empty, that attachment is deleted from the list;
8164 once the end of the list is reached either new attachments may be
8165 entered or the session can be quit by committing an empty
8168 In non-interactive mode or in batch mode
8170 the list of attachments is effectively not edited but instead recreated;
8171 again, an empty input ends list creation.
8173 For all modes, if a given filename solely consists of the number sign
8175 followed by either a valid message number of the currently active
8176 mailbox, or by a period
8178 referring to the current message of the active mailbox, the so-called
8180 then the given message is attached as a
8183 The number sign must be quoted to avoid misinterpretation as a shell
8187 .It Ic ~| Ar command
8188 Pipe the message text through the specified filter command.
8189 If the command gives no output or terminates abnormally,
8190 retain the original text of the message.
8193 is often used as a rejustifying filter.
8195 If the first character of the command is a vertical bar, then the entire
8196 message including header fields is subject to the filter command, so
8197 .Ql ~|| echo Fcc: /tmp/test; cat
8198 will prepend a file-carbon-copy message header.
8204 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
8205 Low-level compose mode command which shares semantics with
8207 and therefore evaluates its command line as documented in
8208 .Sx "Shell-style argument quoting" .
8209 Does not manage the error number
8213 errors are handled via the protocol, and hard errors like I/O failures
8217 The protocol consists of command lines followed by (a) response line(s).
8218 The first field of the response line represents a status code
8219 which specifies whether a command was successful or not, whether result
8220 data is to be expected, and if, the format of the result data.
8221 Response data will be shell quoted as necessary for consumption by
8228 Error status code lines may optionally contain additional context:
8232 .Bl -tag -compact -width ".It Ql 210"
8234 Status ok; the remains of the line are the result.
8237 Status ok; the rest of the line is optionally used for more status.
8238 What follows are lines of result addresses, terminated by an empty line.
8239 All the input, including the empty line, must be consumed before further
8240 commands can be issued.
8241 Address lines consist of two token, first the plain network address, e.g.,
8243 followed by the (quoted) full address as known:
8244 .Ql '(Lovely) Bob <bob@exam.ple>' .
8245 Non-network addresses use the first field to indicate the type (hyphen-minus
8247 for files, vertical bar
8249 for pipes, and number sign
8251 for names which will undergo
8253 processing) instead, the actual value will be in the second field.
8256 Status ok; the rest of the line is optionally used for more status.
8257 What follows are lines of furtherly unspecified (quoted) string content,
8258 terminated by an empty line.
8259 All the input, including the empty line, must be consumed before further
8260 commands can be issued.
8263 Syntax error; invalid command.
8266 Syntax error in parameters or arguments.
8269 Error: an argument fails verification.
8270 For example an invalid address has been specified (also see
8272 or an attempt was made to modify anything in \*(UA's own namespace,
8273 or a modifying subcommand has been used on a read-only message.
8276 Error: an otherwise valid argument is rendered invalid due to context.
8277 For example, a second address is added to a header which may consist of
8278 a single address only.
8283 If a command indicates failure then the message will have remained
8285 Most commands can fail with
8287 if required arguments are missing, or excessive arguments have been
8288 given (false command usage).
8289 (\*(ID The latter does not yet occur regulary, because as stated in
8290 .Sx "Shell-style argument quoting"
8291 our argument parser is not yet smart enough to work on subcommand base;
8292 for example one might get excess argument error for a three argument
8293 subcommand that receives four arguments, but not for a four argument
8294 subcommand which receives six arguments: here excess will be joined.)
8295 The following (case-insensitive) commands are supported:
8298 .Bl -hang -width ".It Cm version"
8300 This command allows listing, removal and addition of message attachments.
8301 The second argument specifies the subcommand to apply, one of:
8303 .Bl -hang -width ".It Cm remove"
8305 This uses the same search mechanism as described for
8307 and prints any known attributes of the first found attachment via
8311 if no such attachment can be found.
8312 The attributes are written as lines with a keyword and a value token.
8315 This uses the same search mechanism as described for
8317 and is otherwise identical to
8320 .It Cm attribute-set
8321 This uses the same search mechanism as described for
8323 and will set the attribute given as the fourth to the value given as
8324 the fifth token argument.
8325 If the value is an empty token, then the given attribute is removed,
8326 or reset to a default value if existence of the attribute is crucial.
8330 upon success, with the index of the found attachment following,
8332 for message attachments or if the given keyword is invalid, and
8334 if no such attachment can be found.
8335 The following keywords may be used (case-insensitively):
8337 .Bl -hang -compact -width ".It Ql filename"
8339 Sets the filename of the MIME part, i.e., the name that is used for
8340 display and when (suggesting a name for) saving (purposes).
8341 .It Ql content-description
8342 Associate some descriptive information to the attachment's content, used
8343 in favour of the plain filename by some MUAs.
8345 May be used for uniquely identifying MIME entities in several contexts;
8346 this expects a special reference address format as defined in RFC 2045
8349 upon address content verification failure.
8351 Defines the media type/subtype of the part, which is managed
8352 automatically, but can be overwritten.
8353 .It Ql content-disposition
8354 Automatically set to the string
8358 .It Cm attribute-set-at
8359 This uses the same search mechanism as described for
8361 and is otherwise identical to
8365 Adds the attachment given as the third argument, specified exactly as
8366 documented for the command line option
8368 and supporting the message number extension as documented for
8372 upon success, with the index of the new attachment following,
8374 if the given file cannot be opened,
8376 if an on-the-fly performed character set conversion fails, otherwise
8378 is reported; this is also reported if character set conversion is
8379 requested but not available.
8382 List all attachments via
8386 if no attachments exist.
8387 This command is the default command of
8389 if no second argument has been given.
8392 This will remove the attachment given as the third argument, and report
8396 if no such attachment can be found.
8397 If there exists any path component in the given argument, then an exact
8398 match of the path which has been used to create the attachment is used
8399 directly, but if only the basename of that path matches then all
8400 attachments are traversed to find an exact match first, and the removal
8401 occurs afterwards; if multiple basenames match, a
8404 Message attachments are treated as absolute pathnames.
8406 If no path component exists in the given argument, then all attachments
8407 will be searched for
8409 parameter matches as well as for matches of the basename of the path
8410 which has been used when the attachment has been created; multiple
8415 This will interpret the third argument as a number and remove the
8416 attachment at that list position (counting from one!), reporting
8420 if the argument is not a number or
8422 if no such attachment exists.
8427 This command allows listing, inspection, and editing of message headers.
8428 Header name case is not normalized, so that case-insensitive comparison
8429 should be used when matching names.
8430 The second argument specifies the subcommand to apply, one of:
8433 .Bl -hang -width ".It Cm remove"
8435 Create a new or an additional instance of the header given in the third
8436 argument, with the header body content as given in the fourth token.
8439 if the third argument specifies a free-form header field name that is
8440 invalid, or if body content extraction fails to succeed,
8442 if any extracted address does not pass syntax and/or security checks or
8443 on \*(UA namespace violations, and
8445 to indicate prevention of excessing a single-instance header \(em note that
8447 can be appended to (a space separator will be added automatically first).
8454 modifier to enforce treatment as a single addressee, for example
8455 .Ql header insert To?single: 'exa, <m@ple>' ;
8461 is returned upon success, followed by the name of the header and the list
8462 position of the newly inserted instance.
8463 The list position is always 1 for single-instance header fields.
8464 All free-form header fields are managed in a single list.
8467 Without a third argument a list of all yet existing headers is given via
8469 this command is the default command of
8471 if no second argument has been given.
8472 A third argument restricts output to the given header only, which may
8475 if no such field is defined.
8478 This will remove all instances of the header given as the third
8483 if no such header can be found, and
8485 on \*(UA namespace violations.
8488 This will remove from the header given as the third argument the
8489 instance at the list position (counting from one!) given with the fourth
8494 if the list position argument is not a number or on \*(UA namespace
8497 if no such header instance exists.
8500 Shows the content of the header given as the third argument.
8501 Dependent on the header type this may respond with
8505 any failure results in
8511 In compose-mode read-only access to optional pseudo headers in the \*(UA
8512 private namespace is available:
8516 .Bl -tag -compact -width ".It Va BaNg"
8517 .It Ql Mailx-Command:
8518 The name of the command that generates the message, one of
8525 This pseudo header always exists (in compose-mode).
8527 .It Ql Mailx-Raw-To:
8528 .It Ql Mailx-Raw-Cc:
8529 .It Ql Mailx-Raw-Bcc:
8530 Represent the frozen initial state of these headers before any
8534 .Va recipients-in-cc
8537 .It Ql Mailx-Orig-Sender:
8538 .It Ql Mailx-Orig-From:
8539 .It Ql Mailx-Orig-To:
8540 .It Ql Mailx-Orig-Cc:
8541 .It Ql Mailx-Orig-Bcc:
8542 The values of said headers of the original message which has been
8544 .Ic reply , forward , resend .
8545 The sender field is special as it is filled in with the sole sender
8546 according to RFC 5322 rules, it may thus be equal to the from field.
8551 Show an abstract of the above commands via
8555 This command will print the protocol version via
8563 .Ql Ic ~i Ns \| Va Sign .
8568 .Ql Ic ~i Ns \| Va sign .
8571 .It Ic ~b Ar name ...
8572 Add the given names to the list of blind carbon copy recipients.
8575 .It Ic ~c Ar name ...
8576 Add the given names to the list of carbon copy recipients.
8580 Read the file specified by the
8582 variable into the message.
8588 on the message collected so far, then return to compose mode.
8590 can be used for a more display oriented editor, and
8592 offers a pipe-based editing approach.
8595 .It Ic ~F Ar messages
8596 Read the named messages into the message being sent, including all
8597 message headers and MIME parts, and honouring
8600 .Va forward-inject-head
8602 .Va forward-inject-tail .
8603 If no messages are specified, read in the current message, the
8607 .It Ic ~f Ar messages
8608 Read the named messages into the message being sent.
8609 If no messages are specified, read in the current message, the
8611 Strips down the list of header fields according to the
8616 white- and blacklist selection of
8621 .Va forward-inject-head
8623 .Va forward-inject-tail .
8624 For MIME multipart messages,
8625 only the first displayable part is included.
8629 In interactive mode, edit the message header fields
8634 by typing each one in turn and allowing the user to edit the field.
8635 The default values for these fields originate from the
8640 In non-interactive mode this sets
8641 .Va ^ERR Ns -NOTTY .
8645 In interactive mode, edit the message header fields
8651 by typing each one in turn and allowing the user to edit the field.
8652 In non-interactive mode this sets
8653 .Va ^ERR Ns -NOTTY .
8656 .It Ic ~I Ar variable
8657 Insert the value of the specified variable into the message.
8658 The message remains unaltered if the variable is unset or empty.
8659 Any embedded character sequences
8661 horizontal tabulator and
8663 line feed are expanded in
8665 mode; otherwise the expansion should occur at
8667 time (\*(ID by using the command modifier
8671 .It Ic ~i Ar variable
8674 but appends a newline character.
8677 .It Ic ~M Ar messages
8678 Read the named messages into the message being sent,
8681 If no messages are specified, read the current message, the
8686 .Va forward-inject-head
8688 .Va forward-inject-tail .
8691 .It Ic ~m Ar messages
8692 Read the named messages into the message being sent,
8695 If no messages are specified, read the current message, the
8697 Strips down the list of header fields according to the
8699 white- and blacklist selection of
8704 .Va forward-inject-head
8706 .Va forward-inject-tail .
8707 For MIME multipart messages,
8708 only the first displayable part is included.
8712 Display the message collected so far,
8713 prefaced by the message header fields
8714 and followed by the attachment list, if any.
8718 Read in the given / current message(s) using the algorithm of
8720 (except that is implicitly assumed, even if not set), honouring
8725 Abort the message being sent,
8726 copying it to the file specified by the
8733 .It Ic ~R Ar filename
8736 but indent each line that has been read by
8740 .It Ic ~r Ar filename Op Ar HERE-delimiter
8741 Read the named file, object to
8742 .Sx "Filename transformations"
8743 excluding shell globs and variable expansions, into the message; if
8747 then standard input is used (for pasting, for example).
8748 Only in this latter mode
8750 may be given: if it is data will be read in until the given
8752 is seen on a line by itself, and encountering EOF is an error; the
8754 is a required argument in non-interactive mode; if it is single-quote
8755 quoted then the pasted content will not be expanded, \*(ID otherwise
8756 a future version of \*(UA may perform shell-style expansion on the content.
8760 Cause the named string to become the current subject field.
8761 Newline (NL) and carriage-return (CR) bytes are invalid and will be
8762 normalized to space (SP) characters.
8765 .It Ic ~t Ar name ...
8766 Add the given name(s) to the direct recipient list.
8769 .It Ic ~U Ar messages
8770 Read in the given / current message(s) excluding all headers, indented by
8775 .Va forward-inject-head
8777 .Va forward-inject-tail .
8780 .It Ic ~u Ar messages
8781 Read in the given / current message(s), excluding all headers.
8785 .Va forward-inject-head
8787 .Va forward-inject-tail .
8793 editor on the message collected so far, then return to compose mode.
8795 can be used for a less display oriented editor, and
8797 offers a pipe-based editing approach.
8800 .It Ic ~w Ar filename
8801 Write the message onto the named file, which is object to the usual
8802 .Sx "Filename transformations" .
8804 the message is appended to it.
8810 except that the message is not saved at all.
8816 .\" .Sh INTERNAL VARIABLES {{{
8817 .Sh "INTERNAL VARIABLES"
8819 Internal \*(UA variables are controlled via the
8823 commands; prefixing a variable name with the string
8827 has the same effect as using
8834 will give more insight on the given variable(s), and
8836 when called without arguments, will show a listing of all variables.
8837 Both commands support a more
8840 Some well-known variables will also become inherited from the
8843 implicitly, others can be imported explicitly with the command
8845 and henceforth share said properties.
8848 Two different kinds of internal variables exist, and both of which can
8850 There are boolean variables, which can only be in one of the two states
8854 and value variables with a(n optional) string value.
8855 For the latter proper quoting is necessary upon assignment time, the
8856 introduction of the section
8858 documents the supported quoting rules.
8860 .Bd -literal -offset indent
8861 ? wysh set one=val\e 1 two="val 2" \e
8862 three='val "3"' four=$'val \e'4\e''; \e
8863 varshow one two three four; \e
8864 unset one two three four
8868 Dependent upon the actual option string values may become interpreted as
8869 colour names, command specifications, normal text, etc.
8870 They may be treated as numbers, in which case decimal values are
8871 expected if so documented, but otherwise any numeric format and
8872 base that is valid and understood by the
8874 command may be used, too.
8877 There also exists a special kind of string value, the
8878 .Dq boolean string ,
8879 which must either be a decimal integer (in which case
8883 and any other value is true) or any of the (case-insensitive) strings
8889 for a false boolean and
8897 a special kind of boolean string is the
8899 it can optionally be prefixed with the (case-insensitive) term
8903 in interactive mode the user will be prompted, otherwise the actual
8907 Variable chains extend a plain
8912 .Ql variable-USER@HOST
8916 will be converted to all lowercase when looked up (but not when the
8917 variable is set or unset!), \*(OPally IDNA converted, and indeed means
8921 had been specified in the contextual Uniform Resource Locator URL, see
8922 .Sx "On URL syntax and credential lookup" .
8923 Even though this mechanism is based on URLs no URL percent encoding may
8924 be applied to neither of
8928 variable chains need to be specified using raw data;
8929 the mentioned section contains examples.
8930 Variables which support chains are explicitly documented as such, and
8931 \*(UA treats the base name of any such variable special, meaning that
8932 users should not create custom names like
8934 in order to avoid false classifications and treatment of such variables.
8936 .\" .Ss "Initial settings" {{{
8937 .\" (Keep in SYNC: mx/nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
8938 .Ss "Initial settings"
8940 The standard POSIX 2008/Cor 2-2016 mandates the following initial
8946 .Pf no Va autoprint ,
8960 .Pf no Va ignoreeof ,
8962 .Pf no Va keepsave ,
8964 .Pf no Va outfolder ,
8972 .Pf no Va sendwait ,
8981 However, \*(UA has built-in some initial (and some default) settings
8982 which (may) diverge, others may become adjusted by one of the
8983 .Sx "Resource files" .
8984 Displaying the former is accomplished via
8986 .Ql $ \*(uA -:/ -v -Xset -Xx .
8987 In general this implementation sets (and has extended the meaning of)
8989 and does not support the
8991 variable \(en use command line options or
8993 to pass options through to a
8995 The default global resource file sets, among others, the variables
9000 establishes a default
9002 selection etc., and should thus be taken into account.
9005 .\" .Ss "Variables" {{{
9008 .Bl -tag -width ".It Va BaNg"
9012 \*(RO The exit status of the last command, or the
9017 This status has a meaning in the state machine: in conjunction with
9019 any non-0 exit status will cause a program exit, and in
9021 mode any error while loading (any of the) resource files will have the
9025 .Sx "Command modifiers" ,
9026 can be used to instruct the state machine to ignore errors.
9030 \*(RO The current error number
9031 .Pf ( Xr errno 3 ) ,
9032 which is set after an error occurred; it is also available via
9034 and the error name and documentation string can be queried via
9038 \*(ID This machinery is new and the error number is only really usable
9039 if a command explicitly states that it manages the variable
9041 for others errno will be used in case of errors, or
9043 if that is 0: it thus may or may not reflect the real error.
9044 The error number may be set with the command
9050 \*(RO This is a multiplexer variable which performs dynamic expansion of
9051 the requested state or condition, of which there are:
9053 .Bl -tag -width ".It Va BaNg"
9057 .It Va ^ERR , ^ERRDOC , ^ERRNAME
9058 The number, documentation, and name of the current
9060 respectively, which is usually set after an error occurred.
9061 The documentation is an \*(OP, the name is used if not available.
9062 \*(ID This machinery is new and is usually reliable only if a command
9063 explicitly states that it manages the variable
9065 which is effectively identical to
9067 Each of those variables can be suffixed with a hyphen minus followed by
9068 a name or number, in which case the expansion refers to the given error.
9069 Note this is a direct mapping of (a subset of) the system error values:
9070 .Bd -literal -offset indent
9072 eval echo \e$1: \e$^ERR-$1:\e
9073 \e$^ERRNAME-$1: \e$^ERRDOC-$1
9074 vput vexpr i + "$1" 1
9084 .It Va ^ERRQUEUE-COUNT , ^ERRQUEUE-EXISTS
9085 The number of messages present in the \*(OPal log queue of
9087 and a boolean which indicates whether the queue is not empty,
9088 respectively; both are always 0 unless
9097 \*(RO Expands all positional parameters (see
9099 separated by the first character of the value of
9101 \*(ID The special semantics of the equally named special parameter of the
9103 are not yet supported.
9107 \*(RO Expands all positional parameters (see
9109 separated by a space character.
9110 If placed in double quotation marks, each positional parameter is
9111 properly quoted to expand to a single parameter again.
9115 \*(RO Expands to the number of positional parameters, i.e., the size of
9116 the positional parameter stack in decimal.
9120 \*(RO Inside the scope of a
9124 ed macro this expands to the name of the calling macro, or to the empty
9125 string if the macro is running from top-level.
9126 For the \*(OPal regular expression search and replace operator of
9128 this expands to the entire matching expression.
9129 It represents the program name in global context.
9133 \*(RO Access of the positional parameter stack.
9134 All further parameters can be accessed with this syntax, too,
9137 etc.; positional parameters can be shifted off the stack by calling
9139 The parameter stack contains, for example, the arguments of a
9143 d macro, the matching groups of the \*(OPal regular expression search
9144 and replace expression of
9146 and can be explicitly created or overwritten with the command
9151 \*(RO Is set to the active
9155 .It Va add-file-recipients
9156 \*(BO When file or pipe recipients have been specified,
9157 mention them in the corresponding address fields of the message instead
9158 of silently stripping them from their recipient list.
9159 By default such addressees are not mentioned.
9163 \*(BO Causes only the local part to be evaluated
9164 when comparing addresses.
9168 \*(BO Causes messages saved in the
9170 .Sx "secondary mailbox"
9172 to be appended to the end rather than prepended.
9173 This should always be set.
9177 \*(BO Causes the prompts for
9181 lists to appear after the message has been edited.
9185 \*(BO If set, \*(UA asks an interactive user for files to attach at the
9186 end of each message; An empty line finalizes the list.
9190 \*(BO Causes the interactive user to be prompted for carbon copy
9191 recipients (at the end of each message if
9199 \*(BO Causes the interactive user to be prompted for blind carbon copy
9200 recipients (at the end of each message if
9208 \*(BO Causes the interactive user to be prompted for confirmation to
9209 send the message or reenter compose mode after having been shown an
9211 This is by default enabled.
9215 \*(BO\*(OP Causes the interactive user to be prompted if the message is
9216 to be signed at the end of each message.
9219 variable is ignored when this variable is set.
9223 .\" The alternative *ask* is not documented on purpose
9224 \*(BO Causes \*(UA to prompt the interactive user for the subject upon
9225 entering compose mode unless a subject already exists.
9229 A sequence of characters to display in the
9233 as shown in the display of
9235 each for one type of messages (see
9236 .Sx "Message states" ) ,
9237 with the default being
9240 .Ql NU\ \ *HMFAT+\-$~
9243 variable is set, in the following order:
9245 .Bl -tag -compact -width ".It Ql _"
9267 \*(ID start of a (collapsed) thread in threaded mode (see
9271 \*(ID an uncollapsed thread in threaded mode; only used in conjunction with
9276 classified as possible spam.
9282 Specifies a list of recipients to which a blind carbon copy of each
9283 outgoing message will be sent automatically.
9287 Specifies a list of recipients to which a carbon copy of each outgoing
9288 message will be sent automatically.
9292 \*(BO Causes threads to be collapsed automatically when .Ql thread Ns
9295 mode is entered (see the
9301 \*(BO Enable automatic
9303 ing of a(n existing)
9309 commands: the message that becomes the new
9311 is shown automatically, as via
9318 Causes sorted mode (see the
9320 command) to be entered automatically with the value of this variable as
9321 sorting method when a folder is opened, for example
9322 .Ql set autosort=thread .
9326 \*(BO Enables the substitution of all not (reverse-solidus) escaped
9329 characters by the contents of the last executed command for the
9331 shell escape command and
9333 one of the compose mode
9334 .Sx "COMMAND ESCAPES" .
9335 If this variable is not set no reverse solidus stripping is performed.
9339 \*(OB Predecessor of
9340 .Va bind-inter-byte-timeout .
9341 \*(ID Setting this automatically sets the successor.
9344 .It Va bind-inter-byte-timeout
9345 \*(OP Terminals may generate multi-byte sequences for special function
9346 keys, for example, but these sequences may not become read as a unit.
9347 And multi-byte sequences can be defined freely via
9349 This variable specifies the timeout in milliseconds that the MLE (see
9350 .Sx "On terminal control and line editor" )
9351 waits for more bytes to arrive unless it considers a sequence
9353 The default is 200, the maximum is about 10 seconds.
9354 In the following example the comments state which sequences are
9355 affected by this timeout:
9356 .Bd -literal -offset indent
9357 ? bind base abc echo 0 # abc
9358 ? bind base ab,c echo 1 # ab
9359 ? bind base abc,d echo 2 # abc
9360 ? bind base ac,d echo 3 # ac
9361 ? bind base a,b,c echo 4
9362 ? bind base a,b,c,d echo 5
9363 ? bind base a,b,cc,dd echo 6 # cc and dd
9367 .It Va bind-inter-key-timeout
9370 sequences do not time out by default.
9371 If this variable is set, then the current key sequence is forcefully
9372 terminated once the timeout (in milliseconds) triggers.
9373 The value should be (maybe significantly) larger than
9374 .Va bind-inter-byte-timeout ,
9375 but may not excess the maximum, too.
9379 \*(BO Sets some cosmetical features to traditional BSD style;
9380 has the same affect as setting
9382 and all other variables prefixed with
9384 it also changes the behaviour of
9386 (which does not exist in BSD).
9390 \*(BO Changes the letters shown in the first column of a header
9391 summary to traditional BSD style.
9395 \*(BO Changes the display of columns in a header summary to traditional
9400 \*(BO Changes some informational messages to traditional BSD style.
9406 field to appear immediately after the
9408 field in message headers and with the
9410 .Sx "COMMAND ESCAPES" .
9416 .It Va build-cc , build-ld , build-os , build-rest
9417 \*(RO The build environment, including the compiler, the linker, the
9418 operating system \*(UA has been build for, usually taken from
9422 and then lowercased, as well as all the possibly interesting rest of the
9423 configuration and build environment.
9424 This information is also available in the
9426 output of the command
9431 The value that should appear in the
9435 MIME header fields when no character set conversion of the message data
9437 This defaults to US-ASCII, and the chosen character set should be
9438 US-ASCII compatible.
9442 \*(OP The default 8-bit character set that is used as an implicit last
9443 member of the variable
9445 This defaults to UTF-8 if character set conversion capabilities are
9446 available, and to ISO-8859-1 otherwise (unless the operating system
9447 environment is known to always and exclusively support UTF-8 locales),
9448 in which case the only supported character set is
9450 and this variable is effectively ignored.
9453 .It Va charset-unknown-8bit
9454 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
9456 the content of a mail message by using a character set with the name
9458 Because of the unclassified nature of this character set \*(UA will not
9459 be capable to convert this character set to any other character set.
9460 If this variable is set any message part which uses the character set
9462 is assumed to really be in the character set given in the value,
9463 otherwise the (final) value of
9465 is used for this purpose.
9467 This variable will also be taken into account if a MIME type (see
9468 .Sx "The mime.types files" )
9469 of a MIME message part that uses the
9471 character set is forcefully treated as text.
9475 The default value for the
9480 .It Va colour-disable
9481 \*(BO\*(OP Forcefully disable usage of colours.
9482 Also see the section
9483 .Sx "Coloured display" .
9487 \*(BO\*(OP Whether colour shall be used for output that is paged through
9489 Note that pagers may need special command line options, for example
9497 in order to support colours.
9498 Often doing manual adjustments is unnecessary since \*(UA may perform
9499 adjustments dependent on the value of the environment variable
9501 (see there for more).
9505 .It Va contact-mail , contact-web
9506 \*(RO Addresses for contact per email and web, respectively, for
9507 bug reports, suggestions, or anything else regarding \*(UA.
9508 The former can be used directly:
9509 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
9515 .It Va content-description-forwarded-message , \
9516 content-description-quote-attachment , \
9517 content-description-smime-message , \
9518 content-description-smime-signature
9519 \*(OP(partially) Strings which will be placed in according
9520 .Ql Content-Description:
9521 headers if non-empty.
9522 They all have default values, for example
9523 .Ql Forwarded message .
9527 In a(n interactive) terminal session, then if this valued variable is
9528 set it will be used as a threshold to determine how many lines the given
9529 output has to span before it will be displayed via the configured
9533 can be forced by setting this to the value
9535 setting it without a value will deduce the current height of the
9536 terminal screen to compute the threshold (see
9541 \*(ID At the moment this uses the count of lines of the message in wire
9542 format, which, dependent on the
9544 of the message, is unrelated to the number of display lines.
9545 (The software is old and historically the relation was a given thing.)
9549 Define a set of custom headers to be injected into newly composed or
9551 A custom header consists of the field name followed by a colon
9553 and the field content body.
9554 Standard header field names cannot be overwritten by a custom header.
9555 Different to the command line option
9557 the variable value is interpreted as a comma-separated list of custom
9558 headers: to include commas in header bodies they need to become escaped
9559 with reverse solidus
9561 Headers can be managed more freely in compose mode via
9564 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2, Hdr2: Body2'
9568 Controls the appearance of the
9570 date and time format specification of the
9572 variable, that is used, for example, when viewing the summary of
9574 If unset, then the local receiving date is used and displayed
9575 unformatted, otherwise the message sending
9577 It is possible to assign a
9579 format string and control formatting, but embedding newlines via the
9581 format is not supported, and will result in display errors.
9583 .Ql %Y-%m-%d %H:%M ,
9585 .Va datefield-markout-older .
9588 .It Va datefield-markout-older
9589 Only used in conjunction with
9591 Can be used to create a visible distinction of messages dated more than
9592 a day in the future, or older than six months, a concept comparable to the
9594 option of the POSIX utility
9596 If set to the empty string, then the plain month, day and year of the
9598 will be displayed, but a
9600 format string to control formatting can be assigned.
9606 \*(BO (Almost) Enter a debug-only sandbox mode which generates many
9607 log messages, disables the actual delivery of messages, and also implies
9615 .It Va disposition-notification-send
9617 .Ql Disposition-Notification-To:
9618 header (RFC 3798) with the message.
9622 .\" TODO .It Va disposition-notification-send-HOST
9624 .\".Va disposition-notification-send
9625 .\" for SMTP accounts on a specific host.
9626 .\" TODO .It Va disposition-notification-send-USER@HOST
9628 .\".Va disposition-notification-send
9629 .\"for a specific account.
9633 \*(BO When dot is set, a period
9635 on a line by itself during message input in (interactive or batch
9637 compose mode will be treated as end-of-message (in addition to the
9638 normal end-of-file condition).
9639 This behaviour is implied in
9645 .It Va dotlock-disable
9646 \*(BO\*(OP Disable creation of
9651 .It Va dotlock-ignore-error
9652 \*(OB\*(BO\*(OP Ignore failures when creating
9654 .Sx "dotlock files" .
9661 If this variable is set then the editor is started automatically when
9662 a message is composed in interactive mode.
9663 If the value starts with the letter
9665 then this acts as if
9669 .Pf (see\0 Sx "COMMAND ESCAPES" )
9673 variable is implied for this automatically spawned editor session.
9677 \*(BO When a message is edited while being composed,
9678 its header is included in the editable text.
9682 \*(BO When entering interactive mode \*(UA normally writes
9683 .Dq \&No mail for user
9684 and exits immediately if a mailbox is empty or does not exist.
9685 If this variable is set \*(UA starts even with an empty or non-existent
9686 mailbox (the latter behaviour furtherly depends upon
9692 \*(BO Let each command with a non-0 exit status, including every
9696 s a non-0 status, cause a program exit unless prefixed by
9699 .Sx "Command modifiers" ) .
9701 .Sx "COMMAND ESCAPES" ,
9702 but which use a different modifier for ignoring the error.
9703 Please refer to the variable
9705 for more on this topic.
9709 The first character of this value defines the escape character for
9710 .Sx "COMMAND ESCAPES"
9712 The default value is the character tilde
9714 If set to the empty string, command escapes are disabled.
9719 If unset then file and command pipeline address targets are not allowed,
9720 and any such address will be filtered out, giving a warning message.
9721 If set then all possible recipient address specifications will be
9722 accepted, unless the optional value is more specific (also see
9723 .Sx "On sending mail, and non-interactive mode" ) .
9724 If the value contains
9726 then behaviour equals the former unless in interactive mode, or when
9727 tilde commands were enabled explicitly via
9731 in which case it equals the latter, and thus allows all addressees.
9734 .Ql restrict,\:-all,\:+name,\:+addr ,
9735 so care for ordering issues must be taken.
9738 Indeed the value is interpreted as a comma-separated list of
9739 case-insensitive strings.
9740 Hard send errors can be enforced for disallowed address types by setting
9742 by default these are only filtered out.
9743 User name receivers addressing valid local users can be expanded to
9744 a network address (also see
9748 Address targets can be added and removed with a plus sign
9752 prefix, respectively: the value
9754 addresses all possible specifications,
9756 whitelists targets specified via
9758 headers regardless of other settings,
9760 file targets (it includes
9763 command pipeline targets,
9765 plain user names left for further expansion by the MTA (implicitly
9766 disallowed for the SMTP based
9771 Targets are interpreted in the given order, so that
9772 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
9773 will cause hard errors for any non-network address recipient address
9774 unless running interactively or having been started with the option
9778 in the latter case(s) any address may be used, then.
9781 Historically invalid network addressees were silently stripped off \(em
9782 shall they cause hard errors instead it must be ensured that
9784 is an entry of the list (it really acts like
9785 .Ql failinvaddr,\:+addr ) .
9788 .Pf (actually\0\: Ql domaincheck,\:+addr )
9789 compares address domain names against a whitelist and strips off
9791 for hard errors) addressees which fail this test; the domain name
9793 and the non-empty value of
9795 (the real hostname otherwise) are always whitelisted,
9796 .Va expandaddr-domaincheck
9797 can be set to extend this list.
9798 Finally some address providers (for example
9800 and all other command line recipients) will be evaluated as
9801 if specified within dollar-single-quotes (see
9802 .Sx "Shell-style argument quoting" )
9803 if the value list contains the string
9808 .It Va expandaddr-domaincheck
9809 Can be set to a comma-separated list of domain names which should be
9810 whitelisted for the evaluation of the
9814 IDNA encoding is not automatically performed,
9816 can be used to prepare the domain (of an address).
9820 Unless this variable is set additional
9822 (Mail-Transfer-Agent)
9823 arguments from the command line, as can be given after a
9825 separator, results in a program termination with failure status.
9826 The same can be accomplished by using the special (case-insensitive) value
9828 A lesser strict variant is the otherwise identical
9830 which does accept such arguments in interactive mode, or if tilde
9831 commands were enabled explicitly by using one of the command line options
9835 The empty value will allow unconditional usage.
9839 \*(RO String giving a list of optional features.
9840 Features are preceded with a plus sign
9842 if they are available, with a hyphen-minus
9845 To ease substring matching the string starts and ends with a comma.
9846 The output of the command
9848 includes this information in a more pleasant output.
9852 \*(BO This setting reverses the meanings of a set of reply commands,
9853 turning the lowercase variants, which by default address all recipients
9854 included in the header of a message
9855 .Pf ( Ic reply , respond , followup )
9856 into the uppercase variants, which by default address the sender only
9857 .Pf ( Ic Reply , Respond , Followup )
9862 The default path under which mailboxes are to be saved:
9863 filenames that begin with the plus sign
9865 will have the plus sign replaced with the value of this variable if set,
9866 otherwise the plus sign will remain unchanged when doing
9867 .Sx "Filename transformations" ;
9870 for more on this topic, and know about standard imposed implications of
9872 The value supports a subset of transformations itself, and if the
9873 non-empty value does not start with a solidus
9877 will be prefixed automatically.
9878 Once the actual value is evaluated first, the internal variable
9880 will be updated for caching purposes.
9883 .It Va folder-hook-FOLDER , Va folder-hook
9886 macro which will be called whenever a
9889 The macro will also be invoked when new mail arrives,
9890 but message lists for commands executed from the macro
9891 only include newly arrived messages then.
9893 are activated by default in a folder hook, causing the covered settings
9894 to be reverted once the folder is left again.
9896 The specialized form will override the generic one if
9898 matches the file that is opened.
9899 Unlike other folder specifications, the fully expanded name of a folder,
9900 without metacharacters, is used to avoid ambiguities.
9901 However, if the mailbox resides under
9905 specification is tried in addition, so that if
9909 (and thus relative to the user's home directory) then
9910 .Pa /home/usr1/mail/sent
9912 .Ql folder-hook-/home/usr1/mail/sent
9913 first, but then followed by
9914 .Ql folder-hook-+sent .
9917 .It Va folder-resolved
9918 \*(RO Set to the fully resolved path of
9920 once that evaluation has occurred; rather internal.
9924 \*(BO Controls whether a
9925 .Ql Mail-Followup-To:
9926 header is generated when sending messages to known mailing lists.
9927 The user as determined via
9929 (or, if that contains multiple addresses,
9931 will be placed in there if any list addressee is not a subscribed list.
9933 .Va followup-to-honour
9935 .Ic mlist , mlsubscribe , reply
9940 .It Va followup-to-add-cc
9941 \*(BO Controls whether the user will be added to the messages'
9943 list in addition to placing an entry in
9944 .Ql Mail-Followup-To:
9949 .It Va followup-to-honour
9951 .Ql Mail-Followup-To:
9952 header is honoured when group-replying to a message via
9959 if set without a value it defaults to
9965 .It Va forward-add-cc
9966 \*(BO Whether the sender of a message quoted via
9968 shall be added to the messages'
9973 .It Va forward-as-attachment
9974 \*(BO Original messages are normally sent as inline text with the
9977 and only the first part of a multipart message is included.
9978 With this setting enabled messages are sent as unmodified MIME
9980 attachments with all of their parts included.
9984 .It Va forward-inject-head , forward-inject-tail
9985 The strings to put before and after the text of a message with the
9987 command, respectively.
9988 The former defaults to
9989 .Ql -------- Original Message --------\en .
9990 Special format directives in these strings will be expanded if possible,
9991 and if so configured the output will be folded according to
9993 for more please refer to
9994 .Va quote-inject-head .
9995 Injections will not be performed by
9998 .Va forward-as-attachment
10000 .Sx "COMMAND ESCAPES"
10001 .Ic ~F , ~f , ~M , ~m , ~U , ~u
10007 The address (or a list of addresses) to put into the
10009 field of the message header, quoting RFC 5322:
10010 the author(s) of the message, that is, the mailbox(es) of the person(s)
10011 or system(s) responsible for the writing of the message.
10012 According to that RFC setting the
10014 variable is required if
10016 contains more than one address.
10017 \*(ID Please expect automatic management of the
10022 Dependent on the context these addresses are handled as if they were in
10027 If a file-based MTA is used, then
10029 (or, if that contains multiple addresses,
10031 can nonetheless be used as the envelope sender address at the MTA
10032 protocol level (the RFC 5321 reverse-path), either via the
10034 command line option (without argument; see there for more), or by setting
10035 .Va r-option-implicit .
10038 If the machine's hostname is not valid at the Internet (for example at
10039 a dialup machine), then either this variable or
10041 (\*(IN a SMTP-based
10043 adds even more fine-tuning capabilities with
10044 .Va smtp-hostname )
10045 have to be set: if so the message and MIME part related unique ID fields
10049 will be created (except when disallowed by
10050 .Va message-id-disable
10057 \*(BO Due to historical reasons comments and name parts of email
10058 addresses are removed by default when sending mail, replying to or
10059 forwarding a message.
10060 If this variable is set such stripping is not performed.
10063 \*(OB Predecessor of
10064 .Va forward-inject-head .
10068 \*(BO Causes the header summary to be written at startup and after
10069 commands that affect the number of messages or the order of messages in
10074 mode a header summary will also be displayed on folder changes.
10075 The command line option
10083 A format string to use for the summary of
10085 Format specifiers in the given string start with a percent sign
10087 and may be followed by an optional decimal number indicating the field
10088 width \(em if that is negative, the field is to be left-aligned.
10089 Names and addresses are subject to modifications according to
10093 Valid format specifiers are:
10096 .Bl -tag -compact -width ".It Ql _%%_"
10098 A plain percent sign.
10101 a space character but for the current message
10103 for which it expands to
10106 .Va headline-plain ) .
10109 a space character but for the current message
10111 for which it expands to
10114 .Va headline-plain ) .
10116 \*(OP The spam score of the message, as has been classified via the
10119 Shows only a replacement character if there is no spam support.
10121 Message attribute character (status flag); the actual content can be
10122 adjusted by setting
10125 The date found in the
10127 header of the message when
10129 is set (the default), otherwise the date when the message was received.
10130 Formatting can be controlled by assigning a
10135 .Va datefield-markout-older ) .
10137 The indenting level in
10143 The address of the message sender.
10145 The message thread tree structure.
10146 (Note that this format does not support a field width, and honours
10147 .Va headline-plain . )
10149 Mailing list status: is the addressee of the message a known
10158 announces the presence of a RFC 2369
10160 header, which makes a message a valuable target of
10163 The number of lines of the message, if available.
10167 The number of octets (bytes) in the message, if available.
10169 Message subject (if any) in double quotes.
10171 Message subject (if any).
10173 The position in threaded/sorted order.
10175 The value 0 except in an IMAP mailbox,
10176 where it expands to the UID of the message.
10180 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
10182 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
10190 .Va headline-bidi .
10194 .It Va headline-bidi
10195 Bidirectional text requires special treatment when displaying headers,
10196 because numbers (in dates or for file sizes etc.) will not affect the
10197 current text direction, in effect resulting in ugly line layouts when
10198 arabic or other right-to-left text is to be displayed.
10199 On the other hand only a minority of terminals is capable to correctly
10200 handle direction changes, so that user interaction is necessary for
10201 acceptable results.
10202 Note that extended host system support is required nonetheless, e.g.,
10203 detection of the terminal character set is one precondition;
10204 and this feature only works in an Unicode (i.e., UTF-8) locale.
10206 In general setting this variable will cause \*(UA to encapsulate text
10207 fields that may occur when displaying
10209 (and some other fields, like dynamic expansions in
10211 with special Unicode control sequences;
10212 it is possible to fine-tune the terminal support level by assigning
10214 no value (or any value other than
10219 will make \*(UA assume that the terminal is capable to properly deal
10220 with Unicode version 6.3, in which case text is embedded in a pair of
10221 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
10223 In addition no space on the line is reserved for these characters.
10225 Weaker support is chosen by using the value
10227 (Unicode 6.3, but reserve the room of two spaces for writing the control
10228 sequences onto the line).
10233 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
10234 again reserves room for two spaces in addition.
10237 .It Va headline-plain
10238 \*(BO On Unicode (UTF-8) aware terminals enhanced graphical symbols are
10239 used by default for certain entries of
10241 If this variable is set only basic US-ASCII symbols will be used.
10244 .It Va history-file
10245 \*(OP The (expandable) location of a permanent
10247 file for the MLE line editor
10248 .Pf ( Sx "On terminal control and line editor" ) .
10253 .It Va history-gabby
10254 \*(OP Add more entries to the MLE
10256 as is normally done.
10257 A comma-separated list of case-insensitive strings can be used to
10258 fine-tune which gabby entries shall be allowed.
10261 erroneous commands will also be added.
10263 adds all optional entries, and is the fallback chattiness identifier of
10264 .Va on-history-addition .
10267 .It Va history-gabby-persist
10270 entries will not be saved in persistent storage unless this variable is set.
10271 The knowledge of whether a persistent entry was gabby is not lost.
10276 .It Va history-size
10277 \*(OP Setting this variable imposes a limit on the number of concurrent
10280 If set to the value 0 then no further history entries will be added,
10281 and loading and incorporation of the
10283 upon program startup can also be suppressed by doing this.
10284 Runtime changes will not be reflected before the
10286 is saved or loaded (again).
10290 \*(BO This setting controls whether messages are held in the system
10292 and it is set by default.
10296 Used instead of the value obtained from
10300 as the hostname when expanding local addresses, for example in
10303 .Sx "On sending mail, and non-interactive mode" ,
10304 for expansion of addresses that have a valid user-, but no domain
10305 name in angle brackets).
10308 or this variable is set the message and MIME part related unique ID fields
10312 will be created (except when disallowed by
10313 .Va message-id-disable
10316 If the \*(OPal IDNA support is available (see
10318 variable assignment is aborted when a necessary conversion fails.
10320 Setting it to the empty string will cause the normal hostname to be
10321 used, but nonetheless enables creation of said ID fields.
10322 \*(IN in conjunction with the built-in SMTP
10325 also influences the results:
10326 one should produce some test messages with the desired combination of
10334 .It Va idna-disable
10335 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
10336 names according to the rules of IDNA (internationalized domain names
10338 Since the IDNA code assumes that domain names are specified with the
10340 character set, an UTF-8 locale charset is required to represent all
10341 possible international domain names (before conversion, that is).
10345 The input field separator that is used (\*(ID by some functions) to
10346 determine where to split input data.
10348 .Bl -tag -compact -width ".It MMM"
10350 Unsetting is treated as assigning the default value,
10353 If set to the empty value, no field splitting will be performed.
10355 If set to a non-empty value, all whitespace characters are extracted
10356 and assigned to the variable
10360 .Bl -tag -compact -width ".It MMM"
10363 will be ignored at the beginning and end of input.
10364 Diverging from POSIX shells default whitespace is removed in addition,
10365 which is owed to the entirely different line content extraction rules.
10367 Each occurrence of a character of
10369 will cause field-splitting, any adjacent
10371 characters will be skipped.
10376 \*(RO Automatically deduced from the whitespace characters in
10381 \*(BO Ignore interrupt signals from the terminal while entering
10382 messages; instead echo them as
10384 characters and discard the current line.
10388 \*(BO Ignore end-of-file conditions
10389 .Pf ( Ql control-D )
10390 in compose mode on message input and in interactive command input.
10391 If set an interactive command input session can only be left by
10392 explicitly using one of the commands
10396 and message input in compose mode can only be terminated by entering
10399 on a line by itself or by using the
10401 .Sx "COMMAND ESCAPES" ;
10402 Setting this implies the behaviour that
10410 If this is set to a non-empty string it will specify the user's
10412 .Sx "primary system mailbox" ,
10415 and the system-dependent default, and (thus) be used to replace
10418 .Sx "Filename transformations" ;
10421 for more on this topic.
10422 The value supports a subset of transformations itself.
10424 .It Va indentprefix
10429 .Sx "COMMAND ESCAPES"
10432 option for indenting messages,
10433 in place of the POSIX mandated default tabulator character
10440 \*(BO If set, an empty
10442 .Sx "primary system mailbox"
10443 file is not removed.
10444 Note that, in conjunction with
10446 mode any empty file will be removed unless this variable is set.
10447 This may improve the interoperability with other mail user agents
10448 when using a common folder directory, and prevents malicious users
10449 from creating fake mailboxes in a world-writable spool directory.
10450 \*(ID Only local regular (MBOX) files are covered, Maildir and other
10451 mailbox types will never be removed, even if empty.
10454 .It Va keep-content-length
10455 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
10456 be told to keep the
10457 .Ql Content-Length:
10460 header fields that some MUAs generate by setting this variable.
10461 Since \*(UA does neither use nor update these non-standardized header
10462 fields (which in itself shows one of their conceptual problems),
10463 stripping them should increase interoperability in between MUAs that
10464 work with with same mailbox files.
10465 Note that, if this is not set but
10466 .Va writebackedited ,
10467 as below, is, a possibly performed automatic stripping of these header
10468 fields already marks the message as being modified.
10469 \*(ID At some future time \*(UA will be capable to rewrite and apply an
10471 to modified messages, and then those fields will be stripped silently.
10475 \*(BO When a message is saved it is usually discarded from the
10476 originating folder when \*(UA is quit.
10477 This setting causes all saved message to be retained.
10480 .It Va line-editor-cpl-word-breaks
10481 \*(OP List of bytes which are used by the
10483 tabulator completion to decide where word boundaries exist, by default
10485 \*(ID This mechanism is yet restricted.
10488 .It Va line-editor-disable
10489 \*(BO Turn off any line editing capabilities (from \*(UAs POW, see
10490 .Sx "On terminal control and line editor"
10494 .It Va line-editor-no-defaults
10495 \*(BO\*(OP Do not establish any default key binding.
10499 Error log message prefix string
10500 .Pf ( Ql "\*(uA: " ) .
10503 .It Va mailbox-display
10504 \*(RO The name of the current mailbox
10505 .Pf ( Ic folder ) ,
10506 possibly abbreviated for display purposes.
10509 .It Va mailbox-resolved
10510 \*(RO The fully resolved path of the current mailbox.
10513 .It Va mailcap-disable
10514 \*(BO\*(OP Turn off consideration of MIME type handlers from,
10515 and implicit loading of
10516 .Sx "The Mailcap files" .
10519 .It Va mailx-extra-rc
10520 An additional startup file that is loaded as the last of the
10521 .Sx "Resource files" .
10522 Use this file for commands that are not understood by other POSIX
10524 implementations, i.e., mostly anything which is not covered by
10525 .Sx "Initial settings" .
10528 .It Va markanswered
10529 \*(BO When a message is replied to and this variable is set,
10530 it is marked as having been
10533 .Sx "Message states" .
10536 .It Va mbox-fcc-and-pcc
10537 \*(BO By default all file and pipe message receivers (see
10539 will be fed valid MBOX database entry message data (see
10541 .Va mbox-rfc4155 ) ,
10542 and existing file targets will become extended in compliance to RFC 4155.
10543 If this variable is unset then a plain standalone RFC 5322 message will
10544 be written, and existing file targets will be overwritten.
10547 .It Va mbox-rfc4155
10548 \*(BO When opening MBOX mailbox databases, and in order to achieve
10549 compatibility with old software, the very tolerant POSIX standard rules
10550 for detecting message boundaries (so-called
10552 lines) are used instead of the stricter rules from the standard RFC 4155.
10553 This behaviour can be switched by setting this variable.
10555 This may temporarily be handy when \*(UA complains about invalid
10557 lines when opening a MBOX: in this case setting this variable and
10558 re-opening the mailbox in question may correct the result.
10559 If so, copying the entire mailbox to some other file, as in
10560 .Ql copy * SOME-FILE ,
10561 will perform proper, all-compatible
10563 quoting for all detected messages, resulting in a valid MBOX mailbox.
10564 (\*(ID The better and non-destructive approach is to re-encode invalid
10565 messages, as if it would be created anew, instead of mangling the
10567 lines; this requires the structural code changes of the v15 rewrite.)
10568 Finally the variable can be unset again:
10569 .Bd -literal -offset indent
10571 localopts yes; wysh set mbox-rfc4155;\e
10572 wysh File "${1}"; copy * "${2}"
10574 call mboxfix /tmp/bad.mbox /tmp/good.mbox
10579 \*(BO Internal development variable.
10580 (Keeps memory debug enabled even if
10585 .It Va message-id-disable
10586 \*(BO By setting this variable the generation of
10590 message and MIME part headers can be completely suppressed, effectively
10591 leaving this task up to the
10593 (Mail-Transfer-Agent) or the SMTP server.
10594 Note that according to RFC 5321 a SMTP server is not required to add this
10595 field by itself, so it should be ensured that it accepts messages without
10599 .It Va message-inject-head
10600 A string to put at the beginning of each new message, followed by a newline.
10601 \*(OB The escape sequences tabulator
10605 are understood (use the
10609 ting the variable(s) instead).
10612 .It Va message-inject-tail
10613 A string to put at the end of each new message, followed by a newline.
10614 \*(OB The escape sequences tabulator
10618 are understood (use the
10622 ting the variable(s) instead).
10624 .Va on-compose-leave .
10628 \*(BO Usually, when an
10630 expansion contains the sender, the sender is removed from the expansion.
10631 Setting this option suppresses these removals.
10636 option to be passed through to the
10638 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
10639 this flag, no MTA is known which does not support it (for historical
10643 .It Va mime-allow-text-controls
10644 \*(BO When sending messages, each part of the message is MIME-inspected
10645 in order to classify the
10648 .Ql Content-Transfer-Encoding:
10650 .Va mime-encoding )
10651 that is required to send this part over mail transport, i.e.,
10652 a computation rather similar to what the
10654 command produces when used with the
10658 This classification however treats text files which are encoded in
10659 UTF-16 (seen for HTML files) and similar character sets as binary
10660 octet-streams, forcefully changing any
10665 .Ql application/octet-stream :
10666 If that actually happens a yet unset charset MIME parameter is set to
10668 effectively making it impossible for the receiving MUA to automatically
10669 interpret the contents of the part.
10671 If this variable is set, and the data was unambiguously identified as
10672 text data at first glance (by a
10676 file extension), then the original
10678 will not be overwritten.
10681 .It Va mime-alternative-favour-rich
10682 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
10683 HTML) will be preferred in favour of included plain text versions when
10684 displaying messages, provided that a handler exists which produces
10685 output that can be (re)integrated into \*(UA's normal visual display.
10688 .It Va mime-counter-evidence
10691 field is used to decide how to handle MIME parts.
10692 Some MUAs, however, do not use
10693 .Sx "The mime.types files"
10695 .Sx "HTML mail and MIME attachments" )
10696 or a similar mechanism to correctly classify content, but specify an
10697 unspecific MIME type
10698 .Pf ( Ql application/octet-stream )
10699 even for plain text attachments.
10700 If this variable is set then \*(UA will try to re-classify such MIME
10701 message parts, if possible, for example via a possibly existing
10702 attachment filename.
10703 A non-empty value may also be given, in which case a number is expected,
10704 actually a carrier of bits, best specified as a binary value, like
10707 .Bl -bullet -compact
10709 If bit two is set (counting from 1, decimal 2) then the detected
10711 will be carried along with the message and be used for deciding which
10712 MIME handler is to be used, for example;
10713 when displaying such a MIME part the part-info will indicate the
10714 overridden content-type by showing a plus sign
10717 If bit three is set (decimal 4) then the counter-evidence is always
10718 produced and a positive result will be used as the MIME type, even
10719 forcefully overriding the parts given MIME type.
10721 If bit four is set (decimal 8) as a last resort the actual content of
10722 .Ql application/octet-stream
10723 parts will be inspected, so that data which looks like plain text can be
10725 This mode is even more relaxed when data is to be displayed to the user
10726 or used as a message quote (data consumers which mangle data for display
10727 purposes, which includes masking of control characters, for example).
10732 .It Va mime-encoding
10734 .Ql Content-Transfer-Encoding
10735 to use in outgoing text messages and message parts, where applicable
10736 (7-bit clean text messages are without an encoding if possible):
10739 .Bl -tag -compact -width ".It Ql _%%_"
10741 .Pf (Or\0 Ql 8b . )
10742 8-bit transport effectively causes the raw data be passed through
10743 unchanged, but may cause problems when transferring mail messages over
10744 channels that are not ESMTP (RFC 1869) compliant.
10745 Also, several input data constructs are not allowed by the
10746 specifications and may cause a different transfer-encoding to be used.
10747 By established rules and popular demand occurrences of
10751 will be MBOXO quoted (prefixed with greater-than sign
10753 instead of causing a non-destructive encoding like
10754 .Ql quoted-printable
10755 to be chosen, unless context (like message signing) requires otherwise.
10757 .It Ql quoted-printable
10758 .Pf (Or\0 Ql qp . )
10759 Quoted-printable encoding is 7-bit clean and has the property that ASCII
10760 characters are passed through unchanged, so that an english message can
10761 be read as-is; it is also acceptable for other single-byte locales that
10762 share many characters with ASCII, for example ISO-8859-1.
10763 The encoding will cause a large overhead for messages in other character
10764 sets: for example it will require up to twelve (12) bytes to encode
10765 a single UTF-8 character of four (4) bytes.
10766 It is the default encoding.
10769 .Pf (Or\0 Ql b64 . )
10770 This encoding is 7-bit clean and will always be used for binary data.
10771 This encoding has a constant input:output ratio of 3:4, regardless of
10772 the character set of the input data it will encode three bytes of input
10773 to four bytes of output.
10774 This transfer-encoding is not human readable without performing
10780 .It Va mime-force-sendout
10781 \*(BO\*(OP Whenever it is not acceptable to fail sending out messages
10782 because of non-convertible character content this variable may be set.
10783 It will, as a last resort, classify the part content as
10784 .Ql application/octet-stream .
10785 Please refer to the section
10786 .Sx "Character sets"
10787 for the complete picture of character set conversion in \*(UA.
10790 .It Va mimetypes-load-control
10791 Can be used to control which of
10792 .Sx "The mime.types files"
10793 are loaded: if the letter
10795 is part of the option value, then the user's personal
10797 file will be loaded (if it exists); likewise the letter
10799 controls loading of the system wide
10801 directives found in the user file take precedence, letter matching is
10803 If this variable is not set \*(UA will try to load both files.
10804 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
10805 but they will be matched last (the order can be listed via
10808 More sources can be specified by using a different syntax: if the
10809 value string contains an equals sign
10811 then it is instead parsed as a comma-separated list of the described
10814 pairs; the given filenames will be expanded and loaded, and their
10815 content may use the extended syntax that is described in the section
10816 .Sx "The mime.types files" .
10817 Directives found in such files always take precedence (are prepended to
10818 the MIME type cache).
10823 Select an alternate Mail-Transfer-Agent by either specifying the full
10824 pathname of an executable (a
10826 prefix may be given), or \*(OPally a SMTP aka SUBMISSION protocol URL \*(IN:
10828 .Dl submissions://[user[:password]@]server[:port]
10831 .Ql [smtp://]server[:port] . )
10832 The default has been chosen at compile time.
10833 MTA data transfers are always performed in asynchronous child processes,
10834 and without supervision unless either the
10840 headers are not passed through to MTAs as part of messages unless
10842 is set (see there); corresponding receivers are addressed by
10843 protocol-specific means or MTA command line options only until then.
10844 \*(OPally expansion of the well-known
10846 .Pf ( Xr aliases 5 )
10847 can also be directly performed by \*(UA.
10850 For testing purposes there is the
10852 pseudo-MTA, which dumps to standard output or optionally to a file,
10854 .Va mbox-fcc-and-pcc :
10856 .Bd -literal -offset indent
10857 $ echo text | \*(uA -:/ -Smta=test -s ubject ex@am.ple
10858 $ </dev/null \*(uA -:/ -Smta=test://./xy ex@am.ple
10862 For a file-based MTA it may be necessary to set
10864 in in order to choose the right target of a modern
10867 It will be passed command line arguments from several possible sources:
10870 if set, from the command line if given and the variable
10873 Argument processing of the MTA will be terminated with a
10878 The otherwise occurring implicit usage of the following MTA command
10879 line arguments can be disabled by setting the boolean variable
10880 .Va mta-no-default-arguments
10881 (which will also disable passing
10885 (for not treating a line with only a dot
10887 character as the end of input),
10889 (shall the variable
10895 variable is set); in conjunction with the
10897 command line option \*(UA will also (not) pass
10899 as well as possibly
10903 \*(OPally \*(UA can send mail over SMTP aka SUBMISSION network
10904 connections to a single defined smart host by setting this variable to
10905 a SMTP or SUBMISSION URL (see
10906 .Sx "On URL syntax and credential lookup" ) .
10907 An authentication scheme can be specified via the variable chain
10909 Encrypted network connections are \*(OPally available, the section
10910 .Sx "Encrypted network communication"
10911 should give an overview and provide links to more information on this.
10912 Note that with some mail providers it may be necessary to set the
10914 variable in order to use a specific combination of
10919 Network communication socket timeouts are configurable via
10920 .Va socket-connect-timeout .
10921 All generated network traffic may be proxied over a SOCKS
10923 it can be logged by setting
10926 The following SMTP variants may be used:
10930 The plain SMTP protocol (RFC 5321) that normally lives on the
10931 server port 25 and requires setting the
10932 .Va smtp-use-starttls
10933 variable to enter a TLS encrypted session state.
10934 Assign a value like \*(IN
10935 .Ql smtp://[user[:password]@]server[:port]
10937 .Ql smtp://server[:port] )
10938 to choose this protocol.
10940 The so-called SMTPS which is supposed to live on server port 465
10941 and is automatically TLS secured.
10942 Unfortunately it never became a standardized protocol and may thus not
10943 be supported by your hosts network service database
10944 \(en in fact the port number has already been reassigned to other
10947 SMTPS is nonetheless a commonly offered protocol and thus can be
10948 chosen by assigning a value like \*(IN
10949 .Ql smtps://[user[:password]@]server[:port]
10951 .Ql smtps://server[:port] ) ;
10952 due to the mentioned problems it is usually necessary to explicitly
10953 specify the port as
10957 The SUBMISSION protocol (RFC 6409) lives on server port 587 and
10958 is identically to the SMTP protocol from \*(UA's point of view;
10959 it requires setting
10960 .Va smtp-use-starttls
10961 to enter a TLS secured session state; e.g., \*(IN
10962 .Ql submission://[user[:password]@]server[:port] .
10964 The SUBMISSIONS protocol (RFC 8314) that lives on server port 465 and is
10965 TLS secured by default.
10966 It can be chosen by assigning a value like \*(IN
10967 .Ql submissions://[user[:password]@]server[:port] .
10968 Due to the problems mentioned for SMTPS above and the fact that
10969 SUBMISSIONS is new and a successor that lives on the same port as the
10970 historical engineering mismanagement named SMTPS, it is usually
10971 necessary to explicitly specify the port as
10978 \*(OP If set to a path pointing to a text file in valid MTA (Postfix)
10980 format, the file is loaded and cached (manageable with
10982 and henceforth plain
10986 message receiver names are recursively expanded as a last expansion
10987 step, after the distribution lists which can be created with
10991 content support: only local addresses (names) which are valid usernames
10992 .Pf ( Ql [a-z_][a-z0-9_-]*[$]? )
10993 are treated as expandable aliases, and \*(ID
10994 .Ql :include:/file/name
10995 directives are not supported.
11000 it can be asserted that only expanded names (mail addresses) are passed
11001 through to the MTA.
11004 .It Va mta-arguments
11005 Arguments to pass through to a file-based
11007 can be given via this variable, which is parsed according to
11008 .Sx "Shell-style argument quoting"
11009 into an array of arguments, and which will be joined onto MTA options
11010 from other sources, and then passed individually to the MTA:
11011 .Ql \&? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
11014 .It Va mta-no-default-arguments
11015 \*(BO Unless this variable is set \*(UA will pass some well known
11016 standard command line options to a file-based
11018 (Mail-Transfer-Agent), see there for more.
11021 .It Va mta-no-receiver-arguments
11022 \*(BO By default a file-based
11024 will be passed all receiver addresses on the command line.
11025 Some MTAs impose special behaviour on such arguments, so setting this
11026 variable will suppress them altogether.
11027 This can make it necessary to pass a
11030 .Va mta-arguments .
11034 Many systems use a so-called
11036 environment to ensure compatibility with
11038 This works by inspecting the name that was used to invoke the mail
11040 If this variable is set then the mailwrapper (the program that is
11041 actually executed when calling the file-based
11043 will treat its contents as that name.
11049 header lines are not passed through since some MTAs do not remove them
11050 before sending them over the wire, in violation of RFC 5322.
11051 (For example Exim and Courier would need to be started with the
11053 command line option to force stripping.)
11054 Setting this enables pass-through, therefore avoids generation of
11055 mutilated message versions, and \*(ID improves performance.
11057 .Mx Va netrc-lookup
11058 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
11059 \*(BO\*(IN\*(OP Used to control usage of the user's
11061 file for lookup of account credentials, as documented in the section
11062 .Sx "On URL syntax and credential lookup"
11063 and for the command
11066 .Sx "The .netrc file"
11067 documents the file format.
11079 then \*(UA will read the output of a shell pipe instead of the user's
11081 file if this variable is set (to the desired shell command).
11082 This can be used to, for example, store
11085 .Ql \&? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
11089 \*(OP If this variable has the value
11091 newly created local folders will be in Maildir instead of MBOX format.
11095 Checks for new mail in the current folder each time the prompt is shown.
11096 A Maildir folder must be re-scanned to determine if new mail has arrived.
11097 If this variable is set to the special value
11099 then a Maildir folder will not be rescanned completely, but only
11100 timestamp changes are detected.
11101 Maildir folders are \*(OPal.
11105 \*(BO Causes a non-absolute filename specified in
11107 as well as the sender-based filenames of the
11113 commands to be interpreted relative to the
11115 directory rather than relative to the current directory.
11117 .Mx Va on-account-cleanup
11118 .It Va on-account-cleanup-ACCOUNT , Va on-account-cleanup
11119 Macro hook which will be called once an
11121 is left, as the very last step before unrolling per-account
11123 This hook is run even in case of fatal errors, including those generated
11124 by switching to the account as such, and it is advisable to perform only
11125 absolutely necessary actions, like cleaning up
11128 The specialized form is used in favour of the generic one if found.
11131 .It Va on-compose-cleanup
11132 Macro hook which will be called after the message has been sent (or not,
11133 in case of failures), as the very last step before unrolling compose mode
11135 This hook is run even in case of fatal errors, and it is advisable to
11136 perform only absolutely necessary actions, like cleaning up
11140 For compose mode hooks that may affect the message content please see
11141 .Va on-compose-enter , on-compose-leave , on-compose-splice .
11142 \*(ID This hook exists because
11143 .Ic alias , alternates , commandalias , shortcut ,
11144 to name a few, are neither covered by
11148 changes applied in compose mode will continue to be in effect thereafter.
11153 .It Va on-compose-enter , on-compose-leave
11154 Macro hooks which will be called once compose mode is entered,
11155 and after composing has been finished, respectively;
11156 the exact order of the steps taken is documented for
11159 .Sx "COMMAND ESCAPES" .
11160 Context about the message being worked on can be queried via
11163 are enabled for these hooks, and changes on variables will be forgotten
11164 after the message has been sent.
11165 .Va on-compose-cleanup
11166 can be used to perform other necessary cleanup steps.
11169 Here is an example that injects a signature via
11170 .Va message-inject-tail ;
11172 .Va on-compose-splice
11173 to simply inject the file of desire via
11177 may be a better approach.
11179 .Bd -literal -offset indent
11181 vput ! i cat ~/.mysig
11183 vput csop message-inject-tail trim-end $i
11187 readctl create ~/.mysig
11191 vput csop message-inject-tail trim-end $i
11193 readctl remove ~/.mysig
11196 set on-compose-leave=t_ocl
11202 .It Va on-compose-splice , on-compose-splice-shell
11203 These hooks run once the normal compose mode is finished, but before the
11204 .Va on-compose-leave
11205 macro hook is called etc.
11206 Both hooks will be executed in a subprocess, with their input and output
11207 connected to \*(UA such that they can act as if they would be an
11209 The difference in between them is that the latter is a
11211 command, whereas the former is a normal
11213 d macro, but which is restricted to a small set of commands (the
11215 output of for example
11217 will indicate said capability).
11219 are enabled for these hooks (in the parent process), causing any setting
11220 to be forgotten after the message has been sent;
11221 .Va on-compose-cleanup
11222 can be used to perform other cleanup as necessary.
11225 During execution of these hooks \*(UA will temporarily forget whether it
11226 has been started in interactive mode, (a restricted set of)
11227 .Sx "COMMAND ESCAPES"
11228 will always be available, and for guaranteed reproducibilities sake
11232 will be set to their defaults.
11233 The compose mode command
11235 has been especially designed for scriptability (via these hooks).
11236 The first line the hook will read on its standard input is the protocol
11237 version of said command escape, currently
11239 backward incompatible protocol changes have to be expected.
11242 Care must be taken to avoid deadlocks and other false control flow:
11243 if both involved processes wait for more input to happen at the
11244 same time, or one does not expect more input but the other is stuck
11245 waiting for consumption of its output, etc.
11246 There is no automatic synchronization of the hook: it will not be
11247 stopped automatically just because it, e.g., emits
11249 The hooks will however receive a termination signal if the parent enters
11250 an error condition.
11251 \*(ID Protection against and interaction with signals is not yet given;
11252 it is likely that in the future these scripts will be placed in an
11253 isolated session, which is signalled in its entirety as necessary.
11255 .Bd -literal -offset indent
11256 define ocs_signature {
11258 echo '~< ~/.mysig' # '~<! fortune pathtofortunefile'
11260 set on-compose-splice=ocs_signature
11262 wysh set on-compose-splice-shell=$'\e
11264 printf "hello $version! Headers: ";\e
11265 echo \e'~^header list\e';\e
11266 read status result;\e
11267 echo "status=$status result=$result";\e
11272 echo Splice protocol version is $version
11273 echo '~^h l'; read hl; vput csop es subs "${hl}" 0 1
11275 echoerr 'Cannot read header list'; echo '~x'; xit
11277 if "$hl" !%?case ' cc'
11278 echo '~^h i cc "Diet is your <mirr.or>"'; read es;\e
11279 vput csop es substring "${es}" 0 1
11281 echoerr 'Cannot insert Cc: header'; echo '~x'
11282 # (no xit, macro finishes anyway)
11286 set on-compose-splice=ocsm
11291 .It Va on-history-addition
11292 This hook will be called if an entry is about to be added to the
11294 of the MLE, as documented in
11295 .Sx "On terminal control and line editor" .
11296 It will be called with three arguments: the first is the name of the
11299 the second is either an empty string or the matching
11301 type, and the third being the complete command line to be added.
11302 The entry will not be added to history if the hook uses a non-0
11304 \*(ID A future version will give the expanded command name as the third
11305 argument, followed by the tokenized command line as parsed in the
11306 remaining arguments, the first of which is the original unexpanded
11307 command name; i.e., one may do
11308 .Ql Ic shift Ns \| 4
11309 and will then be able to access the positional parameters as usual via
11314 .It Va on-main-loop-tick
11315 This hook will be called whenever the program's main event loop is
11316 about to read the next input line.
11317 Note variable and other changes it performs are not scoped as via
11321 .It Va on-program-exit
11322 This hook will be called when the program exits, whether via
11326 or because the send mode is done.
11329 .It Va on-resend-cleanup
11331 .Va on-compose-cleanup ,
11332 but is only triggered by
11336 .It Va on-resend-enter
11338 .Va on-compose-enter ,
11339 but is only triggered by
11341 currently there is no
11343 support, for example.
11347 \*(BO If set, each message feed through the command given for
11349 is followed by a formfeed character
11353 .It Va password-USER@HOST , password-HOST , password
11354 \*(IN Variable chain that sets a password, which is used in case none has
11355 been given in the protocol and account-specific URL;
11356 as a last resort \*(UA will ask for a password on the user's terminal if
11357 the authentication method requires a password.
11358 Specifying passwords in a startup file is generally a security risk;
11359 the file should be readable by the invoking user only.
11361 .It Va password-USER@HOST
11362 \*(OU (see the chain above for \*(IN)
11363 Set the password for
11367 If no such variable is defined for a host,
11368 the user will be asked for a password on standard input.
11369 Specifying passwords in a startup file is generally a security risk;
11370 the file should be readable by the invoking user only.
11374 \*(BO Send messages to the
11376 command without performing MIME and character set conversions.
11380 .It Va pipe-TYPE/SUBTYPE
11381 When a MIME message part of type
11383 (case-insensitive) is displayed or quoted,
11384 its text is filtered through the value of this variable interpreted as
11386 Note that only parts which can be displayed inline as plain text (see
11387 .Cd copiousoutput )
11388 are displayed unless otherwise noted, other MIME parts will only be
11389 considered by and for the command
11393 The special value question mark
11395 forces interpretation of the message part as plain text, for example
11396 .Ql set pipe-application/xml=?
11397 will henceforth display XML
11399 (The same could also be achieved by adding a MIME type marker with the
11402 And \*(OPally MIME type handlers may be defined via
11403 .Sx "The Mailcap files"
11404 \(em these directives,
11406 has already been used, should be referred to for further documentation.
11411 can in fact be used as a trigger character to adjust usage and behaviour
11412 of a following shell command specification more thoroughly by appending
11413 more special characters which refer to further mailcap directives, for
11414 example the following hypothetical command specification could be used:
11416 .Bd -literal -offset indent
11417 ? set pipe-X/Y='?!++=? vim ${MAILX_FILENAME_TEMPORARY}'
11421 .Bl -tag -compact -width ".It Ql __"
11423 The command produces plain text to be integrated in \*(UAs output:
11424 .Cd copiousoutput .
11427 If set the handler will not be invoked when a message is to be quoted,
11428 but only when it will be displayed:
11429 .Cd x-mailx-noquote .
11432 Run the command asynchronously, i.e., without blocking \*(UA:
11433 .Cd x-mailx-async .
11434 The standard output of the command will go to
11438 The command must be run on an interactive terminal, \*(UA will
11439 temporarily release the terminal to it:
11440 .Cd needsterminal .
11443 Request creation of a zero-sized temporary file, the absolute pathname
11444 of which will be made accessible via the environment variable
11445 .Ev MAILX_FILENAME_TEMPORARY :
11446 .Cd x-mailx-tmpfile .
11447 If given twice then the file will be unlinked automatically by \*(UA
11448 when the command loop is entered again at latest:
11449 .Cd x-mailx-tmpfile-unlink ;
11450 it is an error to use automatic deletion in conjunction with
11451 .Cd x-mailx-async .
11454 Normally the MIME part content is passed to the handler via standard
11455 input; if this flag is set then the data will instead be written into
11456 .Ev MAILX_FILENAME_TEMPORARY
11457 .Pf ( Cd x-mailx-tmpfile-fill ) ,
11458 the creation of which is implied; in order to cause automatic deletion
11459 of the temporary file two plus signs
11461 still have to be used.
11464 To avoid ambiguities with normal shell command content another
11465 question mark can be used to forcefully terminate interpretation of
11466 remaining characters.
11467 (Any character not in this list will have the same effect.)
11471 Some information about the MIME part to be displayed is embedded into
11472 the environment of the shell command:
11475 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
11477 .It Ev MAILX_CONTENT
11478 The MIME content-type of the part, if known, the empty string otherwise.
11481 .It Ev MAILX_CONTENT_EVIDENCE
11483 .Va mime-counter-evidence
11484 includes the carry-around-bit (2), then this will be set to the detected
11485 MIME content-type; not only then identical to
11486 .Ev \&\&MAILX_CONTENT
11490 .It Ev MAILX_EXTERNAL_BODY_URL
11492 .Ql message/external-body access-type=url
11493 will store the access URL in this variable, it is empty otherwise.
11494 URL targets should not be activated automatically, without supervision.
11497 .It Ev MAILX_FILENAME
11498 The filename, if any is set, the empty string otherwise.
11501 .It Ev MAILX_FILENAME_GENERATED
11505 .It Ev MAILX_FILENAME_TEMPORARY
11506 If temporary file creation has been requested through the command prefix
11507 this variable will be set and contain the absolute pathname of the
11513 .It Va pipe-EXTENSION
11514 This is identical to
11515 .Va pipe-TYPE/SUBTYPE
11518 (normalized to lowercase using character mappings of the ASCII charset)
11519 names a file extension, for example
11521 Handlers registered using this method take precedence.
11524 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
11525 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
11526 Supported are the default
11533 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
11538 for TLS secured connections which pass a client certificate via
11539 .Va tls-config-pairs .
11540 There may be the \*(OPal method \*(IN
11543 does not need any user credentials,
11549 the remains also require a
11552 solely builds upon the credentials passed via a client certificate,
11553 and is usually the way to go since tested servers do not actually follow
11554 RFC 4422, and fail if additional credentials are actually passed.
11559 method will \*(OPally be replaced with APOP if possible (see there).
11561 .Mx Va pop3-bulk-load
11562 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
11563 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
11564 the messages, and only requests the message bodies on user request.
11565 For the POP3 protocol this means that the message headers will be
11567 If this variable is set then \*(UA will download only complete messages
11568 from the given POP3 server(s) instead.
11570 .Mx Va pop3-keepalive
11571 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
11572 \*(OP POP3 servers close the connection after a period of inactivity;
11573 the standard requires this to be at least 10 minutes,
11574 but practical experience may vary.
11575 Setting this variable to a numeric value greater than
11579 command to be sent each value seconds if no other operation is performed.
11581 .Mx Va pop3-no-apop
11582 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
11583 \*(BO\*(OP Unless this variable is set the MD5 based
11585 authentication method will be used instead of a chosen
11588 when connecting to a POP3 server that advertises support.
11591 is that only a single packet is sent for the user/password tuple.
11592 (Originally also that the password is not sent in clear text over the
11593 wire, but for one MD5 does not any longer offer sufficient security,
11594 and then today transport is almost ever TLS secured.)
11596 .Va pop3-no-apop-HOST
11599 .Mx Va pop3-use-starttls
11600 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
11601 \*(BO\*(OP Causes \*(UA to issue a
11603 command to make an unencrypted POP3 session TLS encrypted.
11604 This functionality is not supported by all servers,
11605 and is not used if the session is already encrypted by the POP3S method.
11607 .Va pop3-use-starttls-HOST
11613 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
11614 where that deviates from standardized behaviour.
11615 It is automatically squared with the environment variable
11616 .Ev POSIXLY_CORRECT ,
11617 changing the one will adjust the other.
11618 The following behaviour is covered and enforced by this mechanism:
11621 .Bl -bullet -compact
11623 In non-interactive mode, any error encountered while loading resource
11624 files during program startup will cause a program exit, whereas in
11625 interactive mode such errors will stop loading of the currently loaded
11626 (stack of) file(s, i.e., recursively).
11627 These exits can be circumvented on a per-command base by using
11630 .Sx "Command modifiers" ,
11631 for each command which shall be allowed to fail.
11635 will replace the list of alternate addresses instead of appending to it.
11636 In addition alternates will only be honoured for any sort of message
11641 The variable inserting
11642 .Sx "COMMAND ESCAPES"
11648 will expand embedded character sequences
11650 horizontal tabulator and
11653 \*(ID For compatibility reasons this step will always be performed.
11656 Reading in messages via
11658 .Pf ( Sx "COMMAND ESCAPES" )
11667 Upon changing the active
11671 will be displayed even if
11678 implies the behaviour described by
11684 is extended to cover any empty mailbox, not only empty
11686 .Sx "primary system mailbox" Ns
11687 es: they will be removed when they are left in empty state otherwise.
11692 .It Va print-alternatives
11693 \*(BO When a MIME message part of type
11694 .Ql multipart/alternative
11695 is displayed and it contains a subpart of type
11697 other parts are normally discarded.
11698 Setting this variable causes all subparts to be displayed,
11699 just as if the surrounding part was of type
11700 .Ql multipart/mixed .
11704 The string used as a prompt in interactive mode.
11705 Whenever the variable is evaluated the value is treated as if specified
11706 within dollar-single-quotes (see
11707 .Sx "Shell-style argument quoting" ) .
11708 This (post-assignment, i.e., second) expansion can be used to embed
11709 status information, for example
11714 .Va mailbox-display .
11716 In order to embed characters which should not be counted when
11717 calculating the visual width of the resulting string, enclose the
11718 characters of interest in a pair of reverse solidus escaped brackets:
11720 a slot for coloured prompts is also available with the \*(OPal command
11722 Prompting may be prevented by setting this to the null string
11724 .Ql set noprompt ) .
11728 This string is used for secondary prompts, but is otherwise identical to
11735 \*(BO Suppresses the printing of the version when first invoked.
11739 If set messages processed by
11742 and variants will be prefixed with the quoted original message,
11743 the lines of which prefixed by
11745 taking into account
11749 No headers will be quoted when set without value or if the value is
11756 selection will be included in the quotation,
11757 whereas all headers and all MIME parts are included for
11759 The quoted message will be enclosed by the expansions of
11760 .Va quote-inject-head
11762 .Va quote-inject-tail .
11765 .Va quote-as-attachment
11769 .Sx "COMMAND ESCAPES" .
11772 .It Va quote-add-cc
11773 \*(BO Whether the sender of a message quoted via
11775 shall be added to the messages'
11780 .It Va quote-as-attachment
11781 \*(BO Add the original message in its entirety as a
11783 MIME attachment when replying to a message.
11784 Note this works regardless of the setting of
11789 Can be set to a string consisting of non-whitespace ASCII characters
11790 which shall be treated as quotation leaders, the default being
11795 \*(OP Can be set in addition to
11797 and creates a more fancy quotation in that leading quotation characters
11798 .Pf ( Va quote-chars )
11799 are compressed and overlong lines are folded.
11801 can be set to either one, two or three (space separated) numeric values,
11802 which are interpreted as the maximum (goal) and the minimum line length,
11803 respectively, in a spirit rather equal to the
11805 program, but line- instead of paragraph-based.
11806 The third value is used as the maximum line length instead of the first
11807 if no better break point can be found; it is ignored unless it is larger
11808 than the minimum and smaller than the maximum.
11809 If not set explicitly the minimum will reflect the goal algorithmically.
11810 The goal cannot be smaller than the length of
11812 plus some additional pad; necessary adjustments take place silently.
11817 .It Va quote-inject-head , quote-inject-tail
11818 The strings to put before and after the text of a
11820 d message, if non-empty, and respectively.
11821 The former defaults to
11822 .Ql %f wrote:\en\en .
11823 Special format directives will be expanded if possible, and if so
11824 configured the output will be folded according to
11826 Format specifiers in the given strings start with a percent sign
11828 and expand values of the original message, unless noted otherwise.
11829 Note that names and addresses are not subject to the setting of
11831 Valid format specifiers are:
11834 .Bl -tag -compact -width ".It Ql _%%_"
11836 A plain percent sign.
11838 The address(es) of the sender(s).
11840 The date found in the
11842 header of the message when
11844 is set (the default), otherwise the date when the message was received.
11845 Formatting can be controlled by assigning a
11850 .Va datefield-markout-older ) .
11852 The full name(s) (name and address, as given) of the sender(s).
11857 The real name(s) of the sender(s) if there is one and
11859 allows usage, the address(es) otherwise.
11861 The senders real name(s) if there is one, the address(es) otherwise.
11866 .It Va r-option-implicit
11867 \*(BO Setting this option evaluates the contents of
11869 (or, if that contains multiple addresses,
11871 and passes the results onto the used (file-based) MTA as described for the
11873 option (empty argument case).
11876 .It Va recipients-in-cc
11883 as well as addressees which possibly came in via
11886 .Ql Mail-Followup-To:
11887 are by default merged into the new
11889 If this variable is set a sensitive algorithm tries to place in
11891 only the sender of the message being replied to, others are placed in
11896 Unless this variable is defined, no copies of outgoing mail will be saved.
11897 If defined it gives the pathname, subject to the usual
11898 .Sx "Filename transformations" ,
11899 of a folder where all new, replied-to or forwarded messages are saved:
11900 when saving to this folder fails the message is not sent, but instead
11904 The standard defines that relative (fully expanded) paths are to be
11905 interpreted relative to the current directory
11907 to force interpretation relative to
11910 needs to be set in addition.
11913 .It Va record-files
11914 \*(BO If this variable is set the meaning of
11916 will be extended to cover messages which target only file and pipe
11919 These address types will not appear in recipient lists unless
11920 .Va add-file-recipients
11924 .It Va record-resent
11925 \*(BO If this variable is set the meaning of
11927 will be extended to also cover the
11934 .It Va reply-in-same-charset
11935 \*(BO If this variable is set \*(UA first tries to use the same
11936 character set of the original message for replies.
11937 If this fails, the mechanism described in
11938 .Sx "Character sets"
11939 is evaluated as usual.
11942 .It Va reply-strings
11943 Can be set to a comma-separated list of (case-insensitive according to
11944 ASCII rules) strings which shall be recognized in addition to the
11945 built-in strings as
11947 reply message indicators \(en built-in are
11949 which is mandated by RFC 5322, as well as the german
11954 which often has been seen in the wild;
11955 I.e., the separating colon has to be specified explicitly.
11959 A list of addresses to put into the
11961 field of the message header.
11962 Members of this list are handled as if they were in the
11971 .It Va reply-to-honour
11974 header is honoured when replying to a message via
11981 if set without a value it defaults to
11985 .It Va reply-to-swap-in
11986 Standards like DKIM and (in conjunction with) DMARC caused many
11987 .Sx "Mailing lists"
11988 to use sender address rewriting in the style of
11989 .Ql Name via List <list@address> ,
11990 where the original sender address often being placed in
11992 If this is set and a
11994 exists then that is used in place of the pretended sender.
11995 This works independently from
11996 .Va reply-to-honour .
11997 The optional value, a comma-separated list of strings, offers more
11998 fine-grained control on when swapping shall be used; for now supported is
12000 here swapping occurs if the sender is a mailing-list as defined by
12004 .It Va rfc822-body-from_
12005 \*(BO This variable can be used to force displaying a so-called
12007 line for messages that are embedded into an envelope mail via the
12009 MIME mechanism, for more visual convenience, also see
12014 \*(BO Enable saving of (partial) messages in
12016 upon interrupt or delivery error.
12020 The number of lines that represents a
12029 line display and scrolling via
12031 If this variable is not set \*(UA falls back to a calculation based upon
12032 the detected terminal window size and the baud rate: the faster the
12033 terminal, the more will be shown.
12034 Overall screen dimensions and pager usage is influenced by the
12035 environment variables
12043 .It Va searchheaders
12044 \*(BO Expand message list specifiers in the form
12046 to all messages containing the substring
12048 in the header field
12050 The string search is case insensitive.
12053 .It Va sendcharsets
12054 \*(OP A comma-separated list of character set names that can be used in
12055 outgoing internet mail.
12056 The value of the variable
12058 is automatically appended to this list of character sets.
12059 If no character set conversion capabilities are compiled into \*(UA then
12060 the only supported charset is
12063 .Va sendcharsets-else-ttycharset
12064 and refer to the section
12065 .Sx "Character sets"
12066 for the complete picture of character set conversion in \*(UA.
12069 .It Va sendcharsets-else-ttycharset
12070 \*(BO\*(OP If this variable is set, but
12072 is not, then \*(UA acts as if
12074 had been set to the value of the variable
12076 In effect this combination passes through the message data in the
12077 character set of the current locale encoding:
12078 therefore mail message text will be (assumed to be) in ISO-8859-1
12079 encoding when send from within a ISO-8859-1 locale, and in UTF-8
12080 encoding when send from within an UTF-8 locale.
12084 never comes into play as
12086 is implicitly assumed to be 8-bit and capable to represent all files the
12087 user may specify (as is the case when no character set conversion
12088 support is available in \*(UA and the only supported character set is
12091 .Sx "Character sets" ) .
12092 This might be a problem for scripts which use the suggested
12094 setting, since in this case the character set is US-ASCII by definition,
12095 so that it is better to also override
12097 then; and/or do something like the following in the resource file:
12098 .Bd -literal -offset indent
12099 if [ "$LC_ALL" == C ] || [ "$LC_CTYPE" == C ]
12100 unset sendcharsets-else-ttycharset
12106 An address that is put into the
12108 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
12109 responsible for the actual transmission of the message.
12110 This field should normally not be used unless the
12112 field contains more than one address, on which case it is required.
12113 \*(ID Please expect automatic management of the
12118 Dependent on the context this address is handled as if it were in
12123 .Va r-option-implicit .
12126 \*(OB Predecessor of
12129 .It Va sendmail-arguments
12130 \*(OB Predecessor of
12131 .Va mta-arguments .
12133 .It Va sendmail-no-default-arguments
12134 \*(OB\*(BO Predecessor of
12135 .Va mta-no-default-arguments .
12137 .It Va sendmail-progname
12138 \*(OB Predecessor of
12143 Sending messages to the chosen
12145 or to command-pipe receivers (see
12146 .Sx "On sending mail, and non-interactive mode" )
12147 will be performed asynchronously.
12148 This means that only startup errors of the respective program will be
12149 recognizable, but no delivery errors.
12150 Also, no guarantees can be made as to when the respective program will
12151 actually run, as well as to when they will have produced output.
12153 If this variable is set then child program exit is waited for, and its
12154 exit status code is used to decide about success.
12155 Remarks: in conflict with the POSIX standard this variable is built-in
12156 to be initially set.
12157 Another difference is that it can have a value, which is interpreted as
12158 a comma-separated list of case-insensitive strings naming specific
12159 subsystems for which synchronousness shall be ensured (only).
12160 Possible values are
12166 for command-pipe receivers.
12170 \*(BO This setting causes \*(UA to start at the last message
12171 instead of the first one when opening a mail folder, as well as with
12178 \*(BO Causes \*(UA to use the sender's real name instead of the plain
12179 address in the header field summary and in message specifications.
12183 \*(BO Causes the recipient of the message to be shown in the header
12184 summary if the message was sent by the user.
12191 .Sx "COMMAND ESCAPES" .
12193 .Va message-inject-tail ,
12194 .Va on-compose-leave
12196 .Va on-compose-splice .
12203 .Sx "COMMAND ESCAPES" .
12205 .Va message-inject-tail ,
12206 .Va on-compose-leave
12208 .Va on-compose-splice .
12213 .Va on-compose-splice
12215 .Va on-compose-splice-shell
12217 .Va on-compose-leave
12219 .Va message-inject-tail
12223 .It Va skipemptybody
12224 \*(BO If an outgoing message does not contain any text in its first or
12225 only message part, do not send it but discard it silently (see also the
12226 command line option
12231 .It Va smime-ca-dir , smime-ca-file
12232 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
12233 Enhanced Mail) for the purpose of verification of S/MIME signed messages.
12235 documents the necessary preparation steps to use the former.
12236 The set of CA certificates which are built into the TLS library can
12237 be explicitly turned off by setting
12238 .Va smime-ca-no-defaults ,
12239 and further fine-tuning is possible via
12240 .Va smime-ca-flags .
12243 .It Va smime-ca-flags
12244 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
12245 storage, and the certificate verification that is used.
12246 The actual values and their meanings are documented for
12250 .It Va smime-ca-no-defaults
12251 \*(BO\*(OP Do not load the default CA locations that are built into the
12252 used to TLS library to verify S/MIME signed messages.
12254 .Mx Va smime-cipher
12255 .It Va smime-cipher-USER@HOST , smime-cipher
12256 \*(OP Specifies the cipher to use when generating S/MIME encrypted
12257 messages (for the specified account).
12258 RFC 5751 mandates a default of
12261 Possible values are (case-insensitive and) in decreasing cipher strength:
12269 (DES EDE3 CBC, 168 bits; default if
12271 is not available) and
12273 (DES CBC, 56 bits).
12275 The actually available cipher algorithms depend on the cryptographic
12276 library that \*(UA uses.
12277 \*(OP Support for more cipher algorithms may be available through
12278 dynamic loading via
12279 .Xr EVP_get_cipherbyname 3
12280 (OpenSSL) if \*(UA has been compiled to support this.
12283 .It Va smime-crl-dir
12284 \*(OP Specifies a directory that contains files with CRLs in PEM format
12285 to use when verifying S/MIME messages.
12288 .It Va smime-crl-file
12289 \*(OP Specifies a file that contains a CRL in PEM format to use when
12290 verifying S/MIME messages.
12293 .It Va smime-encrypt-USER@HOST
12294 \*(OP If this variable is set, messages send to the given receiver are
12295 encrypted before sending.
12296 The value of the variable must be set to the name of a file that
12297 contains a certificate in PEM format.
12299 If a message is sent to multiple recipients,
12300 each of them for whom a corresponding variable is set will receive an
12301 individually encrypted message;
12302 other recipients will continue to receive the message in plain text
12304 .Va smime-force-encryption
12306 It is recommended to sign encrypted messages, i.e., to also set the
12309 .Va content-description-smime-message
12310 will be inspected for messages which become encrypted.
12313 .It Va smime-force-encryption
12314 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
12318 \*(BO\*(OP S/MIME sign outgoing messages with the user's
12320 private key and include the users certificate as a MIME attachment.
12321 Signing a message enables a recipient to verify that the sender used
12322 a valid certificate,
12323 that the email addresses in the certificate match those in the message
12324 header and that the message content has not been altered.
12325 It does not change the message text,
12326 and people will be able to read the message as usual.
12327 .Va content-description-smime-signature
12330 .Va smime-sign-cert , smime-sign-include-certs
12332 .Va smime-sign-digest .
12334 .Mx Va smime-sign-cert
12335 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
12336 \*(OP Points to a file in PEM format.
12337 For the purpose of signing and decryption this file needs to contain the
12338 user's private key, followed by his certificate.
12340 For message signing
12342 is always derived from the value of
12344 (or, if that contains multiple addresses,
12346 For the purpose of encryption the recipients public encryption key
12347 (certificate) is expected; the command
12349 can be used to save certificates of signed messages (the section
12350 .Sx "Signed and encrypted messages with S/MIME"
12351 gives some details).
12352 This mode of operation is usually driven by the specialized form.
12354 When decrypting messages the account is derived from the recipient
12359 of the message, which are searched for addresses for which such
12361 \*(UA always uses the first address that matches,
12362 so if the same message is sent to more than one of the user addresses
12363 using different encryption keys, decryption might fail.
12365 Password-encrypted keys may be used for signing and decryption.
12366 Automated password lookup is possible via the
12368 .Ql USER@HOST.smime-cert-key
12369 for the private key, and
12370 .Ql USER@HOST.smime-cert-cert
12371 for the certificate stored in the same file.
12372 For example, the hypothetical address
12374 could be driven with a private key / certificate pair path defined in
12375 .Va \&\&smime-sign-cert-bob@exam.ple ,
12376 and the needed passwords would then be looked up as
12377 .Ql bob@exam.ple.smime-cert-key
12379 .Ql bob@exam.ple.smime-cert-cert .
12380 When decrypting the value of
12382 will be tried as a fallback to provide the necessary
12384 To include intermediate certificates, use
12385 .Va smime-sign-include-certs .
12386 The possible password sources are documented in
12387 .Sx "On URL syntax and credential lookup" .
12389 .Mx Va smime-sign-digest
12390 .It Va smime-sign-digest-USER@HOST , smime-sign-digest
12391 \*(OP Specifies the message digest to use when signing S/MIME messages.
12392 Please remember that for this use case
12394 refers to the variable
12396 (or, if that contains multiple addresses,
12398 The available algorithms depend on the used cryptographic library, but
12399 at least one usable built-in algorithm is ensured as a default.
12400 If possible the standard RFC 5751 will be violated by using
12402 instead of the mandated
12404 due to security concerns.
12406 \*(UA will try to add built-in support for the following message
12407 digests, names are case-insensitive:
12414 as well as the widely available
12419 and the proposed insecure
12423 More digests may \*(OPally be available through dynamic loading via the
12425 .Xr EVP_get_digestbyname 3 .
12427 .Mx Va smime-sign-include-certs
12428 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
12429 \*(OP If used, this is supposed to a consist of a comma-separated list
12430 of files, each of which containing a single certificate in PEM format to
12431 be included in the S/MIME message in addition to the
12432 .Va smime-sign-cert
12434 This can be used to include intermediate certificates of the certificate
12435 authority, in order to allow the receiver's S/MIME implementation to
12436 perform a verification of the entire certificate chain, starting from
12437 a local root certificate, over the intermediate certificates, down to the
12438 .Va smime-sign-cert .
12439 Even though top level certificates may also be included in the chain,
12440 they will not be used for the verification on the receiver's side.
12442 For the purpose of the mechanisms involved here,
12444 refers to the content of the internal variable
12446 (or, if that contains multiple addresses,
12449 .Ql USER@HOST.smime-include-certs
12450 will be used for performing password lookups for these certificates,
12451 shall they have been given one, therefore the lookup can be automated
12452 via the mechanisms described in
12453 .Sx "On URL syntax and credential lookup" .
12455 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
12456 \*(OB\*(OP Predecessor(s) of
12457 .Va smime-sign-digest .
12460 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
12462 \*(ID For compatibility reasons a set
12464 is used in preference of
12468 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
12469 \*(OP Variable chain that controls the SMTP
12471 authentication method, possible values are
12482 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" )
12487 for TLS secured connections which pass a client certificate via
12488 .Va tls-config-pairs .
12489 There may be the \*(OPal methods
12496 do not need any user credentials,
12500 require a user name, and all other methods require a
12505 solely builds upon the credentials passed via a client certificate,
12506 and is usually the way to go since tested servers do not actually follow
12507 RFC 4422 aka RFC 4954, and fail if additional credentials are passed.
12514 .Va smtp-auth-password
12516 .Va smtp-auth-user .
12518 .Va smtp-auth-USER@HOST :
12519 may override dependent on sender address in the variable
12522 .It Va smtp-auth-password
12523 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
12524 If the authentication method requires a password, but neither
12525 .Va smtp-auth-password
12527 .Va smtp-auth-password-USER@HOST
12529 \*(UA will ask for a password on the user's terminal.
12531 .It Va smtp-auth-password-USER@HOST
12533 .Va smtp-auth-password
12534 for specific values of sender addresses, dependent upon the variable
12537 .It Va smtp-auth-user
12538 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
12539 If the authentication method requires a user name, but neither
12542 .Va smtp-auth-user-USER@HOST
12544 \*(UA will ask for a user name on the user's terminal.
12546 .It Va smtp-auth-user-USER@HOST
12549 for specific values of sender addresses, dependent upon the variable
12553 .It Va smtp-hostname
12554 \*(OP\*(IN Normally \*(UA uses the variable
12556 to derive the necessary
12558 information in order to issue a
12565 can be used to use the
12567 from the SMTP account
12575 if the empty string is given, or the local hostname as a last resort).
12576 This often allows using an address that is itself valid but hosted by
12577 a provider other than from which (in
12579 the message is sent.
12580 Setting this variable also influences generated
12585 If the \*(OPal IDNA support is available (see
12587 variable assignment is aborted when a necessary conversion fails.
12589 .Mx Va smtp-use-starttls
12590 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
12591 \*(BO\*(OP Causes \*(UA to issue a
12593 command to make an SMTP
12595 session TLS encrypted, i.e., to enable transport layer security.
12598 .It Va socket-connect-timeout
12599 \*(OP A positive number that defines the timeout to wait for
12600 establishing a socket connection before forcing
12601 .Va ^ERR Ns -TIMEDOUT .
12604 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
12605 \*(OP If set to the URL of a SOCKS5 server then all network activities
12606 are proxied through it, except for the single DNS name lookup necessary
12607 to resolve the proxy URL (unnecessary when given an already resolved IP
12609 It is automatically squared with the environment variable
12611 changing the one will adjust the other.
12612 This example creates a local SOCKS5 proxy on port 10000 that forwards to
12617 and from which actual network traffic happens:
12618 .Bd -literal -offset indent
12619 $ ssh -D 10000 USER@HOST
12620 $ \*(uA -Ssocks-proxy=[socks5://]localhost:10000
12621 # or =localhost:10000; no local DNS: =127.0.0.1:10000
12625 .It Va spam-interface
12626 \*(OP In order to use any of the spam-related commands (like
12628 the desired spam interface must be defined by setting this variable.
12629 Please refer to the manual section
12630 .Sx "Handling spam"
12631 for the complete picture of spam handling in \*(UA.
12632 All or none of the following interfaces may be available:
12634 .Bl -tag -width ".It Ql _ilte_"
12640 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
12642 Different to the generic filter interface \*(UA will automatically add
12643 the correct arguments for a given command and has the necessary
12644 knowledge to parse the program's output.
12645 A default value for
12647 will have been compiled into the \*(UA binary if
12651 during compilation.
12652 Shall it be necessary to define a specific connection type (rather than
12653 using a configuration file for that), the variable
12654 .Va spamc-arguments
12655 can be used as in for example
12656 .Ql -d server.example.com -p 783 .
12657 It is also possible to specify a per-user configuration via
12659 Note that this interface does not inspect the
12661 flag of a message for the command
12665 generic spam filter support via freely configurable hooks.
12666 This interface is meant for programs like
12668 and requires according behaviour in respect to the hooks' exit
12669 status for at least the command
12672 meaning a message is spam,
12676 for unsure and any other return value indicating a hard error);
12677 since the hooks can include shell code snippets diverting behaviour
12678 can be intercepted as necessary.
12680 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
12683 .Va spamfilter-spam ;
12685 .Sx "Handling spam"
12686 contains examples for some programs.
12687 The process environment of the hooks will have the variable
12688 .Ev MAILX_FILENAME_GENERATED
12690 Note that spam score support for
12692 is not supported unless the \*(OPtional regular expression support is
12694 .Va spamfilter-rate-scanscore
12700 .It Va spam-maxsize
12701 \*(OP Messages that exceed this size will not be passed through to the
12703 .Va spam-interface .
12704 If unset or 0, the default of 420000 bytes is used.
12707 .It Va spamc-command
12708 \*(OP The path to the
12712 .Va spam-interface .
12713 Note that the path is not expanded, but used
12715 A fallback path will have been compiled into the \*(UA binary if the
12716 executable had been found during compilation.
12719 .It Va spamc-arguments
12720 \*(OP Even though \*(UA deals with most arguments for the
12723 automatically, it may at least sometimes be desirable to specify
12724 connection-related ones via this variable, for example
12725 .Ql -d server.example.com -p 783 .
12729 \*(OP Specify a username for per-user configuration files for the
12731 .Va spam-interface .
12732 If this is set to the empty string then \*(UA will use the name of the
12741 .It Va spamfilter-ham , spamfilter-noham , \
12742 spamfilter-nospam , spamfilter-rate , spamfilter-spam
12743 \*(OP Command and argument hooks for the
12745 .Va spam-interface .
12747 .Sx "Handling spam"
12748 contains examples for some programs.
12751 .It Va spamfilter-rate-scanscore
12752 \*(OP Because of the generic nature of the
12755 spam scores are not supported for it by default, but if the \*(OPnal
12756 regular expression support is available then setting this variable can
12757 be used to overcome this restriction.
12758 It is interpreted as follows: first a number (digits) is parsed that
12759 must be followed by a semicolon
12761 and an extended regular expression.
12762 Then the latter is used to parse the first output line of the
12763 .Va spamfilter-rate
12764 hook, and, in case the evaluation is successful, the group that has been
12765 specified via the number is interpreted as a floating point scan score.
12767 .It Va ssl-ca-dir-USER@HOST , ssl-ca-dir-HOST , ssl-ca-dir ,\
12768 ssl-ca-file-USER@HOST , ssl-ca-file-HOST , ssl-ca-file
12769 \*(OB\*(OP Predecessors of
12773 .It Va ssl-ca-flags-USER@HOST , ssl-ca-flags-HOST , ssl-ca-flags
12774 \*(OB\*(OP Predecessor of
12777 .It Va ssl-ca-no-defaults-USER@HOST , ssl-ca-no-defaults-HOST ,\
12779 \*(OB\*(BO\*(OP Predecessor of
12780 .Va tls-ca-no-defaults .
12782 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
12783 \*(OB\*(OP Please use the
12786 .Va tls-config-pairs .
12788 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
12789 \*(OB\*(OP Please use the
12792 .Va tls-config-pairs .
12794 .It Va ssl-config-file
12795 \*(OB\*(OP Predecessor of
12796 .Va tls-config-file .
12798 .It Va ssl-config-module-USER@HOST , ssl-config-module-HOST ,\
12800 \*(OB\*(OP Predecessor of
12801 .Va tls-config-module .
12803 .It Va ssl-config-pairs-USER@HOST , ssl-config-pairs-HOST , ssl-config-pairs
12804 \*(OB\*(OP Predecessor of
12805 .Va tls-config-pairs .
12807 .It Va ssl-crl-dir , ssl-crl-file
12808 \*(OB\*(OP Predecessors of
12812 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
12813 \*(OB\*(OP Please use the
12816 .Va tls-config-pairs .
12818 .It Va ssl-features
12819 \*(OB\*(OP\*(RO Predecessor of
12822 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
12823 \*(OB\*(OP Please use the
12826 .Va tls-config-pairs .
12828 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
12829 \*(OB\*(OP Please use the
12832 .Va tls-config-pairs .
12834 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
12835 \*(OB\*(OP Please use the
12838 .Va tls-config-pairs .
12840 .It Va ssl-rand-file
12841 \*(OB\*(OP Predecessor of
12842 .Va tls-rand-file .
12844 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
12845 \*(OB\*(OP Predecessor of
12850 If only set without an assigned value, then this setting inhibits the
12856 header fields that include obvious references to \*(UA.
12857 There are two pitfalls associated with this:
12858 First, the message id of outgoing messages is not known anymore.
12859 Second, an expert may still use the remaining information in the header
12860 to track down the originating mail user agent.
12861 If set to the value
12867 suppression does not occur.
12870 .It Va system-mailrc
12871 \*(RO The compiled in path of the system wide initialization file
12873 .Sx "Resource files" :
12879 (\*(OP) This specifies a comma-separated list of
12884 .Sx "On terminal control and line editor" ,
12885 escape commas with reverse solidus) to be used to overwrite or define
12888 this variable will only be queried once at program startup and can
12889 thus only be specified in resource files or on the command line.
12892 String capabilities form
12894 pairs and are expected unless noted otherwise.
12895 Numerics have to be notated as
12897 where the number is expected in normal decimal notation.
12898 Finally, booleans do not have any value but indicate a true or false
12899 state simply by being defined or not; this indeed means that \*(UA
12900 does not support undefining an existing boolean.
12901 String capability values will undergo some expansions before use:
12902 for one notations like
12905 .Ql control-LETTER ,
12906 and for clarification purposes
12908 can be used to specify
12910 (the control notation
12912 could lead to misreadings when a left bracket follows, which it does for
12913 the standard CSI sequence);
12914 finally three letter octal sequences, as in
12917 To specify that a terminal supports 256-colours, and to define sequences
12918 that home the cursor and produce an audible bell, one might write:
12920 .Bd -literal -offset indent
12921 ? set termcap='Co#256,home=\eE[H,bel=^G'
12925 The following terminal capabilities are or may be meaningful for the
12926 operation of the built-in line editor or \*(UA in general:
12929 .Bl -tag -compact -width ".It Cd yay"
12931 .Cd auto_right_margin :
12932 boolean which indicates if the right margin needs special treatment; the
12934 capability is related, for more see
12937 .It Cd clear Ns \0or Cd cl
12939 clear the screen and home cursor.
12940 (Will be simulated via
12946 .It Cd colors Ns \0or Cd Co
12948 numeric capability specifying the maximum number of colours.
12949 Note that \*(UA does not actually care about the terminal beside that,
12950 but always emits ANSI / ISO 6429 escape sequences; also see
12954 .Cd carriage_return :
12955 move to the first column in the current row.
12956 The default built-in fallback is
12959 .It Cd cub1 Ns \0or Cd le
12961 move the cursor left one space (non-destructively).
12962 The default built-in fallback is
12965 .It Cd cuf1 Ns \0or Cd nd
12967 move the cursor right one space (non-destructively).
12968 The default built-in fallback is
12970 which is used by most terminals.
12976 .It Cd ed Ns \0or Cd cd
12981 .It Cd el Ns \0or Cd ce
12983 clear to the end of line.
12984 (Will be simulated via
12986 plus repetitions of space characters.)
12988 .It Cd home Ns \0or Cd ho
12992 .It Cd hpa Ns \0or Cd ch
12993 .Cd column_address :
12994 move the cursor (to the given column parameter) in the current row.
12995 (Will be simulated via
13000 .\" mx_HAVE_TERMCAP
13001 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
13004 .Cd enter_ca_mode ,
13005 respectively: exit and enter the alternative screen ca-mode,
13006 effectively turning \*(UA into a fullscreen application.
13007 This must be enabled explicitly by setting
13008 .Va termcap-ca-mode .
13010 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
13014 respectively: enable and disable the keypad.
13015 This is always enabled if available, because it seems even keyboards
13016 without keypads generate other key codes for, e.g., cursor keys in that
13017 case, and only if enabled we see the codes that we are interested in.
13019 .It Cd xenl Ns \0or Cd xn
13020 .Cd eat_newline_glitch :
13021 boolean which indicates whether a newline written in the last column of an
13022 .Cd auto_right_margin
13023 indicating terminal is ignored.
13024 With it the full terminal width is available even on autowrap terminals.
13028 Many more capabilities which describe key-sequences are documented for
13033 .It Va termcap-ca-mode
13034 \*(OP Allow usage of the
13039 abilities in order to enter an alternative exclusive screen, the
13040 so-called ca-mode; this usually requires special configuration of the
13042 also dependent on the value of
13045 this variable will only be queried once at program startup and can
13046 thus only be specified in resource files or on the command line.
13049 .It Va termcap-disable
13050 \*(OP Disable any interaction with a terminal control library.
13051 If set only some generic fallback built-ins and possibly the content of
13053 describe the terminal to \*(UA.
13055 this variable will only be queried once at program startup and can
13056 thus only be specified in resource files or on the command line.
13060 .It Va tls-ca-dir-USER@HOST , tls-ca-dir-HOST , tls-ca-dir ,\
13061 tls-ca-file-USER@HOST , tls-ca-file-HOST , tls-ca-file
13062 \*(OP Directory and file, respectively, for pools of trusted CA
13063 certificates in PEM (Privacy Enhanced Mail) format, for the purpose of
13064 verification of TLS server certificates.
13065 Concurrent use is possible, the file is loaded once needed first, the
13066 directory lookup is performed anew as a last resort whenever necessary.
13067 The CA certificate pool built into the TLS library can be disabled via
13068 .Va tls-ca-no-defaults ,
13069 further fine-tuning is possible via
13071 The directory search requires special filename conventions, please see
13072 .Xr SSL_CTX_load_verify_locations 3
13079 .Mx Va tls-ca-flags
13080 .It Va tls-ca-flags-USER@HOST , tls-ca-flags-HOST , tls-ca-flags
13081 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
13082 storage, and the certificate verification that is used (also see
13084 The value is expected to consist of a comma-separated list of
13085 configuration directives, with any intervening whitespace being ignored.
13086 The directives directly map to flags that can be passed to
13087 .Xr X509_STORE_set_flags 3 ,
13088 which are usually defined in a file
13089 .Pa openssl/x509_vfy.h ,
13090 and the availability of which depends on the used TLS library
13091 version: a directive without mapping is ignored (error log subject to
13093 Directives currently understood (case-insensitively) include:
13096 .Bl -tag -compact -width ".It Cd BaNg"
13097 .It Cd no-alt-chains
13098 If the initial chain is not trusted, do not attempt to build an
13100 Setting this flag will make OpenSSL certificate verification match that
13101 of older OpenSSL versions, before automatic building and checking of
13102 alternative chains has been implemented; also see
13103 .Cd trusted-first .
13104 .It Cd no-check-time
13105 Do not check certificate/CRL validity against current time.
13106 .It Cd partial-chain
13107 By default partial, incomplete chains which cannot be verified up to the
13108 chain top, a self-signed root certificate, will not verify.
13109 With this flag set, a chain succeeds to verify if at least one signing
13110 certificate of the chain is in any of the configured trusted stores of
13112 The OpenSSL manual page
13113 .Xr SSL_CTX_load_verify_locations 3
13114 gives some advise how to manage your own trusted store of CA certificates.
13116 Disable workarounds for broken certificates.
13117 .It Cd trusted-first
13118 Try building a chain using issuers in the trusted store first to avoid
13119 problems with server-sent legacy intermediate certificates.
13120 Newer versions of OpenSSL support alternative chain checking and enable
13121 it by default, resulting in the same behaviour; also see
13122 .Cd no-alt-chains .
13126 .Mx Va tls-ca-no-defaults
13127 .It Va tls-ca-no-defaults-USER@HOST , tls-ca-no-defaults-HOST ,\
13129 \*(BO\*(OP Do not load the default CA locations that are built into the
13130 used to TLS library to verify TLS server certificates.
13133 .It Va tls-config-file
13134 \*(OP If this variable is set
13135 .Xr CONF_modules_load_file 3
13137 .Ql +modules-load-file
13140 is used to allow resource file based configuration of the TLS library.
13141 This happens once the library is used first, which may also be early
13142 during startup (logged with
13144 If a non-empty value is given then the given file, after performing
13145 .Sx "Filename transformations" ,
13146 will be used instead of the TLS libraries global default, and it is an
13147 error if the file cannot be loaded.
13148 The application name will always be passed as
13150 Some TLS libraries support application-specific configuration via
13151 resource files loaded like this, please see
13152 .Va tls-config-module .
13154 .Mx Va tls-config-module
13155 .It Va tls-config-module-USER@HOST , tls-config-module-HOST ,\
13157 \*(OP If file based application-specific configuration via
13158 .Va tls-config-file
13159 is available, announced as
13163 indicating availability of
13164 .Xr SSL_CTX_config 3 ,
13165 then, it becomes possible to use a central TLS configuration file
13166 for all programs, including \*(uA, for example
13167 .Bd -literal -offset indent
13168 # Register a configuration section for \*(uA
13169 \*(uA = mailx_master
13170 # The top configuration section creates a relation
13171 # in between dynamic SSL configuration and an actual
13172 # program specific configuration section
13174 ssl_conf = mailx_tls_config
13175 # And that program specific configuration section now
13176 # can map diverse tls-config-module names to sections,
13177 # as in: tls-config-module=account_xy
13179 account_xy = mailx_account_xy
13180 account_yz = mailx_account_yz
13182 MinProtocol = TLSv1.2
13185 CipherString = TLSv1.2:!aNULL:!eNULL:
13186 MinProtocol = TLSv1.1
13191 .Mx Va tls-config-pairs
13192 .It Va tls-config-pairs-USER@HOST , tls-config-pairs-HOST , tls-config-pairs
13193 \*(OP The value of this variable chain will be interpreted as
13194 a comma-separated list of directive/value pairs.
13195 Directives and values need to be separated by equals signs
13197 any whitespace surrounding pair members is removed.
13198 Keys are (usually) case-insensitive.
13199 Different to when placing these pairs in a
13200 .Va tls-config-module
13202 .Va tls-config-file ,
13205 need to be escaped with a reverse solidus
13207 when included in pairs; also different: if the equals sign
13209 is preceded with an asterisk
13211 .Sx "Filename transformations"
13212 will be performed on the value; it is an error if these fail.
13213 Unless proper support is announced by
13215 .Pf ( Ql +conf-ctx )
13216 only the keys below are supported, otherwise the pairs will be used
13217 directly as arguments to the function
13218 .Xr SSL_CONF_cmd 3 .
13221 .Bl -tag -compact -width ".It Cd C_rtificate_"
13223 Filename of a TLS client certificate (chain) required by some servers.
13224 Fallback support via
13225 .Xr SSL_CTX_use_certificate_chain_file 3 .
13226 .Sx "Filename transformations"
13229 will be set to the same value if not initialized explicitly.
13230 Some services support so-called
13232 authentication if a TLS client certificate was successfully presented
13233 during connection establishment
13234 .Pf ( Dq connecting is authenticating ) .
13236 .It Cd CipherString
13237 A list of ciphers for TLS connections, see
13239 By default no list of ciphers is set, resulting in a
13240 .Cd Protocol Ns - Ns
13241 specific list of ciphers (the protocol standards define lists of
13242 acceptable ciphers; possibly cramped by the used TLS library).
13243 Fallback support via
13244 .Xr SSL_CTX_set_cipher_list 3 .
13246 .It Cd Ciphersuites
13247 A list of ciphers used for TLSv1.3 connections, see
13249 These will be joined onto the list of ciphers from
13254 .Ql +ctx-set-ciphersuites ,
13256 .Xr SSL_CTX_set_ciphersuites 3 .
13259 A list of supported elliptic curves, if applicable.
13260 By default no curves are set.
13261 Fallback support via
13262 .Xr SSL_CTX_set1_curves_list 3 ,
13265 .It Cd MaxProtocol , MinProtocol
13266 The maximum and minimum supported TLS versions, respectively.
13270 .Ql +ctx-set-maxmin-proto ,
13272 .Xr SSL_CTX_set_max_proto_version 3
13274 .Xr SSL_CTX_set_min_proto_version 3 ;
13275 these fallbacks use an internal parser which understands the strings
13281 and the special value
13283 which disables the given limit.
13286 Various flags to set.
13288 .Xr SSL_CTX_set_options 3 ,
13289 in which case any other value but (exactly)
13291 results in an error.
13294 Filename of the private key in PEM format of a TLS client certificate.
13295 If unset, the value of
13298 .Sx "Filename transformations"
13301 .Xr SSL_CTX_use_PrivateKey_file 3 .
13304 The used TLS protocol.
13310 .Ql ctx-set-maxmin-proto
13317 .Xr SSL_CTX_set_options 3 ,
13318 driven via an internal parser which understands the strings
13324 and the special value
13326 Multiple protocols may be given as a comma-separated list, any
13327 whitespace is ignored, an optional plus sign
13329 prefix enables, a hyphen-minus
13331 prefix disables a protocol, so that
13333 enables only the TLSv1.2 protocol.
13339 .It Va tls-crl-dir , tls-crl-file
13340 \*(OP Specify a directory / a file, respectively, that contains a CRL in
13341 PEM format to use when verifying TLS server certificates.
13344 .It Va tls-features
13345 \*(OP\*(RO This expands to a comma-separated list of the TLS library
13346 identity and optional features.
13347 To ease substring matching the string starts and ends with a comma.
13348 Currently supported identities are
13352 (OpenSSL v1.1.x series)
13355 (elder OpenSSL series, other clones).
13356 Optional features are preceded with a plus sign
13358 when available, and with a hyphen-minus
13362 Currently known features are
13364 .Pf ( Va tls-config-pairs ) ,
13366 .Pf ( Va tls-config-module ) ,
13367 .Ql ctx-set-ciphersuites
13368 .Pf ( Cd Ciphersuites
13370 .Va tls-config-pairs ) ,
13371 .Ql ctx-set-maxmin-proto
13372 .Pf ( Va tls-config-pairs ) ,
13373 .Ql modules-load-file
13374 .Pf ( Va tls-config-file ) ,
13377 .Pf ( Va tls-rand-file ) .
13379 .Mx Va tls-fingerprint
13380 .It Va tls-fingerprint-USER@HOST , tls-fingerprint-HOST , tls-fingerprint
13381 \*(OP It is possible to replace the verification of the connection
13382 peer certificate against the entire local pool of CAs (for more see
13383 .Sx "Encrypted network communication" )
13384 with the comparison against a precalculated certificate message digest,
13385 the so-called fingerprint, to be specified as the used
13386 .Va tls-fingerprint-digest .
13387 This fingerprint can for example be calculated with
13388 .Ql Ic tls Ns \:\0\:fingerprint HOST .
13390 .Mx Va tls-fingerprint-digest
13391 .It Va tls-fingerprint-digest-USER@HOST , tls-fingerprint-digest-HOST , \
13392 tls-fingerprint-digest
13393 \*(OP The message digest to be used when creating TLS certificate
13394 fingerprints, the defaults, if available, in test order, being
13397 For the complete list of digest algorithms refer to
13398 .Va smime-sign-digest .
13401 .It Va tls-rand-file
13406 then this will be queried to find a file with random entropy data which
13407 can be used to seed the P(seudo)R(andom)N(umber)G(enerator), see
13408 .Xr RAND_load_file 3 .
13409 The default filename
13410 .Pf ( Xr RAND_file_name 3 ,
13413 will be used if this variable is not set or empty, or if the
13414 .Sx "Filename transformations"
13416 Shall seeding the PRNG have been successful,
13417 .Xr RAND_write_file 3
13418 will be called to update the entropy.
13419 Remarks: libraries which do not announce this feature seed the PRNG by
13423 .It Va tls-verify-USER@HOST , tls-verify-HOST , tls-verify
13424 \*(OP Variable chain that sets the action to be performed if an error
13425 occurs during TLS server certificate validation against the
13426 specified or default trust stores
13429 or the TLS library built-in defaults (unless usage disallowed via
13430 .Va tls-ca-no-defaults ) ,
13431 and as fine-tuned via
13433 Valid (case-insensitive) values are
13435 (fail and close connection immediately),
13437 (ask whether to continue on standard input),
13439 (show a warning and continue),
13441 (do not perform validation).
13446 If defined, gives the number of lines of a message to be displayed
13449 if unset, the first five lines are printed, if set to 0 the variable
13452 If the value is negative then its absolute value will be used for
13453 unsigned right shifting (see
13461 \*(BO If set then the
13463 command series will strip adjacent empty lines and quotations.
13467 The character set of the terminal \*(UA operates on,
13468 and the one and only supported character set that \*(UA can use if no
13469 character set conversion capabilities have been compiled into it,
13470 in which case it defaults to ISO-8859-1.
13471 Otherwise it defaults to UTF-8.
13472 Sufficient locale support provided the default will be preferably
13473 deduced from the locale environment if that is set (for example
13475 see there for more); runtime locale changes will be reflected by
13477 except during the program startup phase and if
13479 had been used to freeze the given value.
13480 Refer to the section
13481 .Sx "Character sets"
13482 for the complete picture about character sets.
13485 .It Va typescript-mode
13486 \*(BO A special multiplex variable that disables all variables and
13487 settings which result in behaviour that interferes with running \*(UA in
13490 .Va colour-disable ,
13491 .Va line-editor-disable
13492 and (before startup completed only)
13493 .Va termcap-disable .
13494 Unsetting it does not restore the former state of the covered settings.
13498 For a safe-by-default policy the process file mode creation mask
13502 on program startup after the resource files have been loaded,
13503 and unless this variable is set.
13504 By assigning this an empty value the active setting will not be changed,
13505 otherwise the given value will be made the new file mode creation mask.
13506 Child processes inherit the file mode creation mask of their parent.
13509 .It Va user-HOST , user
13510 \*(IN Variable chain that sets a global fallback user name, used in case
13511 none has been given in the protocol and account-specific URL.
13512 This variable defaults to the name of the user who runs \*(UA.
13516 Enable upward compatibility with \*(UA version 15.0 in respect to which
13517 configuration options are available and how they are handled.
13518 If set to a non-empty value the command modifier
13520 is implied and thus enforces
13521 .Sx "Shell-style argument quoting"
13523 .Sx "Old-style argument quoting"
13524 for all commands which support both.
13525 This manual uses \*(IN and \*(OU to refer to the new and the old way of
13526 doing things, respectively.
13530 Verbose mode enables logging of informational context messages.
13531 Historically a \*(BO variable, this can either be set multiple times
13532 (what the command line option
13534 uses), or be assigned a numeric value in order to increase verbosity.
13535 Assigning the value 0 disables verbosity and thus (almost) equals
13537 The maximum number is 3.
13547 .It Va version , version-date , \
13548 version-hexnum , version-major , version-minor , version-update
13549 \*(RO \*(UA version information: the first variable is a string with
13550 the complete version identification, the second the release date in ISO
13551 8601 notation without time.
13552 The third is a 32-bit hexadecimal number with the upper 8 bits storing
13553 the major, followed by the minor and update version numbers which occupy
13555 The latter three variables contain only decimal digits: the major, minor
13556 and update version numbers.
13557 The output of the command
13559 will include this information.
13562 .It Va writebackedited
13563 If this variable is set messages modified using the
13567 commands are written back to the current folder when it is quit;
13568 it is only honoured for writable folders in MBOX format, though.
13569 Note that the editor will be pointed to the raw message content in that
13570 case, i.e., neither MIME decoding nor decryption will have been
13571 performed, and proper
13574 quoting of newly added or edited content is also left as an exercise
13577 .\" }}} (Variables)
13579 .\" }}} (INTERNAL VARIABLES)
13582 .\" .Sh ENVIRONMENT {{{
13586 .Dq environment variable
13587 should be considered an indication that these variables are either
13588 standardized as vivid parts of process environments, or that they are
13589 commonly found in there.
13590 The process environment is inherited from the
13592 once \*(UA is started, and unless otherwise explicitly noted handling of
13593 the following variables transparently integrates into that of the
13594 .Sx "INTERNAL VARIABLES"
13595 from \*(UA's point of view.
13596 This means they can be managed via
13600 causing automatic program environment updates (to be inherited by
13601 newly created child processes).
13604 In order to integrate other environment variables equally they need to
13605 be imported (linked) with the command
13607 This command can also be used to set and unset non-integrated
13608 environment variables from scratch, sufficient system support provided.
13609 The following example, applicable to a POSIX shell, sets the
13611 environment variable for \*(UA only, and beforehand exports the
13613 in order to affect any further processing in the running shell:
13615 .Bd -literal -offset indent
13616 $ EDITOR="vim -u ${HOME}/.vimrc"
13618 $ COLUMNS=80 \*(uA -R
13621 .Bl -tag -width ".It Ev BaNg"
13624 The user's preferred width in column positions for the terminal screen.
13625 Queried and used once on program startup in interactive or batch
13627 mode, actively managed for child processes and the MLE (see
13628 .Sx "On terminal control and line editor" )
13629 in interactive mode thereafter.
13630 Non-interactive mode always uses, and the fallback default is
13631 a compile-time constant, by default 80 columns.
13636 are both set but not both are usable (empty, not a number, or 0) at
13637 program startup, then the real terminal screen size will be (tried to
13638 be) determined once.
13641 manages these variables, and unsets them for pipe specifications etc.)
13645 The name of the (mailbox)
13647 to use for saving aborted messages if
13649 is set; this defaults to
13653 is set no output will be generated, otherwise the contents of the file
13656 .Sx "Filename transformations"
13663 Pathname of the text editor to use for the
13667 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13669 is used for a more display oriented editor.
13673 The user's home directory.
13674 This variable is only used when it resides in the process environment.
13675 The calling user's home directory will be used instead if this directory
13676 does not exist, is not accessible or cannot be read;
13677 it will always be used for the root user.
13678 (No test for being writable is performed to allow usage by
13679 non-privileged users within read-only jails, but dependent on settings
13680 this directory is a default write target for, for example,
13688 .It Ev LC_ALL , LC_CTYPE , LANG
13689 \*(OP The (names in lookup order of the)
13693 which indicates the used
13694 .Sx "Character sets" .
13695 Runtime changes trigger automatic updates of the entire locale system,
13696 which includes updating
13698 (except during startup if the variable has been frozen via
13703 The user's preferred number of lines for the terminal screen.
13704 The behaviour is as described for
13706 yet the compile-time constant used in non-interactive mode and as
13707 a fallback defaults to 24 (lines).
13711 Pathname of the directory lister to use in the
13713 command when operating on local mailboxes.
13716 (path search through
13721 Upon startup \*(UA will actively ensure that this variable refers to the
13722 name of the user who runs \*(UA, in order to be able to pass a verified
13723 name to any newly created child process.
13727 Is used as the user's
13729 .Sx "primary system mailbox"
13733 If the environmental fallback is also not set, a built-in compile-time
13735 This is assumed to be an absolute pathname.
13739 \*(OP Override the default path search of
13740 .Sx "The Mailcap files" :
13741 any existing file therein will be loaded in sequence, appending any
13742 content to the list of MIME type handler directives.
13743 The RFC 1524 standard imposed default value is assigned otherwise:
13744 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
13745 (The default value is a compile-time \*(OP.)
13749 Is used as a startup file instead of
13752 In order to avoid side-effects from configuration files scripts should
13753 either set this variable to
13757 command line option should be used.
13760 .It Ev MAILX_NO_SYSTEM_RC
13761 If this variable is set then reading of
13764 .Va system-mailrc )
13765 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
13766 had been started up with the option
13768 (and according argument) or
13770 This variable is only used when it resides in the process environment.
13774 The name of the user's
13776 .Sx "secondary mailbox"
13778 A logical subset of the special
13779 .Sx "Filename transformations"
13785 Traditionally this MBOX is used as the file to save messages from the
13787 .Sx "primary system mailbox"
13788 that have been read.
13790 .Sx "Message states" .
13794 \*(IN\*(OP This variable overrides the default location of the user's
13800 Pathname of the program to use for backing the command
13804 variable enforces usage of a pager for output.
13805 The default paginator is
13807 (path search through
13810 \*(UA inspects the contents of this variable: if its contains the string
13812 then a non-existing environment variable
13819 will optionally be set to
13826 A colon-separated list of directories that is searched by the shell when
13827 looking for commands, for example
13828 .Ql /bin:/usr/bin:/usr/local/bin .
13831 .It Ev POSIXLY_CORRECT
13832 This environment entry is automatically squared with
13837 The shell to use for the commands
13842 .Sx "COMMAND ESCAPES"
13843 and when starting subprocesses.
13844 A default shell is used if this environment variable is not defined.
13847 .It Ev SOCKS5_PROXY
13848 This environment entry is automatically squared with
13852 .It Ev SOURCE_DATE_EPOCH
13853 Specifies a time in seconds since the Unix epoch (1970-01-01) to be
13854 used in place of the current time.
13855 This variable is looked up upon program startup, and its existence will
13856 switch \*(UA to a reproducible mode
13857 .Pf ( Lk https://reproducible-builds.org )
13858 which uses deterministic random numbers, a special fixated pseudo
13861 This operation mode is used for development and by software packagers.
13862 \*(ID Currently an invalid setting is only ignored, rather than causing
13863 a program abortion.
13865 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
13869 \*(OP The terminal type for which output is to be prepared.
13870 For extended colour and font control please refer to
13871 .Sx "Coloured display" ,
13872 and for terminal management in general to
13873 .Sx "On terminal control and line editor" .
13877 Except for the root user this variable defines the directory for
13878 temporary files to be used instead of
13880 (or the given compile-time constant) if set, existent, accessible as
13881 well as read- and writable.
13882 This variable is only used when it resides in the process environment,
13883 but \*(UA will ensure at startup that this environment variable is
13884 updated to contain a usable temporary directory.
13890 (see there), but this variable is not standardized, should therefore not
13891 be used, and is only corrected if already set.
13895 Pathname of the text editor to use for the
13899 .Pf (see\0 Sx "COMMAND ESCAPES" ) ;
13901 is used for a less display oriented editor.
13911 .Bl -tag -width ".It Pa BaNg"
13914 .It Pa ~/.mailcap , /etc/mailcap
13915 \*(OP Personal and system-wide MIME type handler definition files, see
13916 .Sx "The Mailcap files" .
13917 (The shown names are part of the RFC 1524 standard search path
13920 .It Pa \*(ur , \*(UR
13921 User-specific and system-wide files giving initial commands, the
13922 .Sx "Resource files" .
13923 (The used filenames come from
13926 .Va system-mailrc ,
13931 The default value for
13936 .It Pa \*(vU , \*(vS
13937 Personal and system-wide MIME types, see
13938 .Sx "The mime.types files" .
13942 \*(IN\*(OP The default location of the user's
13944 file \(en the section
13945 .Sx "The .netrc file"
13946 documents the file format.
13947 The used path can be set via
13957 \*(OP Possible location for persistent random entropy seed storage, see
13958 .Va tls-rand-file .
13962 .\" .Ss "Resource files" {{{
13963 .Ss "Resource files"
13965 Upon startup \*(UA reads in several resource files, in order:
13967 .Bl -tag -width ".It Pa BaNg"
13970 System wide initialization file
13971 .Pf ( Va system-mailrc ) .
13972 Reading of this file can be suppressed, either by using the
13974 (and according argument) or
13976 command line options, or by setting the
13979 .Ev MAILX_NO_SYSTEM_RC .
13983 File giving initial commands.
13984 A different file can be chosen by setting the
13988 Reading of this file can be suppressed with the
13990 command line option.
13992 .It Va mailx-extra-rc
13993 Defines a startup file to be read after all other resource files.
13994 It can be used to specify settings that are not understood by other
13996 implementations, for example.
14000 The content of these files is interpreted as follows:
14003 .Bl -bullet -compact
14005 The whitespace characters space, tabulator and newline,
14006 as well as those defined by the variable
14008 are removed from the beginning and end of input lines.
14010 Empty lines are ignored.
14012 Any other line is interpreted as a command.
14013 It may be spread over multiple input lines if the newline character is
14015 by placing a reverse solidus character
14017 as the last character of the line; whereas any leading whitespace of
14018 follow lines is ignored, trailing whitespace before a escaped newline
14019 remains in the input.
14021 If the line (content) starts with the number sign
14023 then it is a comment-command and also ignored.
14024 (The comment-command is a real command, which does nothing, and
14025 therefore the usual follow lines mechanism applies!)
14029 Errors while loading these files are subject to the settings of
14033 More files with syntactically equal content can be
14035 The following, saved in a file, would be an examplary content:
14037 .Bd -literal -offset indent
14038 # This line is a comment command. And y\e
14039 es, it is really continued here.
14046 .\" .Ss "The mime.types files" {{{
14047 .Ss "The mime.types files"
14050 .Sx "HTML mail and MIME attachments"
14051 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
14052 media types in order to classify message and attachment content.
14053 One source for them are
14055 files, the loading of which can be controlled by setting the variable
14056 .Va mimetypes-load-control .
14057 Another is the command
14059 which also offers access to \*(UAs MIME type cache.
14061 files have the following syntax:
14063 .Bd -literal -offset indent
14064 type/subtype extension [extension ...]
14065 # For example text/html html htm
14071 define the MIME media type, as standardized in RFC 2046:
14073 is used to declare the general type of data, while the
14075 specifies a specific format for that type of data.
14076 One or multiple filename
14078 s, separated by whitespace, can be bound to the media type format.
14079 Comments may be introduced anywhere on a line with a number sign
14081 causing the remaining line to be discarded.
14083 \*(UA also supports an extended, non-portable syntax in especially
14084 crafted files, which can be loaded via the alternative value syntax of
14085 .Va mimetypes-load-control ,
14086 and prepends an optional
14090 .Dl [type-marker ]type/subtype extension [extension ...]
14093 The following type markers are supported:
14096 .Bl -tag -compact -width ".It Ar _n_u"
14098 Treat message parts with this content as plain text.
14103 Treat message parts with this content as HTML tagsoup.
14104 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
14105 the content as plain text instead.
14109 but instead of falling back to plain text require an explicit content
14110 handler to be defined.
14112 If no handler can be found a text message is displayed which says so.
14113 This can be annoying, for example signatures serve a contextual purpose,
14114 their content is of no use by itself.
14115 This marker will avoid displaying the text message.
14120 for sending messages:
14122 .Va mime-allow-text-controls ,
14123 .Va mimetypes-load-control .
14124 For reading etc. messages:
14125 .Sx "HTML mail and MIME attachments" ,
14126 .Sx "The Mailcap files" ,
14128 .Va mime-counter-evidence ,
14129 .Va mimetypes-load-control ,
14130 .Va pipe-TYPE/SUBTYPE ,
14131 .Va pipe-EXTENSION .
14134 .\" .Ss "The Mailcap files" {{{ review
14135 .Ss "The Mailcap files"
14137 \*(OP RFC 1524 defines a
14138 .Dq User Agent Configuration Mechanism
14139 to be used to inform mail user agent programs about the locally
14140 installed facilities for handling various data formats, i.e., about
14141 commands and how they can be used to display, edit et cetera MIME part
14142 contents, as well as a default path search that includes multiple
14143 possible locations of resource files, and the
14145 environment variable to overwrite that.
14146 Handlers found from doing the path search will be cached, the command
14148 operates on that cache, and the variable
14149 .Va mailcap-disable
14150 will suppress automatic loading, and usage of any mailcap handlers.
14151 .Sx "HTML mail and MIME attachments"
14152 gives a general overview of how MIME types are handled.
14156 files consist of a set of newline separated entries.
14157 Comment lines start with a number sign
14159 (in the first column!) and are ignored.
14160 Empty lines are ignored.
14161 All other lines are interpreted as mailcap entries.
14162 An entry definition may be split over multiple lines by placing the
14163 reverse solidus character
14165 last in all but the final line.
14166 The standard does not specify how leading whitespace of successive lines
14167 is to be treated, therefore they are retained.
14171 entries consist of a number of semicolon
14174 The first two fields are mandatory and must occur in the specified
14175 order, the remaining fields are optional and may appear in any order.
14176 Leading and trailing whitespace of field content is ignored (removed).
14177 The reverse solidus
14179 character can be used to escape any following character including
14180 semicolon and itself in the content of the second field, and in value
14181 parts of any optional key/value field.
14184 The first field defines the MIME
14186 the entry is about to handle (case-insensitively).
14187 If the subtype is specified as an asterisk
14189 the entry is meant to match all subtypes of the named type, e.g.,
14191 would match any audio type.
14192 The second field is the
14194 shell command used to display MIME parts of the given type.
14197 Data consuming shell commands will be fed message (MIME part) data on
14198 standard input unless one or more instances of the (unquoted) string
14200 are used: these formats will be replaced with a temporary file(name)
14201 that has been prefilled with the parts data.
14202 Data producing shell commands are expected to generata data on their
14203 standard output unless that format is used.
14204 In all cases any given
14206 format is replaced with a properly shell quoted filename.
14207 When a command requests a temporary file via
14209 then that will be removed again, as if the
14210 .Cd x-mailx-tmpfile
14212 .Cd x-mailx-tmpfile-fill
14213 flags had been set; unless the command requests
14216 .Cd x-mailx-tmpfile-unlink
14217 flag is also implied; see below for more.
14220 Optional fields define single-word flags (case-insensitive), or key
14221 / value pairs consisting of a case-insensitive keyword, an equals sign
14223 and a shell command; whitespace surrounding the equals sign is removed.
14224 Optional fields include the following:
14227 .Bl -tag -width ".It Cd BaNg"
14229 A program that can be used to compose a new body or body part in the
14231 (Currently unused.)
14233 .It Cd composetyped
14236 field, but is to be used when the composing program needs to specify the
14238 header field to be applied to the composed data.
14239 (Currently unused.)
14242 .It Cd copiousoutput
14243 A flag field which indicates that the output of the
14245 command is integrable into \*(UAs normal visual display.
14246 It is mutually exclusive with
14247 .Cd needsterminal .
14250 A textual description that describes this type of data.
14251 The text may optionally be enclosed within double quotation marks
14255 A program that can be used to edit a body or body part in the given
14257 (Currently unused.)
14259 .It Cd nametemplate
14260 This field specifies a filename format for the
14262 format used in the shell command fields, in which
14264 will be replaced by a random string.
14265 (The filename is also stored in and passed to subprocesses via
14266 .Ev MAILX_FILENAME_TEMPORARY . )
14267 The standard says this is
14268 .Dq only expected to be relevant in environments \
14269 where filename extensions are meaningful ,
14270 and so this field is ignored unless the
14272 is a prefix, optionally followed by (ASCII) alphabetic and numeric
14273 characters, the underscore and the period.
14274 For example, to specify that a JPG file is to be passed to an image
14275 viewer with a name ending in
14277 .Ql nametemplate=%s.jpg
14281 .It Cd needsterminal
14282 This flag field indicates that the given shell command must be run on
14283 an interactive terminal.
14284 \*(UA will temporarily release the terminal to the given command in
14285 interactive mode, in non-interactive mode this entry will be entirely
14286 ignored; this flag implies
14287 .Cd x-mailx-noquote .
14290 A program that can be used to print a message or body part in the given
14292 (Currently unused.)
14295 Specifies a program to be run to test some condition, for example, the
14296 machine architecture, or the window system in use, to determine whether
14297 or not this mailcap entry applies.
14298 If the test fails, a subsequent mailcap entry should be sought; also see
14299 .Cd x-mailx-test-once .
14300 Standard I/O of the test program is redirected from and to
14304 is not supported (the data does not yet exist).
14306 .It Cd textualnewlines
14307 A flag field which indicates that this type of data is line-oriented and
14308 that, if encoded in
14310 all newlines should be converted to canonical form (CRLF) before
14311 encoding, and will be in that form after decoding.
14312 (Currently unused.)
14315 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
14316 icon to be used to visually denote the presence of this kind of data.
14317 This field is not used by \*(UA.
14320 .It Cd x-mailx-async
14321 Extension flag field that denotes that the given
14323 command shall be executed asynchronously, without blocking \*(UA.
14324 Cannot be used in conjunction with
14325 .Cd needsterminal ;
14326 the standard output of the command will go to
14330 .It Cd x-mailx-noquote
14331 An extension flag field that indicates that even a
14334 command shall not be used when
14336 ing messages, as it would by default.
14339 .It Cd x-mailx-test-once
14340 Extension flag which denotes whether the given
14342 command shall be evaluated once only with its exit status being cached.
14343 This is handy if some global unchanging condition is to be queried, like
14344 .Dq running under the X Window System .
14347 .It Cd x-mailx-tmpfile
14348 Extension flag field that requests creation of a zero-sized temporary
14349 file, the name of which is to be placed in the environment variable
14350 .Ev MAILX_FILENAME_TEMPORARY .
14351 It is an error to use this flag with commands that include a
14353 format (because that is implemented by means of this temporary file).
14356 .It Cd x-mailx-tmpfile-fill
14357 Normally the MIME part content is passed to the handler via standard
14358 input; if this flag is set then the data will instead be written into
14360 .Cd x-mailx-tmpfile .
14361 In order to cause deletion of the temporary file you will have to set
14362 .Cd x-mailx-tmpfile-unlink
14364 It is an error to use this flag with commands that include a
14369 .It Cd x-mailx-tmpfile-unlink
14370 Extension flag field that requests that the temporary file shall be
14371 deleted automatically when the command loop is entered again at latest.
14372 It is an error to use this flag with commands that include a
14374 format, or in conjunction with
14375 .Cd x-mailx-async .
14376 .Cd x-mailx-tmpfile
14382 The standard includes the possibility to define any number of additional
14383 fields, prefixed by
14385 Flag fields apply to the entire
14387 entry \(em in some unusual cases, this may not be desirable, but
14388 differentiation can be accomplished via separate entries, taking
14389 advantage of the fact that subsequent entries are searched if an earlier
14390 one does not provide enough information.
14393 command needs to specify the
14397 command shall not, the following will help out the latter:
14399 .Bd -literal -offset indent
14400 application/postscript; ps-to-terminal %s; needsterminal
14401 application/postscript; ps-to-terminal %s; compose=idraw %s
14405 In value parts of command fields any occurrence of the format string
14407 will be replaced by the
14410 Any named parameter from a messages'
14412 field may be embedded into the command line using the format
14414 followed by the parameter name and a closing brace
14417 The entire parameter should appear as a single command line argument,
14418 regardless of embedded spaces, shell quoting will be performed by the
14419 RFC 1524 processor, thus:
14421 .Bd -literal -offset indent
14423 Content-type: multipart/mixed; boundary=42
14426 multipart/*; /usr/local/bin/showmulti \e
14427 %t %{boundary} ; composetyped = /usr/local/bin/makemulti
14429 # Executed shell command
14430 /usr/local/bin/showmulti multipart/mixed 42
14434 Note that \*(UA does not support handlers for multipart MIME parts as
14435 shown in this example (as of today).
14436 It does not support the additional formats
14440 An example file, also showing how to properly deal with the expansion of
14442 which includes any quotes that are necessary to make it a valid shell
14443 argument by itself and thus will cause undesired behaviour when placed
14444 in additional user-provided quotes:
14446 .Bd -literal -offset indent
14448 text/richtext; richtext %s; copiousoutput
14450 text/x-perl; perl -cWT %s; nametemplate = %s.pl
14452 # Exit EX_TEMPFAIL=75 on signal
14453 application/pdf; \e
14455 trap "rm -f ${infile}" EXIT\e; \e
14456 trap "exit 75" INT QUIT TERM\e; \e
14457 mupdf "${infile}"; \e
14458 test = [ -n "${DISPLAY}" ]; \e
14459 nametemplate = %s.pdf; x-mailx-async
14460 application/pdf; pdftotext -layout - -; copiousoutput
14462 application/*; echo "This is \e\e"%t\e\e" but \e
14463 is 50 \e% Greek to me" \e; < %s head -c 512 | cat -vet; \e
14464 copiousoutput; x-mailx-noquote
14469 .Sx "HTML mail and MIME attachments" ,
14470 .Sx "The mime.types files" ,
14473 .Va mime-counter-evidence ,
14474 .Va pipe-TYPE/SUBTYPE ,
14475 .Va pipe-EXTENSION .
14478 .\" .Ss "The .netrc file" {{{ review
14479 .Ss "The .netrc file"
14481 User credentials for machine accounts (see
14482 .Sx "On URL syntax and credential lookup" )
14483 can be placed in the
14485 file, which will be loaded and cached when requested by
14487 The default location
14489 may be overridden by the
14491 environment variable.
14492 As long as syntax constraints are honoured the file source may be
14493 replaced with the output of the shell command set in
14495 to load an encrypted file, for example.
14496 The cache can be managed with the command
14500 The file consists of space, tabulator or newline separated tokens.
14501 This parser implements a superset of the original BSD syntax, but users
14502 should nonetheless be aware of portability glitches, shall their
14504 be usable across multiple programs and platforms:
14507 .Bl -bullet -compact
14509 BSD only supports double quotation marks, for example
14510 .Ql password """pass with spaces""" .
14512 BSD (only?) supports escaping of single characters via a reverse solidus
14513 (a space could be escaped via
14515 in- as well as outside of a quoted string.
14516 This method is assumed to be present, and will actively be used to quote
14517 double quotation marks
14519 and reverse solidus
14521 characters inside the
14525 tokens, for example for display purposes.
14527 BSD does not require a final quotation mark of the last user input token.
14529 The original BSD (Berknet) parser also supported a format which allowed
14530 tokens to be separated with commas \(en whereas at least Hewlett-Packard
14531 still seems to support this syntax, this parser does not!
14533 As a non-portable extension some widely-used programs support
14534 shell-style comments: if an input line starts, after any amount of
14535 whitespace, with a number sign
14537 then the rest of the line is ignored.
14539 Whereas other programs may require that the
14541 file is accessible by only the user if it contains a
14543 token for any other
14547 this parser will always require these strict permissions.
14551 Of the following list of supported tokens this parser uses (and caches)
14558 entry will not be used.
14560 .Bl -tag -width ".It Cd BaNg"
14561 .It Cd machine Ar name
14562 The hostname of the entries' machine, lowercase-normalized before use.
14563 Any further file content, until either end-of-file or the occurrence
14568 first-class token is bound (only related) to the machine
14571 As an extension that should not be the cause of any worries this parser
14572 supports a single wildcard prefix for
14574 .Bd -literal -offset indent
14575 machine *.example.com login USER password PASS
14576 machine pop3.example.com login USER password PASS
14577 machine smtp.example.com login USER password PASS
14583 .Ql pop3.example.com ,
14587 .Ql local.smtp.example.com .
14588 In the example neither
14589 .Ql pop3.example.com
14591 .Ql smtp.example.com
14592 will be matched by the wildcard, since the exact matches take
14593 precedence (it is however faster to specify it the other way around).
14596 This is the same as
14598 except that it is a fallback entry that is used shall none of the
14599 specified machines match; only one default token may be specified,
14600 and it must be the last first-class token.
14602 .It Cd login Ar name
14603 The user name on the remote machine.
14605 .It Cd password Ar string
14606 The user's password on the remote machine.
14608 .It Cd account Ar string
14609 Supply an additional account password.
14610 This is merely for FTP purposes.
14612 .It Cd macdef Ar name
14614 A macro is defined with the specified
14616 it is formed from all lines beginning with the next line and continuing
14617 until a blank line is (consecutive newline characters are) encountered.
14620 entries cannot be utilized by multiple machines, too, but must be
14621 defined following the
14623 they are intended to be used with.)
14626 exists, it is automatically run as the last step of the login process.
14627 This is merely for FTP purposes.
14634 .\" .Sh EXAMPLES {{{
14637 .\" .Ss "An example configuration" {{{
14638 .Ss "An example configuration"
14640 .Bd -literal -offset indent
14641 # This example assumes v15.0 compatibility mode
14644 # Request strict TLL transport layer security checks
14645 set tls-verify=strict
14647 # Where are the up-to-date TLS certificates?
14648 # (Since we manage up-to-date ones explicitly, do not use any,
14649 # possibly outdated, default certificates shipped with OpenSSL)
14650 #set tls-ca-dir=/etc/ssl/certs
14651 set tls-ca-file=/etc/ssl/certs/ca-certificates.crt
14652 set tls-ca-no-defaults
14653 #set tls-ca-flags=partial-chain
14654 wysh set smime-ca-file="${tls-ca-file}" \e
14655 smime-ca-no-defaults #smime-ca-flags="${tls-ca-flags}"
14657 # This could be outsourced to a central configuration file via
14658 # tls-config-file plus tls-config-module if the used library allows.
14659 # CipherString: explicitly define the list of ciphers, which may
14660 # improve security, especially with protocols older than TLS v1.2.
14661 # See ciphers(1). Possibly best to only use tls-config-pairs-HOST
14662 # (or -USER@HOST), as necessary, again..
14663 # Note that TLSv1.3 uses Ciphersuites= instead, which will join
14664 # with CipherString (if protocols older than v1.3 are allowed)
14665 # Curves: especially with TLSv1.3 curves selection may be desired.
14666 # MinProtocol,MaxProtocol: do not use protocols older than TLS v1.2.
14667 # Change this only when the remote server does not support it:
14668 # maybe use chain support via tls-config-pairs-HOST / -USER@HOST
14669 # to define such explicit exceptions, then, e.g.,
14670 # MinProtocol=TLSv1.1
14671 if [ "$tls-features" =% +ctx-set-maxmin-proto ]
14672 wysh set tls-config-pairs='\e
14673 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14674 Curves=P-521:P-384:P-256,\e
14675 MinProtocol=TLSv1.1'
14677 wysh set tls-config-pairs='\e
14678 CipherString=TLSv1.2:!aNULL:!eNULL:@STRENGTH,\e
14679 Curves=P-521:P-384:P-256,\e
14680 Protocol=-ALL\e,+TLSv1.1 \e, +TLSv1.2\e, +TLSv1.3'
14683 # Essential setting: select allowed character sets
14684 set sendcharsets=utf-8,iso-8859-1
14686 # A very kind option: when replying to a message, first try to
14687 # use the same encoding that the original poster used herself!
14688 set reply-in-same-charset
14690 # When replying, do not merge From: and To: of the original message
14691 # into To:. Instead old From: -> new To:, old To: -> merge Cc:.
14692 set recipients-in-cc
14694 # When sending messages, wait until the Mail-Transfer-Agent finishs.
14695 # Only like this you will be able to see errors reported through the
14696 # exit status of the MTA (including the built-in SMTP one)!
14699 # Only use built-in MIME types, no mime.types(5) files
14700 set mimetypes-load-control
14702 # Default directory where we act in (relative to $HOME)
14704 # A leading "+" (often) means: under *folder*
14705 # *record* is used to save copies of sent messages
14706 set MBOX=+mbox.mbox DEAD=+dead.txt \e
14707 record=+sent.mbox record-files record-resent
14709 # Make "file mymbox" and "file myrec" go to..
14710 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
14712 # Not really optional, e.g., for S/MIME
14713 set from='Your Name <address@exam.ple>'
14715 # It may be necessary to set hostname and/or smtp-hostname
14716 # if the "SERVER" of mta and "domain" of from do not match.
14717 # The `urlencode' command can be used to encode USER and PASS
14718 set mta=(smtps?|submissions?)://[USER[:PASS]@]SERVER[:PORT] \e
14719 smtp-auth=login/plain... \e
14722 # Never refuse to start into interactive mode, and more
14724 colour-pager crt= \e
14725 followup-to followup-to-honour=ask-yes fullnames \e
14726 history-file=+.\*(uAhist history-size=-1 history-gabby \e
14727 mime-counter-evidence=0b1111 \e
14728 prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
14729 reply-to-honour=ask-yes \e
14732 # Only include the selected header fields when typing messages
14733 headerpick type retain from_ date from to cc subject \e
14734 message-id mail-followup-to reply-to
14735 # ...when forwarding messages
14736 headerpick forward retain subject date from to cc
14737 # ...when saving message, etc.
14738 #headerpick save ignore ^Original-.*$ ^X-.*$
14740 # Some mailing lists
14741 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
14742 mlsubscribe '^xfans@xfans\e.xyz$'
14744 # Handle a few file extensions (to store MBOX databases)
14745 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
14746 gz 'gzip -dc' 'gzip -c' xz 'xz -dc' 'xz -zc' \e
14747 zst 'zstd -dc' 'zstd -19 -zc' \e
14748 zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
14750 # A real life example of a very huge free mail provider
14751 # Instead of directly placing content inside `account',
14752 # we `define' a macro: like that we can switch "accounts"
14753 # from within *on-compose-splice*, for example!
14755 set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
14756 set from='Your Name <address@examp.ple>'
14758 set pop3-no-apop-pop.gmXil.com
14759 shortcut pop %:pop3s://pop.gmXil.com
14760 shortcut imap %:imaps://imap.gmXil.com
14761 # Or, entirely IMAP based setup
14762 #set folder=imaps://imap.gmail.com record="+[Gmail]/Sent Mail" \e
14763 # imap-cache=~/spool/cache
14765 set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
14767 set mta=smtps://USER:PASS@smtp.gmail.com:465
14773 # Here is a pretty large one which does not allow sending mails
14774 # if there is a domain name mismatch on the SMTP protocol level,
14775 # which would bite us if the value of from does not match, e.g.,
14776 # for people who have a sXXXXeforge project and want to speak
14777 # with the mailing list under their project account (in from),
14778 # still sending the message through their normal mail provider
14780 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14781 set from='Your Name <address@exam.ple>'
14783 shortcut pop %:pop3s://pop.yaXXex.com
14784 shortcut imap %:imaps://imap.yaXXex.com
14786 set mta=smtps://USER:PASS@smtp.yaXXex.com:465 \e
14787 hostname=yaXXex.com smtp-hostname=
14793 # Create some new commands so that, e.g., `ls /tmp' will..
14794 commandalias lls '!ls ${LS_COLOUR_FLAG} -aFlrS'
14795 commandalias llS '!ls ${LS_COLOUR_FLAG} -aFlS'
14797 set pipe-message/external-body='?* echo $MAILX_EXTERNAL_BODY_URL'
14799 # We do not support gpg(1) directly yet. But simple --clearsign'd
14800 # message parts can be dealt with as follows:
14803 wysh set pipe-text/plain=$'?*#++=?\e
14804 < "${MAILX_FILENAME_TEMPORARY}" awk \e
14805 -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
14807 /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
14810 print "--- GPG --verify ---";\e
14811 system("gpg --verify " TMPFILE " 2>&1");\e
14812 print "--- GPG --verify ---";\e
14816 /^-----BEGIN PGP SIGNATURE-----/,\e
14817 /^-----END PGP SIGNATURE-----/{\e
14824 commandalias V '\e'call V
14828 When storing passwords in
14830 appropriate permissions should be set on this file with
14831 .Ql $ chmod 0600 \*(ur .
14834 is available user credentials can be stored in the central
14836 file instead; e.g., here is a different version of the example account
14837 that sets up SMTP and POP3:
14839 .Bd -literal -offset indent
14841 set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
14842 set from='Your Name <address@exam.ple>'
14844 # Load an encrypted ~/.netrc by uncommenting the next line
14845 #set netrc-pipe='gpg -qd ~/.netrc.pgp'
14847 set mta=smtps://smtp.yXXXXx.ru:465 \e
14848 smtp-hostname= hostname=yXXXXx.com
14849 set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
14850 commandalias xp fi pop3s://pop.yXXXXx.ru
14862 .Bd -literal -offset indent
14863 machine *.yXXXXx.ru login USER password PASS
14867 This configuration should now work just fine:
14870 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
14873 .\" .Ss "S/MIME step by step" {{{
14874 .Ss "S/MIME step by step"
14876 \*(OP The first thing that is needed for
14877 .Sx "Signed and encrypted messages with S/MIME"
14878 is a personal certificate, and a private key.
14879 The certificate contains public information, in particular a name and
14880 email address(es), and the public key that can be used by others to
14881 encrypt messages for the certificate holder (the owner of the private
14884 signed messages generated with that certificate('s private key).
14885 Whereas the certificate is included in each signed message, the private
14886 key must be kept secret.
14887 It is used to decrypt messages that were previously encrypted with the
14888 public key, and to sign messages.
14891 For personal use it is recommended to get a S/MIME certificate from
14892 one of the major CAs on the Internet.
14893 Many CAs offer such certificates for free.
14894 Usually offered is a combined certificate and private key in PKCS#12
14895 format which \*(UA does not accept directly.
14896 To convert it to PEM format, the following shell command can be used;
14897 please read on for how to use these PEM files.
14899 .Bd -literal -offset indent
14900 $ openssl pkcs12 -in cert.p12 -out certpem.pem -clcerts -nodes
14902 $ openssl pkcs12 -in cert.p12 -out cert.pem -clcerts -nokeys
14903 $ openssl pkcs12 -in cert.p12 -out key.pem -nocerts -nodes
14908 .Lk https://www.CAcert.org
14909 which issues client and server certificates to members of their
14910 community for free; their root certificate
14911 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
14912 is often not in the default set of trusted CA root certificates, though,
14913 which means their root certificate has to be downloaded separately,
14914 and needs to be part of the S/MIME certificate validation chain by
14917 or as a vivid member of the
14918 .Va smime-ca-file .
14919 But let us take a step-by-step tour on how to setup S/MIME with
14920 a certificate from CAcert.org despite this situation!
14923 First of all you will have to become a member of the CAcert.org
14924 community, simply by registrating yourself via the web interface.
14925 Once you are, create and verify all email addresses you want to be able
14926 to create signed and encrypted messages for/with using the corresponding
14927 entries of the web interface.
14928 Now ready to create S/MIME certificates, so let us create a new
14929 .Dq client certificate ,
14930 ensure to include all email addresses that should be covered by the
14931 certificate in the following web form, and also to use your name as the
14935 Create a private key and a certificate request on your local computer
14936 (please see the manual pages of the used commands for more in-depth
14937 knowledge on what the used arguments etc. do):
14940 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
14943 Afterwards copy-and-paste the content of
14945 into the certificate-request (CSR) field of the web form on the
14946 CAcert.org website (you may need to unfold some
14947 .Dq advanced options
14948 to see the corresponding text field).
14949 This last step will ensure that your private key (which never left your
14950 box) and the certificate belong together (through the public key that
14951 will find its way into the certificate via the certificate-request).
14952 You are now ready and can create your CAcert certified certificate.
14953 Download and store or copy-and-paste it as
14958 In order to use your new S/MIME setup a combined private key/public key
14959 (certificate) file has to be created:
14962 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
14965 This is the file \*(UA will work with.
14966 If you have created your private key with a passphrase then \*(UA will
14967 ask you for it whenever a message is signed or decrypted, unless this
14968 operation has been automated as described in
14969 .Sx "Signed and encrypted messages with S/MIME" .
14970 Set the following variables to henceforth use S/MIME (setting
14972 is of interest for verification only):
14974 .Bd -literal -offset indent
14975 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
14976 smime-sign-cert=ME@HERE.com.paired \e
14977 smime-sign-digest=SHA512 \e
14978 smime-sign from=myname@my.host
14983 .\" .Ss "Using CRLs with S/MIME or TLS" {{{
14984 .Ss "Using CRLs with S/MIME or TLS"
14986 \*(OP Certification authorities (CAs) issue certificate revocation
14987 lists (CRLs) on a regular basis.
14988 These lists contain the serial numbers of certificates that have been
14989 declared invalid after they have been issued.
14990 Such usually happens because the private key for the certificate has
14992 because the owner of the certificate has left the organization that is
14993 mentioned in the certificate, etc.
14994 To seriously use S/MIME or TLS verification,
14995 an up-to-date CRL is required for each trusted CA.
14996 There is otherwise no method to distinguish between valid and
14997 invalidated certificates.
14998 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
14999 the Internet, so they have to be retrieved by some external mechanism.
15002 \*(UA accepts CRLs in PEM format only;
15003 CRLs in DER format must be converted, like, e.\|g.:
15006 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
15009 To tell \*(UA about the CRLs, a directory that contains all CRL files
15010 (and no other files) must be created.
15015 variables, respectively, must then be set to point to that directory.
15016 After that, \*(UA requires a CRL to be present for each CA that is used
15017 to verify a certificate.
15026 In general it is a good idea to turn on
15032 twice) if something does not work well.
15033 Very often a diagnostic message can be produced that leads to the
15034 problems' solution.
15036 .\" .Ss "\*(UA shortly hangs on startup" {{{
15037 .Ss "\*(UA shortly hangs on startup"
15039 This can have two reasons, one is the necessity to wait for a file lock
15040 and cannot be helped, the other being that \*(UA calls the function
15042 in order to query the nodename of the box (sometimes the real one is
15043 needed instead of the one represented by the internal variable
15045 One may have varying success by ensuring that the real hostname and
15049 or, more generally, that the name service is properly setup \(en
15052 return the expected value?
15053 Does this local hostname have a domain suffix?
15054 RFC 6762 standardized the link-local top-level domain
15056 try again after adding an (additional) entry with this extension.
15059 .\" .Ss "I cannot login to Google mail (via OAuth)" {{{
15060 .Ss "I cannot login to Google mail \&(via OAuth\&)"
15062 Since 2014 some free service providers classify programs as
15064 unless they use a special authentication method (OAuth 2.0) which
15065 was not standardized for non-HTTP protocol authentication token query
15066 until August 2015 (RFC 7628).
15069 Different to Kerberos / GSSAPI, which is developed since the mid of the
15070 1980s, where a user can easily create a local authentication ticket for
15071 her- and himself with the locally installed
15073 program, that protocol has no such local part but instead requires
15074 a world-wide-web query to create or fetch a token; since there is no
15075 local cache this query would have to be performed whenever \*(UA is
15076 invoked (in interactive sessions situation may differ).
15079 \*(UA does not directly support OAuth.
15080 It, however, supports XOAUTH2 / OAUTHBEARER, see
15081 .Sx "But, how about XOAUTH2 / OAUTHBEARER?"
15082 If that is not used it is necessary to declare \*(UA a
15083 .Dq less secure app
15084 (on the providers account web page) in order to read and send mail.
15085 However, it also seems possible to take the following steps instead:
15090 give the provider the number of a mobile phone,
15093 .Dq 2-Step Verification ,
15095 create an application specific password (16 characters), and
15097 use that special password instead of the real Google account password in
15098 \*(UA (for more on that see the section
15099 .Sx "On URL syntax and credential lookup" ) .
15103 .\" .Ss "But, how about XOAUTH2 / OAUTHBEARER?" {{{
15104 .Ss "But, how about XOAUTH2 / OAUTHBEARER?"
15107 .Sx "I cannot login to Google mail \&(via OAuth\&)"
15108 one OAuth-based authentication method is available:
15109 the OAuth 2.0 bearer token usage as standardized in RFC 6750 (according
15110 SASL mechanism in RFC 7628), also known as XOAUTH2 and OAUTHBEARER,
15111 allows fetching a temporary access token via the web that can locally be
15114 The protocol is simple and extendable, token updates or even password
15115 changes via a simple TLS secured server login would be possible in
15116 theory, but today a web browser and an external support tool are
15117 prerequisites for using this authentication method.
15118 The token times out and must be periodically refreshed via the web.
15121 Some hurdles must be taken before being able to use this method.
15122 Using GMail as an example, an application (that is a name) must be
15123 registered, for which credentials, a
15126 .Dq client secret ,
15127 need to be created and saved locally (in a secure way).
15128 These initial configuration steps can be performed at
15129 .Lk https://console.developers.google.com/apis/credentials .
15130 Thereafter a refresh token can be requested;
15131 a python program to do this for GMail accounts is
15132 .Lk https://github.com/google/\:gmail-oauth2-tools/\:raw/\:\
15133 master/\:python/\:oauth2.py :
15135 .Bd -literal -offset indent
15136 $ python oauth2.py --user=EMAIL \e
15137 --client-id=THE-ID --client-secret=THE-SECRET \e
15138 --generate_oauth2_token
15139 To authorize token, visit this url and follow the directions:
15140 https://accounts.google.com/o/oauth2/auth?client_id=...
15141 Enter verification code: ...
15144 Access Token Expiration Seconds: 3600
15145 $ # Of which the last three are actual token responses.
15146 $ # Thereafter access tokens can regulary be refreshed
15147 $ # via the created refresh token (read on)
15151 The generated refresh token must also be saved locally (securely).
15152 The procedure as a whole can be read at
15153 .Lk https://github.com/google/\:gmail-oauth2-tools/\:wiki/\:\
15154 OAuth2DotPyRunThrough .
15155 Since periodic timers are not yet supported, keeping an access token
15156 up-to-date (from within \*(UA) can only be performed via the hook
15157 .Va on-main-loop-tick ,
15158 or (for sending only)
15159 .Va on-compose-enter
15160 (for more on authentication please see the section
15161 .Sx "On URL syntax and credential lookup" ) :
15163 .Bd -literal -offset indent
15164 set on-main-loop-tick=o-m-l-t on-compose-enter=o-c-e
15166 xcall update_access_token
15169 xcall update_access_token
15172 set access_token_=0
15173 define update_access_token {
15174 local set i epoch_sec epoch_nsec
15176 eval set $i # set epoch_sec/_nsec of vexpr epoch
15177 vput vexpr i + $access_token_ 2100
15178 if $epoch_sec -ge $i
15179 vput ! password python oauth2.py --user=EMAIL \e
15180 --client-id=THE-ID --client-secret=THE-SECRET \e
15181 --refresh-token=THE-REFRESH-TOKEN |\e
15182 sed '1b PASS;d; :PASS s/^.\e{1,\e}:\e(.\e{1,\e}\e)$/\e1/'
15183 vput csop password trim "$password"
15185 echo password is <$password>
15187 set access_token_=$epoch_sec
15193 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{ review
15194 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
15196 Two thinkable situations: the first is a shadowed sequence; setting
15198 or the most possible
15200 mode, causes a printout of the
15202 tree after that is built; being a cache, this happens only upon startup
15203 or after modifying bindings.
15206 Or second, terminal libraries (see
15207 .Sx "On terminal control and line editor",
15210 may report different codes than the terminal really sends, rendering
15211 bindings dysfunctional because expected and received data do not match; the
15215 ings will show the byte sequences that are expected.
15216 (One common source of problems is that the \(em possibly even
15217 non-existing \(em keypad is not turned on, and the resulting layout
15218 reports the keypad control codes for the normal keyboard keys.)
15221 To overcome the situation use for example the program
15225 if available, to see the byte sequences which are actually produced
15226 by keypresses, and use the variable
15228 to make \*(UA aware of them.
15229 The terminal this is typed on produces some unexpected sequences,
15230 here for an example the shifted home key:
15232 .Bd -literal -offset indent
15235 # 1B 5B=[ 31=1 3B=; 32=2 48=H
15240 $ \*(uA -v -Stermcap='kHOM=\eE[H'
15247 .\" .Ss "Can \*(UA git-send-email?" {{{
15248 .Ss "Can \*(UA git-send-email?"
15251 Put (at least parts of) the following in your
15254 .Bd -literal -offset indent
15256 smtpserver = /usr/bin/\*(uA
15257 smtpserveroption = -t
15258 #smtpserveroption = -Sexpandaddr
15259 smtpserveroption = -Athe-account-you-need
15262 suppressfrom = false
15263 assume8bitEncoding = UTF-8
15266 chainreplyto = true
15274 Patches can also be send directly, for example:
15276 .Bd -literal -offset indent
15277 $ git mail-patch HEAD^ |
15278 \*(uA -Athe-account-you-need -t RECEIVER
15282 .\" .Ss "Howto handle stale dotlock files" {{{
15283 .Ss "Howto handle stale dotlock files"
15286 sometimes fails to open MBOX mail databases because creation of
15288 .Sx "dotlock files"
15289 is impossible due to existing but unowned lock files.
15290 \*(UA does not offer an option to deal with those files, because it is
15291 considered a site policy what counts as unowned, and what not.
15292 The site policy is usually defined by administrator(s), and expressed in
15293 the configuration of a locally installed MTA (for example Postfix
15294 .Ql stale_lock_time=500s ) .
15295 Therefore the suggestion:
15297 .Bd -literal -offset indent
15298 $ </dev/null \*(uA -s 'MTA: be no frog, handle lock' $LOGNAME
15302 By sending a mail to yourself the local MTA can use its normal queue
15303 mechanism to try the delivery multiple times, finally decide a lock file
15304 has become stale, and remove it.
15310 .\" .Sh "IMAP CLIENT" {{{
15313 \*(OPally there is IMAP client support available.
15314 This part of the program is obsolete and will vanish in v15 with the
15315 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
15316 and makes excessive use of signal based long code jumps.
15317 Support can hopefully be readded later based on a new-style I/O, with
15318 SysV signal handling.
15319 In fact the IMAP support had already been removed from the codebase, but
15320 was reinstantiated on user demand: in effect the IMAP code is at the
15321 level of \*(UA v14.8.16 (with
15323 being the sole exception), and should be treated with some care.
15330 protocol prefixes, and an IMAP-based
15333 IMAP URLs (paths) undergo inspections and possible transformations
15334 before use (and the command
15336 can be used to manually apply them to any given argument).
15337 Hierarchy delimiters are normalized, a step which is configurable via the
15339 variable chain, but defaults to the first seen delimiter otherwise.
15340 \*(UA supports internationalised IMAP names, and en- and decodes the
15341 names from and to the
15343 as necessary and possible.
15344 If a mailbox name is expanded (see
15345 .Sx "Filename transformations" )
15346 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
15347 mailboxes below the
15349 target box, while folder names prefixed by `@' refer to folders below
15350 the hierarchy base, so the following will list all folders below the
15351 current one when in an IMAP mailbox:
15355 Note: some IMAP servers do not accept the creation of mailboxes in
15356 the hierarchy base, but require that they are created as subfolders of
15357 `INBOX' \(en with such servers a folder name of the form
15359 .Dl imaps://mylogin@imap.myisp.example/INBOX.
15361 should be used (the last character is the server's hierarchy
15363 The following IMAP-specific commands exist:
15366 .Bl -tag -width ".It Ic BaNg"
15369 Only applicable to cached IMAP mailboxes;
15370 takes a message list and reads the specified messages into the IMAP
15375 If operating in disconnected mode on an IMAP mailbox,
15376 switch to online mode and connect to the mail server while retaining
15377 the mailbox status.
15378 See the description of the
15380 variable for more information.
15384 If operating in online mode on an IMAP mailbox,
15385 switch to disconnected mode while retaining the mailbox status.
15386 See the description of the
15389 A list of messages may optionally be given as argument;
15390 the respective messages are then read into the cache before the
15391 connection is closed, thus
15393 makes the entire mailbox available for disconnected use.
15397 Sends command strings directly to the current IMAP server.
15398 \*(UA operates always in IMAP `selected state' on the current mailbox;
15399 commands that change this will produce undesirable results and should be
15401 Useful IMAP commands are:
15402 .Bl -tag -offset indent -width ".Ic getquotearoot"
15404 Takes the name of an IMAP mailbox as an argument and creates it.
15406 (RFC 2087) Takes the name of an IMAP mailbox as an argument
15407 and prints the quotas that apply to the mailbox.
15408 Not all IMAP servers support this command.
15410 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
15411 the Other User's Namespaces and the Shared Namespaces.
15412 Each namespace type is printed in parentheses;
15413 if there are multiple namespaces of the same type,
15414 inner parentheses separate them.
15415 For each namespace a prefix and a hierarchy separator is listed.
15416 Not all IMAP servers support this command.
15421 Perform IMAP path transformations.
15425 .Sx "Command modifiers" ) ,
15426 and manages the error number
15428 The first argument specifies the operation:
15430 normalizes hierarchy delimiters (see
15432 and converts the strings from the locale
15434 to the internationalized variant used by IMAP,
15436 performs the reverse operation.
15437 Encoding will honour the (global) value of
15443 The following IMAP-specific internal variables exist:
15446 .Bl -tag -width ".It Va BaNg"
15448 .It Va disconnected
15449 \*(BO When an IMAP mailbox is selected and this variable is set,
15450 no connection to the server is initiated.
15451 Instead, data is obtained from the local cache (see
15454 Mailboxes that are not present in the cache
15455 and messages that have not yet entirely been fetched from the server
15457 to fetch all messages in a mailbox at once,
15459 .No ` Ns Li copy * /dev/null Ns '
15460 can be used while still in connected mode.
15461 Changes that are made to IMAP mailboxes in disconnected mode are queued
15462 and committed later when a connection to that server is made.
15463 This procedure is not completely reliable since it cannot be guaranteed
15464 that the IMAP unique identifiers (UIDs) on the server still match the
15465 ones in the cache at that time.
15468 when this problem occurs.
15470 .It Va disconnected-USER@HOST
15471 The specified account is handled as described for the
15474 but other accounts are not affected.
15477 .It Va imap-auth-USER@HOST , imap-auth
15478 Sets the IMAP authentication method.
15479 Supported are the default
15486 .Sx "But, how about XOAUTH2 / OAUTHBEARER?" ) ,
15491 (for TLS secured connections which pass a client certificate via
15492 .Va tls-config-pairs ) ,
15493 as well as the \*(OPal
15505 which only need the former.
15507 solely builds upon the credentials passed via a client certificate,
15508 and is usually the way to go since tested servers do not actually follow
15509 RFC 4422, and fail if additional credentials are actually passed.
15513 Enables caching of IMAP mailboxes.
15514 The value of this variable must point to a directory that is either
15515 existent or can be created by \*(UA.
15516 All contents of the cache can be deleted by \*(UA at any time;
15517 it is not safe to make assumptions about them.
15520 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
15521 The hierarchy separator used by the IMAP server.
15522 Whenever an IMAP path is specified it will undergo normalization.
15523 One of the normalization steps is the squeezing and adjustment of
15524 hierarchy separators.
15525 If this variable is set, any occurrence of any character of the given
15526 value that exists in the path will be replaced by the first member of
15527 the value; an empty value will cause the default to be used, it is
15529 If not set, we will reuse the first hierarchy separator character that
15530 is discovered in a user-given mailbox name.
15532 .Mx Va imap-keepalive
15533 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
15534 IMAP servers may close the connection after a period of
15535 inactivity; the standard requires this to be at least 30 minutes,
15536 but practical experience may vary.
15537 Setting this variable to a numeric `value' greater than 0 causes
15538 a `NOOP' command to be sent each `value' seconds if no other operation
15542 .It Va imap-list-depth
15543 When retrieving the list of folders on an IMAP server, the
15545 command stops after it has reached a certain depth to avoid possible
15547 The value of this variable sets the maximum depth allowed.
15549 If the folder separator on the current IMAP server is a slash `/',
15550 this variable has no effect and the
15552 command does not descend to subfolders.
15554 .Mx Va imap-use-starttls
15555 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
15556 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
15557 IMAP session TLS encrypted.
15558 This functionality is not supported by all servers,
15559 and is not used if the session is already encrypted by the IMAPS method.
15565 .\" .Sh "SEE ALSO" {{{
15575 .Xr spamassassin 1 ,
15584 .Pf (or\0 Xr regex 7 ) ,
15585 .Xr mailwrapper 8 ,
15591 .\" .Sh HISTORY {{{
15594 M. Douglas McIlroy writes in his article
15595 .Dq A Research UNIX Reader: Annotated Excerpts \
15596 from the Programmer's Manual, 1971-1986
15599 command already appeared in First Edition
15603 .Bd -ragged -offset indent
15604 Electronic mail was there from the start.
15605 Never satisfied with its exact behavior, everybody touched it at one
15606 time or another: to assure the safety of simultaneous access, to improve
15607 privacy, to survive crashes, to exploit uucp, to screen out foreign
15608 freeloaders, or whatever.
15609 Not until v7 did the interface change (Thompson).
15610 Later, as mail became global in its reach, Dave Presotto took charge and
15611 brought order to communications with a grab-bag of external networks
15617 Mail, in large parts compatible with
15619 mail, was written in 1978 by Kurt Shoens and developed as part of the
15622 distribution until 1995.
15623 This manual page is derived from
15624 .Dq The Mail Reference Manual
15625 that Kurt Shoens wrote for Mail 1.3, included in 3BSD in 1980.
15630 denominator became standardized as
15632 in the X/Open Portability Guide Issue 2 (January 1987).
15633 After the rise of Open Source
15636 Mail saw continuous development in the individual code forks,
15637 noticeably by Christos Zoulas in
15639 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
15640 Ritter in the years 2000 until 2008.
15641 Since 2012 S-nail is maintained by Steffen Nurpmeso.
15644 Electronic mail exchange in general is a concept even older.
15645 The earliest well documented electronic mail system was part of the
15646 Compatible Time Sharing System (CTSS) at MIT, its MAIL command had been
15647 proposed in a staff planning memo at the end of 1964 and was implemented
15648 in mid-1965 when Tom Van Vleck and Noel Morris wrote the necessary code.
15649 Similar communication programs were built for other timesharing systems.
15650 One of the most ambitious and influential was Murray Turoff's EMISARI.
15651 Created in 1971 for the United States Office of Emergency Preparedness,
15652 EMISARI combined private electronic messages with a chat system, public
15653 postings, voting, and a user directory.
15656 During the 1960s it was common to connect a large number of terminals to
15657 a single, central computer.
15658 Connecting two computers together was relatively unusual.
15659 This began to change with the development of the ARPANET, the ancestor
15660 of today's Internet.
15661 In 1971 Ray Tomlinson adapted the SNDMSG program, originally developed
15662 for the University of California at Berkeley timesharing system, to give
15663 it the ability to transmit a message across the network into the mailbox
15664 of a user on a different computer.
15665 For the first time it was necessary to specify the recipient's computer
15666 as well as an account name.
15667 Tomlinson decided that the underused commercial at
15669 would work to separate the two.
15672 Sending a message across the network was originally treated as a special
15673 instance of transmitting a file, and so a MAIL command was included in
15674 RFC 385 on file transfer in 1972.
15675 Because it was not always clear when or where a message had come from,
15676 RFC 561 in 1973 aimed to formalize electronic mail headers, including
15681 In 1975 RFC 680 described fields to help with the transmission of
15682 messages to multiple users, including
15687 In 1977 these features and others went from best practices to a binding
15688 standard in RFC 733.
15689 Queen Elizabeth II of England became the first head of state to send
15690 electronic mail on March 26 1976 while ceremonially opening a building
15691 in the British Royal Signals and Radar Establishment (RSRE) in Malvern.
15698 .An "Kurt Shoens" ,
15699 .An "Edward Wang" ,
15700 .An "Keith Bostic" ,
15701 .An "Christos Zoulas" ,
15702 .An "Gunnar Ritter" .
15703 \*(UA is developed by
15704 .An "Steffen Nurpmeso" Aq s-mailx@lists.sdaoden.eu .
15707 .\" .Sh CAVEATS {{{
15710 \*(ID Interrupting an operation via
15714 from anywhere else but a command prompt is very problematic and likely
15715 to leave the program in an undefined state: many library functions
15716 cannot deal with the
15718 that this software (still) performs; even though efforts have been taken
15719 to address this, no sooner but in v15 it will have been worked out:
15720 interruptions have not been disabled in order to allow forceful breakage
15721 of hanging network connections, for example (all this is unrelated to
15725 The SMTP and POP3 protocol support of \*(UA is very basic.
15726 Also, if it fails to contact its upstream SMTP server, it will not make
15727 further attempts to transfer the message at a later time (setting
15732 If this is a concern, it might be better to set up a local SMTP server
15733 that is capable of message queuing.
15740 When a network-based mailbox is open, directly changing to another
15741 network-based mailbox of a different protocol (i.e., from POP3 to IMAP
15742 or vice versa) will cause a
15746 After deleting some message of a POP3 mailbox the header summary falsely
15747 claims that there are no messages to display, one needs to perform
15748 a scroll or dot movement to restore proper state.
15755 mode a power user may encounter crashes very occasionally (this is may
15759 Please report bugs to the
15761 address, for example from within \*(uA:
15762 .\" v15-compat: drop eval as `mail' will expand variable?
15763 .Ql \&? Ns \| Ic eval Ns \| Ic mail Ns \| $contact-mail .
15766 output of the command
15770 .Bd -literal -offset indent
15771 ? wysh set escape=! verbose; vput version xy; unset verbose;\e
15772 eval mail $contact-mail
15779 Information on the web at
15780 .Ql $ \*(uA -X 'echo Ns \| $ Ns Va contact-web Ns ; x' .