nail.1: missed `headerpick' reference for `save'!
[s-mailx.git] / nail.1
blob2b768f443df6a4980176edfe1e67ac08283a5fc5
1 .\"@ nail.1 - S-nail(1) reference manual.
2 .\"
3 .\" Copyright (c) 2000-2008 Gunnar Ritter, Freiburg i. Br., Germany.
4 .\" Copyright (c) 2012 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
5 .\"
6 .\" Copyright (c) 1980, 1990, 1993
7 .\"      The Regents of the University of California.  All rights reserved.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. Neither the name of the University nor the names of its contributors
18 .\"    may be used to endorse or promote products derived from this software
19 .\"    without specific prior written permission.
20 .\"
21 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .\" SUCH DAMAGE.
32 .\"
33 .\"--MKREL-START--
34 .\"@ S-nail v14.9.3 / 2017-08-03
35 .Dd August 03, 2017
36 .ds VV \\%v14.9.3
37 .\"--MKREL-END--
38 .\"--MKMAN-START--
39 .ds UU \\%S-NAIL
40 .ds UA \\%S-nail
41 .ds uA \\%s-nail
42 .ds UR \\%s-nail.rc
43 .\"--MKMAN-END--
44 .\" --BEGINSTRIP--
45 .\"
46 .\" If not ~/.mailrc, it breaks POSIX compatibility.  And adjust main.c.
47 .ds ur \\%~/.mailrc
48 .ds OB [Obsolete]
49 .ds OP [Option]
50 .ds IN [v15-compat]
51 .ds OU [no v15-compat]
52 .ds ID [v15 behaviour may differ]
53 .ds NQ [Only new quoting rules]
54 .ds BO (Boolean)
55 .ds RO (Read-only)
57 .Dt "\*(UU" 1
58 .Os
59 .Mx -enable
62 .Sh NAME
63 .Nm \*(UA \%[\*(VV]
64 .Nd send and receive Internet mail
67 .\" .Sh SYNOPSIS {{{
68 .Sh SYNOPSIS
70 .\" Keep in SYNC: ./nail.1:"SYNOPSIS, main()
71 .Nm \*(uA
72 .Fl h | Fl Fl help
73 .Pp
74 .Nm \*(uA
75 .Bk -words
76 .Op Fl BdEFinv~#
77 .Op Fl \&: Ar spec
78 .Op Fl A Ar account
79 .Op : Ns Fl a Ar attachment Ns \&:
80 .Op : Ns Fl b Ar bcc-addr Ns \&:
81 .Op : Ns Fl c Ar cc-addr Ns \&:
82 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
83 .Op Fl r Ar from-addr
84 .Oo : Ns
85 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
86 .Pf \&: Oc
87 .Op Fl s Ar subject
88 .Op : Ns Fl X Ar cmd Ns \&:
89 .Op Fl \&.
90 .Pf : Ar to-addr Ns \&:
91 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
92 .Ek
93 .Pp
94 .Nm \*(uA
95 .Bk -words
96 .Op Fl BdEeHiNnRv~#
97 .Op Fl \&: Ar spec
98 .Op Fl A Ar account
99 .Op Fl L Ar spec
100 .Op Fl r Ar from-addr
101 .Oo : Ns
102 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
103 .Pf \&: Oc
104 .Op Fl u Ar user
105 .Op : Ns Fl X Ar cmd Ns \&:
106 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
108 .Nm \*(uA
109 .Bk -words
110 .Op Fl BdEeHiNnRv~#
111 .Op Fl \&: Ar spec
112 .Op Fl A Ar account
113 .Fl f
114 .Op Fl L Ar spec
115 .Op Fl r Ar from-addr
116 .Oo : Ns
117 .Fl S Ar var Ns Op Ns = Ns Ar value Ns
118 .Pf \&: Oc
119 .Op : Ns Fl X Ar cmd Ns \&:
120 .Op Ar file
121 .Op Fl Fl \~ Ns : Ns Ar mta-option Ns \&:
124 .\" }}}
127 .Mx -toc -tree html pdf ps xhtml
130 .\" .Sh DESCRIPTION {{{
131 .Sh DESCRIPTION
133 .Bd -filled -compact -offset indent
134 .Sy Compatibility note:
135 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2019).
136 Backward incompatibility has to be expected \(en
137 .Sx COMMANDS
138 will use
139 .Sx "Shell-style argument quoting"
140 rules, for example, and shell metacharacters will become meaningful.
141 New and old behaviour is flagged \*(IN and \*(OU, and setting
142 .Va v15-compat ,
143 one of the many
144 .Sx "INTERNAL VARIABLES" ,
145 will choose new behaviour when applicable.
146 \*(OB flags what will vanish, and enabling
147 .Fl d
149 .Fl v
150 enables obsoletion warnings.
154 \*(UA provides a simple and friendly environment for sending and
155 receiving mail.
156 It is intended to provide the functionality of the POSIX
157 .Xr mailx 1
158 command, but is MIME capable and optionally offers extensions for
159 line editing, S/MIME, SMTP and POP3, among others.
160 \*(UA divides incoming mail into its constituent messages and allows
161 the user to deal with them in any order.
162 It offers many
163 .Sx COMMANDS
165 .Sx "INTERNAL VARIABLES"
166 for manipulating messages and sending mail.
167 It provides the user simple editing capabilities to ease the composition
168 of outgoing messages, and increasingly powerful and reliable
169 non-interactive scripting capabilities.
171 .\" .Ss "Options" {{{
172 .Ss "Options"
174 .Bl -tag -width ".It Fl BaNg"
176 .It Fl \&: Ar spec
177 Explicitly control which of the
178 .Sx "Resource files"
179 shall be loaded: if the letter
180 .Ql s
181 is (case-insensitively) part of the
182 .Ar spec
183 then the system wide
184 .Pa \*(UR
185 is loaded, likewise the letter
186 .Ql u
187 controls loading of the user's personal
188 .Pa \*(ur
189 file, whereas the letters
190 .Ql -
192 .Ql /
193 explicitly forbid loading of any resource files.
194 This option should be used by scripts: to avoid environmental noise they
195 should
196 .Dq detach
197 from any configuration files and create a script-local environment,
198 explicitly setting any of the desired
199 .Sx "INTERNAL VARIABLES"
201 .Fl S .
202 This option overrides
203 .Fl n .
206 .It Fl A Ar account
207 Executes an
208 .Ic account
209 command for the given user email
210 .Ar account
211 after program startup is complete (all resource files are loaded, any
212 .Fl S
213 setting is being established; only
214 .Fl X
215 commands have not been evaluated yet).
216 Being a special incarnation of
217 .Ic define Ns d
218 macros for the purpose of bundling longer-lived
219 .Ic set Ns
220 tings, activating such an email account also switches to the accounts
221 .Mx -sx
222 .Sx "primary system mailbox"
223 (most likely the
224 .Va inbox ) .
227 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
228 Attach
229 .Ar file
230 to the message (for compose mode opportunities refer to
231 .Ic ~@
233 .Ic ~^ ) .
234 .Sx "Filename transformations"
235 (also see
236 .Ic file )
237 will be performed, but shell word expansion is restricted to the tilde
238 .Ql ~ .
239 Shall
240 .Ar file
241 not be accessible but contain a
242 .Ql =
243 character, then anything before the
244 .Ql =
245 will be used as the filename, anything thereafter as a character set
246 specification.
248 If an input character set is specified,
249 .Mx -ix "character set specification"
250 but no output character set, then the given input character set is fixed
251 as-is, and no conversion will be applied;
252 giving the empty string or the special string hyphen-minus
253 .Ql -
254 will be treated as if
255 .Va ttycharset
256 has been specified (the default).
258 If an output character set has also been given then the conversion will
259 be performed exactly as specified and on-the-fly, not considering the
260 file's type and content.
261 As an exception, if the output character set is specified as the empty
262 string or hyphen-minus
263 .Ql - ,
264 then the default conversion algorithm (see
265 .Sx "Character sets" )
266 is applied (therefore no conversion is performed on-the-fly,
267 .Ar file
268 will be MIME-classified and its contents will be inspected first) \(em
269 without support for character set conversions
270 .Pf ( Va features
271 does not include the term
272 .Ql +iconv )
273 only this argument is supported.
275 .It Fl B
276 (\*(OB: \*(UA will always use line-buffered output, to gain
277 line-buffered input even in batch mode enable batch mode via
278 .Fl # . )
281 .It Fl b Ar addr
282 Send a blind carbon copy to
283 .Ar addr Ns
284 ess, if the
285 .Ic set Ns
286 ting of
287 .Va expandaddr ,
288 one of the
289 .Sx "INTERNAL VARIABLES" ,
290 allows.
291 The option may be used multiple times.
292 Also see the section
293 .Sx "On sending mail, and non-interactive mode" .
296 .It Fl c Ar addr
297 Send carbon copies to the given receiver, if so allowed by
298 .Va expandaddr .
299 May be used multiple times.
302 .It Fl d
303 .Ic set
304 the internal variable
305 .Va debug
306 which enables debug messages and disables message delivery,
307 among others; effectively turns almost any operation into a dry-run.
310 .It Fl E
311 .Ic set
312 .Va skipemptybody
313 and thus discard messages with an empty message part body.
314 This command line option is \*(OB.
317 .It Fl e
318 Just check if mail is present (in the system
319 .Va inbox
320 or the one specified via
321 .Fl f ) :
322 if yes, return an exit status of zero, a non-zero value otherwise.
323 To restrict the set of mails to consider in this evaluation a message
324 specification can be added with the option
325 .Fl L .
328 .It Fl F
329 Save the message to send in a file named after the local part of the
330 first recipient's address (instead of in
331 .Va record Ns ).
334 .It Fl f
335 Read in the contents of the user's
336 .Mx -sx
337 .Sx "secondary mailbox"
338 .Ev MBOX
339 (or the specified file) for processing;
340 when \*(UA is quit, it writes undeleted messages back to this file
341 (but be aware of the
342 .Va hold
343 option).
344 The optional
345 .Ar file
346 argument will undergo some special
347 .Sx "Filename transformations"
348 (also see
349 .Ic file ) .
350 Note that
351 .Ar file
352 is not an argument to the flag
353 .Fl \&\&f ,
354 but is instead taken from the command line after option processing has
355 been completed.
356 In order to use a
357 .Ar file
358 that starts with a hyphen-minus, prefix with a relative path, as in
359 .Ql ./-hyphenbox.mbox .
362 .It Fl H
363 Display a summary of
364 .Ic headers
365 and exit; a configurable summary view is available via the
366 .Fl L
367 option.
370 .It Fl h
371 Show a short usage summary.
374 .It Fl i
375 .Ic set
376 .Va ignore
377 to ignore tty interrupt signals.
380 .It Fl L Ar spec
381 Display a summary of
382 .Ic headers
383 of all messages that match the given
384 .Ar spec ,
385 then exit.
386 See the section
387 .Sx "Specifying messages"
388 for the format of
389 .Ar spec .
390 If the
391 .Fl e
392 option has been given in addition no header summary is produced,
393 but \*(UA will instead indicate via its exit status whether
394 .Ar spec
395 matched any messages
396 .Pf ( Ql 0 )
397 or not
398 .Pf ( Ql 1 ) ;
399 note that any verbose output is suppressed in this mode and must instead
400 be enabled explicitly (e.g., by using the option
401 .Fl v ) .
404 .It Fl M Ar type
405 Special send mode that will flag standard input with the MIME
406 .Ql Content-Type:
407 set to the given
408 .Ar type
409 and use it as the main message body.
410 \*(ID Using this option will bypass processing of
411 .Va message-inject-head ,
412 .Va signature
414 .Va message-inject-tail .
415 Also see
416 .Fl q , m , t .
419 .It Fl m Ar file
420 Special send mode that will MIME classify the specified
421 .Ar file
422 and use it as the main message body.
423 \*(ID Using this option will bypass processing of
424 .Va message-inject-head ,
425 .Va signature
427 .Va message-inject-tail .
428 Also see
429 .Fl q , M , t .
432 .It Fl N
433 inhibit the initial display of message headers when reading mail or
434 editing a mailbox
435 .Ic folder
436 by calling
437 .Ic unset
438 for the internal variable
439 .Va header .
442 .It Fl n
443 Standard flag that inhibits reading the system wide
444 .Pa \*(UR
445 upon startup.
446 The option
447 .Fl \&:
448 allows more control over the startup sequence; also see
449 .Sx "Resource files" .
452 .It Fl q Ar file
453 Special send mode that will initialize the message body with the
454 contents of the specified
455 .Ar file ,
456 which may be standard input
457 .Ql -
458 only in non-interactive context.
459 Also see
460 .Fl M , m , t .
463 .It Fl R
464 Any mailbox
465 .Ic folder
466 opened will be in read-only mode.
470 .It Fl r Ar from-addr
471 Whereas the source address that appears in the
472 .Va from
473 header of a message (or in the
474 .Va sender
475 header if the former contains multiple addresses) is honoured by the
476 builtin SMTP transport, it is not used by a file-based
477 .Va mta
478 (Mail-Transfer-Agent) for the RFC 5321 reverse-path used for relaying
479 and delegating a message to its destination(s), for delivery errors
480 etc., but it instead uses the local identity of the initiating user.
483 When this command line option is used the given
484 .Ar from-addr
485 will be assigned to the internal variable
486 .Va from ,
487 but in addition the command line option
488 .Fl \&\&f Ar from-addr
489 will be passed to a file-based
490 .Va mta
491 whenever a message is sent.
492 Shall
493 .Ar from-addr
494 include a user name the address components will be separated and
495 the name part will be passed to a file-based
496 .Va mta
497 individually via
498 .Fl \&\&F Ar name .
501 If an empty string is passed as
502 .Ar from-addr
503 then the content of the variable
504 .Va from
505 (or, if that contains multiple addresses,
506 .Va sender )
507 will be evaluated and used for this purpose whenever the file-based
508 .Va mta
509 is contacted.
510 By default, without
511 .Fl \&\&r
512 that is, neither
513 .Fl \&\&f
515 .Fl \&\&F
516 command line options are used when contacting a file-based MTA, unless
517 this automatic deduction is enforced by
518 .Ic set Ns
519 ing the internal variable
520 .Va r-option-implicit .
523 Remarks: many default installations and sites disallow overriding the
524 local user identity like this unless either the MTA has been configured
525 accordingly or the user is member of a group with special privileges.
529 .It Fl S Ar var Ns Op = Ns value
530 .Ic set
531 the internal
532 .Ar var Ns
533 iable and, in case of a non-boolean variable which has a value, assign
534 .Ar value
535 to it.
536 Even though
537 .Sx "INTERNAL VARIABLES"
538 .Ic \&\&set
540 .Fl \&\&S
541 may be overwritten from within resource files,
542 the command line setting will be reestablished after all resource files
543 have been loaded.
544 (\*(ID In the future such a setting may instead become
545 .Dq frozen
546 until the startup is complete.)
549 .It Fl s Ar subject
550 Specify the subject of the message to be sent.
551 Newline (NL) and carriage-return (CR) bytes are invalid and will be
552 normalized to space (SP) characters.
555 .It Fl t
556 The message given (on standard input) is expected to contain, separated
557 from the message body by an empty line, a message header with
558 .Ql To: ,
559 .Ql Cc: ,
561 .Ql Bcc:
562 fields giving its recipients, which will be added to any recipients
563 specified on the command line.
564 If a message subject is specified via
565 .Ql Subject:
566 then it will be used in favour of one given on the command line.
568 Also understood are
569 .Ql Reply-To:
570 (possibly overriding
571 .Va reply-to ) ,
572 .Ql Sender:
573 .Pf ( Va sender ) ,
574 .Ql From:
575 .Pf ( Va from
576 and / or option
577 .Fl r ) .
578 .Ql Message-ID: ,
579 .Ql In-Reply-To: ,
580 .Ql References:
582 .Ql Mail-Followup-To: ,
583 by default created automatically dependent on message context, will
584 be used if specified (a special address massage will however still occur
585 for the latter).
586 Any other custom header field (also see
587 .Va customhdr
589 .Ic ~^ )
590 is passed through entirely
591 unchanged, and in conjunction with the options
592 .Fl ~
594 .Fl #
595 it is possible to embed
596 .Sx "COMMAND ESCAPES" .
597 Also see
598 .Fl M , m , q .
601 .It Fl u Ar user
602 Initially read the
603 .Mx -sx
604 .Sx "primary system mailbox"
606 .Ar user ,
607 appropriate privileges presumed; effectively identical to
608 .Ql Fl \&\&f Ns \0%user .
611 .It Fl V
612 Show \*(UA's
613 .Va version
614 and exit.
615 The command
616 .Ic version
617 will also show the list of
618 .Va features :
619 .Ql $ \*(uA -Xversion -Xx .
622 .It Fl v
623 .Ic set Ns
624 ting the internal variable
625 .Va verbose
626 enables display of some informational context messages.
627 Using it twice increases the level of verbosity.
630 .It Fl X Ar cmd
631 Add the given (or multiple for a multiline argument)
632 .Ar cmd
633 to the list of commands to be executed,
634 as a last step of program startup, before normal operation starts.
635 This is the only possibility to execute commands in non-interactive mode
636 when reading startup files is actively prohibited.
637 The commands will be evaluated as a unit, just as via
638 .Ic source .
639 Correlates with
640 .Fl #
642 .Va errexit .
645 .It Fl ~
646 Enable
647 .Sx "COMMAND ESCAPES"
648 in compose mode even in non-interactive use cases.
649 This can be used to, e.g., automatically format the composed message
650 text before sending the message:
651 .Bd -literal -offset indent
652 $ ( echo 'line    one. Word.     Word2.';\e
653     echo '~| /usr/bin/fmt -tuw66' ) |\e
654   LC_ALL=C \*(uA -d~:/ -Sttycharset=utf-8 bob@exam.ple
658 .It Fl #
659 Enables batch mode: standard input is made line buffered, the complete
660 set of (interactive) commands is available, processing of
661 .Sx "COMMAND ESCAPES"
662 is enabled in compose mode, and diverse
663 .Sx "INTERNAL VARIABLES"
664 are adjusted for batch necessities, exactly as if done via
665 .Fl S :
666 .Va emptystart ,
667 .Pf no Va errexit ,
668 .Pf no Va header ,
669 .Pf no Va posix ,
670 .Va quiet ,
671 .Va sendwait ,
672 .Va typescript-mode
673 as well as
674 .Ev MAIL ,
675 .Ev MBOX
677 .Va inbox
678 (the latter three to
679 .Pa /dev/null ) .
680 The following prepares an email message in a batched dry run:
681 .Bd -literal -offset indent
682 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' |\e
683   LC_ALL=C \*(uA -d#:/ -X'alias bob bob@exam.ple'
687 .It Fl \&.
688 This flag forces termination of option processing in order to prevent
689 .Dq option injection
690 (attacks).
691 It also forcefully puts \*(UA into send mode, see
692 .Sx "On sending mail, and non-interactive mode" .
696 All given
697 .Ar to-addr
698 arguments and all receivers established via
699 .Fl b
701 .Fl c
702 are subject to the checks established by
703 .Va expandaddr ,
704 one of the
705 .Sx "INTERNAL VARIABLES" .
706 If the setting of
707 .Va expandargv
708 allows their recognition all
709 .Ar mta-option
710 arguments given at the end of the command line after a
711 .Ql --
712 separator will be passed through to a file-based
713 .Va mta
714 (Mail-Transfer-Agent) and persist for the entire session.
715 .Va expandargv
716 constraints do not apply to the content of
717 .Va mta-arguments .
718 .\" }}}
720 .\" .Ss "A starter" {{{
721 .Ss "A starter"
723 \*(UA is a direct descendant of
725 Mail, itself a successor of the Research
727 mail which
728 .Dq was there from the start
729 according to
730 .Sx HISTORY .
731 It thus represents the user side of the
733 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
734 traditionally taken by
735 .Xr sendmail 8 ,
736 and most MTAs provide a binary of this name for compatibility purposes.
737 If the \*(OPal SMTP
738 .Va mta
739 is included in the
740 .Va features
741 of \*(UA then the system side is not a mandatory precondition for mail
742 delivery.
745 Because \*(UA strives for compliance with POSIX
746 .Xr mailx 1
747 it is likely that some configuration settings have to be adjusted before
748 using it is a smooth experience.
749 (Rather complete configuration examples can be found in the section
750 .Sx EXAMPLES . )
751 The default global
752 .Pa \*(UR
753 resource file bends those standard imposed settings of the
754 .Sx "INTERNAL VARIABLES"
755 a bit towards more user friendliness and safety already.
758 For example, it
759 .Ic set Ns s
760 .Va hold
762 .Va keepsave
763 in order to suppress the automatic moving of messages to the
764 .Mx -sx
765 .Sx "secondary mailbox"
766 .Ev MBOX
767 that would otherwise occur (see
768 .Sx "Message states" ) ,
770 .Va keep
771 to not remove empty system MBOX mailbox files in order not to mangle
772 file permissions when files eventually get recreated (all empty (MBOX)
773 mailbox files will be removed unless this variable is set whenever
774 .Ev POSIXLY_CORRECT
775 mode has been enabled).
778 It also enables
779 .Va sendwait
780 in order to synchronize \*(UA with the exit status report of the used
781 .Va mta
782 when sending mails.
784 .Ic set Ns
786 .Va emptystart
787 to enter interactive startup even if the initial mailbox is empty,
788 .Va editheaders
789 to allow editing of headers as well as
790 .Va fullnames
791 to not strip down addresses in compose mode, and
792 .Va quote
793 to include the message that is being responded to when
794 .Ic reply Ns
795 ing.
798 It should be remarked that the file mode creation mask can be
799 explicitly managed via the variable
800 .Va umask .
801 \*(UA will not follow symbolic links when opening files for writing,
802 sufficient system support provided.
803 .\" }}}
805 .\" .Ss "On sending mail, and non-interactive mode" {{{
806 .Ss "On sending mail, and non-interactive mode"
808 To send a message to one or more people, using a local or a built-in
809 .Va mta
810 (Mail-Transfer-Agent) transport to actually deliver the generated mail
811 message, \*(UA can be invoked with arguments which are the names of
812 people to whom the mail will be sent, and the command line options
813 .Fl b
815 .Fl c
816 can be used to add (blind) carbon copy receivers:
818 .Bd -literal -offset indent
819 # Via sendmail(1)
820 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
822 # But... try it in an isolated dry-run mode (-d) first
823 $ LC_ALL=C \*(uA -d -:/ -Ssendwait -Sttycharset=utf8 \e
824    -b bcc@exam.ple -c cc@exam.ple \e
825    -. '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
827 # With SMTP
828 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
829     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
830     -S from=scriptreply@exam.ple \e
831     -a /etc/mail.rc \e
832     -. eric@exam.ple
836 If standard input is a terminal rather than the message to be sent,
837 the user is expected to type in the message contents.
838 In this compose mode \*(UA treats lines beginning with the character
839 .Ql ~
840 special \(en these are so-called
841 .Sx "COMMAND ESCAPES" ,
842 which can be used to read in files, process shell commands, add and edit
843 attachments and more; e.g., the command escape
844 .Ic ~e
845 will start the text editor to revise the message in its current state,
846 .Ic ~h
847 allows editing of the most important message headers, with
848 .Ic ~^
849 custom headers can be created (more specifically than with
850 .Va customhdr ) .
851 .Ic ~?
852 gives an overview of most other available command escapes.
853 The command escape
854 .Ic ~.
855 will leave compose mode and send the message once it is completed.
856 Alternatively typing
857 .Ql control-D
858 .Pf ( Ql ^D )
859 at the beginning of an empty line has the same effect, whereas typing
860 .Ql control-C
861 .Pf ( Ql ^C )
862 twice will abort the current letter (saving its contents in the file
863 denoted by
864 .Ev DEAD
865 unless
866 .Pf no Va save
867 is set).
870 A number of
871 .Sx ENVIRONMENT
873 .Sx "INTERNAL VARIABLES"
874 can be used to alter default behavior.
875 E.g., messages are sent asynchronously, without supervision, unless the
876 internal variable
877 .Va sendwait
878 is set, therefore send errors will not be recognizable until then.
879 .Ic set Ns
880 ting (also via
881 .Fl S )
882 .Va editalong
883 will automatically startup a text editor when compose mode is entered,
884 .Va editheaders
885 allows editing of headers additionally to plain body content, whereas
886 .Va askcc
888 .Va askbcc
889 will cause the user to be prompted actively for (blind) carbon-copy
890 recipients, respectively, if the given list is empty.
893 Especially when using public mail provider accounts with the SMTP
894 .Va mta
895 it is often necessary to set
896 .Va from
897 and/or
898 .Va hostname
899 (even finer control via
900 .Va smtp-hostname ) ,
901 which (even if empty) also causes creation of
902 .Ql Message-ID:
904 .Ql Content-ID:
905 header fields unless
906 .Va stealthmua
907 is set.
908 Saving a copy of sent messages in a
909 .Va record
910 mailbox may be desirable \(en as for most mailbox
911 .Ic file
912 targets the value will undergo
913 .Sx "Filename transformations" .
914 Defining user email
915 .Ic account Ns s
916 for the purpose of arranging a complete environment of settings that can
917 be switched to with a single command or command line option may be
918 useful.
919 .Pf ( Sx EXAMPLES
920 has example configurations for some of the well-known public mail
921 providers, and also gives a compact overview on how to setup a secure
922 SSL/TLS environment.)
923 Some introductional
924 .Fl d
926 .Va debug
927 sandbox dry-run tests will prove correctness.
930 The section
931 .Sx "On URL syntax and credential lookup"
932 will spread light on the different ways of how to specify user email
933 account credentials, the
934 .Ql USER@HOST
935 variable chains, and accessing protocol-specific resources,
936 the section
937 .Sx "Character sets"
938 goes into the details of character encodings, and how to use them for
939 interpreting the input data given in
940 .Va ttycharset
941 and representing messages and MIME part contents in
942 .Va sendcharsets ,
943 and reading the section
944 .Sx "The mime.types files"
945 should help to understand how the MIME-type of outgoing attachments are
946 classified, and what can be done for fine-tuning.
947 Over the wire a configurable
948 .Va mime-encoding
949 .Pf ( Ql Content-Transfer-Encoding: )
950 may be applied to the message data.
953 Message recipients (as specified on the command line or defined in
954 .Ql To: ,
955 .Ql Cc:
957 .Ql Bcc: )
958 may not only be email addressees but can also be names of mailboxes and
959 even complete shell command pipe specifications.
960 If the variable
961 .Va expandaddr
962 is not set then only network addresses (see
963 .Xr mailaddr 7
964 for a description of mail addresses) and plain user names (including MTA
965 aliases) may be used, other types will be filtered out, giving a warning
966 message.
967 The command
968 .Ic addrcodec
969 can be used to generate standard compliant network addresses.
971 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
972 .\" grep the latter for the complete picture
974 If the variable
975 .Va expandaddr
976 is set then extended recipient addresses will optionally be accepted:
977 Any name which starts with a vertical bar
978 .Ql |
979 character specifies a command pipe \(en the command string following the
980 .Ql |
981 is executed and the message is sent to its standard input;
982 Likewise, any name that starts with the character solidus
983 .Ql /
984 or the character sequence dot solidus
985 .Ql ./
986 is treated as a file, regardless of the remaining content;
987 likewise a name that solely consists of a hyphen-minus
988 .Ql - .
989 Any other name which contains a commercial at
990 .Ql @
991 character is treated as a network address;
992 Any other name which starts with a plus sign
993 .Ql +
994 character specifies a mailbox name;
995 Any other name which contains a solidus
996 .Ql /
997 character but no exclamation mark
998 .Ql \&!
999 or percent sign
1000 .Ql %
1001 character before also specifies a mailbox name;
1002 What remains is treated as a network address.
1004 .Bd -literal -offset indent
1005 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1006 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1007 $ echo safe | LC_ALL=C \e
1008     \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1009       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1010       -. bob@exam.ple
1014 It is possible to create personal distribution lists via the
1015 .Ic alias
1016 command, so that, for instance, the user can send mail to
1017 .Ql cohorts
1018 and have it go to a group of people.
1019 These aliases have nothing in common with the system wide aliases that
1020 may be used by the MTA, which are subject to the
1021 .Ql name
1022 constraint of
1023 .Va expandaddr
1024 and are often tracked in a file
1025 .Pa /etc/aliases
1026 (and documented in
1027 .Xr aliases 5
1029 .Xr sendmail 1 ) .
1030 Personal aliases will be expanded by \*(UA before the message is sent,
1031 and are thus a convenient alternative to specifying each addressee by
1032 itself; they correlate with the active set of
1033 .Ic alternates
1034 and are subject to
1035 .Va metoo
1036 filtering.
1039 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
1042 .Va on-compose-enter , on-compose-leave
1044 .Va on-compose-cleanup
1045 hook variables may be set to
1046 .Ic define Ns
1047 d macros to automatically adjust some settings dependent
1048 on receiver, sender or subject contexts, and via the
1049 .Va on-compose-splice
1050 as well as
1051 .Va on-compose-splice-shell
1052 variables, the former also to be set to a
1053 .Ic define Ns
1054 d macro, increasingly powerful mechanisms to perform automated message
1055 adjustments are available.
1056 (\*(ID These hooks work for commands which newly create messages, namely
1057 .Ic forward , mail , reply
1058 and variants;
1059 .Ic resend
1061 .Ic Resend
1062 for now provide only the hooks
1063 .Va on-resend-enter
1065 .Va on-resend-cleanup . )
1068 To avoid environmental noise scripts should
1069 .Dq detach
1070 \*(UA from any configuration files and create a script-local
1071 environment, ideally with the command line options
1072 .Fl \&:
1073 to disable any configuration file in conjunction with repetitions of
1074 .Fl S
1075 to specify variables:
1077 .Bd -literal -offset indent
1078 $ env LC_ALL=C \*(uA -:/ \e
1079     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1080     -Sexpandaddr=fail,-all,failinvaddr \e
1081     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1082     -S from=scriptreply@exam.ple \e
1083     -s 'Subject to go' -a attachment_file \e
1084     -. 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1085     < content_file
1089 As shown, scripts can
1090 .Dq fake
1091 a locale environment, the above specifies the all-compatible 7-bit clean
1092 .Ev LC_ALL
1093 .Dq C ,
1094 but will nonetheless take and send UTF-8 in the message text by using
1095 .Va ttycharset .
1096 In interactive mode, which is introduced in the next section, messages
1097 can be sent by calling the
1098 .Ic mail
1099 command with a list of recipient addresses:
1101 .Bd -literal -offset indent
1102 $ \*(uA -d -Squiet -Semptystart
1103 "/var/spool/mail/user": 0 messages
1104 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1106 ? # Will do the right thing (tm)
1107 ? m rec1@exam.ple rec2@exam.ple
1109 .\" }}}
1111 .\" .Ss "On reading mail, and interactive mode" {{{
1112 .Ss "On reading mail, and interactive mode"
1114 When invoked without addressees \*(UA enters interactive mode in which
1115 mails may be read.
1116 When used like that the user's system
1117 .Va inbox
1118 (for more on mailbox types please see the command
1119 .Ic file )
1120 is read in and a one line header of each message therein is displayed if
1121 the variable
1122 .Va header
1123 is set.
1124 The visual style of this summary of
1125 .Ic headers
1126 can be adjusted through the variable
1127 .Va headline
1128 and the possible sorting criterion via
1129 .Va autosort .
1130 Scrolling through
1131 .Va screen Ns
1132 fuls of
1133 .Ic headers
1134 can be performed with the command
1135 .Ic z .
1136 If the initially opened mailbox is empty \*(UA will instead exit
1137 immediately (after displaying a message) unless the variable
1138 .Va emptystart
1139 is set.
1142 At the
1143 .Va prompt
1144 the command
1145 .Ic list
1146 will give a listing of all available commands and
1147 .Ic help
1148 will give a summary of some common ones.
1149 If the \*(OPal documentation strings are available one can type
1150 .Ql help X
1151 .Pf "(or " Ql ?X )
1152 and see the actual expansion of
1153 .Ql X
1154 and what its purpose is, i.e., commands can be abbreviated
1155 (note that POSIX defines some abbreviations, so that the alphabetical
1156 order of commands does not necessarily relate to the abbreviations; it is
1157 however possible to define overwrites with
1158 .Ic commandalias ) .
1159 These commands can also produce a more
1160 .Va verbose
1161 output.
1164 Messages are given numbers (starting at 1) which uniquely identify
1165 messages; the current message \(en the
1166 .Dq dot
1167 \(en will either be the first new message, or the first unread message,
1168 or the first message of the mailbox; the internal variable
1169 .Va showlast
1170 will instead cause usage of the last message for this purpose.
1171 The command
1172 .Ic headers
1173 will display a
1174 .Va screen Ns
1175 ful of header summaries containing the
1176 .Dq dot ,
1177 whereas
1178 .Ic from
1179 will display only the summaries of the given messages, defaulting to the
1180 .Dq dot .
1183 Message content can be displayed with the command
1184 .Ic type
1185 .Pf ( Ql t ,
1186 alias
1187 .Ic print ) .
1188 Here the variable
1189 .Va crt
1190 controls whether and when \*(UA will use the configured
1191 .Ev PAGER
1192 for display instead of directly writing to the user terminal
1193 .Va screen ,
1194 the sole difference to the command
1195 .Ic more ,
1196 which will always use the
1197 .Ev PAGER .
1198 The command
1199 .Ic top
1200 will instead only show the first
1201 .Va toplines
1202 of a message (maybe even compressed if
1203 .Va topsqueeze
1204 is set).
1205 Message display experience may improve by setting and adjusting
1206 .Va mime-counter-evidence ,
1207 and also see
1208 .Sx "HTML mail and MIME attachments" .
1211 By default the current message
1212 .Pf ( Dq dot )
1213 is displayed, but like with many other commands it is possible to give
1214 a fancy message specification (see
1215 .Sx "Specifying messages" ) ,
1216 e.g.,
1217 .Ql t:u
1218 will display all unread messages,
1219 .Ql t.
1220 will display the
1221 .Dq dot ,
1222 .Ql t 1 5
1223 will type the messages 1 and 5,
1224 .Ql t 1-5
1225 will type the messages 1 through 5, and
1226 .Ql t-
1228 .Ql t+
1229 will display the last and the next message, respectively.
1230 The command
1231 .Ic search
1232 (a more substantial alias for
1233 .Ic from )
1234 will display a header summary of the given message specification list
1235 instead of their content, e.g., the following will search for subjects:
1238 .Dl ? from "'@Some subject to search for'"
1241 In the default setup all header fields of a message will be
1242 .Ic type Ns
1243 d, but fields can be white- or blacklisted for a variety of
1244 applications by using the command
1245 .Ic headerpick ,
1246 e.g., to restrict their display to a very restricted set for
1247 .Ic type :
1248 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1249 In order to display all header fields of a message regardless of
1250 currently active ignore or retain lists, use the commands
1251 .Ic Type
1253 .Ic Top ;
1254 .Ic Show
1255 will show the raw message content.
1256 Note that historically the global
1257 .Pa \*(UR
1258 not only adjusts the list of displayed headers, but also sets
1259 .Va crt .
1262 Dependent upon the configuration a line editor (see the section
1263 .Sx "On terminal control and line editor" )
1264 aims at making the user experience with the many
1265 .Sx COMMANDS
1266 a bit nicer.
1267 When reading the system
1268 .Va inbox
1269 or when
1270 .Fl f
1272 .Ic file )
1273 specified a mailbox explicitly prefixed with the special
1274 .Ql %:
1275 modifier (propagating the mailbox to a
1276 .Mx -sx
1277 .Sx "primary system mailbox" ) ,
1278 then messages which have been read will be automatically moved to a
1279 .Mx -sx
1280 .Sx "secondary mailbox" ,
1281 the users
1282 .Ev MBOX
1283 file, when the mailbox is left, either by changing the
1284 active mailbox or by quitting \*(UA (also see
1285 .Sx "Message states" )
1286 \(en this automatic moving from a system or primary to the secondary
1287 mailbox is not performed when the variable
1288 .Va hold
1289 is set.
1290 Messages can also be explicitly
1291 .Ic move Ns
1292 d to other mailboxes, whereas
1293 .Ic copy
1294 keeps the original message.
1295 .Ic write
1296 can be used to write out data content of specific parts of messages.
1299 After examining a message the user can
1300 .Ic reply Ql r
1301 to the sender and all recipients (which will also be placed in
1302 .Ql To:
1303 unless
1304 .Va recipients-in-cc
1305 is set) or
1306 .Ic Reply Ql R
1307 exclusively to the sender(s).
1308 .Ic forward Ns
1309 ing a message will allow editing the new message: the original message
1310 will be contained in the message body, adjusted according to
1311 .Ic headerpick .
1312 When replying to or forwarding a message recipient addresses will be
1313 stripped from comments and names unless the internal variable
1314 .Va fullnames
1315 is set.
1316 It is possible to
1317 .Ic resend
1319 .Ic Resend
1320 messages: the former will add a series of
1321 .Ql Resent-
1322 headers, whereas the latter will not; different to newly created
1323 messages editing is not possible and no copy will be saved even with
1324 .Va record
1325 unless the additional variable
1326 .Va record-resent
1327 is set.
1328 Of course messages can be
1329 .Ic delete Ql d ,
1330 and they can spring into existence again via
1331 .Ic undelete
1332 or when the \*(UA session is ended via the
1333 .Ic exit Ql x
1334 command.
1337 To end a mail processing session one may either issue
1338 .Ic quit Ql q
1339 to cause a full program exit, which possibly includes
1340 automatic moving of read messages to the
1341 .Mx -sx
1342 .Sx "secondary mailbox"
1343 .Ev MBOX
1344 as well as updating the \*(OPal line editor
1345 .Va history-file ,
1346 or use the command
1347 .Ic exit Ql x
1348 instead in order to prevent any of these actions.
1349 .\" }}}
1351 .\" .Ss "HTML mail and MIME attachments" {{{
1352 .Ss "HTML mail and MIME attachments"
1354 Messages which are HTML-only become more and more common and of course
1355 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1356 Mail Extensions) parts for, e.g., attachments.
1357 To get a notion of MIME types, \*(UA will first read
1358 .Sx "The mime.types files"
1359 (as configured and allowed by
1360 .Va mimetypes-load-control ) ,
1361 and then add onto that types registered directly with
1362 .Ic mimetype .
1363 It (normally) has a default set of types built-in, too.
1364 To improve interaction with faulty MIME part declarations which are
1365 often seen in real-life messages, setting
1366 .Va mime-counter-evidence
1367 will allow \*(UA to verify the given assertion and possibly provide
1368 an alternative MIME type.
1371 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter for
1372 HTML messages, it cannot handle MIME types other than plain text itself.
1373 Instead programs need to become registered to deal with specific MIME
1374 types or file extensions.
1375 These programs may either prepare plain text versions of their input in
1376 order to enable \*(UA to integrate their output neatlessly in its own
1377 message visualization (a mode which is called
1378 .Cd copiousoutput ) ,
1379 or display the content themselves, for example in an external graphical
1380 window: such handlers will only be considered by and for the command
1381 .Ic mimeview .
1384 To install a handler program for a specific MIME type an according
1385 .Va pipe-TYPE/SUBTYPE
1386 variable needs to be set; to instead define a handler for a specific
1387 file extension the respective
1388 .Va pipe-EXTENSION
1389 variable can be used \(en these handlers take precedence.
1390 \*(OPally \*(UA supports mail user agent configuration as defined in
1391 RFC 1524; this mechanism (see
1392 .Sx "The Mailcap files" )
1393 will be queried for display or quote handlers if none of the former two
1394 .\" TODO v15-compat "will be" -> "is"
1395 did; it will be the sole source for handlers of other purpose.
1396 A last source for handlers is the MIME type definition itself, when
1397 a (\*(UA specific) type-marker was registered with the command
1398 .Ic mimetype
1399 (which many built-in MIME types do).
1402 E.g., to display a HTML message inline (that is, converted to a more
1403 fancy plain text representation than the built-in converter is capable to
1404 produce) with either of the text-mode browsers
1405 .Xr lynx 1
1407 .Xr elinks 1 ,
1408 teach \*(UA about MathML documents and make it display them as plain
1409 text, and to open PDF attachments in an external PDF viewer,
1410 asynchronously and with some other magic attached:
1412 .Bd -literal -offset indent
1413 ? if [ "$features" !% +filter-html-tagsoup ]
1414 ?  #set pipe-text/html='@* elinks -force-html -dump 1'
1415 ?  set pipe-text/html='@* lynx -stdin -dump -force_html'
1416 ?  # Display HTML as plain text instead
1417 ?  #set pipe-text/html=@
1418 ? endif
1419 ? mimetype @ application/mathml+xml mathml
1420 ? wysh set pipe-application/pdf='@&=@ \e
1421     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1422     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1423     mupdf "${MAILX_FILENAME_TEMPORARY}"'
1425 .\" }}}
1427 .\" .Ss "Mailing lists" {{{
1428 .Ss "Mailing lists"
1430 \*(UA offers some support to ease handling of mailing lists.
1431 The command
1432 .Ic mlist
1433 promotes all given arguments to known mailing lists, and
1434 .Ic mlsubscribe
1435 sets their subscription attribute, creating them first as necessary.
1436 (On the other hand
1437 .Ic unmlsubscribe
1438 does not
1439 .Ic unmlist
1440 automatically, but only resets the subscription attribute.)
1441 Using the commands without arguments will show (a subset of) all
1442 currently defined mailing lists.
1444 .Va headline
1445 format
1446 .Ql \&%T
1447 can be used to mark out messages with configured list addresses
1448 in the header display.
1451 \*(OPally mailing lists may also be specified as (extended) regular
1452 expressions, which allows matching of many addresses with a single
1453 expression.
1454 However, all fully qualified list addresses are matched via a fast
1455 dictionary, whereas expressions are placed in (a) list(s) which is
1456 (are) matched sequentially.
1458 .Bd -literal -offset indent
1459 ? set followup-to followup-to-honour=ask-yes \e
1460     reply-to-honour=ask-yes
1461 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1462 ? mlsubscribe a4@b4.c4 exact@lists.c3
1466 The variable
1467 .Va followup-to-honour
1468 will ensure that a
1469 .Ql Mail-\:Followup-\:To:
1470 header is honoured when the message is being replied to (via
1471 .Ic reply
1473 .Ic Lreply )
1475 .Va followup-to
1476 controls whether this header is created when sending mails; it will be
1477 created automatically for a couple of reasons, too, like when the
1478 special
1479 .Dq mailing list specific
1480 respond command
1481 .Ic Lreply
1482 is used, when
1483 .Ic reply
1484 is used to respond to a message with its
1485 .Ql Mail-Followup-To:
1486 being honoured etc.
1489 A difference in between the handling of known and subscribed lists is
1490 that the address of the sender is usually not part of a generated
1491 .Ql Mail-Followup-To:
1492 when addressing the latter, whereas it is for the former kind of lists.
1493 Usually because there are exceptions: say, if multiple lists are
1494 addressed and not all of them are subscribed lists.
1496 For convenience \*(UA will, temporarily, automatically add a list
1497 address that is presented in the
1498 .Ql List-Post:
1499 header of a message that is being responded to to the list of known
1500 mailing lists.
1501 Shall that header have existed \*(UA will instead, dependent on the
1502 variable
1503 .Va reply-to-honour ,
1504 use an also set
1505 .Ql Reply-To:
1506 for this purpose in order to accept a list administrators' wish that
1507 is supposed to have been manifested like that (but only if it provides
1508 a single address which resides on the same domain as what is stated in
1509 .Ql List-Post: ) .
1510 .\" }}}
1512 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1513 .Ss "Signed and encrypted messages with S/MIME"
1515 \*(OP S/MIME provides two central mechanisms:
1516 message signing and message encryption.
1517 A signed message contains some data in addition to the regular text.
1518 The data can be used to verify that the message was sent using a valid
1519 certificate, that the sender's address in the message header matches
1520 that in the certificate, and that the message text has not been altered.
1521 Signing a message does not change its regular text;
1522 it can be read regardless of whether the recipient's software is able to
1523 handle S/MIME.
1524 It is thus usually possible to sign all outgoing messages if so desired.
1527 Encryption, in contrast, makes the message text invisible for all people
1528 except those who have access to the secret decryption key.
1529 To encrypt a message, the specific recipient's public encryption key
1530 must be known.
1531 It is therefore not possible to send encrypted mail to people unless their
1532 key has been retrieved from either previous communication or public key
1533 directories.
1534 A message should always be signed before it is encrypted.
1535 Otherwise, it is still possible that the encrypted message text is
1536 altered.
1539 A central concept to S/MIME is that of the certification authority (CA).
1540 A CA is a trusted institution that issues certificates.
1541 For each of these certificates it can be verified that it really
1542 originates from the CA, provided that the CA's own certificate is
1543 previously known.
1544 A set of CA certificates is usually delivered with OpenSSL and installed
1545 on your system.
1546 If you trust the source of your OpenSSL software installation,
1547 this offers reasonable security for S/MIME on the Internet.
1548 Otherwise set
1549 .Va smime-ca-no-defaults
1550 to avoid using the default certificates and point
1551 .Va smime-ca-file
1552 and/or
1553 .Va smime-ca-dir
1554 to a trusted pool of certificates.
1555 In general, a certificate cannot be more secure than the method its CA
1556 certificate has been retrieved with.
1559 This trusted pool of certificates is used by the command
1560 .Ic verify
1561 to ensure that the given S/MIME messages can be trusted.
1562 If so, verified sender certificates that were embedded in signed
1563 messages can be saved locally with the command
1564 .Ic certsave ,
1565 and used by \*(UA to encrypt further communication with these senders:
1567 .Bd -literal -offset indent
1568 ? certsave FILENAME
1569 ? set smime-encrypt-USER@HOST=FILENAME \e
1570     smime-cipher-USER@HOST=AES256
1574 To sign outgoing messages in order to allow receivers to verify the
1575 origin of these messages a personal S/MIME certificate is required.
1576 \*(UA supports password-protected personal certificates (and keys),
1577 for more on this, and its automatization, please see the section
1578 .Sx "On URL syntax and credential lookup" .
1579 The section
1580 .Sx "S/MIME step by step"
1581 shows examplarily how such a private certificate can be obtained.
1582 In general, if such a private key plus certificate
1583 .Dq pair
1584 is available, all that needs to be done is to set some variables:
1586 .Bd -literal -offset indent
1587 ? set smime-sign-cert=ME@HERE.com.paired \e
1588     smime-sign-message-digest=SHA256 \e
1589     smime-sign
1593 Variables of interest for S/MIME in general are
1594 .Va smime-ca-dir ,
1595 .Va smime-ca-file ,
1596 .Va smime-ca-flags ,
1597 .Va smime-ca-no-defaults ,
1598 .Va smime-crl-dir ,
1599 .Va smime-crl-file .
1600 For S/MIME signing of interest are
1601 .Va smime-sign ,
1602 .Va smime-sign-cert ,
1603 .Va smime-sign-include-certs
1605 .Va smime-sign-message-digest .
1606 Additional variables of interest for S/MIME en- and decryption:
1607 .Va smime-cipher
1609 .Va smime-encrypt-USER@HOST .
1612 \*(ID Note that neither S/MIME signing nor encryption applies to
1613 message subjects or other header fields yet.
1614 Thus they may not contain sensitive information for encrypted messages,
1615 and cannot be trusted even if the message content has been verified.
1616 When sending signed messages,
1617 it is recommended to repeat any important header information in the
1618 message text.
1619 .\" }}}
1621 .\" .Ss "On URL syntax and credential lookup" {{{
1622 .Ss "On URL syntax and credential lookup"
1624 \*(IN For accessing protocol-specific resources usage of Uniform
1625 Resource Locators (URL, RFC 1738) has become omnipresent.
1626 \*(UA expects and understands URLs in the following form;
1627 parts in brackets
1628 .Ql []
1629 denote optional parts, optional either because there also exist other
1630 ways to define the information in question or because support of the
1631 part is protocol-specific (e.g.,
1632 .Ql /path
1633 is used by the local maildir and the IMAP protocol, but not by POP3);
1634 If any of
1635 .Ql USER
1637 .Ql PASSWORD
1638 are specified they must be given in URL percent encoded form (RFC 3986;
1639 the command
1640 .Ic urlcodec
1641 may be helpful):
1644 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1647 Note that these \*(UA URLs most often do not conform to any real
1648 standard, but instead represent a normalized variant of RFC 1738 \(en
1649 they are not used in data exchange but only meant as a compact,
1650 easy-to-use way of defining and representing information in
1651 a well-known notation.
1654 Many internal variables of \*(UA exist in multiple versions, called
1655 variable chains for the rest of this document: the plain
1656 .Ql variable
1657 as well as
1658 .Ql variable-HOST
1660 .Ql variable-USER@HOST .
1661 Here
1662 .Ql HOST
1663 indeed means
1664 .Ql server:port
1665 if a
1666 .Ql port
1667 had been specified in the respective URL, otherwise it refers to the plain
1668 .Ql server .
1669 Also,
1670 .Ql USER
1671 is not truly the
1672 .Ql USER
1673 that had been found when doing the user chain lookup as is described
1674 below, i.e., this
1675 .Ql USER
1676 will never be in URL percent encoded form, whether it came from an URL
1677 or not; i.e., variable chain name extensions of
1678 .Sx "INTERNAL VARIABLES"
1679 must not be URL percent encoded.
1682 For example, whether an hypothetical URL
1683 .Ql smtp://hey%3Ayou@our.house
1684 had been given that includes a user, or whether the URL was
1685 .Ql smtp://our.house
1686 and the user had been found differently, to lookup the variable chain
1687 .Va smtp-use-starttls
1688 \*(UA first looks for whether
1689 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1690 is defined, then whether
1691 .Ql smtp-\:use-\:starttls-\:our.house
1692 exists before finally ending up looking at the plain variable itself.
1695 \*(UA obeys the following logic scheme when dealing with the
1696 necessary credential information of an account:
1698 .Bl -bullet
1700 If no
1701 .Ql USER
1702 has been given in the URL the variables
1703 .Va user-HOST
1705 .Va user
1706 are looked up; if no such variable(s) can be found then \*(UA will,
1707 when enforced by the \*(OPal variables
1708 .Va netrc-lookup-HOST
1710 .Va netrc-lookup ,
1711 search the users
1712 .Pa .netrc
1713 file for a
1714 .Ql HOST
1715 specific entry which provides a
1716 .Ql login
1717 name: this lookup will only succeed if unambiguous (one possible matching
1718 entry for
1719 .Ql HOST ) .
1720 It is possible to load encrypted
1721 .Pa .netrc
1722 files via
1723 .Va netrc-pipe .
1725 If there is still no
1726 .Ql USER
1727 then \*(UA will fall back to the user who is supposed to run \*(UA,
1728 the identity of which has been fixated during \*(UA startup and is
1729 known to be a valid user on the current host.
1732 Authentication: unless otherwise noted this will lookup the
1733 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1734 variable chain, falling back to a protocol-specific default should this
1735 have no success.
1738 If no
1739 .Ql PASSWORD
1740 has been given in the URL, then if the
1741 .Ql USER
1742 has been found through the \*(OPal
1743 .Va netrc-lookup
1744 that may have already provided the password, too.
1745 Otherwise the variable chain
1746 .Va password-USER@HOST , password-HOST , password
1747 is looked up and used if existent.
1749 Afterwards the complete \*(OPal variable chain
1750 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1751 is looked up.
1752 If set, the
1753 .Ic netrc
1754 cache is searched for a password only (multiple user accounts for
1755 a single machine may exist as well as a fallback entry without user
1756 but with a password).
1758 If at that point there is still no password available, but the
1759 (protocols') chosen authentication type requires a password, then in
1760 interactive mode the user will be prompted on the terminal.
1764 .Sy Note:
1765 S/MIME verification works relative to the values found in the
1766 .Ql From:
1768 .Ql Sender: )
1769 header field(s), which means that the values of
1770 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1772 .Va smime-sign-message-digest
1773 will not be looked up using the
1774 .Ql USER
1776 .Ql HOST
1777 chains from above but instead use the corresponding values from the
1778 message that is being worked on.
1779 In unusual cases multiple and different
1780 .Ql USER
1782 .Ql HOST
1783 combinations may therefore be involved \(en on the other hand those
1784 unusual cases become possible.
1785 The usual case is as short as:
1788 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1789 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
1792 The section
1793 .Sx EXAMPLES
1794 contains complete example configurations.
1795 .\" }}}
1797 .\" .Ss "Character sets" {{{
1798 .Ss "Character sets"
1800 \*(OP \*(UA detects the character set of the terminal by using
1801 mechanisms that are controlled by the
1802 .Ev LC_CTYPE
1803 environment variable
1804 (in fact
1805 .Ev LC_ALL ,
1806 .Ev \&\&LC_CTYPE ,
1807 .Ev LANG ,
1808 in that order, see there).
1809 The internal variable
1810 .Va ttycharset
1811 will be set to the detected terminal character set accordingly,
1812 and will thus show up in the output of commands like, e.g.,
1813 .Ic set
1815 .Ic varshow .
1818 However, the user may give a value for
1819 .Va ttycharset
1820 during startup, so that it is possible to send mail in a completely
1821 .Dq faked
1822 locale environment, an option which can be used to generate and send,
1823 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
1824 .Ql LC_ALL=C
1825 environment (an example of this can be found in the section
1826 .Sx "On sending mail, and non-interactive mode" ) .
1827 Changing the value does not mean much beside that, because several
1828 aspects of the real character set are implied by the locale environment
1829 of the system, which stays unaffected by
1830 .Va ttycharset .
1833 Messages and attachments which consist of 7-bit clean data will be
1834 classified as consisting of
1835 .Va charset-7bit
1836 character data.
1837 This is a problem if the
1838 .Va ttycharset
1839 character set is a multibyte character set that is also 7-bit clean.
1840 For example, the Japanese character set ISO-2022-JP is 7-bit clean but
1841 capable to encode the rich set of Japanese Kanji, Hiragana and Katakana
1842 characters: in order to notify receivers of this character set the mail
1843 message must be MIME encoded so that the character set ISO-2022-JP can
1844 be advertised!
1845 To achieve this, the variable
1846 .Va charset-7bit
1847 must be set to ISO-2022-JP.
1848 (Today a better approach regarding email is the usage of UTF-8, which
1849 uses 8-bit bytes for non-US-ASCII data.)
1852 If the \*(OPal character set conversion capabilities are not available
1853 .Pf ( Va features
1854 does not include the term
1855 .Ql +iconv ) ,
1856 then
1857 .Va ttycharset
1858 will be the only supported character set,
1859 it is simply assumed that it can be used to exchange 8-bit messages
1860 (over the wire an intermediate, configurable
1861 .Va mime-encoding
1862 may be applied),
1863 and the rest of this section does not apply;
1864 it may however still be necessary to explicitly set it if automatic
1865 detection fails, since in that case it defaults to
1866 .\" (Keep in SYNC: ./nail.1:"Character sets", ./config.h:CHARSET_*!)
1867 LATIN1 a.k.a. ISO-8859-1.
1870 \*(OP When reading messages, their text is converted into
1871 .Va ttycharset
1872 as necessary in order to display them on the users terminal.
1873 Unprintable characters and invalid byte sequences are detected
1874 and replaced by proper substitution characters.
1875 Character set mappings for source character sets can be established with
1876 the command
1877 .Ic charsetalias ,
1878 which may be handy to work around faulty character set catalogues (e.g.,
1879 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
1880 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
1881 Also see
1882 .Va charset-unknown-8bit
1883 to deal with another hairy aspect of message interpretation.
1886 When sending messages all their parts and attachments are classified.
1887 Whereas no character set conversion is performed on those parts which
1888 appear to be binary data,
1889 the character set being used must be declared within the MIME header of
1890 an outgoing text part if it contains characters that do not conform to
1891 the set of characters that are allowed by the email standards.
1892 Permissible values for character sets used in outgoing messages can be
1893 declared using the
1894 .Va sendcharsets
1895 variable, and
1896 .Va charset-8bit ,
1897 which defines a catch-all last-resort fallback character set that is
1898 implicitly appended to the list of character sets in
1899 .Va sendcharsets .
1902 When replying to a message and the variable
1903 .Va reply-in-same-charset
1904 is set, then the character set of the message being replied to
1905 is tried first (still being a subject of
1906 .Ic charsetalias ) .
1907 And it is also possible to make \*(UA work even more closely related to
1908 the current locale setting automatically by using the variable
1909 .Va sendcharsets-else-ttycharset ,
1910 please see there for more information.
1913 All the specified character sets are tried in order unless the
1914 conversion of the part or attachment succeeds.
1915 If none of the tried (8-bit) character sets is capable to represent the
1916 content of the part or attachment,
1917 then the message will not be sent and its text will optionally be
1918 .Va save Ns d
1920 .Ev DEAD .
1921 In general, if a message saying
1922 .Dq cannot convert from a to b
1923 appears, either some characters are not appropriate for the currently
1924 selected (terminal) character set,
1925 or the needed conversion is not supported by the system.
1926 In the first case, it is necessary to set an appropriate
1927 .Ev LC_CTYPE
1928 locale and/or the variable
1929 .Va ttycharset .
1932 The best results are usually achieved when \*(UA is run in a UTF-8
1933 locale on an UTF-8 capable terminal, in which case the full Unicode
1934 spectrum of characters is available.
1935 In this setup characters from various countries can be displayed,
1936 while it is still possible to use more simple character sets for sending
1937 to retain maximum compatibility with older mail clients.
1940 On the other hand the POSIX standard defines a locale-independent 7-bit
1941 .Dq portable character set
1942 that should be used when overall portability is an issue, the even more
1943 restricted subset named
1944 .Dq portable filename character set
1945 consists of A-Z, a-z, 0-9, period
1946 .Ql \&. ,
1947 underscore
1948 .Ql _
1949 and hyphen-minus
1950 .Ql - .
1951 .\" }}}
1953 .\" .Ss "Message states" {{{
1954 .Ss "Message states"
1956 \*(UA differentiates in between several different message states;
1957 the current state will be reflected in header summary displays if
1958 .Va headline
1959 is configured to do so (via the internal variable
1960 .Va attrlist ) ,
1961 and messages can also be selected and be acted upon depending on their
1962 state (see
1963 .Sx "Specifying messages" ) .
1964 When operating on the system
1965 .Va inbox ,
1966 or in any other
1967 .Mx -sx
1968 .Sx "primary system mailbox" ,
1969 special actions, like the automatic moving of messages to the
1970 .Mx -sx
1971 .Sx "secondary mailbox"
1972 .Ev MBOX ,
1973 may be applied when the mailbox is left (also implicitly via
1974 a successful exit of \*(UA, but not if the special command
1975 .Ic exit
1976 is used) \(en however, because this may be irritating to users which
1977 are used to
1978 .Dq more modern
1979 mail-user-agents, the default global
1980 .Pa \*(UR
1981 sets the internal
1982 .Va hold
1984 .Va keepsave
1985 variables in order to suppress this behaviour.
1987 .Bl -hang -width ".It Ql new"
1988 .It Ql new
1989 Message has neither been viewed nor moved to any other state.
1990 Such messages are retained even in the
1991 .Mx -sx
1992 .Sx "primary system mailbox" .
1994 .It Ql unread
1995 Message has neither been viewed nor moved to any other state, but the
1996 message was present already when the mailbox has been opened last:
1997 Such messages are retained even in the
1998 .Mx -sx
1999 .Sx "primary system mailbox" .
2001 .It Ql read
2002 The message has been processed by one of the following commands:
2003 .Ic ~f ,
2004 .Ic ~m ,
2005 .Ic ~F ,
2006 .Ic ~M ,
2007 .Ic copy ,
2008 .Ic mbox ,
2009 .Ic next ,
2010 .Ic pipe  ,
2011 .Ic Print ,
2012 .Ic print ,
2013 .Ic top ,
2014 .Ic Type ,
2015 .Ic type ,
2016 .Ic undelete .
2017 The commands
2018 .Ic dp
2020 .Ic dt
2021 will always try to automatically
2022 .Dq step
2024 .Ic type
2026 .Dq next
2027 logical message, and may thus mark multiple messages as read, the
2028 .Ic delete
2029 command will do so if  the internal variable
2030 .Va autoprint
2031 is set.
2032 Except when the
2033 .Ic exit
2034 command is used, messages that are in a
2035 .Mx -sx
2036 .Sx "primary system mailbox"
2037 and are in
2038 .Ql read
2039 state when the mailbox is left will be saved in the
2040 .Mx -sx
2041 .Sx "secondary mailbox"
2042 .Ev MBOX
2043 unless the internal variable
2044 .Va hold
2045 it set.
2047 .It Ql deleted
2048 The message has been processed by one of the following commands:
2049 .Ic delete ,
2050 .Ic dp ,
2051 .Ic dt .
2052 Only
2053 .Ic undelete
2054 can be used to access such messages.
2056 .It Ql preserved
2057 The message has been processed by a
2058 .Ic preserve
2059 command and it will be retained in its current location.
2061 .It Ql saved
2062 The message has been processed by one of the following commands:
2063 .Ic save
2065 .Ic write .
2066 Unless when the
2067 .Ic exit
2068 command is used, messages that are in a
2069 .Mx -sx
2070 .Sx "primary system mailbox"
2071 and are in
2072 .Ql saved
2073 state when the mailbox is left will be deleted; they will be saved in the
2074 .Mx -sx
2075 .Sx "secondary mailbox"
2076 .Ev MBOX
2077 when the internal variable
2078 .Va keepsave
2079 is set.
2083 In addition to these message states, flags which otherwise have no
2084 technical meaning in the mail system except allowing special ways of
2085 addressing them when
2086 .Sx "Specifying messages"
2087 can be set on messages.
2088 These flags are saved with messages and are thus persistent, and are
2089 portable between a set of widely used MUAs.
2091 .Bl -hang -width ".It Ic answered"
2092 .It Ic answered
2093 Mark messages as having been answered.
2094 .It Ic draft
2095 Mark messages as being a draft.
2096 .It Ic flag
2097 Mark messages which need special attention.
2099 .\" }}}
2101 .\" .Ss "Specifying messages" {{{
2102 .Ss "Specifying messages"
2104 Commands such as
2105 .Ic from ,
2106 .Ic type
2108 .Ic delete
2109 can be given a list of message numbers as arguments to apply to a number
2110 of messages at once.
2111 Thus
2112 .Ql delete 1 2
2113 deletes messages 1 and 2,
2114 whereas
2115 .Ql delete 1-5
2116 will delete the messages 1 through 5.
2117 In sorted or threaded mode (see the
2118 .Ic sort
2119 command),
2120 .Ql delete 1-5
2121 will delete the messages that are located between (and including)
2122 messages 1 through 5 in the sorted/threaded order, as shown in the
2123 .Ic headers
2124 summary.
2125 The following special message names exist:
2128 .Bl -tag -width ".It Ar BaNg"
2129 .It Ar \&.
2130 The current message, the so-called
2131 .Dq dot .
2133 .It Ar \&;
2134 The message that was previously the current message.
2136 .It Ar \&,
2137 The parent message of the current message,
2138 that is the message with the Message-ID given in the
2139 .Ql In-Reply-To:
2140 field or the last entry of the
2141 .Ql References:
2142 field of the current message.
2144 .It Ar -
2145 The next previous undeleted message,
2146 or the next previous deleted message for the
2147 .Ic undelete
2148 command.
2149 In sorted/threaded mode,
2150 the next previous such message in the sorted/threaded order.
2152 .It Ar +
2153 The next undeleted message,
2154 or the next deleted message for the
2155 .Ic undelete
2156 command.
2157 In sorted/threaded mode,
2158 the next such message in the sorted/threaded order.
2160 .It Ar ^
2161 The first undeleted message,
2162 or the first deleted message for the
2163 .Ic undelete
2164 command.
2165 In sorted/threaded mode,
2166 the first such message in the sorted/threaded order.
2168 .It Ar $
2169 The last message.
2170 In sorted/threaded mode,
2171 the last message in the sorted/threaded order.
2173 .It Ar & Ns Ar x
2174 In threaded mode,
2175 selects the message addressed with
2176 .Ar x ,
2177 where
2178 .Ar x
2179 is any other message specification,
2180 and all messages from the thread that begins at it.
2181 Otherwise it is identical to
2182 .Ar x .
2184 .Ar x
2185 is omitted,
2186 the thread beginning with the current message is selected.
2188 .It Ar *
2189 All messages.
2190 .It Ar `
2191 All messages that were included in the
2192 .Sx "Message list arguments"
2193 of the previous command.
2195 .It Ar x-y
2196 An inclusive range of message numbers.
2197 Selectors that may also be used as endpoints include any of
2198 .Ar .;-+^$ .
2200 .It Ar address
2201 A case-insensitive
2202 .Dq any substring matches
2203 search against the
2204 .Ql From:
2205 header, which will match addresses (too) even if
2206 .Va showname
2207 is set (and POSIX says
2208 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2209 However, if the
2210 .Va allnet
2211 variable is set, only the local part of the address is evaluated
2212 for the comparison, not ignoring case, and the setting of
2213 .Va showname
2214 is completely ignored.
2215 For finer control and match boundaries use the
2216 .Ql @
2217 search expression.
2219 .It Ar / Ns Ar string
2220 All messages that contain
2221 .Ar string
2222 in the subject field (case ignored).
2223 See also the
2224 .Va searchheaders
2225 variable.
2227 .Ar string
2228 is empty,
2229 the string from the previous specification of that type is used again.
2231 .It Xo Op Ar @ Ns Ar name-list Ns
2232 .Ar @ Ns Ar expr
2234 All messages that contain the given case-insensitive search
2235 .Ar expr Ns
2236 ession; if the \*(OPal regular expression (see
2237 .Xr re_format 7 )
2238 support is available
2239 .Ar expr
2240 will be interpreted as (an extended) one if any of the
2241 .Dq magical
2242 (extended) regular expression characters is seen: in this case this
2243 should match strings correctly which are in the locale
2244 .Ev LC_CTYPE
2245 encoding.
2246 If the optional
2247 .Ar @ Ns Ar name-list
2248 part is missing, the search is restricted to the subject field body,
2249 but otherwise
2250 .Ar name-list
2251 specifies a comma-separated list of header fields to search, as in
2253 .Dl '@to,from,cc@Someone i ought to know'
2255 In order to search for a string that includes a
2256 .Ql @
2257 (commercial at) character the
2258 .Ar name-list
2259 is effectively non-optional, but may be given as the empty string.
2260 Some special header fields may be abbreviated:
2261 .Ql f ,
2262 .Ql t ,
2263 .Ql c ,
2264 .Ql b
2266 .Ql s
2267 will match
2268 .Ql From ,
2269 .Ql To ,
2270 .Ql Cc ,
2271 .Ql Bcc
2273 .Ql Subject ,
2274 respectively and case-insensitively.
2275 The special names
2276 .Ql header
2278 .Ql <
2279 can be used to search in (all of) the header(s) of the message, and the
2280 special names
2281 .Ql body
2283 .Ql >
2285 .Ql text
2287 .Ql =
2288 can be used to perform full text searches \(en whereas the former
2289 searches only the body, the latter also searches the message header.
2291 This message specification performs full text comparison, but even with
2292 regular expression support it is almost impossible to write a search
2293 expression that savely matches only a specific address domain.
2294 To request that the content of the header is treated as a list of
2295 addresses, and to strip those down to the plain email address which the
2296 search expression is to be matched against, prefix the header name
2297 (abbreviation) with a tilde
2298 .Ql ~ :
2300 .Dl @~f@@a\e.safe\e.domain\e.match$
2302 .It Ar :c
2303 All messages of state
2304 .Ql c ,
2305 where
2306 .Ql c
2307 is one or multiple of the following colon modifiers:
2309 .Bl -tag -compact -width ".It Ar :M"
2310 .It Ar n
2311 .Ql new
2312 messages.
2313 .It Ar o
2314 Old messages (any not in state
2315 .Ql read
2317 .Ql new ) .
2318 .It Ar u
2319 .Ql unread
2320 messages.
2321 .It Ar d
2322 .Ql deleted
2323 messages (for the
2324 .Ic undelete
2326 .Ic from
2327 commands only).
2328 .It Ar r
2329 .Ql read
2330 messages.
2331 .It Ar f
2332 .Ic flag Ns
2333 ged messages.
2334 .It Ar a
2335 .Ic answered
2336 messages (cf. the variable
2337 .Va markanswered ) .
2338 .It Ar t
2339 Messages marked as
2340 .Ic draft .
2341 .It Ar s
2342 \*(OP Messages classified as spam (see
2343 .Sx "Handling spam" . )
2344 .It Ar S
2345 \*(OP Messages with unsure spam classification.
2351 \*(OP IMAP-style SEARCH expressions may also be used.
2352 This addressing mode is available with all types of mailbox
2353 .Ic folder Ns
2354 s; \*(UA will perform the search locally as necessary.
2355 Strings must be enclosed by double quotes
2356 .Ql \&"
2357 in their entirety if they contain whitespace or parentheses;
2358 within the quotes, only reverse solidus
2359 .Ql \e
2360 is recognized as an escape character.
2361 All string searches are case-insensitive.
2362 When the description indicates that the
2363 .Dq envelope
2364 representation of an address field is used,
2365 this means that the search string is checked against both a list
2366 constructed as
2368 .Bd -literal -offset indent
2369 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2373 for each address,
2374 and the addresses without real names from the respective header field.
2375 These search expressions can be nested using parentheses, see below for
2376 examples.
2379 .Bl -tag -compact -width ".It Ar _n_u"
2380 .It Ar ( criterion )
2381 All messages that satisfy the given
2382 .Ar criterion .
2383 .It Ar ( criterion1 criterion2 ... criterionN )
2384 All messages that satisfy all of the given criteria.
2386 .It Ar ( or criterion1 criterion2 )
2387 All messages that satisfy either
2388 .Ar criterion1
2390 .Ar criterion2 ,
2391 or both.
2392 To connect more than two criteria using
2393 .Ql or
2394 specifications have to be nested using additional parentheses,
2395 as with
2396 .Ql (or a (or b c)) ,
2397 since
2398 .Ql (or a b c)
2399 really means
2400 .Ql ((a or b) and c) .
2401 For a simple
2402 .Ql or
2403 operation of independent criteria on the lowest nesting level,
2404 it is possible to achieve similar effects by using three separate
2405 criteria, as with
2406 .Ql (a) (b) (c) .
2408 .It Ar ( not criterion )
2409 All messages that do not satisfy
2410 .Ar criterion .
2411 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2412 All messages that contain
2413 .Ar string
2414 in the envelope representation of the
2415 .Ql Bcc:
2416 field.
2417 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2418 All messages that contain
2419 .Ar string
2420 in the envelope representation of the
2421 .Ql Cc:
2422 field.
2423 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2424 All messages that contain
2425 .Ar string
2426 in the envelope representation of the
2427 .Ql From:
2428 field.
2429 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2430 All messages that contain
2431 .Ar string
2432 in the
2433 .Ql Subject:
2434 field.
2435 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2436 All messages that contain
2437 .Ar string
2438 in the envelope representation of the
2439 .Ql To:
2440 field.
2441 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2442 All messages that contain
2443 .Ar string
2444 in the specified
2445 .Ql Name:
2446 field.
2447 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2448 All messages that contain
2449 .Ar string
2450 in their body.
2451 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2452 All messages that contain
2453 .Ar string
2454 in their header or body.
2455 .It Ar ( larger size )
2456 All messages that are larger than
2457 .Ar size
2458 (in bytes).
2459 .It Ar ( smaller size )
2460 All messages that are smaller than
2461 .Ar size
2462 (in bytes).
2464 .It Ar ( before date )
2465 All messages that were received before
2466 .Ar date ,
2467 which must be in the form
2468 .Ql d[d]-mon-yyyy ,
2469 where
2470 .Ql d
2471 denotes the day of the month as one or two digits,
2472 .Ql mon
2473 is the name of the month \(en one of
2474 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2476 .Ql yyyy
2477 is the year as four digits, e.g.,
2478 .Ql 28-Dec-2012 .
2480 .It Ar ( on date )
2481 All messages that were received on the specified date.
2482 .It Ar ( since date )
2483 All messages that were received since the specified date.
2484 .It Ar ( sentbefore date )
2485 All messages that were sent on the specified date.
2486 .It Ar ( senton date )
2487 All messages that were sent on the specified date.
2488 .It Ar ( sentsince date )
2489 All messages that were sent since the specified date.
2490 .It Ar ()
2491 The same criterion as for the previous search.
2492 This specification cannot be used as part of another criterion.
2493 If the previous command line contained more than one independent
2494 criterion then the last of those criteria is used.
2496 .\" }}}
2498 .\" .Ss "On terminal control and line editor" {{{
2499 .Ss "On terminal control and line editor"
2501 \*(OP Terminal control will be realized through one of the standard
2503 libraries, either the
2504 .Lb libtermcap ,
2505 or, alternatively, the
2506 .Lb libterminfo ,
2507 both of which will be initialized to work with the environment variable
2508 .Ev TERM .
2509 Terminal control will enhance or enable interactive usage aspects, e.g.,
2510 .Sx "Coloured display" ,
2511 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2512 byte-sequences of keys like the cursor and function keys.
2515 The internal variable
2516 .Va termcap
2517 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2518 \*(UA may also become a fullscreen application by entering the
2519 so-called ca-mode and switching to an alternative exclusive screen
2520 (content) shall the terminal support it and the internal variable
2521 .Va termcap-ca-mode
2522 has been set explicitly.
2523 Actual interaction with the chosen library can be disabled completely by
2524 setting the internal variable
2525 .Va termcap-disable ;
2526 .Va termcap
2527 will be queried regardless, which is true even if the \*(OPal library
2528 support has not been enabled at configuration time as long as some other
2529 \*(OP which (may) query terminal control sequences has been enabled.
2532 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2533 environments which comply to the ISO C standard
2534 .St -isoC-amd1 ,
2535 and will support wide glyphs if possible (the necessary functionality
2536 had been removed from ISO C, but was included in
2537 .St -xpg4 ) .
2538 Prevent usage of a line editor in interactive mode by setting the
2539 internal variable
2540 .Va line-editor-disable .
2541 Especially if the \*(OPal terminal control support is missing setting
2542 entries in the internal variable
2543 .Va termcap
2544 will help shall the MLE misbehave, see there for more.
2545 The MLE can support a little bit of
2546 .Ic colour .
2549 \*(OP If the
2550 .Ic history
2551 feature is available then input from line editor prompts will be saved
2552 in a history list that can be searched in and be expanded from.
2553 Such saving can be prevented by prefixing input with any amount of
2554 whitespace.
2555 Aspects of history, like allowed content and maximum size, as well as
2556 whether history shall be saved persistently, can be configured with the
2557 internal variables
2558 .Va history-file ,
2559 .Va history-gabby ,
2560 .Va history-gabby-persist
2562 .Va history-size .
2565 The MLE supports a set of editing and control commands.
2566 By default (as) many (as possible) of these will be assigned to a set of
2567 single-letter control codes, which should work on any terminal (and can
2568 be generated by holding the
2569 .Dq control
2570 key while pressing the key of desire, e.g.,
2571 .Ql control-D ) .
2572 If the \*(OPal
2573 .Ic bind
2574 command is available then the MLE commands can also be accessed freely
2575 by assigning the command name, which is shown in parenthesis in the list
2576 below, to any desired key-sequence, and the MLE will instead and also use
2577 .Ic bind
2578 to establish its built-in key bindings
2579 (more of them if the \*(OPal terminal control is available),
2580 an action which can then be suppressed completely by setting
2581 .Va line-editor-no-defaults .
2582 .Sx "Shell-style argument quoting"
2583 notation is used in the following;
2584 combinations not mentioned either cause job control signals or do not
2585 generate a (unique) keycode:
2589 .Bl -tag -compact -width ".It Ql \eBa"
2590 .It Ql \ecA
2591 Go to the start of the line
2593 .Pf ( Cd mle-go-home ) .
2595 .It Ql \ecB
2596 Move the cursor backward one character
2598 .Pf ( Cd mle-go-bwd ) .
2600 .It Ql \ecD
2601 Forward delete the character under the cursor;
2602 quits \*(UA if used on the empty line unless the internal variable
2603 .Va ignoreeof
2604 is set
2606 .Pf ( Cd mle-del-fwd ) .
2608 .It Ql \ecE
2609 Go to the end of the line
2611 .Pf ( Cd mle-go-end ) .
2613 .It Ql \ecF
2614 Move the cursor forward one character
2616 .Pf ( Cd mle-go-fwd ) .
2618 .It Ql \ecG
2619 Cancel current operation, full reset.
2620 If there is an active history search or tabulator expansion then this
2621 command will first reset that, reverting to the former line content;
2622 thus a second reset is needed for a full reset in this case
2624 .Pf ( Cd mle-reset ) .
2626 .It Ql \ecH
2627 Backspace: backward delete one character
2629 .Pf ( Cd mle-del-bwd ) .
2631 .It Ql \ecI
2632 \*(NQ
2633 Horizontal tabulator:
2634 try to expand the word before the cursor, supporting the usual
2635 .Sx "Filename transformations"
2637 .Pf ( Cd mle-complete ) .
2638 This is affected by
2639 .Cd mle-quote-rndtrip .
2641 .It Ql \ecJ
2642 Newline:
2643 commit the current line
2645 .Pf ( Cd mle-commit ) .
2647 .It Ql \ecK
2648 Cut all characters from the cursor to the end of the line
2650 .Pf ( Cd mle-snarf-end ) .
2652 .It Ql \ecL
2653 Repaint the line
2655 .Pf ( Cd mle-repaint ) .
2657 .It Ql \ecN
2658 \*(OP Go to the next history entry
2660 .Pf ( Cd mle-hist-fwd ) .
2662 .It Ql \ecO
2663 (\*(OPally context-dependent) Invokes the command
2664 .Ic dt .
2666 .It Ql \ecP
2667 \*(OP Go to the previous history entry
2669 .Pf ( Cd mle-hist-bwd ) .
2671 .It Ql \ecQ
2672 Toggle roundtrip mode shell quotes, where produced,
2673 on and off
2675 .Pf ( Cd mle-quote-rndtrip ) .
2676 This setting is temporary, and will be forgotten once the command line
2677 is committed; also see
2678 .Ic shcodec .
2680 .It Ql \ecR
2681 \*(OP Complete the current line from (the remaining) older history entries
2683 .Pf ( Cd mle-hist-srch-bwd ) .
2685 .It Ql \ecS
2686 \*(OP Complete the current line from (the remaining) newer history entries
2688 .Pf ( Cd mle-hist-srch-fwd ) .
2690 .It Ql \ecT
2691 Paste the snarf buffer
2693 .Pf ( Cd mle-paste ) .
2695 .It Ql \ecU
2696 The same as
2697 .Ql \ecA
2698 followed by
2699 .Ql \ecK
2701 .Pf ( Cd mle-snarf-line ) .
2703 .It Ql \ecV
2704 Prompts for a Unicode character (its hexadecimal number) to be inserted
2706 .Pf ( Cd mle-prompt-char ) .
2707 Note this command needs to be assigned to a single-letter control code
2708 in order to become recognized and executed during input of
2709 a key-sequence (only three single-letter control codes can be used for
2710 that shortcut purpose); this control code is special-treated and cannot
2711 be part of any other sequence, because any occurrence will perform the
2712 .Cd mle-prompt-char
2713 function immediately.
2715 .It Ql \ecW
2716 Cut the characters from the one preceding the cursor to the preceding
2717 word boundary
2719 .Pf ( Cd mle-snarf-word-bwd ) .
2721 .It Ql \ecX
2722 Move the cursor forward one word boundary
2724 .Pf ( Cd mle-go-word-fwd ) .
2726 .It Ql \ecY
2727 Move the cursor backward one word boundary
2729 .Pf ( Cd mle-go-word-bwd ) .
2731 .It Ql \ec[
2732 Escape: reset a possibly used multibyte character input state machine
2733 and \*(OPally a lingering, incomplete key binding
2735 .Pf ( Cd mle-cancel ) .
2736 This command needs to be assigned to a single-letter control code in
2737 order to become recognized and executed during input of a key-sequence
2738 (only three single-letter control codes can be used for that shortcut
2739 purpose).
2740 This control code may also be part of a multi-byte sequence, but if
2741 a sequence is active and the very control code is currently also an
2742 expected input, then it will first be consumed by the active sequence.
2744 .It Ql \ec\e
2745 (\*(OPally context-dependent) Invokes the command
2746 .Ql Ic z Ns + .
2748 .It Ql \ec]
2749 (\*(OPally context-dependent) Invokes the command
2750 .Ql Ic z Ns $ .
2752 .It Ql \ec^
2753 (\*(OPally context-dependent) Invokes the command
2754 .Ql Ic z Ns 0 .
2756 .It Ql \ec_
2757 Cut the characters from the one after the cursor to the succeeding word
2758 boundary
2760 .Pf ( Cd mle-snarf-word-fwd ) .
2762 .It Ql \ec?
2763 Backspace:
2764 .Cd mle-del-bwd .
2766 .It \(en
2768 .Cd mle-fullreset :
2769 different to
2770 .Cd mle-reset
2771 this will immediately reset a possibly active search etc.
2773 .It \(en
2775 .Cd mle-bell :
2776 ring the audible bell.
2778 .\" }}}
2780 .\" .Ss "Coloured display" {{{
2781 .Ss "Coloured display"
2783 \*(OP \*(UA can be configured to support a coloured display and font
2784 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
2785 rendition) escape sequences.
2786 Usage of colours and font attributes solely depends upon the
2787 capability of the detected terminal type that is defined by the
2788 environment variable
2789 .Ev TERM
2790 and which can be fine-tuned by the user via the internal variable
2791 .Va termcap .
2794 On top of what \*(UA knows about the terminal the boolean variable
2795 .Va colour-pager
2796 defines whether the actually applicable colour and font attribute
2797 sequences should also be generated when output is going to be paged
2798 through the external program defined by the environment variable
2799 .Ev PAGER
2800 (also see
2801 .Va crt Ns
2803 This is not enabled by default because different pager programs need
2804 different command line switches or other configuration in order to
2805 support those sequences.
2806 \*(UA however knows about some widely used pagers and in a clean
2807 environment it is often enough to simply set
2808 .Va colour-pager ;
2809 please refer to that variable for more on this topic.
2812 If the variable
2813 .Va colour-disable
2814 is set then any active usage of colour and font attribute sequences
2815 is suppressed, but without affecting possibly established
2816 .Ic colour
2817 mappings.
2820 To define and control colours and font attributes a single multiplexer
2821 command family exists:
2822 .Ic colour
2823 shows or defines colour mappings for the given colour type (e.g.,
2824 monochrome) and
2825 .Ic uncolour
2826 can be used to remove mappings of a given colour type.
2827 Since colours are only available in interactive mode, it may make
2828 sense to conditionalize the colour setup by encapsulating it with
2829 .Ic if :
2831 .Bd -literal -offset indent
2832 if terminal && [ "$features" =% +colour ]
2833   colour iso view-msginfo ft=bold,fg=green
2834   colour iso view-header ft=bold,fg=red from,subject
2835   colour iso view-header fg=red
2837   uncolour iso view-header from,subject
2838   colour iso view-header ft=bold,fg=magenta,bg=cyan
2839   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
2840   colour mono view-header ft=bold
2841   colour mono view-header ft=bold,ft=reverse subject,from
2842 endif
2844 .\" }}}
2846 .\" .Ss "Handling spam" {{{
2847 .Ss "Handling spam"
2849 \*(OP \*(UA can make use of several spam interfaces for the purpose of
2850 identification of, and, in general, dealing with spam messages.
2851 A precondition of most commands in order to function is that the
2852 .Va spam-interface
2853 variable is set to one of the supported interfaces.
2854 Once messages have been identified as spam their (volatile)
2855 .Ql is-spam
2856 state can be prompted: the
2857 .Ql Ar :s
2859 .Ql Ar :S
2860 message specifications will address respective messages and their
2861 .Va attrlist
2862 entries will be used when displaying the
2863 .Va headline
2864 in the header display.
2866 .Bl -bullet
2868 .Ic spamrate
2869 rates the given messages and sets their
2870 .Ql is-spam
2871 flag accordingly.
2872 If the spam interface offers spam scores those can also be displayed in
2873 the header display by including the
2874 .Ql %$
2875 format in the
2876 .Va headline
2877 variable.
2879 .Ic spamham ,
2880 .Ic spamspam
2882 .Ic spamforget
2883 will interact with the Bayesian filter of the chosen interface and learn
2884 the given messages as
2885 .Dq ham
2887 .Dq spam ,
2888 respectively; the last command can be used to cause
2889 .Dq unlearning
2890 of messages; it adheres to their current
2891 .Ql is-spam
2892 state and thus reverts previous teachings.
2894 .Ic spamclear
2896 .Ic spamset
2897 will simply set and clear, respectively, the mentioned volatile
2898 .Ql is-spam
2899 message flag, without any interface interaction.
2904 .Xr spamassassin 1
2905 based
2906 .Va spam-interface
2907 .Ql spamc
2908 requires a running instance of the
2909 .Xr spamd 1
2910 server in order to function, started with the option
2911 .Fl -allow-tell
2912 shall Bayesian filter learning be possible.
2914 .Bd -literal -offset indent
2915 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
2916 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
2917     --daemonize [--local] [--allow-tell]
2921 Thereafter \*(UA can make use of these interfaces:
2923 .Bd -literal -offset indent
2924 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
2925     -Sspamc-command=/usr/local/bin/spamc \e
2926     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
2928 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
2929     -Sspamc-command=/usr/local/bin/spamc \e
2930     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
2934 Using the generic filter approach allows usage of programs like
2935 .Xr bogofilter 1 .
2936 Here is an example, requiring it to be accessible via
2937 .Ev PATH :
2939 .Bd -literal -offset indent
2940 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
2941     -Sspamfilter-ham="bogofilter -n" \e
2942     -Sspamfilter-noham="bogofilter -N" \e
2943     -Sspamfilter-nospam="bogofilter -S" \e
2944     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
2945     -Sspamfilter-spam="bogofilter -s" \e
2946     -Sspamfilter-rate-scanscore="1;^(.+)$"
2950 Because messages must exist on local storage in order to be scored (or
2951 used for Bayesian filter training), it is possibly a good idea to
2952 perform the local spam check last:
2954 .Bd -literal -offset indent
2955 define spamdelhook {
2956   # Server side DCC
2957   spamset (header x-dcc-brand-metrics "bulk")
2958   # Server-side spamassassin(1)
2959   spamset (header x-spam-flag "YES")
2960   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
2961   move :S +maybe-spam
2962   spamrate :u
2963   del :s
2964   move :S +maybe-spam
2966 set folder-hook-FOLDER=spamdelhook
2970 See also the documentation for the variables
2971 .Va spam-interface , spam-maxsize ,
2972 .Va spamc-command , spamc-arguments , spamc-user ,
2973 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
2974   spamfilter-rate
2976 .Va spamfilter-rate-scanscore .
2977 .\" }}}
2979 .\" }}} (DESCRIPTION)
2982 .\" .Sh COMMANDS {{{
2983 .Sh COMMANDS
2985 \*(UA reads input in lines.
2986 An unquoted reverse solidus
2987 .Ql \e
2988 at the end of a command line
2989 .Dq escapes
2990 the newline character: it is discarded and the next line of input is
2991 used as a follow-up line, with all leading whitespace removed;
2992 once an entire line is completed, the whitespace characters
2993 .Cm space , tabulator , newline
2994 as well as those defined by the variable
2995 .Va ifs
2996 are removed from the beginning and end.
2997 Placing any whitespace characters at the beginning of a line will
2998 prevent a possible addition of the command line to the \*(OPal
2999 .Ic history .
3002 The beginning of such input lines is then scanned for the name of
3003 a known command: command names may be abbreviated, in which case the
3004 first command that matches the given prefix will be used.
3005 .Sx "Command modifiers"
3006 may prefix a command in order to modify its behaviour.
3007 A name may also be a
3008 .Ic commandalias ,
3009 which will become expanded until no more expansion is possible.
3010 Once the command that shall be executed is known, the remains of the
3011 input line will be interpreted according to command-specific rules:
3012 (\*(ID) some commands use
3013 .Sx "Shell-style argument quoting" ,
3014 so that a single input line may actually consist of multiple commands,
3015 but others pass it unchanged as
3016 .Sx "Raw data arguments for codec commands" .
3019 The command
3020 .Ic list
3021 can be used to show the list of all commands, either alphabetically
3022 sorted or in prefix search order (these do not match, also because the
3023 POSIX standard prescribes a set of abbreviations).
3024 \*(OPally the command
3025 .Ic help
3027 .Ic \&? ) ,
3028 when given an argument, will show a documentation string for the
3029 command matching the expanded argument, as in
3030 .Ql ?t ,
3031 which should be a shorthand of
3032 .Ql ?type ;
3033 with these documentation strings both commands support a more
3034 .Va verbose
3035 listing mode which includes the argument type of the command and other
3036 information which applies; a handy suggestion might thus be:
3038 .Bd -literal -offset indent
3039 ? define __xv {
3040   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3041   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
3043 ? commandalias xv '\ecall __xv'
3044 ? xv help set
3047 .\" .Ss "Command modifiers" {{{
3048 .Ss "Command modifiers"
3050 Commands may be prefixed by one or multiple command modifiers.
3052 .Bl -bullet
3054 The modifier reverse solidus
3056 .Cm \e ,
3057 to be placed first, prevents
3058 .Ic commandalias
3059 expansions on the remains of the line, e.g.,
3060 .Ql \eecho
3061 will always evaluate the command
3062 .Ic echo ,
3063 even if an (command)alias of the same name exists.
3064 .Ic commandalias
3065 content may itself contain further command modifiers, including
3066 an initial reverse solidus to prevent further expansions.
3069 The modifier
3071 .Cm ignerr
3072 indicates that any error generated by the following command should be
3073 ignored by the state machine and not cause a program exit with enabled
3074 .Va errexit
3075 or for the standardized exit cases in
3076 .Ev POSIXLY_CORRECT
3077 mode.
3078 .Va \&? ,
3079 one of the
3080 .Sx "INTERNAL VARIABLES" ,
3081 will be set to the real exit status of the command regardless.
3084 Some commands support the
3086 .Cm vput
3087 modifier: if used, they expect the name of a variable, which can itself
3088 be a variable, i.e., shell expansion is applied, as their first
3089 argument, and will place their computation result in it instead of the
3090 default location (it is usually written to standard output).
3092 The given name will be tested for being a valid
3093 .Xr sh 1
3094 variable name, and may therefore only consist of upper- and lowercase
3095 characters, digits, and the underscore; the hyphen-minus may be used as
3096 a non-portable extension; digits may not be used as first, hyphen-minus
3097 may not be used as last characters.
3098 In addition the name may either not be one of the known
3099 .Sx "INTERNAL VARIABLES" ,
3100 or must otherwise refer to a writable (non-boolean) value variable.
3101 The actual put operation may fail nonetheless, e.g., if the variable
3102 expects a number argument only a number will be accepted.
3103 Any error during these operations causes the command as such to fail,
3104 and the error number
3105 .Va \&!
3106 will be set to
3107 .Va ^ERR Ns -NOTSUP ,
3108 the exit status
3109 .Va \&?
3110 should be set to
3111 .Ql -1 .
3114 Last, but not least, the modifier
3116 .Cm wysh
3117 can be used for some old and established commands to choose the new
3118 .Sx "Shell-style argument quoting"
3119 rules over the traditional
3120 .Sx "Old-style argument quoting" .
3122 .\" }}}
3124 .\" .Ss "Message list arguments" {{{
3125 .Ss "Message list arguments"
3127 Some commands expect arguments that represent messages (actually
3128 their symbolic message numbers), as has been documented above under
3129 .Sx "Specifying messages"
3130 already.
3131 If no explicit message list has been specified, the next message
3132 forward that satisfies the command's requirements will be used,
3133 and if there are no messages forward of the current message,
3134 the search proceeds backwards;
3135 if there are no good messages at all to be found, an error message is
3136 shown and the command is aborted.
3137 .\" }}}
3139 .\" .Ss "Old-style argument quoting" {{{
3140 .Ss "Old-style argument quoting"
3142 \*(ID This section documents the old, traditional style of quoting
3143 non-message-list arguments to commands which expect this type of
3144 arguments: whereas still used by the majority of such commands, the new
3145 .Sx "Shell-style argument quoting"
3146 may be available even for those via
3147 .Cm wysh ,
3148 one of the
3149 .Sx "Command modifiers" .
3150 Nonetheless care must be taken, because only new commands have been
3151 designed with all the capabilities of the new quoting rules in mind,
3152 which can, e.g., generate control characters.
3155 .Bl -bullet -offset indent
3157 An argument can be enclosed between paired double-quotes
3158 .Ql """argument"""
3160 single-quotes
3161 .Ql 'argument' ;
3162 any whitespace, shell word expansion, or reverse solidus characters
3163 (except as described next) within the quotes are treated literally as
3164 part of the argument.
3165 A double-quote will be treated literally within single-quotes and vice
3166 versa.
3167 Inside such a quoted string the actually used quote character can be
3168 used nonetheless by escaping it with a reverse solidus
3169 .Ql \e ,
3170 as in
3171 .Ql """y\e""ou""" .
3174 An argument that is not enclosed in quotes, as above, can usually still
3175 contain space characters if those spaces are reverse solidus escaped, as in
3176 .Ql you\e are .
3179 A reverse solidus outside of the enclosing quotes is discarded
3180 and the following character is treated literally as part of the argument.
3182 .\" }}}
3184 .\" .Ss "Shell-style argument quoting" {{{
3185 .Ss "Shell-style argument quoting"
3187 Commands which don't expect message-list arguments use
3188 .Xr sh 1 Ns
3189 ell-style, and therefore POSIX standardized, argument parsing and
3190 quoting rules.
3191 \*(ID Most new commands only support these new rules and are flagged
3192 \*(NQ, some elder ones can use them with the command modifier
3193 .Cm wysh ;
3194 in the future only this type of argument quoting will remain.
3197 A command line is parsed from left to right and an input token is
3198 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3199 Metacharacters are vertical bar
3200 .Cm \&| ,
3201 ampersand
3202 .Cm & ,
3203 semicolon
3204 .Cm \&; ,
3205 as well as all characters from the variable
3206 .Va ifs ,
3207 and / or
3208 .Cm space , tabulator , newline .
3209 The additional metacharacters left and right parenthesis
3210 .Cm \&( , \&)
3211 and less-than and greater-than signs
3212 .Cm < , >
3213 that the
3214 .Xr sh 1
3215 supports are not used, and are treated as ordinary characters: for one
3216 these characters are a vivid part of email addresses, and it seems
3217 highly unlikely that their function will become meaningful to \*(UA.
3219 .Bd -filled -offset indent
3220 .Sy Compatibility note:
3221 \*(ID Please note that even many new-style commands do not yet honour
3222 .Va ifs
3223 to parse their arguments: whereas the
3224 .Xr sh 1 Ns
3225 ell is a language with syntactic elements of clearly defined semantics,
3226 \*(UA parses entire input lines and decides on a per-command base what
3227 to do with the rest of the line.
3228 This also means that whenever an unknown command is seen all that \*(UA
3229 can do is cancellation of the processing of the remains of the line.
3231 It also often depends on an actual subcommand of a multiplexer command
3232 how the rest of the line should be treated, and until v15 we are not
3233 capable to perform this deep inspection of arguments.
3234 Nonetheless, at least the following commands which work with positional
3235 parameters fully support
3236 .Va ifs
3237 for an almost shell-compatible field splitting:
3238 .Ic call , call_if , read , vpospar , xcall .
3242 Any unquoted number sign
3243 .Ql #
3244 at the beginning of a new token starts a comment that extends to the end
3245 of the line, and therefore ends argument processing.
3246 An unquoted dollar sign
3247 .Ql $
3248 will cause variable expansion of the given name, which must be a valid
3249 .Xr sh 1 Ns
3250 ell-style variable name (see
3251 .Cm vput ) :
3252 .Sx "INTERNAL VARIABLES"
3253 as well as
3254 .Sx ENVIRONMENT
3255 (shell) variables can be accessed through this mechanism, brace
3256 enclosing the name is supported (i.e., to subdivide a token).
3259 Whereas the metacharacters
3260 .Cm space , tabulator , newline
3261 only complete an input token, vertical bar
3262 .Cm \&| ,
3263 ampersand
3264 .Cm &
3265 and semicolon
3266 .Cm \&;
3267 also act as control operators and perform control functions.
3268 For now supported is semicolon
3269 .Cm \&; ,
3270 which terminates a single command, therefore sequencing the command line
3271 and making the remainder of the line a subject to reevaluation.
3272 With sequencing, multiple command argument types and quoting rules may
3273 therefore apply to a single line, which can become problematic before
3274 v15: e.g., the first of the following will cause surprising results.
3277 .Dl ? echo one; set verbose; echo verbose=$verbose.
3278 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3281 Quoting is a mechanism that will remove the special meaning of
3282 metacharacters and reserved words, and will prevent expansion.
3283 There are four quoting mechanisms: the escape character, single-quotes,
3284 double-quotes and dollar-single-quotes:
3287 .Bl -bullet -offset indent
3289 The literal value of any character can be preserved by preceding it
3290 with the escape character reverse solidus
3291 .Ql \e .
3294 Arguments which are enclosed in
3295 .Ql 'single-\:quotes'
3296 retain their literal value.
3297 A single-quote cannot occur within single-quotes.
3300 The literal value of all characters enclosed in
3301 .Ql \(dqdouble-\:quotes\(dq
3302 is retained, with the exception of dollar sign
3303 .Ql $ ,
3304 which will cause variable expansion, as above, backquote (grave accent)
3305 .Ql ` ,
3306 (which not yet means anything special), reverse solidus
3307 .Ql \e ,
3308 which will escape any of the characters dollar sign
3309 .Ql $
3310 (to prevent variable expansion), backquote (grave accent)
3311 .Ql ` ,
3312 double-quote
3313 .Ql \(dq
3314 (to prevent ending the quote) and reverse solidus
3315 .Ql \e
3316 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3317 but has no special meaning otherwise.
3320 Arguments enclosed in
3321 .Ql $'dollar-\:single-\:quotes'
3322 extend normal single quotes in that reverse solidus escape sequences are
3323 expanded as follows:
3325 .Bl -tag -compact -width "Ql \eNNN"
3326 .It Ql \ea
3327 bell control character (ASCII and ISO-10646 BEL).
3328 .It Ql \eb
3329 backspace control characer (ASCII and ISO-10646 BS).
3330 .It Ql \eE
3331 escape control character (ASCII and ISO-10646 ESC).
3332 .It Ql \ee
3333 the same.
3334 .It Ql \ef
3335 form feed control character (ASCII and ISO-10646 FF).
3336 .It Ql \en
3337 line feed control character (ASCII and ISO-10646 LF).
3338 .It Ql \er
3339 carriage return control character (ASCII and ISO-10646 CR).
3340 .It Ql \et
3341 horizontal tabulator control character (ASCII and ISO-10646 HT).
3342 .It Ql \ev
3343 vertical tabulator control character (ASCII and ISO-10646 VT).
3344 .It Ql \e\e
3345 emits a reverse solidus character.
3346 .It Ql \e'
3347 single quote.
3348 .It Ql \e"
3349 double quote (escaping is optional).
3350 .It Ql \eNNN
3351 eight-bit byte with the octal value
3352 .Ql NNN
3353 (one to three octal digits), optionally prefixed by an additional
3354 .Ql 0 .
3355 A 0 byte will suppress further output for the quoted argument.
3356 .It Ql \exHH
3357 eight-bit byte with the hexadecimal value
3358 .Ql HH
3359 (one or two hexadecimal characters).
3360 A 0 byte will suppress further output for the quoted argument.
3361 .It Ql \eUHHHHHHHH
3362 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3363 .Ql HHHHHHHH
3364 (one to eight hexadecimal digits) \(em note that Unicode defines the
3365 maximum codepoint ever to be supported as
3366 .Ql 0x10FFFF
3367 (in planes of
3368 .Ql 0xFFFF
3369 characters each).
3370 This escape is only supported in locales that support Unicode (see
3371 .Sx "Character sets" ) ,
3372 in other cases the sequence will remain unexpanded unless the given code
3373 point is ASCII compatible or (if the \*(OPal character set conversion is
3374 available) can be represented in the current locale.
3375 The character NUL will suppress further output for the quoted argument.
3376 .It Ql \euHHHH
3377 Identical to
3378 .Ql \eUHHHHHHHH
3379 except it takes only one to four hexadecimal digits.
3380 .It Ql \ecX
3381 Emits the non-printable (ASCII and compatible) C0 control codes
3382 0 (NUL) to 31 (US), and 127 (DEL).
3383 Printable representations of ASCII control codes can be created by
3384 mapping them to a different part of the ASCII character set, which is
3385 possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is
3386 .Ql 7 + 64 = 71 = G .
3387 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3388 .Ic vexpr ) ,
3389 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3390 .Ql ? vexpr ^ 127 64 .
3392 Whereas historically circumflex notation has often been used for
3393 visualization purposes of control codes, e.g.,
3394 .Ql ^G ,
3395 the reverse solidus notation has been standardized:
3396 .Ql \ecG .
3397 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3398 as shown above (e.g.,
3399 .Ql \ea ,
3400 .Ql \en ,
3401 .Ql \et ) :
3402 whenever such an alias exists it will be used for display purposes.
3403 The control code NUL
3404 .Pf ( Ql \ec@ ,
3405 a non-standard extension) will suppress further output for the remains
3406 of the token (which may extend beyond the current quote), or, depending
3407 on the context, the remains of all arguments for the current command.
3408 .It Ql \e$NAME
3409 Non-standard extension: expand the given variable name, as above.
3410 Brace enclosing the name is supported.
3411 .It Ql \e`{command}
3412 Not yet supported, just to raise awareness: Non-standard extension.
3417 Caveats:
3419 .Bd -literal -offset indent
3420 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3421 ? echo Quotes ${HOME} and tokens differ! # comment
3422 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3424 .\" }}}
3426 .\" .Ss "Raw data arguments for codec commands" {{{
3427 .Ss "Raw data arguments for codec commands"
3429 A special set of commands, which all have the string
3430 .Dq codec
3431 in their name, e.g.,
3432 .Ic addrcodec ,
3433 .Ic shcodec ,
3434 .Ic urlcodec ,
3435 take raw string data as input, which means that the content of the
3436 command input line is passed completely unexpanded and otherwise
3437 unchanged: like this the effect of the actual codec is visible without
3438 any noise of possible shell quoting rules etc., i.e., the user can input
3439 one-to-one the desired or questionable data.
3440 To gain a level of expansion, the entire command line can be
3441 .Ic eval Ns
3442 uated first, e.g.,
3444 .Bd -literal -offset indent
3445 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3446 ? echo $res
3447 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3448 ? shcodec d $res
3449 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3450 ? eval shcodec d $res
3451 /usr/Sch\[:o]nes Wetter/heute.txt
3453 .\" }}}
3455 .\" .Ss "Filename transformations" {{{
3456 .Ss "Filename transformations"
3458 Filenames, where expected, and unless documented otherwise, are
3459 subsequently subject to the following filename transformations, in
3460 sequence:
3462 .Bl -bullet -offset indent
3464 If the given name is a registered
3465 .Ic shortcut ,
3466 it will be replaced with the expanded shortcut.
3469 The filename is matched against the following patterns or strings:
3471 .Bl -hang -compact -width ".Ar %user"
3472 .It Ar #
3473 (Number sign) is expanded to the previous file.
3474 .It Ar %
3475 (Percent sign) is replaced by the invoking
3476 .Mx -ix "primary system mailbox"
3477 user's primary system mailbox, which either is the (itself expandable)
3478 .Va inbox
3479 if that is set, the standardized absolute pathname indicated by
3480 .Ev MAIL
3481 if that is set, or a built-in compile-time default otherwise.
3482 .It Ar %user
3483 Expands to the primary system mailbox of
3484 .Ar user
3485 (and never the value of
3486 .Va inbox ,
3487 regardless of its actual setting).
3488 .It Ar &
3489 (Ampersand) is replaced with the invoking users
3490 .Mx -ix "secondary mailbox"
3491 secondary mailbox, the
3492 .Ev MBOX .
3493 .It Ar +file
3494 Refers to a
3495 .Ar file
3496 in the
3497 .Va folder
3498 directory (if that variable is set).
3499 .It Ar %:filespec
3500 Expands to the same value as
3501 .Ar filespec ,
3502 but has special meaning when used with, e.g., the command
3503 .Ic file :
3504 the file will be treated as a primary system mailbox by, e.g., the
3505 .Ic mbox
3507 .Ic save
3508 commands, meaning that messages that have been read in the current
3509 session will be moved to the
3510 .Ev MBOX
3511 mailbox instead of simply being flagged as read.
3515 Meta expansions are applied to the resulting filename, as applicable to
3516 the resulting file access protocol (also see
3517 .Sx "On URL syntax and credential lookup" ) .
3518 If the fully expanded filename results in multiple pathnames and the
3519 command is expecting only one file, an error results.
3521 For the file-protocol, a leading tilde
3522 .Ql ~
3523 character will be replaced by the expansion of
3524 .Ev HOME ,
3525 except when followed by a valid user name, in which case the home
3526 directory of the given user is used instead.
3528 In addition a shell expansion as if specified in double-quotes (see
3529 .Sx "Shell-style argument quoting" )
3530 is applied, so that any occurrence of
3531 .Ql $VARIABLE
3533 .Ql ${VARIABLE} )
3534 will be replaced by the expansion of the variable, if possible;
3535 .Sx "INTERNAL VARIABLES"
3536 as well as
3537 .Sx ENVIRONMENT
3538 (shell) variables can be accessed through this mechanism.
3540 In interactive context, in order to allow simple value acceptance (via
3541 .Dq ENTER ) ,
3542 arguments will usually be displayed in a properly quoted form, e.g., a file
3543 .Ql diet\e is \ecurd.txt
3544 may be displayed as
3545 .Ql 'diet\e is \ecurd.txt' .
3547 .\" }}}
3549 .\" .Ss "Commands" {{{
3550 .Ss "Commands"
3552 The following commands are available:
3554 .Bl -tag -width ".It Ic BaNg"
3558 .It Ic \&!
3559 Executes the
3560 .Ev SHELL
3561 command which follows, replacing unescaped exclamation marks with the
3562 previously executed command if the internal variable
3563 .Va bang
3564 is set.
3565 This command supports
3566 .Cm vput
3567 as documented in
3568 .Sx "Command modifiers" ,
3569 and manages the error number
3570 .Va \&! .
3571 A 0 or positive exit status
3572 .Va \&?
3573 reflects the exit status of the command, negative ones that
3574 an error happened before the command was executed, or that the program
3575 did not exit cleanly, but, e.g., due to a signal: the error number is
3576 .Va ^ERR Ns -CHILD ,
3577 then.
3580 In conjunction with the
3581 .Cm vput
3582 modifier the following special cases exist:
3583 a negative exit status occurs if the collected data could not be stored
3584 in the given variable, which is a
3585 .Va ^ERR Ns -NOTSUP
3586 error that should otherwise not occur.
3587 .Va ^ERR Ns -CANCELED
3588 indicates that no temporary file could be created to collect the command
3589 output at first glance.
3590 In case of catchable out-of-memory situations
3591 .Va ^ERR Ns -NOMEM
3592 will occur and \*(UA will try to store the empty string, just like with
3593 all other detected error conditions.
3597 .It Ic #
3598 The comment-command causes the entire line to be ignored.
3599 .Sy Note:
3600 this really is a normal command which' purpose is to discard its
3601 arguments, not a
3602 .Dq comment-start
3603 indicating special character, which means that, e.g., trailing comments
3604 on a line are not possible.
3607 .It Ic +
3608 Goes to the next message in sequence and types it
3609 (like
3610 .Dq ENTER ) .
3613 .It Ic -
3614 Display the preceding message, or the n'th previous message if given
3615 a numeric argument n.
3618 .It Ic =
3619 Show the current message number (the
3620 .Dq dot ) .
3623 .It Ic \&?
3624 Show a brief summary of commands.
3625 \*(OP Given an argument a synopsis for the command in question is
3626 shown instead; commands can be abbreviated in general and this command
3627 can be used to see the full expansion of an abbreviation including the
3628 synopsis, try, e.g.,
3629 .Ql ?h ,
3630 .Ql ?hel
3632 .Ql ?help
3633 and see how the output changes.
3634 This mode also supports a more
3635 .Va verbose
3636 output, which will provide the informations documented for
3637 .Ic list .
3640 .It Ic \&|
3641 A synonym for the
3642 .Ic pipe
3643 command.
3647 .It Ic account , unaccount
3648 (ac, una) Creates, selects or lists (an) account(s).
3649 Accounts are special incarnations of
3650 .Ic define Ns d
3651 macros and group commands and variable settings which together usually
3652 arrange the environment for the purpose of creating an email account.
3653 Different to normal macros settings which are covered by
3654 .Ic localopts
3655 \(en here by default enabled! \(en will not be reverted before the
3656 .Ic account
3657 is changed again.
3658 The special account
3659 .Ql null
3660 (case-insensitive) always exists, and all but it can be deleted by the
3661 latter command, and in one operation with the special name
3662 .Ql * .
3664 Without arguments a listing of all defined accounts is shown.
3665 With one argument the given account is activated: the system
3666 .Va inbox
3667 of that account will be activated (as via
3668 .Ic file ) ,
3669 a possibly installed
3670 .Va folder-hook
3671 will be run, and the internal variable
3672 .Va account
3673 will be updated.
3674 The two argument form is identical to defining a macro as via
3675 .Ic define :
3676 .Bd -literal -offset indent
3677 account myisp {
3678   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
3679   set from='(My Name) myname@myisp.example'
3680   set mta=smtp://mylogin@smtp.myisp.example
3686 .It Ic addrcodec
3687 Perform email address codec transformations on raw-data argument, rather
3688 according to email standards (RFC 5322; \*(ID will furtherly improve).
3689 Supports
3690 .Cm vput
3691 (see
3692 .Sx "Command modifiers" ) ,
3693 and manages the error number
3694 .Va \&! .
3695 The first argument must be either
3696 .Ar [+[+[+]]]e[ncode] ,
3697 .Ar d[ecode]
3699 .Ar s[kin] ,
3700 and specifies the operation to perform on the rest of the line.
3703 Decoding will show how a standard-compliant MUA will display the given
3704 argument, which should be an email address.
3705 Please be aware that most MUAs have difficulties with the address
3706 standards, and vary wildly when (comments) in parenthesis,
3707 .Dq double-quoted
3708 strings, or quoted-pairs, as below, become involved.
3709 \*(ID \*(UA currently does not perform decoding when displaying addresses.
3712 Skinning is identical to decoding but only outputs the plain address,
3713 without any string, comment etc. components.
3714 Another difference is that it may fail with the error number
3715 .Va \&!
3716 set to
3717 .Va ^ERR Ns -INVAL
3718 if decoding fails to find a(n) (valid) email address, in which case the
3719 unmodified input will be output again.
3722 Encoding supports four different modes, lesser automated versions can be
3723 chosen by prefixing one, two or three plus signs: the standard imposes
3724 a special meaning on some characters, which thus have to be transformed
3725 to so-called quoted-pairs by pairing them with a reverse solidus
3726 .Ql \e
3727 in order to remove the special meaning; this might change interpretation
3728 of the entire argument from what has been desired, however!
3729 Specify one plus sign to remark that parenthesis shall be left alone,
3730 two for not turning double quotation marks into quoted-pairs, and three
3731 for also leaving any user-specified reverse solidus alone.
3732 The result will always be valid, if a successful exit status is reported.
3733 \*(ID Addresses need to be specified in between angle brackets
3734 .Ql < ,
3735 .Ql >
3736 if the construct becomes more difficult, otherwise the current parser
3737 will fail; it is not smart enough to guess right.
3739 .Bd -literal -offset indent
3740 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
3741 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3742 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3743 "Hey, you", \e out\e there <diet@exam.ple>
3744 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3745 diet@exam.ple
3751 .It Ic alias , unalias
3752 (a, una) Aliases are a method of creating personal distribution lists
3753 that map a single alias name to none to multiple real receivers;
3754 these aliases become expanded after message composing is completed.
3755 The latter command removes the given list of aliases, the special name
3756 .Ql *
3757 will discard all existing aliases.
3758 The former command shows all currently defined aliases when used without
3759 arguments, and with one argument the expansion of the given alias.
3760 With more than one argument, creates or appends to the alias name given
3761 as the first argument the remaining arguments.
3762 Alias names are restricted to alphabetic characters, digits, the
3763 underscore, hyphen-minus, the number sign, colon, commercial at and
3764 period, the last character can also be the dollar sign:
3765 .Ql [[:alnum:]_#:@.-]+$? .
3769 .It Ic alternates , unalternates
3770 \*(NQ (alt) Manage a list of alternate addresses or names of the active user,
3771 members of which will be removed from recipient lists.
3772 The latter command removes the given list of alternates, the special name
3773 .Ql *
3774 will discard all existing aliases.
3775 The former command manages the error number
3776 .Va \&!
3777 and shows the current set of alternates when used without arguments; in
3778 this mode it supports
3779 .Cm vput
3780 (see
3781 .Sx "Command modifiers" ) .
3782 Otherwise the given arguments (after being checked for validity) are
3783 appended to the list of alternate names; in
3784 .Va posix
3785 mode they replace that list instead.
3786 There is a set of implicit alternates which is formed of the values of
3787 .Ev LOGNAME ,
3788 .Va from ,
3789 .Va sender
3791 .Va reply-to .
3795 .It Ic answered , unanswered
3796 Take a message lists and mark each message as having been answered,
3797 having not been answered, respectively.
3798 Messages will be marked answered when being
3799 .Ic reply Ns d
3800 to automatically if the
3801 .Va markanswered
3802 variable is set.
3803 See the section
3804 .Sx "Message states" .
3809 .It Ic bind , unbind
3810 \*(OP\*(NQ The bind command extends the MLE (see
3811 .Sx "On terminal control and line editor" )
3812 with freely configurable key bindings.
3813 The latter command removes from the given context the given key binding,
3814 both of which may be specified as a wildcard
3815 .Ql * ,
3816 so that, e.g.,
3817 .Ql unbind * *
3818 will remove all bindings of all contexts.
3819 Due to initialization order unbinding will not work for built-in key
3820 bindings upon program startup, however: please use
3821 .Va line-editor-no-defaults
3822 for this purpose instead.
3825 With one argument the former command shows all key bindings for the
3826 given context, specifying an asterisk
3827 .Ql *
3828 will show the bindings of all contexts; a more verbose listing will be
3829 produced if either of
3830 .Va debug
3832 .Va verbose
3833 are set.
3834 With two or more arguments a binding is (re)established:
3835 the first argument is the context to which the binding shall apply,
3836 the second argument is a comma-separated list of the
3837 .Dq keys
3838 which form the binding, and any remaining arguments form the expansion.
3839 To indicate that a binding shall not be auto-committed, but that the
3840 expansion shall instead be furtherly editable by the user, a commercial at
3841 .Ql @
3842 (that will be removed) can be placed last in the expansion, from which
3843 leading and trailing whitespace will finally be removed.
3844 Reverse solidus cannot be used as the last character of expansion.
3847 Contexts define when a binding applies, i.e., a binding will not be seen
3848 unless the context for which it is defined for is currently active.
3849 This is not true for the shared binding
3850 .Ql base ,
3851 which is the foundation for all other bindings and as such always
3852 applies, its bindings, however, only apply secondarily.
3853 The available contexts are the shared
3854 .Ql base ,
3856 .Ql default
3857 context which is used in all not otherwise documented situations, and
3858 .Ql compose ,
3859 which applies to compose mode only.
3862 .Dq Keys
3863 which form the binding are specified as a comma-separated list of
3864 byte-sequences, where each list entry corresponds to one key(press).
3865 A list entry may, indicated by a leading colon character
3866 .Ql \&: ,
3867 also refer to the name of a terminal capability; several dozen names
3868 will be compiled in and may be specified either by their
3869 .Xr terminfo 5 ,
3870 or, if existing, by their
3871 .Xr termcap 5
3872 name, regardless of the actually used \*(OPal terminal control library.
3873 It is possible to use any capability, as long as the name is resolvable
3874 by the \*(OPal control library or was defined via the internal variable
3875 .Va termcap .
3876 Input sequences are not case-normalized, so that an exact match is
3877 required to update or remove a binding.
3878 Examples:
3880 .Bd -literal -offset indent
3881 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
3882 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
3883 ? bind default $'\ecA',:khome,w 'echo An editable binding@'
3884 ? bind default a,b,c rm -irf / @  # Another editable binding
3885 ? bind default :kf1 File %
3886 ? bind compose :kf1 ~e
3890 Note that the entire comma-separated list is first parsed (over) as a
3891 shell-token with whitespace as the field separator, before being parsed
3892 and expanded for real with comma as the field separator, therefore
3893 whitespace needs to be properly quoted, see
3894 .Sx "Shell-style argument quoting" .
3895 Using Unicode reverse solidus escape sequences renders a binding
3896 defunctional if the locale does not support Unicode (see
3897 .Sx "Character sets" ) ,
3898 and using terminal capabilities does so if no (corresponding) terminal
3899 control support is (currently) available.
3902 The following terminal capability names are built-in and can be used in
3903 .Xr terminfo 5
3904 or (if available) the two-letter
3905 .Xr termcap 5
3906 notation.
3907 See the respective manual for a list of capabilities.
3908 The program
3909 .Xr infocmp 1
3910 can be used to show all the capabilities of
3911 .Ev TERM
3912 or the given terminal type;
3913 using the
3914 .Fl \&\&x
3915 flag will also show supported (non-standard) extensions.
3918 .Bl -tag -compact -width kcuuf_or_kcuuf
3919 .It Cd kbs Ns \0or Cd kb
3920 Backspace.
3921 .It Cd kdch1 Ns \0or Cd kD
3922 Delete character.
3923 .It Cd kDC Ns \0or Cd *4
3924 \(em shifted variant.
3925 .It Cd kel Ns \0or Cd kE
3926 Clear to end of line.
3927 .It Cd kext Ns \0or Cd @9
3928 Exit.
3929 .It Cd kich1 Ns \0or Cd kI
3930 Insert character.
3931 .It Cd kIC Ns \0or Cd #3
3932 \(em shifted variant.
3933 .It Cd khome Ns \0or Cd kh
3934 Home.
3935 .It Cd kHOM Ns \0or Cd #2
3936 \(em shifted variant.
3937 .It Cd kend Ns \0or Cd @7
3938 End.
3939 .It Cd knp Ns \0or Cd kN
3940 Next page.
3941 .It Cd kpp Ns \0or Cd kP
3942 Previous page.
3943 .It Cd kcub1 Ns \0or Cd kl
3944 Left cursor (with more modifiers: see below).
3945 .It Cd kLFT Ns \0or Cd #4
3946 \(em shifted variant.
3947 .It Cd kcuf1 Ns \0or Cd kr
3948 Right cursor (ditto).
3949 .It Cd kRIT Ns \0or Cd %i
3950 \(em shifted variant.
3951 .It Cd kcud1 Ns \0or Cd kd
3952 Down cursor (ditto).
3953 .It Cd kDN
3954 \(em shifted variant (only terminfo).
3955 .It Cd kcuu1 Ns \0or Cd ku
3956 Up cursor (ditto).
3957 .It Cd kUP
3958 \(em shifted variant (only terminfo).
3959 .It Cd kf0 Ns \0or Cd k0
3960 Function key 0.
3961 Add one for each function key up to
3962 .Cd kf9
3964 .Cd k9 ,
3965 respectively.
3966 .It Cd kf10 Ns \0or Cd k;
3967 Function key 10.
3968 .It Cd kf11 Ns \0or Cd F1
3969 Function key 11.
3970 Add one for each function key up to
3971 .Cd kf19
3973 .Cd F9 ,
3974 respectively.
3978 Some terminals support key-modifier combination extensions, e.g.,
3979 .Ql Alt+Shift+xy .
3980 For example, the delete key,
3981 .Cd kdch1 :
3982 in its shifted variant, the name is mutated to
3983 .Cd  kDC ,
3984 then a number is appended for the states
3985 .Ql Alt
3986 .Pf ( Cd kDC3 ) ,
3987 .Ql Shift+Alt
3988 .Pf ( Cd kDC4 ) ,
3989 .Ql Control
3990 .Pf ( Cd kDC5 ) ,
3991 .Ql Shift+Control
3992 .Pf ( Cd kDC6 ) ,
3993 .Ql Alt+Control
3994 .Pf ( Cd kDC7 ) ,
3995 finally
3996 .Ql Shift+Alt+Control
3997 .Pf ( Cd kDC8 ) .
3998 The same for the left cursor key,
3999 .Cd kcub1 :
4000 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4003 It is advisable to use an initial escape or other control character (e.g.,
4004 .Ql \ecA )
4005 for bindings which describe user key combinations (as opposed to purely
4006 terminal capability based ones), in order to avoid ambiguities whether
4007 input belongs to key sequences or not; it also reduces search time.
4008 Adjusting
4009 .Va bind-timeout
4010 may help shall keys and sequences be falsely recognized.
4014 .It Ic call
4015 \*(NQ Calls the given macro, which must have been created via
4016 .Ic define ,
4017 otherwise a
4018 .Va ^ERR Ns -NOENT
4019 error occurs.
4020 Parameters given to macros are implicitly local to the macro's scope, and
4021 may be accessed via special (positional) parameters, e.g.,
4022 .Va 1 ,
4023 .Va * ,
4024 .Va @ ,
4025 .Va # .
4026 The positional parameters may be removed by
4027 .Ic shift Ns
4028 ing them off the stack (exceeding the supported number of arguments
4029 results in a
4030 .Va ^ERR Ns -OVERFLOW ) ,
4031 and are otherwise controllable via
4032 .Ic vpospar .
4033 Changes to other
4034 .Sx ENVIRONMENT
4035 as well as
4036 .Sx "INTERNAL VARIABLES"
4037 can be reverted before the current level regains control by setting
4038 .Ic localopts
4039 for called macro(s) (or in them, of course).
4040 Macro execution can be terminated at any time by calling
4041 .Ic return .
4044 Calling macros recursively will at some time excess the stack size
4045 limit, causing a hard program abortion; if recursively calling a macro
4046 is the last command of the current macro, consider to use the command
4047 .Ic xcall ,
4048 which will first release all resources of the current macro before
4049 replacing the current macro with the called one.
4050 Numeric and string operations can be performed via
4051 .Ic vexpr ,
4053 .Ic eval
4054 may be helpful to recreate argument lists.
4056 .Bd -literal -offset indent
4057 define exmac {
4058   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4059   return 1000 0
4061 call exmac Hello macro exmac!
4066 .It Ic call_if
4067 Identical to
4068 .Ic call
4069 if the given macro has been created via
4070 .Ic define ,
4071 but doesn't fail nor warn if the macro doesn't exist.
4074 .It Ic cd
4075 (ch) Change the working directory to
4076 .Ev HOME
4077 or the given argument.
4078 Synonym for
4079 .Ic chdir .
4082 .It Ic certsave
4083 \*(OP Only applicable to S/MIME signed messages.
4084 Takes a message list and a filename and saves the certificates
4085 contained within the message signatures to the named file in both
4086 human-readable and PEM format.
4087 The certificates can later be used to send encrypted messages to the
4088 respective message senders by setting
4089 .Va smime-encrypt-USER@HOST
4090 variables.
4094 .It Ic charsetalias , uncharsetalias
4095 \*(NQ Manage (character set conversion) character set alias mappings,
4096 as documented in the section
4097 .Sx "Character sets" .
4098 Character set aliases are expanded recursively, but no expansion is
4099 performed on values of the user-settable variables, e.g.,
4100 .Va charset-8bit .
4101 These are effectively no-operations if character set conversion
4102 is not available (i.e., no
4103 .Ql +iconv
4105 .Va features ) .
4106 Without arguments the list of all currently defined aliases is shown,
4107 with one argument the expansion of the given alias.
4108 Otherwise all given arguments are treated as pairs of character sets and
4109 their desired target alias name, creating new or changing already
4110 existing aliases, as necessary.
4112 The latter deletes all aliases given as arguments, the special argument
4113 .Ql *
4114 will remove all aliases.
4117 .It Ic chdir
4118 (ch) Change the working directory to
4119 .Ev HOME
4120 or the given argument.
4121 Synonym for
4122 .Ic cd .
4126 .It Ic collapse , uncollapse
4127 Only applicable to threaded mode.
4128 Takes a message list and makes all replies to these messages invisible
4129 in header summaries, except for
4130 .Ql new
4131 messages and the
4132 .Dq dot .
4133 Also when a message with collapsed replies is displayed,
4134 all of these are automatically uncollapsed.
4135 The latter command undoes collapsing.
4140 .It Ic colour , uncolour
4141 \*(OP\*(NQ Manage colour mappings of and for a
4142 .Sx "Coloured display" .
4143 The type of colour is given as the (case-insensitive) first argument,
4144 which must be one of
4145 .Ql 256
4146 for 256-colour terminals,
4147 .Ql 8 ,
4148 .Ql ansi
4150 .Ql iso
4151 for the standard 8-colour ANSI / ISO 6429 color palette and
4152 .Ql 1
4154 .Ql mono
4155 for monochrome terminals.
4156 Monochrome terminals cannot deal with colours, but only (some) font
4157 attributes.
4160 Without further arguments the list of all currently defined mappings
4161 for the given colour type is shown (as a special case giving
4162 .Ql all
4164 .Ql *
4165 will show the mappings of all types).
4166 Otherwise the second argument defines the mappable slot, and the third
4167 argument a (comma-separated list of) colour and font attribute
4168 specification(s), and the optional fourth argument can be used to
4169 specify a precondition: if conditioned mappings exist they are tested in
4170 (creation) order unless a (case-insensitive) match has been found, and
4171 the default mapping (if any has been established) will only be chosen as
4172 a last resort.
4173 The types of precondition available depend on the mappable slot (see
4174 .Sx "Coloured display"
4175 for some examples), the following of which exist:
4178 Mappings prefixed with
4179 .Ql mle-
4180 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4181 .Sx "On terminal control and line editor" )
4182 and do not support preconditions.
4184 .Bl -tag -compact -width view-partinfo
4185 .It Ar mle-position
4186 This mapping is used for the position indicator that is visible when
4187 a line cannot be fully displayed on the screen.
4188 .It Ar mle-prompt
4189 Used for the
4190 .Va prompt .
4194 Mappings prefixed with
4195 .Ql sum-
4196 are used in header summaries, and they all understand the preconditions
4197 .Ql dot
4198 (the current message) and
4199 .Ql older
4200 for elder messages (only honoured in conjunction with
4201 .Va datefield-markout-older ) .
4203 .Bl -tag -compact -width view-partinfo
4204 .It Ar sum-dotmark
4205 This mapping is used for the
4206 .Dq dotmark
4207 that can be created with the
4208 .Ql %>
4210 .Ql %<
4211 formats of the variable
4212 .Va headline .
4213 .It Ar sum-header
4214 For the complete header summary line except the
4215 .Dq dotmark
4216 and the thread structure.
4217 .It Ar sum-thread
4218 For the thread structure which can be created with the
4219 .Ql %i
4220 format of the variable
4221 .Va headline .
4225 Mappings prefixed with
4226 .Ql view-
4227 are used when displaying messages.
4229 .Bl -tag -compact -width view-partinfo
4230 .It Ar view-from_
4231 This mapping is used for so-called
4232 .Ql From_
4233 lines, which are MBOX file format specific header lines.
4234 .It Ar view-header
4235 For header lines.
4236 A comma-separated list of headers to which the mapping applies may be
4237 given as a precondition; if the \*(OPal regular expression support is
4238 available then if any of the
4239 .Dq magical
4240 (extended) regular expression characters is seen the precondition will
4241 be evaluated as (an extended) one.
4242 .It Ar view-msginfo
4243 For the introductional message info line.
4244 .It Ar view-partinfo
4245 For MIME part info lines.
4249 The following (case-insensitive) colour definitions and font attributes
4250 are understood, multiple of which can be specified in a comma-separated
4251 list:
4253 .Bl -tag -width ft=
4254 .It Ar ft=
4255 a font attribute:
4256 .Ql bold ,
4257 .Ql reverse
4259 .Ql underline .
4260 It is possible (and often applicable) to specify multiple font
4261 attributes for a single mapping.
4263 .It Ar fg=
4264 foreground colour attribute:
4265 .Ql black ,
4266 .Ql blue ,
4267 .Ql green ,
4268 .Ql red ,
4269 .Ql brown ,
4270 .Ql magenta ,
4271 .Ql cyan
4273 .Ql white .
4274 To specify a 256-color mode a decimal number colour specification in
4275 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4277 .Bl -tag -compact -width "999 - 999"
4278 .It 0 - 7
4279 the standard ISO 6429 colors, as above.
4280 .It 8 - 15
4281 high intensity variants of the standard colors.
4282 .It 16 - 231
4283 216 colors in tuples of 6.
4284 .It 232 - 255
4285 grayscale from black to white in 24 steps.
4287 .Bd -literal -offset indent
4288 #!/bin/sh -
4289 fg() { printf "\e033[38;5;${1}m($1)"; }
4290 bg() { printf "\e033[48;5;${1}m($1)"; }
4292 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4293 printf "\e033[0m\en"
4295 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4296 printf "\e033[0m\en"
4299 .It Ar bg=
4300 background colour attribute (see
4301 .Cd fg=
4302 for possible values).
4306 The command
4307 .Ic \&uncolour
4308 will remove for the given colour type (the special type
4309 .Ql *
4310 selects all) the given mapping; if the optional precondition argument is
4311 given only the exact tuple of mapping and precondition is removed.
4312 The special name
4313 .Ql *
4314 will remove all mappings (no precondition allowed), thus
4315 .Ql uncolour * *
4316 will remove all established mappings.
4321 .It Ic commandalias , uncommandalias
4322 \*(NQ Define or list, and remove, respectively, command aliases.
4323 An (command)alias can be used everywhere a normal command can be used,
4324 but always takes precedence: any arguments that are given to the command
4325 alias are joined onto the alias expansion, and the resulting string
4326 forms the command line that is, in effect, executed.
4327 The latter command removes all given aliases, the special name
4328 .Ql *
4329 will remove all existing aliases.
4330 When used without arguments the former shows a list of all currently
4331 known aliases, with one argument only the expansion of the given one.
4333 With two or more arguments a command alias is defined or updated: the
4334 first argument is the name under which the remaining command line should
4335 be accessible, the content of which can be just about anything.
4336 An alias may itself expand to another alias, but to avoid expansion loops
4337 further expansion will be prevented if an alias refers to itself or if
4338 an expansion depth limit is reached.
4339 Explicit expansion prevention is available via reverse solidus
4340 .Cm \e ,
4341 one of the
4342 .Sx "Command modifiers" .
4343 .Bd -literal -offset indent
4344 ? commandalias xx
4345 \*(uA: `commandalias': no such alias: xx
4346 ? commandalias xx echo hello,
4347 ? commandalias xx
4348 commandalias xx 'echo hello,'
4349 ? xx
4350 hello,
4351 ? xx world
4352 hello, world
4356 .It Ic Copy
4357 (C) Copy messages to files whose names are derived from the author of
4358 the respective message and do not mark them as being saved;
4359 otherwise identical to
4360 .Ic Save .
4363 .It Ic copy
4364 (c) Copy messages to the named file and do not mark them as being saved;
4365 otherwise identical to
4366 .Ic save .
4369 .It Ic cwd
4370 Show the name of the current working directory, as reported by
4371 .Xr getcwd 3 .
4372 Supports
4373 .Cm vput
4374 (see
4375 .Sx "Command modifiers" ) .
4376 The return status is tracked via
4377 .Va \&! .
4380 .It Ic Decrypt
4381 \*(OP For unencrypted messages this command is identical to
4382 .Ic Copy ;
4383 Encrypted messages are first decrypted, if possible, and then copied.
4386 .It Ic decrypt
4387 \*(OP For unencrypted messages this command is identical to
4388 .Ic copy ;
4389 Encrypted messages are first decrypted, if possible, and then copied.
4393 .It Ic define , undefine
4394 Without arguments the current list of macros, including their content,
4395 is shown, otherwise a macro is defined, replacing an existing macro of
4396 the same name.
4397 A macro definition is a sequence of commands in the following form:
4398 .Bd -literal -offset indent
4399 define name {
4400   command1
4401   command2
4402   ...
4403   commandN
4407 A defined macro can be invoked explicitly by using the
4408 .Ic call ,
4409 .Ic call_if
4411 .Ic xcall
4412 commands, or implicitly if a macro hook is triggered, e.g., a
4413 .Va folder-hook .
4414 It is possible to localize adjustments, like creation, deletion and
4415 modification of
4416 .Sx "INTERNAL VARIABLES" ,
4417 by using the
4418 .Ic localopts
4419 command; the scope which is localized depends on how (i.e.,
4420 .Dq as what :
4421 normal macro, folder hook, hook,
4422 .Ic account
4423 switch) the macro is invoked.
4424 Execution of a macro body can be stopped from within by calling
4425 .Ic return .
4426 Inside a
4427 .Ic call Ns
4428 ed macro, given positional parameters can be
4429 .Ic shift Ns
4430 ed, or become completely replaced, removed etc. via
4431 .Ic vpospar .
4433 The latter command deletes the given macro, the special name
4434 .Ql *
4435 will discard all existing macros.
4436 Creation and deletion of (a) macro(s) can be performed from within
4437 a running macro.
4441 .It Ic delete , undelete
4442 (d, u) Marks the given message list as being or not being
4443 .Ql deleted ,
4444 respectively; if no argument has been specified then the usual search
4445 for a visible message is performed, as documented for
4446 .Sx "Message list arguments" ,
4447 showing only the next input prompt if the search fails.
4448 Deleted messages will neither be saved in the
4449 .Mx -sx
4450 .Sx "secondary mailbox"
4451 .Ev MBOX
4452 nor will they be available for most other commands.
4453 If the
4454 .Va autoprint
4455 variable is set, the new
4456 .Dq dot
4457 or the last message restored, respectively, is automatically
4458 .Ic type Ns
4459 d; also see
4460 .Ic dp ,
4461 .Ic dt .
4464 .It Ic discard
4465 (di) Identical to
4466 .Ic ignore .
4467 Superseded by the multiplexer
4468 .Ic headerpick .
4472 .It Ic dp , dt
4473 Delete the given messages and automatically
4474 .Ic type
4475 the new
4476 .Dq dot
4477 if one exists, regardless of the setting of
4478 .Va autoprint .
4481 .It Ic dotmove
4482 Move the
4483 .Dq dot
4484 up or down by one message when given
4485 .Ql +
4487 .Ql -
4488 argument, respectively.
4492 .It Ic draft , undraft
4493 Take message lists and mark each given message as being draft, or not
4494 being draft, respectively, as documented in the section
4495 .Sx "Message states" .
4498 .It Ic echo
4499 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4500 newline, whereas the otherwise identical
4501 .Ic echon
4502 does not.
4503 .Sx "Shell-style argument quoting"
4504 is used,
4505 .Sx "Filename transformations"
4506 are applied to the expanded arguments.
4509 .It Ic echoerr
4510 \*(NQ Identical to
4511 .Ic echo
4512 except that is echoes to standard error.
4513 Also see
4514 .Ic echoerrn .
4515 In interactive sessions the \*(OPal message ring queue for
4516 .Ic errors
4517 will be used instead, if available.
4520 .It Ic echon
4521 \*(NQ Identical to
4522 .Ic echo ,
4523 but does not write a trailing newline.
4526 .It Ic echoerrn
4527 \*(NQ Identical to
4528 .Ic echoerr ,
4529 but does not write a trailing newline.
4532 .It Ic edit
4533 (e) Point the text editor (as defined in
4534 .Ev EDITOR )
4535 at each message from the given list in turn.
4536 Modified contents are discarded unless the
4537 .Va writebackedited
4538 variable is set, and are not used unless the mailbox can be written to
4539 and the editor returns a successful exit status.
4542 .It Ic elif
4543 Part of the
4544 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4545 conditional \(em if the condition of a preceding
4546 .Ic if
4547 was false, check the following condition and execute the following block
4548 if it evaluates true.
4551 .It Ic else
4552 (el) Part of the
4553 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4554 conditional \(em if none of the conditions of the preceding
4555 .Ic if
4557 .Ic elif
4558 commands was true, the
4559 .Ic else
4560 block is executed.
4563 .It Ic endif
4564 (en) Marks the end of an
4565 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4566 conditional execution block.
4570 .It Ic environ
4571 \*(NQ \*(UA has a strict notion about which variables are
4572 .Sx "INTERNAL VARIABLES"
4573 and which are managed in the program
4574 .Sx ENVIRONMENT .
4575 Since some of the latter are a vivid part of \*(UAs functioning,
4576 however, they are transparently integrated into the normal handling of
4577 internal variables via
4578 .Ic set
4580 .Ic unset .
4581 To integrate other environment variables of choice into this
4582 transparent handling, and also to export internal variables into the
4583 process environment where they normally are not, a
4584 .Ql link
4585 needs to become established with this command, as in, e.g.,
4588 .Dl environ link PERL5LIB TZ
4591 Afterwards changing such variables with
4592 .Ic set
4593 will cause automatic updates of the program environment, and therefore
4594 be inherited by newly created child processes.
4595 Sufficient system support provided (it was in BSD as early as 1987, and
4596 is standardized since Y2K) removing such variables with
4597 .Ic unset
4598 will remove them also from the program environment, but in any way
4599 the knowledge they ever have been
4600 .Ql link Ns
4601 ed will be lost.
4602 Note that this implies that
4603 .Ic localopts
4604 may cause loss of such links.
4607 The command
4608 .Ql unlink
4609 will remove an existing link, but leaves the variables as such intact.
4610 Additionally the subcommands
4611 .Ql set
4613 .Ql unset
4614 are provided, which work exactly the same as the documented commands
4615 .Ic set
4617 .Ic unset ,
4618 but (additionally un)link the variable(s) with the program environment
4619 and thus immediately export them to, or remove them from (if possible),
4620 respectively, the program environment.
4624 .It Ic errors
4625 \*(OP Since \*(UA uses the console as a user interface it can happen
4626 that messages scroll by too fast to become recognized.
4627 An error message ring queue is available which stores duplicates of any
4628 error message and notifies the user in interactive sessions whenever
4629 a new error has occurred.
4630 The queue is finite: if its maximum size is reached any new message
4631 replaces the eldest.
4632 The command
4633 .Ic errors
4634 can be used to manage this message queue: if given
4635 .Ar show
4636 or no argument the queue will be displayed and cleared,
4637 .Ar clear
4638 will only clear all messages from the queue.
4641 .It Ic eval
4642 \*(NQ Construct a command by concatenating the arguments, separated with
4643 a single space character, and then evaluate the result.
4644 This command passes through the exit status
4645 .Va \&?
4646 and error number
4647 .Va \&!
4648 of the evaluated command; also see
4649 .Ic call .
4650 .Bd -literal -offset indent
4651 define xxx {
4652   echo "xxx arg <$1>"
4653   shift
4654   if [ $# -gt 0 ]
4655     \excall xxx "$@"
4656   endif
4658 define yyy {
4659   eval "$@ ' ball"
4661 call yyy '\ecall xxx' "b\e$'\et'u ' "
4662 call xxx arg <b      u>
4663 call xxx arg <  >
4664 call xxx arg <ball>
4668 .It Ic exit
4669 (ex or x) Exit from \*(UA without changing the active mailbox and skip
4670 any saving of messages in the
4671 .Mx -sx
4672 .Sx "secondary mailbox"
4673 .Ev MBOX ,
4674 as well as a possibly tracked line editor
4675 .Va history-file .
4676 The optional status number argument will be passed through to
4677 .Xr exit 3 .
4678 \*(ID For now it can happen that the given status will be overwritten,
4679 later this will only occur if a later error needs to be reported onto an
4680 otherwise success indicating status.
4683 .It Ic File
4684 (Fi) Like
4685 .Ic file ,
4686 but open the mailbox read-only.
4690 .It Ic file
4691 (fi) The file command switches to a new mailbox.
4692 Without arguments it shows status information of the current mailbox.
4693 If an argument is given, it will write out changes (such as deletions)
4694 the user has made, open a new mailbox, update the internal variables
4695 .Va mailbox-resolved
4697 .Va mailbox-display ,
4698 and optionally display a summary of
4699 .Ic headers
4700 if the variable
4701 .Va header
4702 is set.
4705 .Sx "Filename transformations"
4706 will be applied to the
4707 .Ar name
4708 argument, and
4709 .Ql protocol://
4710 prefixes are, i.e., URL syntax is understood, e.g.,
4711 .Ql maildir:///tmp/mdirbox :
4712 if a protocol prefix is used the mailbox type is fixated and neither
4713 the auto-detection (read on) nor the
4714 .Va newfolders
4715 mechanisms apply.
4716 \*(OPally URLs can also be used to access network resources, and it is
4717 possible to proxy all network traffic over a SOCKS5 server given via
4718 .Va socks-proxy .
4721 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
4722 .Dl \*(OU protocol://[user@]host[:port][/path]
4725 \*(OPally supported network protocols are
4726 .Ar pop3
4727 (POP3) and
4728 .Ar pop3s
4729 (POP3 with SSL/TLS encrypted transport),
4730 .Ar imap
4732 .Ar imaps .
4734 .Ar [/path]
4735 part is valid only for IMAP; there it defaults to
4736 .Ar INBOX .
4737 Network URLs require a special encoding as documented in the section
4738 .Sx "On URL syntax and credential lookup" .
4741 If the resulting file protocol (MBOX database)
4742 .Ar name
4743 is located on a local filesystem then the list of all registered
4744 .Ic filetype Ns
4745 s is traversed in order to see whether a transparent intermediate
4746 conversion step is necessary to handle the given mailbox, in which case
4747 \*(UA will use the found hook to load and save data into and from
4748 a temporary file, respectively.
4749 Changing hooks will not affect already opened mailboxes.
4750 For example, the following creates hooks for the
4751 .Xr gzip 1
4752 compression tool and a combined compressed and encrypted format:
4754 .Bd -literal -offset indent
4755 ? filetype \e
4756     gzip 'gzip -dc' 'gzip -c' \e
4757     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
4761 MBOX database files are generally locked during file operations in order
4762 to avoid inconsistencies due to concurrent modifications.
4763 \*(OPal Mailbox files which \*(UA treats as the system
4764 .Va inbox
4765 .Pf ( Ev MAIL ) ,
4767 .Mx -sx
4768 .Sx "primary system mailbox" Ns
4769 es in general will also be protected by so-called dotlock files, the
4770 traditional way of mail spool file locking: for any file
4771 .Ql a
4772 a lock file
4773 .Ql a.lock
4774 will be created for the duration of the synchronization \(em
4775 as necessary a privilege-separated dotlock child process will be used
4776 to accommodate for necessary privilege adjustments in order to create
4777 the dotlock file in the same directory
4778 and with the same user and group identities as the file of interest.
4781 \*(UA by default uses tolerant POSIX rules when reading MBOX database
4782 files, but it will detect invalid message boundaries in this mode and
4783 complain (even more with
4784 .Va debug )
4785 if any is seen: in this case
4786 .Va mbox-rfc4155
4787 can be used to create a valid MBOX database from the invalid input.
4790 If no protocol has been fixated, and
4791 .Ar name
4792 refers to a directory with the subdirectories
4793 .Ql tmp ,
4794 .Ql new
4796 .Ql cur ,
4797 then it is treated as a folder in
4798 .Dq Maildir
4799 format.
4800 The maildir format stores each message in its own file, and has been
4801 designed so that file locking is not necessary when reading or writing
4802 files.
4805 \*(ID If no protocol has been fixated and no existing file has
4806 been found, the variable
4807 .Va newfolders
4808 controls the format of mailboxes yet to be created.
4813 .It Ic filetype , unfiletype
4814 \*(NQ Define or list, and remove, respectively, file handler hooks,
4815 which provide (shell) commands that enable \*(UA to load and save MBOX
4816 files from and to files with the registered file extensions;
4817 it will use an intermediate temporary file to store the plain data.
4818 The latter command removes the hooks for all given extensions,
4819 .Ql *
4820 will remove all existing handlers.
4822 When used without arguments the former shows a list of all currently
4823 defined file hooks, with one argument the expansion of the given alias.
4824 Otherwise three arguments are expected, the first specifying the file
4825 extension for which the hook is meant, and the second and third defining
4826 the load- and save commands, respectively, to deal with the file type,
4827 both of which must read from standard input and write to standard
4828 output.
4829 Changing hooks will not affect already opened mailboxes (\*(ID except below).
4830 \*(ID For now too much work is done, and files are oftened read in twice
4831 where once would be sufficient: this can cause problems if a filetype is
4832 changed while such a file is opened; this was already so with the
4833 built-in support of .gz etc. in Heirloom, and will vanish in v15.
4834 \*(ID For now all handler strings are passed to the
4835 .Ev SHELL for evaluation purposes; in the future a
4836 .Ql \&!
4837 prefix to load and save commands may mean to bypass this shell instance:
4838 placing a leading space will avoid any possible misinterpretations.
4839 .Bd -literal -offset indent
4840 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
4841     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
4842     zst 'zstd -dc' 'zstd -19 -zc' \e
4843     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
4844 ? set record=+sent.zst.pgp
4849 .It Ic flag , unflag
4850 Take message lists and mark the messages as being flagged, or not being
4851 flagged, respectively, for urgent/special attention.
4852 See the section
4853 .Sx "Message states" .
4856 .It Ic folder
4857 (fold) The same as
4858 .Ic file .
4861 .It Ic folders
4862 With no arguments, list the names of the folders in the folder directory.
4863 With an existing folder as an argument,
4864 lists the names of folders below the named folder.
4867 .It Ic Followup
4868 (F) Similar to
4869 .Ic Respond ,
4870 but saves the message in a file named after the local part of the first
4871 recipient's address (instead of in
4872 .Va record Ns ).
4875 .It Ic followup
4876 (fo) Similar to
4877 .Ic respond ,
4878 but saves the message in a file named after the local part of the first
4879 recipient's address (instead of in
4880 .Va record Ns ).
4883 .It Ic followupall
4884 Similar to
4885 .Ic followup ,
4886 but responds to all recipients regardless of the
4887 .Va flipr
4888 variable.
4891 .It Ic followupsender
4892 Similar to
4893 .Ic Followup ,
4894 but responds to the sender only regardless of the
4895 .Va flipr
4896 variable.
4899 .It Ic Forward
4900 Similar to
4901 .Ic forward ,
4902 but saves the message in a file named after the local part of the
4903 recipient's address (instead of in
4904 .Va record Ns ).
4907 .It Ic forward
4908 Takes a message and the address of a recipient
4909 and forwards the message to him.
4910 The text of the original message is included in the new one,
4911 with the value of the
4912 .Va forward-inject-head
4913 variable preceding it.
4914 To filter the included header fields to the desired subset use the
4915 .Ql forward
4916 slot of the white- and blacklisting command
4917 .Ic headerpick .
4918 Only the first part of a multipart message is included unless
4919 .Va forward-as-attachment ,
4920 and recipient addresses will be stripped from comments, names
4921 etc. unless the internal variable
4922 .Va fullnames
4923 is set.
4925 This may generate the errors
4926 .Va ^ERR Ns -DESTADDRREQ
4927 if no receiver has been specified,
4928 .Va ^ERR Ns -PERM
4929 if some addressees where rejected by
4930 .Va expandaddr ,
4931 .Va ^ERR Ns -NODATA
4932 if no applicable messages have been given,
4933 .Va ^ERR Ns -NOTSUP
4934 if multiple messages have been specified,
4935 .Va ^ERR Ns -IO
4936 if an I/O error occurs,
4937 .Va ^ERR Ns -NOTSUP
4938 if a necessary character set conversion fails, and
4939 .Va ^ERR Ns -INVAL
4940 for other errors.
4943 .It Ic from
4944 (f) Takes a list of message specifications and displays a summary of
4945 their message headers, exactly as via
4946 .Ic headers .
4947 An alias of this command is
4948 .Ic search .
4949 Also see
4950 .Sx "Specifying messages" .
4952 .It Ic Fwd
4953 \*(OB Alias for
4954 .Ic Forward .
4956 .It Ic fwd
4957 \*(OB Alias for
4958 .Ic forward .
4960 .It Ic fwdignore
4961 \*(OB Superseded by the multiplexer
4962 .Ic headerpick .
4964 .It Ic fwdretain
4965 \*(OB Superseded by the multiplexer
4966 .Ic headerpick .
4968 .It Ic ghost , unghost
4969 \*(OB Replaced by
4970 .Ic commandalias ,
4971 .Ic uncommandalias .
4975 .It Ic headerpick , unheaderpick
4976 \*(NQ Multiplexer command to manage white- and blacklisting
4977 selections of header fields for a variety of applications.
4978 Without arguments the set of contexts that have settings is displayed.
4979 When given arguments, the first argument is the context to which the
4980 command applies, one of (case-insensitive)
4981 .Ql type
4982 for display purposes (via, e.g.,
4983 .Ic type ) ,
4984 .Ql save
4985 for selecting which headers shall be stored persistently when
4986 .Ic save ,
4987 .Ic copy ,
4988 .Ic move
4989 or even
4990 .Ic decrypt Ns
4991 ing messages (note that MIME related etc. header fields should not be
4992 ignored in order to not destroy usability of the message in this case),
4993 .Ql forward
4994 for stripping down messages when
4995 .Ic forward Ns
4996 ing message (has no effect if
4997 .Va forward-as-attachment
4998 is set), and
4999 .Ql top
5000 for defining user-defined set of fields for the command
5001 .Ic top .
5003 The current settings of the given context are displayed if it is the
5004 only argument.
5005 A second argument denotes the type of restriction that is to be chosen,
5006 it may be (a case-insensitive prefix of)
5007 .Ql retain
5009 .Ql ignore
5010 for white- and blacklisting purposes, respectively.
5011 Establishing a whitelist suppresses inspection of the corresponding
5012 blacklist.
5014 If no further argument is given the current settings of the given type
5015 will be displayed, otherwise the remaining arguments specify header
5016 fields, which \*(OPally may be given as regular expressions, to be added
5017 to the given type.
5018 The special wildcard field (asterisk,
5019 .Ql * )
5020 will establish a (fast) shorthand setting which covers all fields.
5022 The latter command always takes three or more arguments and can be used
5023 to remove selections, i.e., from the given context, the given type of
5024 list, all the given headers will be removed, the special argument
5025 .Ql *
5026 will remove all headers.
5029 .It Ic headers
5030 (h) Show the current group of headers, the size of which depends on
5031 the variable
5032 .Va screen ,
5033 and the style of which can be adjusted with the variable
5034 .Va headline .
5035 If a message-specification is given the group of headers containing the
5036 first message therein is shown and the message at the top of the screen
5037 becomes the new
5038 .Dq dot .
5041 .It Ic help
5042 (hel) A synonym for
5043 .Ic \&? .
5046 .It Ic history
5047 \*(OP Either
5048 .Ar show
5049 (this mode also supports a more
5050 .Va verbose
5051 output) or
5052 .Ar clear
5053 the list of history entries;
5054 a decimal
5055 .Ar NUMBER
5056 argument selects and evaluates the respective history entry,
5057 which will become the new history top; a negative number is used as an
5058 offset to the current command, e.g.,
5059 .Ql -1
5060 will select the last command, the history top.
5061 The default mode if no arguments are given is
5062 .Ar show .
5063 Please see
5064 .Sx "On terminal control and line editor"
5065 for more on this topic.
5068 .It Ic hold
5069 (ho, also
5070 .Ic preserve )
5071 Takes a message list and marks each message therein to be saved in the
5072 user's system
5073 .Va inbox
5074 instead of in the
5075 .Mx -sx
5076 .Sx "secondary mailbox"
5077 .Ev MBOX .
5078 Does not override the
5079 .Ic delete
5080 command.
5081 \*(UA deviates from the POSIX standard with this command, because a
5082 .Ic next
5083 command issued after
5084 .Ic hold
5085 will display the following message, not the current one.
5089 .It Ic if
5090 (i) Part of the nestable
5091 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5092 conditional execution construct \(em if the given condition is true then
5093 the encapsulated block is executed.
5094 The POSIX standards supports the (case-insensitive) conditions
5095 .Ql r Ns
5096 eceive
5098 .Ql s Ns
5099 end, all remaining conditions are non-portable extensions.
5100 \*(ID These commands do not yet use
5101 .Sx "Shell-style argument quoting"
5102 and therefore do not know about input tokens, so that syntax
5103 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5104 all conditions bracket group wise and consider the tokens, representing
5105 values and operators, therein, which also means that variables will
5106 already have been expanded at that time (just like in the shell).
5108 .Bd -literal -offset indent
5109 if receive
5110   commands ...
5111 else
5112   commands ...
5113 endif
5117 The (case-insensitive) condition
5118 .Ql t Ns
5119 erminal will evaluate to true if the standard input is a terminal, i.e.,
5120 in interactive sessions.
5121 Another condition can be any boolean value (see the section
5122 .Sx "INTERNAL VARIABLES"
5123 for textual boolean representations) to mark an enwrapped block as
5124 .Dq never execute
5126 .Dq always execute .
5127 (It shall be remarked that a faulty condition skips all branches until
5128 .Ic endif . )
5131 (\*(ID In v15
5132 .Sx "Shell-style argument quoting"
5133 will be used, and this command will simply interpret expanded tokens.)
5134 It is possible to check
5135 .Sx "INTERNAL VARIABLES"
5136 as well as
5137 .Sx ENVIRONMENT
5138 variables for existence or compare their expansion against a user given
5139 value or another variable by using the
5140 .Ql $
5141 .Pf ( Dq variable next )
5142 conditional trigger character;
5143 a variable on the right hand side may be signalled using the same
5144 mechanism.
5145 Variable names may be enclosed in a pair of matching braces.
5146 When this mode has been triggered, several operators are available:
5149 Integer operators treat the arguments on the left and right hand side of
5150 the operator as integral numbers and compare them arithmetically.
5151 It is an error if any of the operands is not a valid integer, an empty
5152 argument (which implies it had been quoted) is treated as if it were 0.
5153 Available operators are
5154 .Ql -lt
5155 (less than),
5156 .Ql -le
5157 (less than or equal to),
5158 .Ql -eq
5159 (equal),
5160 .Ql -ne
5161 (not equal),
5162 .Ql -ge
5163 (greater than or equal to), and
5164 .Ql -gt
5165 (greater than).
5168 String data operators compare the left and right hand side according to
5169 their textual content.
5170 Unset variables are treated as the empty string.
5171 The behaviour of string operators can be adjusted by prefixing the
5172 operator with the modifier trigger commercial at
5173 .Ql @ ,
5174 followed by none to multiple modifiers: for now supported is
5175 .Ql i ,
5176 which turns the comparison into a case-insensitive one: this is
5177 implied if no modifier follows the trigger.
5180 Available string operators are
5181 .Ql <
5182 (less than),
5183 .Ql <=
5184 (less than or equal to),
5185 .Ql ==
5186 (equal),
5187 .Ql !=
5188 (not equal),
5189 .Ql >=
5190 (greater than or equal to),
5191 .Ql >
5192 (greater than),
5193 .Ql =%
5194 (is substring of) and
5195 .Ql !%
5196 (is not substring of).
5197 By default these operators work on bytes and (therefore) do not take
5198 into account character set specifics.
5199 If the case-insensitivity modifier has been used, case is ignored
5200 according to the rules of the US-ASCII encoding, i.e., bytes are
5201 still compared.
5204 When the \*(OPal regular expression support is available, the additional
5205 string operators
5206 .Ql =~
5208 .Ql !~
5209 can be used.
5210 They treat the right hand side as an extended regular expression that is
5211 matched according to the active locale (see
5212 .Sx "Character sets" ) ,
5213 i.e., character sets should be honoured correctly.
5216 Conditions can be joined via AND-OR lists (where the AND operator is
5217 .Ql &&
5218 and the OR operator is
5219 .Ql || ) ,
5220 which have equal precedence and will be evaluated with left
5221 associativity, thus using the same syntax that is known for the
5222 .Xr sh 1 .
5223 It is also possible to form groups of conditions and lists by enclosing
5224 them in pairs of brackets
5225 .Ql [\ \&.\&.\&.\ ] ,
5226 which may be interlocked within each other, and also be joined via
5227 AND-OR lists.
5230 The results of individual conditions and entire groups may be modified
5231 via unary operators: the unary operator
5232 .Ql \&!
5233 will reverse the result.
5235 .Bd -literal -offset indent
5236 # (This not in v15, there [ -n "$debug"]!)
5237 if $debug
5238   echo *debug* is set
5239 endif
5240 if [ "$ttycharset" == UTF-8 ] || [ "$ttycharset" @i== UTF8 ]
5241   echo *ttycharset* is UTF-8, the former case-sensitive!
5242 endif
5243 set t1=one t2=one
5244 if [ "${t1}" == "${t2}" ]
5245   echo These two variables are equal
5246 endif
5247 if [ "$features" =% +regex ] && [ "$TERM" @i=~ "^xterm\&.*" ]
5248   echo ..in an X terminal
5249 endif
5250 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5251     [ "$verbose" != '' ] ] ]
5252   echo Noisy, noisy
5253 endif
5254 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5255   echo Left associativity, as is known from the shell
5256 endif
5261 .It Ic ignore
5262 (ig) Identical to
5263 .Ic discard .
5264 Superseded by the multiplexer
5265 .Ic headerpick .
5268 .It Ic list
5269 Shows the names of all available commands, alphabetically sorted.
5270 If given any non-whitespace argument the list will be shown in the order
5271 in which command prefixes are searched.
5272 \*(OP In conjunction with a set variable
5273 .Va verbose
5274 additional information will be provided for each command: the argument
5275 type will be indicated, the documentation string will be shown,
5276 and the set of command flags will show up:
5278 .Bl -tag -compact -width ".It Ql BaNg"
5279 .It Ql "vput modifier"
5280 command supports the command modifier
5281 .Cm vput .
5282 .It Ql "errno in *!*"
5283 the error number is tracked in
5284 .Va \&! .
5285 .It Ql "needs box"
5286 commands needs an active mailbox, a
5287 .Ic file .
5288 .It Ql "ok: batch or interactive"
5289 command may only be used in interactive or
5290 .Fl #
5291 batch mode.
5292 .It Ql "ok: send mode"
5293 command can be used in send mode.
5294 .It Ql "not ok: compose mode"
5295 command is not available when in compose mode.
5296 .It Ql "not ok: during startup"
5297 command cannot be used during program startup, e.g., while loading
5298 .Sx "Resource files" .
5299 .It Ql "ok: in subprocess"
5300 command is allowed to be used when running in a subprocess instance,
5301 e.g., from within a macro that is called via
5302 .Va on-compose-splice .
5307 .It Ic localopts
5308 This command can be used to localize changes to (linked)
5309 .Sx ENVIRONMENT
5310 as well as
5311 .Sx "INTERNAL VARIABLES" ,
5312 meaning that their state will be reverted to the former one once the
5313 .Dq covered scope
5314 is left.
5315 It can only be used inside of macro definition blocks introduced by
5316 .Ic account
5318 .Ic define .
5319 The covered scope of an
5320 .Ic account
5321 is left once a different account is activated, and some macros, notably
5322 .Va folder-hook Ns s ,
5323 use their own specific notion of covered scope, here it will be extended
5324 until the folder is left again.
5327 This setting stacks up: i.e., if
5328 .Ql macro1
5329 enables change localization and calls
5330 .Ql macro2 ,
5331 which explicitly resets localization, then any value changes within
5332 .Ql macro2
5333 will still be reverted when the scope of
5334 .Ql macro1
5335 is left.
5336 (Caveats: if in this example
5337 .Ql macro2
5338 changes to a different
5339 .Ic account
5340 which sets some variables that are already covered by localizations,
5341 their scope will be extended, and in fact leaving the
5342 .Ic account
5343 will (thus) restore settings in (likely) global scope which actually
5344 were defined in a local, macro private context!)
5347 This command takes one or two arguments, the optional first one
5348 specifies an attribute that may be one of
5349 .Cm scope ,
5350 which refers to the current scope and is thus the default,
5351 .Cm call ,
5352 which causes any macro that is being
5353 .Ic call Ns
5354 ed to be started with localization enabled by default, as well as
5355 .Cm call-fixate ,
5356 which (if enabled) disallows any called macro to turn off localization:
5357 like this it can be ensured that once the current scope regains control,
5358 any changes made in deeper levels have been reverted.
5359 The latter two are mutually exclusive.
5360 The (second) argument is interpreted as a boolean (string, see
5361 .Sx "INTERNAL VARIABLES" )
5362 and states whether the given attribute shall be turned on or off.
5364 .Bd -literal -offset indent
5365 define temporary_settings {
5366   set possibly_global_option1
5367   localopts on
5368   set local_option1
5369   set local_option2
5370   localopts scope off
5371   set possibly_global_option2
5377 .It Ic Lreply
5378 Reply to messages that come in via known
5379 .Pf ( Ic mlist )
5380 or subscribed
5381 .Pf ( Ic mlsubscribe )
5382 mailing lists, or pretend to do so (see
5383 .Sx "Mailing lists" ) :
5384 on top of the usual
5385 .Ic reply
5386 functionality this will actively resort and even remove message
5387 recipients in order to generate a message that is supposed to be sent to
5388 a mailing list.
5389 For example it will also implicitly generate a
5390 .Ql Mail-Followup-To:
5391 header if that seems useful, regardless of the setting of the variable
5392 .Va followup-to .
5393 For more documentation please refer to
5394 .Sx "On sending mail, and non-interactive mode" .
5396 This may generate the errors
5397 .Va ^ERR Ns -DESTADDRREQ
5398 if no receiver has been specified,
5399 .Va ^ERR Ns -PERM
5400 if some addressees where rejected by
5401 .Va expandaddr ,
5402 .Va ^ERR Ns -NODATA
5403 if no applicable messages have been given,
5404 .Va ^ERR Ns -IO
5405 if an I/O error occurs,
5406 .Va ^ERR Ns -NOTSUP
5407 if a necessary character set conversion fails, and
5408 .Va ^ERR Ns -INVAL
5409 for other errors.
5410 Any error stops processing of further messages.
5413 .It Ic Mail
5414 Similar to
5415 .Ic mail ,
5416 but saves the message in a file named after the local part of the first
5417 recipient's address (instead of in
5418 .Va record Ns ).
5421 .It Ic mail
5422 (m) Takes a (list of) recipient address(es) as (an) argument(s),
5423 or asks on standard input if none were given;
5424 then collects the remaining mail content and sends it out.
5425 For more documentation please refer to
5426 .Sx "On sending mail, and non-interactive mode" .
5428 This may generate the errors
5429 .Va ^ERR Ns -DESTADDRREQ
5430 if no receiver has been specified,
5431 .Va ^ERR Ns -PERM
5432 if some addressees where rejected by
5433 .Va expandaddr ,
5434 .Va ^ERR Ns -NODATA
5435 if no applicable messages have been given,
5436 .Va ^ERR Ns -NOTSUP
5437 if multiple messages have been specified,
5438 .Va ^ERR Ns -IO
5439 if an I/O error occurs,
5440 .Va ^ERR Ns -NOTSUP
5441 if a necessary character set conversion fails, and
5442 .Va ^ERR Ns -INVAL
5443 for other errors.
5446 .It Ic mbox
5447 (mb) The given message list is to be sent to the
5448 .Mx -sx
5449 .Sx "secondary mailbox"
5450 .Ev MBOX
5451 when \*(UA is quit; this is the default action unless the variable
5452 .Va hold
5453 is set.
5454 \*(ID This command can only be used in a
5455 .Mx -sx
5456 .Sx "primary system mailbox" .
5460 .It Ic mimetype , unmimetype
5461 Without arguments the content of the MIME type cache will displayed;
5462 a more verbose listing will be produced if either of
5463 .Va debug
5465 .Va verbose
5466 are set.
5467 When given arguments they will be joined, interpreted as shown in
5468 .Sx "The mime.types files"
5469 (also see
5470 .Sx "HTML mail and MIME attachments" ) ,
5471 and the resulting entry will be added (prepended) to the cache.
5472 In any event MIME type sources are loaded first as necessary \(en
5473 .Va mimetypes-load-control
5474 can be used to fine-tune which sources are actually loaded.
5476 The latter command deletes all specifications of the given MIME type, thus
5477 .Ql ? unmimetype text/plain
5478 will remove all registered specifications for the MIME type
5479 .Ql text/plain .
5480 The special name
5481 .Ql *
5482 will discard all existing MIME types, just as will
5483 .Ql reset ,
5484 but which also reenables cache initialization via
5485 .Va mimetypes-load-control .
5489 .It Ic mlist , unmlist
5490 The latter command removes all given mailing-lists, the special name
5491 .Ql *
5492 can be used to remove all registered lists.
5493 The former will list all currently defined mailing lists (and their
5494 attributes, if any) when used without arguments; a more verbose listing
5495 will be produced if either of
5496 .Va debug
5498 .Va verbose
5499 are set.
5500 Otherwise all given arguments will be added and henceforth be recognized
5501 as mailing lists.
5502 If the \*(OPal regular expression support is available then mailing
5503 lists may also be specified as (extended) regular expressions (see
5504 .Xr re_format 7
5505 for more on those).
5508 .It Ic mimeview
5509 \*(ID Only available in interactive mode, this command allows to display
5510 MIME parts which require external MIME handler programs to run which do
5511 not integrate in \*(UAs normal
5512 .Ic type
5513 output (see
5514 .Sx "HTML mail and MIME attachments" ) .
5515 (\*(ID No syntax to directly address parts, this restriction may vanish.)
5516 The user will be asked for each non-text part of the given message in
5517 turn whether the registered handler shall be used to display the part.
5521 .It Ic mlsubscribe , unmlsubscribe
5522 The latter command removes the subscription attribute from all given
5523 mailing-lists, the special name
5524 .Ql *
5525 can be used to do so for any registered list.
5526 The former will list all currently defined mailing lists which have
5527 a subscription attribute when used without arguments; a more verbose
5528 listing will be produced if either of
5529 .Va debug
5531 .Va verbose
5532 are set.
5533 Otherwise this attribute will be set for all given mailing lists,
5534 newly creating them as necessary (as via
5535 .Ic mlist ) .
5536 Also see
5537 .Va followup-to .
5540 .It Ic Move
5541 Similar to
5542 .Ic move ,
5543 but moves the messages to a file named after the local part of the
5544 sender address of the first message (instead of in
5545 .Va record Ns ).
5548 .It Ic move
5549 Acts like
5550 .Ic copy
5551 but marks the messages for deletion if they were transferred
5552 successfully.
5555 .It Ic More
5556 Like
5557 .Ic more ,
5558 but also displays header fields which would not pass the
5559 .Ic headerpick
5560 selection, and all MIME parts.
5561 Identical to
5562 .Ic Page .
5565 .It Ic more
5566 Invokes the
5567 .Ev PAGER
5568 on the given messages, even in non-interactive mode and as long as the
5569 standard output is a terminal.
5570 Identical to
5571 .Ic page .
5574 .It Ic netrc
5575 \*(OP When used without arguments or if
5576 .Ar show
5577 has been given the content of the
5578 .Pa .netrc
5579 cache is shown, loading it first as necessary.
5580 If the argument is
5581 .Ar load
5582 then the cache will only be initialized and
5583 .Ar clear
5584 will remove its contents.
5585 Note that \*(UA will try to load the file only once, use
5586 .Ql Ic \&\&netrc Ns \:\0\:clear
5587 to unlock further attempts.
5589 .Va netrc-lookup ,
5590 .Va netrc-pipe
5591 and the section
5592 .Sx "On URL syntax and credential lookup" ;
5593 the section
5594 .Sx "The .netrc file"
5595 documents the file format in detail.
5598 .It Ic newmail
5599 Checks for new mail in the current folder without committing any changes
5600 before.
5601 If new mail is present, a message is shown.
5602 If the
5603 .Va header
5604 variable is set,
5605 the headers of each new message are also shown.
5606 This command is not available for all mailbox types.
5609 .It Ic next
5610 (n) (like
5611 .Ql +
5613 .Dq ENTER )
5614 Goes to the next message in sequence and types it.
5615 With an argument list, types the next matching message.
5618 .It Ic New
5619 Same as
5620 .Ic Unread .
5623 .It Ic new
5624 Same as
5625 .Ic unread .
5628 .It Ic noop
5629 If the current folder is accessed via a network connection, a
5630 .Dq NOOP
5631 command is sent, otherwise no operation is performed.
5634 .It Ic Page
5635 Like
5636 .Ic page ,
5637 but also displays header fields which would not pass the
5638 .Ic headerpick
5639 selection, and all MIME parts.
5640 Identical to
5641 .Ic More .
5644 .It Ic page
5645 Invokes the
5646 .Ev PAGER
5647 on the given messages, even in non-interactive mode and as long as the
5648 standard output is a terminal.
5649 Identical to
5650 .Ic more .
5653 .It Ic Pipe
5654 Like
5655 .Ic pipe
5656 but also pipes header fields which would not pass the
5657 .Ic headerpick
5658 selection, and all parts of MIME
5659 .Ql multipart/alternative
5660 messages.
5663 .It Ic pipe
5664 (pi) Takes a message list and a shell command
5665 and pipes the messages through the command.
5666 Without an argument the current message is piped through the command
5667 given by the
5668 .Va cmd
5669 variable.
5670 If the
5671 .Va page
5672 variable is set,
5673 every message is followed by a formfeed character.
5676 .It Ic preserve
5677 (pre) A synonym for
5678 .Ic hold .
5681 .It Ic Print
5682 (P) Alias for
5683 .Ic Type .
5686 .It Ic print
5687 (p) Research
5689 equivalent of
5690 .Ic type .
5693 .It Ic quit
5694 (q) Terminates the session, saving all undeleted, unsaved messages in
5695 the current
5696 .Mx -sx
5697 .Sx "secondary mailbox"
5698 .Ev MBOX ,
5699 preserving all messages marked with
5700 .Ic hold
5702 .Ic preserve
5703 or never referenced in the system
5704 .Va inbox ,
5705 and removing all other messages from the
5706 .Mx -sx
5707 .Sx "primary system mailbox" .
5708 If new mail has arrived during the session,
5709 the message
5710 .Dq You have new mail
5711 will be shown.
5712 If given while editing a mailbox file with the command line option
5713 .Fl f ,
5714 then the edit file is rewritten.
5715 A return to the shell is effected,
5716 unless the rewrite of edit file fails,
5717 in which case the user can escape with the exit command.
5718 The optional status number argument will be passed through to
5719 .Xr exit 3 .
5720 \*(ID For now it can happen that the given status will be overwritten,
5721 later this will only occur if a later error needs to be reported onto an
5722 otherwise success indicating status.
5725 .It Ic read
5726 \*(NQ Read a line from standard input, or the channel set active via
5727 .Ic readctl ,
5728 and assign the data, which will be splitted as indicated by
5729 .Va ifs ,
5730 to the given variables.
5731 The variable names are checked by the same rules as documented for
5732 .Cm vput ,
5733 and the same error codes will be seen in
5734 .Va \&! ;
5735 the exit status
5736 .Va \&?
5737 indicates the number of bytes read, it will be
5738 .Ql -1
5739 with the error number
5740 .Va \&!
5741 set to
5742 .Va ^ERR Ns -BADF
5743 in case of I/O errors, or
5744 .Va ^ERR Ns -NONE
5745 upon End-Of-File.
5746 If there are more fields than variables, assigns successive fields to the
5747 last given variable.
5748 If there are less fields than variables, assigns the empty string to the
5749 remains.
5750 .Bd -literal -offset indent
5751 ? read a b c
5752    H  e  l  l  o
5753 ? echo "<$a> <$b> <$c>"
5754 <H> <e> <l  l  o>
5755 ? wysh set ifs=:; read a b c;unset ifs
5756 hey2.0,:"'you    ",:world!:mars.:
5757 ? echo $?/$^ERRNAME / <$a><$b><$c>
5758 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
5762 .It Ic readctl
5763 \*(NQ Manages input channels for
5764 .Ic read ,
5765 to be used to avoid complicated or impracticable code, like calling
5766 .Ic \&\&read
5767 from within a macro in non-interactive mode.
5768 Without arguments, or when the first argument is
5769 .Cm show ,
5770 a listing of all known channels is printed.
5771 Channels can otherwise be
5772 .Cm create Ns
5773 d, and existing channels can be
5774 .Cm set
5775 active and
5776 .Cm remove Ns
5777 d by giving the string used for creation.
5779 The channel name is expected to be a file descriptor number, or,
5780 if parsing the numeric fails, an input file name that undergoes
5781 .Sx "Filename transformations" .
5782 E.g. (this example requires a modern shell):
5783 .Bd -literal -offset indent
5784 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
5785   LC_ALL=C \*(uA -R#
5786 hey, you
5787 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
5788   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
5789 hey, you
5792 .It Ic redirect
5793 \*(OB Same as
5794 .Ic resend .
5796 .It Ic Redirect
5797 \*(OB Same as
5798 .Ic Resend .
5801 .It Ic remove
5802 Removes the named files or directories.
5803 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
5804 type specific removal will be performed, deleting the complete mailbox.
5805 The user is asked for confirmation in interactive mode.
5808 .It Ic rename
5809 Takes the name of an existing folder
5810 and the name for the new folder
5811 and renames the first to the second one.
5812 Both folders must be of the same type.
5815 .It Ic Reply
5816 (R) Replies to only the sender of each message of the given message
5817 list, by using the first message as the template to quote, for the
5818 .Ql Subject:
5819 etc.
5820 .Va flipr
5821 will exchange this command with
5822 .Ic reply .
5823 Unless the internal variable
5824 .Va fullnames
5825 is set the recipient address will be stripped from comments, names etc.
5826 .Ql Reply-To:
5827 headers will be inspected if
5828 .Va reply-to-honour
5829 is set.
5831 This may generate the errors
5832 .Va ^ERR Ns -DESTADDRREQ
5833 if no receiver has been specified,
5834 .Va ^ERR Ns -PERM
5835 if some addressees where rejected by
5836 .Va expandaddr ,
5837 .Va ^ERR Ns -NODATA
5838 if no applicable messages have been given,
5839 .Va ^ERR Ns -IO
5840 if an I/O error occurs,
5841 .Va ^ERR Ns -NOTSUP
5842 if a necessary character set conversion fails, and
5843 .Va ^ERR Ns -INVAL
5844 for other errors.
5847 .It Ic reply
5848 (r) Take a message and group-responds to it by addressing the sender
5849 and all recipients, subject to
5850 .Ic alternates
5851 processing.
5852 .Va followup-to ,
5853 .Va followup-to-honour ,
5854 .Va reply-to-honour
5855 as well as
5856 .Va recipients-in-cc
5857 influence response behaviour.
5858 Unless the internal variable
5859 .Va fullnames
5860 is set recipient addresses will be stripped from comments, names etc.
5862 .Va flipr
5863 is set the commands
5864 .Ic Reply
5866 .Ic reply
5867 are exchanged.
5868 The command
5869 .Ic Lreply
5870 offers special support for replying to mailing lists.
5871 For more documentation please refer to
5872 .Sx "On sending mail, and non-interactive mode" .
5874 This may generate the errors
5875 .Va ^ERR Ns -DESTADDRREQ
5876 if no receiver has been specified,
5877 .Va ^ERR Ns -PERM
5878 if some addressees where rejected by
5879 .Va expandaddr ,
5880 .Va ^ERR Ns -NODATA
5881 if no applicable messages have been given,
5882 .Va ^ERR Ns -IO
5883 if an I/O error occurs,
5884 .Va ^ERR Ns -NOTSUP
5885 if a necessary character set conversion fails, and
5886 .Va ^ERR Ns -INVAL
5887 for other errors.
5888 Any error stops processing of further messages.
5891 .It Ic replyall
5892 Similar to
5893 .Ic reply ,
5894 but initiates a group-reply regardless of the value of
5895 .Va flipr .
5898 .It Ic replysender
5899 Similar to
5900 .Ic Reply ,
5901 but responds to the sender only regardless of the value of
5902 .Va flipr .
5905 .It Ic Resend
5906 Like
5907 .Ic resend ,
5908 but does not add any header lines.
5909 This is not a way to hide the sender's identity,
5910 but useful for sending a message again to the same recipients.
5913 .It Ic resend
5914 Takes a list of messages and a user name
5915 and sends each message to the named user.
5916 .Ql Resent-From:
5917 and related header fields are prepended to the new copy of the message.
5918 Saving in
5919 .Va record
5920 is only performed if
5921 .Va record-resent
5922 is set.
5924 This may generate the errors
5925 .Va ^ERR Ns -DESTADDRREQ
5926 if no receiver has been specified,
5927 .Va ^ERR Ns -PERM
5928 if some addressees where rejected by
5929 .Va expandaddr ,
5930 .Va ^ERR Ns -NODATA
5931 if no applicable messages have been given,
5932 .Va ^ERR Ns -IO
5933 if an I/O error occurs,
5934 .Va ^ERR Ns -NOTSUP
5935 if a necessary character set conversion fails, and
5936 .Va ^ERR Ns -INVAL
5937 for other errors.
5938 Any error stops processing of further messages.
5941 .It Ic Respond
5942 Same as
5943 .Ic Reply .
5946 .It Ic respond
5947 Same as
5948 .Ic reply .
5951 .It Ic respondall
5952 Same as
5953 .Ic replyall .
5956 .It Ic respondsender
5957 Same as
5958 .Ic replysender .
5961 .It Ic retain
5962 (ret) Superseded by the multiplexer
5963 .Ic headerpick .
5966 .It Ic return
5967 Only available inside the scope of a
5968 .Ic define Ns
5969 d macro or an
5970 .Ic account ,
5971 this will stop evaluation of any further macro content, and return
5972 execution control to the caller.
5973 The two optional parameters must be specified as positive decimal
5974 numbers and default to the value 0:
5975 the first argument specifies the signed 32-bit return value (stored in
5976 .Va \&?
5977 \*(ID and later extended to signed 64-bit),
5978 the second the signed 32-bit error number (stored in
5979 .Va \&! ) .
5980 As documented for
5981 .Va \&?
5982 a non-0 exit status may cause the program to exit.
5985 .It Ic Save
5986 (S) Similar to
5987 .Ic save,
5988 but saves the messages in a file named after the local part of the
5989 sender of the first message instead of (in
5990 .Va record
5991 and) taking a filename argument; the variable
5992 .Va outfolder
5993 is inspected to decide on the actual storage location.
5996 .It Ic save
5997 (s) Takes a message list and a filename and appends each message in turn
5998 to the end of the file.
5999 If no filename is given, the
6000 .Mx -sx
6001 .Sx "secondary mailbox"
6002 .Ev MBOX
6003 is used.
6004 The filename in quotes, followed by the generated character count
6005 is echoed on the user's terminal.
6006 If editing a
6007 .Mx -sx
6008 .Sx "primary system mailbox"
6009 the messages are marked for deletion.
6010 .Sx "Filename transformations"
6011 will be applied.
6012 To filter the saved header fields to the desired subset use the
6013 .Ql save
6014 slot of the white- and blacklisting command
6015 .Ic headerpick .
6017 .It Ic savediscard
6018 \*(OB Superseded by the multiplexer
6019 .Ic headerpick .
6021 .It Ic saveignore
6022 \*(OB Superseded by the multiplexer
6023 .Ic headerpick .
6025 .It Ic saveretain
6026 \*(OB Superseded by the multiplexer
6027 .Ic headerpick .
6030 .It Ic search
6031 Takes a message specification (list) and displays a header summary of
6032 all matching messages, as via
6033 .Ic headers .
6034 This command is an alias of
6035 .Ic from .
6036 Also see
6037 .Sx "Specifying messages" .
6040 .It Ic seen
6041 Takes a message list and marks all messages as having been read.
6046 .It Ic set , unset
6047 (se, \*(NQ uns) The latter command will delete all given variables,
6048 the former, when used without arguments, will show all variables which
6049 are currently known to \*(UA.
6050 A more verbose listing will be produced if
6051 either of
6052 .Va debug
6054 .Va verbose
6055 are set.
6056 Remarks: the list mode will not automatically link-in known
6057 .Sx ENVIRONMENT
6058 variables, but only explicit addressing will, e.g., via
6059 .Ic varshow ,
6060 using a variable in an
6061 .Ic if
6062 condition or a string passed to
6063 .Ic echo ,
6064 explicit
6065 .Ic set Ns
6066 ting, as well as some program-internal use cases.
6069 Otherwise the given variables (and arguments) are set or adjusted.
6070 Arguments are of the form
6071 .Ql name=value
6072 (no space before or after
6073 .Ql = ) ,
6074 or plain
6075 .Ql name
6076 if there is no value, i.e., a boolean variable.
6077 \*(ID In conjunction with the
6078 .Cm wysh
6079 command prefix
6080 .Sx "Shell-style argument quoting"
6081 can be used to quote arguments as necessary.
6082 \*(ID Otherwise quotation marks may be placed around any part of the
6083 assignment statement to quote blanks or tabs.
6086 .Dl ? wysh set indentprefix=' -> '
6089 If an argument begins with
6090 .Ql no ,
6091 as in
6092 .Ql set nosave ,
6093 the effect is the same as invoking the
6094 .Ic unset
6095 command with the remaining part of the variable
6096 .Pf ( Ql unset save ) .
6100 .Ql name
6101 that is known to map to an environment variable will automatically cause
6102 updates in the program environment (unsetting a variable in the
6103 environment requires corresponding system support) \(em use the command
6104 .Ic environ
6105 for further environmental control.
6106 Also see
6107 .Ic varedit ,
6108 .Ic varshow
6109 and the sections
6110 .Sx "INTERNAL VARIABLES"
6112 .Sx ENVIRONMENT .
6116 .It Ic shcodec
6117 Apply shell quoting rules to the given raw-data arguments.
6118 Supports
6119 .Cm vput
6120 (see
6121 .Sx "Command modifiers" ) .
6122 The first argument specifies the operation:
6123 .Ar [+]e[ncode]
6125 .Ar d[ecode]
6126 cause shell quoting to be applied to the remains of the line, and
6127 expanded away thereof, respectively.
6128 If the former is prefixed with a plus-sign, the quoted result will not
6129 be roundtrip enabled, and thus can be decoded only in the very same
6130 environment that was used to perform the encode; also see
6131 .Cd mle-quote-rndtrip .
6132 If the coding operation fails the error number
6133 .Va \&!
6134 is set to
6135 .Va ^ERR Ns -CANCELED ,
6136 and the unmodified input is used as the result; the error number may
6137 change again due to output or result storage errors.
6140 .It Ic shell
6141 \*(NQ (sh) Invokes an interactive version of the shell,
6142 and returns its exit status.
6146 .It Ic shortcut , unshortcut
6147 Without arguments the list of all currently defined shortcuts is
6148 shown, with one argument the expansion of the given shortcut.
6149 Otherwise all given arguments are treated as pairs of shortcuts and
6150 their expansions, creating new or changing already existing shortcuts,
6151 as necessary.
6152 The latter command will remove all given shortcuts, the special name
6153 .Ql *
6154 will remove all registered shortcuts.
6157 .It Ic shift
6158 \*(NQ Shift the positional parameter stack (starting at
6159 .Va 1 )
6160 by the given number (which must be a positive decimal),
6161 or 1 if no argument has been given.
6162 It is an error if the value exceeds the number of positional parameters.
6163 If the given number is 0, no action is performed, successfully.
6164 The stack as such can be managed via
6165 .Ic vpospar .
6166 Note this command will fail in
6167 .Ic account
6168 and hook macros unless the positional parameter stack has been
6169 explicitly created in the current context via
6170 .Ic vpospar .
6173 .It Ic show
6174 Like
6175 .Ic type ,
6176 but performs neither MIME decoding nor decryption, so that the raw
6177 message text is shown.
6180 .It Ic size
6181 (si) Shows the size in characters of each message of the given
6182 message-list.
6185 .It Ic sleep
6186 \*(NQ Sleep for the specified number of seconds (and optionally
6187 milliseconds), by default interruptably.
6188 If a third argument is given the sleep will be uninterruptible,
6189 otherwise the error number
6190 .Va \&!
6191 will be set to
6192 .Va ^ERR Ns -INTR
6193 if the sleep has been interrupted.
6194 The command will fail and the error number will be
6195 .Va ^ERR Ns -OVERFLOW
6196 if the given duration(s) overflow the time datatype, and
6197 .Va ^ERR Ns -INVAL
6198 if the given durations are no valid integers.
6203 .It Ic sort , unsort
6204 The latter command disables sorted or threaded mode, returns to normal
6205 message order and, if the
6206 .Va header
6207 variable is set,
6208 displays a header summary.
6209 The former command shows the current sorting criterion when used without
6210 an argument, but creates a sorted representation of the current folder
6211 otherwise, and changes the
6212 .Ic next
6213 command and the addressing modes such that they refer to messages in
6214 the sorted order.
6215 Message numbers are the same as in regular mode.
6216 If the
6217 .Va header
6218 variable is set,
6219 a header summary in the new order is also displayed.
6220 Automatic folder sorting can be enabled by setting the
6221 .Va autosort
6222 variable, as in, e.g.,
6223 .Ql set autosort=thread .
6224 Possible sorting criterions are:
6227 .Bl -tag -compact -width "subject"
6228 .It Ar date
6229 Sort the messages by their
6230 .Ql Date:
6231 field, that is by the time they were sent.
6232 .It Ar from
6233 Sort messages by the value of their
6234 .Ql From:
6235 field, that is by the address of the sender.
6236 If the
6237 .Va showname
6238 variable is set, the sender's real name (if any) is used.
6239 .It Ar size
6240 Sort the messages by their size.
6241 .It spam
6242 \*(OP Sort the message by their spam score, as has been classified by
6243 .Ic spamrate .
6244 .It Ar status
6245 Sort the messages by their message status.
6246 .It Ar subject
6247 Sort the messages by their subject.
6248 .It Ar thread
6249 Create a threaded display.
6250 .It Ar to
6251 Sort messages by the value of their
6252 .Ql To:
6253 field, that is by the address of the recipient.
6254 If the
6255 .Va showname
6256 variable is set, the recipient's real name (if any) is used.
6261 .It Ic source
6262 \*(NQ (so) The source command reads commands from the given file.
6263 .Sx "Filename transformations"
6264 will be applied.
6265 If the given expanded argument ends with a vertical bar
6266 .Ql |
6267 then the argument will instead be interpreted as a shell command and
6268 \*(UA will read the output generated by it.
6269 Interpretation of commands read is stopped when an error is encountered.
6270 \*(ID Note that
6271 .Ic \&\&source
6272 cannot be used from within macros that execute as
6273 .Va folder-hook Ns s
6275 .Ic account Ns s ,
6276 i.e., it can only be called from macros that were
6277 .Ic call Ns ed .
6280 .It Ic source_if
6281 \*(NQ The difference to
6282 .Ic source
6283 (beside not supporting pipe syntax aka shell command input) is that
6284 this command will not generate an error nor warn if the given file
6285 argument cannot be opened successfully.
6288 .It Ic spamclear
6289 \*(OP Takes a list of messages and clears their
6290 .Ql is-spam
6291 flag.
6294 .It Ic spamforget
6295 \*(OP Takes a list of messages and causes the
6296 .Va spam-interface
6297 to forget it has ever used them to train its Bayesian filter.
6298 Unless otherwise noted the
6299 .Ql is-spam
6300 flag of the message is inspected to chose whether a message shall be
6301 forgotten to be
6302 .Dq ham
6304 .Dq spam .
6307 .It Ic spamham
6308 \*(OP Takes a list of messages and informs the Bayesian filter of the
6309 .Va spam-interface
6310 that they are
6311 .Dq ham .
6312 This also clears the
6313 .Ql is-spam
6314 flag of the messages in question.
6317 .It Ic spamrate
6318 \*(OP Takes a list of messages and rates them using the configured
6319 .Va spam-interface ,
6320 without modifying the messages, but setting their
6321 .Ql is-spam
6322 flag as appropriate; because the spam rating headers are lost the rate
6323 will be forgotten once the mailbox is left.
6324 Refer to the manual section
6325 .Sx "Handling spam"
6326 for the complete picture of spam handling in \*(UA.
6329 .It Ic spamset
6330 \*(OP Takes a list of messages and sets their
6331 .Ql is-spam
6332 flag.
6335 .It Ic spamspam
6336 \*(OP Takes a list of messages and informs the Bayesian filter of the
6337 .Va spam-interface
6338 that they are
6339 .Dq spam .
6340 This also sets the
6341 .Ql is-spam
6342 flag of the messages in question.
6344 .It Ic thread
6345 \*(OB The same as
6346 .Ql sort thread
6347 (consider using a
6348 .Ql commandalias
6349 as necessary).
6352 .It Ic Top
6353 Like
6354 .Ic top
6355 but always uses the
6356 .Ic headerpick
6357 .Ql type
6358 slot for white- and blacklisting header fields.
6361 .It Ic top
6362 (to) Takes a message list and types out the first
6363 .Va toplines
6364 lines of each message on the users' terminal.
6365 Unless a special selection has been established for the
6366 .Ql top
6367 slot of the
6368 .Ic headerpick
6369 command, the only header fields that are displayed are
6370 .Ql From: ,
6371 .Ql To: ,
6372 .Ql CC: ,
6374 .Ql Subject: .
6375 .Ic Top
6376 will always use the
6377 .Ql type
6378 .Ic headerpick
6379 selection instead.
6380 It is possible to apply compression to what is displayed by setting
6381 .Va topsqueeze .
6382 Messages are decrypted and converted to the terminal character set
6383 if necessary.
6386 .It Ic touch
6387 (tou) Takes a message list and marks the messages for saving in the
6388 .Mx -sx
6389 .Sx "secondary mailbox"
6390 .Ev MBOX .
6391 \*(UA deviates from the POSIX standard with this command,
6392 as a following
6393 .Ic next
6394 command will display the following message instead of the current one.
6397 .It Ic Type
6398 (T) Like
6399 .Ic type
6400 but also displays header fields which would not pass the
6401 .Ic headerpick
6402 selection, and all visualizable parts of MIME
6403 .Ql multipart/alternative
6404 messages.
6407 .It Ic type
6408 (t) Takes a message list and types out each message on the users terminal.
6409 The display of message headers is selectable via
6410 .Ic headerpick .
6411 For MIME multipart messages, all parts with a content type of
6412 .Ql text ,
6413 all parts which have a registered MIME type handler (see
6414 .Sx "HTML mail and MIME attachments" )
6415 which produces plain text output, and all
6416 .Ql message
6417 parts are shown, others are hidden except for their headers.
6418 Messages are decrypted and converted to the terminal character set
6419 if necessary.
6420 The command
6421 .Ic mimeview
6422 can be used to display parts which are not displayable as plain text.
6424 .It Ic unaccount
6426 .Ic account .
6428 .It Ic unalias
6429 (una) See
6430 .Ic alias .
6432 .It Ic unanswered
6434 .Ic answered .
6436 .It Ic unbind
6438 .Ic bind .
6440 .It Ic uncollapse
6442 .Ic collapse .
6444 .It Ic uncolour
6446 .Ic colour .
6448 .It Ic undefine
6450 .Ic define .
6452 .It Ic undelete
6454 .Ic delete .
6456 .It Ic undraft
6458 .Ic draft .
6460 .It Ic unflag
6462 .Ic flag .
6464 .It Ic unfwdignore
6465 \*(OB Superseded by the multiplexer
6466 .Ic headerpick .
6468 .It Ic unfwdretain
6469 \*(OB Superseded by the multiplexer
6470 .Ic headerpick .
6473 .It Ic unignore
6474 Superseded by the multiplexer
6475 .Ic headerpick .
6477 .It Ic unmimetype
6479 .Ic mimetype .
6481 .It Ic unmlist
6483 .Ic mlist .
6485 .It Ic unmlsubscribe
6487 .Ic mlsubscribe .
6490 .It Ic Unread
6491 Same as
6492 .Ic unread .
6495 .It Ic unread
6496 Takes a message list and marks each message as not having been read.
6499 .It Ic unretain
6500 Superseded by the multiplexer
6501 .Ic headerpick .
6503 .It Ic unsaveignore
6504 \*(OB Superseded by the multiplexer
6505 .Ic headerpick .
6507 .It Ic unsaveretain
6508 \*(OB Superseded by the multiplexer
6509 .Ic headerpick .
6511 .It Ic unset
6512 \*(NQ (uns) See
6513 .Ic set .
6515 .It Ic unshortcut
6517 .Ic shortcut .
6519 .It Ic unsort
6521 .Ic short .
6523 .It Ic unthread
6524 \*(OB
6525 Same as
6526 .Ic unsort .
6529 .It Ic urlcodec
6530 Perform URL percent codec operations on the raw-data argument, rather
6531 according to RFC 3986.
6532 Supports
6533 .Cm vput
6534 (see
6535 .Sx "Command modifiers" ) ,
6536 and manages the error number
6537 .Va \&! .
6538 This is a character set agnostic and thus locale dependent operation,
6539 and it may decode bytes which are invalid in the current
6540 .Va ttycharset .
6541 \*(ID This command does not know about URLs beside that.
6543 The first argument specifies the operation:
6544 .Ar e[ncode]
6546 .Ar d[ecode]
6547 perform plain URL percent en- and decoding, respectively.
6548 .Ar p[ath]enc[ode]
6550 .Ar p[ath]dec[ode]
6551 perform a slightly modified operation which should be better for
6552 pathnames: it does not allow a tilde
6553 .Ql ~ ,
6554 and will neither accept hyphen-minus
6555 .Ql -
6556 nor dot
6557 .Ql .
6558 as an initial character.
6559 The remains of the line form the URL data which is to be converted.
6560 If the coding operation fails the error number
6561 .Va \&!
6562 is set to
6563 .Va ^ERR Ns -CANCELED ,
6564 and the unmodified input is used as the result; the error number may
6565 change again due to output or result storage errors.
6568 .It Ic varedit
6569 \*(NQ Edit the values of or create the given variable(s) in the
6570 .Ev EDITOR .
6571 Boolean variables cannot be edited, and variables can also not be
6572 .Ic unset
6573 with this command.
6576 .It Ic varshow
6577 \*(NQ This command produces the same output as the listing mode of
6578 .Ic set ,
6579 including
6580 .Va verbose Ns
6581 ity adjustments, but only for the given variables.
6584 .It Ic verify
6585 \*(OP Takes a message list and verifies each message.
6586 If a message is not a S/MIME signed message,
6587 verification will fail for it.
6588 The verification process checks if the message was signed using a valid
6589 certificate,
6590 if the message sender's email address matches one of those contained
6591 within the certificate,
6592 and if the message content has been altered.
6595 .It Ic version
6596 Shows the
6597 .Va version
6599 .Va features
6600 of \*(UA.
6604 .It Ic vexpr
6605 \*(NQ Evaluate arguments according to a given operator.
6606 This is a multiplexer command which can be used to perform signed 64-bit
6607 numeric calculations as well as byte string and string operations.
6608 It uses polish notation, i.e., the operator is the first argument and
6609 defines the number and type, and the meaning of the remaining arguments.
6610 An empty argument is replaced with a 0 if a number is expected.
6611 Supports
6612 .Cm vput
6613 (see
6614 .Sx "Command modifiers" ) .
6617 The result that is shown in case of errors is always
6618 .Ql -1
6619 for usage errors and numeric operations, and the empty string for byte
6620 string and string operations;
6621 if the latter two fail to provide result data for
6622 .Dq soft
6623 errors, e.g., when a search operation failed, they also set the
6624 .Va \&!
6625 error number to
6626 .Va ^ERR Ns -NODATA .
6627 Except when otherwise noted numeric arguments are parsed as signed 64-bit
6628 numbers, and errors will be reported in the error number
6629 .Va \&!
6630 as the numeric error
6631 .Va ^ERR Ns -RANGE .
6634 Numeric operations work on one or two signed 64-bit integers.
6635 One integer is expected by assignment (equals sign
6636 .Ql = ) ,
6637 which does nothing but parsing the argument, thus detecting validity and
6638 possible overflow conditions, and unary not (tilde
6639 .Ql ~ ) ,
6640 which creates the bitwise complement.
6641 Two integers are used by addition (plus sign
6642 .Ql + ) ,
6643 subtraction (hyphen-minus
6644 .Ql - ) ,
6645 multiplication (asterisk
6646 .Ql * ) ,
6647 division (solidus
6648 .Ql / )
6649 and modulo (percent sign
6650 .Ql % ) ,
6651 as well as for the bitwise operators logical or (vertical bar
6652 .Ql | ,
6653 to be quoted) ,
6654 bitwise and (ampersand
6655 .Ql \&& ,
6656 to be quoted) ,
6657 bitwise xor (circumflex
6658 .Ql ^ ) ,
6659 the bitwise signed left- and right shifts
6660 .Pf ( Ql << ,
6661 .Ql >> ) ,
6662 as well as for the unsigned right shift
6663 .Ql >>> .
6666 All numeric operators can be suffixed with a commercial at
6667 .Ql @ ,
6668 e.g.,
6669 .Ql *@ :
6670 this will turn the operation into a saturated one, which means that
6671 overflow errors and division and modulo by zero are no longer reported
6672 via the exit status, but the result will linger at the minimum or
6673 maximum possible value, instead of overflowing (or trapping).
6674 This is true also for the argument parse step.
6675 For the bitwise shifts, the saturated maximum is 63.
6676 Any catched overflow will be reported via the error number
6677 .Va \&!
6679 .Va ^ERR Ns -OVERFLOW .
6682 Character set agnostic string functions have no notion of locale
6683 settings and character sets.
6684 There is
6685 .Ql file-expand ,
6686 which performs the usual
6687 .Sx "Filename transformations"
6688 on its argument, and
6689 .Ql random ,
6690 which generates a random string of the given length, or of
6691 .Dv \&\&PATH_MAX
6692 bytes (a constant from
6693 .Pa /usr/include )
6694 if the value 0 is given; the random string will be base64url encoded
6695 according to RFC 4648, and thus be usable as a (portable) filename.
6698 Byte string operations work on 8-bit bytes and have no notion of locale
6699 settings and character sets, effectively assuming ASCII data.
6700 Operations that take one argument are
6701 .Ql length ,
6702 which queries the length of the given argument, and
6703 .Ql hash ,
6704 which calculates the Chris Torek hash of the given argument.
6707 Byte string operations with two or more arguments are
6708 .Ql find ,
6709 which byte-searches in the first for the second argument, and shows the
6710 resulting 0-based offset shall it have been found,
6711 .Ql ifind ,
6712 which is identical to
6713 .Ql find ,
6714 but works case-insensitively according to the rules of the ASCII
6715 character set.
6716 .Ql substring
6717 will show a substring of its first argument:
6718 the second argument is the 0-based starting offset, the optional third
6719 argument can be used to specify the length of the desired substring,
6720 by default the entire string is used;
6721 this operation tries to work around faulty arguments (set
6722 .Va verbose
6723 for error logs), but reports them via the error number
6724 .Va \&!
6726 .Va ^ERR Ns -OVERFLOW .
6729 String operations work, sufficient support provided, according to the
6730 active user's locale encoding and character set (see
6731 .Sx "Character sets" ) .
6732 There is the one argument operation
6733 .Ql makeprint ,
6734 which (one-way) converts the argument to something safely printable on
6735 the terminal.
6738 \*(OP
6739 .Ql regex
6740 is a string operation that will try to match the first argument with the
6741 regular expression given as the second argument, as does
6742 .Ql iregex ,
6743 but which is case-insensitive.
6744 If the optional third argument has been given then instead of showing
6745 the match offset a replacement operation is performed:
6746 the third argument is treated as if specified via dollar-single-quote
6747 (see
6748 .Sx "Shell-style argument quoting" ) ,
6749 and any occurrence of a positional parameter, e.g.,
6750 .Va 1 ,
6751 is replaced by the corresponding match group of the regular expression.
6753 .Bd -literal -offset indent
6754 ? vexpr -@ +1 -9223372036854775808
6755 ? vput vexpr res ir bananarama (.*)NanA(.*) '\e${1}au\e$2'
6756 ? echo $0 $res
6761 .It Ic vpospar
6762 \*(NQ Manage the positional parameter stack (see
6763 .Va 1 , # , * , @
6764 as well as
6765 .Ic shift ) .
6766 If the first argument is
6767 .Ql clear ,
6768 then the positional parameter stack of the current context, or the
6769 global one, if there is none, is cleared.
6770 If it is
6771 .Ql set ,
6772 then the remaining arguments will be used to (re)create the stack,
6773 if the parameter stack size limit is excessed an
6774 .Va ^ERR Ns -OVERFLOW
6775 error will occur.
6778 If the first argument is
6779 .Ql quote ,
6780 a round-trip capable representation of the stack contents is created,
6781 with each quoted parameter separated from each other with the first
6782 character of
6783 .Va ifs ,
6784 and followed by the first character of
6785 .Va if-ws ,
6786 if that is not empty and not identical to the first.
6787 If that results in no separation at all a
6788 .Cm space
6789 character is used.
6790 This mode supports
6791 .Cm vput
6792 (see
6793 .Sx "Command modifiers" ) .
6794 I.e., the subcommands
6795 .Ql set
6797 .Ql quote
6798 can be used (in conjunction with
6799 .Ic eval )
6800 to (re)create an argument stack from and to a single variable losslessly.
6802 .Bd -literal -offset indent
6803 ? vpospar set hey, "'you    ", world!
6804 ? echo $#: <${1}><${2}><${3}>
6805 ? vput vpospar x quote
6806 ? vpospar clear
6807 ? echo $#: <${1}><${2}><${3}>
6808 ? eval vpospar set ${x}
6809 ? echo $#: <${1}><${2}><${3}>
6814 .It Ic visual
6815 (v) Takes a message list and invokes the display editor on each message.
6816 Modified contents are discarded unless the
6817 .Va writebackedited
6818 variable is set, and are not used unless the mailbox can be written to
6819 and the editor returns a successful exit status.
6822 .It Ic write
6823 (w) For conventional messages the body without all headers is written.
6824 The original message is never marked for deletion in the originating
6825 mail folder.
6826 The output is decrypted and converted to its native format as necessary.
6827 If the output file exists, the text is appended.
6828 If a message is in MIME multipart format its first part is written to
6829 the specified file as for conventional messages, handling of the remains
6830 depends on the execution mode.
6831 No special handling of compressed files is performed.
6833 In interactive mode the user is consecutively asked for the filenames of
6834 the processed parts.
6835 For convience saving of each part may be skipped by giving an empty
6836 value, the same result as writing it to
6837 .Pa /dev/null .
6838 Shell piping the part content by specifying a leading vertical bar
6839 .Ql |
6840 character for the filename is supported.
6841 Other user input undergoes the usual
6842 .Sx "Filename transformations" ,
6843 and contents of the destination file are overwritten if the file
6844 previously existed.
6846 \*(ID In non-interactive mode any part which does not specify a filename
6847 is ignored, and suspicious parts of filenames of the remaining parts are
6848 URL percent encoded (as via
6849 .Ic urlcodec )
6850 to prevent injection of malicious character sequences, resulting in
6851 a filename that will be written into the current directory.
6852 Existing files will not be overwritten, instead the part number or
6853 a dot are appended after a number sign
6854 .Ql #
6855 to the name until file creation succeeds (or fails due to other
6856 reasons).
6859 .It Ic xcall
6860 \*(NQ The sole difference to
6861 .Ic call
6862 is that the new macro is executed in place of the current one, which
6863 will not regain control: all resources of the current macro will be
6864 released first.
6865 This implies that any setting covered by
6866 .Ic localopts
6867 will be forgotten and covered variables will become cleaned up.
6868 If this command is not used from within a
6869 .Ic call Ns
6870 ed macro it will silently be (a more expensive variant of)
6871 .Ic call .
6874 .It Ic xit
6875 (x) A synonym for
6876 .Ic exit .
6879 .It Ic z
6880 \*(NQ \*(UA presents message headers in
6881 .Va screen Ns
6882 fuls as described under the
6883 .Ic headers
6884 command.
6885 Without arguments this command scrolls to the next window of messages,
6886 likewise if the argument is
6887 .Ql + .
6888 An argument of
6889 .Ql -
6890 scrolls to the last,
6891 .Ql ^
6892 scrolls to the first, and
6893 .Ql $
6894 to the last
6895 .Va \&\&screen
6896 of messages.
6897 A number argument prefixed by
6898 .Ql +
6900 .Ql \-
6901 indicates that the window is calculated in relation to the current
6902 position, and a number without a prefix specifies an absolute position.
6905 .It Ic Z
6906 \*(NQ Similar to
6907 .Ic z ,
6908 but scrolls to the next or previous window that contains at least one
6909 .Ql new
6911 .Ic flag Ns
6912 ged message.
6914 .\" }}}
6916 .\" }}}
6919 .\" .Sh COMMAND ESCAPES {{{
6920 .Sh "COMMAND ESCAPES"
6922 Here is a summary of the command escapes available in compose mode,
6923 which are used to perform special functions when composing messages.
6924 Command escapes are only recognized at the beginning of lines, and
6925 consist of a trigger (escape) and a command character.
6926 The actual escape character can be set via the internal variable
6927 .Va escape ,
6928 it defaults to the tilde
6929 .Ql ~ .
6930 Otherwise ignored whitespace characters following the escape character
6931 will prevent a possible addition of the command line to the \*(OPal
6932 history.
6935 Unless otherwise noted all compose mode command escapes ensure proper
6936 updates of the variables which represent the error number
6937 .Va \&!
6938 and the exit status
6939 .Va \&? .
6940 If the variable
6941 .Va errexit
6942 is set they will, unless stated otherwise, error out message compose
6943 mode if an operation fails.
6944 It is however possible to place the character hyphen-minus
6945 .Ql -
6946 after (possible whitespace following) the escape character, which has an
6947 effect equivalent to the command modifier
6948 .Cm ignerr .
6949 If the \*(OPal key bindings are available it is possible to create
6950 .Ic bind Ns
6951 ings specifically for the compose mode.
6954 .Bl -tag -width ".It Ic BaNg"
6956 .It Ic ~~ Ar string
6957 Insert the string of text in the message prefaced by a single
6958 .Ql ~ .
6959 (If the escape character has been changed,
6960 that character must be doubled instead.)
6963 .It Ic ~! Ar command
6964 Execute the indicated shell
6965 .Ar command
6966 which follows, replacing unescaped exclamation marks with the previously
6967 executed command if the internal variable
6968 .Va bang
6969 is set, then return to the message.
6972 .It Ic ~.
6973 Same effect as typing the end-of-file character.
6976 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
6977 Execute the given \*(UA command.
6978 Not all commands, however, are allowed.
6981 .It Ic ~?
6982 Write a summary of command escapes.
6985 .It Ic ~< Ar filename
6986 Identical to
6987 .Ic ~r .
6990 .It Ic ~<! Ar command
6991 .Ar command
6992 is executed using the shell.
6993 Its standard output is inserted into the message.
6996 .It Ic ~@ Op Ar filename...
6997 Append or edit the list of attachments.
6998 Does not manage the error number
6999 .Va \&!
7000 and the exit status
7001 .Va \&? ,
7002 (please use
7003 .Ic ~^
7004 instead if this is a concern).
7005 A list of
7006 .Ar filename
7007 arguments is expected as shell tokens (see
7008 .Sx "Shell-style argument quoting" ;
7009 token-separating commas are ignored, too), to be
7010 interpreted as documented for the command line option
7011 .Fl a ,
7012 with the message number exception as below.
7014 Without
7015 .Ar filename
7016 arguments the attachment list is edited, entry by entry;
7017 if a filename is left empty, that attachment is deleted from the list;
7018 once the end of the list is reached either new attachments may be
7019 entered or the session can be quit by committing an empty
7020 .Dq new
7021 attachment.
7023 For all mode, if a given filename solely consists of the number sign
7024 .Ql #
7025 followed by a valid message number of the currently active mailbox, then
7026 the given message is attached as a
7027 .Ql message/rfc822
7028 MIME message part.
7029 As the shell comment character the number sign must be quoted.
7032 .It Ic ~A
7033 Inserts the string contained in the
7034 .Va Sign
7035 variable (same as
7036 .Ql Ic ~i Ns \0Sign ) .
7037 \*(OB The escape sequences tabulator
7038 .Ql \et
7039 and newline
7040 .Ql \en
7041 are understood (use the
7042 .Cm wysh
7043 prefix when
7044 .Ic set Ns
7045 ting the variable(s) instead).
7048 .It Ic ~a
7049 Inserts the string contained in the
7050 .Va sign
7051 variable (same as
7052 .Ql Ic ~i Ns \0sign ) .
7053 \*(OB The escape sequences tabulator
7054 .Ql \et
7055 and newline
7056 .Ql \en
7057 are understood (use the
7058 .Cm wysh
7059 prefix when
7060 .Ic set Ns
7061 ting the variable(s) instead).
7064 .It Ic ~b Ar name ...
7065 Add the given names to the list of blind carbon copy recipients.
7068 .It Ic ~c Ar name ...
7069 Add the given names to the list of carbon copy recipients.
7072 .It Ic ~d
7073 Read the file specified by the
7074 .Ev DEAD
7075 variable into the message.
7078 .It Ic ~e
7079 Invoke the text editor on the message collected so far.
7080 After the editing session is finished,
7081 the user may continue appending text to the message.
7084 .It Ic ~F Ar messages
7085 Read the named messages into the message being sent, including all
7086 message headers and MIME parts.
7087 If no messages are specified, read in the current message, the
7088 .Dq dot .
7091 .It Ic ~f Ar messages
7092 Read the named messages into the message being sent.
7093 If no messages are specified, read in the current message, the
7094 .Dq dot .
7095 Strips down the list of header fields according to the
7096 .Ql type
7097 white- and blacklist selection of
7098 .Ic headerpick .
7099 For MIME multipart messages,
7100 only the first displayable part is included.
7103 .It Ic ~H
7104 Edit the message header fields
7105 .Ql From: ,
7106 .Ql Reply-To:
7108 .Ql Sender:
7109 by typing each one in turn and allowing the user to edit the field.
7110 The default values for these fields originate from the
7111 .Va from , reply-to
7113 .Va sender
7114 variables.
7117 .It Ic ~h
7118 Edit the message header fields
7119 .Ql To: ,
7120 .Ql Cc: ,
7121 .Ql Bcc:
7123 .Ql Subject:
7124 by typing each one in turn and allowing the user to edit the field.
7127 .It Ic ~I Ar variable
7128 Insert the value of the specified variable into the message.
7129 The message remains unaltered if the variable is unset or empty.
7130 \*(OB The escape sequences tabulator
7131 .Ql \et
7132 and newline
7133 .Ql \en
7134 are understood (use the
7135 .Cm wysh
7136 prefix when
7137 .Ic set Ns
7138 ting the variable(s) instead).
7141 .It Ic ~i Ar variable
7142 Identical to
7143 .Ic ~I ,
7144 but adds a newline character at the end of a successful insertion.
7147 .It Ic ~M Ar messages
7148 Read the named messages into the message being sent,
7149 indented by
7150 .Va indentprefix .
7151 If no messages are specified, read the current message, the
7152 .Dq dot .
7155 .It Ic ~m Ar messages
7156 Read the named messages into the message being sent,
7157 indented by
7158 .Va indentprefix .
7159 If no messages are specified, read the current message, the
7160 .Dq dot .
7161 Strips down the list of header fields according to the
7162 .Ql type
7163 white- and blacklist selection of
7164 .Ic headerpick .
7165 For MIME multipart messages,
7166 only the first displayable part is included.
7169 .It Ic ~p
7170 Display the message collected so far,
7171 prefaced by the message header fields
7172 and followed by the attachment list, if any.
7175 .It Ic ~q
7176 Abort the message being sent,
7177 copying it to the file specified by the
7178 .Ev DEAD
7179 variable if
7180 .Va save
7181 is set.
7184 .It Ic ~R Ar filename
7185 Identical to
7186 .Ic ~r ,
7187 but indent each line that has been read by
7188 .Va indentprefix .
7191 .It Ic ~r Ar filename Op Ar HERE-delimiter
7192 Read the named file, object to the usual
7193 .Sx "Filename transformations" ,
7194 into the message; if (the expanded)
7195 .Ar filename
7196 is the hyphen-minus
7197 .Ql -
7198 then standard input is used, e.g., for pasting purposes.
7199 Only in this latter mode
7200 .Ar HERE-delimiter
7201 may be given: if it is data will be read in until the given
7202 .Ar HERE-delimiter
7203 is seen on a line by itself, and encountering EOF is an error; the
7204 .Ar HERE-delimiter
7205 is a required argument in non-interactive mode; if it is single-quote
7206 quoted then the pasted content will not be expanded, \*(ID otherwise
7207 a future version of \*(UA may perform shell-style expansion on the content.
7210 .It Ic ~s Ar string
7211 Cause the named string to become the current subject field.
7212 Newline (NL) and carriage-return (CR) bytes are invalid and will be
7213 normalized to space (SP) characters.
7216 .It Ic ~t Ar name ...
7217 Add the given name(s) to the direct recipient list.
7220 .It Ic ~U Ar messages
7221 Read in the given / current message(s) excluding all headers, indented by
7222 .Va indentprefix .
7225 .It Ic ~u Ar messages
7226 Read in the given / current message(s), excluding all headers.
7229 .It Ic ~v
7230 Invoke an alternate editor (defined by the
7231 .Ev VISUAL
7232 environment variable) on the message collected so far.
7233 Usually, the alternate editor will be a screen editor.
7234 After the editor is quit,
7235 the user may resume appending text to the end of the message.
7238 .It Ic ~w Ar filename
7239 Write the message onto the named file, which is object to the usual
7240 .Sx "Filename transformations" .
7241 If the file exists,
7242 the message is appended to it.
7245 .It Ic ~x
7246 Same as
7247 .Ic ~q ,
7248 except that the message is not saved at all.
7251 .It Ic ~| Ar command
7252 Pipe the message through the specified filter command.
7253 If the command gives no output or terminates abnormally,
7254 retain the original text of the message.
7255 E.g., the command
7256 .Xr fmt 1
7257 is often used as a rejustifying filter.
7261 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7262 Low-level command meant for scripted message access, i.e., for
7263 .Va on-compose-splice
7265 .Va on-compose-splice-shell .
7266 The used protocol is likely subject to changes, and therefore the
7267 mentioned hooks receive the used protocol version as an initial line.
7268 In general the first field of a response line represents a status code
7269 which specifies whether a command was successful or not, whether result
7270 data is to be expected, and if, the format of the result data.
7271 Does not manage the error number
7272 .Va \&!
7273 and the exit status
7274 .Va \&? ,
7275 because errors are reported via the protocol
7276 (hard errors like I/O failures cannot be handled).
7277 This command has read-only access to several virtual pseudo headers in
7278 the \*(UA private namespace, which may not exist (except for the first):
7282 .Bl -tag -compact -width ".It Va BaNg"
7283 .It Ql Mailx-Command:
7284 The name of the command that generates the message, one of
7285 .Ql forward ,
7286 .Ql Lreply ,
7287 .Ql mail ,
7288 .Ql Reply ,
7289 .Ql reply ,
7290 .Ql resend .
7292 .It Ql Mailx-Raw-To:
7293 .It Ql Mailx-Raw-Cc:
7294 .It Ql Mailx-Raw-Bcc:
7295 Represent the frozen initial state of these headers before any
7296 transformation (e.g.,
7297 .Ic alias ,
7298 .Ic alternates ,
7299 .Va recipients-in-cc
7300 etc.) took place.
7302 .It Ql Mailx-Orig-From:
7303 .It Ql Mailx-Orig-To:
7304 .It Ql Mailx-Orig-Cc:
7305 .It Ql Mailx-Orig-Bcc:
7306 The values of said headers of the original message which has been
7307 addressed by any of
7308 .Ic reply , forward , resend .
7312 The status codes are:
7316 .Bl -tag -compact -width ".It Ql 210"
7317 .It Ql 210
7318 Status ok; the remains of the line are the result.
7320 .It Ql 211
7321 Status ok; the rest of the line is optionally used for more status.
7322 What follows are lines of result addresses, terminated by an empty line.
7323 The address lines consist of two fields, the first of which is the
7324 plain address, e.g.,
7325 .Ql bob@exam.ple ,
7326 separated by a single ASCII SP space from the second which contains the
7327 unstripped address, even if that is identical to the first field, e.g.,
7328 .Ql (Lovely) Bob <bob@exam.ple> .
7329 All the input, including the empty line, must be consumed before further
7330 commands can be issued.
7332 .It Ql 212
7333 Status ok; the rest of the line is optionally used for more status.
7334 What follows are lines of furtherly unspecified string content,
7335 terminated by an empty line.
7336 All the input, including the empty line, must be consumed before further
7337 commands can be issued.
7339 .It Ql 500
7340 Syntax error; invalid command.
7342 .It Ql 501
7343 Syntax error in parameters or arguments.
7345 .It Ql 505
7346 Error: an argument fails verification.
7347 For example an invalid address has been specified, or an attempt was
7348 made to modify anything in \*(UA's own namespace.
7350 .It Ql 506
7351 Error: an otherwise valid argument is rendered invalid due to context.
7352 For example, a second address is added to a header which may consist of
7353 a single address only.
7358 If a command indicates failure then the message will have remained
7359 unmodified.
7360 Most commands can fail with
7361 .Ql 500
7362 if required arguments are missing (false command usage).
7363 The following (case-insensitive) commands are supported:
7366 .Bl -hang -width ".It Cm header"
7367 .It Cm header
7368 This command allows listing, inspection, and editing of message headers.
7369 Header name case is not normalized, and case-insensitive comparison
7370 should be used when matching names.
7371 The second argument specifies the subcommand to apply, one of:
7373 .Bl -hang -width ".It Cm remove"
7374 .It Cm list
7375 Without a third argument a list of all yet existing headers is given via
7376 .Ql 210 ;
7377 this command is the default command of
7378 .Cm header
7379 if no second argument has been given.
7380 A third argument restricts output to the given header only, which may
7381 fail with
7382 .Ql 501
7383 if no such field is defined.
7385 .It Cm show
7386 Shows the content of the header given as the third argument.
7387 Dependent on the header type this may respond with
7388 .Ql 211
7390 .Ql 212 ;
7391 any failure results in
7392 .Ql 501 .
7394 .It Cm remove
7395 This will remove all instances of the header given as the third
7396 argument, reporting
7397 .Ql 210
7398 upon success,
7399 .Ql 501
7400 if no such header can be found, and
7401 Ql 505
7402 on \*(UA namespace violations.
7404 .It Cm remove-at
7405 This will remove from the header given as the third argument the
7406 instance at the list position (counting from one!) given with the fourth
7407 argument, reporting
7408 .Ql 210
7409 upon success or
7410 .Ql 505
7411 if the list position argument is not a number or on \*(UA namespace
7412 violations, and
7413 .Ql 501
7414 if no such header instance exists.
7416 .It Cm insert
7417 Create a new or an additional instance of the header given in the third
7418 argument, with the header body content as given in the fourth argument
7419 (the remains of the line).
7420 It may return
7421 .Ql 501
7422 if the third argument specifies a free-form header field name that is
7423 invalid, or if body content extraction fails to succeed,
7424 .Ql 505
7425 if any extracted address does not pass syntax and/or security checks or
7426 on \*(UA namespace violations, and
7427 .Ql 506
7428 to indicate prevention of excessing a single-instance header \(em note that
7429 .Ql Subject:
7430 can be appended to (a space separator will be added automatically first).
7432 .Ql 210
7433 is returned upon success, followed by the name of the header and the list
7434 position of the newly inserted instance.
7435 The list position is always 1 for single-instance header fields.
7436 All free-form header fields are managed in a single list.
7440 .It Cm attachment
7441 This command allows listing, removal and addition of message attachments.
7442 The second argument specifies the subcommand to apply, one of:
7444 .Bl -hang -width ".It Cm remove"
7445 .It Cm list
7446 List all attachments via
7447 .Ql 212 ,
7448 or report
7449 .Ql 501
7450 if no attachments exist.
7451 This command is the default command of
7452 .Cm attachment
7453 if no second argument has been given.
7455 .It Cm remove
7456 This will remove the attachment given as the third argument, and report
7457 .Ql 210
7458 upon success or
7459 .Ql 501
7460 if no such attachment can be found.
7461 If there exists any path component in the given argument, then an exact
7462 match of the path which has been used to create the attachment is used
7463 directly, but if only the basename of that path matches then all
7464 attachments are traversed to find an exact match first, and the removal
7465 occurs afterwards; if multiple basenames match, a
7466 .Ql 506
7467 error occurs.
7468 Message attachments are treated as absolute pathnames.
7470 If no path component exists in the given argument, then all attachments
7471 will be searched for
7472 .Ql filename=
7473 parameter matches as well as for matches of the basename of the path
7474 which has been used when the attachment has been created; multiple
7475 matches result in a
7476 .Ql 506 .
7478 .It Cm remove-at
7479 This will interpret the third argument as a number and remove the
7480 attachment at that list position (counting from one!), reporting
7481 .Ql 210
7482 upon success or
7483 .Ql 505
7484 if the argument is not a number or
7485 .Ql 501
7486 if no such attachment exists.
7488 .It Cm insert
7489 Adds the attachment given as the third argument, specified exactly as
7490 documented for the command line option
7491 .Fl a ,
7492 and supporting the message number extension as documented for
7493 .Ic ~@ .
7494 This reports
7495 .Ql 210
7496 upon success, with the index of the new attachment following,
7497 .Ql 505
7498 if the given file cannot be opened,
7499 .Ql 506
7500 if an on-the-fly performed character set conversion fails, otherwise
7501 .Ql 501
7502 is reported; this is also reported if character set conversion is
7503 requested but not available.
7505 .It Cm attribute
7506 This uses the same search mechanism as described for
7507 .Cm remove
7508 and prints any known attributes of the first found attachment via
7509 .Ql 212
7510 upon success or
7511 .Ql 501
7512 if no such attachment can be found.
7513 The attributes are written as lines of keyword and value tuples, the
7514 keyword being separated from the rest of the line with an ASCII SP space
7515 character.
7517 .It Cm attribute-at
7518 This uses the same search mechanism as described for
7519 .Cm remove-at
7520 and is otherwise identical to
7521 .Cm attribute .
7523 .It Cm attribute-set
7524 This uses the same search mechanism as described for
7525 .Cm remove ,
7526 and will assign the attribute given as the fourth argument, which is
7527 expected to be a value tuple of keyword and other data, separated by
7528 a ASCII SP space or TAB tabulator character.
7529 If the value part is empty, then the given attribute is removed, or
7530 reset to a default value if existence of the attribute is crucial.
7532 It returns via
7533 .Ql 210
7534 upon success, with the index of the found attachment following,
7535 .Ql 505
7536 for message attachments or if the given keyword is invalid, and
7537 .Ql 501
7538 if no such attachment can be found.
7539 The following keywords may be used (case-insensitively):
7541 .Bl -hang -compact -width ".It Ql filename"
7542 .It Ql filename
7543 Sets the filename of the MIME part, i.e., the name that is used for
7544 display and when (suggesting a name for) saving (purposes).
7545 .It Ql content-description
7546 Associate some descriptive information to the attachment's content, used
7547 in favour of the plain filename by some MUAs.
7548 .It Ql content-id
7549 May be used for uniquely identifying MIME entities in several contexts;
7550 this expects a special reference address format as defined in RFC 2045
7551 and generates a
7552 .Ql 505
7553 upon address content verification failure.
7554 .It Ql content-type
7555 Defines the media type/subtype of the part, which is managed
7556 automatically, but can be overwritten.
7557 .It Ql content-disposition
7558 Automatically set to the string
7559 .Ql attachment .
7562 .It Cm attribute-set-at
7563 This uses the same search mechanism as described for
7564 .Cm remove-at
7565 and is otherwise identical to
7566 .Cm attribute-set .
7573 .\" }}}
7576 .\" .Sh INTERNAL VARIABLES {{{
7577 .Sh "INTERNAL VARIABLES"
7579 Internal \*(UA variables are controlled via the
7580 .Ic set
7582 .Ic unset
7583 commands; prefixing a variable name with the string
7584 .Ql no
7585 and calling
7586 .Ic set
7587 has the same effect as using
7588 .Ic unset :
7589 .Ql unset crt
7591 .Ql set nocrt
7592 do the same thing.
7593 Creation or editing of variables can be performed in the
7594 .Ev EDITOR
7595 with the command
7596 .Ic varedit .
7597 .Ic varshow
7598 will give more insight on the given variable(s), and
7599 .Ic set ,
7600 when called without arguments, will show a listing of all variables.
7601 Both commands support a more
7602 .Va verbose
7603 listing mode.
7604 Some well-known variables will also become inherited from the
7605 program
7606 .Sx ENVIRONMENT
7607 implicitly, others can be imported explicitly with the command
7608 .Ic environ
7609 and henceforth share said properties.
7612 Two different kinds of internal variables exist.
7613 There are boolean variables, which can only be in one of the two states
7614 .Dq set
7616 .Dq unset ,
7617 and value variables with a(n optional) string value.
7618 For the latter proper quoting is necessary upon assignment time, the
7619 introduction of the section
7620 .Sx COMMANDS
7621 documents the supported quoting rules.
7623 .Bd -literal -offset indent
7624 ? wysh set one=val\e 1 two="val 2" \e
7625     three='val "3"' four=$'val \e'4\e''; \e
7626     varshow one two three four; \e
7627     unset one two three four
7631 Dependent upon the actual option the string values will be interpreted
7632 as numbers, colour names, normal text etc., but there also exists
7633 a special kind of string value, the
7634 .Dq boolean string ,
7635 which must either be a decimal integer (in which case
7636 .Ql 0
7637 is false and
7638 .Ql 1
7639 and any other value is true) or any of the (case-insensitive) strings
7640 .Ql off ,
7641 .Ql no ,
7642 .Ql n
7644 .Ql false
7645 for a false boolean and
7646 .Ql on ,
7647 .Ql yes ,
7648 .Ql y
7650 .Ql true
7651 for a true boolean; a special kind of boolean string is the
7652 .Dq quadoption ,
7653 which is a boolean string that can optionally be prefixed with the
7654 (case-insensitive) term
7655 .Ql ask- ,
7656 as in
7657 .Ql ask-yes ,
7658 which causes prompting of the user in interactive mode, with the given
7659 boolean as the default value.
7661 .\" .Ss "Initial settings" {{{
7662 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
7663 .Ss "Initial settings"
7665 The standard POSIX 2008/Cor 2-2016 mandates the following initial
7666 variable settings:
7667 .Pf no Va allnet ,
7668 .Pf no Va append ,
7669 .Va asksub ,
7670 .Pf no Va askbcc ,
7671 .Pf no Va autoprint ,
7672 .Pf no Va bang ,
7673 .Pf no Va cmd ,
7674 .Pf no Va crt ,
7675 .Pf no Va debug ,
7676 .Pf no Va dot ,
7677 .Va escape
7678 set to
7679 .Ql ~ ,
7680 .Pf no Va flipr ,
7681 .Pf no Va folder ,
7682 .Va header ,
7683 .Pf no Va hold ,
7684 .Pf no Va ignore ,
7685 .Pf no Va ignoreeof ,
7686 .Pf no Va keep ,
7687 .Pf no Va keepsave ,
7688 .Pf no Va metoo ,
7689 .Pf no Va outfolder ,
7690 .Pf no Va page ,
7691 .Va prompt
7692 set to
7693 .Ql ?\0 ,
7694 .Pf no Va quiet ,
7695 .Pf no Va record ,
7696 .Va save ,
7697 .Pf no Va sendwait ,
7698 .Pf no Va showto ,
7699 .Pf no Va Sign ,
7700 .Pf no Va sign ,
7701 .Va toplines
7702 set to
7703 .Ql 5 .
7706 Notes: \*(UA does not support the
7707 .Pf no Va onehop
7708 variable \(en use command line options or
7709 .Va mta-arguments
7710 to pass options through to a
7711 .Va mta .
7712 And the default global
7713 .Pa \*(UR
7714 file, which is loaded unless the
7715 .Fl \&:
7716 (with according argument) or
7717 .Fl n
7718 command line options have been used, or the
7719 .Ev MAILX_NO_SYSTEM_RC
7720 environment variable is set (see
7721 .Sx "Resource files" )
7722 bends those initial settings a bit, e.g., it sets the variables
7723 .Va hold ,
7724 .Va keepsave
7726 .Va keep ,
7727 to name a few, establishes a default
7728 .Ic headerpick
7729 selection etc., and should thus be taken into account.
7730 .\" }}}
7732 .\" .Ss "Variables" {{{
7733 .Ss "Variables"
7735 .Bl -tag -width ".It Va BaNg"
7738 .It Va \&?
7739 \*(RO The exit status of the last command, or the
7740 .Ic return
7741 value of the macro
7742 .Ic call Ns
7743 ed last.
7744 This status has a meaning in the state machine: in conjunction with
7745 .Va errexit
7746 any non-0 exit status will cause a program exit, and in
7747 .Ev POSIXLY_CORRECT
7748 mode any error while loading (any of the) resource files will have the
7749 same effect.
7750 .Cm ignerr ,
7751 one of the
7752 .Sx "Command modifiers" ,
7753 can be used to instruct the state machine to ignore errors.
7756 .It Va \&!
7757 \*(RO The current error number
7758 .Pf ( Xr errno 3 ) ,
7759 which is set after an error occurred; it is also available via
7760 .Va ^ERR ,
7761 and the error name and documentation string can be queried via
7762 .Va ^ERRNAME
7764 .Va ^ERRDOC .
7765 \*(ID This machinery is new and the error number is only really usable
7766 if a command explicitly states that it manages the variable
7767 .Va \&! ,
7768 for others errno will be used in case of errors, or
7769 .Va ^ERR Ns -INVAL
7770 if that is 0: it thus may or may not reflect the real error.
7771 The error number may be set with the command
7772 .Ic return .
7776 .It Va ^
7777 \*(RO This is a multiplexer variable which performs dynamic expansion of
7778 the requested state or condition, of which there are:
7781 .Bl -tag -compact -width ".It Va BaNg"
7785 .It Va ^ERR , ^ERRDOC , ^ERRNAME
7786 The number, documentation, and name of the current
7787 .Xr errno 3 ,
7788 respectively, which is usually set after an error occurred.
7789 \*(ID This machinery is new and is usually reliable only if a command
7790 explicitly states that it manages the variable
7791 .Va \&! ,
7792 which is effectively identical to
7793 .Va \&\&^ERR .
7794 Each of those variables can be suffixed with a hyphen minus followed by
7795 a name or number, in which case the expansion refers to the given error.
7796 Note this is a direct mapping of (a subset of) the system error values:
7797 .Bd -literal -offset indent
7798 define work {
7799   eval echo \e$1: \e$^ERR-$1: \e$^ERRNAME-$1: \e$^ERRDOC-$1
7800   vput vexpr i + "$1" 1
7801   if [ $i -lt 16 ]
7802     \excall work $i
7803   end
7805 call work 0
7811 .It Va *
7812 \*(RO Expands all positional parameters (see
7813 .Va 1 ) ,
7814 separated by a space character.
7815 \*(ID The special semantics of the equally named special parameter of the
7816 .Xr sh 1
7817 are not yet supported.
7820 .It Va @
7821 \*(RO Expands all positional parameters (see
7822 .Va 1 ) ,
7823 separated by a space character.
7824 If placed in double quotation marks, each positional parameter is
7825 properly quoted to expand to a single parameter again.
7828 .It Va #
7829 \*(RO Expands to the number of positional parameters, i.e., the size of
7830 the positional parameter stack in decimal.
7833 .It Va \&0
7834 \*(RO Inside the scope of a
7835 .Ic define Ns
7836 d and
7837 .Ic call Ns
7838 ed macro this expands to the name of the calling macro, or to the empty
7839 string if the macro is running from top-level.
7840 For the \*(OPal regular expression search and replace operator of
7841 .Ic vexpr
7842 this expands to the entire matching expression.
7843 It represents the program name in global context.
7846 .It Va 1
7847 \*(RO Access of the positional parameter stack.
7848 All further parameters can be accessed with this syntax, too, e.g.,
7849 .Ql 2 ,
7850 .Ql 3
7851 etc.; positional parameters can be shifted off the stack by calling
7852 .Ic shift .
7853 The parameter stack contains, e.g., the arguments of a
7854 .Ic call Ns
7856 .Ic define Ns
7857 d macro, the matching groups of the \*(OPal regular expression search
7858 and replace expression of
7859 .Ic vexpr ,
7860 and can be explicitly created or overwritten with the command
7861 .Ic vpospar .
7864 .It Va account
7865 \*(RO Is set to the active
7866 .Ic account .
7869 .It Va add-file-recipients
7870 \*(BO When file or pipe recipients have been specified,
7871 mention them in the corresponding address fields of the message instead
7872 of silently stripping them from their recipient list.
7873 By default such addressees are not mentioned.
7876 .It Va allnet
7877 \*(BO Causes only the local part to be evaluated
7878 when comparing addresses.
7881 .It Va append
7882 \*(BO Causes messages saved in the
7883 .Mx -sx
7884 .Sx "secondary mailbox"
7885 .Ev MBOX
7886 to be appended to the end rather than prepended.
7887 This should always be set.
7890 .It Va ask
7891 \*(BO Causes \*(UA to prompt for the subject of each message sent.
7892 If the user responds with simply a newline,
7893 no subject field will be sent.
7896 .It Va askatend
7897 \*(BO Causes the prompts for
7898 .Ql Cc:
7900 .Ql Bcc:
7901 lists to appear after the message has been edited.
7904 .It Va askattach
7905 \*(BO If set, \*(UA asks for files to attach at the end of each message,
7906 shall the list be found empty at that time.
7907 An empty line finalizes the list.
7910 .It Va askcc
7911 \*(BO Causes the user to be prompted for carbon copy recipients
7912 (at the end of each message if
7913 .Va askatend
7915 .Va bsdcompat
7916 are set) shall the list be found empty (at that time).
7917 An empty line finalizes the list.
7920 .It Va askbcc
7921 \*(BO Causes the user to be prompted for blind carbon copy
7922 recipients (at the end of each message if
7923 .Va askatend
7925 .Va bsdcompat
7926 are set) shall the list be found empty (at that time).
7927 An empty line finalizes the list.
7930 .It Va asksign
7931 \*(BO\*(OP Causes the user to be prompted if the message is to be
7932 signed at the end of each message.
7934 .Va smime-sign
7935 variable is ignored when this variable is set.
7938 .It Va asksub
7939 \*(BO Alternative name for
7940 .Va ask .
7943 .It Va attrlist
7944 A sequence of characters to display in the
7945 .Ql attribute
7946 column of the
7947 .Va headline
7948 as shown in the display of
7949 .Ic headers ;
7950 each for one type of messages (see
7951 .Sx "Message states" ) ,
7952 with the default being
7953 .Ql NUROSPMFAT+\-$~
7955 .Ql NU\ \ *HMFAT+\-$~
7956 if the
7957 .Va bsdflags
7958 variable is set, in the following order:
7960 .Bl -tag -compact -width ".It Ql _"
7961 .It Ql N
7962 new.
7963 .It Ql U
7964 unread but old.
7965 .It Ql R
7966 new but read.
7967 .It Ql O
7968 read and old.
7969 .It Ql S
7970 saved.
7971 .It Ql P
7972 preserved.
7973 .It Ql M
7974 mboxed.
7975 .It Ql F
7976 flagged.
7977 .It Ql A
7978 answered.
7979 .It Ql T
7980 draft.
7981 .It Ql +
7982 start of a collapsed thread.
7983 .It Ql -
7984 an uncollapsed thread (TODO ignored for now).
7985 .It Ql $
7986 classified as spam.
7987 .It Ql ~
7988 classified as possible spam.
7993 .It Va autobcc
7994 Specifies a list of recipients to which a blind carbon copy of each
7995 outgoing message will be sent automatically.
7998 .It Va autocc
7999 Specifies a list of recipients to which a carbon copy of each outgoing
8000 message will be sent automatically.
8003 .It Va autocollapse
8004 \*(BO Causes threads to be collapsed automatically when threaded mode
8005 is entered (see the
8006 .Ic collapse
8007 command).
8010 .It Va autoprint
8011 \*(BO Enable automatic
8012 .Ic type Ns
8013 ing of a(n existing)
8014 .Dq successive
8015 message after
8016 .Ic delete
8018 .Ic undelete
8019 commands, e.g., the message that becomes the new
8020 .Dq dot
8021 is shown automatically, as via
8022 .Ic dp
8024 .Ic dt .
8027 .It Va autosort
8028 Causes sorted mode (see the
8029 .Ic sort
8030 command) to be entered automatically with the value of this variable as
8031 sorting method when a folder is opened, e.g.,
8032 .Ql set autosort=thread .
8035 .It Va bang
8036 \*(BO Enables the substitution of all not (reverse-solidus) escaped
8037 exclamation mark
8038 .Ql \&!
8039 characters by the contents of the last executed command for the
8040 .Ic \&!
8041 shell escape command and
8042 .Ic ~! ,
8043 one of the compose mode
8044 .Sx "COMMAND ESCAPES" .
8045 If this variable is not set no reverse solidus stripping is performed.
8048 .It Va bind-timeout
8049 \*(OP Terminals generate multi-byte sequences for certain forms of
8050 input, for example for function and other special keys.
8051 Some terminals however do not write these multi-byte sequences as
8052 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
8053 This variable specifies the timeout in milliseconds that the MLE (see
8054 .Sx "On terminal control and line editor" )
8055 waits for more bytes to arrive unless it considers a sequence
8056 .Dq complete .
8057 The default is 200.
8060 .It Va bsdcompat
8061 \*(BO Sets some cosmetical features to traditional BSD style;
8062 has the same affect as setting
8063 .Va askatend
8064 and all other variables prefixed with
8065 .Ql bsd ;
8066 it also changes the behaviour of
8067 .Va emptystart
8068 (which does not exist in BSD).
8071 .It Va bsdflags
8072 \*(BO Changes the letters shown in the first column of a header
8073 summary to traditional BSD style.
8076 .It Va bsdheadline
8077 \*(BO Changes the display of columns in a header summary to traditional
8078 BSD style.
8081 .It Va bsdmsgs
8082 \*(BO Changes some informational messages to traditional BSD style.
8085 .It Va bsdorder
8086 \*(BO Causes the
8087 .Ql Subject:
8088 field to appear immediately after the
8089 .Ql To:
8090 field in message headers and with the
8091 .Ic ~h
8092 .Sx "COMMAND ESCAPES" .
8096 .It Va build-os , build-osenv
8097 \*(RO The operating system \*(UA has been build for, usually taken from
8098 .Xr uname 1
8100 .Ql uname -s
8102 .Ql uname -srm ,
8103 respectively, the former being lowercased.
8106 .It Va charset-7bit
8107 The value that should appear in the
8108 .Ql charset=
8109 parameter of
8110 .Ql Content-Type:
8111 MIME header fields when no character set conversion of the message data
8112 was performed.
8113 This defaults to US-ASCII, and the chosen character set should be
8114 US-ASCII compatible.
8117 .It Va charset-8bit
8118 \*(OP The default 8-bit character set that is used as an implicit last
8119 member of the variable
8120 .Va sendcharsets .
8121 This defaults to UTF-8 if character set conversion capabilities are
8122 available, and to ISO-8859-1 otherwise, in which case the only supported
8123 character set is
8124 .Va ttycharset
8125 and this variable is effectively ignored.
8126 Refer to the section
8127 .Sx "Character sets"
8128 for the complete picture of character set conversion in \*(UA.
8131 .It Va charset-unknown-8bit
8132 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
8133 .Dq upgrade
8134 the content of a mail message by using a character set with the name
8135 .Ql unknown-8bit .
8136 Because of the unclassified nature of this character set \*(UA will not
8137 be capable to convert this character set to any other character set.
8138 If this variable is set any message part which uses the character set
8139 .Ql unknown-8bit
8140 is assumed to really be in the character set given in the value,
8141 otherwise the (final) value of
8142 .Va charset-8bit
8143 is used for this purpose.
8145 This variable will also be taken into account if a MIME type (see
8146 .Sx "The mime.types files" )
8147 of a MIME message part that uses the
8148 .Ql binary
8149 character set is forcefully treated as text.
8152 .It Va cmd
8153 The default value for the
8154 .Ic pipe
8155 command.
8158 .It Va colour-disable
8159 \*(BO\*(OP Forcefully disable usage of colours.
8160 Also see the section
8161 .Sx "Coloured display" .
8164 .It Va colour-pager
8165 \*(BO\*(OP Whether colour shall be used for output that is paged through
8166 .Ev PAGER .
8167 Note that pagers may need special command line options, e.g.,
8168 .Xr less 1
8169 requires the option
8170 .Fl \&\&R
8172 .Xr lv 1
8173 the option
8174 .Fl \&\&c
8175 in order to support colours.
8176 Often doing manual adjustments is unnecessary since \*(UA may perform
8177 adjustments dependent on the value of the environment variable
8178 .Ev PAGER
8179 (see there for more).
8183 .It Va contact-mail , contact-web
8184 \*(RO Addresses for contact per email and web, respectively, e.g., for
8185 bug reports, suggestions, or help regarding \*(UA.
8186 The former can be used directly:
8187 .Ql ? eval mail $contact-mail .
8190 .It Va crt
8191 In a(n interactive) terminal session, then if this valued variable is
8192 set it will be used as a threshold to determine how many lines the given
8193 output has to span before it will be displayed via the configured
8194 .Ev PAGER ;
8195 Usage of the
8196 .Ev PAGER
8197 can be forced by setting this to the value
8198 .Ql 0 ,
8199 setting it without a value will deduce the current height of the
8200 terminal screen to compute the treshold (see
8201 .Ev LINES ,
8202 .Va screen
8204 .Xr stty 1 ) .
8205 \*(ID At the moment this uses the count of lines of the message in wire
8206 format, which, dependent on the
8207 .Va mime-encoding
8208 of the message, is unrelated to the number of display lines.
8209 (The software is old and historically the relation was a given thing.)
8212 .It Va customhdr
8213 Define a set of custom headers to be injected into newly composed or
8214 forwarded messages; it is also possible to create custom headers in
8215 compose mode with
8216 .Ic ~^ ,
8217 which can be automated by setting one of the hooks
8218 .Va on-compose-splice
8220 .Va on-compose-splice-shell .
8221 The value is interpreted as a comma-separated list of custom headers to
8222 be injected, to include commas in the header bodies escape them with
8223 reverse solidus.
8224 \*(ID Overwriting of automatically managed headers is neither supported
8225 nor prevented.
8227 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
8230 .It Va datefield
8231 Controls the appearance of the
8232 .Ql %d
8233 date and time format specification of the
8234 .Va headline
8235 variable, that is used, for example, when viewing the summary of
8236 .Ic headers .
8237 If unset, then the local receiving date is used and displayed
8238 unformatted, otherwise the message sending
8239 .Ql Date: .
8240 It is possible to assign a
8241 .Xr strftime 3
8242 format string and control formatting, but embedding newlines via the
8243 .Ql %n
8244 format is not supported, and will result in display errors.
8245 The default is
8246 .Ql %Y-%m-%d %H:%M ,
8247 and also see
8248 .Va datefield-markout-older .
8251 .It Va datefield-markout-older
8252 Only used in conjunction with
8253 .Va datefield .
8254 Can be used to create a visible distinction of messages dated more than
8255 a day in the future, or older than six months, a concept comparable to the
8256 .Fl \&\&l
8257 option of the POSIX utility
8258 .Xr ls 1 .
8259 If set to the empty string, then the plain month, day and year of the
8260 .Ql Date:
8261 will be displayed, but a
8262 .Xr strftime 3
8263 format string to control formatting can be assigned.
8264 The default is
8265 .Ql %Y-%m-%d .
8268 .It Va debug
8269 \*(BO Enables debug messages and obsoletion warnings, disables the
8270 actual delivery of messages and also implies
8271 .Pf no Va record
8272 as well as
8273 .Pf no Va save .
8276 .It Va disposition-notification-send
8277 \*(BO\*(OP Emit a
8278 .Ql Disposition-Notification-To:
8279 header (RFC 3798) with the message.
8280 This requires the
8281 .Va from
8282 variable to be set.
8283 .\" TODO .It Va disposition-notification-send-HOST
8284 .\"Overrides
8285 .\".Va disposition-notification-send
8286 .\" for SMTP accounts on a specific host.
8287 .\" TODO .It Va disposition-notification-send-USER@HOST
8288 .\"Overrides
8289 .\".Va disposition-notification-send
8290 .\"for a specific account.
8293 .It Va dot
8294 \*(BO When dot is set, a period
8295 .Ql \&.
8296 on a line by itself during message input in (interactive or batch
8297 .Fl # )
8298 compose mode will be treated as end-of-message (in addition to the
8299 normal end-of-file condition).
8300 This behaviour is implied in
8301 .Va posix
8302 mode with a set
8303 .Va ignoreeof .
8306 .It Va dotlock-ignore-error
8307 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as
8308 .Mx -sx
8309 .Sx "primary system mailbox" Ns
8310 es (see, e.g., the notes on
8311 .Sx "Filename transformations" ,
8312 as well as the documentation of
8313 .Ic file )
8314 will be protected with so-called dotlock files\(emthe traditional mail
8315 spool file locking method\(emin addition to system file locking.
8316 Because \*(UA ships with a privilege-separated dotlock creation program
8317 that should always be able to create such a dotlock file there is no
8318 good reason to ignore dotlock file creation errors, and thus these are
8319 fatal unless this variable is set.
8322 .It Va editalong
8323 \*(BO If this variable is set then the editor is started automatically
8324 when a message is composed in interactive mode, as if the
8325 .Ic ~e
8326 .Sx "COMMAND ESCAPES"
8327 had been specified.
8329 .Va editheaders
8330 variable is implied for this automatically spawned editor session.
8333 .It Va editheaders
8334 \*(BO When a message is edited while being composed,
8335 its header is included in the editable text.
8338 .It Va emptystart
8339 \*(BO When entering interactive mode \*(UA normally writes
8340 .Dq \&No mail for user
8341 and exits immediately if a mailbox is empty or does not exist.
8342 If this variable is set \*(UA starts even with an empty or non-existent
8343 mailbox (the latter behaviour furtherly depends upon
8344 .Va bsdcompat ,
8345 though).
8348 .It Va errexit
8349 \*(BO Let each command with a non-0 exit status, including every
8350 .Ic call Ns
8351 ed macro which
8352 .Ic return Ns
8353 s a non-0 status, cause a program exit unless prefixed by
8354 .Cm ignerr
8355 (see
8356 .Sx "Command modifiers" ) .
8357 This also affects
8358 .Sx "COMMAND ESCAPES" ,
8359 but which use a different modifier for ignoring the error.
8360 Please refer to the variable
8361 .Va \&?
8362 for more on this topic.
8365 .It Va escape
8366 The first character of this value defines the escape character for
8367 .Sx "COMMAND ESCAPES"
8368 in compose mode.
8369 The default value is the character tilde
8370 .Ql ~ .
8371 If set to the empty string, command escapes are disabled.
8374 .It Va expandaddr
8375 If not set then file and command pipeline targets are not allowed,
8376 and any such address will be filtered out, giving a warning message.
8377 If set without a value then all possible recipient address
8378 specifications will be accepted \(en see the section
8379 .Sx "On sending mail, and non-interactive mode"
8380 for more on this.
8381 To accept them, but only in interactive mode, or when tilde commands
8382 were enabled explicitly by using one of the command line options
8383 .Fl ~
8385 .Fl # ,
8386 set this to the (case-insensitive) value
8387 .Ql restrict
8388 (it actually acts like
8389 .Ql restrict,-all,+name,+addr ,
8390 so that care for ordering issues must be taken) .
8392 In fact the value is interpreted as a comma-separated list of values.
8393 If it contains
8394 .Ql fail
8395 then the existence of disallowed specifications is treated as a hard
8396 send error instead of only filtering them out.
8397 The remaining values specify whether a specific type of recipient
8398 address specification is allowed (optionally indicated by a plus sign
8399 .Ql +
8400 prefix) or disallowed (prefixed with a hyphen-minus
8401 .Ql - ) .
8402 The value
8403 .Ql all
8404 addresses all possible address specifications,
8405 .Ql file
8406 file targets,
8407 .Ql pipe
8408 command pipeline targets,
8409 .Ql name
8410 plain user names and (MTA) aliases and
8411 .Ql addr
8412 network addresses.
8413 These kind of values are interpreted in the given order, so that
8414 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
8415 will cause hard errors for any non-network address recipient address
8416 unless \*(UA is in interactive mode or has been started with the
8417 .Fl ~
8419 .Fl #
8420 command line option; in the latter case(s) any address may be used, then.
8422 Historically invalid network addressees are silently stripped off.
8423 To change this so that any encountered invalid email address causes
8424 a hard error it must be ensured that
8425 .Ql failinvaddr
8426 is an entry in the above list.
8427 Setting this automatically enables network addressees
8428 (it actually acts like
8429 .Ql failinvaddr,+addr ,
8430 so that care for ordering issues must be taken) .
8433 .It Va expandargv
8434 Unless this variable is set additional
8435 .Va mta
8436 (Mail-Transfer-Agent)
8437 arguments from the command line, as can be given after a
8438 .Fl \&\&-
8439 separator, are ignored due to safety reasons.
8440 However, if set to the special (case-insensitive) value
8441 .Ql fail ,
8442 then the presence of additional MTA arguments is treated as a hard
8443 error that causes \*(UA to exit with failure status.
8444 A lesser strict variant is the otherwise identical
8445 .Ql restrict ,
8446 which does accept such arguments in interactive mode, or if tilde
8447 commands were enabled explicitly by using one of the command line options
8448 .Fl ~
8450 .Fl # .
8453 .It Va features
8454 \*(RO String giving a list of features \*(UA, preceded with a plus sign
8455 .Ql +
8456 if the feature is available, and a hyphen-minus
8457 .Ql -
8458 otherwise.
8459 The output of the command
8460 .Ic version
8461 will include this information in a more pleasant output.
8464 .It Va flipr
8465 \*(BO This setting reverses the meanings of a set of reply commands,
8466 turning the lowercase variants, which by default address all recipients
8467 included in the header of a message
8468 .Pf ( Ic reply , respond , followup )
8469 into the uppercase variants, which by default address the sender only
8470 .Pf ( Ic Reply , Respond , Followup )
8471 and vice versa.
8472 The commands
8473 .Ic replysender , respondsender , followupsender
8474 as well as
8475 .Ic replyall , respondall , followupall
8476 are not affected by the current setting of
8477 .Va flipr .
8480 .It Va folder
8481 The default path under which mailboxes are to be saved:
8482 filenames that begin with the plus sign
8483 .Ql +
8484 will have the plus sign replaced with the value of this variable if set,
8485 otherwise the plus sign will remain unchanged when doing
8486 .Sx "Filename transformations" ;
8487 also see
8488 .Ic file
8489 for more on this topic.
8490 The value supports a subset of transformations itself, and if the
8491 non-empty value does not start with a solidus
8492 .Ql / ,
8493 then the value of
8494 .Ev HOME
8495 will be prefixed automatically.
8496 Once the actual value is evaluated first, the internal variable
8497 .Va folder-resolved
8498 will be updated for caching purposes.
8501 .It Va folder-hook
8502 This variable can be set to the name of a
8503 .Ic define Ns d
8504 macro which will be called whenever a
8505 .Ic file
8506 is opened.
8507 The macro will also be invoked when new mail arrives,
8508 but message lists for commands executed from the macro
8509 only include newly arrived messages then.
8510 .Ic localopts
8511 are activated by default in a folder hook, causing the covered settings
8512 to be reverted once the folder is left again.
8515 .It Va folder-hook-FOLDER
8516 Overrides
8517 .Va folder-hook
8518 for a folder named
8519 .Ql FOLDER .
8520 Unlike other folder specifications, the fully expanded name of a folder,
8521 without metacharacters, is used to avoid ambiguities.
8522 However, if the mailbox resides under
8523 .Va folder
8524 then the usual
8525 .Ql +
8526 specification is tried in addition, e.g., if
8527 .Va \&\&folder
8529 .Dq mail
8530 (and thus relative to the user's home directory) then
8531 .Pa /home/usr1/mail/sent
8532 will be tried as
8533 .Ql folder-hook-/home/usr1/mail/sent
8534 first, but then followed by
8535 .Ql folder-hook-+sent .
8538 .It Va folder-resolved
8539 \*(RO Set to the fully resolved path of
8540 .Va folder
8541 once that evaluation has occurred; rather internal.
8544 .It Va followup-to
8545 \*(BO Controls whether a
8546 .Ql Mail-Followup-To:
8547 header is generated when sending messages to known mailing lists.
8548 Also see
8549 .Va followup-to-honour
8550 and the commands
8551 .Ic mlist , mlsubscribe , reply
8553 .Ic Lreply .
8556 .It Va followup-to-honour
8557 Controls whether a
8558 .Ql Mail-Followup-To:
8559 header is honoured when group-replying to a message via
8560 .Ic reply
8562 .Ic Lreply .
8563 This is a quadoption; if set without a value it defaults to
8564 .Dq yes .
8565 Also see
8566 .Va followup-to
8567 and the commands
8568 .Ic mlist
8570 .Ic mlsubscribe .
8573 .It Va forward-as-attachment
8574 \*(BO Original messages are normally sent as inline text with the
8575 .Ic forward
8576 command,
8577 and only the first part of a multipart message is included.
8578 With this setting enabled messages are sent as unmodified MIME
8579 .Ql message/rfc822
8580 attachments with all of their parts included.
8583 .It Va forward-inject-head
8584 The string to put before the text of a message with the
8585 .Ic forward
8586 command instead of the default
8587 .Dq -------- Original Message -------- .
8588 No heading is put if it is set to the empty string.
8589 This variable is ignored if the
8590 .Va forward-as-attachment
8591 variable is set.
8594 .It Va from
8595 The address (or a list of addresses) to put into the
8596 .Ql From:
8597 field of the message header, quoting RFC 5322:
8598 the author(s) of the message, that is, the mailbox(es) of the person(s)
8599 or system(s) responsible for the writing of the message.
8600 When
8601 .Ic reply Ns
8602 ing to messages these addresses are handled as if they were in the
8603 .Ic alternates
8604 list.
8606 If the machine's hostname is not valid at the Internet (for example at
8607 a dialup machine) then either this variable or
8608 .Va hostname
8609 (\*(IN and with a defined SMTP protocol in
8610 .Va mta
8611 .Va smtp-hostname
8612 adds even more fine-tuning capabilities),
8613 have to be set.
8615 .Va \&\&from
8616 contains more than one address,
8617 setting the
8618 .Va sender
8619 variable is required (according to the standard RFC 5322).
8621 If a file-based MTA is used, then
8622 .Va from
8623 (or, if that contains multiple addresses,
8624 .Va sender )
8625 can nonetheless be enforced to appear as the envelope sender address at
8626 the MTA protocol level (the RFC 5321 reverse-path), either by using the
8627 .Fl r
8628 command line option (with an empty argument; see there for the complete
8629 picture on this topic), or by setting the internal variable
8630 .Va r-option-implicit .
8633 .It Va fullnames
8634 \*(BO When replying to or forwarding a message \*(UA normally removes
8635 the comment and name parts of email addresses.
8636 If this variable is set such stripping is not performed,
8637 and comments, names etc. are retained.
8639 .It Va fwdheading
8640 \*(OB Predecessor of
8641 .Va forward-inject-head .
8644 .It Va header
8645 \*(BO Causes the header summary to be written at startup and after
8646 commands that affect the number of messages or the order of messages in
8647 the current
8648 .Ic folder .
8649 Unless in
8650 .Ev POSIXLY_CORRECT
8651 mode a header summary will also be displayed on folder changes.
8652 The command line option
8653 .Fl N
8654 can be used to set
8655 .Pf no Va header .
8659 .It Va headline
8660 A format string to use for the summary of
8661 .Ic headers ,
8662 similar to the ones used for
8663 .Xr printf 3
8664 formats.
8665 Format specifiers in the given string start with a percent sign
8666 .Ql %
8667 and may be followed by an optional decimal number indicating the field
8668 width \(em if that is negative, the field is to be left-aligned.
8669 Valid format specifiers are:
8672 .Bl -tag -compact -width ".It Ql _%%_"
8673 .It Ql %%
8674 A plain percent sign.
8675 .It Ql %>
8676 .Dq Dotmark :
8677 a space character but for the current message
8678 .Pf ( Dq dot ) ,
8679 for which it expands to
8680 .Ql > .
8681 .It Ql %<
8682 .Dq Dotmark :
8683 a space character but for the current message
8684 .Pf ( Dq dot ) ,
8685 for which it expands to
8686 .Ql < .
8687 .It Ql %$
8688 \*(OP The spam score of the message, as has been classified via the
8689 command
8690 .Ic spamrate .
8691 Shows only a replacement character if there is no spam support.
8692 .It Ql %a
8693 Message attribute character (status flag); the actual content can be
8694 adjusted by setting
8695 .Va attrlist .
8696 .It Ql %d
8697 The date found in the
8698 .Ql From:
8699 header of the message when
8700 .Va datefield
8701 is set (the default), otherwise the date when the message was received.
8702 Formatting can be controlled by assigning a
8703 .Xr strftime 3
8704 format string to
8705 .Va datefield .
8706 .It Ql %e
8707 The indenting level in threaded mode.
8708 .It Ql %f
8709 The address of the message sender.
8710 .It Ql %i
8711 The message thread tree structure.
8712 (Note that this format does not support a field width.)
8713 .It Ql %l
8714 The number of lines of the message, if available.
8715 .It Ql %m
8716 Message number.
8717 .It Ql %o
8718 The number of octets (bytes) in the message, if available.
8719 .It Ql %s
8720 Message subject (if any).
8721 .It Ql %S
8722 Message subject (if any) in double quotes.
8723 .It Ql \&%T
8724 Message recipient flags: is the addressee of the message a known or
8725 subscribed mailing list \(en see
8726 .Ic mlist
8728 .Ic mlsubscribe .
8729 .It Ql %t
8730 The position in threaded/sorted order.
8733 The default is
8734 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
8736 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
8738 .Va bsdcompat
8739 is set.
8740 Also see
8741 .Va attrlist
8743 .Va headline-bidi .
8747 .It Va headline-bidi
8748 Bidirectional text requires special treatment when displaying headers,
8749 because numbers (in dates or for file sizes etc.) will not affect the
8750 current text direction, in effect resulting in ugly line layouts when
8751 arabic or other right-to-left text is to be displayed.
8752 On the other hand only a minority of terminals is capable to correctly
8753 handle direction changes, so that user interaction is necessary for
8754 acceptable results.
8755 Note that extended host system support is required nonetheless, e.g.,
8756 detection of the terminal character set is one precondition;
8757 and this feature only works in an Unicode (i.e., UTF-8) locale.
8759 In general setting this variable will cause \*(UA to encapsulate text
8760 fields that may occur when displaying
8761 .Va headline
8762 (and some other fields, like dynamic expansions in
8763 .Va prompt )
8764 with special Unicode control sequences;
8765 it is possible to fine-tune the terminal support level by assigning
8766 a value:
8767 no value (or any value other than
8768 .Ql 1 ,
8769 .Ql 2
8771 .Ql 3 )
8772 will make \*(UA assume that the terminal is capable to properly deal
8773 with Unicode version 6.3, in which case text is embedded in a pair of
8774 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
8775 characters.
8776 In addition no space on the line is reserved for these characters.
8778 Weaker support is chosen by using the value
8779 .Ql 1
8780 (Unicode 6.3, but reserve the room of two spaces for writing the control
8781 sequences onto the line).
8782 The values
8783 .Ql 2
8785 .Ql 3
8786 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
8787 again reserves room for two spaces in addition.
8790 .It Va history-file
8791 \*(OP If a line editor is available then this can be set to
8792 name the (expandable) path of the location of a permanent history file.
8793 Also see
8794 .Va history-size .
8797 .It Va history-gabby
8798 \*(BO\*(OP Add more entries to the history as is normally done.
8801 .It Va history-gabby-persist
8802 \*(BO\*(OP \*(UA's own MLE will not save the additional
8803 .Va history-gabby
8804 entries in persistent storage unless this variable is set.
8805 On the other hand it will not loose the knowledge of whether
8806 a persistent entry was gabby or not.
8807 Also see
8808 .Va history-file .
8811 .It Va history-size
8812 \*(OP Setting this variable imposes a limit on the number of concurrent
8813 history entries.
8814 If set to the value 0 then no further history entries will be added, and
8815 loading and incorporation of the
8816 .Va history-file
8817 upon program startup can also be suppressed by doing this.
8818 Runtime changes will not be reflected, but will affect the number of
8819 entries saved to permanent storage.
8822 .It Va hold
8823 \*(BO This setting controls whether messages are held in the system
8824 .Va inbox ,
8825 and it is set by default.
8828 .It Va hostname
8829 Use this string as hostname when expanding local addresses instead of
8830 the value obtained from
8831 .Xr uname 3
8833 .Xr getaddrinfo 3 .
8834 It is used, e.g., in
8835 .Ql Message-ID:
8837 .Ql From:
8838 fields, as well as when generating
8839 .Ql Content-ID:
8840 MIME part related unique ID fields.
8841 Setting it to the empty string will cause the normal hostname to be
8842 used, but nonetheless enables creation of said ID fields.
8843 \*(IN in conjunction with the built-in SMTP
8844 .Va mta
8845 .Va smtp-hostname
8846 also influences the results:
8847 one should produce some test messages with the desired combination of
8848 .Va \&\&hostname ,
8849 and/or
8850 .Va from ,
8851 .Va sender
8852 etc. first.
8855 .It Va idna-disable
8856 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
8857 names according to the rules of IDNA (internationalized domain names
8858 for applications).
8859 Since the IDNA code assumes that domain names are specified with the
8860 .Va ttycharset
8861 character set, an UTF-8 locale charset is required to represent all
8862 possible international domain names (before conversion, that is).
8865 .It Va ifs
8866 The input field separator that is used (\*(ID by some functions) to
8867 determine where to split input data.
8869 .Bl -tag -compact -width ".It MMM"
8870 .It 1.
8871 Unsetting is treated as assigning the default value,
8872 .Ql \& \et\en .
8873 .It 2.
8874 If set to the empty value, no field splitting will be performed.
8875 .It 3.
8876 If set to a non-empty value, all whitespace characters are extracted
8877 and assigned to the variable
8878 .Va ifs-ws .
8881 .Bl -tag -compact -width ".It MMM"
8882 .It a.
8883 .Va \&\&ifs-ws
8884 will be ignored at the beginning and end of input.
8885 Diverging from POSIX shells default whitespace is removed in addition,
8886 which is owed to the entirely different line content extraction rules.
8887 .It b.
8888 Each occurrence of a character of
8889 .Va \&\&ifs
8890 will cause field-splitting, any adjacent
8891 .Va \&\&ifs-ws
8892 characters will be skipped.
8896 .It Va ifs-ws
8897 \*(RO Automatically deduced from the whitespace characters in
8898 .Va ifs .
8901 .It Va ignore
8902 \*(BO Ignore interrupt signals from the terminal while entering
8903 messages; instead echo them as
8904 .Ql @
8905 characters and discard the current line.
8908 .It Va ignoreeof
8909 \*(BO Ignore end-of-file conditions
8910 .Pf ( Ql control-D )
8911 in compose mode on message input and in interactive command input.
8912 If set an interactive command input session can only be left by
8913 explicitly using one of the commands
8914 .Ic exit
8916 .Ic quit ,
8917 and message input in compose mode can only be terminated by entering
8918 a period
8919 .Ql \&.
8920 on a line by itself or by using the
8921 .Ic ~.
8922 .Sx "COMMAND ESCAPES" ;
8923 Setting this implies the behaviour that
8924 .Va dot
8925 describes in
8926 .Va posix
8927 mode.
8930 .It Va inbox
8931 If this is set to a non-empty string it will specify the users
8932 .Mx -sx
8933 .Sx "primary system mailbox" ,
8934 overriding
8935 .Ev MAIL
8936 and the system-dependent default, and (thus) be used to replace
8937 .Ql %
8938 when doing
8939 .Sx "Filename transformations" ;
8940 also see
8941 .Ic file
8942 for more on this topic.
8943 The value supports a subset of transformations itself.
8946 .It Va indentprefix
8947 String used by the
8948 .Ic ~m , ~M
8950 .Ic ~R
8951 .Sx "COMMAND ESCAPES"
8952 and by the
8953 .Va quote
8954 option for indenting messages,
8955 in place of the normal tabulator character
8956 .Ql ^I ,
8957 which is the default.
8958 Be sure to quote the value if it contains spaces or tabs.
8961 .It Va keep
8962 \*(BO If set, an empty
8963 .Mx -sx
8964 .Sx "primary system mailbox"
8965 file is not removed.
8966 Note that, in conjunction with
8967 .Ev POSIXLY_CORRECT
8968 any empty file will be removed unless this variable is set.
8969 This may improve the interoperability with other mail user agents
8970 when using a common folder directory, and prevents malicious users
8971 from creating fake mailboxes in a world-writable spool directory.
8972 \*(ID Only local regular (MBOX) files are covered, Maildir or other
8973 mailbox types will never be removed, even if empty.
8976 .It Va keep-content-length
8977 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
8978 be told to keep the
8979 .Ql Content-Length:
8981 .Ql Lines:
8982 header fields that some MUAs generate by setting this variable.
8983 Since \*(UA does neither use nor update these non-standardized header
8984 fields (which in itself shows one of their conceptual problems),
8985 stripping them should increase interoperability in between MUAs that
8986 work with with same mailbox files.
8987 Note that, if this is not set but
8988 .Va writebackedited ,
8989 as below, is, a possibly performed automatic stripping of these header
8990 fields already marks the message as being modified.
8991 \*(ID At some future time \*(UA will be capable to rewrite and apply an
8992 .Va mime-encoding
8993 to modified messages, and then those fields will be stripped silently.
8996 .It Va keepsave
8997 \*(BO When a message is saved it is usually discarded from the
8998 originating folder when \*(UA is quit.
8999 This setting causes all saved message to be retained.
9002 .It Va line-editor-disable
9003 \*(BO Turn off any enhanced line editing capabilities (see
9004 .Sx "On terminal control and line editor"
9005 for more).
9008 .It Va line-editor-no-defaults
9009 \*(BO\*(OP Do not establish any default key binding.
9012 .It Va log-prefix
9013 Error log message prefix string
9014 .Pf ( Ql "\*(uA: " ) .
9017 .It Va mailbox-display
9018 \*(RO The name of the current mailbox
9019 .Pf ( Ic file ) ,
9020 possibly abbreviated for display purposes.
9023 .It Va mailbox-resolved
9024 \*(RO The fully resolved path of the current mailbox.
9027 .It Va mailx-extra-rc
9028 An additional startup file that is loaded as the last of the
9029 .Sx "Resource files" .
9030 Use this file for commands that are not understood by other POSIX
9031 .Xr mailx 1
9032 implementations, i.e., mostly anything which is not covered by
9033 .Sx "Initial settings" .
9036 .It Va markanswered
9037 \*(BO When a message is replied to and this variable is set,
9038 it is marked as having been
9039 .Ic answered .
9040 See the section
9041 .Sx "Message states" .
9044 .It Va mbox-rfc4155
9045 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
9046 POSIX rules for detecting message boundaries (so-called
9047 .Ql From_
9048 lines) due to compatibility reasons, instead of the stricter rules that
9049 have been standardized in RFC 4155.
9050 This behaviour can be switched to the stricter RFC 4155 rules by
9051 setting this variable.
9052 (This is never necessary for any message newly generated by \*(UA,
9053 it only applies to messages generated by buggy or malicious MUAs, or may
9054 occur in old MBOX databases: \*(UA itself will choose a proper
9055 .Va mime-encoding
9056 to avoid false interpretation of
9057 .Ql From_
9058 content lines in the MBOX database.)
9060 This may temporarily be handy when \*(UA complains about invalid
9061 .Ql From_
9062 lines when opening a MBOX: in this case setting this variable and
9063 re-opening the mailbox in question may correct the result.
9064 If so, copying the entire mailbox to some other file, as in
9065 .Ql copy * SOME-FILE ,
9066 will perform proper, all-compatible
9067 .Ql From_
9068 quoting for all detected messages, resulting in a valid MBOX mailbox.
9069 Finally the variable can be unset again:
9070 .Bd -literal -offset indent
9071 define mboxfix {
9072   localopts yes; wysh set mbox-rfc4155;\e
9073     wysh File "${1}"; eval copy * "${2}"
9075 call mboxfix /tmp/bad.mbox /tmp/good.mbox
9079 .It Va memdebug
9080 \*(BO Internal development variable.
9083 .It Va message-id-disable
9084 \*(BO By setting this variable the generation of
9085 .Ql Message-ID:
9086 can be completely suppressed, effectively leaving this task up to the
9087 .Va mta
9088 (Mail-Transfer-Agent) or the SMTP server.
9089 (According to RFC 5321 a SMTP server is not required to add this
9090 field by itself, so it should be ensured that it accepts messages without
9091 .Ql Message-ID . )
9092 This variable also affects automatic generation of
9093 .Va Content-ID:
9094 MIME header fields.
9097 .It Va message-inject-head
9098 A string to put at the beginning of each new message.
9099 The escape sequences tabulator
9100 .Ql \et
9101 and newline
9102 .Ql \en
9103 are understood.
9106 .It Va message-inject-tail
9107 A string to put at the end of each new message.
9108 The escape sequences tabulator
9109 .Ql \et
9110 and newline
9111 .Ql \en
9112 are understood.
9115 .It Va metoo
9116 \*(BO Usually, when an
9117 .Ic alias
9118 expansion contains the sender, the sender is removed from the expansion.
9119 Setting this option suppresses these removals.
9120 Note that a set
9121 .Va metoo
9122 also causes a
9123 .Ql -m
9124 option to be passed through to the
9125 .Va mta
9126 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
9127 this flag, no MTA is known which does not support it (for historical
9128 compatibility).
9131 .It Va mime-allow-text-controls
9132 \*(BO When sending messages, each part of the message is MIME-inspected
9133 in order to classify the
9134 .Ql Content-Type:
9136 .Ql Content-Transfer-Encoding:
9137 (see
9138 .Va mime-encoding )
9139 that is required to send this part over mail transport, i.e.,
9140 a computation rather similar to what the
9141 .Xr file 1
9142 command produces when used with the
9143 .Ql --mime
9144 option.
9146 This classification however treats text files which are encoded in
9147 UTF-16 (seen for HTML files) and similar character sets as binary
9148 octet-streams, forcefully changing any
9149 .Ql text/plain
9151 .Ql text/html
9152 specification to
9153 .Ql application/octet-stream :
9154 If that actually happens a yet unset charset MIME parameter is set to
9155 .Ql binary ,
9156 effectively making it impossible for the receiving MUA to automatically
9157 interpret the contents of the part.
9159 If this variable is set, and the data was unambiguously identified as
9160 text data at first glance (by a
9161 .Ql .txt
9163 .Ql .html
9164 file extension), then the original
9165 .Ql Content-Type:
9166 will not be overwritten.
9169 .It Va mime-alternative-favour-rich
9170 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
9171 HTML) will be preferred in favour of included plain text versions when
9172 displaying messages, provided that a handler exists which produces
9173 output that can be (re)integrated into \*(UA's normal visual display.
9174 (E.g., at the time of this writing some newsletters ship their full
9175 content only in the rich HTML part, whereas the plain text part only
9176 contains topic subjects.)
9179 .It Va mime-counter-evidence
9180 Normally the
9181 .Ql Content-Type:
9182 field is used to decide how to handle MIME parts.
9183 Some MUAs, however, do not use
9184 .Sx "The mime.types files"
9185 (also see
9186 .Sx "HTML mail and MIME attachments" )
9187 or a similar mechanism to correctly classify content, but specify an
9188 unspecific MIME type
9189 .Pf ( Ql application/octet-stream )
9190 even for plain text attachments.
9191 If this variable is set then \*(UA will try to re-classify such MIME
9192 message parts, if possible, for example via a possibly existing
9193 attachment filename.
9194 A non-empty value may also be given, in which case a number is expected,
9195 actually a carrier of bits.
9196 Creating the bit-carrying number is a simple addition:
9197 .Bd -literal -offset indent
9198 ? !echo Value should be set to $((2 + 4 + 8))
9199 Value should be set to 14
9202 .Bl -bullet -compact
9204 If bit two is set (2) then the detected
9205 .Ic mimetype
9206 will be carried along with the message and be used for deciding which
9207 MIME handler is to be used, for example;
9208 when displaying such a MIME part the part-info will indicate the
9209 overridden content-type by showing a plus sign
9210 .Ql + .
9212 If bit three is set (4) then the counter-evidence is always produced
9213 and a positive result will be used as the MIME type, even forcefully
9214 overriding the parts given MIME type.
9216 If bit four is set (8) then as a last resort the actual content of
9217 .Ql application/octet-stream
9218 parts will be inspected, so that data which looks like plain text can be
9219 treated as such.
9223 .It Va mime-encoding
9224 The MIME
9225 .Ql Content-Transfer-Encoding
9226 to use in outgoing text messages and message parts, where applicable.
9227 (7-bit clean text messages are sent as-is, without a transfer encoding.)
9228 Valid values are:
9230 .Bl -tag -compact -width ".It Ql _%%_"
9231 .It Ql 8bit
9232 .Pf (Or\0 Ql 8b . )
9233 8-bit transport effectively causes the raw data be passed through
9234 unchanged, but may cause problems when transferring mail messages over
9235 channels that are not ESMTP (RFC 1869) compliant.
9236 Also, several input data constructs are not allowed by the
9237 specifications and may cause a different transfer-encoding to be used.
9238 .It Ql quoted-printable
9239 .Pf (Or\0 Ql qp . )
9240 Quoted-printable encoding is 7-bit clean and has the property that ASCII
9241 characters are passed through unchanged, so that an english message can
9242 be read as-is; it is also acceptible for other single-byte locales that
9243 share many characters with ASCII, like, e.g., ISO-8859-1.
9244 The encoding will cause a large overhead for messages in other character
9245 sets: e.g., it will require up to twelve (12) bytes to encode a single
9246 UTF-8 character of four (4) bytes.
9247 .It Ql base64
9248 .Pf (Or\0 Ql b64 . )
9249 The default encoding, it is 7-bit clean and will always be used for
9250 binary data.
9251 This encoding has a constant input:output ratio of 3:4, regardless of
9252 the character set of the input data it will encode three bytes of input
9253 to four bytes of output.
9254 This transfer-encoding is not human readable without performing
9255 a decoding step.
9259 .It Va mimetypes-load-control
9260 Can be used to control which of
9261 .Sx "The mime.types files"
9262 are loaded: if the letter
9263 .Ql u
9264 is part of the option value, then the user's personal
9265 .Pa ~/.mime.types
9266 file will be loaded (if it exists); likewise the letter
9267 .Ql s
9268 controls loading of the system wide
9269 .Pa /etc/mime.types ;
9270 directives found in the user file take precedence, letter matching is
9271 case-insensitive.
9272 If this variable is not set \*(UA will try to load both files.
9273 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
9274 but they will be matched last (the order can be listed via
9275 .Ic mimetype ) .
9277 More sources can be specified by using a different syntax: if the
9278 value string contains an equals sign
9279 .Ql =
9280 then it is instead parsed as a comma-separated list of the described
9281 letters plus
9282 .Ql f=FILENAME
9283 pairs; the given filenames will be expanded and loaded, and their
9284 content may use the extended syntax that is described in the section
9285 .Sx "The mime.types files" .
9286 Directives found in such files always take precedence (are prepended to
9287 the MIME type cache).
9291 .It Va mta
9292 To choose an alternate Mail-Transfer-Agent, set this option to either
9293 the full pathname of an executable (optionally prefixed with a
9294 .Ql file://
9295 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
9297 .Dl smtps?://[user[:password]@]server[:port]
9299 (\*(OU:
9300 .Ql [smtp://]server[:port] . )
9301 The default has been chosen at compile time.
9302 All supported data transfers are executed in child processes, which
9303 run asynchronously and without supervision unless either the
9304 .Va sendwait
9305 or the
9306 .Va verbose
9307 variable is set.
9308 If such a child receives a TERM signal, it will abort and
9309 .Va save
9310 the message to
9311 .Ev DEAD ,
9312 if so configured.
9315 For a file-based MTA it may be necessary to set
9316 .Va mta-argv0
9317 in in order to choose the right target of a modern
9318 .Xr mailwrapper 8
9319 environment.
9320 It will be passed command line arguments from several possible sources:
9321 from the variable
9322 .Va mta-arguments
9323 if set, from the command line if given and the variable
9324 .Va expandargv
9325 allows their use.
9326 Argument processing of the MTA will be terminated with a
9327 .Fl \&\&-
9328 separator.
9331 The otherwise occurring implicit usage of the following MTA command
9332 line arguments can be disabled by setting the boolean variable
9333 .Va mta-no-default-arguments
9334 (which will also disable passing
9335 .Fl \&\&-
9336 to the MTA):
9337 .Fl \&\&i
9338 (for not treating a line with only a dot
9339 .Ql \&.
9340 character as the end of input),
9341 .Fl \&\&m
9342 (shall the variable
9343 .Va metoo
9344 be set) and
9345 .Fl \&\&v
9346 (if the
9347 .Va verbose
9348 variable is set); in conjunction with the
9349 .Fl r
9350 command line option \*(UA will also (not) pass
9351 .Fl \&\&f
9352 as well as possibly
9353 .Fl \&\&F .
9356 \*(OPally \*(UA can send mail over SMTP network connections to a single
9357 defined SMTP smart host by specifying a SMTP URL as the value (see
9358 .Sx "On URL syntax and credential lookup" ) .
9359 Note that with some mail providers it may be necessary to set the
9360 .Va smtp-hostname
9361 variable in order to use a specific combination of
9362 .Va from ,
9363 .Va hostname
9365 .Va mta .
9366 \*(UA also supports forwarding of all network traffic over a specified
9367 .Va socks-proxy .
9368 The following SMTP variants may be used:
9370 .Bl -bullet
9372 The plain SMTP protocol (RFC 5321) that normally lives on the
9373 server port 25 and requires setting the
9374 .Va smtp-use-starttls
9375 variable to enter a SSL/TLS encrypted session state.
9376 Assign a value like \*(IN
9377 .Ql smtp://[user[:password]@]server[:port]
9378 (\*(OU
9379 .Ql smtp://server[:port] )
9380 to choose this protocol.
9382 The so-called SMTPS which is supposed to live on server port 465
9383 and is automatically SSL/TLS secured.
9384 Unfortunately it never became a standardized protocol and may thus not
9385 be supported by your hosts network service database
9386 \(en in fact the port number has already been reassigned to other
9387 protocols!
9389 SMTPS is nonetheless a commonly offered protocol and thus can be
9390 chosen by assigning a value like \*(IN
9391 .Ql smtps://[user[:password]@]server[:port]
9392 (\*(OU
9393 .Ql smtps://server[:port] ) ;
9394 due to the mentioned problems it is usually necessary to explicitly
9395 specify the port as
9396 .Ql :465 ,
9397 however.
9399 Finally there is the SUBMISSION protocol (RFC 6409), which usually
9400 lives on server port 587 and is practically identically to the SMTP
9401 protocol from \*(UA's point of view beside that; it requires setting the
9402 .Va smtp-use-starttls
9403 variable to enter a SSL/TLS secured session state.
9404 Assign a value like \*(IN
9405 .Ql submission://[user[:password]@]server[:port]
9406 (\*(OU
9407 .Ql submission://server[:port] ) .
9412 .It Va mta-arguments
9413 Arguments to pass through to a file-based
9414 .Va mta
9415 can be given via this variable, which is parsed according to
9416 .Sx "Shell-style argument quoting"
9417 into an array of arguments, and which will be joined onto MTA options
9418 from other sources, and then passed individually to the MTA:
9419 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
9422 .It Va mta-no-default-arguments
9423 \*(BO Unless this variable is set \*(UA will pass some well known
9424 standard command line options to a file-based
9425 .Va mta
9426 (Mail-Transfer-Agent), see there for more.
9429 .It Va mta-argv0
9430 Many systems use a so-called
9431 .Xr mailwrapper 8
9432 environment to ensure compatibility with
9433 .Xr sendmail 1 .
9434 This works by inspecting the name that was used to invoke the mail
9435 delivery system.
9436 If this variable is set then the mailwrapper (the program that is
9437 actually executed when calling the file-based
9438 .Va mta )
9439 will treat its contents as that name.
9441 .Mx Va netrc-lookup
9442 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
9443 \*(BO\*(IN\*(OP Used to control usage of the users
9444 .Pa .netrc
9445 file for lookup of account credentials, as documented in the section
9446 .Sx "On URL syntax and credential lookup"
9447 and for the command
9448 .Ic netrc ;
9449 the section
9450 .Sx "The .netrc file"
9451 documents the file format.
9452 Also see
9453 .Va netrc-pipe .
9456 .It Va netrc-pipe
9457 \*(IN\*(OP When
9458 .Pa .netrc
9459 is loaded (see
9460 .Ic netrc
9462 .Va netrc-lookup )
9463 then \*(UA will read the output of a shell pipe instead of the users
9464 .Pa .netrc
9465 file if this variable is set (to the desired shell command).
9466 This can be used to, e.g., store
9467 .Pa .netrc
9468 in encrypted form:
9469 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
9472 .It Va newfolders
9473 If this variable has the value
9474 .Ql maildir ,
9475 newly created local folders will be in Maildir instead of MBOX format.
9478 .It Va newmail
9479 Checks for new mail in the current folder each time the prompt is shown.
9480 A Maildir folder must be re-scanned to determine if new mail has arrived.
9481 If this variable is set to the special value
9482 .Ql nopoll
9483 then a Maildir folder will not be rescanned completely, but only
9484 timestamp changes are detected.
9487 .It Va outfolder
9488 \*(BO Causes the filename given in the
9489 .Va record
9490 variable
9491 and the sender-based filenames for the
9492 .Ic Copy
9494 .Ic Save
9495 commands to be interpreted relative to the directory given in the
9496 .Va folder
9497 variable rather than to the current directory,
9498 unless it is set to an absolute pathname.
9501 .It Va on-compose-cleanup
9502 Macro hook which will be called after the message has been sent (or not,
9503 in case of failures), as the very last step before unrolling compose mode
9504 .Ic localopts .
9505 This hook is run even in case of fatal errors, and it is advisable to
9506 perform only absolutely necessary actions, like cleaning up
9507 .Ic alternates ,
9508 for example.
9509 For compose mode hooks that may affect the message content please see
9510 .Va on-compose-enter , on-compose-leave , on-compose-splice .
9511 \*(ID This hook exists only because
9512 .Ic alias , alternates , commandalias , shortcut ,
9513 to name a few, are currently not covered by
9514 .Ic localopts
9515 or a similar mechanism: any changes applied in compose mode will
9516 continue to be in effect thereafter.
9520 .It Va on-compose-enter , on-compose-leave
9521 Macro hooks which will be called before compose mode is entered,
9522 and after composing has been finished (but before the
9523 .Va signature
9524 is injected, etc.), respectively.
9525 .Ic localopts
9526 are enabled for these hooks, causing any setting to be forgotten after
9527 the message has been sent;
9528 .Va on-compose-cleanup
9529 can be used to perform any other necessary cleanup.
9530 The following (read-only) variables will be set temporarily during
9531 execution of the macros to represent the according message headers, or
9532 the empty string for non-existent; they correspond to accoding virtual
9533 temporary message headers that can be accessed via
9534 .Ic ~^ ,
9535 one of the
9536 .Sx "COMMAND ESCAPES" :
9538 .Bl -tag -compact -width ".It Va mailx_subject"
9539 .It Va mailx-command
9540 The command that generates the message.
9541 .It Va mailx-subject
9542 The subject.
9543 .It Va mailx-from
9544 .Va from .
9545 .It Va mailx-sender
9546 .Va sender .
9547 .It Va mailx-to , mailx-cc , mailx-bcc
9548 The list of receiver addresses as a space-separated list.
9549 .It Va mailx-raw-to , mailx-raw-cc , mailx-raw-bcc
9550 The list of receiver addresses before any mangling (due to, e.g.,
9551 .Ic alternates ,
9552 .Ic alias
9553 .Va recipients-in-cc )
9554 as a space-separated list.
9555 .It Va mailx-orig-from
9556 When replying, forwarding or resending, this will be set to the
9557 .Ql From:
9558 of the given message.
9559 .It Va mailx-orig-to , mailx-orig-cc , mailx-orig-bcc
9560 When replying, forwarding or resending, this will be set to the
9561 receivers of the given message.
9567 .It Va on-compose-splice , on-compose-splice-shell
9568 These hooks run once the normal compose mode is finished, but before the
9569 .Va on-compose-leave
9570 macro hook is called, the
9571 .Va signature
9572 is injected etc.
9573 Both hooks will be executed in a subprocess, with their input and output
9574 connected to \*(UA such that they can act as if they would be an
9575 interactive user.
9576 The difference in between them is that the latter is a
9577 .Ev SHELL
9578 command, whereas the former is a normal \*(UA macro, but which is
9579 restricted to a small set of commands (the
9580 .Va verbose
9581 output of, e.g.,
9582 .Ic list
9583 will indicate said capability).
9584 .Ic localopts
9585 are enabled for these hooks (in the parent process), causing any setting
9586 to be forgotten after the message has been sent;
9587 .Va on-compose-cleanup
9588 can be used to perform other cleanup as necessary.
9591 During execution of these hooks \*(UA will temporarily forget whether it
9592 has been started in interactive mode, (a restricted set of)
9593 .Sx "COMMAND ESCAPES"
9594 will always be available, and for guaranteed reproducibilities sake
9595 .Va escape
9597 .Va ifs
9598 will be set to their defaults.
9599 The compose mode command
9600 .Ic ~^
9601 has been especially designed for scriptability (via these hooks).
9602 The first line the hook will read on its standard input is the protocol
9603 version of said command escape, currently
9604 .Dq 0 0 1 :
9605 backward incompatible protocol changes have to be expected.
9608 Care must be taken to avoid deadlocks and other false control flow:
9609 if both involved processes wait for more input to happen at the
9610 same time, or one does not expect more input but the other is stuck
9611 waiting for consumption of its output, etc.
9612 There is no automatic synchronization of the hook: it will not be
9613 stopped automatically just because it, e.g., emits
9614 .Ql ~x .
9615 The hooks will however receive a termination signal if the parent enters
9616 an error condition.
9617 \*(ID Protection against and interaction with signals is not yet given;
9618 it is likely that in the future these scripts will be placed in an
9619 isolated session, which is signalled in its entirety as necessary.
9621 .Bd -literal -offset indent
9622 wysh set on-compose-splice-shell=$'\e
9623   read version;\e
9624   printf "hello $version!  Headers: ";\e
9625   echo \e'~^header list\e';\e
9626   read status result;\e
9627   echo "status=$status result=$result";\e
9628   '
9630 set on-compose-splice=ocsm
9631 define ocsm {
9632   read ver
9633   echo Splice protocol version is $ver
9634   echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
9635   if [ "$es" != 2 ]
9636     echoerr 'Cannot read header list'; echo '~x'; xit
9637   endif
9638   if [ "$hl" @i!% ' cc' ]
9639     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
9640       vput vexpr es substring "${es}" 0 1
9641     if [ "$es" != 2 ]
9642       echoerr 'Cannot insert Cc: header'; echo '~x'
9643     endif
9644   endif
9650 .It Va on-resend-cleanup
9651 \*(ID Identical to
9652 .Va on-compose-cleanup ,
9653 but is only triggered by
9654 .Ic resend .
9657 .It Va on-resend-enter
9658 \*(ID Identical to
9659 .Va on-compose-enter ,
9660 but is only triggered by
9661 .Ic resend .
9664 .It Va page
9665 \*(BO If set, each message feed through the command given for
9666 .Ic pipe
9667 is followed by a formfeed character
9668 .Ql \ef .
9670 .Mx Va password
9671 .It Va password-USER@HOST , password-HOST , password
9672 \*(IN Variable chain that sets a password, which is used in case none has
9673 been given in the protocol and account-specific URL;
9674 as a last resort \*(UA will ask for a password on the user's terminal if
9675 the authentication method requires a password.
9676 Specifying passwords in a startup file is generally a security risk;
9677 the file should be readable by the invoking user only.
9679 .It Va password-USER@HOST
9680 \*(OU (see the chain above for \*(IN)
9681 Set the password for
9682 .Ql USER
9683 when connecting to
9684 .Ql HOST .
9685 If no such variable is defined for a host,
9686 the user will be asked for a password on standard input.
9687 Specifying passwords in a startup file is generally a security risk;
9688 the file should be readable by the invoking user only.
9691 .It Va piperaw
9692 \*(BO Send messages to the
9693 .Ic pipe
9694 command without performing MIME and character set conversions.
9698 .It Va pipe-TYPE/SUBTYPE
9699 When a MIME message part of type
9700 .Ql TYPE/SUBTYPE
9701 (case-insensitive) is displayed or quoted,
9702 its text is filtered through the value of this variable interpreted as
9703 a shell command.
9704 Note that only parts which can be displayed inline as plain text (see
9705 .Cd copiousoutput )
9706 are displayed unless otherwise noted, other MIME parts will only be
9707 considered by and for the command
9708 .Ic mimeview .
9711 The special value commercial at
9712 .Ql @
9713 forces interpretation of the message part as plain text, e.g.,
9714 .Ql set pipe-application/xml=@
9715 will henceforth display XML
9716 .Dq as is .
9717 (The same could also be achieved by adding a MIME type marker with the
9718 .Ic mimetype
9719 command.
9720 And \*(OPally MIME type handlers may be defined via
9721 .Sx "The Mailcap files"
9722 \(em these directives,
9723 .Cd copiousoutput
9724 has already been used, should be referred to for further documentation.
9727 The commercial at
9728 .Ql @
9729 can in fact be used as a trigger character to adjust usage and behaviour
9730 of a following shell command specification more thoroughly by appending
9731 more special characters which refer to further mailcap directives, e.g.,
9732 the following hypothetical command specification could be used:
9734 .Bd -literal -offset indent
9735 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
9739 .Bl -tag -compact -width ".It Ql __"
9740 .It Ql *
9741 The command produces plain text to be integrated in \*(UAs output:
9742 .Cd copiousoutput .
9744 .It Ql #
9745 If set the handler will not be invoked when a message is to be quoted,
9746 but only when it will be displayed:
9747 .Cd x-mailx-noquote .
9749 .It Ql &
9750 Run the command asynchronously, i.e., without blocking \*(UA:
9751 .Cd x-mailx-async .
9753 .It Ql \&!
9754 The command must be run on an interactive terminal, \*(UA will
9755 temporarily release the terminal to it:
9756 .Cd needsterminal .
9758 .It Ql +
9759 Request creation of a zero-sized temporary file, the absolute pathname
9760 of which will be made accessible via the environment variable
9761 .Ev MAILX_FILENAME_TEMPORARY :
9762 .Cd x-mailx-tmpfile .
9763 If given twice then the file will be unlinked automatically by \*(UA
9764 when the command loop is entered again at latest:
9765 .Cd x-mailx-tmpfile-unlink .
9767 .It Ql =
9768 Normally the MIME part content is passed to the handler via standard
9769 input; if this flag is set then the data will instead be written into
9770 .Ev MAILX_FILENAME_TEMPORARY
9771 .Pf ( Cd x-mailx-tmpfile-fill ) ,
9772 the creation of which is implied; note however that in order to cause
9773 deletion of the temporary file you still have to use two plus signs
9774 .Ql ++
9775 explicitly!
9777 .It Ql @
9778 To avoid ambiguities with normal shell command content you can use
9779 another commercial at to forcefully terminate interpretation of
9780 remaining characters.
9781 (Any character not in this list will have the same effect.)
9785 Some information about the MIME part to be displayed is embedded into
9786 the environment of the shell command:
9789 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
9791 .It Ev MAILX_CONTENT
9792 The MIME content-type of the part, if known, the empty string otherwise.
9795 .It Ev MAILX_CONTENT_EVIDENCE
9797 .Va mime-counter-evidence
9798 includes the carry-around-bit (2), then this will be set to the detected
9799 MIME content-type; not only then identical to
9800 .Ev \&\&MAILX_CONTENT
9801 otherwise.
9804 .It Ev MAILX_FILENAME
9805 The filename, if any is set, the empty string otherwise.
9808 .It Ev MAILX_FILENAME_GENERATED
9809 A random string.
9812 .It Ev MAILX_FILENAME_TEMPORARY
9813 If temporary file creation has been requested through the command prefix
9814 this variable will be set and contain the absolute pathname of the
9815 temporary file.
9820 .It Va pipe-EXTENSION
9821 This is identical to
9822 .Va pipe-TYPE/SUBTYPE
9823 except that
9824 .Ql EXTENSION
9825 (normalized to lowercase using character mappings of the ASCII charset)
9826 names a file extension, e.g.,
9827 .Ql xhtml .
9828 Handlers registered using this method take precedence.
9830 .Mx Va pop3-auth
9831 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
9832 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
9833 The only possible value as of now is
9834 .Ql plain ,
9835 which is thus the default.
9838 .Mx Va pop3-bulk-load
9839 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
9840 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
9841 the messages, and only requests the message bodies on user request.
9842 For the POP3 protocol this means that the message headers will be
9843 downloaded twice.
9844 If this variable is set then \*(UA will download only complete messages
9845 from the given POP3 server(s) instead.
9847 .Mx Va pop3-keepalive
9848 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
9849 \*(OP POP3 servers close the connection after a period of inactivity;
9850 the standard requires this to be at least 10 minutes,
9851 but practical experience may vary.
9852 Setting this variable to a numeric value greater than
9853 .Ql 0
9854 causes a
9855 .Ql NOOP
9856 command to be sent each value seconds if no other operation is performed.
9858 .Mx Va pop3-no-apop
9859 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
9860 \*(BO\*(OP Unless this variable is set the
9861 .Ql APOP
9862 authentication method will be used when connecting to a POP3 server that
9863 advertises support.
9864 The advantage of
9865 .Ql APOP
9866 is that the password is not sent in clear text over the wire and that
9867 only a single packet is sent for the user/password tuple.
9868 Note that
9869 .Va pop3-no-apop-HOST
9870 requires \*(IN.
9872 .Mx Va pop3-use-starttls
9873 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
9874 \*(BO\*(OP Causes \*(UA to issue a
9875 .Ql STLS
9876 command to make an unencrypted POP3 session SSL/TLS encrypted.
9877 This functionality is not supported by all servers,
9878 and is not used if the session is already encrypted by the POP3S method.
9879 Note that
9880 .Va pop3-use-starttls-HOST
9881 requires \*(IN.
9885 .It Va posix
9886 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
9887 where that deviates from standardized behaviour.
9888 It will be set implicitly before the
9889 .Sx "Resource files"
9890 are loaded if the environment variable
9891 .Ev POSIXLY_CORRECT
9892 is set, and adjusting any of those two will be reflected by the other
9893 one implicitly.
9894 The following behaviour is covered and enforced by this mechanism:
9897 .Bl -bullet -compact
9899 In non-interactive mode, any error encountered while loading resource
9900 files during program startup will cause a program exit, whereas in
9901 interactive mode such errors will stop loading of the currently loaded
9902 (stack of) file(s, i.e., recursively).
9903 These exits can be circumvented on a per-command base by using
9904 .Cm ignerr ,
9905 one of the
9906 .Sx "Command modifiers" ,
9907 for each command which shall be allowed to fail.
9910 .Ic alternates
9911 will replace the list of alternate addresses instead of appending to it.
9914 Upon changing the active
9915 .Ic file
9916 no summary of
9917 .Ic headers
9918 will be displayed even if
9919 .Va header
9920 is set.
9923 Setting
9924 .Va ignoreeof
9925 implies the behaviour described by
9926 .Va dot .
9929 The variable
9930 .Va keep
9931 is extended to cover any empty mailbox, not only empty
9932 .Mx -sx
9933 .Sx "primary system mailbox" Ns
9934 es: they will be removed when they are left in empty state otherwise.
9939 .It Va print-alternatives
9940 \*(BO When a MIME message part of type
9941 .Ql multipart/alternative
9942 is displayed and it contains a subpart of type
9943 .Ql text/plain ,
9944 other parts are normally discarded.
9945 Setting this variable causes all subparts to be displayed,
9946 just as if the surrounding part was of type
9947 .Ql multipart/mixed .
9950 .It Va prompt
9951 The string used as a prompt in interactive mode.
9952 Whenever the variable is evaluated the value is expanded as via
9953 dollar-single-quote expansion (see
9954 .Sx "Shell-style argument quoting" ) .
9955 This (post-assignment, i.e., second) expansion can be used to embed
9956 status information, for example
9957 .Va \&? ,
9958 .Va \&! ,
9959 .Va account
9961 .Va mailbox-display .
9963 In order to embed characters which should not be counted when
9964 calculating the visual width of the resulting string, enclose the
9965 characters of interest in a pair of reverse solidus escaped brackets:
9966 .Ql \e[\eE[0m\e] ;
9967 a slot for coloured prompts is also available with the \*(OPal command
9968 .Ic colour .
9969 Prompting may be prevented by setting this to the null string
9970 (a.k.a.\|
9971 .Ql set noprompt ) .
9974 .It Va prompt2
9975 This string is used for secondary prompts, but is otherwise identical to
9976 .Va prompt .
9977 The default is
9978 .Ql ..\0 .
9981 .It Va quiet
9982 \*(BO Suppresses the printing of the version when first invoked.
9985 .It Va quote
9986 If set, \*(UA starts a replying message with the original message
9987 prefixed by the value of the variable
9988 .Va indentprefix .
9989 Normally, a heading consisting of
9990 .Dq Fromheaderfield wrote:
9991 is put before the quotation.
9992 If the string
9993 .Ql noheading
9994 is assigned to the
9995 .Va \&\&quote
9996 variable, this heading is omitted.
9997 If the string
9998 .Ql headers
9999 is assigned, only the headers selected by the
10000 .Ql type
10001 .Ic headerpick
10002 selection are put above the message body,
10003 thus
10004 .Va \&\&quote
10005 acts like an automatic
10006 .Pf ` Ic ~m Ns '
10007 .Sx "COMMAND ESCAPES"
10008 command, then.
10009 If the string
10010 .Ql allheaders
10011 is assigned, all headers are put above the message body and all MIME
10012 parts are included, making
10013 .Va \&\&quote
10014 act like an automatic
10015 .Pf ` Ic ~M Ns '
10016 command; also see
10017 .Va quote-as-attachment .
10020 .It Va quote-as-attachment
10021 \*(BO Add the original message in its entirety as a
10022 .Ql message/rfc822
10023 MIME attachment when replying to a message.
10024 Note this works regardless of the setting of
10025 .Va quote .
10028 .It Va quote-fold
10029 \*(OP Can be set in addition to
10030 .Va indentprefix .
10031 Setting this turns on a more fancy quotation algorithm in that leading
10032 quotation characters are compressed and overlong lines are folded.
10033 .Va \&\&quote-fold
10034 can be set to either one or two (space separated) numeric values,
10035 which are interpreted as the maximum (goal) and the minimum line length,
10036 respectively, in a spirit rather equal to the
10037 .Xr fmt 1
10038 program, but line-, not paragraph-based.
10039 If not set explicitly the minimum will reflect the goal algorithmically.
10040 The goal cannot be smaller than the length of
10041 .Va indentprefix
10042 plus some additional pad.
10043 Necessary adjustments take place silently.
10046 .It Va r-option-implicit
10047 \*(BO Setting this option evaluates the contents of
10048 .Va from
10049 (or, if that contains multiple addresses,
10050 .Va sender )
10051 and passes the results onto the used (file-based) MTA as described for the
10052 .Fl r
10053 option (empty argument case).
10056 .It Va recipients-in-cc
10057 \*(BO When doing a
10058 .Ic reply ,
10059 the original
10060 .Ql From:
10062 .Ql To:
10063 are by default merged into the new
10064 .Ql To: .
10065 If this variable is set, only the original
10066 .Ql From:
10067 ends in the new
10068 .Ql To: ,
10069 the rest is merged into
10070 .Ql Cc: .
10073 .It Va record
10074 Unless this variable is defined, no copies of outgoing mail will be saved.
10075 If defined it gives the pathname, subject to the usual
10076 .Sx "Filename transformations" ,
10077 of a folder where all new, replied-to or forwarded messages are saved:
10078 when saving to this folder fails the message is not sent, but instead
10079 .Va save Ns
10080 d to
10081 .Ev DEAD .
10082 The standard defines that relative (fully expanded) paths are to be
10083 interpreted relative to the current directory
10084 .Pf ( Ic cwd ) ,
10085 to force interpretation relative to
10086 .Va folder
10087 .Va outfolder
10088 needs to be set in addition.
10091 .It Va record-files
10092 \*(BO If this variable is set the meaning of
10093 .Va record
10094 will be extended to cover messages which target only file and pipe
10095 recipients (see
10096 .Va expandaddr ) .
10097 These address types will not appear in recipient lists unless
10098 .Va add-file-recipients
10099 is also set.
10102 .It Va record-resent
10103 \*(BO If this variable is set the meaning of
10104 .Va record
10105 will be extended to also cover the
10106 .Ic resend
10108 .Ic Resend
10109 commands.
10112 .It Va reply-in-same-charset
10113 \*(BO If this variable is set \*(UA first tries to use the same
10114 character set of the original message for replies.
10115 If this fails, the mechanism described in
10116 .Sx "Character sets"
10117 is evaluated as usual.
10120 .It Va reply-strings
10121 Can be set to a comma-separated list of (case-insensitive according to
10122 ASCII rules) strings which shall be recognized in addition to the
10123 built-in strings as
10124 .Ql Subject:
10125 reply message indicators \(en built-in are
10126 .Ql Re: ,
10127 which is mandated by RFC 5322, as well as the german
10128 .Ql Aw: ,
10129 .Ql Antw: ,
10130 and the
10131 .Ql Wg:
10132 which often has been seen in the wild;
10133 I.e., the separating colon has to be specified explicitly.
10136 .It Va reply-to
10137 A list of addresses to put into the
10138 .Ql Reply-To:
10139 field of the message header.
10140 Members of this list are handled as if they were in the
10141 .Ic alternates
10142 list.
10144 .It Va replyto
10145 \*(OB Variant of
10146 .Va reply-to .
10149 .It Va reply-to-honour
10150 Controls whether a
10151 .Ql Reply-To:
10152 header is honoured when replying to a message via
10153 .Ic reply
10155 .Ic Lreply .
10156 This is a quadoption; if set without a value it defaults to
10157 .Dq yes .
10160 .It Va rfc822-body-from_
10161 \*(BO This variable can be used to force displaying a so-called
10162 .Ql From_
10163 line for messages that are embedded into an envelope mail via the
10164 .Ql message/rfc822
10165 MIME mechanism, for more visual convenience.
10168 .It Va save
10169 \*(BO Enable saving of (partial) messages in
10170 .Ev DEAD
10171 upon interrupt or delivery error.
10174 .It Va screen
10175 The number of lines that represents a
10176 .Dq screenful
10177 of lines, used in
10178 .Ic headers
10179 summary display,
10180 .Ic from
10181 .Ic search Ns
10182 ing, message
10183 .Ic top Ns
10184 line display and scrolling via
10185 .Ic z .
10186 If this variable is not set \*(UA falls back to a calculation based upon
10187 the detected terminal window size and the baud rate: the faster the
10188 terminal, the more will be shown.
10189 Overall screen dimensions and pager usage is influenced by the
10190 environment variables
10191 .Ev COLUMNS
10193 .Ev LINES
10194 and the variable
10195 .Va crt .
10198 .It Va searchheaders
10199 \*(BO Expand message-list specifiers in the form
10200 .Ql /x:y
10201 to all messages containing the substring
10202 .Dq y
10203 in the header field
10204 .Ql x .
10205 The string search is case insensitive.
10208 .It Va sendcharsets
10209 \*(OP A comma-separated list of character set names that can be used in
10210 outgoing internet mail.
10211 The value of the variable
10212 .Va charset-8bit
10213 is automatically appended to this list of character sets.
10214 If no character set conversion capabilities are compiled into \*(UA then
10215 the only supported charset is
10216 .Va ttycharset .
10217 Also see
10218 .Va sendcharsets-else-ttycharset
10219 and refer to the section
10220 .Sx "Character sets"
10221 for the complete picture of character set conversion in \*(UA.
10224 .It Va sendcharsets-else-ttycharset
10225 \*(BO\*(OP If this variable is set, but
10226 .Va sendcharsets
10227 is not, then \*(UA acts as if
10228 .Va sendcharsets
10229 had been set to the value of the variable
10230 .Va ttycharset .
10231 In effect this combination passes through the message data in the
10232 character set of the current locale encoding:
10233 therefore mail message text will be (assumed to be) in ISO-8859-1
10234 encoding when send from within a ISO-8859-1 locale, and in UTF-8
10235 encoding when send from within an UTF-8 locale.
10237 The 8-bit fallback
10238 .Va charset-8bit
10239 never comes into play as
10240 .Va ttycharset
10241 is implicitly assumed to be 8-bit and capable to represent all files the
10242 user may specify (as is the case when no character set conversion
10243 support is available in \*(UA and the only supported character set is
10244 .Va ttycharset :
10245 .Sx "Character sets" ) .
10246 This might be a problem for scripts which use the suggested
10247 .Ql LC_ALL=C
10248 setting, since in this case the character set is US-ASCII by definition,
10249 so that it is better to also override
10250 .Va ttycharset ,
10251 then.
10254 .It Va sender
10255 An address that is put into the
10256 .Ql Sender:
10257 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
10258 responsible for the actual transmission of the message.
10259 This field should normally not be used unless the
10260 .Va from
10261 field contains more than one address, on which case it is required.
10263 .Va \&\&sender
10264 address is handled as if it were in the
10265 .Ic alternates
10266 list; also see
10267 .Fl r ,
10268 .Va r-option-implicit .
10270 .It Va sendmail
10271 \*(OB Predecessor of
10272 .Va mta .
10274 .It Va sendmail-arguments
10275 \*(OB Predecessor of
10276 .Va mta-arguments .
10278 .It Va sendmail-no-default-arguments
10279 \*(OB\*(BO Predecessor of
10280 .Va mta-no-default-arguments .
10282 .It Va sendmail-progname
10283 \*(OB Predecessor of
10284 .Va mta-argv0 .
10287 .It Va sendwait
10288 \*(BO When sending a message wait until the
10289 .Va mta
10290 (including the built-in SMTP one) exits before accepting further commands.
10291 .Sy Only
10292 with this variable set errors reported by the MTA will be recognizable!
10293 If the MTA returns a non-zero exit status,
10294 the exit status of \*(UA will also be non-zero.
10297 .It Va showlast
10298 \*(BO This setting causes \*(UA to start at the last message
10299 instead of the first one when opening a mail folder.
10302 .It Va showname
10303 \*(BO Causes \*(UA to use the sender's real name instead of the plain
10304 address in the header field summary and in message specifications.
10307 .It Va showto
10308 \*(BO Causes the recipient of the message to be shown in the header
10309 summary if the message was sent by the user.
10312 .It Va Sign
10313 The string to expand
10314 .Ic ~A
10315 to (see
10316 .Sx "COMMAND ESCAPES" ) .
10319 .It Va sign
10320 The string to expand
10321 .Ic ~a
10322 to (see
10323 .Sx "COMMAND ESCAPES" ) .
10326 .It Va signature
10327 Must correspond to the name of a readable file if set.
10328 The file's content is then appended to each singlepart message
10329 and to the first part of each multipart message.
10330 Be warned that there is no possibility to edit the signature for an
10331 individual message.
10334 .It Va skipemptybody
10335 \*(BO If an outgoing message does not contain any text in its first or
10336 only message part, do not send it but discard it silently (see also the
10337 command line option
10338 .Fl E ) .
10342 .It Va smime-ca-dir , smime-ca-file
10343 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10344 Enhanced Mail) format as a directory and a file, respectively, for the
10345 purpose of verification of S/MIME signed messages.
10346 It is possible to set both, the file will be loaded immediately, the
10347 directory will be searched whenever no match has yet been found.
10348 The set of CA certificates which are built into the SSL/TLS library can
10349 be explicitly turned off by setting
10350 .Va smime-ca-no-defaults ,
10351 and further fine-tuning is possible via
10352 .Va smime-ca-flags .
10355 .It Va smime-ca-flags
10356 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10357 storage, and the certificate verification that is used.
10358 The actual values and their meanings are documented for
10359 .Va ssl-ca-flags .
10362 .It Va smime-ca-no-defaults
10363 \*(BO\*(OP Do not load the default CA locations that are built into the
10364 used to SSL/TLS library to verify S/MIME signed messages.
10366 .Mx Va smime-cipher
10367 .It Va smime-cipher-USER@HOST , smime-cipher
10368 \*(OP Specifies the cipher to use when generating S/MIME encrypted
10369 messages (for the specified account).
10370 RFC 5751 mandates a default of
10371 .Ql aes128
10372 (AES-128 CBC).
10373 Possible values are (case-insensitive and) in decreasing cipher strength:
10374 .Ql aes256
10375 (AES-256 CBC),
10376 .Ql aes192
10377 (AES-192 CBC),
10378 .Ql aes128
10379 (AES-128 CBC),
10380 .Ql des3
10381 (DES EDE3 CBC, 168 bits; default if
10382 .Ql aes128
10383 is not available) and
10384 .Ql des
10385 (DES CBC, 56 bits).
10387 The actually available cipher algorithms depend on the cryptographic
10388 library that \*(UA uses.
10389 \*(OP Support for more cipher algorithms may be available through
10390 dynamic loading via, e.g.,
10391 .Xr EVP_get_cipherbyname 3
10392 (OpenSSL) if \*(UA has been compiled to support this.
10395 .It Va smime-crl-dir
10396 \*(OP Specifies a directory that contains files with CRLs in PEM format
10397 to use when verifying S/MIME messages.
10400 .It Va smime-crl-file
10401 \*(OP Specifies a file that contains a CRL in PEM format to use when
10402 verifying S/MIME messages.
10405 .It Va smime-encrypt-USER@HOST
10406 \*(OP If this variable is set, messages send to the given receiver are
10407 encrypted before sending.
10408 The value of the variable must be set to the name of a file that
10409 contains a certificate in PEM format.
10411 If a message is sent to multiple recipients,
10412 each of them for whom a corresponding variable is set will receive an
10413 individually encrypted message;
10414 other recipients will continue to receive the message in plain text
10415 unless the
10416 .Va smime-force-encryption
10417 variable is set.
10418 It is recommended to sign encrypted messages, i.e., to also set the
10419 .Va smime-sign
10420 variable.
10423 .It Va smime-force-encryption
10424 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
10427 .It Va smime-sign
10428 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
10429 and include the user's certificate as a MIME attachment.
10430 Signing a message enables a recipient to verify that the sender used
10431 a valid certificate,
10432 that the email addresses in the certificate match those in the message
10433 header and that the message content has not been altered.
10434 It does not change the message text,
10435 and people will be able to read the message as usual.
10436 Also see
10437 .Va smime-sign-cert , smime-sign-include-certs
10439 .Va smime-sign-message-digest .
10441 .Mx Va smime-sign-cert
10442 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
10443 \*(OP Points to a file in PEM format.
10444 For the purpose of signing and decryption this file needs to contain the
10445 user's private key, followed by his certificate.
10447 For message signing
10448 .Ql USER@HOST
10449 is always derived from the value of
10450 .Va from
10451 (or, if that contains multiple addresses,
10452 .Va sender ) .
10453 For the purpose of encryption the recipient's public encryption key
10454 (certificate) is expected; the command
10455 .Ic certsave
10456 can be used to save certificates of signed messages (the section
10457 .Sx "Signed and encrypted messages with S/MIME"
10458 gives some details).
10459 This mode of operation is usually driven by the specialized form.
10461 When decrypting messages the account is derived from the recipient
10462 fields
10463 .Pf ( Ql To:
10465 .Ql Cc: )
10466 of the message, which are searched for addresses for which such
10467 a variable is set.
10468 \*(UA always uses the first address that matches,
10469 so if the same message is sent to more than one of the user's addresses
10470 using different encryption keys, decryption might fail.
10472 For signing and decryption purposes it is possible to use encrypted
10473 keys, and the pseudo-host(s)
10474 .Ql USER@HOST.smime-cert-key
10475 for the private key
10476 (and
10477 .Ql USER@HOST.smime-cert-cert
10478 for the certificate stored in the same file)
10479 will be used for performing any necessary password lookup,
10480 therefore the lookup can be automatized via the mechanisms described in
10481 .Sx "On URL syntax and credential lookup" .
10482 For example, the hypothetical address
10483 .Ql bob@exam.ple
10484 could be driven with a private key / certificate pair path defined in
10485 .Va \&\&smime-sign-cert-bob@exam.ple ,
10486 and needed passwords would then be looked up via the pseudo hosts
10487 .Ql bob@exam.ple.smime-cert-key
10488 (and
10489 .Ql bob@exam.ple.smime-cert-cert ) .
10490 To include intermediate certificates, use
10491 .Va smime-sign-include-certs .
10493 .Mx Va smime-sign-include-certs
10494 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
10495 \*(OP If used, this is supposed to a consist of a comma-separated list
10496 of files, each of which containing a single certificate in PEM format to
10497 be included in the S/MIME message in addition to the
10498 .Va smime-sign-cert
10499 certificate.
10500 This can be used to include intermediate certificates of the certificate
10501 authority, in order to allow the receiver's S/MIME implementation to
10502 perform a verification of the entire certificate chain, starting from
10503 a local root certificate, over the intermediate certificates, down to the
10504 .Va smime-sign-cert .
10505 Even though top level certificates may also be included in the chain,
10506 they won't be used for the verification on the receiver's side.
10508 For the purpose of the mechanisms involved here,
10509 .Ql USER@HOST
10510 refers to the content of the internal variable
10511 .Va from
10512 (or, if that contains multiple addresses,
10513 .Va sender ) .
10514 The pseudo-host
10515 .Ql USER@HOST.smime-include-certs
10516 will be used for performing password lookups for these certificates,
10517 shall they have been given one, therefore the lookup can be automatized
10518 via the mechanisms described in
10519 .Sx "On URL syntax and credential lookup" .
10521 .Mx Va smime-sign-message-digest
10522 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
10523 \*(OP Specifies the message digest to use when signing S/MIME messages.
10524 RFC 5751 mandates a default of
10525 .Ql sha1 .
10526 Possible values are (case-insensitive and) in decreasing cipher strength:
10527 .Ql sha512 ,
10528 .Ql sha384 ,
10529 .Ql sha256 ,
10530 .Ql sha224
10532 .Ql md5 .
10534 The actually available message digest algorithms depend on the
10535 cryptographic library that \*(UA uses.
10536 \*(OP Support for more message digest algorithms may be available
10537 through dynamic loading via, e.g.,
10538 .Xr EVP_get_digestbyname 3
10539 (OpenSSL) if \*(UA has been compiled to support this.
10540 Remember that for this
10541 .Ql USER@HOST
10542 refers to the variable
10543 .Va from
10544 (or, if that contains multiple addresses,
10545 .Va sender ) .
10547 .It Va smtp
10548 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
10549 .Va mta .
10550 \*(ID For compatibility reasons a set
10551 .Va smtp
10552 is used in preference of
10553 .Va mta .
10555 .Mx Va smtp-auth
10556 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
10557 \*(OP Variable chain that controls the SMTP
10558 .Va mta
10559 authentication method, possible values are
10560 .Ql none
10561 (\*(OU default),
10562 .Ql plain
10563 (\*(IN default),
10564 .Ql login
10565 as well as the \*(OPal methods
10566 .Ql cram-md5
10568 .Ql gssapi .
10570 .Ql none
10571 method does not need any user credentials,
10572 .Ql gssapi
10573 requires a user name and all other methods require a user name and
10574 a password.
10575 See \*(IN
10576 .Va mta ,
10577 .Va user
10579 .Va password
10580 (\*(OU
10581 .Va smtp-auth-password
10583 .Va smtp-auth-user ) .
10584 Note that
10585 .Va smtp-auth-HOST
10586 is \*(IN.
10587 \*(OU: Note for
10588 .Va smtp-auth-USER@HOST :
10589 may override dependent on sender address in the variable
10590 .Va from .
10592 .It Va smtp-auth-password
10593 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
10594 If the authentication method requires a password, but neither
10595 .Va smtp-auth-password
10596 nor a matching
10597 .Va smtp-auth-password-USER@HOST
10598 can be found,
10599 \*(UA will ask for a password on the user's terminal.
10601 .It Va smtp-auth-password-USER@HOST
10602 \*(OU Overrides
10603 .Va smtp-auth-password
10604 for specific values of sender addresses, dependent upon the variable
10605 .Va from .
10607 .It Va smtp-auth-user
10608 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
10609 If the authentication method requires a user name, but neither
10610 .Va smtp-auth-user
10611 nor a matching
10612 .Va smtp-auth-user-USER@HOST
10613 can be found,
10614 \*(UA will ask for a user name on the user's terminal.
10616 .It Va smtp-auth-user-USER@HOST
10617 \*(OU Overrides
10618 .Va smtp-auth-user
10619 for specific values of sender addresses, dependent upon the variable
10620 .Va from .
10623 .It Va smtp-hostname
10624 \*(OP\*(IN Normally \*(UA uses the variable
10625 .Va from
10626 to derive the necessary
10627 .Ql USER@HOST
10628 information in order to issue a
10629 .Ql MAIL FROM:<>
10630 SMTP
10631 .Va mta
10632 command.
10633 Setting
10634 .Va smtp-hostname
10635 can be used to use the
10636 .Ql USER
10637 from the SMTP account
10638 .Pf ( Va mta
10639 or the
10640 .Va user
10641 variable chain)
10642 and the
10643 .Ql HOST
10644 from the content of this variable (or, if that is the empty string,
10645 .Va hostname
10646 or the local hostname as a last resort).
10647 This often allows using an address that is itself valid but hosted by
10648 a provider other than which (in
10649 .Va from )
10650 is about to send the message.
10651 Setting this variable also influences generated
10652 .Ql Message-ID:
10654 .Ql Content-ID:
10655 header fields.
10657 .Mx Va smtp-use-starttls
10658 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
10659 \*(BO\*(OP Causes \*(UA to issue a
10660 .Ql STARTTLS
10661 command to make an SMTP
10662 .Va mta
10663 session SSL/TLS encrypted, i.e., to enable transport layer security.
10665 .Mx Va socks-proxy
10666 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
10667 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
10668 \*(UA will proxy all of its network activities through it.
10669 This can be used to proxy SMTP, POP3 etc. network traffic through the
10670 Tor anonymizer, for example.
10671 The following would create a local SOCKS proxy on port 10000 that
10672 forwards to the machine
10673 .Ql HOST ,
10674 and from which the network traffic is actually instantiated:
10675 .Bd -literal -offset indent
10676 # Create local proxy server in terminal 1 forwarding to HOST
10677 $ ssh -D 10000 USER@HOST
10678 # Then, start a client that uses it in terminal 2
10679 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
10683 .It Va spam-interface
10684 \*(OP In order to use any of the spam-related commands (like, e.g.,
10685 .Ic spamrate )
10686 the desired spam interface must be defined by setting this variable.
10687 Please refer to the manual section
10688 .Sx "Handling spam"
10689 for the complete picture of spam handling in \*(UA.
10690 All or none of the following interfaces may be available:
10692 .Bl -tag -width ".It Ql _ilte_"
10693 .It Ql spamc
10694 Interaction with
10695 .Xr spamc 1
10696 from the
10697 .Xr spamassassin 1
10698 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
10699 suite.
10700 Different to the generic filter interface \*(UA will automatically add
10701 the correct arguments for a given command and has the necessary
10702 knowledge to parse the program's output.
10703 A default value for
10704 .Va spamc-command
10705 will have been compiled into the \*(UA binary if
10706 .Xr spamc 1
10707 has been found in
10708 .Ev PATH
10709 during compilation.
10710 Shall it be necessary to define a specific connection type (rather than
10711 using a configuration file for that), the variable
10712 .Va spamc-arguments
10713 can be used as in, e.g.,
10714 .Ql -d server.example.com -p 783 .
10715 It is also possible to specify a per-user configuration via
10716 .Va spamc-user .
10717 Note that this interface does not inspect the
10718 .Ql is-spam
10719 flag of a message for the command
10720 .Ic spamforget .
10722 .It Ql filter
10723 generic spam filter support via freely configurable hooks.
10724 This interface is meant for programs like
10725 .Xr bogofilter 1
10726 and requires according behaviour in respect to the hooks' exit
10727 status for at least the command
10728 .Ic spamrate
10729 .Pf ( Ql 0
10730 meaning a message is spam,
10731 .Ql 1
10732 for non-spam,
10733 .Ql 2
10734 for unsure and any other return value indicating a hard error);
10735 since the hooks can include shell code snippets diverting behaviour
10736 can be intercepted as necessary.
10737 The hooks are
10738 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
10739   spamfilter-rate
10741 .Va spamfilter-spam ;
10742 the manual section
10743 .Sx "Handling spam"
10744 contains examples for some programs.
10745 The process environment of the hooks will have the variable
10746 .Ev MAILX_FILENAME_GENERATED
10747 set.
10748 Note that spam score support for
10749 .Ic spamrate
10750 is not supported unless the \*(OPtional regular expression support is
10751 available and the
10752 .Va spamfilter-rate-scanscore
10753 variable is set.
10758 .It Va spam-maxsize
10759 \*(OP Messages that exceed this size will not be passed through to the
10760 configured
10761 .Va spam-interface .
10762 If unset or 0, the default of 420000 bytes is used.
10765 .It Va spamc-command
10766 \*(OP The path to the
10767 .Xr spamc 1
10768 program for the
10769 .Ql spamc
10770 .Va spam-interface .
10771 Note that the path is not expanded, but used
10772 .Dq as is .
10773 A fallback path will have been compiled into the \*(UA binary if the
10774 executable had been found during compilation.
10777 .It Va spamc-arguments
10778 \*(OP Even though \*(UA deals with most arguments for the
10779 .Ql spamc
10780 .Va spam-interface
10781 automatically, it may at least sometimes be desirable to specify
10782 connection-related ones via this variable, e.g.,
10783 .Ql -d server.example.com -p 783 .
10786 .It Va spamc-user
10787 \*(OP Specify a username for per-user configuration files for the
10788 .Ql spamc
10789 .Va spam-interface .
10790 If this is set to the empty string then \*(UA will use the name of the
10791 current
10792 .Va user .
10799 .It Va spamfilter-ham , spamfilter-noham , \
10800   spamfilter-nospam , spamfilter-rate , spamfilter-spam
10801 \*(OP Command and argument hooks for the
10802 .Ql filter
10803 .Va spam-interface .
10804 The manual section
10805 .Sx "Handling spam"
10806 contains examples for some programs.
10809 .It Va spamfilter-rate-scanscore
10810 \*(OP Because of the generic nature of the
10811 .Ql filter
10812 .Va spam-interface
10813 spam scores are not supported for it by default, but if the \*(OPnal
10814 regular expression support is available then setting this variable can
10815 be used to overcome this restriction.
10816 It is interpreted as follows: first a number (digits) is parsed that
10817 must be followed by a semicolon
10818 .Ql \&;
10819 and an extended regular expression.
10820 Then the latter is used to parse the first output line of the
10821 .Va spamfilter-rate
10822 hook, and, in case the evaluation is successful, the group that has been
10823 specified via the number is interpreted as a floating point scan score.
10827 .It Va ssl-ca-dir , ssl-ca-file
10828 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10829 Enhanced Mail) format as a directory and a file, respectively, for the
10830 purpose of verification of SSL/TLS server certificates.
10831 It is possible to set both, the file will be loaded immediately, the
10832 directory will be searched whenever no match has yet been found.
10833 The set of CA certificates which are built into the SSL/TLS library can
10834 be explicitly turned off by setting
10835 .Va ssl-ca-no-defaults ,
10836 and further fine-tuning is possible via
10837 .Va ssl-ca-flags ;
10838 also see
10839 .Xr SSL_CTX_load_verify_locations 3
10840 for more information.
10841 \*(UA will try to use the TLS/SNI (ServerNameIndication) extension when
10842 establishing TLS connections to servers identified with hostnames.
10846 .It Va ssl-ca-flags
10847 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10848 storage, and the certificate verification that is used (also see
10849 .Va ssl-verify ) .
10850 The value is expected to consist of a comma-separated list of
10851 configuration directives, with any intervening whitespace being ignored.
10852 The directives directly map to flags that can be passed to
10853 .Xr X509_STORE_set_flags 3 ,
10854 which are usually defined in a file
10855 .Pa openssl/x509_vfy.h ,
10856 and the availability of which depends on the used SSL/TLS library
10857 version: a directive without mapping is ignored (error log subject to
10858 .Va debug ) .
10859 Directives currently understood (case-insensitively) include:
10862 .Bl -tag -compact -width ".It Cd BaNg"
10863 .It Cd no-alt-chains
10864 If the initial chain is not trusted, do not attempt to build an
10865 alternative chain.
10866 Setting this flag will make OpenSSL certificate verification match that
10867 of older OpenSSL versions, before automatic building and checking of
10868 alternative chains has been implemented; also see
10869 .Cd trusted-first .
10870 .It Cd no-check-time
10871 Do not check certificate/CRL validity against current time.
10872 .It Cd partial-chain
10873 By default partial, incomplete chains which cannot be verified up to the
10874 chain top, a self-signed root certificate, will not verify.
10875 With this flag set, a chain succeeds to verify if at least one signing
10876 certificate of the chain is in any of the configured trusted stores of
10877 CA certificates.
10878 The OpenSSL manual page
10879 .Xr SSL_CTX_load_verify_locations 3
10880 gives some advise how to manage your own trusted store of CA certificates.
10881 .It Cd strict
10882 Disable workarounds for broken certificates.
10883 .It Cd trusted-first
10884 Try building a chain using issuers in the trusted store first to avoid
10885 problems with server-sent legacy intermediate certificates.
10886 Newer versions of OpenSSL support alternative chain checking and enable
10887 it by default, resulting in the same behaviour; also see
10888 .Cd no-alt-chains .
10893 .It Va ssl-ca-no-defaults
10894 \*(BO\*(OP Do not load the default CA locations that are built into the
10895 used to SSL/TLS library to verify SSL/TLS server certificates.
10897 .Mx Va ssl-cert
10898 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
10899 \*(OP Variable chain that sets the filename for a SSL/TLS client
10900 certificate required by some servers.
10901 This is a direct interface to the
10902 .Ql Certificate
10903 slot of the
10904 .Xr SSL_CONF_cmd 3
10905 function of the OpenSSL library, if available.
10907 .Mx Va ssl-cipher-list
10908 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
10909 \*(OP Specifies a list of ciphers for SSL/TLS connections.
10910 This is a direct interface to the
10911 .Ql CipherString
10912 slot of the
10913 .Xr SSL_CONF_cmd 3
10914 function of the OpenSSL library, if available; see
10915 .Xr ciphers 1
10917 .Xr SSL_CTX_set_cipher_list 3
10918 for more information.
10919 By default \*(UA does not set a list of ciphers, in effect using a
10920 .Va ssl-protocol
10921 specific cipher (protocol standards ship with a list of acceptable
10922 ciphers), possibly cramped to what the actually used SSL/TLS library
10923 supports \(en the manual section
10924 .Sx "An example configuration"
10925 also contains a SSL/TLS use case.
10928 .It Va ssl-config-file
10929 \*(OP If this variable is set \*(UA will call
10930 .Xr CONF_modules_load_file 3
10931 to allow OpenSSL to be configured according to the host system wide
10932 security settings.
10933 If a non-empty value is given then this will be used to specify the
10934 configuration file to be used instead of the global OpenSSL default;
10935 note that in this case it is an error if the file cannot be loaded.
10936 The application name will always be passed as
10937 .Dq \*(uA .
10939 .Mx Va ssl-curves
10940 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
10941 \*(OP Specifies a list of supported curves for SSL/TLS connections.
10942 This is a direct interface to the
10943 .Ql Curves
10944 slot of the
10945 .Xr SSL_CONF_cmd 3
10946 function of the OpenSSL library, if available; see
10947 .Xr SSL_CTX_set1_curves_list 3
10948 for more information.
10949 By default \*(UA does not set a list of curves.
10953 .It Va ssl-crl-dir , ssl-crl-file
10954 \*(OP Specify a directory / a file, respectively that contains a CRL in
10955 PEM format to use when verifying SSL/TLS server certificates.
10957 .Mx Va ssl-key
10958 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
10959 \*(OP Variable chain that sets the filename for the private key of
10960 a SSL/TLS client certificate.
10961 If unset, the name of the certificate file is used.
10962 The file is expected to be in PEM format.
10963 This is a direct interface to the
10964 .Ql PrivateKey
10965 slot of the
10966 .Xr SSL_CONF_cmd 3
10967 function of the OpenSSL library, if available.
10969 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
10970 \*(OB\*(OP Please use the newer and more flexible
10971 .Va ssl-protocol
10972 instead: if both values are set,
10973 .Va ssl-protocol
10974 will take precedence!
10975 Can be set to the following values, the actually used
10976 .Va ssl-protocol
10977 specification to which it is mapped is shown in parenthesis:
10978 .Ql tls1.2
10979 .Pf ( Ql -ALL, TLSv1.2 ) ,
10980 .Ql tls1.1
10981 .Pf ( Ql -ALL, TLSv1.1 ) ,
10982 .Ql tls1
10983 .Pf ( Ql -ALL, TLSv1 )
10985 .Ql ssl3
10986 .Pf ( Ql -ALL, SSLv3 ) ;
10987 the special value
10988 .Ql auto
10989 is mapped to
10990 .Ql ALL, -SSLv2
10991 and thus includes the SSLv3 protocol.
10992 Note that SSLv2 is no longer supported at all.
10994 .Mx Va ssl-protocol
10995 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
10996 \*(OP Specify the used SSL/TLS protocol.
10997 This is a direct interface to the
10998 .Ql Protocol
10999 slot of the
11000 .Xr SSL_CONF_cmd 3
11001 function of the OpenSSL library, if available;
11002 otherwise an \*(UA internal parser is used which understands the
11003 following subset of (case-insensitive) command strings:
11004 .Ql SSLv3 ,
11005 .Ql TLSv1 ,
11006 .Ql TLSv1.1
11008 .Ql TLSv1.2 ,
11009 as well as the special value
11010 .Ql ALL .
11011 Multiple specifications may be given via a comma-separated list which
11012 ignores any whitespace.
11013 An optional
11014 .Ql +
11015 plus sign prefix will enable a protocol, a
11016 .Ql -
11017 hyphen-minus prefix will disable it, so that
11018 .Ql -ALL, TLSv1.2
11019 will enable only the TLSv1.2 protocol.
11021 It depends upon the used TLS/SSL library which protocols are actually
11022 supported and which protocols are used if
11023 .Va ssl-protocol
11024 is not set, but note that SSLv2 is no longer supported at all and
11025 actively disabled.
11026 Especially for older protocols explicitly securing
11027 .Va ssl-cipher-list
11028 may be worthwile, see
11029 .Sx "An example configuration" .
11032 .It Va ssl-rand-egd
11033 \*(OP Gives the pathname to an entropy daemon socket, see
11034 .Xr RAND_egd 3 .
11035 Not all SSL/TLS libraries support this.
11038 .It Va ssl-rand-file
11039 \*(OP Gives the filename to a file with random entropy data, see
11040 .Xr RAND_load_file 3 .
11041 If this variable is not set, or set to the empty string, or if the
11042 .Sx "Filename transformations"
11043 fail, then
11044 .Xr RAND_file_name 3
11045 will be used to create the filename if, and only if,
11046 .Xr RAND_status 3
11047 documents that the SSL PRNG is not yet sufficiently seeded.
11048 If \*(UA successfully seeded the SSL PRNG then it will update the file
11049 .Pf ( Xr RAND_write_file 3 ) .
11050 This variable is only used if
11051 .Va ssl-rand-egd
11052 is not set (or not supported by the SSL/TLS library).
11054 .Mx Va ssl-verify
11055 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
11056 \*(OP Variable chain that sets the action to be performed if an error
11057 occurs during SSL/TLS server certificate validation against the
11058 specified or default trust stores
11059 .Va ssl-ca-dir ,
11060 .Va ssl-ca-file ,
11061 or the SSL/TLS library built-in defaults (unless usage disallowed via
11062 .Va ssl-ca-no-defaults ) ,
11063 and as fine-tuned via
11064 .Va ssl-ca-flags .
11065 Valid (case-insensitive) values are
11066 .Ql strict
11067 (fail and close connection immediately),
11068 .Ql ask
11069 (ask whether to continue on standard input),
11070 .Ql warn
11071 (show a warning and continue),
11072 .Ql ignore
11073 (do not perform validation).
11074 The default is
11075 .Ql ask .
11078 .It Va stealthmua
11079 If only set without an assigned value, then this setting inhibits the
11080 generation of the
11081 .Ql Message-ID: ,
11082 .Ql Content-ID:
11084 .Ql User-Agent:
11085 header fields that include obvious references to \*(UA.
11086 There are two pitfalls associated with this:
11087 First, the message id of outgoing messages is not known anymore.
11088 Second, an expert may still use the remaining information in the header
11089 to track down the originating mail user agent.
11090 If set to the value
11091 .Ql noagent ,
11092 then the mentioned
11093 .Ql Message-ID:
11095 .Ql Content-ID:
11096 suppression does not occur.
11100 .It Va termcap
11101 (\*(OP) This specifies a comma-separated list of
11102 .Lb libterminfo
11103 and/or
11104 .Lb libtermcap
11105 capabilities (see
11106 .Sx "On terminal control and line editor" ,
11107 escape commas with reverse solidus) to be used to overwrite or define
11108 entries.
11109 .Sy Note
11110 this variable will only be queried once at program startup and can
11111 thus only be specified in resource files or on the command line.
11114 String capabilities form
11115 .Ql cap=value
11116 pairs and are expected unless noted otherwise.
11117 Numerics have to be notated as
11118 .Ql cap#number
11119 where the number is expected in normal decimal notation.
11120 Finally, booleans do not have any value but indicate a true or false
11121 state simply by being defined or not; this indeed means that \*(UA
11122 does not support undefining an existing boolean.
11123 String capability values will undergo some expansions before use:
11124 for one notations like
11125 .Ql ^LETTER
11126 stand for
11127 .Ql control-LETTER ,
11128 and for clarification purposes
11129 .Ql \eE
11130 can be used to specify
11131 .Ql escape
11132 (the control notation
11133 .Ql ^[
11134 could lead to misreadings when a left bracket follows, which it does for
11135 the standard CSI sequence);
11136 finally three letter octal sequences, as in
11137 .Ql \e061 ,
11138 are supported.
11139 To specify that a terminal supports 256-colours, and to define sequences
11140 that home the cursor and produce an audible bell, one might write:
11142 .Bd -literal -offset indent
11143 ? set termcap='Co#256,home=\eE[H,bel=^G'
11147 The following terminal capabilities are or may be meaningful for the
11148 operation of the built-in line editor or \*(UA in general:
11151 .Bl -tag -compact -width ".It Cd yay"
11152 .\" HAVE_COLOUR
11153 .It Cd colors Ns \0or Cd Co
11154 .Cd max_colors :
11155 numeric capability specifying the maximum number of colours.
11156 Note that \*(UA does not actually care about the terminal beside that,
11157 but always emits ANSI / ISO 6429 escape sequences.
11159 .\" HAVE_TERMCAP
11160 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
11161 .Cd exit_ca_mode
11163 .Cd enter_ca_mode ,
11164 respectively: exit and enter the alternative screen ca-mode,
11165 effectively turning \*(UA into a fullscreen application.
11166 This must be enabled explicitly by setting
11167 .Va termcap-ca-mode .
11169 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
11170 .Cd keypad_xmit
11172 .Cd keypad_local ,
11173 respectively: enable and disable the keypad.
11174 This is always enabled if available, because it seems even keyboards
11175 without keypads generate other key codes for, e.g., cursor keys in that
11176 case, and only if enabled we see the codes that we are interested in.
11178 .It Cd ed Ns \0or Cd cd
11179 .Cd clr_eos :
11180 clear the screen.
11182 .It Cd clear Ns \0or Cd cl
11183 .Cd clear_screen :
11184 clear the screen and home cursor.
11185 (Will be simulated via
11186 .Cd ho
11187 plus
11188 .Cd cd . )
11190 .It Cd home Ns \0or Cd ho
11191 .Cd cursor_home :
11192 home cursor.
11194 .\" HAVE_MLE
11195 .It Cd el Ns \0or Cd ce
11196 .Cd clr_eol :
11197 clear to the end of line.
11198 (Will be simulated via
11199 .Cd ch
11200 plus repetitions of space characters.)
11202 .It Cd hpa Ns \0or Cd ch
11203 .Cd column_address :
11204 move the cursor (to the given column parameter) in the current row.
11205 (Will be simulated via
11206 .Cd cr
11207 plus
11208 .Cd nd . )
11210 .It Cd cr
11211 .Cd carriage_return :
11212 move to the first column in the current row.
11213 The default built-in fallback is
11214 .Ql \er .
11216 .It Cd cub1 Ns \0or Cd le
11217 .Cd cursor_left :
11218 move the cursor left one space (non-destructively).
11219 The default built-in fallback is
11220 .Ql \eb .
11222 .It Cd cuf1 Ns \0or Cd nd
11223 .Cd cursor_right :
11224 move the cursor right one space (non-destructively).
11225 The default built-in fallback is
11226 .Ql \eE[C ,
11227 which is used by most terminals.
11228 Less often occur
11229 .Ql \eEC
11231 .Ql \eEOC .
11235 Many more capabilities which describe key-sequences are documented for
11236 .Ic bind .
11240 .It Va termcap-ca-mode
11241 \*(OP Allow usage of the
11242 .Cd exit_ca_mode
11244 .Cd enter_ca_mode
11245 terminal capabilities, effectively turning \*(UA into a fullscreen
11246 application, as documented for
11247 .Va termcap .
11248 .Sy Note
11249 this variable will only be queried once at program startup and can
11250 thus only be specified in resource files or on the command line.
11253 .It Va termcap-disable
11254 \*(OP Disable any interaction with a terminal control library.
11255 If set only some generic fallback built-ins and possibly the content of
11256 .Va termcap
11257 describe the terminal to \*(UA.
11258 .Sy Note
11259 this variable will only be queried once at program startup and can
11260 thus only be specified in resource files or on the command line.
11263 .It Va toplines
11264 If defined, gives the number of lines of a message to be displayed
11265 with the command
11266 .Ic top ;
11267 if unset, the first five lines are printed, if set to 0 the variable
11268 .Va screen
11269 is inspected.
11270 If the value is negative then its absolute value will be used for
11271 unsigned right shifting (see
11272 .Ic vexpr )
11274 .Va screen
11275 height.
11278 .It Va topsqueeze
11279 \*(BO If set then the
11280 .Ic top
11281 command series will strip adjacent empty lines and quotations.
11284 .It Va ttycharset
11285 The character set of the terminal \*(UA operates on,
11286 and the one and only supported character set that \*(UA can use if no
11287 character set conversion capabilities have been compiled into it,
11288 in which case it defaults to ISO-8859-1 unless it can deduce a value
11289 from the locale specified in the
11290 .Ev LC_CTYPE
11291 environment variable (if supported, see there for more).
11292 It defaults to UTF-8 if conversion is available.
11293 Refer to the section
11294 .Sx "Character sets"
11295 for the complete picture about character sets.
11298 .It Va typescript-mode
11299 \*(BO A special multiplex variable that disables all variables and
11300 settings which result in behaviour that interferes with running \*(UA in
11301 .Xr script 1 ,
11302 e.g., it sets
11303 .Va colour-disable ,
11304 .Va line-editor-disable
11305 and (before startup completed only)
11306 .Va termcap-disable .
11307 Unsetting it does not restore the former state of the covered settings.
11310 .It Va umask
11311 For a safety-by-default policy \*(UA sets its process
11312 .Xr umask 2
11314 .Ql 0077 ,
11315 but this variable can be used to override that:
11316 set it to an empty value to do not change the (current) setting (on
11317 startup), otherwise the process file mode creation mask is updated to
11318 the new value.
11319 Child processes inherit the process file mode creation mask.
11321 .Mx Va user
11322 .It Va user-HOST , user
11323 \*(IN Variable chain that sets a global fallback user name, which is
11324 used in case none has been given in the protocol and account-specific
11325 URL.
11326 This variable defaults to the name of the user who runs \*(UA.
11329 .It Va v15-compat
11330 \*(BO Setting this enables upward compatibility with \*(UA
11331 version 15.0 in respect to which configuration options are available and
11332 how they are handled.
11333 This manual uses \*(IN and \*(OU to refer to the new and the old way of
11334 doing things, respectively.
11337 .It Va verbose
11338 \*(BO This setting, also controllable via the command line option
11339 .Fl v ,
11340 causes \*(UA to be more verbose, e.g., it will display obsoletion
11341 warnings and SSL/TLS certificate chains.
11342 Even though marked \*(BO this option may be set twice in order to
11343 increase the level of verbosity even more, in which case even details of
11344 the actual message delivery and protocol conversations are shown.
11345 A single
11346 .Pf no Va verbose
11347 is sufficient to disable verbosity as such.
11354 .It Va version , version-date , version-major , version-minor , version-update
11355 \*(RO \*(UA version information: the first variable contains a string
11356 containing the complete version identification, the latter three contain
11357 only digits: the major, minor and update version numbers.
11358 The date is in ISO 8601 notation.
11359 The output of the command
11360 .Ic version
11361 will include this information.
11364 .It Va writebackedited
11365 If this variable is set messages modified using the
11366 .Ic edit
11368 .Ic visual
11369 commands are written back to the current folder when it is quit;
11370 it is only honoured for writable folders in MBOX format, though.
11371 Note that the editor will be pointed to the raw message content in that
11372 case, i.e., neither MIME decoding nor decryption will have been
11373 performed, and proper RFC 4155
11374 .Ql From_
11375 quoting of newly added or edited content is also left as an excercise to
11376 the user.
11378 .\" }}} (Variables)
11380 .\" }}} (INTERNAL VARIABLES)
11383 .\" .Sh ENVIRONMENT {{{
11384 .Sh ENVIRONMENT
11386 The term
11387 .Dq environment variable
11388 should be considered an indication that these variables are either
11389 standardized as vivid parts of process environments, or that they are
11390 commonly found in there.
11391 The process environment is inherited from the
11392 .Xr sh 1
11393 once \*(UA is started, and unless otherwise explicitly noted handling of
11394 the following variables transparently integrates into that of the
11395 .Sx "INTERNAL VARIABLES"
11396 from \*(UA's point of view.
11397 This means that, e.g., they can be managed via
11398 .Ic set
11400 .Ic unset ,
11401 causing automatic program environment updates (to be inherited by
11402 newly created child processes).
11405 In order to transparently integrate other environment variables equally
11406 they need to be imported (linked) with the command
11407 .Ic environ .
11408 This command can also be used to set and unset non-integrated
11409 environment variables from scratch, sufficient system support provided.
11410 The following example, applicable to a POSIX shell, sets the
11411 .Ev COLUMNS
11412 environment variable for \*(UA only, and beforehand exports the
11413 .Ev EDITOR
11414 in order to affect any further processing in the running shell:
11416 .Bd -literal -offset indent
11417 $ EDITOR="vim -u ${HOME}/.vimrc"
11418 $ export EDITOR
11419 $ COLUMNS=80 \*(uA -R
11422 .Bl -tag -width ".It Ev BaNg"
11424 .It Ev COLUMNS
11425 The user's preferred width in column positions for the terminal screen
11426 or window.
11427 Queried and used once on program startup, actively managed for child
11428 processes and the MLE (see
11429 .Sx "On terminal control and line editor" )
11430 in interactive mode thereafter.
11431 Ignored in non-interactive mode, which always uses 80 columns, unless in
11432 .fl #
11433 batch mode.
11436 .It Ev DEAD
11437 The name of the (mailbox)
11438 .Ic file
11439 to use for saving aborted messages if
11440 .Va save
11441 is set; this defaults to
11442 .Pa dead.letter
11443 in the user's
11444 .Ev HOME
11445 directory.
11446 If the variable
11447 .Va debug
11448 is set no output will be generated, otherwise the contents of the file
11449 will be replaced.
11452 .It Ev EDITOR
11453 Pathname of the text editor to use in the
11454 .Ic edit
11455 command and
11456 .Ic ~e
11457 .Sx "COMMAND ESCAPES" .
11458 A default editor is used if this value is not defined.
11461 .It Ev HOME
11462 The user's home directory.
11463 This variable is only used when it resides in the process environment.
11464 The calling user's home directory will be used instead if this directory
11465 does not exist, is not accessible or cannot be read.
11466 (No test for being writable is performed to allow usage by
11467 non-privileged users within read-only jails, but dependent on the
11468 variable settings this directory is a default write target, e.g. for
11469 .Ev DEAD ,
11470 .Ev MBOX
11471 and more.)
11476 .It Ev LC_ALL , LC_CTYPE , LANG
11477 \*(OP The (names in lookup order of the)
11478 .Xr locale 7
11479 (and / or see
11480 .Xr setlocale 3 )
11481 which indicates the used
11482 .Sx "Character sets" .
11483 Runtime changes trigger automatic updates of the entire locale system,
11484 updating and overwriting also a
11485 .Va ttycharset
11486 set by the user.
11489 .It Ev LINES
11490 The user's preferred number of lines on a page or the vertical screen
11491 or window size in lines.
11492 Queried and used once on program startup, actively managed for child
11493 processes in interactive mode thereafter.
11494 Ignored in non-interactive mode, which always uses 24 lines, unless in
11495 .fl #
11496 batch mode.
11499 .It Ev LISTER
11500 Pathname of the directory lister to use in the
11501 .Ic folders
11502 command when operating on local mailboxes.
11503 Default is
11504 .Xr ls 1
11505 (path search through
11506 .Ev SHELL ) .
11509 .It Ev LOGNAME
11510 Upon startup \*(UA will actively ensure that this variable refers to the
11511 name of the user who runs \*(UA, in order to be able to pass a verified
11512 name to any newly created child process.
11515 .It Ev MAIL
11516 Is used as the users
11517 .Mx -sx
11518 .Sx "primary system mailbox"
11519 unless
11520 .Va inbox
11521 is set.
11522 This is assumed to be an absolute pathname.
11525 .It Ev MAILCAPS
11526 \*(OP Overrides the default path search for
11527 .Sx "The Mailcap files" ,
11528 which is defined in the standard RFC 1524 as
11529 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
11530 .\" TODO we should have a mailcaps-default virtual RDONLY option!
11531 (\*(UA makes it a configuration option, however.)
11532 Note this is not a search path, but a path search.
11535 .It Ev MAILRC
11536 Is used as a startup file instead of
11537 .Pa \*(ur
11538 if set.
11539 When \*(UA scripts are invoked on behalf of other users,
11540 either this variable should be set to
11541 .Pa /dev/null
11542 or the
11543 .Fl \&:
11544 command line option should be used in order to avoid side-effects from
11545 reading their configuration files.
11546 This variable is only used when it resides in the process environment.
11549 .It Ev MAILX_NO_SYSTEM_RC
11550 If this variable is set then reading of
11551 .Pa \*(UR
11552 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
11553 had been started up with the option
11554 .Fl \&:
11555 (and according argument) or
11556 .Fl n .
11557 This variable is only used when it resides in the process environment.
11560 .It Ev MBOX
11561 The name of the users
11562 .Mx -sx
11563 .Sx "secondary mailbox"
11564 file.
11565 A logical subset of the special
11566 .Sx "Filename transformations"
11567 (also see
11568 .Ic file )
11569 are supported.
11570 The default is
11571 .Pa ~/mbox .
11572 Traditionally this MBOX is used as the file to save messages from the
11573 .Mx -sx
11574 .Sx "primary system mailbox"
11575 that have been read.
11576 Also see
11577 .Sx "Message states" .
11580 .It Ev NETRC
11581 \*(IN\*(OP This variable overrides the default location of the user's
11582 .Pa ~/.netrc
11583 file.
11586 .It Ev PAGER
11587 Pathname of the program to use for backing the command
11588 .Ic more ,
11589 and when the
11590 .Va crt
11591 variable enforces usage of a pager for output.
11592 The default paginator is
11593 .Xr more 1
11594 (path search through
11595 .Ev SHELL ) .
11597 \*(UA inspects the contents of this variable: if its contains the string
11598 .Dq less
11599 then a non-existing environment variable
11600 .Ev LESS
11601 will be set to
11602 .Ql Ri ,
11603 likewise for
11604 .Dq lv
11605 .Ev LV
11606 will optionally be set to
11607 .Ql -c .
11608 Alse see
11609 .Va colour-pager .
11612 .It Ev PATH
11613 A colon-separated list of directories that is searched by the shell when
11614 looking for commands, e.g.,
11615 .Ql /bin:/usr/bin:/usr/local/bin .
11618 .It Ev POSIXLY_CORRECT
11619 This variable is automatically looked for upon startup, see
11620 .Va posix
11621 for more.
11624 .It Ev SHELL
11625 The shell to use for the commands
11626 .Ic \&! ,
11627 .Ic shell ,
11629 .Ic ~!
11630 .Sx "COMMAND ESCAPES"
11631 and when starting subprocesses.
11632 A default shell is used if this environment variable is not defined.
11635 .It Ev SOURCE_DATE_EPOCH
11636 This specifies a time in seconds since the Unix epoch (1970-01-01) to be
11637 used in place of the current time.
11638 This variable is looked up upon program startup, and its existence will
11639 switch \*(UA to a completely reproducible mode which causes
11640 deterministic random numbers, a special fixed (non-existent?)
11641 .Ev LOGNAME
11642 and more to be used and set.
11643 It is to be used during development or by software packagers.
11644 \*(ID Currently an invalid setting is only ignored, rather than causing
11645 a program abortion.
11647 .Dl $ SOURCE_DATE_EPOCH=`date +%s` \*(uA
11650 .It Ev TERM
11651 \*(OP The terminal type for which output is to be prepared.
11652 For extended colour and font control please refer to
11653 .Sx "Coloured display" ,
11654 and for terminal management in general to
11655 .Sx "On terminal control and line editor" .
11658 .It Ev TMPDIR
11659 Used as directory for temporary files instead of
11660 .Pa /tmp ,
11661 if set, existent, accessible as well as read- and writable.
11662 This variable is only used when it resides in the process environment,
11663 but \*(UA will ensure at startup that this environment variable is
11664 updated to contain a usable temporary directory.
11667 .It Ev USER
11668 Identical to
11669 .Ev LOGNAME
11670 (see there), but this variable is not standardized, should therefore not
11671 be used, and is only corrected if already set.
11674 .It Ev VISUAL
11675 Pathname of the text editor to use in the
11676 .Ic visual
11677 command and
11678 .Ic ~v
11679 .Sx "COMMAND ESCAPES" .
11682 .\" }}}
11685 .\" .Sh FILES {{{
11686 .Sh FILES
11688 .\" file list {{{
11689 .Bl -tag -width ".It Pa BaNg"
11690 .It Pa \*(ur
11691 File giving initial commands, one of the
11692 .Sx "Resource files" .
11694 .It Pa \*(UR
11695 System wide initialization file, one of the
11696 .Sx "Resource files" .
11699 .It Pa ~/.mailcap
11700 \*(OP Personal MIME type handler definition file, see
11701 .Sx "The Mailcap files" .
11702 This location is part of the RFC 1524 standard search path, which is
11703 a configuration option and can be overridden via
11704 .Ev MAILCAPS .
11707 .It Pa /etc/mailcap
11708 \*(OP System wide MIME type handler definition file, see
11709 .Sx "The Mailcap files" .
11710 This location is part of the RFC 1524 standard search path, which is
11711 a configuration option and can be overridden via
11714 .It Pa ~/mbox
11715 The default value for
11716 .Ev MBOX .
11717 The actually used path is a configuration option.
11720 .It Pa ~/.mime.types
11721 Personal MIME types, see
11722 .Sx "The mime.types files" .
11723 The actually used path is a configuration option.
11726 .It Pa /etc/mime.types
11727 System wide MIME types, see
11728 .Sx "The mime.types files" .
11729 The actually used path is a configuration option.
11732 .It Pa ~/.netrc
11733 \*(IN\*(OP The default location of the users
11734 .Pa .netrc
11735 file \(en the section
11736 .Sx "The .netrc file"
11737 documents the file format.
11738 The actually used path is a configuration option and can be overridden via
11739 .Ev NETRC .
11742 .It Pa /dev/null
11743 The data sink
11744 .Xr null 4 .
11745 The actually used path is a compile-time constant.
11747 .\" }}}
11749 .\" .Ss "Resource files" {{{
11750 .Ss "Resource files"
11752 Upon startup \*(UA reads in several resource files:
11754 .Bl -tag -width ".It Pa BaNg"
11756 .It Pa \*(UR
11757 System wide initialization file.
11758 Reading of this file can be suppressed, either by using the
11759 .Fl \&:
11760 (and according argument) or
11761 .Fl n
11762 command line options, or by setting the
11763 .Sx ENVIRONMENT
11764 variable
11765 .Ev MAILX_NO_SYSTEM_RC .
11768 .It Pa \*(ur
11769 File giving initial commands.
11770 A different file can be chosen by setting the
11771 .Sx ENVIRONMENT
11772 variable
11773 .Ev MAILRC .
11774 Reading of this file can be suppressed with the
11775 .Fl \&:
11776 command line option.
11778 .It Va mailx-extra-rc
11779 Defines a startup file to be read after all other resource files.
11780 It can be used to specify settings that are not understood by other
11781 .Xr mailx 1
11782 implementations, for example.
11783 This variable is only honoured when defined in a resource file, e.g.,
11784 it is one of the
11785 .Sx "INTERNAL VARIABLES" .
11789 The content of these files is interpreted as follows:
11792 .Bl -bullet -compact
11794 The whitespace characters space, tabulator and newline,
11795 as well as those defined by the variable
11796 .Va ifs ,
11797 are removed from the beginning and end of input lines.
11799 Empty lines are ignored.
11801 Any other line is interpreted as a command.
11802 It may be spread over multiple input lines if the newline character is
11803 .Dq escaped
11804 by placing a reverse solidus character
11805 .Ql \e
11806 as the last character of the line; whereas any leading whitespace of
11807 follow lines is ignored, trailing whitespace before a escaped newline
11808 remains in the input.
11810 If the line (content) starts with the number sign
11811 .Ql #
11812 then it is a comment-command and also ignored.
11813 (The comment-command is a real command, which does nothing, and
11814 therefore the usual follow lines mechanism applies!)
11818 Unless \*(UA is about to enter interactive mode syntax errors that occur
11819 while loading these files are treated as errors and cause program exit.
11820 More files with syntactically equal content can be
11821 .Ic source Ns ed .
11822 The following, saved in a file, would be an examplary content:
11824 .Bd -literal -offset indent
11825  # This line is a comment command.  And y\e
11826     es, it is really continued here.
11827 set debug \e
11828     verbose
11829     set editheaders
11831 .\" }}}
11833 .\" .Ss "The mime.types files" {{{
11834 .Ss "The mime.types files"
11836 As stated in
11837 .Sx "HTML mail and MIME attachments"
11838 \*(UA needs to learn about MIME (Multipurpose Internet Mail Extensions)
11839 media types in order to classify message and attachment content.
11840 One source for them are
11841 .Pa mime.types
11842 files, the loading of which can be controlled by setting the variable
11843 .Va mimetypes-load-control .
11844 Another is the command
11845 .Ic mimetype ,
11846 which also offers access to \*(UAs MIME type cache.
11847 .Pa mime.types
11848 files have the following syntax:
11850 .Bd -literal -offset indent
11851 type/subtype extension [extension ...]
11852 # E.g., text/html html htm
11856 where
11857 .Ql type/subtype
11858 define the MIME media type, as standardized in RFC 2046:
11859 .Ql type
11860 is used to declare the general type of data, while the
11861 .Ql subtype
11862 specifies a specific format for that type of data.
11863 One or multiple filename
11864 .Ql extension Ns
11865 s, separated by whitespace, can be bound to the media type format.
11866 Comments may be introduced anywhere on a line with a number sign
11867 .Ql # ,
11868 causing the remaining line to be discarded.
11870 \*(UA also supports an extended, non-portable syntax in especially
11871 crafted files, which can be loaded via the alternative value syntax of
11872 .Va mimetypes-load-control ,
11873 and prepends an optional
11874 .Ql type-marker :
11877 .Dl [type-marker ]type/subtype extension [extension ...]
11880 The following type markers are supported:
11883 .Bl -tag -compact -width ".It Ar _n_u"
11884 .It Ar @
11885 Treat message parts with this content as plain text.
11886 .It Ar @t
11887 The same as plain
11888 .Ar @ .
11889 .It Ar @h
11890 Treat message parts with this content as HTML tagsoup.
11891 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
11892 the content as plain text instead.
11893 .It Ar @H
11894 Likewise
11895 .Ar @h ,
11896 but instead of falling back to plain text require an explicit content
11897 handler to be defined.
11901 Further reading:
11902 for sending messages:
11903 .Ic mimetype ,
11904 .Va mime-allow-text-controls ,
11905 .Va mimetypes-load-control .
11906 For reading etc. messages:
11907 .Sx "HTML mail and MIME attachments" ,
11908 .Sx "The Mailcap files" ,
11909 .Ic mimetype ,
11910 .Va mime-counter-evidence ,
11911 .Va mimetypes-load-control ,
11912 .Va pipe-TYPE/SUBTYPE ,
11913 .Va pipe-EXTENSION .
11914 .\" }}}
11916 .\" .Ss "The Mailcap files" {{{
11917 .Ss "The Mailcap files"
11919 .\" TODO MAILCAP DISABLED
11920 .Sy This feature is not available in v14.9.0, sorry!
11921 RFC 1524 defines a
11922 .Dq User Agent Configuration Mechanism
11923 which \*(UA \*(OPally supports (see
11924 .Sx "HTML mail and MIME attachments" ) .
11925 It defines a file format to be used to inform mail user agent programs
11926 about the locally-installed facilities for handling various data
11927 formats, i.e., about commands and how they can be used to display, edit
11928 et cetera MIME part contents, as well as a default path search that
11929 includes multiple possible locations of
11930 .Dq mailcap
11931 files and the
11932 .Ev MAILCAPS
11933 environment variable that can be used to overwrite that (repeating here
11934 that it is not a search path, but instead a path search specification).
11935 Any existing files will be loaded in sequence, appending any content to
11936 the list of MIME type handler directives.
11939 .Dq Mailcap
11940 files consist of a set of newline separated entries.
11941 Comment lines start with a number sign
11942 .Ql #
11943 (in the first column!) and are ignored.
11944 Empty lines are also ignored.
11945 All other lines form individual entries that must adhere to the syntax
11946 described below.
11947 To extend a single entry (not comment) its line can be continued on
11948 follow lines if newline characters are
11949 .Dq escaped
11950 by preceding them with the reverse solidus character
11951 .Ql \e .
11952 The standard does not specify how leading whitespace of follow lines
11953 is to be treated, therefore \*(UA retains it.
11956 .Dq Mailcap
11957 entries consist of a number of semicolon
11958 .Ql \&;
11959 separated fields, and the reverse solidus
11960 .Ql \e
11961 character can be used to escape any following character including
11962 semicolon and itself.
11963 The first two fields are mandatory and must occur in the specified
11964 order, the remaining fields are optional and may appear in any order.
11965 Leading and trailing whitespace of content is ignored (removed).
11968 The first field defines the MIME
11969 .Ql TYPE/SUBTYPE
11970 the entry is about to handle (case-insensitively, and no reverse solidus
11971 escaping is possible in this field).
11972 If the subtype is specified as an asterisk
11973 .Ql *
11974 the entry is meant to match all subtypes of the named type, e.g.,
11975 .Ql audio/*
11976 would match any audio type.
11977 The second field defines the shell command which shall be used to
11978 .Dq display
11979 MIME parts of the given type; it is implicitly called the
11980 .Cd view
11981 command.
11984 For data
11985 .Dq consuming
11986 shell commands message (MIME part) data is passed via standard input
11987 unless the given shell command includes one or more instances of the
11988 (unquoted) string
11989 .Ql %s ,
11990 in which case these instances will be replaced with a temporary filename
11991 and the data will have been stored in the file that is being pointed to.
11992 Likewise, for data
11993 .Dq producing
11994 shell commands data is assumed to be generated on standard output unless
11995 the given command includes (one ore multiple)
11996 .Ql %s .
11997 In any case any given
11998 .Ql %s
11999 format is replaced with a(n already) properly quoted filename.
12000 Note that when a command makes use of a temporary file via
12001 .Ql %s
12002 then \*(UA will remove it again, as if the
12003 .Cd x-mailx-tmpfile ,
12004 .Cd x-mailx-tmpfile-fill
12006 .Cd x-mailx-tmpfile-unlink
12007 flags had been set; see below for more.
12010 The optional fields either define a shell command or an attribute (flag)
12011 value, the latter being a single word and the former being a keyword
12012 naming the field followed by an equals sign
12013 .Ql =
12014 succeeded by a shell command, and as usual for any
12015 .Dq Mailcap
12016 content any whitespace surrounding the equals sign will be removed, too.
12017 Optional fields include the following:
12020 .Bl -tag -width ".It Cd BaNg"
12021 .It Cd compose
12022 A program that can be used to compose a new body or body part in the
12023 given format.
12024 (Currently unused.)
12026 .It Cd composetyped
12027 Similar to the
12028 .Cd compose
12029 field, but is to be used when the composing program needs to specify the
12030 .Ql Content-type:
12031 header field to be applied to the composed data.
12032 (Currently unused.)
12034 .It Cd edit
12035 A program that can be used to edit a body or body part in the given
12036 format.
12037 (Currently unused.)
12039 .It Cd print
12040 A program that can be used to print a message or body part in the given
12041 format.
12042 (Currently unused.)
12044 .It Cd test
12045 Specifies a program to be run to test some condition, e.g., the machine
12046 architecture, or the window system in use, to determine whether or not
12047 this mailcap entry applies.
12048 If the test fails, a subsequent mailcap entry should be sought; also see
12049 .Cd x-mailx-test-once .
12052 .It Cd needsterminal
12053 This flag field indicates that the given shell command must be run on
12054 an interactive terminal.
12055 \*(UA will temporarily release the terminal to the given command in
12056 interactive mode, in non-interactive mode this entry will be entirely
12057 ignored; this flag implies
12058 .Cd x-mailx-noquote .
12061 .It Cd copiousoutput
12062 A flag field which indicates that the output of the
12063 .Cd view
12064 command will be an extended stream of textual output that can be
12065 (re)integrated into \*(UA's normal visual display.
12066 It is mutually exclusive with
12067 .Cd needsterminal .
12069 .It Cd textualnewlines
12070 A flag field which indicates that this type of data is line-oriented and
12071 that, if encoded in
12072 .Ql base64 ,
12073 all newlines should be converted to canonical form (CRLF) before
12074 encoding, and will be in that form after decoding.
12075 (Currently unused.)
12077 .It Cd nametemplate
12078 This field gives a filename format, in which
12079 .Ql %s
12080 will be replaced by a random string, the joined combination of which
12081 will be used as the filename denoted by
12082 .Ev MAILX_FILENAME_TEMPORARY .
12083 One could specify that a GIF file being passed to an image viewer should
12084 have a name ending in
12085 .Ql .gif
12086 by using
12087 .Ql nametemplate=%s.gif .
12088 Note that \*(UA ignores the name template unless that solely specifies
12089 a filename suffix that consists of (ASCII) alphabetic and numeric
12090 characters, the underscore and dot only.
12092 .It Cd x11-bitmap
12093 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
12094 icon to be used to visually denote the presence of this kind of data.
12095 This field is not used by \*(UA.
12097 .It Cd description
12098 A textual description that describes this type of data.
12101 .It Cd x-mailx-even-if-not-interactive
12102 An extension flag test field \(em by default handlers without
12103 .Cd copiousoutput
12104 are entirely ignored in non-interactive mode, but if this flag is set
12105 then their use will be considered.
12106 It is an error if this flag is set for commands that use the flag
12107 .Cd needsterminal .
12110 .It Cd x-mailx-noquote
12111 An extension flag field that indicates that even a
12112 .Cd copiousoutput
12113 .Cd view
12114 command shall not be used to generate message quotes
12115 (as it would be by default).
12118 .It Cd x-mailx-async
12119 Extension flag field that denotes that the given
12120 .Cd view
12121 command shall be executed asynchronously, without blocking \*(UA.
12122 Cannot be used in conjunction with
12123 .Cd needsterminal .
12126 .It Cd x-mailx-test-once
12127 Extension flag which denotes whether the given
12128 .Cd test
12129 command shall be evaluated once only and the (boolean) result be cached.
12130 This is handy if some global unchanging condition is to be queried, like
12131 .Dq running under the X Window System .
12134 .It Cd x-mailx-tmpfile
12135 Extension flag field that requests creation of a zero-sized temporary
12136 file, the name of which is to be placed in the environment variable
12137 .Ev MAILX_FILENAME_TEMPORARY .
12138 It is an error to use this flag with commands that include a
12139 .Ql %s
12140 format.
12143 .It Cd x-mailx-tmpfile-fill
12144 Normally the MIME part content is passed to the handler via standard
12145 input; if this flag is set then the data will instead be written into
12146 the implied
12147 .Cd x-mailx-tmpfile .
12148 In order to cause deletion of the temporary file you will have to set
12149 .Cd x-mailx-tmpfile-unlink
12150 explicitly!
12151 It is an error to use this flag with commands that include a
12152 .Ql %s
12153 format.
12156 .It Cd x-mailx-tmpfile-unlink
12157 Extension flag field that requests that the temporary file shall be
12158 deleted automatically when the command loop is entered again at latest.
12159 (Do not use this for asynchronous handlers.)
12160 It is an error to use this flag with commands that include a
12161 .Ql %s
12162 format, or in conjunction with
12163 .Cd x-mailx-async ,
12164 or without also setting
12165 .Cd x-mailx-tmpfile
12167 .Cd x-mailx-tmpfile-fill .
12170 .It Cd x-mailx-tmpfile-keep
12171 Using the string
12172 .Ql %s
12173 implies the three tmpfile related flags above, but if you want, e.g.,
12174 .Cd x-mailx-async
12175 and deal with the temporary file yourself, you can add in this flag to
12176 forcefully ignore
12177 .Cd x-mailx-tmpfile-unlink .
12182 The standard includes the possibility to define any number of additional
12183 entry fields, prefixed by
12184 .Ql x- .
12185 Flag fields apply to the entire
12186 .Dq Mailcap
12187 entry \(em in some unusual cases, this may not be desirable, but
12188 differentiation can be accomplished via separate entries, taking
12189 advantage of the fact that subsequent entries are searched if an earlier
12190 one does not provide enough information.
12191 E.g., if a
12192 .Cd view
12193 command needs to specify the
12194 .Cd needsterminal
12195 flag, but the
12196 .Cd compose
12197 command shall not, the following will help out the latter (with enabled
12198 .Va debug
12199 or an increased
12200 .Va verbose
12201 level \*(UA will show information about handler evaluation):
12203 .Bd -literal -offset indent
12204 application/postscript; ps-to-terminal %s; needsterminal
12205 application/postscript; ps-to-terminal %s; compose=idraw %s
12209 In fields any occurrence of the format string
12210 .Ql %t
12211 will be replaced by the
12212 .Ql TYPE/SUBTYPE
12213 specification.
12214 Named parameters from the
12215 .Ql Content-type:
12216 field may be placed in the command execution line using
12217 .Ql %{
12218 followed by the parameter name and a closing
12219 .Ql }
12220 character.
12221 The entire parameter should appear as a single command line argument,
12222 regardless of embedded spaces; thus:
12224 .Bd -literal -offset indent
12225 # Message
12226 Content-type:  multipart/mixed; boundary=42
12228 # Mailcap file
12229 multipart/*; /usr/local/bin/showmulti \e
12230   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
12232 # Executed shell command
12233 /usr/local/bin/showmulti multipart/mixed 42
12237 .\" TODO v15: Mailcap: %n,%F
12238 Note that \*(UA does not support handlers for multipart MIME parts as
12239 shown in this example (as of today).
12240 \*(UA does not support the additional formats
12241 .Ql %n
12243 .Ql %F .
12244 An example file, also showing how to properly deal with the expansion of
12245 .Ql %s ,
12246 which includes any quotes that are necessary to make it a valid shell
12247 argument by itself and thus will cause undesired behaviour when placed
12248 in additional user-provided quotes:
12250 .Bd -literal -offset indent
12251 # Comment line
12252 text/richtext; richtext %s; copiousoutput
12254 text/x-perl; perl -cWT %s
12256 application/pdf; \e
12257   infile=%s\e; \e
12258     trap "rm -f ${infile}" EXIT\e; \e
12259     trap "exit 75" INT QUIT TERM\e; \e
12260     mupdf %s; \e
12261   x-mailx-async; x-mailx-tmpfile-keep
12263 application/*; echo "This is \e"%t\e" but \e
12264     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
12265   copiousoutput; x-mailx-noquote
12269 Further reading:
12270 .Sx "HTML mail and MIME attachments" ,
12271 .Sx "The mime.types files" ,
12272 .Ic mimetype ,
12273 .Ev MAILCAPS ,
12274 .Va mime-counter-evidence ,
12275 .Va pipe-TYPE/SUBTYPE ,
12276 .Va pipe-EXTENSION .
12277 .\" }}}
12279 .\" .Ss "The .netrc file" {{{
12280 .Ss "The .netrc file"
12283 .Pa .netrc
12284 file contains user credentials for machine accounts.
12285 The default location in the user's
12286 .Ev HOME
12287 directory may be overridden by the
12288 .Ev NETRC
12289 environment variable.
12290 The file consists of space, tabulator or newline separated tokens.
12291 \*(UA implements a parser that supports a superset of the original BSD
12292 syntax, but users should nonetheless be aware of portability glitches
12293 of that file format, shall their
12294 .Pa .netrc
12295 be usable across multiple programs and platforms:
12298 .Bl -bullet -compact
12300 BSD does not support single, but only double quotation marks, e.g.,
12301 .Ql password="pass with spaces" .
12303 BSD (only?) supports escaping of single characters via a reverse solidus
12304 (e.g., a space can be escaped via
12305 .Ql \e\0 ) ,
12306 in- as well as outside of a quoted string.
12308 BSD does not require a final quotation mark of the last user input token.
12310 The original BSD (Berknet) parser also supported a format which allowed
12311 tokens to be separated with commas \(en whereas at least Hewlett-Packard
12312 still seems to support this syntax, \*(UA does not!
12314 As a non-portable extension some widely-used programs support
12315 shell-style comments: if an input line starts, after any amount of
12316 whitespace, with a number sign
12317 .Ql # ,
12318 then the rest of the line is ignored.
12320 Whereas other programs may require that the
12321 .Pa .netrc
12322 file is accessible by only the user if it contains a
12323 .Cd password
12324 token for any other
12325 .Cd login
12326 than
12327 .Dq anonymous ,
12328 \*(UA will always require these strict permissions.
12332 Of the following list of supported tokens \*(UA only uses (and caches)
12333 .Cd machine ,
12334 .Cd login
12336 .Cd password .
12337 At runtime the command
12338 .Ic netrc
12339 can be used to control \*(UA's
12340 .Pa .netrc
12341 cache.
12343 .Bl -tag -width ".It Cd BaNg"
12344 .It Cd machine Ar name
12345 The hostname of the entries' machine, lowercase-normalized by \*(UA
12346 before use.
12347 Any further file content, until either end-of-file or the occurrence
12348 of another
12349 .Cd machine
12350 or a
12351 .Cd default
12352 first-class token is bound (only related) to the machine
12353 .Ar name .
12355 As an extension that should not be the cause of any worries
12356 \*(UA supports a single wildcard prefix for
12357 .Ar name :
12358 .Bd -literal -offset indent
12359 machine *.example.com login USER password PASS
12360 machine pop3.example.com login USER password PASS
12361 machine smtp.example.com login USER password PASS
12364 which would match
12365 .Ql xy.example.com
12366 as well as
12367 .Ql pop3.example.com ,
12368 but neither
12369 .Ql example.com
12371 .Ql local.smtp.example.com .
12372 Note that in the example neither
12373 .Ql pop3.example.com
12375 .Ql smtp.example.com
12376 will be matched by the wildcard, since the exact matches take
12377 precedence (it is however faster to specify it the other way around).
12379 .It Cd default
12380 This is the same as
12381 .Cd machine
12382 except that it is a fallback entry that is used shall none of the
12383 specified machines match; only one default token may be specified,
12384 and it must be the last first-class token.
12386 .It Cd login Ar name
12387 The user name on the remote machine.
12389 .It Cd password Ar string
12390 The user's password on the remote machine.
12392 .It Cd account Ar string
12393 Supply an additional account password.
12394 This is merely for FTP purposes.
12396 .It Cd macdef Ar name
12397 Define a macro.
12398 A macro is defined with the specified
12399 .Ar name ;
12400 it is formed from all lines beginning with the next line and continuing
12401 until a blank line is (consecutive newline characters are) encountered.
12402 (Note that
12403 .Cd macdef
12404 entries cannot be utilized by multiple machines, too, but must be
12405 defined following the
12406 .Ic machine
12407 they are intended to be used with.)
12408 If a macro named
12409 .Ar init
12410 exists, it is automatically run as the last step of the login process.
12411 This is merely for FTP purposes.
12413 .\" }}}
12415 .\" }}}
12418 .\" .Sh EXAMPLES {{{
12419 .Sh EXAMPLES
12421 .\" .Ss "An example configuration" {{{
12422 .Ss "An example configuration"
12424 .Bd -literal -offset indent
12425 # This example assumes v15.0 compatibility mode
12426 set v15-compat
12428 # Request strict transport security checks!
12429 set ssl-verify=strict
12431 # Where are the up-to-date SSL certificates?
12432 # (Since we manage up-to-date ones explicitly, do not use any,
12433 # possibly outdated, default certificates shipped with OpenSSL)
12434 #set ssl-ca-dir=/etc/ssl/certs
12435 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
12436 set ssl-ca-no-defaults
12437 #set ssl-ca-flags=partial-chain
12438 wysh set smime-ca-file="${ssl-ca-file}" \e
12439   smime-ca-no-defaults #smime-ca-flags="${ssl-ca-flags}"
12441 # Do not use protocols older than TLS v1.2.
12442 # Change this only when the remote server does not support it:
12443 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
12444 # such explicit exceptions, then, e.g.
12445 #   set ssl-protocol-exam.ple='-ALL,+TLSv1.1'
12446 set ssl-protocol='-ALL,+TLSv1.2'
12448 # Explicitly define the list of ciphers, which may improve security,
12449 # especially with protocols older than TLS v1.2.  See ciphers(1).
12450 # Including "@STRENGTH" will sort the final list by algorithm strength.
12451 # In reality it is possibly best to only use ssl-cipher-list-HOST
12452 # (or -USER@HOST), as necessary, again..
12453 set ssl-cipher-list=TLSv1.2:!aNULL:!eNULL:@STRENGTH
12455 # - TLSv1.2:!aNULL:!eNULL:\e
12456 #     ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
12457 #     DHE-RSA-AES256-SHA:@STRENGTH
12458 # -ALL:!aNULL:!eNULL:!MEDIUM:!LOW:!MD5:!RC4:!EXPORT:@STRENGTH
12459 # Especially with TLSv1.3 curves selection may be desired:
12460 #set ssl-curves=P-521:P-384:P-256
12462 # Essential setting: select allowed character sets
12463 set sendcharsets=utf-8,iso-8859-1
12465 # A very kind option: when replying to a message, first try to
12466 # use the same encoding that the original poster used herself!
12467 set reply-in-same-charset
12469 # When replying, do not merge From: and To: of the original message
12470 # into To:.  Instead old From: -> new To:, old To: -> merge Cc:.
12471 set recipients-in-cc
12473 # When sending messages, wait until the Mail-Transfer-Agent finishs.
12474 # Only like this you will be able to see errors reported through the
12475 # exit status of the MTA (including the built-in SMTP one)!
12476 set sendwait
12478 # Only use built-in MIME types, no mime.types(5) files
12479 set mimetypes-load-control
12481 # Default directory where we act in (relative to $HOME)
12482 set folder=mail
12483 # A leading "+" (often) means: under *folder*
12484 # *record* is used to save copies of sent messages
12485 set MBOX=+mbox.mbox DEAD=+dead.txt \e
12486   record=+sent.mbox record-files record-resent
12488 # Make "file mymbox" and "file myrec" go to..
12489 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
12491 # Not really optional, e.g., for S/MIME
12492 set from='Your Name <address@exam.ple>'
12494 # It may be necessary to set hostname and/or smtp-hostname
12495 # if the "SERVER" of mta and "domain" of from do not match.
12496 # The `urlencode' command can be used to encode USER and PASS
12497 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
12498   smtp-auth=login/plain... \e
12499   smtp-use-starttls
12501 # Never refuse to start into interactive mode, and more
12502 set emptystart \e
12503   colour-pager crt= \e
12504   followup-to followup-to-honour=ask-yes \e
12505   history-file=+.\*(uAhist history-size=-1 history-gabby \e
12506   mime-counter-evidence=0xE \e
12507   prompt='?\e$?!\e$!/\e$^ERRNAME[\e$account#\e$mailbox-display]? ' \e
12508   reply-to-honour=ask-yes \e
12509   umask=
12511 # Only include the selected header fields when typing messages
12512 headerpick type retain from_ date from to cc subject \e
12513   message-id mail-followup-to reply-to
12514 # ...when forwarding messages
12515 headerpick forward retain subject date from to cc
12516 # ...when saving message, etc.
12517 #headerpick save ignore ^Original-.*$ ^X-.*$
12519 # Some mailing lists
12520 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
12521 mlsubscribe '^xfans@xfans\e.xyz$'
12523 # Handle a few file extensions (to store MBOX databases)
12524 filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
12525   gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
12526   zst 'zstd -dc' 'zstd -19 -zc' \e
12527   zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
12529 # A real life example of a very huge free mail provider
12530 # Instead of directly placing content inside `account',
12531 # we `define' a macro: like that we can switch "accounts"
12532 # from within *on-compose-splice*, for example!
12533 define XooglX {
12534   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
12535   set from='Your Name <address@examp.ple>'
12536   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
12538 account XooglX {
12539   \ecall XooglX
12542 # Here is a pretty large one which does not allow sending mails
12543 # if there is a domain name mismatch on the SMTP protocol level,
12544 # which would bite us if the value of from does not match, e.g.,
12545 # for people who have a sXXXXeforge project and want to speak
12546 # with the mailing list under their project account (in from),
12547 # still sending the message through their normal mail provider
12548 define XandeX {
12549   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
12550   set from='Your Name <address@exam.ple>'
12551   set mta=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
12552     hostname=yaXXex.com smtp-hostname=
12554 account XandeX {
12555   \ecall Xandex
12558 # Create some new commands so that, e.g., `ls /tmp' will..
12559 commandalias lls '!ls ${LS_COLOR_FLAG} -aFlrS'
12560 commandalias llS '!ls ${LS_COLOR_FLAG} -aFlS'
12562 # We do not support gpg(1) directly yet.  But simple --clearsign'd
12563 # message parts can be dealt with as follows:
12564 define V {
12565   localopts yes
12566   wysh set pipe-text/plain=$'@*#++=@\e
12567     < "${MAILX_FILENAME_TEMPORARY}" awk \e
12568         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
12569       BEGIN{done=0}\e
12570       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
12571         if(done++ != 0)\e
12572           next;\e
12573         print "--- GPG --verify ---";\e
12574         system("gpg --verify " TMPFILE " 2>&1");\e
12575         print "--- GPG --verify ---";\e
12576         print "";\e
12577         next;\e
12578       }\e
12579       /^-----BEGIN PGP SIGNATURE-----/,\e
12580           /^-----END PGP SIGNATURE-----/{\e
12581         next;\e
12582       }\e
12583       {print}\e
12584     \e''
12585     print
12587 commandalias V '\e'call V
12591 When storing passwords in
12592 .Pa \*(ur
12593 appropriate permissions should be set on this file with
12594 .Ql $ chmod 0600 \*(ur .
12595 If the \*(OPal
12596 .Va netrc-lookup
12597 is available user credentials can be stored in the central
12598 .Pa .netrc
12599 file instead; e.g., here is a different version of the example account
12600 that sets up SMTP and POP3:
12602 .Bd -literal -offset indent
12603 define XandeX {
12604   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
12605   set from='Your Name <address@exam.ple>'
12606   set netrc-lookup
12607   # Load an encrypted ~/.netrc by uncommenting the next line
12608   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
12610   set mta=smtps://smtp.yXXXXx.ru:465 \e
12611       smtp-hostname= hostname=yXXXXx.com
12612   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
12613   commandalias xp fi pop3s://pop.yXXXXx.ru
12615 account XandeX {
12616   \ecall XandeX
12621 and, in the
12622 .Pa .netrc
12623 file:
12625 .Bd -literal -offset indent
12626 machine *.yXXXXx.ru login USER password PASS
12630 This configuration should now work just fine:
12633 .Dl $ echo text | \*(uA -dvv -AXandeX -s Subject user@exam.ple
12634 .\" }}}
12636 .\" .Ss "S/MIME step by step" {{{
12637 .Ss "S/MIME step by step"
12639 \*(OP The first thing you need for participating in S/MIME message
12640 exchange is your personal certificate, including a private key.
12641 The certificate contains public information, in particular your name and
12642 your email address(es), and the public key that is used by others to
12643 encrypt messages for you,
12644 and to verify signed messages they supposedly received from you.
12645 The certificate is included in each signed message you send.
12646 The private key must be kept secret.
12647 It is used to decrypt messages that were previously encrypted with your
12648 public key, and to sign messages.
12651 For personal use it is recommended that you get a S/MIME certificate
12652 from one of the major CAs on the Internet using your WWW browser.
12653 Many CAs offer such certificates for free.
12654 There is also
12655 .Lk https://www.CAcert.org
12656 which issues client and server certificates to members of their
12657 community for free; their root certificate
12658 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
12659 is often not in the default set of trusted CA root certificates, though,
12660 which means you will have to download their root certificate separately
12661 and ensure it is part of our S/MIME certificate validation chain by
12662 including it in
12663 .Va smime-ca-dir
12664 or as a vivid member of the
12665 .Va smime-ca-file .
12666 But let us take a step-by-step tour on how to setup S/MIME with
12667 a certificate from CAcert.org despite this situation!
12670 First of all you will have to become a member of the CAcert.org
12671 community, simply by registrating yourself via the web interface.
12672 Once you are, create and verify all email addresses you want to be able
12673 to create signed and encrypted messages for/with using the corresponding
12674 entries of the web interface.
12675 Now ready to create S/MIME certificates, so let us create a new
12676 .Dq client certificate ,
12677 ensure to include all email addresses that should be covered by the
12678 certificate in the following web form, and also to use your name as the
12679 .Dq common name .
12682 Create a private key and a certificate request on your local computer
12683 (please see the manual pages of the used commands for more in-depth
12684 knowledge on what the used arguments etc. do):
12687 .Dl $ openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
12690 Afterwards copy-and-paste the content of
12691 .Dq creq.pem
12692 into the certificate-request (CSR) field of the web form on the
12693 CAcert.org website (you may need to unfold some
12694 .Dq advanced options
12695 to see the corresponding text field).
12696 This last step will ensure that your private key (which never left your
12697 box) and the certificate belong together (through the public key that
12698 will find its way into the certificate via the certificate-request).
12699 You are now ready and can create your CAcert certified certificate.
12700 Download and store or copy-and-paste it as
12701 .Dq pub.crt .
12704 Yay.
12705 In order to use your new S/MIME setup a combined private key/public key
12706 (certificate) file has to be created:
12709 .Dl $ cat key.pem pub.crt > ME@HERE.com.paired
12712 This is the file \*(UA will work with.
12713 If you have created your private key with a passphrase then \*(UA will
12714 ask you for it whenever a message is signed or decrypted.
12715 Set the following variables to henceforth use S/MIME (setting
12716 .Va smime-ca-file
12717 is of interest for verification only):
12719 .Bd -literal -offset indent
12720 ? set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
12721     smime-sign-cert=ME@HERE.com.paired \e
12722     smime-sign-message-digest=SHA256 \e
12723     smime-sign
12726 .\" }}}
12728 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
12729 .Ss "Using CRLs with S/MIME or SSL/TLS"
12731 \*(OP Certification authorities (CAs) issue certificate revocation
12732 lists (CRLs) on a regular basis.
12733 These lists contain the serial numbers of certificates that have been
12734 declared invalid after they have been issued.
12735 Such usually happens because the private key for the certificate has
12736 been compromised,
12737 because the owner of the certificate has left the organization that is
12738 mentioned in the certificate, etc.
12739 To seriously use S/MIME or SSL/TLS verification,
12740 an up-to-date CRL is required for each trusted CA.
12741 There is otherwise no method to distinguish between valid and
12742 invalidated certificates.
12743 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
12744 the Internet, so they have to be retrieved by some external mechanism.
12747 \*(UA accepts CRLs in PEM format only;
12748 CRLs in DER format must be converted, like, e.\|g.:
12751 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
12754 To tell \*(UA about the CRLs, a directory that contains all CRL files
12755 (and no other files) must be created.
12757 .Va smime-crl-dir
12759 .Va ssl-crl-dir
12760 variables, respectively, must then be set to point to that directory.
12761 After that, \*(UA requires a CRL to be present for each CA that is used
12762 to verify a certificate.
12763 .\" }}}
12765 .\" }}} (Examples)
12768 .\" .Sh "FAQ" {{{
12769 .Sh "FAQ"
12771 In general it is a good idea to turn on
12772 .Va debug
12773 .Pf ( Fl d )
12774 and / or
12775 .Va verbose
12776 .Pf ( Fl v ,
12777 twice) if something does not work well.
12778 Very often a diagnostic message can be produced that leads to the
12779 problems' solution.
12781 .\" .Ss "\*(UA shortly hangs on startup" {{{
12782 .Ss "\*(UA shortly hangs on startup"
12784 This can have two reasons, one is the necessity to wait for a file lock
12785 and cannot be helped, the other being that \*(UA calls the function
12786 .Xr uname 2
12787 in order to query the nodename of the box (sometimes the real one is
12788 needed instead of the one represented by the internal variable
12789 .Va hostname ) .
12790 One may have varying success by ensuring that the real hostname and
12791 .Ql localhost
12792 have entries in
12793 .Pa /etc/hosts ,
12794 or, more generally, that the name service is properly setup \(en
12795 and does
12796 .Xr hostname 1
12797 return the expected value?
12798 Does this local hostname have a domain suffix?
12799 RFC 6762 standardized the link-local top-level domain
12800 .Ql .local ,
12801 try again after adding an (additional) entry with this extension.
12802 .\" }}}
12804 .\" .Ss "I cannot login to Google mail aka GMail" {{{
12805 .Ss "I cannot login to Google mail aka GMail"
12807 Since 2014 some free service providers classify programs as
12808 .Dq less secure
12809 unless they use a special authentification method (OAuth 2.0) which
12810 was not standardized for non-HTTP protocol authentication token query
12811 until August 2015 (RFC 7628).
12814 Different to Kerberos / GSSAPI, which is developed since the mid of the
12815 1980s, where a user can easily create a local authentication ticket for
12816 her- and himself with the locally installed
12817 .Xr kinit 1
12818 program, that protocol has no such local part but instead requires
12819 a world-wide-web query to create or fetch a token; since there is no
12820 local cache this query would have to be performed whenever \*(UA is
12821 invoked (in interactive sessions situation may differ).
12824 \*(UA does not support OAuth.
12825 Because of this it is necessary to declare \*(UA a
12826 .Dq less secure app
12827 (on the providers account web page) in order to read and send mail.
12828 However, it also seems possible to take the following steps instead:
12831 .Bl -enum -compact
12833 give the provider the number of a mobile phone,
12835 enable
12836 .Dq 2-Step Verification ,
12838 create an application specific password (16 characters), and
12840 use that special password instead of the real Google account password in
12841 \*(UA (for more on that see the section
12842 .Sx "On URL syntax and credential lookup" ) .
12844 .\" }}}
12846 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
12847 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
12849 It can happen that the terminal library (see
12850 .Sx "On terminal control and line editor",
12851 .Ic bind ,
12852 .Va termcap )
12853 reports different codes than the terminal really sends, in which case
12854 \*(UA will tell that a key binding is functional, but will not be able to
12855 recognize it because the received data does not match anything expected.
12856 Especially without the \*(OPal terminal capability library support one
12857 reason for this may be that the (possibly even non-existing) keypad
12858 is not turned on and the resulting layout reports the keypad control
12859 codes for the normal keyboard keys.
12861 .Va verbose
12862 listing of
12863 .Ic bind Ns
12864 ings will show the byte sequences that are expected.
12867 To overcome the situation, use, e.g., the program
12868 .Xr cat 1 ,
12869 in conjunction with the command line option
12870 .Fl \&\&v ,
12871 if available, to see the byte sequences which are actually produced
12872 by keypresses, and use the variable
12873 .Va termcap
12874 to make \*(UA aware of them.
12875 E.g., the terminal this is typed on produces some false sequences, here
12876 an example showing the shifted home key:
12878 .Bd -literal -offset indent
12879 ? set verbose
12880 ? bind*
12881 # 1B 5B=[ 31=1 3B=; 32=2 48=H
12882   bind base :kHOM z0
12883 ? x
12884 $ cat -v
12885 ^[[H
12886 ? \*(uA -v -Stermcap='kHOM=\eE[H'
12887 ? bind*
12888 # 1B 5B=[ 48=H
12889   bind base :kHOM z0
12891 .\" }}}
12893 .\" }}}
12896 .\" .Sh "IMAP CLIENT" {{{
12897 .Sh "IMAP CLIENT"
12899 \*(OPally there is IMAP client support available.
12900 This part of the program is obsolete and will vanish in v15 with the
12901 large MIME and I/O layer rewrite, because it uses old-style blocking I/O
12902 and makes excessive use of signal based long code jumps.
12903 Support can hopefully be readded later based on a new-style I/O, with
12904 SysV signal handling.
12905 In fact the IMAP support had already been removed from the codebase, but
12906 was reinstantiated on user demand: in effect the IMAP code is at the
12907 level of \*(UA v14.8.16 (with
12908 .Ic imapcodec
12909 being the sole exception), and should be treated with some care.
12912 IMAP uses the
12913 .Ql imap://
12915 .Ql imaps://
12916 protocol prefixes, and an IMAP-based
12917 .Va folder
12918 may be used.
12919 IMAP URLs (paths) undergo inspections and possible transformations
12920 before use (and the command
12921 .Ic imapcodec
12922 can be used to manually apply them to any given argument).
12923 Hierarchy delimiters are normalized, a step which is configurable via the
12924 .Va imap-delim
12925 variable chain, but defaults to the first seen delimiter otherwise.
12926 \*(UA supports internationalised IMAP names, and en- and decodes the
12927 names from and to the
12928 .Va ttycharset
12929 as necessary and possible.
12930 If a mailbox name is expanded (see
12931 .Sx "Filename transformations" )
12932 to an IMAP mailbox, all names that begin with `+' then refer to IMAP
12933 mailboxes below the
12934 .Va folder
12935 target box, while folder names prefixed by `@' refer to folders below
12936 the hierarchy base.
12939 Note: some IMAP servers do not accept the creation of mailboxes in
12940 the hierarchy base, but require that they are created as subfolders of
12941 `INBOX' \(en with such servers a folder name of the form
12943 .Dl imaps://mylogin@imap.myisp.example/INBOX.
12945 should be used (the last character is the server's hierarchy
12946 delimiter).
12947 The following IMAP-specific commands exist:
12950 .Bl -tag -width ".It Ic BaNg"
12952 .It Ic cache
12953 Only applicable to cached IMAP mailboxes;
12954 takes a message list and reads the specified messages into the IMAP
12955 cache.
12958 .It Ic connect
12959 If operating in disconnected mode on an IMAP mailbox,
12960 switch to online mode and connect to the mail server while retaining
12961 the mailbox status.
12962 See the description of the
12963 .Va disconnected
12964 variable for more information.
12967 .It Ic disconnect
12968 If operating in online mode on an IMAP mailbox,
12969 switch to disconnected mode while retaining the mailbox status.
12970 See the description of the
12971 .Va disconnected
12972 variable for more.
12973 A list of messages may optionally be given as argument;
12974 the respective messages are then read into the cache before the
12975 connection is closed, thus
12976 .Ql disco *
12977 makes the entire mailbox available for disconnected use.
12980 .It Ic imap
12981 Sends command strings directly to the current IMAP server.
12982 \*(UA operates always in IMAP `selected state' on the current mailbox;
12983 commands that change this will produce undesirable results and should be
12984 avoided.
12985 Useful IMAP commands are:
12986 .Bl -tag -offset indent -width ".Ic getquotearoot"
12987 .It create
12988 Takes the name of an IMAP mailbox as an argument and creates it.
12989 .It getquotaroot
12990 (RFC 2087) Takes the name of an IMAP mailbox as an argument
12991 and prints the quotas that apply to the mailbox.
12992 Not all IMAP servers support this command.
12993 .It namespace
12994 (RFC 2342) Takes no arguments and prints the Personal Namespaces,
12995 the Other User's Namespaces and the Shared Namespaces.
12996 Each namespace type is printed in parentheses;
12997 if there are multiple namespaces of the same type,
12998 inner parentheses separate them.
12999 For each namespace a prefix and a hierarchy separator is listed.
13000 Not all IMAP servers support this command.
13004 .It Ic imapcodec
13005 Perform IMAP path transformations.
13006 Supports
13007 .Cm vput
13008 (see
13009 .Sx "Command modifiers" ) ,
13010 and manages the error number
13011 .Va \&! .
13012 The first argument specifies the operation:
13013 .Ar e[ncode]
13014 normalizes hierarchy delimiters (see
13015 .Va imap-delim )
13016 and converts the strings from the locale
13017 .Va ttycharset
13018 to the internationalized variant used by IMAP,
13019 .Ar d[ecode]
13020 performs the reverse operation.
13025 The following IMAP-specific internal variables exist:
13028 .Bl -tag -width ".It Va BaNg"
13030 .It Va disconnected
13031 \*(BO When an IMAP mailbox is selected and this variable is set,
13032 no connection to the server is initiated.
13033 Instead, data is obtained from the local cache (see
13034 .Va imap-cache Ns
13036 Mailboxes that are not present in the cache
13037 and messages that have not yet entirely been fetched from the server
13038 are not available;
13039 to fetch all messages in a mailbox at once,
13040 the command
13041 .No ` Ns Li copy * /dev/null Ns '
13042 can be used while still in connected mode.
13043 Changes that are made to IMAP mailboxes in disconnected mode are queued
13044 and committed later when a connection to that server is made.
13045 This procedure is not completely reliable since it cannot be guaranteed
13046 that the IMAP unique identifiers (UIDs) on the server still match the
13047 ones in the cache at that time.
13048 Data is saved to
13049 .Ev DEAD
13050 when this problem occurs.
13052 .It Va disconnected-USER@HOST
13053 The specified account is handled as described for the
13054 .Va disconnected
13055 variable above,
13056 but other accounts are not affected.
13058 .Mx Va imap-auth
13059 .It Va imap-auth-USER@HOST , imap-auth
13060 Sets the IMAP authentication method.
13061 Valid values are `login' for the usual password-based authentication
13062 (the default),
13063 `cram-md5', which is a password-based authentication that does not send
13064 the password over the network in clear text,
13065 and `gssapi' for GSS-API based authentication.
13068 .It Va imap-cache
13069 Enables caching of IMAP mailboxes.
13070 The value of this variable must point to a directory that is either
13071 existent or can be created by \*(UA.
13072 All contents of the cache can be deleted by \*(UA at any time;
13073 it is not safe to make assumptions about them.
13075 .Mx Va imap-delim
13076 .It Va imap-delim-USER@HOST , imap-delim-HOST , imap-delim
13077 The hierarchy separator used by the IMAP server.
13078 Whenever an IMAP path is specified it will undergo normalization.
13079 One of the normalization steps is the squeezing and adjustment of
13080 hierarchy separators.
13081 If this variable is set, any occurrence of any character of the given
13082 value that exists in the path will be replaced by the first member of
13083 the value; an empty value will cause the default to be used, it is
13084 .Ql /. .
13085 If not set, we will reuse the first hierarchy separator character that
13086 is discovered in a user-given mailbox name.
13088 .Mx Va imap-keepalive
13089 .It Va imap-keepalive-USER@HOST , imap-keepalive-HOST , imap-keepalive
13090 IMAP servers may close the connection after a period of
13091 inactivity; the standard requires this to be at least 30 minutes,
13092 but practical experience may vary.
13093 Setting this variable to a numeric `value' greater than 0 causes
13094 a `NOOP' command to be sent each `value' seconds if no other operation
13095 is performed.
13098 .It Va imap-list-depth
13099 When retrieving the list of folders on an IMAP server, the
13100 .Ic folders
13101 command stops after it has reached a certain depth to avoid possible
13102 infinite loops.
13103 The value of this variable sets the maximum depth allowed.
13104 The default is 2.
13105 If the folder separator on the current IMAP server is a slash `/',
13106 this variable has no effect and the
13107 .Ic folders
13108 command does not descend to subfolders.
13110 .Mx Va imap-use-starttls
13111 .It Va imap-use-starttls-USER@HOST , imap-use-starttls-HOST , imap-use-starttls
13112 Causes \*(UA to issue a `STARTTLS' command to make an unencrypted
13113 IMAP session SSL/TLS encrypted.
13114 This functionality is not supported by all servers,
13115 and is not used if the session is already encrypted by the IMAPS method.
13118 .\" }}}
13121 .\" .Sh "SEE ALSO" {{{
13122 .Sh "SEE ALSO"
13124 .Xr bogofilter 1 ,
13125 .Xr gpg 1 ,
13126 .Xr more 1 ,
13127 .Xr newaliases 1 ,
13128 .Xr openssl 1 ,
13129 .Xr sendmail 1 ,
13130 .Xr sh 1 ,
13131 .Xr spamassassin 1 ,
13132 .Xr iconv 3 ,
13133 .Xr setlocale 3 ,
13134 .Xr aliases 5 ,
13135 .Xr termcap 5 ,
13136 .Xr terminfo 5 ,
13137 .Xr locale 7 ,
13138 .Xr mailaddr 7 ,
13139 .Xr re_format 7 ,
13140 .Xr mailwrapper 8 ,
13141 .Xr sendmail 8
13143 .\" }}}
13146 .\" .Sh HISTORY {{{
13147 .Sh HISTORY
13149 M. Douglas McIlroy writes in his article
13150 .Dq A Research UNIX Reader: Annotated Excerpts \
13151 from the Programmer's Manual, 1971-1986
13152 that a
13153 .Xr mail 1
13154 command already appeared in First Edition
13156 in 1971:
13158 .Bd -ragged -offset indent
13159 Electronic mail was there from the start.
13160 Never satisfied with its exact behavior, everybody touched it at one
13161 time or another: to assure the safety of simultaneous access, to improve
13162 privacy, to survive crashes, to exploit uucp, to screen out foreign
13163 freeloaders, or whatever.
13164 Not until v7 did the interface change (Thompson).
13165 Later, as mail became global in its reach, Dave Presotto took charge and
13166 brought order to communications with a grab-bag of external networks
13167 (v8).
13172 Mail was written in 1978 by Kurt Shoens and developed as part of the
13175 distribution until 1995.
13176 Mail has then seen further development in open source
13178 variants, noticeably by Christos Zoulas in
13179 .Pf Net Bx .
13180 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
13181 Ritter in the years 2000 until 2008.
13182 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
13183 This man page is derived from
13184 .Dq The Mail Reference Manual
13185 that was originally written by Kurt Shoens.
13187 .\" }}}
13190 .Sh AUTHORS
13192 .An "Kurt Shoens" ,
13193 .An "Edward Wang" ,
13194 .An "Keith Bostic" ,
13195 .An "Christos Zoulas" ,
13196 .An "Gunnar Ritter" ,
13197 .An "Steffen Nurpmeso" .
13200 The variables
13201 .Va contact-mail
13203 .Va contact-web
13204 provide contact addresses:
13206 .\" v15-compat: drop eval as `mail' will expand variable?
13207 .Dl ? echo $contact-web; eval mail $contact-mail
13210 .\" .Sh CAVEATS {{{
13211 .Sh CAVEATS
13213 \*(ID Interrupting an operation via
13214 .Dv \&\&SIGINT
13216 .Ql control-C
13217 from anywhere else but a command prompt is very problematic and likely
13218 to leave the program in an undefined state: many library functions
13219 cannot deal with the
13220 .Fn siglongjmp 3
13221 that this software (still) performs; even though efforts have been taken
13222 to address this, no sooner but in v15 it will have been worked out:
13223 interruptions have not been disabled in order to allow forceful breakage
13224 of hanging network connections, for example (all this is unrelated to
13225 .Va ignore ) .
13228 The SMTP and POP3 protocol support of \*(UA is very basic.
13229 Also, if it fails to contact its upstream SMTP server, it will not make
13230 further attempts to transfer the message at a later time (setting
13231 .Va save
13233 .Va sendwait
13234 may be useful).
13235 If this is a concern, it might be better to set up a local SMTP server
13236 that is capable of message queuing.
13238 .\" }}}
13241 .Sh BUGS
13243 After deleting some message of a POP3 mailbox the header summary falsely
13244 claims that there are no messages to display, one needs to perform
13245 a scroll or dot movement to restore proper state.
13247 In threaded display a power user may encounter crashes very
13248 occasionally (this is may and very).
13250 The file
13251 .Pa TODO
13252 in the source repository lists future directions.
13254 .\" s-ts-mode