make-release.txt: mention commits like that
[s-mailx.git] / nail.1
bloba34dd1cd3b4a86b368632069fec10e63ec7ec6ff
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 Typing
854 .Ql control-D
855 .Pf ( Ql ^D )
856 at the beginning of an empty line leaves compose mode and causes the
857 message to be sent, whereas typing
858 .Ql control-C
859 .Pf ( Ql ^C )
860 twice will abort the current letter (saving its contents in the file
861 denoted by
862 .Ev DEAD
863 unless
864 .Pf no Va save
865 is set).
868 A number of
869 .Sx ENVIRONMENT
871 .Sx "INTERNAL VARIABLES"
872 can be used to alter default behavior.
873 E.g., messages are sent asynchronously, without supervision, unless the
874 internal variable
875 .Va sendwait
876 is set, therefore send errors will not be recognizable until then.
877 .Ic set Ns
878 ting (also via
879 .Fl S )
880 .Va editalong
881 will automatically startup a text editor when compose mode is entered,
882 .Va editheaders
883 allows editing of headers additionally to plain body content, whereas
884 .Va askcc
886 .Va askbcc
887 will cause the user to be prompted actively for (blind) carbon-copy
888 recipients, respectively, if the given list is empty.
891 Especially when using public mail provider accounts with the SMTP
892 .Va mta
893 it is often necessary to set
894 .Va from
895 and/or
896 .Va hostname
897 (even finer control via
898 .Va smtp-hostname ) ,
899 which (even if empty) also causes creation of
900 .Ql Message-ID:
902 .Ql Content-ID:
903 header fields unless
904 .Va stealthmua
905 is set.
906 Saving a copy of sent messages in a
907 .Va record
908 mailbox may be desirable \(en as for most mailbox
909 .Ic file
910 targets the value will undergo
911 .Sx "Filename transformations" .
912 Defining user email
913 .Ic account Ns s
914 for the purpose of arranging a complete environment of settings that can
915 be switched to with a single command or command line option may be
916 useful.
917 .Pf ( Sx EXAMPLES
918 has example configurations for some of the well-known public mail
919 providers, and also gives a compact overview on how to setup a secure
920 SSL/TLS environment.)
921 Some introductional
922 .Fl d
924 .Va debug
925 sandbox dry-run tests will prove correctness.
928 The section
929 .Sx "On URL syntax and credential lookup"
930 will spread light on the different ways of how to specify user email
931 account credentials, the
932 .Ql USER@HOST
933 variable chains, and accessing protocol-specific resources,
934 the section
935 .Sx "Character sets"
936 goes into the details of character encodings, and how to use them for
937 interpreting the input data given in
938 .Va ttycharset
939 and representing messages and MIME part contents in
940 .Va sendcharsets ,
941 and reading the section
942 .Sx "The mime.types files"
943 should help to understand how the MIME-type of outgoing attachments are
944 classified, and what can be done for fine-tuning.
945 Over the wire a configurable
946 .Va mime-encoding
947 .Pf ( Ql Content-Transfer-Encoding: )
948 may be applied to the message data.
951 Message recipients (as specified on the command line or defined in
952 .Ql To: ,
953 .Ql Cc:
955 .Ql Bcc: )
956 may not only be email addressees but can also be names of mailboxes and
957 even complete shell command pipe specifications.
958 If the variable
959 .Va expandaddr
960 is not set then only network addresses (see
961 .Xr mailaddr 7
962 for a description of mail addresses) and plain user names (including MTA
963 aliases) may be used, other types will be filtered out, giving a warning
964 message.
965 The command
966 .Ic addrcodec
967 can be used to generate standard compliant network addresses.
969 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
970 .\" grep the latter for the complete picture
972 If the variable
973 .Va expandaddr
974 is set then extended recipient addresses will optionally be accepted:
975 Any name which starts with a vertical bar
976 .Ql |
977 character specifies a command pipe \(en the command string following the
978 .Ql |
979 is executed and the message is sent to its standard input;
980 Likewise, any name that starts with the character solidus
981 .Ql /
982 or the character sequence dot solidus
983 .Ql ./
984 is treated as a file, regardless of the remaining content;
985 likewise a name that solely consists of a hyphen-minus
986 .Ql - .
987 Any other name which contains a commercial at
988 .Ql @
989 character is treated as a network address;
990 Any other name which starts with a plus sign
991 .Ql +
992 character specifies a mailbox name;
993 Any other name which contains a solidus
994 .Ql /
995 character but no exclamation mark
996 .Ql \&!
997 or percent sign
998 .Ql %
999 character before also specifies a mailbox name;
1000 What remains is treated as a network address.
1002 .Bd -literal -offset indent
1003 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1004 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1005 $ echo safe | LC_ALL=C \e
1006     \*(uA -:/ -Sv15-compat -Ssendwait -Sttycharset=utf8 \e
1007       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1008       -. bob@exam.ple
1012 It is possible to create personal distribution lists via the
1013 .Ic alias
1014 command, so that, for instance, the user can send mail to
1015 .Ql cohorts
1016 and have it go to a group of people.
1017 These aliases have nothing in common with the system wide aliases that
1018 may be used by the MTA, which are subject to the
1019 .Ql name
1020 constraint of
1021 .Va expandaddr
1022 and are often tracked in a file
1023 .Pa /etc/aliases
1024 (and documented in
1025 .Xr aliases 5
1027 .Xr sendmail 1 ) .
1028 Personal aliases will be expanded by \*(UA before the message is sent,
1029 and are thus a convenient alternative to specifying each addressee by
1030 itself; they correlate with the active set of
1031 .Ic alternates
1032 and are subject to
1033 .Va metoo
1034 filtering.
1037 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
1040 .Va on-compose-enter , on-compose-leave
1042 .Va on-compose-cleanup
1043 hook variables may be set to
1044 .Ic define Ns
1045 d macros to automatically adjust some settings dependent
1046 on receiver, sender or subject contexts, and via the
1047 .Va on-compose-splice
1048 as well as
1049 .Va on-compose-splice-shell
1050 variables, the former also to be set to a
1051 .Ic define Ns
1052 d macro, increasingly powerful mechanisms to perform automated message
1053 adjustments are available.
1054 (\*(ID These hooks work for commands which newly create messages, namely
1055 .Ic forward , mail , reply
1056 and variants;
1057 .Ic resend
1059 .Ic Resend
1060 for now provide only the hooks
1061 .Va on-resend-enter
1063 .Va on-resend-cleanup . )
1066 To avoid environmental noise scripts should
1067 .Dq detach
1068 \*(UA from any configuration files and create a script-local
1069 environment, ideally with the command line options
1070 .Fl \&:
1071 to disable any configuration file in conjunction with repetitions of
1072 .Fl S
1073 to specify variables:
1075 .Bd -literal -offset indent
1076 $ env LC_ALL=C \*(uA -:/ \e
1077     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1078     -Sexpandaddr=fail,-all,failinvaddr \e
1079     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1080     -S from=scriptreply@exam.ple \e
1081     -s 'Subject to go' -a attachment_file \e
1082     -. 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1083     < content_file
1087 As shown, scripts can
1088 .Dq fake
1089 a locale environment, the above specifies the all-compatible 7-bit clean
1090 .Ev LC_ALL
1091 .Dq C ,
1092 but will nonetheless take and send UTF-8 in the message text by using
1093 .Va ttycharset .
1094 In interactive mode, which is introduced in the next section, messages
1095 can be sent by calling the
1096 .Ic mail
1097 command with a list of recipient addresses:
1099 .Bd -literal -offset indent
1100 $ \*(uA -d -Squiet -Semptystart
1101 "/var/spool/mail/user": 0 messages
1102 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1104 ? # Will do the right thing (tm)
1105 ? m rec1@exam.ple rec2@exam.ple
1107 .\" }}}
1109 .\" .Ss "On reading mail, and interactive mode" {{{
1110 .Ss "On reading mail, and interactive mode"
1112 When invoked without addressees \*(UA enters interactive mode in which
1113 mails may be read.
1114 When used like that the user's system
1115 .Va inbox
1116 (for more on mailbox types please see the command
1117 .Ic file )
1118 is read in and a one line header of each message therein is displayed if
1119 the variable
1120 .Va header
1121 is set.
1122 The visual style of this summary of
1123 .Ic headers
1124 can be adjusted through the variable
1125 .Va headline
1126 and the possible sorting criterion via
1127 .Va autosort .
1128 Scrolling through
1129 .Va screen Ns
1130 fuls of
1131 .Ic headers
1132 can be performed with the command
1133 .Ic z .
1134 If the initially opened mailbox is empty \*(UA will instead exit
1135 immediately (after displaying a message) unless the variable
1136 .Va emptystart
1137 is set.
1140 At the
1141 .Va prompt
1142 the command
1143 .Ic list
1144 will give a listing of all available commands and
1145 .Ic help
1146 will give a summary of some common ones.
1147 If the \*(OPal documentation strings are available one can type
1148 .Ql help X
1149 .Pf "(or " Ql ?X )
1150 and see the actual expansion of
1151 .Ql X
1152 and what its purpose is, i.e., commands can be abbreviated
1153 (note that POSIX defines some abbreviations, so that the alphabetical
1154 order of commands does not necessarily relate to the abbreviations; it is
1155 however possible to define overwrites with
1156 .Ic commandalias ) .
1157 These commands can also produce a more
1158 .Va verbose
1159 output.
1162 Messages are given numbers (starting at 1) which uniquely identify
1163 messages; the current message \(en the
1164 .Dq dot
1165 \(en will either be the first new message, or the first unread message,
1166 or the first message of the mailbox; the internal variable
1167 .Va showlast
1168 will instead cause usage of the last message for this purpose.
1169 The command
1170 .Ic headers
1171 will display a
1172 .Va screen Ns
1173 ful of header summaries containing the
1174 .Dq dot ,
1175 whereas
1176 .Ic from
1177 will display only the summaries of the given messages, defaulting to the
1178 .Dq dot .
1181 Message content can be displayed with the command
1182 .Ic type
1183 .Pf ( Ql t ,
1184 alias
1185 .Ic print ) .
1186 Here the variable
1187 .Va crt
1188 controls whether and when \*(UA will use the configured
1189 .Ev PAGER
1190 for display instead of directly writing to the user terminal
1191 .Va screen ,
1192 the sole difference to the command
1193 .Ic more ,
1194 which will always use the
1195 .Ev PAGER .
1196 The command
1197 .Ic top
1198 will instead only show the first
1199 .Va toplines
1200 of a message (maybe even compressed if
1201 .Va topsqueeze
1202 is set).
1203 Message display experience may improve by setting and adjusting
1204 .Va mime-counter-evidence ,
1205 and also see
1206 .Sx "HTML mail and MIME attachments" .
1209 By default the current message
1210 .Pf ( Dq dot )
1211 is displayed, but like with many other commands it is possible to give
1212 a fancy message specification (see
1213 .Sx "Specifying messages" ) ,
1214 e.g.,
1215 .Ql t:u
1216 will display all unread messages,
1217 .Ql t.
1218 will display the
1219 .Dq dot ,
1220 .Ql t 1 5
1221 will type the messages 1 and 5,
1222 .Ql t 1-5
1223 will type the messages 1 through 5, and
1224 .Ql t-
1226 .Ql t+
1227 will display the last and the next message, respectively.
1228 The command
1229 .Ic search
1230 (a more substantial alias for
1231 .Ic from )
1232 will display a header summary of the given message specification list
1233 instead of their content, e.g., the following will search for subjects:
1236 .Dl ? from "'@Some subject to search for'"
1239 In the default setup all header fields of a message will be
1240 .Ic type Ns
1241 d, but fields can be white- or blacklisted for a variety of
1242 applications by using the command
1243 .Ic headerpick ,
1244 e.g., to restrict their display to a very restricted set for
1245 .Ic type :
1246 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1247 In order to display all header fields of a message regardless of
1248 currently active ignore or retain lists, use the commands
1249 .Ic Type
1251 .Ic Top ;
1252 .Ic Show
1253 will show the raw message content.
1254 Note that historically the global
1255 .Pa \*(UR
1256 not only adjusts the list of displayed headers, but also sets
1257 .Va crt .
1260 Dependent upon the configuration a line editor (see the section
1261 .Sx "On terminal control and line editor" )
1262 aims at making the user experience with the many
1263 .Sx COMMANDS
1264 a bit nicer.
1265 When reading the system
1266 .Va inbox
1267 or when
1268 .Fl f
1270 .Ic file )
1271 specified a mailbox explicitly prefixed with the special
1272 .Ql %:
1273 modifier (propagating the mailbox to a
1274 .Mx -sx
1275 .Sx "primary system mailbox" ) ,
1276 then messages which have been read will be automatically moved to a
1277 .Mx -sx
1278 .Sx "secondary mailbox" ,
1279 the users
1280 .Ev MBOX
1281 file, when the mailbox is left, either by changing the
1282 active mailbox or by quitting \*(UA (also see
1283 .Sx "Message states" )
1284 \(en this automatic moving from a system or primary to the secondary
1285 mailbox is not performed when the variable
1286 .Va hold
1287 is set.
1288 Messages can also be explicitly
1289 .Ic move Ns
1290 d to other mailboxes, whereas
1291 .Ic copy
1292 keeps the original message.
1293 .Ic write
1294 can be used to write out data content of specific parts of messages.
1297 After examining a message the user can
1298 .Ic reply Ql r
1299 to the sender and all recipients (which will also be placed in
1300 .Ql To:
1301 unless
1302 .Va recipients-in-cc
1303 is set) or
1304 .Ic Reply Ql R
1305 exclusively to the sender(s).
1306 .Ic forward Ns
1307 ing a message will allow editing the new message: the original message
1308 will be contained in the message body, adjusted according to
1309 .Ic headerpick .
1310 When replying to or forwarding a message recipient addresses will be
1311 stripped from comments and names unless the internal variable
1312 .Va fullnames
1313 is set.
1314 It is possible to
1315 .Ic resend
1317 .Ic Resend
1318 messages: the former will add a series of
1319 .Ql Resent-
1320 headers, whereas the latter will not; different to newly created
1321 messages editing is not possible and no copy will be saved even with
1322 .Va record
1323 unless the additional variable
1324 .Va record-resent
1325 is set.
1326 Of course messages can be
1327 .Ic delete Ql d ,
1328 and they can spring into existence again via
1329 .Ic undelete
1330 or when the \*(UA session is ended via the
1331 .Ic exit Ql x
1332 command.
1335 To end a mail processing session one may either issue
1336 .Ic quit Ql q
1337 to cause a full program exit, which possibly includes
1338 automatic moving of read messages to the
1339 .Mx -sx
1340 .Sx "secondary mailbox"
1341 .Ev MBOX
1342 as well as updating the \*(OPal line editor
1343 .Va history-file ,
1344 or use the command
1345 .Ic exit Ql x
1346 instead in order to prevent any of these actions.
1347 .\" }}}
1349 .\" .Ss "HTML mail and MIME attachments" {{{
1350 .Ss "HTML mail and MIME attachments"
1352 Messages which are HTML-only become more and more common and of course
1353 many messages come bundled with a bouquet of MIME (Multipurpose Internet
1354 Mail Extensions) parts for, e.g., attachments.
1355 To get a notion of MIME types, \*(UA will first read
1356 .Sx "The mime.types files"
1357 (as configured and allowed by
1358 .Va mimetypes-load-control ) ,
1359 and then add onto that types registered directly with
1360 .Ic mimetype .
1361 It (normally) has a default set of types built-in, too.
1362 To improve interaction with faulty MIME part declarations which are
1363 often seen in real-life messages, setting
1364 .Va mime-counter-evidence
1365 will allow \*(UA to verify the given assertion and possibly provide
1366 an alternative MIME type.
1369 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter for
1370 HTML messages, it cannot handle MIME types other than plain text itself.
1371 Instead programs need to become registered to deal with specific MIME
1372 types or file extensions.
1373 These programs may either prepare plain text versions of their input in
1374 order to enable \*(UA to integrate their output neatlessly in its own
1375 message visualization (a mode which is called
1376 .Cd copiousoutput ) ,
1377 or display the content themselves, for example in an external graphical
1378 window: such handlers will only be considered by and for the command
1379 .Ic mimeview .
1382 To install a handler program for a specific MIME type an according
1383 .Va pipe-TYPE/SUBTYPE
1384 variable needs to be set; to instead define a handler for a specific
1385 file extension the respective
1386 .Va pipe-EXTENSION
1387 variable can be used \(en these handlers take precedence.
1388 \*(OPally \*(UA supports mail user agent configuration as defined in
1389 RFC 1524; this mechanism (see
1390 .Sx "The Mailcap files" )
1391 will be queried for display or quote handlers if none of the former two
1392 .\" TODO v15-compat "will be" -> "is"
1393 did; it will be the sole source for handlers of other purpose.
1394 A last source for handlers is the MIME type definition itself, when
1395 a (\*(UA specific) type-marker was registered with the command
1396 .Ic mimetype
1397 (which many built-in MIME types do).
1400 E.g., to display a HTML message inline (that is, converted to a more
1401 fancy plain text representation than the built-in converter is capable to
1402 produce) with either of the text-mode browsers
1403 .Xr lynx 1
1405 .Xr elinks 1 ,
1406 teach \*(UA about MathML documents and make it display them as plain
1407 text, and to open PDF attachments in an external PDF viewer,
1408 asynchronously and with some other magic attached:
1410 .Bd -literal -offset indent
1411 ? if [ "$features" !% +filter-html-tagsoup ]
1412 ?  #set pipe-text/html='@* elinks -force-html -dump 1'
1413 ?  set pipe-text/html='@* lynx -stdin -dump -force_html'
1414 ?  # Display HTML as plain text instead
1415 ?  #set pipe-text/html=@
1416 ? endif
1417 ? mimetype @ application/mathml+xml mathml
1418 ? wysh set pipe-application/pdf='@&=@ \e
1419     trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1420     trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1421     mupdf "${MAILX_FILENAME_TEMPORARY}"'
1423 .\" }}}
1425 .\" .Ss "Mailing lists" {{{
1426 .Ss "Mailing lists"
1428 \*(UA offers some support to ease handling of mailing lists.
1429 The command
1430 .Ic mlist
1431 promotes all given arguments to known mailing lists, and
1432 .Ic mlsubscribe
1433 sets their subscription attribute, creating them first as necessary.
1434 (On the other hand
1435 .Ic unmlsubscribe
1436 does not
1437 .Ic unmlist
1438 automatically, but only resets the subscription attribute.)
1439 Using the commands without arguments will show (a subset of) all
1440 currently defined mailing lists.
1442 .Va headline
1443 format
1444 .Ql \&%T
1445 can be used to mark out messages with configured list addresses
1446 in the header display.
1449 \*(OPally mailing lists may also be specified as (extended) regular
1450 expressions, which allows matching of many addresses with a single
1451 expression.
1452 However, all fully qualified list addresses are matched via a fast
1453 dictionary, whereas expressions are placed in (a) list(s) which is
1454 (are) matched sequentially.
1456 .Bd -literal -offset indent
1457 ? set followup-to followup-to-honour=ask-yes \e
1458     reply-to-honour=ask-yes
1459 ? wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1460 ? mlsubscribe a4@b4.c4 exact@lists.c3
1464 The variable
1465 .Va followup-to-honour
1466 will ensure that a
1467 .Ql Mail-\:Followup-\:To:
1468 header is honoured when the message is being replied to (via
1469 .Ic reply
1471 .Ic Lreply )
1473 .Va followup-to
1474 controls whether this header is created when sending mails; it will be
1475 created automatically for a couple of reasons, too, like when the
1476 special
1477 .Dq mailing list specific
1478 respond command
1479 .Ic Lreply
1480 is used, when
1481 .Ic reply
1482 is used to respond to a message with its
1483 .Ql Mail-Followup-To:
1484 being honoured etc.
1487 A difference in between the handling of known and subscribed lists is
1488 that the address of the sender is usually not part of a generated
1489 .Ql Mail-Followup-To:
1490 when addressing the latter, whereas it is for the former kind of lists.
1491 Usually because there are exceptions: say, if multiple lists are
1492 addressed and not all of them are subscribed lists.
1494 For convenience \*(UA will, temporarily, automatically add a list
1495 address that is presented in the
1496 .Ql List-Post:
1497 header of a message that is being responded to to the list of known
1498 mailing lists.
1499 Shall that header have existed \*(UA will instead, dependent on the
1500 variable
1501 .Va reply-to-honour ,
1502 use an also set
1503 .Ql Reply-To:
1504 for this purpose in order to accept a list administrators' wish that
1505 is supposed to have been manifested like that (but only if it provides
1506 a single address which resides on the same domain as what is stated in
1507 .Ql List-Post: ) .
1508 .\" }}}
1510 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
1511 .Ss "Signed and encrypted messages with S/MIME"
1513 \*(OP S/MIME provides two central mechanisms:
1514 message signing and message encryption.
1515 A signed message contains some data in addition to the regular text.
1516 The data can be used to verify that the message was sent using a valid
1517 certificate, that the sender's address in the message header matches
1518 that in the certificate, and that the message text has not been altered.
1519 Signing a message does not change its regular text;
1520 it can be read regardless of whether the recipient's software is able to
1521 handle S/MIME.
1522 It is thus usually possible to sign all outgoing messages if so desired.
1525 Encryption, in contrast, makes the message text invisible for all people
1526 except those who have access to the secret decryption key.
1527 To encrypt a message, the specific recipient's public encryption key
1528 must be known.
1529 It is therefore not possible to send encrypted mail to people unless their
1530 key has been retrieved from either previous communication or public key
1531 directories.
1532 A message should always be signed before it is encrypted.
1533 Otherwise, it is still possible that the encrypted message text is
1534 altered.
1537 A central concept to S/MIME is that of the certification authority (CA).
1538 A CA is a trusted institution that issues certificates.
1539 For each of these certificates it can be verified that it really
1540 originates from the CA, provided that the CA's own certificate is
1541 previously known.
1542 A set of CA certificates is usually delivered with OpenSSL and installed
1543 on your system.
1544 If you trust the source of your OpenSSL software installation,
1545 this offers reasonable security for S/MIME on the Internet.
1546 Otherwise set
1547 .Va smime-ca-no-defaults
1548 to avoid using the default certificates and point
1549 .Va smime-ca-file
1550 and/or
1551 .Va smime-ca-dir
1552 to a trusted pool of certificates.
1553 In general, a certificate cannot be more secure than the method its CA
1554 certificate has been retrieved with.
1557 This trusted pool of certificates is used by the command
1558 .Ic verify
1559 to ensure that the given S/MIME messages can be trusted.
1560 If so, verified sender certificates that were embedded in signed
1561 messages can be saved locally with the command
1562 .Ic certsave ,
1563 and used by \*(UA to encrypt further communication with these senders:
1565 .Bd -literal -offset indent
1566 ? certsave FILENAME
1567 ? set smime-encrypt-USER@HOST=FILENAME \e
1568     smime-cipher-USER@HOST=AES256
1572 To sign outgoing messages in order to allow receivers to verify the
1573 origin of these messages a personal S/MIME certificate is required.
1574 \*(UA supports password-protected personal certificates (and keys),
1575 for more on this, and its automatization, please see the section
1576 .Sx "On URL syntax and credential lookup" .
1577 The section
1578 .Sx "S/MIME step by step"
1579 shows examplarily how such a private certificate can be obtained.
1580 In general, if such a private key plus certificate
1581 .Dq pair
1582 is available, all that needs to be done is to set some variables:
1584 .Bd -literal -offset indent
1585 ? set smime-sign-cert=ME@HERE.com.paired \e
1586     smime-sign-message-digest=SHA256 \e
1587     smime-sign
1591 Variables of interest for S/MIME in general are
1592 .Va smime-ca-dir ,
1593 .Va smime-ca-file ,
1594 .Va smime-ca-flags ,
1595 .Va smime-ca-no-defaults ,
1596 .Va smime-crl-dir ,
1597 .Va smime-crl-file .
1598 For S/MIME signing of interest are
1599 .Va smime-sign ,
1600 .Va smime-sign-cert ,
1601 .Va smime-sign-include-certs
1603 .Va smime-sign-message-digest .
1604 Additional variables of interest for S/MIME en- and decryption:
1605 .Va smime-cipher
1607 .Va smime-encrypt-USER@HOST .
1610 \*(ID Note that neither S/MIME signing nor encryption applies to
1611 message subjects or other header fields yet.
1612 Thus they may not contain sensitive information for encrypted messages,
1613 and cannot be trusted even if the message content has been verified.
1614 When sending signed messages,
1615 it is recommended to repeat any important header information in the
1616 message text.
1617 .\" }}}
1619 .\" .Ss "On URL syntax and credential lookup" {{{
1620 .Ss "On URL syntax and credential lookup"
1622 \*(IN For accessing protocol-specific resources usage of Uniform
1623 Resource Locators (URL, RFC 1738) has become omnipresent.
1624 \*(UA expects and understands URLs in the following form;
1625 parts in brackets
1626 .Ql []
1627 denote optional parts, optional either because there also exist other
1628 ways to define the information in question or because support of the
1629 part is protocol-specific (e.g.,
1630 .Ql /path
1631 is used by the local maildir and the IMAP protocol, but not by POP3);
1632 If any of
1633 .Ql USER
1635 .Ql PASSWORD
1636 are specified they must be given in URL percent encoded form (RFC 3986;
1637 the command
1638 .Ic urlcodec
1639 may be helpful):
1642 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
1645 Note that these \*(UA URLs most often do not conform to any real
1646 standard, but instead represent a normalized variant of RFC 1738 \(en
1647 they are not used in data exchange but only meant as a compact,
1648 easy-to-use way of defining and representing information in
1649 a well-known notation.
1652 Many internal variables of \*(UA exist in multiple versions, called
1653 variable chains for the rest of this document: the plain
1654 .Ql variable
1655 as well as
1656 .Ql variable-HOST
1658 .Ql variable-USER@HOST .
1659 Here
1660 .Ql HOST
1661 indeed means
1662 .Ql server:port
1663 if a
1664 .Ql port
1665 had been specified in the respective URL, otherwise it refers to the plain
1666 .Ql server .
1667 Also,
1668 .Ql USER
1669 is not truly the
1670 .Ql USER
1671 that had been found when doing the user chain lookup as is described
1672 below, i.e., this
1673 .Ql USER
1674 will never be in URL percent encoded form, whether it came from an URL
1675 or not; i.e., variable chain name extensions of
1676 .Sx "INTERNAL VARIABLES"
1677 must not be URL percent encoded.
1680 For example, whether an hypothetical URL
1681 .Ql smtp://hey%3Ayou@our.house
1682 had been given that includes a user, or whether the URL was
1683 .Ql smtp://our.house
1684 and the user had been found differently, to lookup the variable chain
1685 .Va smtp-use-starttls
1686 \*(UA first looks for whether
1687 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
1688 is defined, then whether
1689 .Ql smtp-\:use-\:starttls-\:our.house
1690 exists before finally ending up looking at the plain variable itself.
1693 \*(UA obeys the following logic scheme when dealing with the
1694 necessary credential information of an account:
1696 .Bl -bullet
1698 If no
1699 .Ql USER
1700 has been given in the URL the variables
1701 .Va user-HOST
1703 .Va user
1704 are looked up; if no such variable(s) can be found then \*(UA will,
1705 when enforced by the \*(OPal variables
1706 .Va netrc-lookup-HOST
1708 .Va netrc-lookup ,
1709 search the users
1710 .Pa .netrc
1711 file for a
1712 .Ql HOST
1713 specific entry which provides a
1714 .Ql login
1715 name: this lookup will only succeed if unambiguous (one possible matching
1716 entry for
1717 .Ql HOST ) .
1718 It is possible to load encrypted
1719 .Pa .netrc
1720 files via
1721 .Va netrc-pipe .
1723 If there is still no
1724 .Ql USER
1725 then \*(UA will fall back to the user who is supposed to run \*(UA,
1726 the identity of which has been fixated during \*(UA startup and is
1727 known to be a valid user on the current host.
1730 Authentication: unless otherwise noted this will lookup the
1731 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
1732 variable chain, falling back to a protocol-specific default should this
1733 have no success.
1736 If no
1737 .Ql PASSWORD
1738 has been given in the URL, then if the
1739 .Ql USER
1740 has been found through the \*(OPal
1741 .Va netrc-lookup
1742 that may have already provided the password, too.
1743 Otherwise the variable chain
1744 .Va password-USER@HOST , password-HOST , password
1745 is looked up and used if existent.
1747 Afterwards the complete \*(OPal variable chain
1748 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
1749 is looked up.
1750 If set, the
1751 .Ic netrc
1752 cache is searched for a password only (multiple user accounts for
1753 a single machine may exist as well as a fallback entry without user
1754 but with a password).
1756 If at that point there is still no password available, but the
1757 (protocols') chosen authentication type requires a password, then in
1758 interactive mode the user will be prompted on the terminal.
1762 .Sy Note:
1763 S/MIME verification works relative to the values found in the
1764 .Ql From:
1766 .Ql Sender: )
1767 header field(s), which means that the values of
1768 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
1770 .Va smime-sign-message-digest
1771 will not be looked up using the
1772 .Ql USER
1774 .Ql HOST
1775 chains from above but instead use the corresponding values from the
1776 message that is being worked on.
1777 In unusual cases multiple and different
1778 .Ql USER
1780 .Ql HOST
1781 combinations may therefore be involved \(en on the other hand those
1782 unusual cases become possible.
1783 The usual case is as short as:
1786 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
1787 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
1790 The section
1791 .Sx EXAMPLES
1792 contains complete example configurations.
1793 .\" }}}
1795 .\" .Ss "Character sets" {{{
1796 .Ss "Character sets"
1798 \*(OP \*(UA detects the character set of the terminal by using
1799 mechanisms that are controlled by the
1800 .Ev LC_CTYPE
1801 environment variable
1802 (in fact
1803 .Ev LC_ALL ,
1804 .Ev \&\&LC_CTYPE ,
1805 .Ev LANG ,
1806 in that order, see there).
1807 The internal variable
1808 .Va ttycharset
1809 will be set to the detected terminal character set accordingly,
1810 and will thus show up in the output of commands like, e.g.,
1811 .Ic set
1813 .Ic varshow .
1816 However, the user may give a value for
1817 .Va ttycharset
1818 during startup, so that it is possible to send mail in a completely
1819 .Dq faked
1820 locale environment, an option which can be used to generate and send,
1821 e.g., 8-bit UTF-8 input data in a pure 7-bit US-ASCII
1822 .Ql LC_ALL=C
1823 environment (an example of this can be found in the section
1824 .Sx "On sending mail, and non-interactive mode" ) .
1825 Changing the value does not mean much beside that, because several
1826 aspects of the real character set are implied by the locale environment
1827 of the system, which stays unaffected by
1828 .Va ttycharset .
1831 Messages and attachments which consist of 7-bit clean data will be
1832 classified as consisting of
1833 .Va charset-7bit
1834 character data.
1835 This is a problem if the
1836 .Va ttycharset
1837 character set is a multibyte character set that is also 7-bit clean.
1838 For example, the Japanese character set ISO-2022-JP is 7-bit clean but
1839 capable to encode the rich set of Japanese Kanji, Hiragana and Katakana
1840 characters: in order to notify receivers of this character set the mail
1841 message must be MIME encoded so that the character set ISO-2022-JP can
1842 be advertised!
1843 To achieve this, the variable
1844 .Va charset-7bit
1845 must be set to ISO-2022-JP.
1846 (Today a better approach regarding email is the usage of UTF-8, which
1847 uses 8-bit bytes for non-US-ASCII data.)
1850 If the \*(OPal character set conversion capabilities are not available
1851 .Pf ( Va features
1852 does not include the term
1853 .Ql +iconv ) ,
1854 then
1855 .Va ttycharset
1856 will be the only supported character set,
1857 it is simply assumed that it can be used to exchange 8-bit messages
1858 (over the wire an intermediate, configurable
1859 .Va mime-encoding
1860 may be applied),
1861 and the rest of this section does not apply;
1862 it may however still be necessary to explicitly set it if automatic
1863 detection fails, since in that case it defaults to
1864 .\" (Keep in SYNC: ./nail.1:"Character sets", ./config.h:CHARSET_*!)
1865 LATIN1 a.k.a. ISO-8859-1.
1868 \*(OP When reading messages, their text is converted into
1869 .Va ttycharset
1870 as necessary in order to display them on the users terminal.
1871 Unprintable characters and invalid byte sequences are detected
1872 and replaced by proper substitution characters.
1873 Character set mappings for source character sets can be established with
1874 the command
1875 .Ic charsetalias ,
1876 which may be handy to work around faulty character set catalogues (e.g.,
1877 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
1878 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
1879 Also see
1880 .Va charset-unknown-8bit
1881 to deal with another hairy aspect of message interpretation.
1884 When sending messages all their parts and attachments are classified.
1885 Whereas no character set conversion is performed on those parts which
1886 appear to be binary data,
1887 the character set being used must be declared within the MIME header of
1888 an outgoing text part if it contains characters that do not conform to
1889 the set of characters that are allowed by the email standards.
1890 Permissible values for character sets used in outgoing messages can be
1891 declared using the
1892 .Va sendcharsets
1893 variable, and
1894 .Va charset-8bit ,
1895 which defines a catch-all last-resort fallback character set that is
1896 implicitly appended to the list of character sets in
1897 .Va sendcharsets .
1900 When replying to a message and the variable
1901 .Va reply-in-same-charset
1902 is set, then the character set of the message being replied to
1903 is tried first (still being a subject of
1904 .Ic charsetalias ) .
1905 And it is also possible to make \*(UA work even more closely related to
1906 the current locale setting automatically by using the variable
1907 .Va sendcharsets-else-ttycharset ,
1908 please see there for more information.
1911 All the specified character sets are tried in order unless the
1912 conversion of the part or attachment succeeds.
1913 If none of the tried (8-bit) character sets is capable to represent the
1914 content of the part or attachment,
1915 then the message will not be sent and its text will optionally be
1916 .Va save Ns d
1918 .Ev DEAD .
1919 In general, if a message saying
1920 .Dq cannot convert from a to b
1921 appears, either some characters are not appropriate for the currently
1922 selected (terminal) character set,
1923 or the needed conversion is not supported by the system.
1924 In the first case, it is necessary to set an appropriate
1925 .Ev LC_CTYPE
1926 locale and/or the variable
1927 .Va ttycharset .
1930 The best results are usually achieved when \*(UA is run in a UTF-8
1931 locale on an UTF-8 capable terminal, in which case the full Unicode
1932 spectrum of characters is available.
1933 In this setup characters from various countries can be displayed,
1934 while it is still possible to use more simple character sets for sending
1935 to retain maximum compatibility with older mail clients.
1938 On the other hand the POSIX standard defines a locale-independent 7-bit
1939 .Dq portable character set
1940 that should be used when overall portability is an issue, the even more
1941 restricted subset named
1942 .Dq portable filename character set
1943 consists of A-Z, a-z, 0-9, period
1944 .Ql \&. ,
1945 underscore
1946 .Ql _
1947 and hyphen-minus
1948 .Ql - .
1949 .\" }}}
1951 .\" .Ss "Message states" {{{
1952 .Ss "Message states"
1954 \*(UA differentiates in between several different message states;
1955 the current state will be reflected in header summary displays if
1956 .Va headline
1957 is configured to do so (via the internal variable
1958 .Va attrlist ) ,
1959 and messages can also be selected and be acted upon depending on their
1960 state (see
1961 .Sx "Specifying messages" ) .
1962 When operating on the system
1963 .Va inbox ,
1964 or in any other
1965 .Mx -sx
1966 .Sx "primary system mailbox" ,
1967 special actions, like the automatic moving of messages to the
1968 .Mx -sx
1969 .Sx "secondary mailbox"
1970 .Ev MBOX ,
1971 may be applied when the mailbox is left (also implicitly via
1972 a successful exit of \*(UA, but not if the special command
1973 .Ic exit
1974 is used) \(en however, because this may be irritating to users which
1975 are used to
1976 .Dq more modern
1977 mail-user-agents, the default global
1978 .Pa \*(UR
1979 sets the internal
1980 .Va hold
1982 .Va keepsave
1983 variables in order to suppress this behaviour.
1985 .Bl -hang -width ".It Ql new"
1986 .It Ql new
1987 Message has neither been viewed nor moved to any other state.
1988 Such messages are retained even in the
1989 .Mx -sx
1990 .Sx "primary system mailbox" .
1992 .It Ql unread
1993 Message has neither been viewed nor moved to any other state, but the
1994 message was present already when the mailbox has been opened last:
1995 Such messages are retained even in the
1996 .Mx -sx
1997 .Sx "primary system mailbox" .
1999 .It Ql read
2000 The message has been processed by one of the following commands:
2001 .Ic ~f ,
2002 .Ic ~m ,
2003 .Ic ~F ,
2004 .Ic ~M ,
2005 .Ic copy ,
2006 .Ic mbox ,
2007 .Ic next ,
2008 .Ic pipe  ,
2009 .Ic Print ,
2010 .Ic print ,
2011 .Ic top ,
2012 .Ic Type ,
2013 .Ic type ,
2014 .Ic undelete .
2015 The commands
2016 .Ic dp
2018 .Ic dt
2019 will always try to automatically
2020 .Dq step
2022 .Ic type
2024 .Dq next
2025 logical message, and may thus mark multiple messages as read, the
2026 .Ic delete
2027 command will do so if  the internal variable
2028 .Va autoprint
2029 is set.
2030 Except when the
2031 .Ic exit
2032 command is used, messages that are in a
2033 .Mx -sx
2034 .Sx "primary system mailbox"
2035 and are in
2036 .Ql read
2037 state when the mailbox is left will be saved in the
2038 .Mx -sx
2039 .Sx "secondary mailbox"
2040 .Ev MBOX
2041 unless the internal variable
2042 .Va hold
2043 it set.
2045 .It Ql deleted
2046 The message has been processed by one of the following commands:
2047 .Ic delete ,
2048 .Ic dp ,
2049 .Ic dt .
2050 Only
2051 .Ic undelete
2052 can be used to access such messages.
2054 .It Ql preserved
2055 The message has been processed by a
2056 .Ic preserve
2057 command and it will be retained in its current location.
2059 .It Ql saved
2060 The message has been processed by one of the following commands:
2061 .Ic save
2063 .Ic write .
2064 Unless when the
2065 .Ic exit
2066 command is used, messages that are in a
2067 .Mx -sx
2068 .Sx "primary system mailbox"
2069 and are in
2070 .Ql saved
2071 state when the mailbox is left will be deleted; they will be saved in the
2072 .Mx -sx
2073 .Sx "secondary mailbox"
2074 .Ev MBOX
2075 when the internal variable
2076 .Va keepsave
2077 is set.
2081 In addition to these message states, flags which otherwise have no
2082 technical meaning in the mail system except allowing special ways of
2083 addressing them when
2084 .Sx "Specifying messages"
2085 can be set on messages.
2086 These flags are saved with messages and are thus persistent, and are
2087 portable between a set of widely used MUAs.
2089 .Bl -hang -width ".It Ic answered"
2090 .It Ic answered
2091 Mark messages as having been answered.
2092 .It Ic draft
2093 Mark messages as being a draft.
2094 .It Ic flag
2095 Mark messages which need special attention.
2097 .\" }}}
2099 .\" .Ss "Specifying messages" {{{
2100 .Ss "Specifying messages"
2102 Commands such as
2103 .Ic from ,
2104 .Ic type
2106 .Ic delete
2107 can be given a list of message numbers as arguments to apply to a number
2108 of messages at once.
2109 Thus
2110 .Ql delete 1 2
2111 deletes messages 1 and 2,
2112 whereas
2113 .Ql delete 1-5
2114 will delete the messages 1 through 5.
2115 In sorted or threaded mode (see the
2116 .Ic sort
2117 command),
2118 .Ql delete 1-5
2119 will delete the messages that are located between (and including)
2120 messages 1 through 5 in the sorted/threaded order, as shown in the
2121 .Ic headers
2122 summary.
2123 The following special message names exist:
2126 .Bl -tag -width ".It Ar BaNg"
2127 .It Ar \&.
2128 The current message, the so-called
2129 .Dq dot .
2131 .It Ar \&;
2132 The message that was previously the current message.
2134 .It Ar \&,
2135 The parent message of the current message,
2136 that is the message with the Message-ID given in the
2137 .Ql In-Reply-To:
2138 field or the last entry of the
2139 .Ql References:
2140 field of the current message.
2142 .It Ar -
2143 The next previous undeleted message,
2144 or the next previous deleted message for the
2145 .Ic undelete
2146 command.
2147 In sorted/threaded mode,
2148 the next previous such message in the sorted/threaded order.
2150 .It Ar +
2151 The next undeleted message,
2152 or the next deleted message for the
2153 .Ic undelete
2154 command.
2155 In sorted/threaded mode,
2156 the next such message in the sorted/threaded order.
2158 .It Ar ^
2159 The first undeleted message,
2160 or the first deleted message for the
2161 .Ic undelete
2162 command.
2163 In sorted/threaded mode,
2164 the first such message in the sorted/threaded order.
2166 .It Ar $
2167 The last message.
2168 In sorted/threaded mode,
2169 the last message in the sorted/threaded order.
2171 .It Ar & Ns Ar x
2172 In threaded mode,
2173 selects the message addressed with
2174 .Ar x ,
2175 where
2176 .Ar x
2177 is any other message specification,
2178 and all messages from the thread that begins at it.
2179 Otherwise it is identical to
2180 .Ar x .
2182 .Ar x
2183 is omitted,
2184 the thread beginning with the current message is selected.
2186 .It Ar *
2187 All messages.
2188 .It Ar `
2189 All messages that were included in the
2190 .Sx "Message list arguments"
2191 of the previous command.
2193 .It Ar x-y
2194 An inclusive range of message numbers.
2195 Selectors that may also be used as endpoints include any of
2196 .Ar .;-+^$ .
2198 .It Ar address
2199 A case-insensitive
2200 .Dq any substring matches
2201 search against the
2202 .Ql From:
2203 header, which will match addresses (too) even if
2204 .Va showname
2205 is set (and POSIX says
2206 .Dq any address as shown in a header summary shall be matchable in this form ) ;
2207 However, if the
2208 .Va allnet
2209 variable is set, only the local part of the address is evaluated
2210 for the comparison, not ignoring case, and the setting of
2211 .Va showname
2212 is completely ignored.
2213 For finer control and match boundaries use the
2214 .Ql @
2215 search expression.
2217 .It Ar / Ns Ar string
2218 All messages that contain
2219 .Ar string
2220 in the subject field (case ignored).
2221 See also the
2222 .Va searchheaders
2223 variable.
2225 .Ar string
2226 is empty,
2227 the string from the previous specification of that type is used again.
2229 .It Xo Op Ar @ Ns Ar name-list Ns
2230 .Ar @ Ns Ar expr
2232 All messages that contain the given case-insensitive search
2233 .Ar expr Ns
2234 ession; if the \*(OPal regular expression (see
2235 .Xr re_format 7 )
2236 support is available
2237 .Ar expr
2238 will be interpreted as (an extended) one if any of the
2239 .Dq magical
2240 (extended) regular expression characters is seen: in this case this
2241 should match strings correctly which are in the locale
2242 .Ev LC_CTYPE
2243 encoding.
2244 If the optional
2245 .Ar @ Ns Ar name-list
2246 part is missing, the search is restricted to the subject field body,
2247 but otherwise
2248 .Ar name-list
2249 specifies a comma-separated list of header fields to search, as in
2251 .Dl '@to,from,cc@Someone i ought to know'
2253 In order to search for a string that includes a
2254 .Ql @
2255 (commercial at) character the
2256 .Ar name-list
2257 is effectively non-optional, but may be given as the empty string.
2258 Some special header fields may be abbreviated:
2259 .Ql f ,
2260 .Ql t ,
2261 .Ql c ,
2262 .Ql b
2264 .Ql s
2265 will match
2266 .Ql From ,
2267 .Ql To ,
2268 .Ql Cc ,
2269 .Ql Bcc
2271 .Ql Subject ,
2272 respectively and case-insensitively.
2273 The special names
2274 .Ql header
2276 .Ql <
2277 can be used to search in (all of) the header(s) of the message, and the
2278 special names
2279 .Ql body
2281 .Ql >
2283 .Ql text
2285 .Ql =
2286 can be used to perform full text searches \(en whereas the former
2287 searches only the body, the latter also searches the message header.
2289 This message specification performs full text comparison, but even with
2290 regular expression support it is almost impossible to write a search
2291 expression that savely matches only a specific address domain.
2292 To request that the content of the header is treated as a list of
2293 addresses, and to strip those down to the plain email address which the
2294 search expression is to be matched against, prefix the header name
2295 (abbreviation) with a tilde
2296 .Ql ~ :
2298 .Dl @~f@@a\e.safe\e.domain\e.match$
2300 .It Ar :c
2301 All messages of state
2302 .Ql c ,
2303 where
2304 .Ql c
2305 is one or multiple of the following colon modifiers:
2307 .Bl -tag -compact -width ".It Ar :M"
2308 .It Ar n
2309 .Ql new
2310 messages.
2311 .It Ar o
2312 Old messages (any not in state
2313 .Ql read
2315 .Ql new ) .
2316 .It Ar u
2317 .Ql unread
2318 messages.
2319 .It Ar d
2320 .Ql deleted
2321 messages (for the
2322 .Ic undelete
2324 .Ic from
2325 commands only).
2326 .It Ar r
2327 .Ql read
2328 messages.
2329 .It Ar f
2330 .Ic flag Ns
2331 ged messages.
2332 .It Ar a
2333 .Ic answered
2334 messages (cf. the variable
2335 .Va markanswered ) .
2336 .It Ar t
2337 Messages marked as
2338 .Ic draft .
2339 .It Ar s
2340 \*(OP Messages classified as spam (see
2341 .Sx "Handling spam" . )
2342 .It Ar S
2343 \*(OP Messages with unsure spam classification.
2349 \*(OP IMAP-style SEARCH expressions may also be used.
2350 This addressing mode is available with all types of mailbox
2351 .Ic folder Ns
2352 s; \*(UA will perform the search locally as necessary.
2353 Strings must be enclosed by double quotes
2354 .Ql \&"
2355 in their entirety if they contain whitespace or parentheses;
2356 within the quotes, only reverse solidus
2357 .Ql \e
2358 is recognized as an escape character.
2359 All string searches are case-insensitive.
2360 When the description indicates that the
2361 .Dq envelope
2362 representation of an address field is used,
2363 this means that the search string is checked against both a list
2364 constructed as
2366 .Bd -literal -offset indent
2367 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2371 for each address,
2372 and the addresses without real names from the respective header field.
2373 These search expressions can be nested using parentheses, see below for
2374 examples.
2377 .Bl -tag -compact -width ".It Ar _n_u"
2378 .It Ar ( criterion )
2379 All messages that satisfy the given
2380 .Ar criterion .
2381 .It Ar ( criterion1 criterion2 ... criterionN )
2382 All messages that satisfy all of the given criteria.
2384 .It Ar ( or criterion1 criterion2 )
2385 All messages that satisfy either
2386 .Ar criterion1
2388 .Ar criterion2 ,
2389 or both.
2390 To connect more than two criteria using
2391 .Ql or
2392 specifications have to be nested using additional parentheses,
2393 as with
2394 .Ql (or a (or b c)) ,
2395 since
2396 .Ql (or a b c)
2397 really means
2398 .Ql ((a or b) and c) .
2399 For a simple
2400 .Ql or
2401 operation of independent criteria on the lowest nesting level,
2402 it is possible to achieve similar effects by using three separate
2403 criteria, as with
2404 .Ql (a) (b) (c) .
2406 .It Ar ( not criterion )
2407 All messages that do not satisfy
2408 .Ar criterion .
2409 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2410 All messages that contain
2411 .Ar string
2412 in the envelope representation of the
2413 .Ql Bcc:
2414 field.
2415 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2416 All messages that contain
2417 .Ar string
2418 in the envelope representation of the
2419 .Ql Cc:
2420 field.
2421 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2422 All messages that contain
2423 .Ar string
2424 in the envelope representation of the
2425 .Ql From:
2426 field.
2427 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2428 All messages that contain
2429 .Ar string
2430 in the
2431 .Ql Subject:
2432 field.
2433 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2434 All messages that contain
2435 .Ar string
2436 in the envelope representation of the
2437 .Ql To:
2438 field.
2439 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2440 All messages that contain
2441 .Ar string
2442 in the specified
2443 .Ql Name:
2444 field.
2445 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2446 All messages that contain
2447 .Ar string
2448 in their body.
2449 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2450 All messages that contain
2451 .Ar string
2452 in their header or body.
2453 .It Ar ( larger size )
2454 All messages that are larger than
2455 .Ar size
2456 (in bytes).
2457 .It Ar ( smaller size )
2458 All messages that are smaller than
2459 .Ar size
2460 (in bytes).
2462 .It Ar ( before date )
2463 All messages that were received before
2464 .Ar date ,
2465 which must be in the form
2466 .Ql d[d]-mon-yyyy ,
2467 where
2468 .Ql d
2469 denotes the day of the month as one or two digits,
2470 .Ql mon
2471 is the name of the month \(en one of
2472 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2474 .Ql yyyy
2475 is the year as four digits, e.g.,
2476 .Ql 28-Dec-2012 .
2478 .It Ar ( on date )
2479 All messages that were received on the specified date.
2480 .It Ar ( since date )
2481 All messages that were received since the specified date.
2482 .It Ar ( sentbefore date )
2483 All messages that were sent on the specified date.
2484 .It Ar ( senton date )
2485 All messages that were sent on the specified date.
2486 .It Ar ( sentsince date )
2487 All messages that were sent since the specified date.
2488 .It Ar ()
2489 The same criterion as for the previous search.
2490 This specification cannot be used as part of another criterion.
2491 If the previous command line contained more than one independent
2492 criterion then the last of those criteria is used.
2494 .\" }}}
2496 .\" .Ss "On terminal control and line editor" {{{
2497 .Ss "On terminal control and line editor"
2499 \*(OP Terminal control will be realized through one of the standard
2501 libraries, either the
2502 .Lb libtermcap ,
2503 or, alternatively, the
2504 .Lb libterminfo ,
2505 both of which will be initialized to work with the environment variable
2506 .Ev TERM .
2507 Terminal control will enhance or enable interactive usage aspects, e.g.,
2508 .Sx "Coloured display" ,
2509 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2510 byte-sequences of keys like the cursor and function keys.
2513 The internal variable
2514 .Va termcap
2515 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2516 \*(UA may also become a fullscreen application by entering the
2517 so-called ca-mode and switching to an alternative exclusive screen
2518 (content) shall the terminal support it and the internal variable
2519 .Va termcap-ca-mode
2520 has been set explicitly.
2521 Actual interaction with the chosen library can be disabled completely by
2522 setting the internal variable
2523 .Va termcap-disable ;
2524 .Va termcap
2525 will be queried regardless, which is true even if the \*(OPal library
2526 support has not been enabled at configuration time as long as some other
2527 \*(OP which (may) query terminal control sequences has been enabled.
2530 \*(OP The built-in Mailx-Line-Editor (MLE) should work in all
2531 environments which comply to the ISO C standard
2532 .St -isoC-amd1 ,
2533 and will support wide glyphs if possible (the necessary functionality
2534 had been removed from ISO C, but was included in
2535 .St -xpg4 ) .
2536 Prevent usage of a line editor in interactive mode by setting the
2537 internal variable
2538 .Va line-editor-disable .
2539 Especially if the \*(OPal terminal control support is missing setting
2540 entries in the internal variable
2541 .Va termcap
2542 will help shall the MLE misbehave, see there for more.
2543 The MLE can support a little bit of
2544 .Ic colour .
2547 \*(OP If the
2548 .Ic history
2549 feature is available then input from line editor prompts will be saved
2550 in a history list that can be searched in and be expanded from.
2551 Such saving can be prevented by prefixing input with any amount of
2552 whitespace.
2553 Aspects of history, like allowed content and maximum size, as well as
2554 whether history shall be saved persistently, can be configured with the
2555 internal variables
2556 .Va history-file ,
2557 .Va history-gabby ,
2558 .Va history-gabby-persist
2560 .Va history-size .
2563 The MLE supports a set of editing and control commands.
2564 By default (as) many (as possible) of these will be assigned to a set of
2565 single-letter control codes, which should work on any terminal (and can
2566 be generated by holding the
2567 .Dq control
2568 key while pressing the key of desire, e.g.,
2569 .Ql control-D ) .
2570 If the \*(OPal
2571 .Ic bind
2572 command is available then the MLE commands can also be accessed freely
2573 by assigning the command name, which is shown in parenthesis in the list
2574 below, to any desired key-sequence, and the MLE will instead and also use
2575 .Ic bind
2576 to establish its built-in key bindings
2577 (more of them if the \*(OPal terminal control is available),
2578 an action which can then be suppressed completely by setting
2579 .Va line-editor-no-defaults .
2580 .Sx "Shell-style argument quoting"
2581 notation is used in the following;
2582 combinations not mentioned either cause job control signals or do not
2583 generate a (unique) keycode:
2587 .Bl -tag -compact -width ".It Ql \eBa"
2588 .It Ql \ecA
2589 Go to the start of the line
2591 .Pf ( Cd mle-go-home ) .
2593 .It Ql \ecB
2594 Move the cursor backward one character
2596 .Pf ( Cd mle-go-bwd ) .
2598 .It Ql \ecD
2599 Forward delete the character under the cursor;
2600 quits \*(UA if used on the empty line unless the internal variable
2601 .Va ignoreeof
2602 is set
2604 .Pf ( Cd mle-del-fwd ) .
2606 .It Ql \ecE
2607 Go to the end of the line
2609 .Pf ( Cd mle-go-end ) .
2611 .It Ql \ecF
2612 Move the cursor forward one character
2614 .Pf ( Cd mle-go-fwd ) .
2616 .It Ql \ecG
2617 Cancel current operation, full reset.
2618 If there is an active history search or tabulator expansion then this
2619 command will first reset that, reverting to the former line content;
2620 thus a second reset is needed for a full reset in this case
2622 .Pf ( Cd mle-reset ) .
2624 .It Ql \ecH
2625 Backspace: backward delete one character
2627 .Pf ( Cd mle-del-bwd ) .
2629 .It Ql \ecI
2630 \*(NQ
2631 Horizontal tabulator:
2632 try to expand the word before the cursor, supporting the usual
2633 .Sx "Filename transformations"
2635 .Pf ( Cd mle-complete ) .
2636 This is affected by
2637 .Cd mle-quote-rndtrip .
2639 .It Ql \ecJ
2640 Newline:
2641 commit the current line
2643 .Pf ( Cd mle-commit ) .
2645 .It Ql \ecK
2646 Cut all characters from the cursor to the end of the line
2648 .Pf ( Cd mle-snarf-end ) .
2650 .It Ql \ecL
2651 Repaint the line
2653 .Pf ( Cd mle-repaint ) .
2655 .It Ql \ecN
2656 \*(OP Go to the next history entry
2658 .Pf ( Cd mle-hist-fwd ) .
2660 .It Ql \ecO
2661 (\*(OPally context-dependent) Invokes the command
2662 .Ic dt .
2664 .It Ql \ecP
2665 \*(OP Go to the previous history entry
2667 .Pf ( Cd mle-hist-bwd ) .
2669 .It Ql \ecQ
2670 Toggle roundtrip mode shell quotes, where produced,
2671 on and off
2673 .Pf ( Cd mle-quote-rndtrip ) .
2674 This setting is temporary, and will be forgotten once the command line
2675 is committed; also see
2676 .Ic shcodec .
2678 .It Ql \ecR
2679 \*(OP Complete the current line from (the remaining) older history entries
2681 .Pf ( Cd mle-hist-srch-bwd ) .
2683 .It Ql \ecS
2684 \*(OP Complete the current line from (the remaining) newer history entries
2686 .Pf ( Cd mle-hist-srch-fwd ) .
2688 .It Ql \ecT
2689 Paste the snarf buffer
2691 .Pf ( Cd mle-paste ) .
2693 .It Ql \ecU
2694 The same as
2695 .Ql \ecA
2696 followed by
2697 .Ql \ecK
2699 .Pf ( Cd mle-snarf-line ) .
2701 .It Ql \ecV
2702 Prompts for a Unicode character (its hexadecimal number) to be inserted
2704 .Pf ( Cd mle-prompt-char ) .
2705 Note this command needs to be assigned to a single-letter control code
2706 in order to become recognized and executed during input of
2707 a key-sequence (only three single-letter control codes can be used for
2708 that shortcut purpose); this control code is special-treated and cannot
2709 be part of any other sequence, because any occurrence will perform the
2710 .Cd mle-prompt-char
2711 function immediately.
2713 .It Ql \ecW
2714 Cut the characters from the one preceding the cursor to the preceding
2715 word boundary
2717 .Pf ( Cd mle-snarf-word-bwd ) .
2719 .It Ql \ecX
2720 Move the cursor forward one word boundary
2722 .Pf ( Cd mle-go-word-fwd ) .
2724 .It Ql \ecY
2725 Move the cursor backward one word boundary
2727 .Pf ( Cd mle-go-word-bwd ) .
2729 .It Ql \ec[
2730 Escape: reset a possibly used multibyte character input state machine
2731 and \*(OPally a lingering, incomplete key binding
2733 .Pf ( Cd mle-cancel ) .
2734 This command needs to be assigned to a single-letter control code in
2735 order to become recognized and executed during input of a key-sequence
2736 (only three single-letter control codes can be used for that shortcut
2737 purpose).
2738 This control code may also be part of a multi-byte sequence, but if
2739 a sequence is active and the very control code is currently also an
2740 expected input, then it will first be consumed by the active sequence.
2742 .It Ql \ec\e
2743 (\*(OPally context-dependent) Invokes the command
2744 .Ql Ic z Ns + .
2746 .It Ql \ec]
2747 (\*(OPally context-dependent) Invokes the command
2748 .Ql Ic z Ns $ .
2750 .It Ql \ec^
2751 (\*(OPally context-dependent) Invokes the command
2752 .Ql Ic z Ns 0 .
2754 .It Ql \ec_
2755 Cut the characters from the one after the cursor to the succeeding word
2756 boundary
2758 .Pf ( Cd mle-snarf-word-fwd ) .
2760 .It Ql \ec?
2761 Backspace:
2762 .Cd mle-del-bwd .
2764 .It \(en
2766 .Cd mle-fullreset :
2767 different to
2768 .Cd mle-reset
2769 this will immediately reset a possibly active search etc.
2771 .It \(en
2773 .Cd mle-bell :
2774 ring the audible bell.
2776 .\" }}}
2778 .\" .Ss "Coloured display" {{{
2779 .Ss "Coloured display"
2781 \*(OP \*(UA can be configured to support a coloured display and font
2782 attributes by emitting ANSI a.k.a. ISO 6429 SGR (select graphic
2783 rendition) escape sequences.
2784 Usage of colours and font attributes solely depends upon the
2785 capability of the detected terminal type that is defined by the
2786 environment variable
2787 .Ev TERM
2788 and which can be fine-tuned by the user via the internal variable
2789 .Va termcap .
2792 On top of what \*(UA knows about the terminal the boolean variable
2793 .Va colour-pager
2794 defines whether the actually applicable colour and font attribute
2795 sequences should also be generated when output is going to be paged
2796 through the external program defined by the environment variable
2797 .Ev PAGER
2798 (also see
2799 .Va crt Ns
2801 This is not enabled by default because different pager programs need
2802 different command line switches or other configuration in order to
2803 support those sequences.
2804 \*(UA however knows about some widely used pagers and in a clean
2805 environment it is often enough to simply set
2806 .Va colour-pager ;
2807 please refer to that variable for more on this topic.
2810 If the variable
2811 .Va colour-disable
2812 is set then any active usage of colour and font attribute sequences
2813 is suppressed, but without affecting possibly established
2814 .Ic colour
2815 mappings.
2818 To define and control colours and font attributes a single multiplexer
2819 command family exists:
2820 .Ic colour
2821 shows or defines colour mappings for the given colour type (e.g.,
2822 monochrome) and
2823 .Ic uncolour
2824 can be used to remove mappings of a given colour type.
2825 Since colours are only available in interactive mode, it may make
2826 sense to conditionalize the colour setup by encapsulating it with
2827 .Ic if :
2829 .Bd -literal -offset indent
2830 if terminal && [ "$features" =% +colour ]
2831   colour iso view-msginfo ft=bold,fg=green
2832   colour iso view-header ft=bold,fg=red from,subject
2833   colour iso view-header fg=red
2835   uncolour iso view-header from,subject
2836   colour iso view-header ft=bold,fg=magenta,bg=cyan
2837   colour 256 view-header ft=bold,fg=208,bg=230 "subject,from"
2838   colour mono view-header ft=bold
2839   colour mono view-header ft=bold,ft=reverse subject,from
2840 endif
2842 .\" }}}
2844 .\" .Ss "Handling spam" {{{
2845 .Ss "Handling spam"
2847 \*(OP \*(UA can make use of several spam interfaces for the purpose of
2848 identification of, and, in general, dealing with spam messages.
2849 A precondition of most commands in order to function is that the
2850 .Va spam-interface
2851 variable is set to one of the supported interfaces.
2852 Once messages have been identified as spam their (volatile)
2853 .Ql is-spam
2854 state can be prompted: the
2855 .Ql Ar :s
2857 .Ql Ar :S
2858 message specifications will address respective messages and their
2859 .Va attrlist
2860 entries will be used when displaying the
2861 .Va headline
2862 in the header display.
2864 .Bl -bullet
2866 .Ic spamrate
2867 rates the given messages and sets their
2868 .Ql is-spam
2869 flag accordingly.
2870 If the spam interface offers spam scores those can also be displayed in
2871 the header display by including the
2872 .Ql %$
2873 format in the
2874 .Va headline
2875 variable.
2877 .Ic spamham ,
2878 .Ic spamspam
2880 .Ic spamforget
2881 will interact with the Bayesian filter of the chosen interface and learn
2882 the given messages as
2883 .Dq ham
2885 .Dq spam ,
2886 respectively; the last command can be used to cause
2887 .Dq unlearning
2888 of messages; it adheres to their current
2889 .Ql is-spam
2890 state and thus reverts previous teachings.
2892 .Ic spamclear
2894 .Ic spamset
2895 will simply set and clear, respectively, the mentioned volatile
2896 .Ql is-spam
2897 message flag, without any interface interaction.
2902 .Xr spamassassin 1
2903 based
2904 .Va spam-interface
2905 .Ql spamc
2906 requires a running instance of the
2907 .Xr spamd 1
2908 server in order to function, started with the option
2909 .Fl -allow-tell
2910 shall Bayesian filter learning be possible.
2912 .Bd -literal -offset indent
2913 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
2914 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
2915     --daemonize [--local] [--allow-tell]
2919 Thereafter \*(UA can make use of these interfaces:
2921 .Bd -literal -offset indent
2922 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
2923     -Sspamc-command=/usr/local/bin/spamc \e
2924     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
2926 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
2927     -Sspamc-command=/usr/local/bin/spamc \e
2928     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
2932 Using the generic filter approach allows usage of programs like
2933 .Xr bogofilter 1 .
2934 Here is an example, requiring it to be accessible via
2935 .Ev PATH :
2937 .Bd -literal -offset indent
2938 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
2939     -Sspamfilter-ham="bogofilter -n" \e
2940     -Sspamfilter-noham="bogofilter -N" \e
2941     -Sspamfilter-nospam="bogofilter -S" \e
2942     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
2943     -Sspamfilter-spam="bogofilter -s" \e
2944     -Sspamfilter-rate-scanscore="1;^(.+)$"
2948 Because messages must exist on local storage in order to be scored (or
2949 used for Bayesian filter training), it is possibly a good idea to
2950 perform the local spam check last:
2952 .Bd -literal -offset indent
2953 define spamdelhook {
2954   # Server side DCC
2955   spamset (header x-dcc-brand-metrics "bulk")
2956   # Server-side spamassassin(1)
2957   spamset (header x-spam-flag "YES")
2958   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
2959   move :S +maybe-spam
2960   spamrate :u
2961   del :s
2962   move :S +maybe-spam
2964 set folder-hook-FOLDER=spamdelhook
2968 See also the documentation for the variables
2969 .Va spam-interface , spam-maxsize ,
2970 .Va spamc-command , spamc-arguments , spamc-user ,
2971 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
2972   spamfilter-rate
2974 .Va spamfilter-rate-scanscore .
2975 .\" }}}
2977 .\" }}} (DESCRIPTION)
2980 .\" .Sh COMMANDS {{{
2981 .Sh COMMANDS
2983 \*(UA reads input in lines.
2984 An unquoted reverse solidus
2985 .Ql \e
2986 at the end of a command line
2987 .Dq escapes
2988 the newline character: it is discarded and the next line of input is
2989 used as a follow-up line, with all leading whitespace removed;
2990 once an entire line is completed, the whitespace characters
2991 .Cm space , tabulator , newline
2992 as well as those defined by the variable
2993 .Va ifs
2994 are removed from the beginning and end.
2995 Placing any whitespace characters at the beginning of a line will
2996 prevent a possible addition of the command line to the \*(OPal
2997 .Ic history .
3000 The beginning of such input lines is then scanned for the name of
3001 a known command: command names may be abbreviated, in which case the
3002 first command that matches the given prefix will be used.
3003 .Sx "Command modifiers"
3004 may prefix a command in order to modify its behaviour.
3005 A name may also be a
3006 .Ic commandalias ,
3007 which will become expanded until no more expansion is possible.
3008 Once the command that shall be executed is known, the remains of the
3009 input line will be interpreted according to command-specific rules:
3010 (\*(ID) some commands use
3011 .Sx "Shell-style argument quoting" ,
3012 so that a single input line may actually consist of multiple commands,
3013 but others pass it unchanged as
3014 .Sx "Raw data arguments for codec commands" .
3017 The command
3018 .Ic list
3019 can be used to show the list of all commands, either alphabetically
3020 sorted or in prefix search order (these do not match, also because the
3021 POSIX standard prescribes a set of abbreviations).
3022 \*(OPally the command
3023 .Ic help
3025 .Ic \&? ) ,
3026 when given an argument, will show a documentation string for the
3027 command matching the expanded argument, as in
3028 .Ql ?t ,
3029 which should be a shorthand of
3030 .Ql ?type ;
3031 with these documentation strings both commands support a more
3032 .Va verbose
3033 listing mode which includes the argument type of the command and other
3034 information which applies; a handy suggestion might thus be:
3036 .Bd -literal -offset indent
3037 ? define __xv {
3038   # Before v15: need to enable sh(1)ell-style on _entire_ line!
3039   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
3041 ? commandalias xv '\ecall __xv'
3042 ? xv help set
3045 .\" .Ss "Command modifiers" {{{
3046 .Ss "Command modifiers"
3048 Commands may be prefixed by one or multiple command modifiers.
3050 .Bl -bullet
3052 The modifier reverse solidus
3054 .Cm \e ,
3055 to be placed first, prevents
3056 .Ic commandalias
3057 expansions on the remains of the line, e.g.,
3058 .Ql \eecho
3059 will always evaluate the command
3060 .Ic echo ,
3061 even if an (command)alias of the same name exists.
3062 .Ic commandalias
3063 content may itself contain further command modifiers, including
3064 an initial reverse solidus to prevent further expansions.
3067 The modifier
3069 .Cm ignerr
3070 indicates that any error generated by the following command should be
3071 ignored by the state machine and not cause a program exit with enabled
3072 .Va errexit
3073 or for the standardized exit cases in
3074 .Ev POSIXLY_CORRECT
3075 mode.
3076 .Va \&? ,
3077 one of the
3078 .Sx "INTERNAL VARIABLES" ,
3079 will be set to the real exit status of the command regardless.
3082 Some commands support the
3084 .Cm vput
3085 modifier: if used, they expect the name of a variable, which can itself
3086 be a variable, i.e., shell expansion is applied, as their first
3087 argument, and will place their computation result in it instead of the
3088 default location (it is usually written to standard output).
3090 The given name will be tested for being a valid
3091 .Xr sh 1
3092 variable name, and may therefore only consist of upper- and lowercase
3093 characters, digits, and the underscore; the hyphen-minus may be used as
3094 a non-portable extension; digits may not be used as first, hyphen-minus
3095 may not be used as last characters.
3096 In addition the name may either not be one of the known
3097 .Sx "INTERNAL VARIABLES" ,
3098 or must otherwise refer to a writable (non-boolean) value variable.
3099 The actual put operation may fail nonetheless, e.g., if the variable
3100 expects a number argument only a number will be accepted.
3101 Any error during these operations causes the command as such to fail,
3102 and the error number
3103 .Va \&!
3104 will be set to
3105 .Va ^ERR Ns -NOTSUP ,
3106 the exit status
3107 .Va \&?
3108 should be set to
3109 .Ql -1 .
3112 Last, but not least, the modifier
3114 .Cm wysh
3115 can be used for some old and established commands to choose the new
3116 .Sx "Shell-style argument quoting"
3117 rules over the traditional
3118 .Sx "Old-style argument quoting" .
3120 .\" }}}
3122 .\" .Ss "Message list arguments" {{{
3123 .Ss "Message list arguments"
3125 Some commands expect arguments that represent messages (actually
3126 their symbolic message numbers), as has been documented above under
3127 .Sx "Specifying messages"
3128 already.
3129 If no explicit message list has been specified, the next message
3130 forward that satisfies the command's requirements will be used,
3131 and if there are no messages forward of the current message,
3132 the search proceeds backwards;
3133 if there are no good messages at all to be found, an error message is
3134 shown and the command is aborted.
3135 .\" }}}
3137 .\" .Ss "Old-style argument quoting" {{{
3138 .Ss "Old-style argument quoting"
3140 \*(ID This section documents the old, traditional style of quoting
3141 non-message-list arguments to commands which expect this type of
3142 arguments: whereas still used by the majority of such commands, the new
3143 .Sx "Shell-style argument quoting"
3144 may be available even for those via
3145 .Cm wysh ,
3146 one of the
3147 .Sx "Command modifiers" .
3148 Nonetheless care must be taken, because only new commands have been
3149 designed with all the capabilities of the new quoting rules in mind,
3150 which can, e.g., generate control characters.
3153 .Bl -bullet -offset indent
3155 An argument can be enclosed between paired double-quotes
3156 .Ql """argument"""
3158 single-quotes
3159 .Ql 'argument' ;
3160 any whitespace, shell word expansion, or reverse solidus characters
3161 (except as described next) within the quotes are treated literally as
3162 part of the argument.
3163 A double-quote will be treated literally within single-quotes and vice
3164 versa.
3165 Inside such a quoted string the actually used quote character can be
3166 used nonetheless by escaping it with a reverse solidus
3167 .Ql \e ,
3168 as in
3169 .Ql """y\e""ou""" .
3172 An argument that is not enclosed in quotes, as above, can usually still
3173 contain space characters if those spaces are reverse solidus escaped, as in
3174 .Ql you\e are .
3177 A reverse solidus outside of the enclosing quotes is discarded
3178 and the following character is treated literally as part of the argument.
3180 .\" }}}
3182 .\" .Ss "Shell-style argument quoting" {{{
3183 .Ss "Shell-style argument quoting"
3185 Commands which don't expect message-list arguments use
3186 .Xr sh 1 Ns
3187 ell-style, and therefore POSIX standardized, argument parsing and
3188 quoting rules.
3189 \*(ID Most new commands only support these new rules and are flagged
3190 \*(NQ, some elder ones can use them with the command modifier
3191 .Cm wysh ;
3192 in the future only this type of argument quoting will remain.
3195 A command line is parsed from left to right and an input token is
3196 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
3197 Metacharacters are vertical bar
3198 .Cm \&| ,
3199 ampersand
3200 .Cm & ,
3201 semicolon
3202 .Cm \&; ,
3203 as well as all characters from the variable
3204 .Va ifs ,
3205 and / or
3206 .Cm space , tabulator , newline .
3207 The additional metacharacters left and right parenthesis
3208 .Cm \&( , \&)
3209 and less-than and greater-than signs
3210 .Cm < , >
3211 that the
3212 .Xr sh 1
3213 supports are not used, and are treated as ordinary characters: for one
3214 these characters are a vivid part of email addresses, and it seems
3215 highly unlikely that their function will become meaningful to \*(UA.
3217 .Bd -filled -offset indent
3218 .Sy Compatibility note:
3219 \*(ID Please note that even many new-style commands do not yet honour
3220 .Va ifs
3221 to parse their arguments: whereas the
3222 .Xr sh 1 Ns
3223 ell is a language with syntactic elements of clearly defined semantics,
3224 \*(UA parses entire input lines and decides on a per-command base what
3225 to do with the rest of the line.
3226 This also means that whenever an unknown command is seen all that \*(UA
3227 can do is cancellation of the processing of the remains of the line.
3229 It also often depends on an actual subcommand of a multiplexer command
3230 how the rest of the line should be treated, and until v15 we are not
3231 capable to perform this deep inspection of arguments.
3232 Nonetheless, at least the following commands which work with positional
3233 parameters fully support
3234 .Va ifs
3235 for an almost shell-compatible field splitting:
3236 .Ic call , call_if , read , vpospar , xcall .
3240 Any unquoted number sign
3241 .Ql #
3242 at the beginning of a new token starts a comment that extends to the end
3243 of the line, and therefore ends argument processing.
3244 An unquoted dollar sign
3245 .Ql $
3246 will cause variable expansion of the given name, which must be a valid
3247 .Xr sh 1 Ns
3248 ell-style variable name (see
3249 .Cm vput ) :
3250 .Sx "INTERNAL VARIABLES"
3251 as well as
3252 .Sx ENVIRONMENT
3253 (shell) variables can be accessed through this mechanism, brace
3254 enclosing the name is supported (i.e., to subdivide a token).
3257 Whereas the metacharacters
3258 .Cm space , tabulator , newline
3259 only complete an input token, vertical bar
3260 .Cm \&| ,
3261 ampersand
3262 .Cm &
3263 and semicolon
3264 .Cm \&;
3265 also act as control operators and perform control functions.
3266 For now supported is semicolon
3267 .Cm \&; ,
3268 which terminates a single command, therefore sequencing the command line
3269 and making the remainder of the line a subject to reevaluation.
3270 With sequencing, multiple command argument types and quoting rules may
3271 therefore apply to a single line, which can become problematic before
3272 v15: e.g., the first of the following will cause surprising results.
3275 .Dl ? echo one; set verbose; echo verbose=$verbose.
3276 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
3279 Quoting is a mechanism that will remove the special meaning of
3280 metacharacters and reserved words, and will prevent expansion.
3281 There are four quoting mechanisms: the escape character, single-quotes,
3282 double-quotes and dollar-single-quotes:
3285 .Bl -bullet -offset indent
3287 The literal value of any character can be preserved by preceding it
3288 with the escape character reverse solidus
3289 .Ql \e .
3292 Arguments which are enclosed in
3293 .Ql 'single-\:quotes'
3294 retain their literal value.
3295 A single-quote cannot occur within single-quotes.
3298 The literal value of all characters enclosed in
3299 .Ql \(dqdouble-\:quotes\(dq
3300 is retained, with the exception of dollar sign
3301 .Ql $ ,
3302 which will cause variable expansion, as above, backquote (grave accent)
3303 .Ql ` ,
3304 (which not yet means anything special), reverse solidus
3305 .Ql \e ,
3306 which will escape any of the characters dollar sign
3307 .Ql $
3308 (to prevent variable expansion), backquote (grave accent)
3309 .Ql ` ,
3310 double-quote
3311 .Ql \(dq
3312 (to prevent ending the quote) and reverse solidus
3313 .Ql \e
3314 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3315 but has no special meaning otherwise.
3318 Arguments enclosed in
3319 .Ql $'dollar-\:single-\:quotes'
3320 extend normal single quotes in that reverse solidus escape sequences are
3321 expanded as follows:
3323 .Bl -tag -compact -width "Ql \eNNN"
3324 .It Ql \ea
3325 bell control character (ASCII and ISO-10646 BEL).
3326 .It Ql \eb
3327 backspace control characer (ASCII and ISO-10646 BS).
3328 .It Ql \eE
3329 escape control character (ASCII and ISO-10646 ESC).
3330 .It Ql \ee
3331 the same.
3332 .It Ql \ef
3333 form feed control character (ASCII and ISO-10646 FF).
3334 .It Ql \en
3335 line feed control character (ASCII and ISO-10646 LF).
3336 .It Ql \er
3337 carriage return control character (ASCII and ISO-10646 CR).
3338 .It Ql \et
3339 horizontal tabulator control character (ASCII and ISO-10646 HT).
3340 .It Ql \ev
3341 vertical tabulator control character (ASCII and ISO-10646 VT).
3342 .It Ql \e\e
3343 emits a reverse solidus character.
3344 .It Ql \e'
3345 single quote.
3346 .It Ql \e"
3347 double quote (escaping is optional).
3348 .It Ql \eNNN
3349 eight-bit byte with the octal value
3350 .Ql NNN
3351 (one to three octal digits), optionally prefixed by an additional
3352 .Ql 0 .
3353 A 0 byte will suppress further output for the quoted argument.
3354 .It Ql \exHH
3355 eight-bit byte with the hexadecimal value
3356 .Ql HH
3357 (one or two hexadecimal characters).
3358 A 0 byte will suppress further output for the quoted argument.
3359 .It Ql \eUHHHHHHHH
3360 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3361 .Ql HHHHHHHH
3362 (one to eight hexadecimal digits) \(em note that Unicode defines the
3363 maximum codepoint ever to be supported as
3364 .Ql 0x10FFFF
3365 (in planes of
3366 .Ql 0xFFFF
3367 characters each).
3368 This escape is only supported in locales that support Unicode (see
3369 .Sx "Character sets" ) ,
3370 in other cases the sequence will remain unexpanded unless the given code
3371 point is ASCII compatible or (if the \*(OPal character set conversion is
3372 available) can be represented in the current locale.
3373 The character NUL will suppress further output for the quoted argument.
3374 .It Ql \euHHHH
3375 Identical to
3376 .Ql \eUHHHHHHHH
3377 except it takes only one to four hexadecimal digits.
3378 .It Ql \ecX
3379 Emits the non-printable (ASCII and compatible) C0 control codes
3380 0 (NUL) to 31 (US), and 127 (DEL).
3381 Printable representations of ASCII control codes can be created by
3382 mapping them to a different part of the ASCII character set, which is
3383 possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is
3384 .Ql 7 + 64 = 71 = G .
3385 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3386 .Ic vexpr ) ,
3387 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3388 .Ql ? vexpr ^ 127 64 .
3390 Whereas historically circumflex notation has often been used for
3391 visualization purposes of control codes, e.g.,
3392 .Ql ^G ,
3393 the reverse solidus notation has been standardized:
3394 .Ql \ecG .
3395 Some control codes also have standardized (ISO-10646, ISO C) aliases,
3396 as shown above (e.g.,
3397 .Ql \ea ,
3398 .Ql \en ,
3399 .Ql \et ) :
3400 whenever such an alias exists it will be used for display purposes.
3401 The control code NUL
3402 .Pf ( Ql \ec@ ,
3403 a non-standard extension) will suppress further output for the remains
3404 of the token (which may extend beyond the current quote), or, depending
3405 on the context, the remains of all arguments for the current command.
3406 .It Ql \e$NAME
3407 Non-standard extension: expand the given variable name, as above.
3408 Brace enclosing the name is supported.
3409 .It Ql \e`{command}
3410 Not yet supported, just to raise awareness: Non-standard extension.
3415 Caveats:
3417 .Bd -literal -offset indent
3418 ? echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3419 ? echo Quotes ${HOME} and tokens differ! # comment
3420 ? echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3422 .\" }}}
3424 .\" .Ss "Raw data arguments for codec commands" {{{
3425 .Ss "Raw data arguments for codec commands"
3427 A special set of commands, which all have the string
3428 .Dq codec
3429 in their name, e.g.,
3430 .Ic addrcodec ,
3431 .Ic shcodec ,
3432 .Ic urlcodec ,
3433 take raw string data as input, which means that the content of the
3434 command input line is passed completely unexpanded and otherwise
3435 unchanged: like this the effect of the actual codec is visible without
3436 any noise of possible shell quoting rules etc., i.e., the user can input
3437 one-to-one the desired or questionable data.
3438 To gain a level of expansion, the entire command line can be
3439 .Ic eval Ns
3440 uated first, e.g.,
3442 .Bd -literal -offset indent
3443 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3444 ? echo $res
3445 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3446 ? shcodec d $res
3447 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3448 ? eval shcodec d $res
3449 /usr/Sch\[:o]nes Wetter/heute.txt
3451 .\" }}}
3453 .\" .Ss "Filename transformations" {{{
3454 .Ss "Filename transformations"
3456 Filenames, where expected, and unless documented otherwise, are
3457 subsequently subject to the following filename transformations, in
3458 sequence:
3460 .Bl -bullet -offset indent
3462 If the given name is a registered
3463 .Ic shortcut ,
3464 it will be replaced with the expanded shortcut.
3467 The filename is matched against the following patterns or strings:
3469 .Bl -hang -compact -width ".Ar %user"
3470 .It Ar #
3471 (Number sign) is expanded to the previous file.
3472 .It Ar %
3473 (Percent sign) is replaced by the invoking
3474 .Mx -ix "primary system mailbox"
3475 user's primary system mailbox, which either is the (itself expandable)
3476 .Va inbox
3477 if that is set, the standardized absolute pathname indicated by
3478 .Ev MAIL
3479 if that is set, or a built-in compile-time default otherwise.
3480 .It Ar %user
3481 Expands to the primary system mailbox of
3482 .Ar user
3483 (and never the value of
3484 .Va inbox ,
3485 regardless of its actual setting).
3486 .It Ar &
3487 (Ampersand) is replaced with the invoking users
3488 .Mx -ix "secondary mailbox"
3489 secondary mailbox, the
3490 .Ev MBOX .
3491 .It Ar +file
3492 Refers to a
3493 .Ar file
3494 in the
3495 .Va folder
3496 directory (if that variable is set).
3497 .It Ar %:filespec
3498 Expands to the same value as
3499 .Ar filespec ,
3500 but has special meaning when used with, e.g., the command
3501 .Ic file :
3502 the file will be treated as a primary system mailbox by, e.g., the
3503 .Ic mbox
3505 .Ic save
3506 commands, meaning that messages that have been read in the current
3507 session will be moved to the
3508 .Ev MBOX
3509 mailbox instead of simply being flagged as read.
3513 Meta expansions are applied to the resulting filename, as applicable to
3514 the resulting file access protocol (also see
3515 .Sx "On URL syntax and credential lookup" ) .
3516 If the fully expanded filename results in multiple pathnames and the
3517 command is expecting only one file, an error results.
3519 For the file-protocol, a leading tilde
3520 .Ql ~
3521 character will be replaced by the expansion of
3522 .Ev HOME ,
3523 except when followed by a valid user name, in which case the home
3524 directory of the given user is used instead.
3526 In addition a shell expansion as if specified in double-quotes (see
3527 .Sx "Shell-style argument quoting" )
3528 is applied, so that any occurrence of
3529 .Ql $VARIABLE
3531 .Ql ${VARIABLE} )
3532 will be replaced by the expansion of the variable, if possible;
3533 .Sx "INTERNAL VARIABLES"
3534 as well as
3535 .Sx ENVIRONMENT
3536 (shell) variables can be accessed through this mechanism.
3538 In interactive context, in order to allow simple value acceptance (via
3539 .Dq ENTER ) ,
3540 arguments will usually be displayed in a properly quoted form, e.g., a file
3541 .Ql diet\e is \ecurd.txt
3542 may be displayed as
3543 .Ql 'diet\e is \ecurd.txt' .
3545 .\" }}}
3547 .\" .Ss "Commands" {{{
3548 .Ss "Commands"
3550 The following commands are available:
3552 .Bl -tag -width ".It Ic BaNg"
3556 .It Ic \&!
3557 Executes the
3558 .Ev SHELL
3559 command which follows, replacing unescaped exclamation marks with the
3560 previously executed command if the internal variable
3561 .Va bang
3562 is set.
3563 This command supports
3564 .Cm vput
3565 as documented in
3566 .Sx "Command modifiers" ,
3567 and manages the error number
3568 .Va \&! .
3569 A 0 or positive exit status
3570 .Va \&?
3571 reflects the exit status of the command, negative ones that
3572 an error happened before the command was executed, or that the program
3573 did not exit cleanly, but, e.g., due to a signal: the error number is
3574 .Va ^ERR Ns -CHILD ,
3575 then.
3578 In conjunction with the
3579 .Cm vput
3580 modifier the following special cases exist:
3581 a negative exit status occurs if the collected data could not be stored
3582 in the given variable, which is a
3583 .Va ^ERR Ns -NOTSUP
3584 error that should otherwise not occur.
3585 .Va ^ERR Ns -CANCELED
3586 indicates that no temporary file could be created to collect the command
3587 output at first glance.
3588 In case of catchable out-of-memory situations
3589 .Va ^ERR Ns -NOMEM
3590 will occur and \*(UA will try to store the empty string, just like with
3591 all other detected error conditions.
3595 .It Ic #
3596 The comment-command causes the entire line to be ignored.
3597 .Sy Note:
3598 this really is a normal command which' purpose is to discard its
3599 arguments, not a
3600 .Dq comment-start
3601 indicating special character, which means that, e.g., trailing comments
3602 on a line are not possible.
3605 .It Ic +
3606 Goes to the next message in sequence and types it
3607 (like
3608 .Dq ENTER ) .
3611 .It Ic -
3612 Display the preceding message, or the n'th previous message if given
3613 a numeric argument n.
3616 .It Ic =
3617 Show the current message number (the
3618 .Dq dot ) .
3621 .It Ic \&?
3622 Show a brief summary of commands.
3623 \*(OP Given an argument a synopsis for the command in question is
3624 shown instead; commands can be abbreviated in general and this command
3625 can be used to see the full expansion of an abbreviation including the
3626 synopsis, try, e.g.,
3627 .Ql ?h ,
3628 .Ql ?hel
3630 .Ql ?help
3631 and see how the output changes.
3632 This mode also supports a more
3633 .Va verbose
3634 output, which will provide the informations documented for
3635 .Ic list .
3638 .It Ic \&|
3639 A synonym for the
3640 .Ic pipe
3641 command.
3645 .It Ic account , unaccount
3646 (ac, una) Creates, selects or lists (an) account(s).
3647 Accounts are special incarnations of
3648 .Ic define Ns d
3649 macros and group commands and variable settings which together usually
3650 arrange the environment for the purpose of creating an email account.
3651 Different to normal macros settings which are covered by
3652 .Ic localopts
3653 \(en here by default enabled! \(en will not be reverted before the
3654 .Ic account
3655 is changed again.
3656 The special account
3657 .Ql null
3658 (case-insensitive) always exists, and all but it can be deleted by the
3659 latter command, and in one operation with the special name
3660 .Ql * .
3662 Without arguments a listing of all defined accounts is shown.
3663 With one argument the given account is activated: the system
3664 .Va inbox
3665 of that account will be activated (as via
3666 .Ic file ) ,
3667 a possibly installed
3668 .Va folder-hook
3669 will be run, and the internal variable
3670 .Va account
3671 will be updated.
3672 The two argument form is identical to defining a macro as via
3673 .Ic define :
3674 .Bd -literal -offset indent
3675 account myisp {
3676   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
3677   set from='(My Name) myname@myisp.example'
3678   set mta=smtp://mylogin@smtp.myisp.example
3684 .It Ic addrcodec
3685 Perform email address codec transformations on raw-data argument, rather
3686 according to email standards (RFC 5322; \*(ID will furtherly improve).
3687 Supports
3688 .Cm vput
3689 (see
3690 .Sx "Command modifiers" ) ,
3691 and manages the error number
3692 .Va \&! .
3693 The first argument must be either
3694 .Ar [+[+[+]]]e[ncode] ,
3695 .Ar d[ecode]
3697 .Ar s[kin] ,
3698 and specifies the operation to perform on the rest of the line.
3701 Decoding will show how a standard-compliant MUA will display the given
3702 argument, which should be an email address.
3703 Please be aware that most MUAs have difficulties with the address
3704 standards, and vary wildly when (comments) in parenthesis,
3705 .Dq double-quoted
3706 strings, or quoted-pairs, as below, become involved.
3707 \*(ID \*(UA currently does not perform decoding when displaying addresses.
3710 Skinning is identical to decoding but only outputs the plain address,
3711 without any string, comment etc. components.
3712 Another difference is that it may fail with the error number
3713 .Va \&!
3714 set to
3715 .Va ^ERR Ns -INVAL
3716 if decoding fails to find a(n) (valid) email address, in which case the
3717 unmodified input will be output again.
3720 Encoding supports four different modes, lesser automated versions can be
3721 chosen by prefixing one, two or three plus signs: the standard imposes
3722 a special meaning on some characters, which thus have to be transformed
3723 to so-called quoted-pairs by pairing them with a reverse solidus
3724 .Ql \e
3725 in order to remove the special meaning; this might change interpretation
3726 of the entire argument from what has been desired, however!
3727 Specify one plus sign to remark that parenthesis shall be left alone,
3728 two for not turning double quotation marks into quoted-pairs, and three
3729 for also leaving any user-specified reverse solidus alone.
3730 The result will always be valid, if a successful exit status is reported.
3731 \*(ID Addresses need to be specified in between angle brackets
3732 .Ql < ,
3733 .Ql >
3734 if the construct becomes more difficult, otherwise the current parser
3735 will fail; it is not smart enough to guess right.
3737 .Bd -literal -offset indent
3738 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
3739 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3740 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3741 "Hey, you", \e out\e there <diet@exam.ple>
3742 ? addrc s "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3743 diet@exam.ple
3749 .It Ic alias , unalias
3750 (a, una) Aliases are a method of creating personal distribution lists
3751 that map a single alias name to none to multiple real receivers;
3752 these aliases become expanded after message composing is completed.
3753 The latter command removes the given list of aliases, the special name
3754 .Ql *
3755 will discard all existing aliases.
3756 The former command shows all currently defined aliases when used without
3757 arguments, and with one argument the expansion of the given alias.
3758 With more than one argument, creates or appends to the alias name given
3759 as the first argument the remaining arguments.
3760 Alias names are restricted to alphabetic characters, digits, the
3761 underscore, hyphen-minus, the number sign, colon, commercial at and
3762 period, the last character can also be the dollar sign:
3763 .Ql [[:alnum:]_#:@.-]+$? .
3767 .It Ic alternates , unalternates
3768 \*(NQ (alt) Manage a list of alternate addresses or names of the active user,
3769 members of which will be removed from recipient lists.
3770 The latter command removes the given list of alternates, the special name
3771 .Ql *
3772 will discard all existing aliases.
3773 The former command manages the error number
3774 .Va \&!
3775 and shows the current set of alternates when used without arguments; in
3776 this mode it supports
3777 .Cm vput
3778 (see
3779 .Sx "Command modifiers" ) .
3780 Otherwise the given arguments (after being checked for validity) are
3781 appended to the list of alternate names; in
3782 .Va posix
3783 mode they replace that list instead.
3784 There is a set of implicit alternates which is formed of the values of
3785 .Ev LOGNAME ,
3786 .Va from ,
3787 .Va sender
3789 .Va reply-to .
3793 .It Ic answered , unanswered
3794 Take a message lists and mark each message as having been answered,
3795 having not been answered, respectively.
3796 Messages will be marked answered when being
3797 .Ic reply Ns d
3798 to automatically if the
3799 .Va markanswered
3800 variable is set.
3801 See the section
3802 .Sx "Message states" .
3807 .It Ic bind , unbind
3808 \*(OP\*(NQ The bind command extends the MLE (see
3809 .Sx "On terminal control and line editor" )
3810 with freely configurable key bindings.
3811 The latter command removes from the given context the given key binding,
3812 both of which may be specified as a wildcard
3813 .Ql * ,
3814 so that, e.g.,
3815 .Ql unbind * *
3816 will remove all bindings of all contexts.
3817 Due to initialization order unbinding will not work for built-in key
3818 bindings upon program startup, however: please use
3819 .Va line-editor-no-defaults
3820 for this purpose instead.
3823 With one argument the former command shows all key bindings for the
3824 given context, specifying an asterisk
3825 .Ql *
3826 will show the bindings of all contexts; a more verbose listing will be
3827 produced if either of
3828 .Va debug
3830 .Va verbose
3831 are set.
3832 With two or more arguments a binding is (re)established:
3833 the first argument is the context to which the binding shall apply,
3834 the second argument is a comma-separated list of the
3835 .Dq keys
3836 which form the binding, and any remaining arguments form the expansion.
3837 To indicate that a binding shall not be auto-committed, but that the
3838 expansion shall instead be furtherly editable by the user, a commercial at
3839 .Ql @
3840 (that will be removed) can be placed last in the expansion, from which
3841 leading and trailing whitespace will finally be removed.
3842 Reverse solidus cannot be used as the last character of expansion.
3845 Contexts define when a binding applies, i.e., a binding will not be seen
3846 unless the context for which it is defined for is currently active.
3847 This is not true for the shared binding
3848 .Ql base ,
3849 which is the foundation for all other bindings and as such always
3850 applies, its bindings, however, only apply secondarily.
3851 The available contexts are the shared
3852 .Ql base ,
3854 .Ql default
3855 context which is used in all not otherwise documented situations, and
3856 .Ql compose ,
3857 which applies to compose mode only.
3860 .Dq Keys
3861 which form the binding are specified as a comma-separated list of
3862 byte-sequences, where each list entry corresponds to one key(press).
3863 A list entry may, indicated by a leading colon character
3864 .Ql \&: ,
3865 also refer to the name of a terminal capability; several dozen names
3866 will be compiled in and may be specified either by their
3867 .Xr terminfo 5 ,
3868 or, if existing, by their
3869 .Xr termcap 5
3870 name, regardless of the actually used \*(OPal terminal control library.
3871 It is possible to use any capability, as long as the name is resolvable
3872 by the \*(OPal control library or was defined via the internal variable
3873 .Va termcap .
3874 Input sequences are not case-normalized, so that an exact match is
3875 required to update or remove a binding.
3876 Examples:
3878 .Bd -literal -offset indent
3879 ? bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
3880 ? bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
3881 ? bind default $'\ecA',:khome,w 'echo An editable binding@'
3882 ? bind default a,b,c rm -irf / @  # Another editable binding
3883 ? bind default :kf1 File %
3884 ? bind compose :kf1 ~e
3888 Note that the entire comma-separated list is first parsed (over) as a
3889 shell-token with whitespace as the field separator, before being parsed
3890 and expanded for real with comma as the field separator, therefore
3891 whitespace needs to be properly quoted, see
3892 .Sx "Shell-style argument quoting" .
3893 Using Unicode reverse solidus escape sequences renders a binding
3894 defunctional if the locale does not support Unicode (see
3895 .Sx "Character sets" ) ,
3896 and using terminal capabilities does so if no (corresponding) terminal
3897 control support is (currently) available.
3900 The following terminal capability names are built-in and can be used in
3901 .Xr terminfo 5
3902 or (if available) the two-letter
3903 .Xr termcap 5
3904 notation.
3905 See the respective manual for a list of capabilities.
3906 The program
3907 .Xr infocmp 1
3908 can be used to show all the capabilities of
3909 .Ev TERM
3910 or the given terminal type;
3911 using the
3912 .Fl \&\&x
3913 flag will also show supported (non-standard) extensions.
3916 .Bl -tag -compact -width kcuuf_or_kcuuf
3917 .It Cd kbs Ns \0or Cd kb
3918 Backspace.
3919 .It Cd kdch1 Ns \0or Cd kD
3920 Delete character.
3921 .It Cd kDC Ns \0or Cd *4
3922 \(em shifted variant.
3923 .It Cd kel Ns \0or Cd kE
3924 Clear to end of line.
3925 .It Cd kext Ns \0or Cd @9
3926 Exit.
3927 .It Cd kich1 Ns \0or Cd kI
3928 Insert character.
3929 .It Cd kIC Ns \0or Cd #3
3930 \(em shifted variant.
3931 .It Cd khome Ns \0or Cd kh
3932 Home.
3933 .It Cd kHOM Ns \0or Cd #2
3934 \(em shifted variant.
3935 .It Cd kend Ns \0or Cd @7
3936 End.
3937 .It Cd knp Ns \0or Cd kN
3938 Next page.
3939 .It Cd kpp Ns \0or Cd kP
3940 Previous page.
3941 .It Cd kcub1 Ns \0or Cd kl
3942 Left cursor (with more modifiers: see below).
3943 .It Cd kLFT Ns \0or Cd #4
3944 \(em shifted variant.
3945 .It Cd kcuf1 Ns \0or Cd kr
3946 Right cursor (ditto).
3947 .It Cd kRIT Ns \0or Cd %i
3948 \(em shifted variant.
3949 .It Cd kcud1 Ns \0or Cd kd
3950 Down cursor (ditto).
3951 .It Cd kDN
3952 \(em shifted variant (only terminfo).
3953 .It Cd kcuu1 Ns \0or Cd ku
3954 Up cursor (ditto).
3955 .It Cd kUP
3956 \(em shifted variant (only terminfo).
3957 .It Cd kf0 Ns \0or Cd k0
3958 Function key 0.
3959 Add one for each function key up to
3960 .Cd kf9
3962 .Cd k9 ,
3963 respectively.
3964 .It Cd kf10 Ns \0or Cd k;
3965 Function key 10.
3966 .It Cd kf11 Ns \0or Cd F1
3967 Function key 11.
3968 Add one for each function key up to
3969 .Cd kf19
3971 .Cd F9 ,
3972 respectively.
3976 Some terminals support key-modifier combination extensions, e.g.,
3977 .Ql Alt+Shift+xy .
3978 For example, the delete key,
3979 .Cd kdch1 :
3980 in its shifted variant, the name is mutated to
3981 .Cd  kDC ,
3982 then a number is appended for the states
3983 .Ql Alt
3984 .Pf ( Cd kDC3 ) ,
3985 .Ql Shift+Alt
3986 .Pf ( Cd kDC4 ) ,
3987 .Ql Control
3988 .Pf ( Cd kDC5 ) ,
3989 .Ql Shift+Control
3990 .Pf ( Cd kDC6 ) ,
3991 .Ql Alt+Control
3992 .Pf ( Cd kDC7 ) ,
3993 finally
3994 .Ql Shift+Alt+Control
3995 .Pf ( Cd kDC8 ) .
3996 The same for the left cursor key,
3997 .Cd kcub1 :
3998 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
4001 It is advisable to use an initial escape or other control character (e.g.,
4002 .Ql \ecA )
4003 for bindings which describe user key combinations (as opposed to purely
4004 terminal capability based ones), in order to avoid ambiguities whether
4005 input belongs to key sequences or not; it also reduces search time.
4006 Adjusting
4007 .Va bind-timeout
4008 may help shall keys and sequences be falsely recognized.
4012 .It Ic call
4013 \*(NQ Calls the given macro, which must have been created via
4014 .Ic define ,
4015 otherwise a
4016 .Va ^ERR Ns -NOENT
4017 error occurs.
4018 Parameters given to macros are implicitly local to the macro's scope, and
4019 may be accessed via special (positional) parameters, e.g.,
4020 .Va 1 ,
4021 .Va * ,
4022 .Va @ ,
4023 .Va # .
4024 The positional parameters may be removed by
4025 .Ic shift Ns
4026 ing them off the stack (exceeding the supported number of arguments
4027 results in a
4028 .Va ^ERR Ns -OVERFLOW ) ,
4029 and are otherwise controllable via
4030 .Ic vpospar .
4031 Changes to other
4032 .Sx ENVIRONMENT
4033 as well as
4034 .Sx "INTERNAL VARIABLES"
4035 can be reverted before the current level regains control by setting
4036 .Ic localopts
4037 for called macro(s) (or in them, of course).
4038 Macro execution can be terminated at any time by calling
4039 .Ic return .
4042 Calling macros recursively will at some time excess the stack size
4043 limit, causing a hard program abortion; if recursively calling a macro
4044 is the last command of the current macro, consider to use the command
4045 .Ic xcall ,
4046 which will first release all resources of the current macro before
4047 replacing the current macro with the called one.
4048 Numeric and string operations can be performed via
4049 .Ic vexpr ,
4051 .Ic eval
4052 may be helpful to recreate argument lists.
4054 .Bd -literal -offset indent
4055 define exmac {
4056   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
4057   return 1000 0
4059 call exmac Hello macro exmac!
4064 .It Ic call_if
4065 Identical to
4066 .Ic call
4067 if the given macro has been created via
4068 .Ic define ,
4069 but doesn't fail nor warn if the macro doesn't exist.
4072 .It Ic cd
4073 (ch) Change the working directory to
4074 .Ev HOME
4075 or the given argument.
4076 Synonym for
4077 .Ic chdir .
4080 .It Ic certsave
4081 \*(OP Only applicable to S/MIME signed messages.
4082 Takes a message list and a filename and saves the certificates
4083 contained within the message signatures to the named file in both
4084 human-readable and PEM format.
4085 The certificates can later be used to send encrypted messages to the
4086 respective message senders by setting
4087 .Va smime-encrypt-USER@HOST
4088 variables.
4092 .It Ic charsetalias , uncharsetalias
4093 \*(NQ Manage (character set conversion) character set alias mappings,
4094 as documented in the section
4095 .Sx "Character sets" .
4096 Character set aliases are expanded recursively, but no expansion is
4097 performed on values of the user-settable variables, e.g.,
4098 .Va charset-8bit .
4099 These are effectively no-operations if character set conversion
4100 is not available (i.e., no
4101 .Ql +iconv
4103 .Va features ) .
4104 Without arguments the list of all currently defined aliases is shown,
4105 with one argument the expansion of the given alias.
4106 Otherwise all given arguments are treated as pairs of character sets and
4107 their desired target alias name, creating new or changing already
4108 existing aliases, as necessary.
4110 The latter deletes all aliases given as arguments, the special argument
4111 .Ql *
4112 will remove all aliases.
4115 .It Ic chdir
4116 (ch) Change the working directory to
4117 .Ev HOME
4118 or the given argument.
4119 Synonym for
4120 .Ic cd .
4124 .It Ic collapse , uncollapse
4125 Only applicable to threaded mode.
4126 Takes a message list and makes all replies to these messages invisible
4127 in header summaries, except for
4128 .Ql new
4129 messages and the
4130 .Dq dot .
4131 Also when a message with collapsed replies is displayed,
4132 all of these are automatically uncollapsed.
4133 The latter command undoes collapsing.
4138 .It Ic colour , uncolour
4139 \*(OP\*(NQ Manage colour mappings of and for a
4140 .Sx "Coloured display" .
4141 The type of colour is given as the (case-insensitive) first argument,
4142 which must be one of
4143 .Ql 256
4144 for 256-colour terminals,
4145 .Ql 8 ,
4146 .Ql ansi
4148 .Ql iso
4149 for the standard 8-colour ANSI / ISO 6429 color palette and
4150 .Ql 1
4152 .Ql mono
4153 for monochrome terminals.
4154 Monochrome terminals cannot deal with colours, but only (some) font
4155 attributes.
4158 Without further arguments the list of all currently defined mappings
4159 for the given colour type is shown (as a special case giving
4160 .Ql all
4162 .Ql *
4163 will show the mappings of all types).
4164 Otherwise the second argument defines the mappable slot, and the third
4165 argument a (comma-separated list of) colour and font attribute
4166 specification(s), and the optional fourth argument can be used to
4167 specify a precondition: if conditioned mappings exist they are tested in
4168 (creation) order unless a (case-insensitive) match has been found, and
4169 the default mapping (if any has been established) will only be chosen as
4170 a last resort.
4171 The types of precondition available depend on the mappable slot (see
4172 .Sx "Coloured display"
4173 for some examples), the following of which exist:
4176 Mappings prefixed with
4177 .Ql mle-
4178 are used for the \*(OPal built-in Mailx-Line-Editor (MLE, see
4179 .Sx "On terminal control and line editor" )
4180 and do not support preconditions.
4182 .Bl -tag -compact -width view-partinfo
4183 .It Ar mle-position
4184 This mapping is used for the position indicator that is visible when
4185 a line cannot be fully displayed on the screen.
4186 .It Ar mle-prompt
4187 Used for the
4188 .Va prompt .
4192 Mappings prefixed with
4193 .Ql sum-
4194 are used in header summaries, and they all understand the preconditions
4195 .Ql dot
4196 (the current message) and
4197 .Ql older
4198 for elder messages (only honoured in conjunction with
4199 .Va datefield-markout-older ) .
4201 .Bl -tag -compact -width view-partinfo
4202 .It Ar sum-dotmark
4203 This mapping is used for the
4204 .Dq dotmark
4205 that can be created with the
4206 .Ql %>
4208 .Ql %<
4209 formats of the variable
4210 .Va headline .
4211 .It Ar sum-header
4212 For the complete header summary line except the
4213 .Dq dotmark
4214 and the thread structure.
4215 .It Ar sum-thread
4216 For the thread structure which can be created with the
4217 .Ql %i
4218 format of the variable
4219 .Va headline .
4223 Mappings prefixed with
4224 .Ql view-
4225 are used when displaying messages.
4227 .Bl -tag -compact -width view-partinfo
4228 .It Ar view-from_
4229 This mapping is used for so-called
4230 .Ql From_
4231 lines, which are MBOX file format specific header lines.
4232 .It Ar view-header
4233 For header lines.
4234 A comma-separated list of headers to which the mapping applies may be
4235 given as a precondition; if the \*(OPal regular expression support is
4236 available then if any of the
4237 .Dq magical
4238 (extended) regular expression characters is seen the precondition will
4239 be evaluated as (an extended) one.
4240 .It Ar view-msginfo
4241 For the introductional message info line.
4242 .It Ar view-partinfo
4243 For MIME part info lines.
4247 The following (case-insensitive) colour definitions and font attributes
4248 are understood, multiple of which can be specified in a comma-separated
4249 list:
4251 .Bl -tag -width ft=
4252 .It Ar ft=
4253 a font attribute:
4254 .Ql bold ,
4255 .Ql reverse
4257 .Ql underline .
4258 It is possible (and often applicable) to specify multiple font
4259 attributes for a single mapping.
4261 .It Ar fg=
4262 foreground colour attribute:
4263 .Ql black ,
4264 .Ql blue ,
4265 .Ql green ,
4266 .Ql red ,
4267 .Ql brown ,
4268 .Ql magenta ,
4269 .Ql cyan
4271 .Ql white .
4272 To specify a 256-color mode a decimal number colour specification in
4273 the range 0 to 255, inclusive, is supported, and interpreted as follows:
4275 .Bl -tag -compact -width "999 - 999"
4276 .It 0 - 7
4277 the standard ISO 6429 colors, as above.
4278 .It 8 - 15
4279 high intensity variants of the standard colors.
4280 .It 16 - 231
4281 216 colors in tuples of 6.
4282 .It 232 - 255
4283 grayscale from black to white in 24 steps.
4285 .Bd -literal -offset indent
4286 #!/bin/sh -
4287 fg() { printf "\e033[38;5;${1}m($1)"; }
4288 bg() { printf "\e033[48;5;${1}m($1)"; }
4290 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
4291 printf "\e033[0m\en"
4293 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
4294 printf "\e033[0m\en"
4297 .It Ar bg=
4298 background colour attribute (see
4299 .Cd fg=
4300 for possible values).
4304 The command
4305 .Ic \&uncolour
4306 will remove for the given colour type (the special type
4307 .Ql *
4308 selects all) the given mapping; if the optional precondition argument is
4309 given only the exact tuple of mapping and precondition is removed.
4310 The special name
4311 .Ql *
4312 will remove all mappings (no precondition allowed), thus
4313 .Ql uncolour * *
4314 will remove all established mappings.
4319 .It Ic commandalias , uncommandalias
4320 \*(NQ Define or list, and remove, respectively, command aliases.
4321 An (command)alias can be used everywhere a normal command can be used,
4322 but always takes precedence: any arguments that are given to the command
4323 alias are joined onto the alias expansion, and the resulting string
4324 forms the command line that is, in effect, executed.
4325 The latter command removes all given aliases, the special name
4326 .Ql *
4327 will remove all existing aliases.
4328 When used without arguments the former shows a list of all currently
4329 known aliases, with one argument only the expansion of the given one.
4331 With two or more arguments a command alias is defined or updated: the
4332 first argument is the name under which the remaining command line should
4333 be accessible, the content of which can be just about anything.
4334 An alias may itself expand to another alias, but to avoid expansion loops
4335 further expansion will be prevented if an alias refers to itself or if
4336 an expansion depth limit is reached.
4337 Explicit expansion prevention is available via reverse solidus
4338 .Cm \e ,
4339 one of the
4340 .Sx "Command modifiers" .
4341 .Bd -literal -offset indent
4342 ? commandalias xx
4343 \*(uA: `commandalias': no such alias: xx
4344 ? commandalias xx echo hello,
4345 ? commandalias xx
4346 commandalias xx 'echo hello,'
4347 ? xx
4348 hello,
4349 ? xx world
4350 hello, world
4354 .It Ic Copy
4355 (C) Copy messages to files whose names are derived from the author of
4356 the respective message and do not mark them as being saved;
4357 otherwise identical to
4358 .Ic Save .
4361 .It Ic copy
4362 (c) Copy messages to the named file and do not mark them as being saved;
4363 otherwise identical to
4364 .Ic save .
4367 .It Ic cwd
4368 Show the name of the current working directory, as reported by
4369 .Xr getcwd 3 .
4370 Supports
4371 .Cm vput
4372 (see
4373 .Sx "Command modifiers" ) .
4374 The return status is tracked via
4375 .Va \&! .
4378 .It Ic Decrypt
4379 \*(OP For unencrypted messages this command is identical to
4380 .Ic Copy ;
4381 Encrypted messages are first decrypted, if possible, and then copied.
4384 .It Ic decrypt
4385 \*(OP For unencrypted messages this command is identical to
4386 .Ic copy ;
4387 Encrypted messages are first decrypted, if possible, and then copied.
4391 .It Ic define , undefine
4392 Without arguments the current list of macros, including their content,
4393 is shown, otherwise a macro is defined, replacing an existing macro of
4394 the same name.
4395 A macro definition is a sequence of commands in the following form:
4396 .Bd -literal -offset indent
4397 define name {
4398   command1
4399   command2
4400   ...
4401   commandN
4405 A defined macro can be invoked explicitly by using the
4406 .Ic call ,
4407 .Ic call_if
4409 .Ic xcall
4410 commands, or implicitly if a macro hook is triggered, e.g., a
4411 .Va folder-hook .
4412 It is possible to localize adjustments, like creation, deletion and
4413 modification of
4414 .Sx "INTERNAL VARIABLES" ,
4415 by using the
4416 .Ic localopts
4417 command; the scope which is localized depends on how (i.e.,
4418 .Dq as what :
4419 normal macro, folder hook, hook,
4420 .Ic account
4421 switch) the macro is invoked.
4422 Execution of a macro body can be stopped from within by calling
4423 .Ic return .
4424 Inside a
4425 .Ic call Ns
4426 ed macro, given positional parameters can be
4427 .Ic shift Ns
4428 ed, or become completely replaced, removed etc. via
4429 .Ic vpospar .
4431 The latter command deletes the given macro, the special name
4432 .Ql *
4433 will discard all existing macros.
4434 Creation and deletion of (a) macro(s) can be performed from within
4435 a running macro.
4439 .It Ic delete , undelete
4440 (d, u) Marks the given message list as being or not being
4441 .Ql deleted ,
4442 respectively; if no argument has been specified then the usual search
4443 for a visible message is performed, as documented for
4444 .Sx "Message list arguments" ,
4445 showing only the next input prompt if the search fails.
4446 Deleted messages will neither be saved in the
4447 .Mx -sx
4448 .Sx "secondary mailbox"
4449 .Ev MBOX
4450 nor will they be available for most other commands.
4451 If the
4452 .Va autoprint
4453 variable is set, the new
4454 .Dq dot
4455 or the last message restored, respectively, is automatically
4456 .Ic type Ns
4457 d; also see
4458 .Ic dp ,
4459 .Ic dt .
4462 .It Ic discard
4463 (di) Identical to
4464 .Ic ignore .
4465 Superseded by the multiplexer
4466 .Ic headerpick .
4470 .It Ic dp , dt
4471 Delete the given messages and automatically
4472 .Ic type
4473 the new
4474 .Dq dot
4475 if one exists, regardless of the setting of
4476 .Va autoprint .
4479 .It Ic dotmove
4480 Move the
4481 .Dq dot
4482 up or down by one message when given
4483 .Ql +
4485 .Ql -
4486 argument, respectively.
4490 .It Ic draft , undraft
4491 Take message lists and mark each given message as being draft, or not
4492 being draft, respectively, as documented in the section
4493 .Sx "Message states" .
4496 .It Ic echo
4497 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4498 newline, whereas the otherwise identical
4499 .Ic echon
4500 does not.
4501 .Sx "Shell-style argument quoting"
4502 is used,
4503 .Sx "Filename transformations"
4504 are applied to the expanded arguments.
4507 .It Ic echoerr
4508 \*(NQ Identical to
4509 .Ic echo
4510 except that is echoes to standard error.
4511 Also see
4512 .Ic echoerrn .
4513 In interactive sessions the \*(OPal message ring queue for
4514 .Ic errors
4515 will be used instead, if available.
4518 .It Ic echon
4519 \*(NQ Identical to
4520 .Ic echo ,
4521 but does not write a trailing newline.
4524 .It Ic echoerrn
4525 \*(NQ Identical to
4526 .Ic echoerr ,
4527 but does not write a trailing newline.
4530 .It Ic edit
4531 (e) Point the text editor (as defined in
4532 .Ev EDITOR )
4533 at each message from the given list in turn.
4534 Modified contents are discarded unless the
4535 .Va writebackedited
4536 variable is set, and are not used unless the mailbox can be written to
4537 and the editor returns a successful exit status.
4540 .It Ic elif
4541 Part of the
4542 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4543 conditional \(em if the condition of a preceding
4544 .Ic if
4545 was false, check the following condition and execute the following block
4546 if it evaluates true.
4549 .It Ic else
4550 (el) Part of the
4551 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4552 conditional \(em if none of the conditions of the preceding
4553 .Ic if
4555 .Ic elif
4556 commands was true, the
4557 .Ic else
4558 block is executed.
4561 .It Ic endif
4562 (en) Marks the end of an
4563 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
4564 conditional execution block.
4568 .It Ic environ
4569 \*(NQ \*(UA has a strict notion about which variables are
4570 .Sx "INTERNAL VARIABLES"
4571 and which are managed in the program
4572 .Sx ENVIRONMENT .
4573 Since some of the latter are a vivid part of \*(UAs functioning,
4574 however, they are transparently integrated into the normal handling of
4575 internal variables via
4576 .Ic set
4578 .Ic unset .
4579 To integrate other environment variables of choice into this
4580 transparent handling, and also to export internal variables into the
4581 process environment where they normally are not, a
4582 .Ql link
4583 needs to become established with this command, as in, e.g.,
4586 .Dl environ link PERL5LIB TZ
4589 Afterwards changing such variables with
4590 .Ic set
4591 will cause automatic updates of the program environment, and therefore
4592 be inherited by newly created child processes.
4593 Sufficient system support provided (it was in BSD as early as 1987, and
4594 is standardized since Y2K) removing such variables with
4595 .Ic unset
4596 will remove them also from the program environment, but in any way
4597 the knowledge they ever have been
4598 .Ql link Ns
4599 ed will be lost.
4600 Note that this implies that
4601 .Ic localopts
4602 may cause loss of such links.
4605 The command
4606 .Ql unlink
4607 will remove an existing link, but leaves the variables as such intact.
4608 Additionally the subcommands
4609 .Ql set
4611 .Ql unset
4612 are provided, which work exactly the same as the documented commands
4613 .Ic set
4615 .Ic unset ,
4616 but (additionally un)link the variable(s) with the program environment
4617 and thus immediately export them to, or remove them from (if possible),
4618 respectively, the program environment.
4622 .It Ic errors
4623 \*(OP Since \*(UA uses the console as a user interface it can happen
4624 that messages scroll by too fast to become recognized.
4625 An error message ring queue is available which stores duplicates of any
4626 error message and notifies the user in interactive sessions whenever
4627 a new error has occurred.
4628 The queue is finite: if its maximum size is reached any new message
4629 replaces the eldest.
4630 The command
4631 .Ic errors
4632 can be used to manage this message queue: if given
4633 .Ar show
4634 or no argument the queue will be displayed and cleared,
4635 .Ar clear
4636 will only clear all messages from the queue.
4639 .It Ic eval
4640 \*(NQ Construct a command by concatenating the arguments, separated with
4641 a single space character, and then evaluate the result.
4642 This command passes through the exit status
4643 .Va \&?
4644 and error number
4645 .Va \&!
4646 of the evaluated command; also see
4647 .Ic call .
4648 .Bd -literal -offset indent
4649 define xxx {
4650   echo "xxx arg <$1>"
4651   shift
4652   if [ $# -gt 0 ]
4653     \excall xxx "$@"
4654   endif
4656 define yyy {
4657   eval "$@ ' ball"
4659 call yyy '\ecall xxx' "b\e$'\et'u ' "
4660 call xxx arg <b      u>
4661 call xxx arg <  >
4662 call xxx arg <ball>
4666 .It Ic exit
4667 (ex or x) Exit from \*(UA without changing the active mailbox and skip
4668 any saving of messages in the
4669 .Mx -sx
4670 .Sx "secondary mailbox"
4671 .Ev MBOX ,
4672 as well as a possibly tracked line editor
4673 .Va history-file .
4674 The optional status number argument will be passed through to
4675 .Xr exit 3 .
4676 \*(ID For now it can happen that the given status will be overwritten,
4677 later this will only occur if a later error needs to be reported onto an
4678 otherwise success indicating status.
4681 .It Ic File
4682 (Fi) Like
4683 .Ic file ,
4684 but open the mailbox read-only.
4688 .It Ic file
4689 (fi) The file command switches to a new mailbox.
4690 Without arguments it shows status information of the current mailbox.
4691 If an argument is given, it will write out changes (such as deletions)
4692 the user has made, open a new mailbox, update the internal variables
4693 .Va mailbox-resolved
4695 .Va mailbox-display ,
4696 and optionally display a summary of
4697 .Ic headers
4698 if the variable
4699 .Va header
4700 is set.
4703 .Sx "Filename transformations"
4704 will be applied to the
4705 .Ar name
4706 argument, and
4707 .Ql protocol://
4708 prefixes are, i.e., URL syntax is understood, e.g.,
4709 .Ql maildir:///tmp/mdirbox :
4710 if a protocol prefix is used the mailbox type is fixated and neither
4711 the auto-detection (read on) nor the
4712 .Va newfolders
4713 mechanisms apply.
4714 \*(OPally URLs can also be used to access network resources, and it is
4715 possible to proxy all network traffic over a SOCKS5 server given via
4716 .Va socks-proxy .
4719 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
4720 .Dl \*(OU protocol://[user@]host[:port][/path]
4723 \*(OPally supported network protocols are
4724 .Ar pop3
4725 (POP3) and
4726 .Ar pop3s
4727 (POP3 with SSL/TLS encrypted transport),
4728 .Ar imap
4730 .Ar imaps .
4732 .Ar [/path]
4733 part is valid only for IMAP; there it defaults to
4734 .Ar INBOX .
4735 Network URLs require a special encoding as documented in the section
4736 .Sx "On URL syntax and credential lookup" .
4739 If the resulting file protocol (MBOX database)
4740 .Ar name
4741 is located on a local filesystem then the list of all registered
4742 .Ic filetype Ns
4743 s is traversed in order to see whether a transparent intermediate
4744 conversion step is necessary to handle the given mailbox, in which case
4745 \*(UA will use the found hook to load and save data into and from
4746 a temporary file, respectively.
4747 Changing hooks will not affect already opened mailboxes.
4748 For example, the following creates hooks for the
4749 .Xr gzip 1
4750 compression tool and a combined compressed and encrypted format:
4752 .Bd -literal -offset indent
4753 ? filetype \e
4754     gzip 'gzip -dc' 'gzip -c' \e
4755     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
4759 MBOX database files are generally locked during file operations in order
4760 to avoid inconsistencies due to concurrent modifications.
4761 \*(OPal Mailbox files which \*(UA treats as the system
4762 .Va inbox
4763 .Pf ( Ev MAIL ) ,
4765 .Mx -sx
4766 .Sx "primary system mailbox" Ns
4767 es in general will also be protected by so-called dotlock files, the
4768 traditional way of mail spool file locking: for any file
4769 .Ql a
4770 a lock file
4771 .Ql a.lock
4772 will be created for the duration of the synchronization \(em
4773 as necessary a privilege-separated dotlock child process will be used
4774 to accommodate for necessary privilege adjustments in order to create
4775 the dotlock file in the same directory
4776 and with the same user and group identities as the file of interest.
4779 \*(UA by default uses tolerant POSIX rules when reading MBOX database
4780 files, but it will detect invalid message boundaries in this mode and
4781 complain (even more with
4782 .Va debug )
4783 if any is seen: in this case
4784 .Va mbox-rfc4155
4785 can be used to create a valid MBOX database from the invalid input.
4788 If no protocol has been fixated, and
4789 .Ar name
4790 refers to a directory with the subdirectories
4791 .Ql tmp ,
4792 .Ql new
4794 .Ql cur ,
4795 then it is treated as a folder in
4796 .Dq Maildir
4797 format.
4798 The maildir format stores each message in its own file, and has been
4799 designed so that file locking is not necessary when reading or writing
4800 files.
4803 \*(ID If no protocol has been fixated and no existing file has
4804 been found, the variable
4805 .Va newfolders
4806 controls the format of mailboxes yet to be created.
4811 .It Ic filetype , unfiletype
4812 \*(NQ Define or list, and remove, respectively, file handler hooks,
4813 which provide (shell) commands that enable \*(UA to load and save MBOX
4814 files from and to files with the registered file extensions;
4815 it will use an intermediate temporary file to store the plain data.
4816 The latter command removes the hooks for all given extensions,
4817 .Ql *
4818 will remove all existing handlers.
4820 When used without arguments the former shows a list of all currently
4821 defined file hooks, with one argument the expansion of the given alias.
4822 Otherwise three arguments are expected, the first specifying the file
4823 extension for which the hook is meant, and the second and third defining
4824 the load- and save commands, respectively, to deal with the file type,
4825 both of which must read from standard input and write to standard
4826 output.
4827 Changing hooks will not affect already opened mailboxes (\*(ID except below).
4828 \*(ID For now too much work is done, and files are oftened read in twice
4829 where once would be sufficient: this can cause problems if a filetype is
4830 changed while such a file is opened; this was already so with the
4831 built-in support of .gz etc. in Heirloom, and will vanish in v15.
4832 \*(ID For now all handler strings are passed to the
4833 .Ev SHELL for evaluation purposes; in the future a
4834 .Ql \&!
4835 prefix to load and save commands may mean to bypass this shell instance:
4836 placing a leading space will avoid any possible misinterpretations.
4837 .Bd -literal -offset indent
4838 ? filetype bz2 'bzip2 -dc' 'bzip2 -zc' \e
4839     gz 'gzip -dc' 'gzip -c'  xz 'xz -dc' 'xz -zc' \e
4840     zst 'zstd -dc' 'zstd -19 -zc' \e
4841     zst.pgp 'gpg -d | zstd -dc' 'zstd -19 -zc | gpg -e'
4842 ? set record=+sent.zst.pgp
4847 .It Ic flag , unflag
4848 Take message lists and mark the messages as being flagged, or not being
4849 flagged, respectively, for urgent/special attention.
4850 See the section
4851 .Sx "Message states" .
4854 .It Ic folder
4855 (fold) The same as
4856 .Ic file .
4859 .It Ic folders
4860 With no arguments, list the names of the folders in the folder directory.
4861 With an existing folder as an argument,
4862 lists the names of folders below the named folder.
4865 .It Ic Followup
4866 (F) Similar to
4867 .Ic Respond ,
4868 but saves the message in a file named after the local part of the first
4869 recipient's address (instead of in
4870 .Va record Ns ).
4873 .It Ic followup
4874 (fo) Similar to
4875 .Ic respond ,
4876 but saves the message in a file named after the local part of the first
4877 recipient's address (instead of in
4878 .Va record Ns ).
4881 .It Ic followupall
4882 Similar to
4883 .Ic followup ,
4884 but responds to all recipients regardless of the
4885 .Va flipr
4886 variable.
4889 .It Ic followupsender
4890 Similar to
4891 .Ic Followup ,
4892 but responds to the sender only regardless of the
4893 .Va flipr
4894 variable.
4897 .It Ic Forward
4898 Similar to
4899 .Ic forward ,
4900 but saves the message in a file named after the local part of the
4901 recipient's address (instead of in
4902 .Va record Ns ).
4905 .It Ic forward
4906 Takes a message and the address of a recipient
4907 and forwards the message to him.
4908 The text of the original message is included in the new one,
4909 with the value of the
4910 .Va forward-inject-head
4911 variable preceding it.
4912 To filter the included header fields to the desired subset use the
4913 .Ql forward
4914 slot of the white- and blacklisting command
4915 .Ic headerpick .
4916 Only the first part of a multipart message is included unless
4917 .Va forward-as-attachment ,
4918 and recipient addresses will be stripped from comments, names etc.
4919 unless the internal variable
4920 .Va fullnames
4921 is set.
4923 This may generate the errors
4924 .Va ^ERR Ns -DESTADDRREQ
4925 if no receiver has been specified,
4926 .Va ^ERR Ns -PERM
4927 if some addressees where rejected by
4928 .Va expandaddr ,
4929 .Va ^ERR Ns -NODATA
4930 if no applicable messages have been given,
4931 .Va ^ERR Ns -NOTSUP
4932 if multiple messages have been specified,
4933 .Va ^ERR Ns -IO
4934 if an I/O error occurs,
4935 .Va ^ERR Ns -NOTSUP
4936 if a necessary character set conversion fails, and
4937 .Va ^ERR Ns -INVAL
4938 for other errors.
4941 .It Ic from
4942 (f) Takes a list of message specifications and displays a summary of
4943 their message headers, exactly as via
4944 .Ic headers .
4945 An alias of this command is
4946 .Ic search .
4947 Also see
4948 .Sx "Specifying messages" .
4950 .It Ic Fwd
4951 \*(OB Alias for
4952 .Ic Forward .
4954 .It Ic fwd
4955 \*(OB Alias for
4956 .Ic forward .
4958 .It Ic fwdignore
4959 \*(OB Superseded by the multiplexer
4960 .Ic headerpick .
4962 .It Ic fwdretain
4963 \*(OB Superseded by the multiplexer
4964 .Ic headerpick .
4966 .It Ic ghost , unghost
4967 \*(OB Replaced by
4968 .Ic commandalias ,
4969 .Ic uncommandalias .
4973 .It Ic headerpick , unheaderpick
4974 \*(NQ Multiplexer command to manage white- and blacklisting
4975 selections of header fields for a variety of applications.
4976 Without arguments the set of contexts that have settings is displayed.
4977 When given arguments, the first argument is the context to which the
4978 command applies, one of (case-insensitive)
4979 .Ql type
4980 for display purposes (via, e.g.,
4981 .Ic type ) ,
4982 .Ql save
4983 for selecting which headers shall be stored persistently when
4984 .Ic save ,
4985 .Ic copy ,
4986 .Ic move
4987 or even
4988 .Ic decrypt Ns
4989 ing messages (note that MIME related etc. header fields should not be
4990 ignored in order to not destroy usability of the message in this case),
4991 .Ql forward
4992 for stripping down messages when
4993 .Ic forward Ns
4994 ing message (has no effect if
4995 .Va forward-as-attachment
4996 is set), and
4997 .Ql top
4998 for defining user-defined set of fields for the command
4999 .Ic top .
5001 The current settings of the given context are displayed if it is the
5002 only argument.
5003 A second argument denotes the type of restriction that is to be chosen,
5004 it may be (a case-insensitive prefix of)
5005 .Ql retain
5007 .Ql ignore
5008 for white- and blacklisting purposes, respectively.
5009 Establishing a whitelist suppresses inspection of the corresponding
5010 blacklist.
5012 If no further argument is given the current settings of the given type
5013 will be displayed, otherwise the remaining arguments specify header
5014 fields, which \*(OPally may be given as regular expressions, to be added
5015 to the given type.
5016 The special wildcard field (asterisk,
5017 .Ql * )
5018 will establish a (fast) shorthand setting which covers all fields.
5020 The latter command always takes three or more arguments and can be used
5021 to remove selections, i.e., from the given context, the given type of
5022 list, all the given headers will be removed, the special argument
5023 .Ql *
5024 will remove all headers.
5027 .It Ic headers
5028 (h) Show the current group of headers, the size of which depends on
5029 the variable
5030 .Va screen ,
5031 and the style of which can be adjusted with the variable
5032 .Va headline .
5033 If a message-specification is given the group of headers containing the
5034 first message therein is shown and the message at the top of the screen
5035 becomes the new
5036 .Dq dot .
5039 .It Ic help
5040 (hel) A synonym for
5041 .Ic \&? .
5044 .It Ic history
5045 \*(OP Either
5046 .Ar show
5047 (this mode also supports a more
5048 .Va verbose
5049 output) or
5050 .Ar clear
5051 the list of history entries;
5052 a decimal
5053 .Ar NUMBER
5054 argument selects and evaluates the respective history entry,
5055 which will become the new history top; a negative number is used as an
5056 offset to the current command, e.g.,
5057 .Ql -1
5058 will select the last command, the history top.
5059 The default mode if no arguments are given is
5060 .Ar show .
5061 Please see
5062 .Sx "On terminal control and line editor"
5063 for more on this topic.
5066 .It Ic hold
5067 (ho, also
5068 .Ic preserve )
5069 Takes a message list and marks each message therein to be saved in the
5070 user's system
5071 .Va inbox
5072 instead of in the
5073 .Mx -sx
5074 .Sx "secondary mailbox"
5075 .Ev MBOX .
5076 Does not override the
5077 .Ic delete
5078 command.
5079 \*(UA deviates from the POSIX standard with this command, because a
5080 .Ic next
5081 command issued after
5082 .Ic hold
5083 will display the following message, not the current one.
5087 .It Ic if
5088 (i) Part of the nestable
5089 .Ic if Ns \0/\: Ic elif Ns \0/\: Ic else Ns \0/\: Ic endif
5090 conditional execution construct \(em if the given condition is true then
5091 the encapsulated block is executed.
5092 The POSIX standards supports the (case-insensitive) conditions
5093 .Ql r Ns
5094 eceive
5096 .Ql s Ns
5097 end, all remaining conditions are non-portable extensions.
5098 \*(ID These commands do not yet use
5099 .Sx "Shell-style argument quoting"
5100 and therefore do not know about input tokens, so that syntax
5101 elements have to be surrounded by whitespace; in v15 \*(UA will inspect
5102 all conditions bracket group wise and consider the tokens, representing
5103 values and operators, therein, which also means that variables will
5104 already have been expanded at that time (just like in the shell).
5106 .Bd -literal -offset indent
5107 if receive
5108   commands ...
5109 else
5110   commands ...
5111 endif
5115 The (case-insensitive) condition
5116 .Ql t Ns
5117 erminal will evaluate to true if the standard input is a terminal, i.e.,
5118 in interactive sessions.
5119 Another condition can be any boolean value (see the section
5120 .Sx "INTERNAL VARIABLES"
5121 for textual boolean representations) to mark an enwrapped block as
5122 .Dq never execute
5124 .Dq always execute .
5125 (It shall be remarked that a faulty condition skips all branches until
5126 .Ic endif . )
5129 (\*(ID In v15
5130 .Sx "Shell-style argument quoting"
5131 will be used, and this command will simply interpret expanded tokens.)
5132 It is possible to check
5133 .Sx "INTERNAL VARIABLES"
5134 as well as
5135 .Sx ENVIRONMENT
5136 variables for existence or compare their expansion against a user given
5137 value or another variable by using the
5138 .Ql $
5139 .Pf ( Dq variable next )
5140 conditional trigger character;
5141 a variable on the right hand side may be signalled using the same
5142 mechanism.
5143 Variable names may be enclosed in a pair of matching braces.
5144 When this mode has been triggered, several operators are available:
5147 Integer operators treat the arguments on the left and right hand side of
5148 the operator as integral numbers and compare them arithmetically.
5149 It is an error if any of the operands is not a valid integer, an empty
5150 argument (which implies it had been quoted) is treated as if it were 0.
5151 Available operators are
5152 .Ql -lt
5153 (less than),
5154 .Ql -le
5155 (less than or equal to),
5156 .Ql -eq
5157 (equal),
5158 .Ql -ne
5159 (not equal),
5160 .Ql -ge
5161 (greater than or equal to), and
5162 .Ql -gt
5163 (greater than).
5166 String data operators compare the left and right hand side according to
5167 their textual content.
5168 Unset variables are treated as the empty string.
5169 The behaviour of string operators can be adjusted by prefixing the
5170 operator with the modifier trigger commercial at
5171 .Ql @ ,
5172 followed by none to multiple modifiers: for now supported is
5173 .Ql i ,
5174 which turns the comparison into a case-insensitive one: this is
5175 implied if no modifier follows the trigger.
5178 Available string operators are
5179 .Ql <
5180 (less than),
5181 .Ql <=
5182 (less than or equal to),
5183 .Ql ==
5184 (equal),
5185 .Ql !=
5186 (not equal),
5187 .Ql >=
5188 (greater than or equal to),
5189 .Ql >
5190 (greater than),
5191 .Ql =%
5192 (is substring of) and
5193 .Ql !%
5194 (is not substring of).
5195 By default these operators work on bytes and (therefore) do not take
5196 into account character set specifics.
5197 If the case-insensitivity modifier has been used, case is ignored
5198 according to the rules of the US-ASCII encoding, i.e., bytes are
5199 still compared.
5202 When the \*(OPal regular expression support is available, the additional
5203 string operators
5204 .Ql =~
5206 .Ql !~
5207 can be used.
5208 They treat the right hand side as an extended regular expression that is
5209 matched according to the active locale (see
5210 .Sx "Character sets" ) ,
5211 i.e., character sets should be honoured correctly.
5214 Conditions can be joined via AND-OR lists (where the AND operator is
5215 .Ql &&
5216 and the OR operator is
5217 .Ql || ) ,
5218 which have equal precedence and will be evaluated with left
5219 associativity, thus using the same syntax that is known for the
5220 .Xr sh 1 .
5221 It is also possible to form groups of conditions and lists by enclosing
5222 them in pairs of brackets
5223 .Ql [\ \&.\&.\&.\ ] ,
5224 which may be interlocked within each other, and also be joined via
5225 AND-OR lists.
5228 The results of individual conditions and entire groups may be modified
5229 via unary operators: the unary operator
5230 .Ql \&!
5231 will reverse the result.
5233 .Bd -literal -offset indent
5234 # (This not in v15, there [ -n "$debug"]!)
5235 if $debug
5236   echo *debug* is set
5237 endif
5238 if [ "$ttycharset" == UTF-8 ] || [ "$ttycharset" @i== UTF8 ]
5239   echo *ttycharset* is UTF-8, the former case-sensitive!
5240 endif
5241 set t1=one t2=one
5242 if [ "${t1}" == "${t2}" ]
5243   echo These two variables are equal
5244 endif
5245 if [ "$features" =% +regex ] && [ "$TERM" @i=~ "^xterm\&.*" ]
5246   echo ..in an X terminal
5247 endif
5248 if [ [ true ] && [ [ "${debug}" != '' ] || \e
5249     [ "$verbose" != '' ] ] ]
5250   echo Noisy, noisy
5251 endif
5252 if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
5253   echo Left associativity, as is known from the shell
5254 endif
5259 .It Ic ignore
5260 (ig) Identical to
5261 .Ic discard .
5262 Superseded by the multiplexer
5263 .Ic headerpick .
5266 .It Ic list
5267 Shows the names of all available commands, alphabetically sorted.
5268 If given any non-whitespace argument the list will be shown in the order
5269 in which command prefixes are searched.
5270 \*(OP In conjunction with a set variable
5271 .Va verbose
5272 additional information will be provided for each command: the argument
5273 type will be indicated, the documentation string will be shown,
5274 and the set of command flags will show up:
5276 .Bl -tag -compact -width ".It Ql BaNg"
5277 .It Ql "vput modifier"
5278 command supports the command modifier
5279 .Cm vput .
5280 .It Ql "errno in *!*"
5281 the error number is tracked in
5282 .Va \&! .
5283 .It Ql "needs box"
5284 commands needs an active mailbox, a
5285 .Ic file .
5286 .It Ql "ok: batch or interactive"
5287 command may only be used in interactive or
5288 .Fl #
5289 batch mode.
5290 .It Ql "ok: send mode"
5291 command can be used in send mode.
5292 .It Ql "not ok: compose mode"
5293 command is not available when in compose mode.
5294 .It Ql "not ok: during startup"
5295 command cannot be used during program startup, e.g., while loading
5296 .Sx "Resource files" .
5297 .It Ql "ok: in subprocess"
5298 command is allowed to be used when running in a subprocess instance,
5299 e.g., from within a macro that is called via
5300 .Va on-compose-splice .
5305 .It Ic localopts
5306 This command can be used to localize changes to (linked)
5307 .Sx ENVIRONMENT
5308 as well as
5309 .Sx "INTERNAL VARIABLES" ,
5310 meaning that their state will be reverted to the former one once the
5311 .Dq covered scope
5312 is left.
5313 It can only be used inside of macro definition blocks introduced by
5314 .Ic account
5316 .Ic define .
5317 The covered scope of an
5318 .Ic account
5319 is left once a different account is activated, and some macros, notably
5320 .Va folder-hook Ns s ,
5321 use their own specific notion of covered scope, here it will be extended
5322 until the folder is left again.
5325 This setting stacks up: i.e., if
5326 .Ql macro1
5327 enables change localization and calls
5328 .Ql macro2 ,
5329 which explicitly resets localization, then any value changes within
5330 .Ql macro2
5331 will still be reverted when the scope of
5332 .Ql macro1
5333 is left.
5334 (Caveats: if in this example
5335 .Ql macro2
5336 changes to a different
5337 .Ic account
5338 which sets some variables that are already covered by localizations,
5339 their scope will be extended, and in fact leaving the
5340 .Ic account
5341 will (thus) restore settings in (likely) global scope which actually
5342 were defined in a local, macro private context!)
5345 This command takes one or two arguments, the optional first one
5346 specifies an attribute that may be one of
5347 .Cm scope ,
5348 which refers to the current scope and is thus the default,
5349 .Cm call ,
5350 which causes any macro that is being
5351 .Ic call Ns
5352 ed to be started with localization enabled by default, as well as
5353 .Cm call-fixate ,
5354 which (if enabled) disallows any called macro to turn off localization:
5355 like this it can be ensured that once the current scope regains control,
5356 any changes made in deeper levels have been reverted.
5357 The latter two are mutually exclusive.
5358 The (second) argument is interpreted as a boolean (string, see
5359 .Sx "INTERNAL VARIABLES" )
5360 and states whether the given attribute shall be turned on or off.
5362 .Bd -literal -offset indent
5363 define temporary_settings {
5364   set possibly_global_option1
5365   localopts on
5366   set local_option1
5367   set local_option2
5368   localopts scope off
5369   set possibly_global_option2
5375 .It Ic Lreply
5376 Reply to messages that come in via known
5377 .Pf ( Ic mlist )
5378 or subscribed
5379 .Pf ( Ic mlsubscribe )
5380 mailing lists, or pretend to do so (see
5381 .Sx "Mailing lists" ) :
5382 on top of the usual
5383 .Ic reply
5384 functionality this will actively resort and even remove message
5385 recipients in order to generate a message that is supposed to be sent to
5386 a mailing list.
5387 For example it will also implicitly generate a
5388 .Ql Mail-Followup-To:
5389 header if that seems useful, regardless of the setting of the variable
5390 .Va followup-to .
5391 For more documentation please refer to
5392 .Sx "On sending mail, and non-interactive mode" .
5394 This may generate the errors
5395 .Va ^ERR Ns -DESTADDRREQ
5396 if no receiver has been specified,
5397 .Va ^ERR Ns -PERM
5398 if some addressees where rejected by
5399 .Va expandaddr ,
5400 .Va ^ERR Ns -NODATA
5401 if no applicable messages have been given,
5402 .Va ^ERR Ns -IO
5403 if an I/O error occurs,
5404 .Va ^ERR Ns -NOTSUP
5405 if a necessary character set conversion fails, and
5406 .Va ^ERR Ns -INVAL
5407 for other errors.
5408 Any error stops processing of further messages.
5411 .It Ic Mail
5412 Similar to
5413 .Ic mail ,
5414 but saves the message in a file named after the local part of the first
5415 recipient's address (instead of in
5416 .Va record Ns ).
5419 .It Ic mail
5420 (m) Takes a (list of) recipient address(es) as (an) argument(s),
5421 or asks on standard input if none were given;
5422 then collects the remaining mail content and sends it out.
5423 For more documentation please refer to
5424 .Sx "On sending mail, and non-interactive mode" .
5426 This may generate the errors
5427 .Va ^ERR Ns -DESTADDRREQ
5428 if no receiver has been specified,
5429 .Va ^ERR Ns -PERM
5430 if some addressees where rejected by
5431 .Va expandaddr ,
5432 .Va ^ERR Ns -NODATA
5433 if no applicable messages have been given,
5434 .Va ^ERR Ns -NOTSUP
5435 if multiple messages have been specified,
5436 .Va ^ERR Ns -IO
5437 if an I/O error occurs,
5438 .Va ^ERR Ns -NOTSUP
5439 if a necessary character set conversion fails, and
5440 .Va ^ERR Ns -INVAL
5441 for other errors.
5444 .It Ic mbox
5445 (mb) The given message list is to be sent to the
5446 .Mx -sx
5447 .Sx "secondary mailbox"
5448 .Ev MBOX
5449 when \*(UA is quit; this is the default action unless the variable
5450 .Va hold
5451 is set.
5452 \*(ID This command can only be used in a
5453 .Mx -sx
5454 .Sx "primary system mailbox" .
5458 .It Ic mimetype , unmimetype
5459 Without arguments the content of the MIME type cache will displayed;
5460 a more verbose listing will be produced if either of
5461 .Va debug
5463 .Va verbose
5464 are set.
5465 When given arguments they will be joined, interpreted as shown in
5466 .Sx "The mime.types files"
5467 (also see
5468 .Sx "HTML mail and MIME attachments" ) ,
5469 and the resulting entry will be added (prepended) to the cache.
5470 In any event MIME type sources are loaded first as necessary \(en
5471 .Va mimetypes-load-control
5472 can be used to fine-tune which sources are actually loaded.
5474 The latter command deletes all specifications of the given MIME type, thus
5475 .Ql ? unmimetype text/plain
5476 will remove all registered specifications for the MIME type
5477 .Ql text/plain .
5478 The special name
5479 .Ql *
5480 will discard all existing MIME types, just as will
5481 .Ql reset ,
5482 but which also reenables cache initialization via
5483 .Va mimetypes-load-control .
5487 .It Ic mlist , unmlist
5488 The latter command removes all given mailing-lists, the special name
5489 .Ql *
5490 can be used to remove all registered lists.
5491 The former will list all currently defined mailing lists (and their
5492 attributes, if any) when used without arguments; a more verbose listing
5493 will be produced if either of
5494 .Va debug
5496 .Va verbose
5497 are set.
5498 Otherwise all given arguments will be added and henceforth be recognized
5499 as mailing lists.
5500 If the \*(OPal regular expression support is available then mailing
5501 lists may also be specified as (extended) regular expressions (see
5502 .Xr re_format 7
5503 for more on those).
5506 .It Ic mimeview
5507 \*(ID Only available in interactive mode, this command allows to display
5508 MIME parts which require external MIME handler programs to run which do
5509 not integrate in \*(UAs normal
5510 .Ic type
5511 output (see
5512 .Sx "HTML mail and MIME attachments" ) .
5513 (\*(ID No syntax to directly address parts, this restriction may vanish.)
5514 The user will be asked for each non-text part of the given message in
5515 turn whether the registered handler shall be used to display the part.
5519 .It Ic mlsubscribe , unmlsubscribe
5520 The latter command removes the subscription attribute from all given
5521 mailing-lists, the special name
5522 .Ql *
5523 can be used to do so for any registered list.
5524 The former will list all currently defined mailing lists which have
5525 a subscription attribute when used without arguments; a more verbose
5526 listing will be produced if either of
5527 .Va debug
5529 .Va verbose
5530 are set.
5531 Otherwise this attribute will be set for all given mailing lists,
5532 newly creating them as necessary (as via
5533 .Ic mlist ) .
5534 Also see
5535 .Va followup-to .
5538 .It Ic Move
5539 Similar to
5540 .Ic move ,
5541 but moves the messages to a file named after the local part of the
5542 sender address of the first message (instead of in
5543 .Va record Ns ).
5546 .It Ic move
5547 Acts like
5548 .Ic copy
5549 but marks the messages for deletion if they were transferred
5550 successfully.
5553 .It Ic More
5554 Like
5555 .Ic more ,
5556 but also displays header fields which would not pass the
5557 .Ic headerpick
5558 selection, and all MIME parts.
5559 Identical to
5560 .Ic Page .
5563 .It Ic more
5564 Invokes the
5565 .Ev PAGER
5566 on the given messages, even in non-interactive mode and as long as the
5567 standard output is a terminal.
5568 Identical to
5569 .Ic page .
5572 .It Ic netrc
5573 \*(OP When used without arguments or if
5574 .Ar show
5575 has been given the content of the
5576 .Pa .netrc
5577 cache is shown, loading it first as necessary.
5578 If the argument is
5579 .Ar load
5580 then the cache will only be initialized and
5581 .Ar clear
5582 will remove its contents.
5583 Note that \*(UA will try to load the file only once, use
5584 .Ql Ic \&\&netrc Ns \:\0\:clear
5585 to unlock further attempts.
5587 .Va netrc-lookup ,
5588 .Va netrc-pipe
5589 and the section
5590 .Sx "On URL syntax and credential lookup" ;
5591 the section
5592 .Sx "The .netrc file"
5593 documents the file format in detail.
5596 .It Ic newmail
5597 Checks for new mail in the current folder without committing any changes
5598 before.
5599 If new mail is present, a message is shown.
5600 If the
5601 .Va header
5602 variable is set,
5603 the headers of each new message are also shown.
5604 This command is not available for all mailbox types.
5607 .It Ic next
5608 (n) (like
5609 .Ql +
5611 .Dq ENTER )
5612 Goes to the next message in sequence and types it.
5613 With an argument list, types the next matching message.
5616 .It Ic New
5617 Same as
5618 .Ic Unread .
5621 .It Ic new
5622 Same as
5623 .Ic unread .
5626 .It Ic noop
5627 If the current folder is accessed via a network connection, a
5628 .Dq NOOP
5629 command is sent, otherwise no operation is performed.
5632 .It Ic Page
5633 Like
5634 .Ic page ,
5635 but also displays header fields which would not pass the
5636 .Ic headerpick
5637 selection, and all MIME parts.
5638 Identical to
5639 .Ic More .
5642 .It Ic page
5643 Invokes the
5644 .Ev PAGER
5645 on the given messages, even in non-interactive mode and as long as the
5646 standard output is a terminal.
5647 Identical to
5648 .Ic more .
5651 .It Ic Pipe
5652 Like
5653 .Ic pipe
5654 but also pipes header fields which would not pass the
5655 .Ic headerpick
5656 selection, and all parts of MIME
5657 .Ql multipart/alternative
5658 messages.
5661 .It Ic pipe
5662 (pi) Takes a message list and a shell command
5663 and pipes the messages through the command.
5664 Without an argument the current message is piped through the command
5665 given by the
5666 .Va cmd
5667 variable.
5668 If the
5669 .Va page
5670 variable is set,
5671 every message is followed by a formfeed character.
5674 .It Ic preserve
5675 (pre) A synonym for
5676 .Ic hold .
5679 .It Ic Print
5680 (P) Alias for
5681 .Ic Type .
5684 .It Ic print
5685 (p) Research
5687 equivalent of
5688 .Ic type .
5691 .It Ic quit
5692 (q) Terminates the session, saving all undeleted, unsaved messages in
5693 the current
5694 .Mx -sx
5695 .Sx "secondary mailbox"
5696 .Ev MBOX ,
5697 preserving all messages marked with
5698 .Ic hold
5700 .Ic preserve
5701 or never referenced in the system
5702 .Va inbox ,
5703 and removing all other messages from the
5704 .Mx -sx
5705 .Sx "primary system mailbox" .
5706 If new mail has arrived during the session,
5707 the message
5708 .Dq You have new mail
5709 will be shown.
5710 If given while editing a mailbox file with the command line option
5711 .Fl f ,
5712 then the edit file is rewritten.
5713 A return to the shell is effected,
5714 unless the rewrite of edit file fails,
5715 in which case the user can escape with the exit command.
5716 The optional status number argument will be passed through to
5717 .Xr exit 3 .
5718 \*(ID For now it can happen that the given status will be overwritten,
5719 later this will only occur if a later error needs to be reported onto an
5720 otherwise success indicating status.
5723 .It Ic read
5724 \*(NQ Read a line from standard input, or the channel set active via
5725 .Ic readctl ,
5726 and assign the data, which will be splitted as indicated by
5727 .Va ifs ,
5728 to the given variables.
5729 The variable names are checked by the same rules as documented for
5730 .Cm vput ,
5731 and the same error codes will be seen in
5732 .Va \&! ;
5733 the exit status
5734 .Va \&?
5735 indicates the number of bytes read, it will be
5736 .Ql -1
5737 with the error number
5738 .Va \&!
5739 set to
5740 .Va ^ERR Ns -BADF
5741 in case of I/O errors, or
5742 .Va ^ERR Ns -NONE
5743 upon End-Of-File.
5744 If there are more fields than variables, assigns successive fields to the
5745 last given variable.
5746 If there are less fields than variables, assigns the empty string to the
5747 remains.
5748 .Bd -literal -offset indent
5749 ? read a b c
5750    H  e  l  l  o
5751 ? echo "<$a> <$b> <$c>"
5752 <H> <e> <l  l  o>
5753 ? wysh set ifs=:; read a b c;unset ifs
5754 hey2.0,:"'you    ",:world!:mars.:
5755 ? echo $?/$^ERRNAME / <$a><$b><$c>
5756 0/NONE / <hey2.0,><"'you    ",><world!:mars.:><><>
5760 .It Ic readctl
5761 \*(NQ Manages input channels for
5762 .Ic read ,
5763 to be used to avoid complicated or impracticable code, like calling
5764 .Ic \&\&read
5765 from within a macro in non-interactive mode.
5766 Without arguments, or when the first argument is
5767 .Cm show ,
5768 a listing of all known channels is printed.
5769 Channels can otherwise be
5770 .Cm create Ns
5771 d, and existing channels can be
5772 .Cm set
5773 active and
5774 .Cm remove Ns
5775 d by giving the string used for creation.
5777 The channel name is expected to be a file descriptor number, or,
5778 if parsing the numeric fails, an input file name that undergoes
5779 .Sx "Filename transformations" .
5780 E.g. (this example requires a modern shell):
5781 .Bd -literal -offset indent
5782 $ LC_ALL=C printf 'echon "hey, "\enread a\enyou\enecho $a' |\e
5783   LC_ALL=C \*(uA -R#
5784 hey, you
5785 $ LC_ALL=C printf 'echon "hey, "\enread a\enecho $a' |\e
5786   LC_ALL=C 6<<< 'you' \*(uA -R#X'readctl create 6'
5787 hey, you
5790 .It Ic redirect
5791 \*(OB Same as
5792 .Ic resend .
5794 .It Ic Redirect
5795 \*(OB Same as
5796 .Ic Resend .
5799 .It Ic remove
5800 Removes the named files or directories.
5801 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
5802 type specific removal will be performed, deleting the complete mailbox.
5803 The user is asked for confirmation in interactive mode.
5806 .It Ic rename
5807 Takes the name of an existing folder
5808 and the name for the new folder
5809 and renames the first to the second one.
5810 Both folders must be of the same type.
5813 .It Ic Reply
5814 (R) Replies to only the sender of each message of the given message
5815 list, by using the first message as the template to quote, for the
5816 .Ql Subject:
5817 etc.
5818 .Va flipr
5819 will exchange this command with
5820 .Ic reply .
5821 Unless the internal variable
5822 .Va fullnames
5823 is set the recipient address will be stripped from comments, names etc.
5824 .Ql Reply-To:
5825 headers will be inspected if
5826 .Va reply-to-honour
5827 is set.
5829 This may generate the errors
5830 .Va ^ERR Ns -DESTADDRREQ
5831 if no receiver has been specified,
5832 .Va ^ERR Ns -PERM
5833 if some addressees where rejected by
5834 .Va expandaddr ,
5835 .Va ^ERR Ns -NODATA
5836 if no applicable messages have been given,
5837 .Va ^ERR Ns -IO
5838 if an I/O error occurs,
5839 .Va ^ERR Ns -NOTSUP
5840 if a necessary character set conversion fails, and
5841 .Va ^ERR Ns -INVAL
5842 for other errors.
5845 .It Ic reply
5846 (r) Take a message and group-responds to it by addressing the sender
5847 and all recipients, subject to
5848 .Ic alternates
5849 processing.
5850 .Va followup-to ,
5851 .Va followup-to-honour ,
5852 .Va reply-to-honour
5853 as well as
5854 .Va recipients-in-cc
5855 influence response behaviour.
5856 Unless the internal variable
5857 .Va fullnames
5858 is set recipient addresses will be stripped from comments, names etc.
5860 .Va flipr
5861 is set the commands
5862 .Ic Reply
5864 .Ic reply
5865 are exchanged.
5866 The command
5867 .Ic Lreply
5868 offers special support for replying to mailing lists.
5869 For more documentation please refer to
5870 .Sx "On sending mail, and non-interactive mode" .
5872 This may generate the errors
5873 .Va ^ERR Ns -DESTADDRREQ
5874 if no receiver has been specified,
5875 .Va ^ERR Ns -PERM
5876 if some addressees where rejected by
5877 .Va expandaddr ,
5878 .Va ^ERR Ns -NODATA
5879 if no applicable messages have been given,
5880 .Va ^ERR Ns -IO
5881 if an I/O error occurs,
5882 .Va ^ERR Ns -NOTSUP
5883 if a necessary character set conversion fails, and
5884 .Va ^ERR Ns -INVAL
5885 for other errors.
5886 Any error stops processing of further messages.
5889 .It Ic replyall
5890 Similar to
5891 .Ic reply ,
5892 but initiates a group-reply regardless of the value of
5893 .Va flipr .
5896 .It Ic replysender
5897 Similar to
5898 .Ic Reply ,
5899 but responds to the sender only regardless of the value of
5900 .Va flipr .
5903 .It Ic Resend
5904 Like
5905 .Ic resend ,
5906 but does not add any header lines.
5907 This is not a way to hide the sender's identity,
5908 but useful for sending a message again to the same recipients.
5911 .It Ic resend
5912 Takes a list of messages and a user name
5913 and sends each message to the named user.
5914 .Ql Resent-From:
5915 and related header fields are prepended to the new copy of the message.
5916 Saving in
5917 .Va record
5918 is only performed if
5919 .Va record-resent
5920 is set.
5922 This may generate the errors
5923 .Va ^ERR Ns -DESTADDRREQ
5924 if no receiver has been specified,
5925 .Va ^ERR Ns -PERM
5926 if some addressees where rejected by
5927 .Va expandaddr ,
5928 .Va ^ERR Ns -NODATA
5929 if no applicable messages have been given,
5930 .Va ^ERR Ns -IO
5931 if an I/O error occurs,
5932 .Va ^ERR Ns -NOTSUP
5933 if a necessary character set conversion fails, and
5934 .Va ^ERR Ns -INVAL
5935 for other errors.
5936 Any error stops processing of further messages.
5939 .It Ic Respond
5940 Same as
5941 .Ic Reply .
5944 .It Ic respond
5945 Same as
5946 .Ic reply .
5949 .It Ic respondall
5950 Same as
5951 .Ic replyall .
5954 .It Ic respondsender
5955 Same as
5956 .Ic replysender .
5959 .It Ic retain
5960 (ret) Superseded by the multiplexer
5961 .Ic headerpick .
5964 .It Ic return
5965 Only available inside the scope of a
5966 .Ic define Ns
5967 d macro or an
5968 .Ic account ,
5969 this will stop evaluation of any further macro content, and return
5970 execution control to the caller.
5971 The two optional parameters must be specified as positive decimal
5972 numbers and default to the value 0:
5973 the first argument specifies the signed 32-bit return value (stored in
5974 .Va \&?
5975 \*(ID and later extended to signed 64-bit),
5976 the second the signed 32-bit error number (stored in
5977 .Va \&! ) .
5978 As documented for
5979 .Va \&?
5980 a non-0 exit status may cause the program to exit.
5983 .It Ic Save
5984 (S) Similar to
5985 .Ic save,
5986 but saves the messages in a file named after the local part of the
5987 sender of the first message instead of (in
5988 .Va record
5989 and) taking a filename argument; the variable
5990 .Va outfolder
5991 is inspected to decide on the actual storage location.
5994 .It Ic save
5995 (s) Takes a message list and a filename and appends each message in turn
5996 to the end of the file.
5997 If no filename is given, the
5998 .Mx -sx
5999 .Sx "secondary mailbox"
6000 .Ev MBOX
6001 is used.
6002 The filename in quotes, followed by the generated character count
6003 is echoed on the user's terminal.
6004 If editing a
6005 .Mx -sx
6006 .Sx "primary system mailbox"
6007 the messages are marked for deletion.
6008 .Sx "Filename transformations"
6009 will be applied.
6011 .It Ic savediscard
6012 \*(OB Superseded by the multiplexer
6013 .Ic headerpick .
6015 .It Ic saveignore
6016 \*(OB Superseded by the multiplexer
6017 .Ic headerpick .
6019 .It Ic saveretain
6020 \*(OB Superseded by the multiplexer
6021 .Ic headerpick .
6024 .It Ic search
6025 Takes a message specification (list) and displays a header summary of
6026 all matching messages, as via
6027 .Ic headers .
6028 This command is an alias of
6029 .Ic from .
6030 Also see
6031 .Sx "Specifying messages" .
6034 .It Ic seen
6035 Takes a message list and marks all messages as having been read.
6040 .It Ic set , unset
6041 (se, \*(NQ uns) The latter command will delete all given variables,
6042 the former, when used without arguments, will show all variables which
6043 are currently known to \*(UA.
6044 A more verbose listing will be produced if
6045 either of
6046 .Va debug
6048 .Va verbose
6049 are set.
6050 Remarks: the list mode will not automatically link-in known
6051 .Sx ENVIRONMENT
6052 variables, but only explicit addressing will, e.g., via
6053 .Ic varshow ,
6054 using a variable in an
6055 .Ic if
6056 condition or a string passed to
6057 .Ic echo ,
6058 explicit
6059 .Ic set Ns
6060 ting, as well as some program-internal use cases.
6063 Otherwise the given variables (and arguments) are set or adjusted.
6064 Arguments are of the form
6065 .Ql name=value
6066 (no space before or after
6067 .Ql = ) ,
6068 or plain
6069 .Ql name
6070 if there is no value, i.e., a boolean variable.
6071 \*(ID In conjunction with the
6072 .Cm wysh
6073 command prefix
6074 .Sx "Shell-style argument quoting"
6075 can be used to quote arguments as necessary.
6076 \*(ID Otherwise quotation marks may be placed around any part of the
6077 assignment statement to quote blanks or tabs.
6080 .Dl ? wysh set indentprefix=' -> '
6083 If an argument begins with
6084 .Ql no ,
6085 as in
6086 .Ql set nosave ,
6087 the effect is the same as invoking the
6088 .Ic unset
6089 command with the remaining part of the variable
6090 .Pf ( Ql unset save ) .
6094 .Ql name
6095 that is known to map to an environment variable will automatically cause
6096 updates in the program environment (unsetting a variable in the
6097 environment requires corresponding system support) \(em use the command
6098 .Ic environ
6099 for further environmental control.
6100 Also see
6101 .Ic varedit ,
6102 .Ic varshow
6103 and the sections
6104 .Sx "INTERNAL VARIABLES"
6106 .Sx ENVIRONMENT .
6110 .It Ic shcodec
6111 Apply shell quoting rules to the given raw-data arguments.
6112 Supports
6113 .Cm vput
6114 (see
6115 .Sx "Command modifiers" ) .
6116 The first argument specifies the operation:
6117 .Ar [+]e[ncode]
6119 .Ar d[ecode]
6120 cause shell quoting to be applied to the remains of the line, and
6121 expanded away thereof, respectively.
6122 If the former is prefixed with a plus-sign, the quoted result will not
6123 be roundtrip enabled, and thus can be decoded only in the very same
6124 environment that was used to perform the encode; also see
6125 .Cd mle-quote-rndtrip .
6126 If the coding operation fails the error number
6127 .Va \&!
6128 is set to
6129 .Va ^ERR Ns -CANCELED ,
6130 and the unmodified input is used as the result; the error number may
6131 change again due to output or result storage errors.
6134 .It Ic shell
6135 \*(NQ (sh) Invokes an interactive version of the shell,
6136 and returns its exit status.
6140 .It Ic shortcut , unshortcut
6141 Without arguments the list of all currently defined shortcuts is
6142 shown, with one argument the expansion of the given shortcut.
6143 Otherwise all given arguments are treated as pairs of shortcuts and
6144 their expansions, creating new or changing already existing shortcuts,
6145 as necessary.
6146 The latter command will remove all given shortcuts, the special name
6147 .Ql *
6148 will remove all registered shortcuts.
6151 .It Ic shift
6152 \*(NQ Shift the positional parameter stack (starting at
6153 .Va 1 )
6154 by the given number (which must be a positive decimal),
6155 or 1 if no argument has been given.
6156 It is an error if the value exceeds the number of positional parameters.
6157 If the given number is 0, no action is performed, successfully.
6158 The stack as such can be managed via
6159 .Ic vpospar .
6160 Note this command will fail in
6161 .Ic account
6162 and hook macros unless the positional parameter stack has been
6163 explicitly created in the current context via
6164 .Ic vpospar .
6167 .It Ic show
6168 Like
6169 .Ic type ,
6170 but performs neither MIME decoding nor decryption, so that the raw
6171 message text is shown.
6174 .It Ic size
6175 (si) Shows the size in characters of each message of the given
6176 message-list.
6179 .It Ic sleep
6180 \*(NQ Sleep for the specified number of seconds (and optionally
6181 milliseconds), by default interruptably.
6182 If a third argument is given the sleep will be uninterruptible,
6183 otherwise the error number
6184 .Va \&!
6185 will be set to
6186 .Va ^ERR Ns -INTR
6187 if the sleep has been interrupted.
6188 The command will fail and the error number will be
6189 .Va ^ERR Ns -OVERFLOW
6190 if the given duration(s) overflow the time datatype, and
6191 .Va ^ERR Ns -INVAL
6192 if the given durations are no valid integers.
6197 .It Ic sort , unsort
6198 The latter command disables sorted or threaded mode, returns to normal
6199 message order and, if the
6200 .Va header
6201 variable is set,
6202 displays a header summary.
6203 The former command shows the current sorting criterion when used without
6204 an argument, but creates a sorted representation of the current folder
6205 otherwise, and changes the
6206 .Ic next
6207 command and the addressing modes such that they refer to messages in
6208 the sorted order.
6209 Message numbers are the same as in regular mode.
6210 If the
6211 .Va header
6212 variable is set,
6213 a header summary in the new order is also displayed.
6214 Automatic folder sorting can be enabled by setting the
6215 .Va autosort
6216 variable, as in, e.g.,
6217 .Ql set autosort=thread .
6218 Possible sorting criterions are:
6221 .Bl -tag -compact -width "subject"
6222 .It Ar date
6223 Sort the messages by their
6224 .Ql Date:
6225 field, that is by the time they were sent.
6226 .It Ar from
6227 Sort messages by the value of their
6228 .Ql From:
6229 field, that is by the address of the sender.
6230 If the
6231 .Va showname
6232 variable is set, the sender's real name (if any) is used.
6233 .It Ar size
6234 Sort the messages by their size.
6235 .It spam
6236 \*(OP Sort the message by their spam score, as has been classified by
6237 .Ic spamrate .
6238 .It Ar status
6239 Sort the messages by their message status.
6240 .It Ar subject
6241 Sort the messages by their subject.
6242 .It Ar thread
6243 Create a threaded display.
6244 .It Ar to
6245 Sort messages by the value of their
6246 .Ql To:
6247 field, that is by the address of the recipient.
6248 If the
6249 .Va showname
6250 variable is set, the recipient's real name (if any) is used.
6255 .It Ic source
6256 \*(NQ (so) The source command reads commands from the given file.
6257 .Sx "Filename transformations"
6258 will be applied.
6259 If the given expanded argument ends with a vertical bar
6260 .Ql |
6261 then the argument will instead be interpreted as a shell command and
6262 \*(UA will read the output generated by it.
6263 Interpretation of commands read is stopped when an error is encountered.
6264 \*(ID Note that
6265 .Ic \&\&source
6266 cannot be used from within macros that execute as
6267 .Va folder-hook Ns s
6269 .Ic account Ns s ,
6270 i.e., it can only be called from macros that were
6271 .Ic call Ns ed .
6274 .It Ic source_if
6275 \*(NQ The difference to
6276 .Ic source
6277 (beside not supporting pipe syntax aka shell command input) is that
6278 this command will not generate an error nor warn if the given file
6279 argument cannot be opened successfully.
6282 .It Ic spamclear
6283 \*(OP Takes a list of messages and clears their
6284 .Ql is-spam
6285 flag.
6288 .It Ic spamforget
6289 \*(OP Takes a list of messages and causes the
6290 .Va spam-interface
6291 to forget it has ever used them to train its Bayesian filter.
6292 Unless otherwise noted the
6293 .Ql is-spam
6294 flag of the message is inspected to chose whether a message shall be
6295 forgotten to be
6296 .Dq ham
6298 .Dq spam .
6301 .It Ic spamham
6302 \*(OP Takes a list of messages and informs the Bayesian filter of the
6303 .Va spam-interface
6304 that they are
6305 .Dq ham .
6306 This also clears the
6307 .Ql is-spam
6308 flag of the messages in question.
6311 .It Ic spamrate
6312 \*(OP Takes a list of messages and rates them using the configured
6313 .Va spam-interface ,
6314 without modifying the messages, but setting their
6315 .Ql is-spam
6316 flag as appropriate; because the spam rating headers are lost the rate
6317 will be forgotten once the mailbox is left.
6318 Refer to the manual section
6319 .Sx "Handling spam"
6320 for the complete picture of spam handling in \*(UA.
6323 .It Ic spamset
6324 \*(OP Takes a list of messages and sets their
6325 .Ql is-spam
6326 flag.
6329 .It Ic spamspam
6330 \*(OP Takes a list of messages and informs the Bayesian filter of the
6331 .Va spam-interface
6332 that they are
6333 .Dq spam .
6334 This also sets the
6335 .Ql is-spam
6336 flag of the messages in question.
6338 .It Ic thread
6339 \*(OB The same as
6340 .Ql sort thread
6341 (consider using a
6342 .Ql commandalias
6343 as necessary).
6346 .It Ic Top
6347 Like
6348 .Ic top
6349 but always uses the
6350 .Ic headerpick
6351 .Ql type
6352 slot for white- and blacklisting header fields.
6355 .It Ic top
6356 (to) Takes a message list and types out the first
6357 .Va toplines
6358 lines of each message on the users' terminal.
6359 Unless a special selection has been established for the
6360 .Ql top
6361 slot of the
6362 .Ic headerpick
6363 command, the only header fields that are displayed are
6364 .Ql From: ,
6365 .Ql To: ,
6366 .Ql CC: ,
6368 .Ql Subject: .
6369 .Ic Top
6370 will always use the
6371 .Ql type
6372 .Ic headerpick
6373 selection instead.
6374 It is possible to apply compression to what is displayed by setting
6375 .Va topsqueeze .
6376 Messages are decrypted and converted to the terminal character set
6377 if necessary.
6380 .It Ic touch
6381 (tou) Takes a message list and marks the messages for saving in the
6382 .Mx -sx
6383 .Sx "secondary mailbox"
6384 .Ev MBOX .
6385 \*(UA deviates from the POSIX standard with this command,
6386 as a following
6387 .Ic next
6388 command will display the following message instead of the current one.
6391 .It Ic Type
6392 (T) Like
6393 .Ic type
6394 but also displays header fields which would not pass the
6395 .Ic headerpick
6396 selection, and all visualizable parts of MIME
6397 .Ql multipart/alternative
6398 messages.
6401 .It Ic type
6402 (t) Takes a message list and types out each message on the users terminal.
6403 The display of message headers is selectable via
6404 .Ic headerpick .
6405 For MIME multipart messages, all parts with a content type of
6406 .Ql text ,
6407 all parts which have a registered MIME type handler (see
6408 .Sx "HTML mail and MIME attachments" )
6409 which produces plain text output, and all
6410 .Ql message
6411 parts are shown, others are hidden except for their headers.
6412 Messages are decrypted and converted to the terminal character set
6413 if necessary.
6414 The command
6415 .Ic mimeview
6416 can be used to display parts which are not displayable as plain text.
6418 .It Ic unaccount
6420 .Ic account .
6422 .It Ic unalias
6423 (una) See
6424 .Ic alias .
6426 .It Ic unanswered
6428 .Ic answered .
6430 .It Ic unbind
6432 .Ic bind .
6434 .It Ic uncollapse
6436 .Ic collapse .
6438 .It Ic uncolour
6440 .Ic colour .
6442 .It Ic undefine
6444 .Ic define .
6446 .It Ic undelete
6448 .Ic delete .
6450 .It Ic undraft
6452 .Ic draft .
6454 .It Ic unflag
6456 .Ic flag .
6458 .It Ic unfwdignore
6459 \*(OB Superseded by the multiplexer
6460 .Ic headerpick .
6462 .It Ic unfwdretain
6463 \*(OB Superseded by the multiplexer
6464 .Ic headerpick .
6467 .It Ic unignore
6468 Superseded by the multiplexer
6469 .Ic headerpick .
6471 .It Ic unmimetype
6473 .Ic mimetype .
6475 .It Ic unmlist
6477 .Ic mlist .
6479 .It Ic unmlsubscribe
6481 .Ic mlsubscribe .
6484 .It Ic Unread
6485 Same as
6486 .Ic unread .
6489 .It Ic unread
6490 Takes a message list and marks each message as not having been read.
6493 .It Ic unretain
6494 Superseded by the multiplexer
6495 .Ic headerpick .
6497 .It Ic unsaveignore
6498 \*(OB Superseded by the multiplexer
6499 .Ic headerpick .
6501 .It Ic unsaveretain
6502 \*(OB Superseded by the multiplexer
6503 .Ic headerpick .
6505 .It Ic unset
6506 \*(NQ (uns) See
6507 .Ic set .
6509 .It Ic unshortcut
6511 .Ic shortcut .
6513 .It Ic unsort
6515 .Ic short .
6517 .It Ic unthread
6518 \*(OB
6519 Same as
6520 .Ic unsort .
6523 .It Ic urlcodec
6524 Perform URL percent codec operations on the raw-data argument, rather
6525 according to RFC 3986.
6526 Supports
6527 .Cm vput
6528 (see
6529 .Sx "Command modifiers" ) ,
6530 and manages the error number
6531 .Va \&! .
6532 This is a character set agnostic and thus locale dependent operation,
6533 and it may decode bytes which are invalid in the current
6534 .Va ttycharset .
6535 \*(ID This command does not know about URLs beside that.
6537 The first argument specifies the operation:
6538 .Ar e[ncode]
6540 .Ar d[ecode]
6541 perform plain URL percent en- and decoding, respectively.
6542 .Ar p[ath]enc[ode]
6544 .Ar p[ath]dec[ode]
6545 perform a slightly modified operation which should be better for
6546 pathnames: it does not allow a tilde
6547 .Ql ~ ,
6548 and will neither accept hyphen-minus
6549 .Ql -
6550 nor dot
6551 .Ql .
6552 as an initial character.
6553 The remains of the line form the URL data which is to be converted.
6554 If the coding operation fails the error number
6555 .Va \&!
6556 is set to
6557 .Va ^ERR Ns -CANCELED ,
6558 and the unmodified input is used as the result; the error number may
6559 change again due to output or result storage errors.
6562 .It Ic varedit
6563 \*(NQ Edit the values of or create the given variable(s) in the
6564 .Ev EDITOR .
6565 Boolean variables cannot be edited, and variables can also not be
6566 .Ic unset
6567 with this command.
6570 .It Ic varshow
6571 \*(NQ This command produces the same output as the listing mode of
6572 .Ic set ,
6573 including
6574 .Va verbose Ns
6575 ity adjustments, but only for the given variables.
6578 .It Ic verify
6579 \*(OP Takes a message list and verifies each message.
6580 If a message is not a S/MIME signed message,
6581 verification will fail for it.
6582 The verification process checks if the message was signed using a valid
6583 certificate,
6584 if the message sender's email address matches one of those contained
6585 within the certificate,
6586 and if the message content has been altered.
6589 .It Ic version
6590 Shows the
6591 .Va version
6593 .Va features
6594 of \*(UA.
6598 .It Ic vexpr
6599 \*(NQ Evaluate arguments according to a given operator.
6600 This is a multiplexer command which can be used to perform signed 64-bit
6601 numeric calculations as well as byte string and string operations.
6602 It uses polish notation, i.e., the operator is the first argument and
6603 defines the number and type, and the meaning of the remaining arguments.
6604 An empty argument is replaced with a 0 if a number is expected.
6605 Supports
6606 .Cm vput
6607 (see
6608 .Sx "Command modifiers" ) .
6611 The result that is shown in case of errors is always
6612 .Ql -1
6613 for usage errors and numeric operations, and the empty string for byte
6614 string and string operations;
6615 if the latter two fail to provide result data for
6616 .Dq soft
6617 errors, e.g., when a search operation failed, they also set the
6618 .Va \&!
6619 error number to
6620 .Va ^ERR Ns -NODATA .
6621 Except when otherwise noted numeric arguments are parsed as signed 64-bit
6622 numbers, and errors will be reported in the error number
6623 .Va \&!
6624 as the numeric error
6625 .Va ^ERR Ns -RANGE .
6628 Numeric operations work on one or two signed 64-bit integers.
6629 One integer is expected by assignment (equals sign
6630 .Ql = ) ,
6631 which does nothing but parsing the argument, thus detecting validity and
6632 possible overflow conditions, and unary not (tilde
6633 .Ql ~ ) ,
6634 which creates the bitwise complement.
6635 Two integers are used by addition (plus sign
6636 .Ql + ) ,
6637 subtraction (hyphen-minus
6638 .Ql - ) ,
6639 multiplication (asterisk
6640 .Ql * ) ,
6641 division (solidus
6642 .Ql / )
6643 and modulo (percent sign
6644 .Ql % ) ,
6645 as well as for the bitwise operators logical or (vertical bar
6646 .Ql | ,
6647 to be quoted) ,
6648 bitwise and (ampersand
6649 .Ql \&& ,
6650 to be quoted) ,
6651 bitwise xor (circumflex
6652 .Ql ^ ) ,
6653 the bitwise signed left- and right shifts
6654 .Pf ( Ql << ,
6655 .Ql >> ) ,
6656 as well as for the unsigned right shift
6657 .Ql >>> .
6660 All numeric operators can be suffixed with a commercial at
6661 .Ql @ ,
6662 e.g.,
6663 .Ql *@ :
6664 this will turn the operation into a saturated one, which means that
6665 overflow errors and division and modulo by zero are no longer reported
6666 via the exit status, but the result will linger at the minimum or
6667 maximum possible value, instead of overflowing (or trapping).
6668 This is true also for the argument parse step.
6669 For the bitwise shifts, the saturated maximum is 63.
6670 Any catched overflow will be reported via the error number
6671 .Va \&!
6673 .Va ^ERR Ns -OVERFLOW .
6676 Character set agnostic string functions have no notion of locale
6677 settings and character sets.
6678 There is
6679 .Ql file-expand ,
6680 which performs the usual
6681 .Sx "Filename transformations"
6682 on its argument, and
6683 .Ql random ,
6684 which generates a random string of the given length, or of
6685 .Dv \&\&PATH_MAX
6686 bytes (a constant from
6687 .Pa /usr/include )
6688 if the value 0 is given; the random string will be base64url encoded
6689 according to RFC 4648, and thus be usable as a (portable) filename.
6692 Byte string operations work on 8-bit bytes and have no notion of locale
6693 settings and character sets, effectively assuming ASCII data.
6694 Operations that take one argument are
6695 .Ql length ,
6696 which queries the length of the given argument, and
6697 .Ql hash ,
6698 which calculates the Chris Torek hash of the given argument.
6701 Byte string operations with two or more arguments are
6702 .Ql find ,
6703 which byte-searches in the first for the second argument, and shows the
6704 resulting 0-based offset shall it have been found,
6705 .Ql ifind ,
6706 which is identical to
6707 .Ql find ,
6708 but works case-insensitively according to the rules of the ASCII
6709 character set.
6710 .Ql substring
6711 will show a substring of its first argument:
6712 the second argument is the 0-based starting offset, the optional third
6713 argument can be used to specify the length of the desired substring,
6714 by default the entire string is used;
6715 this operation tries to work around faulty arguments (set
6716 .Va verbose
6717 for error logs), but reports them via the error number
6718 .Va \&!
6720 .Va ^ERR Ns -OVERFLOW .
6723 String operations work, sufficient support provided, according to the
6724 active user's locale encoding and character set (see
6725 .Sx "Character sets" ) .
6726 There is the one argument operation
6727 .Ql makeprint ,
6728 which (one-way) converts the argument to something safely printable on
6729 the terminal.
6732 \*(OP
6733 .Ql regex
6734 is a string operation that will try to match the first argument with the
6735 regular expression given as the second argument, as does
6736 .Ql iregex ,
6737 but which is case-insensitive.
6738 If the optional third argument has been given then instead of showing
6739 the match offset a replacement operation is performed:
6740 the third argument is treated as if specified via dollar-single-quote
6741 (see
6742 .Sx "Shell-style argument quoting" ) ,
6743 and any occurrence of a positional parameter, e.g.,
6744 .Va 1 ,
6745 is replaced by the corresponding match group of the regular expression.
6747 .Bd -literal -offset indent
6748 ? vexpr -@ +1 -9223372036854775808
6749 ? vput vexpr res ir bananarama (.*)NanA(.*) '\e${1}au\e$2'
6750 ? echo $0 $res
6755 .It Ic vpospar
6756 \*(NQ Manage the positional parameter stack (see
6757 .Va 1 , # , * , @
6758 as well as
6759 .Ic shift ) .
6760 If the first argument is
6761 .Ql clear ,
6762 then the positional parameter stack of the current context, or the
6763 global one, if there is none, is cleared.
6764 If it is
6765 .Ql set ,
6766 then the remaining arguments will be used to (re)create the stack,
6767 if the parameter stack size limit is excessed an
6768 .Va ^ERR Ns -OVERFLOW
6769 error will occur.
6772 If the first argument is
6773 .Ql quote ,
6774 a round-trip capable representation of the stack contents is created,
6775 with each quoted parameter separated from each other with the first
6776 character of
6777 .Va ifs ,
6778 and followed by the first character of
6779 .Va if-ws ,
6780 if that is not empty and not identical to the first.
6781 If that results in no separation at all a
6782 .Cm space
6783 character is used.
6784 This mode supports
6785 .Cm vput
6786 (see
6787 .Sx "Command modifiers" ) .
6788 I.e., the subcommands
6789 .Ql set
6791 .Ql quote
6792 can be used (in conjunction with
6793 .Ic eval )
6794 to (re)create an argument stack from and to a single variable losslessly.
6796 .Bd -literal -offset indent
6797 ? vpospar set hey, "'you    ", world!
6798 ? echo $#: <${1}><${2}><${3}>
6799 ? vput vpospar x quote
6800 ? vpospar clear
6801 ? echo $#: <${1}><${2}><${3}>
6802 ? eval vpospar set ${x}
6803 ? echo $#: <${1}><${2}><${3}>
6808 .It Ic visual
6809 (v) Takes a message list and invokes the display editor on each message.
6810 Modified contents are discarded unless the
6811 .Va writebackedited
6812 variable is set, and are not used unless the mailbox can be written to
6813 and the editor returns a successful exit status.
6816 .It Ic write
6817 (w) For conventional messages the body without all headers is written.
6818 The original message is never marked for deletion in the originating
6819 mail folder.
6820 The output is decrypted and converted to its native format as necessary.
6821 If the output file exists, the text is appended.
6822 If a message is in MIME multipart format its first part is written to
6823 the specified file as for conventional messages, handling of the remains
6824 depends on the execution mode.
6825 No special handling of compressed files is performed.
6827 In interactive mode the user is consecutively asked for the filenames of
6828 the processed parts.
6829 For convience saving of each part may be skipped by giving an empty
6830 value, the same result as writing it to
6831 .Pa /dev/null .
6832 Shell piping the part content by specifying a leading vertical bar
6833 .Ql |
6834 character for the filename is supported.
6835 Other user input undergoes the usual
6836 .Sx "Filename transformations" ,
6837 and contents of the destination file are overwritten if the file
6838 previously existed.
6840 \*(ID In non-interactive mode any part which does not specify a filename
6841 is ignored, and suspicious parts of filenames of the remaining parts are
6842 URL percent encoded (as via
6843 .Ic urlcodec )
6844 to prevent injection of malicious character sequences, resulting in
6845 a filename that will be written into the current directory.
6846 Existing files will not be overwritten, instead the part number or
6847 a dot are appended after a number sign
6848 .Ql #
6849 to the name until file creation succeeds (or fails due to other
6850 reasons).
6853 .It Ic xcall
6854 \*(NQ The sole difference to
6855 .Ic call
6856 is that the new macro is executed in place of the current one, which
6857 will not regain control: all resources of the current macro will be
6858 released first.
6859 This implies that any setting covered by
6860 .Ic localopts
6861 will be forgotten and covered variables will become cleaned up.
6862 If this command is not used from within a
6863 .Ic call Ns
6864 ed macro it will silently be (a more expensive variant of)
6865 .Ic call .
6868 .It Ic xit
6869 (x) A synonym for
6870 .Ic exit .
6873 .It Ic z
6874 \*(NQ \*(UA presents message headers in
6875 .Va screen Ns
6876 fuls as described under the
6877 .Ic headers
6878 command.
6879 Without arguments this command scrolls to the next window of messages,
6880 likewise if the argument is
6881 .Ql + .
6882 An argument of
6883 .Ql -
6884 scrolls to the last,
6885 .Ql ^
6886 scrolls to the first, and
6887 .Ql $
6888 to the last
6889 .Va \&\&screen
6890 of messages.
6891 A number argument prefixed by
6892 .Ql +
6894 .Ql \-
6895 indicates that the window is calculated in relation to the current
6896 position, and a number without a prefix specifies an absolute position.
6899 .It Ic Z
6900 \*(NQ Similar to
6901 .Ic z ,
6902 but scrolls to the next or previous window that contains at least one
6903 .Ql new
6905 .Ic flag Ns
6906 ged message.
6908 .\" }}}
6910 .\" }}}
6913 .\" .Sh COMMAND ESCAPES {{{
6914 .Sh "COMMAND ESCAPES"
6916 Here is a summary of the command escapes available in compose mode,
6917 which are used to perform special functions when composing messages.
6918 Command escapes are only recognized at the beginning of lines, and
6919 consist of a trigger (escape) and a command character.
6920 The actual escape character can be set via the internal variable
6921 .Va escape ,
6922 it defaults to the tilde
6923 .Ql ~ .
6924 Otherwise ignored whitespace characters following the escape character
6925 will prevent a possible addition of the command line to the \*(OPal
6926 history.
6929 Unless otherwise noted all compose mode command escapes ensure proper
6930 updates of the variables which represent the error number
6931 .Va \&!
6932 and the exit status
6933 .Va \&? .
6934 If the variable
6935 .Va errexit
6936 is set they will, unless stated otherwise, error out message compose
6937 mode if an operation fails.
6938 It is however possible to place the character hyphen-minus
6939 .Ql -
6940 after (possible whitespace following) the escape character, which has an
6941 effect equivalent to the command modifier
6942 .Cm ignerr .
6943 If the \*(OPal key bindings are available it is possible to create
6944 .Ic bind Ns
6945 ings specifically for the compose mode.
6948 .Bl -tag -width ".It Ic BaNg"
6950 .It Ic ~~ Ar string
6951 Insert the string of text in the message prefaced by a single
6952 .Ql ~ .
6953 (If the escape character has been changed,
6954 that character must be doubled instead.)
6957 .It Ic ~! Ar command
6958 Execute the indicated shell
6959 .Ar command
6960 which follows, replacing unescaped exclamation marks with the previously
6961 executed command if the internal variable
6962 .Va bang
6963 is set, then return to the message.
6966 .It Ic ~.
6967 Same effect as typing the end-of-file character.
6970 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
6971 Execute the given \*(UA command.
6972 Not all commands, however, are allowed.
6975 .It Ic ~?
6976 Write a summary of command escapes.
6979 .It Ic ~< Ar filename
6980 Identical to
6981 .Ic ~r .
6984 .It Ic ~<! Ar command
6985 .Ar command
6986 is executed using the shell.
6987 Its standard output is inserted into the message.
6990 .It Ic ~@ Op Ar filename...
6991 Append or edit the list of attachments.
6992 Does not manage the error number
6993 .Va \&!
6994 and the exit status
6995 .Va \&? ,
6996 (please use
6997 .Ic ~^
6998 instead if this is a concern).
6999 A list of
7000 .Ar filename
7001 arguments is expected as shell tokens (see
7002 .Sx "Shell-style argument quoting" ;
7003 token-separating commas are ignored, too), to be
7004 interpreted as documented for the command line option
7005 .Fl a ,
7006 with the message number exception as below.
7008 Without
7009 .Ar filename
7010 arguments the attachment list is edited, entry by entry;
7011 if a filename is left empty, that attachment is deleted from the list;
7012 once the end of the list is reached either new attachments may be
7013 entered or the session can be quit by committing an empty
7014 .Dq new
7015 attachment.
7017 For all mode, if a given filename solely consists of the number sign
7018 .Ql #
7019 followed by a valid message number of the currently active mailbox, then
7020 the given message is attached as a
7021 .Ql message/rfc822
7022 MIME message part.
7023 As the shell comment character the number sign must be quoted.
7026 .It Ic ~A
7027 Inserts the string contained in the
7028 .Va Sign
7029 variable (same as
7030 .Ql Ic ~i Ns \0Sign ) .
7031 \*(OB The escape sequences tabulator
7032 .Ql \et
7033 and newline
7034 .Ql \en
7035 are understood (use the
7036 .Cm wysh
7037 prefix when
7038 .Ic set Ns
7039 ting the variable(s) instead).
7042 .It Ic ~a
7043 Inserts the string contained in the
7044 .Va sign
7045 variable (same as
7046 .Ql Ic ~i Ns \0sign ) .
7047 \*(OB The escape sequences tabulator
7048 .Ql \et
7049 and newline
7050 .Ql \en
7051 are understood (use the
7052 .Cm wysh
7053 prefix when
7054 .Ic set Ns
7055 ting the variable(s) instead).
7058 .It Ic ~b Ar name ...
7059 Add the given names to the list of blind carbon copy recipients.
7062 .It Ic ~c Ar name ...
7063 Add the given names to the list of carbon copy recipients.
7066 .It Ic ~d
7067 Read the file specified by the
7068 .Ev DEAD
7069 variable into the message.
7072 .It Ic ~e
7073 Invoke the text editor on the message collected so far.
7074 After the editing session is finished,
7075 the user may continue appending text to the message.
7078 .It Ic ~F Ar messages
7079 Read the named messages into the message being sent, including all
7080 message headers and MIME parts.
7081 If no messages are specified, read in the current message, the
7082 .Dq dot .
7085 .It Ic ~f Ar messages
7086 Read the named messages into the message being sent.
7087 If no messages are specified, read in the current message, the
7088 .Dq dot .
7089 Strips down the list of header fields according to the
7090 .Ql type
7091 white- and blacklist selection of
7092 .Ic headerpick .
7093 For MIME multipart messages,
7094 only the first displayable part is included.
7097 .It Ic ~H
7098 Edit the message header fields
7099 .Ql From: ,
7100 .Ql Reply-To:
7102 .Ql Sender:
7103 by typing each one in turn and allowing the user to edit the field.
7104 The default values for these fields originate from the
7105 .Va from , reply-to
7107 .Va sender
7108 variables.
7111 .It Ic ~h
7112 Edit the message header fields
7113 .Ql To: ,
7114 .Ql Cc: ,
7115 .Ql Bcc:
7117 .Ql Subject:
7118 by typing each one in turn and allowing the user to edit the field.
7121 .It Ic ~I Ar variable
7122 Insert the value of the specified variable into the message.
7123 The message remains unaltered if the variable is unset or empty.
7124 \*(OB The escape sequences tabulator
7125 .Ql \et
7126 and newline
7127 .Ql \en
7128 are understood (use the
7129 .Cm wysh
7130 prefix when
7131 .Ic set Ns
7132 ting the variable(s) instead).
7135 .It Ic ~i Ar variable
7136 Identical to
7137 .Ic ~I ,
7138 but adds a newline character at the end of a successful insertion.
7141 .It Ic ~M Ar messages
7142 Read the named messages into the message being sent,
7143 indented by
7144 .Va indentprefix .
7145 If no messages are specified, read the current message, the
7146 .Dq dot .
7149 .It Ic ~m Ar messages
7150 Read the named messages into the message being sent,
7151 indented by
7152 .Va indentprefix .
7153 If no messages are specified, read the current message, the
7154 .Dq dot .
7155 Strips down the list of header fields according to the
7156 .Ql type
7157 white- and blacklist selection of
7158 .Ic headerpick .
7159 For MIME multipart messages,
7160 only the first displayable part is included.
7163 .It Ic ~p
7164 Display the message collected so far,
7165 prefaced by the message header fields
7166 and followed by the attachment list, if any.
7169 .It Ic ~q
7170 Abort the message being sent,
7171 copying it to the file specified by the
7172 .Ev DEAD
7173 variable if
7174 .Va save
7175 is set.
7178 .It Ic ~R Ar filename
7179 Identical to
7180 .Ic ~r ,
7181 but indent each line that has been read by
7182 .Va indentprefix .
7185 .It Ic ~r Ar filename Op Ar HERE-delimiter
7186 Read the named file, object to the usual
7187 .Sx "Filename transformations" ,
7188 into the message; if (the expanded)
7189 .Ar filename
7190 is the hyphen-minus
7191 .Ql -
7192 then standard input is used, e.g., for pasting purposes.
7193 Only in this latter mode
7194 .Ar HERE-delimiter
7195 may be given: if it is data will be read in until the given
7196 .Ar HERE-delimiter
7197 is seen on a line by itself, and encountering EOF is an error; the
7198 .Ar HERE-delimiter
7199 is a required argument in non-interactive mode; if it is single-quote
7200 quoted then the pasted content will not be expanded, \*(ID otherwise
7201 a future version of \*(UA may perform shell-style expansion on the content.
7204 .It Ic ~s Ar string
7205 Cause the named string to become the current subject field.
7206 Newline (NL) and carriage-return (CR) bytes are invalid and will be
7207 normalized to space (SP) characters.
7210 .It Ic ~t Ar name ...
7211 Add the given name(s) to the direct recipient list.
7214 .It Ic ~U Ar messages
7215 Read in the given / current message(s) excluding all headers, indented by
7216 .Va indentprefix .
7219 .It Ic ~u Ar messages
7220 Read in the given / current message(s), excluding all headers.
7223 .It Ic ~v
7224 Invoke an alternate editor (defined by the
7225 .Ev VISUAL
7226 environment variable) on the message collected so far.
7227 Usually, the alternate editor will be a screen editor.
7228 After the editor is quit,
7229 the user may resume appending text to the end of the message.
7232 .It Ic ~w Ar filename
7233 Write the message onto the named file, which is object to the usual
7234 .Sx "Filename transformations" .
7235 If the file exists,
7236 the message is appended to it.
7239 .It Ic ~x
7240 Same as
7241 .Ic ~q ,
7242 except that the message is not saved at all.
7245 .It Ic ~| Ar command
7246 Pipe the message through the specified filter command.
7247 If the command gives no output or terminates abnormally,
7248 retain the original text of the message.
7249 E.g., the command
7250 .Xr fmt 1
7251 is often used as a rejustifying filter.
7255 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
7256 Low-level command meant for scripted message access, i.e., for
7257 .Va on-compose-splice
7259 .Va on-compose-splice-shell .
7260 The used protocol is likely subject to changes, and therefore the
7261 mentioned hooks receive the used protocol version as an initial line.
7262 In general the first field of a response line represents a status code
7263 which specifies whether a command was successful or not, whether result
7264 data is to be expected, and if, the format of the result data.
7265 Does not manage the error number
7266 .Va \&!
7267 and the exit status
7268 .Va \&? ,
7269 because errors are reported via the protocol
7270 (hard errors like I/O failures cannot be handled).
7271 This command has read-only access to several virtual pseudo headers in
7272 the \*(UA private namespace, which may not exist (except for the first):
7276 .Bl -tag -compact -width ".It Va BaNg"
7277 .It Ql Mailx-Command:
7278 The name of the command that generates the message, one of
7279 .Ql forward ,
7280 .Ql Lreply ,
7281 .Ql mail ,
7282 .Ql Reply ,
7283 .Ql reply ,
7284 .Ql resend .
7286 .It Ql Mailx-Raw-To:
7287 .It Ql Mailx-Raw-Cc:
7288 .It Ql Mailx-Raw-Bcc:
7289 Represent the frozen initial state of these headers before any
7290 transformation (e.g.,
7291 .Ic alias ,
7292 .Ic alternates ,
7293 .Va recipients-in-cc
7294 etc.) took place.
7296 .It Ql Mailx-Orig-From:
7297 .It Ql Mailx-Orig-To:
7298 .It Ql Mailx-Orig-Cc:
7299 .It Ql Mailx-Orig-Bcc:
7300 The values of said headers of the original message which has been
7301 addressed by any of
7302 .Ic reply , forward , resend .
7306 The status codes are:
7310 .Bl -tag -compact -width ".It Ql 210"
7311 .It Ql 210
7312 Status ok; the remains of the line are the result.
7314 .It Ql 211
7315 Status ok; the rest of the line is optionally used for more status.
7316 What follows are lines of result addresses, terminated by an empty line.
7317 The address lines consist of two fields, the first of which is the
7318 plain address, e.g.,
7319 .Ql bob@exam.ple ,
7320 separated by a single ASCII SP space from the second which contains the
7321 unstripped address, even if that is identical to the first field, e.g.,
7322 .Ql (Lovely) Bob <bob@exam.ple> .
7323 All the input, including the empty line, must be consumed before further
7324 commands can be issued.
7326 .It Ql 212
7327 Status ok; the rest of the line is optionally used for more status.
7328 What follows are lines of furtherly unspecified string content,
7329 terminated by an empty line.
7330 All the input, including the empty line, must be consumed before further
7331 commands can be issued.
7333 .It Ql 500
7334 Syntax error; invalid command.
7336 .It Ql 501
7337 Syntax error in parameters or arguments.
7339 .It Ql 505
7340 Error: an argument fails verification.
7341 For example an invalid address has been specified, or an attempt was
7342 made to modify anything in \*(UA's own namespace.
7344 .It Ql 506
7345 Error: an otherwise valid argument is rendered invalid due to context.
7346 For example, a second address is added to a header which may consist of
7347 a single address only.
7352 If a command indicates failure then the message will have remained
7353 unmodified.
7354 Most commands can fail with
7355 .Ql 500
7356 if required arguments are missing (false command usage).
7357 The following (case-insensitive) commands are supported:
7360 .Bl -hang -width ".It Cm header"
7361 .It Cm header
7362 This command allows listing, inspection, and editing of message headers.
7363 Header name case is not normalized, and case-insensitive comparison
7364 should be used when matching names.
7365 The second argument specifies the subcommand to apply, one of:
7367 .Bl -hang -width ".It Cm remove"
7368 .It Cm list
7369 Without a third argument a list of all yet existing headers is given via
7370 .Ql 210 ;
7371 this command is the default command of
7372 .Cm header
7373 if no second argument has been given.
7374 A third argument restricts output to the given header only, which may
7375 fail with
7376 .Ql 501
7377 if no such field is defined.
7379 .It Cm show
7380 Shows the content of the header given as the third argument.
7381 Dependent on the header type this may respond with
7382 .Ql 211
7384 .Ql 212 ;
7385 any failure results in
7386 .Ql 501 .
7388 .It Cm remove
7389 This will remove all instances of the header given as the third
7390 argument, reporting
7391 .Ql 210
7392 upon success,
7393 .Ql 501
7394 if no such header can be found, and
7395 Ql 505
7396 on \*(UA namespace violations.
7398 .It Cm remove-at
7399 This will remove from the header given as the third argument the
7400 instance at the list position (counting from one!) given with the fourth
7401 argument, reporting
7402 .Ql 210
7403 upon success or
7404 .Ql 505
7405 if the list position argument is not a number or on \*(UA namespace
7406 violations, and
7407 .Ql 501
7408 if no such header instance exists.
7410 .It Cm insert
7411 Create a new or an additional instance of the header given in the third
7412 argument, with the header body content as given in the fourth argument
7413 (the remains of the line).
7414 It may return
7415 .Ql 501
7416 if the third argument specifies a free-form header field name that is
7417 invalid, or if body content extraction fails to succeed,
7418 .Ql 505
7419 if any extracted address does not pass syntax and/or security checks or
7420 on \*(UA namespace violations, and
7421 .Ql 506
7422 to indicate prevention of excessing a single-instance header \(em note that
7423 .Ql Subject:
7424 can be appended to (a space separator will be added automatically first).
7426 .Ql 210
7427 is returned upon success, followed by the name of the header and the list
7428 position of the newly inserted instance.
7429 The list position is always 1 for single-instance header fields.
7430 All free-form header fields are managed in a single list.
7434 .It Cm attachment
7435 This command allows listing, removal and addition of message attachments.
7436 The second argument specifies the subcommand to apply, one of:
7438 .Bl -hang -width ".It Cm remove"
7439 .It Cm list
7440 List all attachments via
7441 .Ql 212 ,
7442 or report
7443 .Ql 501
7444 if no attachments exist.
7445 This command is the default command of
7446 .Cm attachment
7447 if no second argument has been given.
7449 .It Cm remove
7450 This will remove the attachment given as the third argument, and report
7451 .Ql 210
7452 upon success or
7453 .Ql 501
7454 if no such attachment can be found.
7455 If there exists any path component in the given argument, then an exact
7456 match of the path which has been used to create the attachment is used
7457 directly, but if only the basename of that path matches then all
7458 attachments are traversed to find an exact match first, and the removal
7459 occurs afterwards; if multiple basenames match, a
7460 .Ql 506
7461 error occurs.
7462 Message attachments are treated as absolute pathnames.
7464 If no path component exists in the given argument, then all attachments
7465 will be searched for
7466 .Ql filename=
7467 parameter matches as well as for matches of the basename of the path
7468 which has been used when the attachment has been created; multiple
7469 matches result in a
7470 .Ql 506 .
7472 .It Cm remove-at
7473 This will interpret the third argument as a number and remove the
7474 attachment at that list position (counting from one!), reporting
7475 .Ql 210
7476 upon success or
7477 .Ql 505
7478 if the argument is not a number or
7479 .Ql 501
7480 if no such attachment exists.
7482 .It Cm insert
7483 Adds the attachment given as the third argument, specified exactly as
7484 documented for the command line option
7485 .Fl a ,
7486 and supporting the message number extension as documented for
7487 .Ic ~@ .
7488 This reports
7489 .Ql 210
7490 upon success, with the index of the new attachment following,
7491 .Ql 505
7492 if the given file cannot be opened,
7493 .Ql 506
7494 if an on-the-fly performed character set conversion fails, otherwise
7495 .Ql 501
7496 is reported; this is also reported if character set conversion is
7497 requested but not available.
7499 .It Cm attribute
7500 This uses the same search mechanism as described for
7501 .Cm remove
7502 and prints any known attributes of the first found attachment via
7503 .Ql 212
7504 upon success or
7505 .Ql 501
7506 if no such attachment can be found.
7507 The attributes are written as lines of keyword and value tuples, the
7508 keyword being separated from the rest of the line with an ASCII SP space
7509 character.
7511 .It Cm attribute-at
7512 This uses the same search mechanism as described for
7513 .Cm remove-at
7514 and is otherwise identical to
7515 .Cm attribute .
7517 .It Cm attribute-set
7518 This uses the same search mechanism as described for
7519 .Cm remove ,
7520 and will assign the attribute given as the fourth argument, which is
7521 expected to be a value tuple of keyword and other data, separated by
7522 a ASCII SP space or TAB tabulator character.
7523 If the value part is empty, then the given attribute is removed, or
7524 reset to a default value if existence of the attribute is crucial.
7526 It returns via
7527 .Ql 210
7528 upon success, with the index of the found attachment following,
7529 .Ql 505
7530 for message attachments or if the given keyword is invalid, and
7531 .Ql 501
7532 if no such attachment can be found.
7533 The following keywords may be used (case-insensitively):
7535 .Bl -hang -compact -width ".It Ql filename"
7536 .It Ql filename
7537 Sets the filename of the MIME part, i.e., the name that is used for
7538 display and when (suggesting a name for) saving (purposes).
7539 .It Ql content-description
7540 Associate some descriptive information to the attachment's content, used
7541 in favour of the plain filename by some MUAs.
7542 .It Ql content-id
7543 May be used for uniquely identifying MIME entities in several contexts;
7544 this expects a special reference address format as defined in RFC 2045
7545 and generates a
7546 .Ql 505
7547 upon address content verification failure.
7548 .It Ql content-type
7549 Defines the media type/subtype of the part, which is managed
7550 automatically, but can be overwritten.
7551 .It Ql content-disposition
7552 Automatically set to the string
7553 .Ql attachment .
7556 .It Cm attribute-set-at
7557 This uses the same search mechanism as described for
7558 .Cm remove-at
7559 and is otherwise identical to
7560 .Cm attribute-set .
7567 .\" }}}
7570 .\" .Sh INTERNAL VARIABLES {{{
7571 .Sh "INTERNAL VARIABLES"
7573 Internal \*(UA variables are controlled via the
7574 .Ic set
7576 .Ic unset
7577 commands; prefixing a variable name with the string
7578 .Ql no
7579 and calling
7580 .Ic set
7581 has the same effect as using
7582 .Ic unset :
7583 .Ql unset crt
7585 .Ql set nocrt
7586 do the same thing.
7587 Creation or editing of variables can be performed in the
7588 .Ev EDITOR
7589 with the command
7590 .Ic varedit .
7591 .Ic varshow
7592 will give more insight on the given variable(s), and
7593 .Ic set ,
7594 when called without arguments, will show a listing of all variables.
7595 Both commands support a more
7596 .Va verbose
7597 listing mode.
7598 Some well-known variables will also become inherited from the
7599 program
7600 .Sx ENVIRONMENT
7601 implicitly, others can be imported explicitly with the command
7602 .Ic environ
7603 and henceforth share said properties.
7606 Two different kinds of internal variables exist.
7607 There are boolean variables, which can only be in one of the two states
7608 .Dq set
7610 .Dq unset ,
7611 and value variables with a(n optional) string value.
7612 For the latter proper quoting is necessary upon assignment time, the
7613 introduction of the section
7614 .Sx COMMANDS
7615 documents the supported quoting rules.
7617 .Bd -literal -offset indent
7618 ? wysh set one=val\e 1 two="val 2" \e
7619     three='val "3"' four=$'val \e'4\e''; \e
7620     varshow one two three four; \e
7621     unset one two three four
7625 Dependent upon the actual option the string values will be interpreted
7626 as numbers, colour names, normal text etc., but there also exists
7627 a special kind of string value, the
7628 .Dq boolean string ,
7629 which must either be a decimal integer (in which case
7630 .Ql 0
7631 is false and
7632 .Ql 1
7633 and any other value is true) or any of the (case-insensitive) strings
7634 .Ql off ,
7635 .Ql no ,
7636 .Ql n
7638 .Ql false
7639 for a false boolean and
7640 .Ql on ,
7641 .Ql yes ,
7642 .Ql y
7644 .Ql true
7645 for a true boolean; a special kind of boolean string is the
7646 .Dq quadoption ,
7647 which is a boolean string that can optionally be prefixed with the
7648 (case-insensitive) term
7649 .Ql ask- ,
7650 as in
7651 .Ql ask-yes ,
7652 which causes prompting of the user in interactive mode, with the given
7653 boolean as the default value.
7655 .\" .Ss "Initial settings" {{{
7656 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
7657 .Ss "Initial settings"
7659 The standard POSIX 2008/Cor 2-2016 mandates the following initial
7660 variable settings:
7661 .Pf no Va allnet ,
7662 .Pf no Va append ,
7663 .Va asksub ,
7664 .Pf no Va askbcc ,
7665 .Pf no Va autoprint ,
7666 .Pf no Va bang ,
7667 .Pf no Va cmd ,
7668 .Pf no Va crt ,
7669 .Pf no Va debug ,
7670 .Pf no Va dot ,
7671 .Va escape
7672 set to
7673 .Ql ~ ,
7674 .Pf no Va flipr ,
7675 .Pf no Va folder ,
7676 .Va header ,
7677 .Pf no Va hold ,
7678 .Pf no Va ignore ,
7679 .Pf no Va ignoreeof ,
7680 .Pf no Va keep ,
7681 .Pf no Va keepsave ,
7682 .Pf no Va metoo ,
7683 .Pf no Va outfolder ,
7684 .Pf no Va page ,
7685 .Va prompt
7686 set to
7687 .Ql ?\0 ,
7688 .Pf no Va quiet ,
7689 .Pf no Va record ,
7690 .Va save ,
7691 .Pf no Va sendwait ,
7692 .Pf no Va showto ,
7693 .Pf no Va Sign ,
7694 .Pf no Va sign ,
7695 .Va toplines
7696 set to
7697 .Ql 5 .
7700 Notes: \*(UA does not support the
7701 .Pf no Va onehop
7702 variable \(en use command line options or
7703 .Va mta-arguments
7704 to pass options through to a
7705 .Va mta .
7706 And the default global
7707 .Pa \*(UR
7708 file, which is loaded unless the
7709 .Fl \&:
7710 (with according argument) or
7711 .Fl n
7712 command line options have been used, or the
7713 .Ev MAILX_NO_SYSTEM_RC
7714 environment variable is set (see
7715 .Sx "Resource files" )
7716 bends those initial settings a bit, e.g., it sets the variables
7717 .Va hold ,
7718 .Va keepsave
7720 .Va keep ,
7721 to name a few, establishes a default
7722 .Ic headerpick
7723 selection etc., and should thus be taken into account.
7724 .\" }}}
7726 .\" .Ss "Variables" {{{
7727 .Ss "Variables"
7729 .Bl -tag -width ".It Va BaNg"
7732 .It Va \&?
7733 \*(RO The exit status of the last command, or the
7734 .Ic return
7735 value of the macro
7736 .Ic call Ns
7737 ed last.
7738 This status has a meaning in the state machine: in conjunction with
7739 .Va errexit
7740 any non-0 exit status will cause a program exit, and in
7741 .Ev POSIXLY_CORRECT
7742 mode any error while loading (any of the) resource files will have the
7743 same effect.
7744 .Cm ignerr ,
7745 one of the
7746 .Sx "Command modifiers" ,
7747 can be used to instruct the state machine to ignore errors.
7750 .It Va \&!
7751 \*(RO The current error number
7752 .Pf ( Xr errno 3 ) ,
7753 which is set after an error occurred; it is also available via
7754 .Va ^ERR ,
7755 and the error name and documentation string can be queried via
7756 .Va ^ERRNAME
7758 .Va ^ERRDOC .
7759 \*(ID This machinery is new and the error number is only really usable
7760 if a command explicitly states that it manages the variable
7761 .Va \&! ,
7762 for others errno will be used in case of errors, or
7763 .Va ^ERR Ns -INVAL
7764 if that is 0: it thus may or may not reflect the real error.
7765 The error number may be set with the command
7766 .Ic return .
7770 .It Va ^
7771 \*(RO This is a multiplexer variable which performs dynamic expansion of
7772 the requested state or condition, of which there are:
7775 .Bl -tag -compact -width ".It Va BaNg"
7779 .It Va ^ERR , ^ERRDOC , ^ERRNAME
7780 The number, documentation, and name of the current
7781 .Xr errno 3 ,
7782 respectively, which is usually set after an error occurred.
7783 \*(ID This machinery is new and is usually reliable only if a command
7784 explicitly states that it manages the variable
7785 .Va \&! ,
7786 which is effectively identical to
7787 .Va \&\&^ERR .
7788 Each of those variables can be suffixed with a hyphen minus followed by
7789 a name or number, in which case the expansion refers to the given error.
7790 Note this is a direct mapping of (a subset of) the system error values:
7791 .Bd -literal -offset indent
7792 define work {
7793   eval echo \e$1: \e$^ERR-$1: \e$^ERRNAME-$1: \e$^ERRDOC-$1
7794   vput vexpr i + "$1" 1
7795   if [ $i -lt 16 ]
7796     \excall work $i
7797   end
7799 call work 0
7805 .It Va *
7806 \*(RO Expands all positional parameters (see
7807 .Va 1 ) ,
7808 separated by a space character.
7809 \*(ID The special semantics of the equally named special parameter of the
7810 .Xr sh 1
7811 are not yet supported.
7814 .It Va @
7815 \*(RO Expands all positional parameters (see
7816 .Va 1 ) ,
7817 separated by a space character.
7818 If placed in double quotation marks, each positional parameter is
7819 properly quoted to expand to a single parameter again.
7822 .It Va #
7823 \*(RO Expands to the number of positional parameters, i.e., the size of
7824 the positional parameter stack in decimal.
7827 .It Va \&0
7828 \*(RO Inside the scope of a
7829 .Ic define Ns
7830 d and
7831 .Ic call Ns
7832 ed macro this expands to the name of the calling macro, or to the empty
7833 string if the macro is running from top-level.
7834 For the \*(OPal regular expression search and replace operator of
7835 .Ic vexpr
7836 this expands to the entire matching expression.
7837 It represents the program name in global context.
7840 .It Va 1
7841 \*(RO Access of the positional parameter stack.
7842 All further parameters can be accessed with this syntax, too, e.g.,
7843 .Ql 2 ,
7844 .Ql 3
7845 etc.; positional parameters can be shifted off the stack by calling
7846 .Ic shift .
7847 The parameter stack contains, e.g., the arguments of a
7848 .Ic call Ns
7850 .Ic define Ns
7851 d macro, the matching groups of the \*(OPal regular expression search
7852 and replace expression of
7853 .Ic vexpr ,
7854 and can be explicitly created or overwritten with the command
7855 .Ic vpospar .
7858 .It Va account
7859 \*(RO Is set to the active
7860 .Ic account .
7863 .It Va add-file-recipients
7864 \*(BO When file or pipe recipients have been specified,
7865 mention them in the corresponding address fields of the message instead
7866 of silently stripping them from their recipient list.
7867 By default such addressees are not mentioned.
7870 .It Va allnet
7871 \*(BO Causes only the local part to be evaluated
7872 when comparing addresses.
7875 .It Va append
7876 \*(BO Causes messages saved in the
7877 .Mx -sx
7878 .Sx "secondary mailbox"
7879 .Ev MBOX
7880 to be appended to the end rather than prepended.
7881 This should always be set.
7884 .It Va ask
7885 \*(BO Causes \*(UA to prompt for the subject of each message sent.
7886 If the user responds with simply a newline,
7887 no subject field will be sent.
7890 .It Va askatend
7891 \*(BO Causes the prompts for
7892 .Ql Cc:
7894 .Ql Bcc:
7895 lists to appear after the message has been edited.
7898 .It Va askattach
7899 \*(BO If set, \*(UA asks for files to attach at the end of each message,
7900 shall the list be found empty at that time.
7901 An empty line finalizes the list.
7904 .It Va askcc
7905 \*(BO Causes the user to be prompted for carbon copy recipients
7906 (at the end of each message if
7907 .Va askatend
7909 .Va bsdcompat
7910 are set) shall the list be found empty (at that time).
7911 An empty line finalizes the list.
7914 .It Va askbcc
7915 \*(BO Causes the user to be prompted for blind carbon copy
7916 recipients (at the end of each message if
7917 .Va askatend
7919 .Va bsdcompat
7920 are set) shall the list be found empty (at that time).
7921 An empty line finalizes the list.
7924 .It Va asksign
7925 \*(BO\*(OP Causes the user to be prompted if the message is to be
7926 signed at the end of each message.
7928 .Va smime-sign
7929 variable is ignored when this variable is set.
7932 .It Va asksub
7933 \*(BO Alternative name for
7934 .Va ask .
7937 .It Va attrlist
7938 A sequence of characters to display in the
7939 .Ql attribute
7940 column of the
7941 .Va headline
7942 as shown in the display of
7943 .Ic headers ;
7944 each for one type of messages (see
7945 .Sx "Message states" ) ,
7946 with the default being
7947 .Ql NUROSPMFAT+\-$~
7949 .Ql NU\ \ *HMFAT+\-$~
7950 if the
7951 .Va bsdflags
7952 variable is set, in the following order:
7954 .Bl -tag -compact -width ".It Ql _"
7955 .It Ql N
7956 new.
7957 .It Ql U
7958 unread but old.
7959 .It Ql R
7960 new but read.
7961 .It Ql O
7962 read and old.
7963 .It Ql S
7964 saved.
7965 .It Ql P
7966 preserved.
7967 .It Ql M
7968 mboxed.
7969 .It Ql F
7970 flagged.
7971 .It Ql A
7972 answered.
7973 .It Ql T
7974 draft.
7975 .It Ql +
7976 start of a collapsed thread.
7977 .It Ql -
7978 an uncollapsed thread (TODO ignored for now).
7979 .It Ql $
7980 classified as spam.
7981 .It Ql ~
7982 classified as possible spam.
7987 .It Va autobcc
7988 Specifies a list of recipients to which a blind carbon copy of each
7989 outgoing message will be sent automatically.
7992 .It Va autocc
7993 Specifies a list of recipients to which a carbon copy of each outgoing
7994 message will be sent automatically.
7997 .It Va autocollapse
7998 \*(BO Causes threads to be collapsed automatically when threaded mode
7999 is entered (see the
8000 .Ic collapse
8001 command).
8004 .It Va autoprint
8005 \*(BO Enable automatic
8006 .Ic type Ns
8007 ing of a(n existing)
8008 .Dq successive
8009 message after
8010 .Ic delete
8012 .Ic undelete
8013 commands, e.g., the message that becomes the new
8014 .Dq dot
8015 is shown automatically, as via
8016 .Ic dp
8018 .Ic dt .
8021 .It Va autosort
8022 Causes sorted mode (see the
8023 .Ic sort
8024 command) to be entered automatically with the value of this variable as
8025 sorting method when a folder is opened, e.g.,
8026 .Ql set autosort=thread .
8029 .It Va bang
8030 \*(BO Enables the substitution of all not (reverse-solidus) escaped
8031 exclamation mark
8032 .Ql \&!
8033 characters by the contents of the last executed command for the
8034 .Ic \&!
8035 shell escape command and
8036 .Ic ~! ,
8037 one of the compose mode
8038 .Sx "COMMAND ESCAPES" .
8039 If this variable is not set no reverse solidus stripping is performed.
8042 .It Va bind-timeout
8043 \*(OP Terminals generate multi-byte sequences for certain forms of
8044 input, for example for function and other special keys.
8045 Some terminals however do not write these multi-byte sequences as
8046 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
8047 This variable specifies the timeout in milliseconds that the MLE (see
8048 .Sx "On terminal control and line editor" )
8049 waits for more bytes to arrive unless it considers a sequence
8050 .Dq complete .
8051 The default is 200.
8054 .It Va bsdcompat
8055 \*(BO Sets some cosmetical features to traditional BSD style;
8056 has the same affect as setting
8057 .Va askatend
8058 and all other variables prefixed with
8059 .Ql bsd ;
8060 it also changes the behaviour of
8061 .Va emptystart
8062 (which does not exist in BSD).
8065 .It Va bsdflags
8066 \*(BO Changes the letters shown in the first column of a header
8067 summary to traditional BSD style.
8070 .It Va bsdheadline
8071 \*(BO Changes the display of columns in a header summary to traditional
8072 BSD style.
8075 .It Va bsdmsgs
8076 \*(BO Changes some informational messages to traditional BSD style.
8079 .It Va bsdorder
8080 \*(BO Causes the
8081 .Ql Subject:
8082 field to appear immediately after the
8083 .Ql To:
8084 field in message headers and with the
8085 .Ic ~h
8086 .Sx "COMMAND ESCAPES" .
8090 .It Va build-os , build-osenv
8091 \*(RO The operating system \*(UA has been build for, usually taken from
8092 .Xr uname 1
8094 .Ql uname -s
8096 .Ql uname -srm ,
8097 respectively, the former being lowercased.
8100 .It Va charset-7bit
8101 The value that should appear in the
8102 .Ql charset=
8103 parameter of
8104 .Ql Content-Type:
8105 MIME header fields when no character set conversion of the message data
8106 was performed.
8107 This defaults to US-ASCII, and the chosen character set should be
8108 US-ASCII compatible.
8111 .It Va charset-8bit
8112 \*(OP The default 8-bit character set that is used as an implicit last
8113 member of the variable
8114 .Va sendcharsets .
8115 This defaults to UTF-8 if character set conversion capabilities are
8116 available, and to ISO-8859-1 otherwise, in which case the only supported
8117 character set is
8118 .Va ttycharset
8119 and this variable is effectively ignored.
8120 Refer to the section
8121 .Sx "Character sets"
8122 for the complete picture of character set conversion in \*(UA.
8125 .It Va charset-unknown-8bit
8126 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
8127 .Dq upgrade
8128 the content of a mail message by using a character set with the name
8129 .Ql unknown-8bit .
8130 Because of the unclassified nature of this character set \*(UA will not
8131 be capable to convert this character set to any other character set.
8132 If this variable is set any message part which uses the character set
8133 .Ql unknown-8bit
8134 is assumed to really be in the character set given in the value,
8135 otherwise the (final) value of
8136 .Va charset-8bit
8137 is used for this purpose.
8139 This variable will also be taken into account if a MIME type (see
8140 .Sx "The mime.types files" )
8141 of a MIME message part that uses the
8142 .Ql binary
8143 character set is forcefully treated as text.
8146 .It Va cmd
8147 The default value for the
8148 .Ic pipe
8149 command.
8152 .It Va colour-disable
8153 \*(BO\*(OP Forcefully disable usage of colours.
8154 Also see the section
8155 .Sx "Coloured display" .
8158 .It Va colour-pager
8159 \*(BO\*(OP Whether colour shall be used for output that is paged through
8160 .Ev PAGER .
8161 Note that pagers may need special command line options, e.g.,
8162 .Xr less 1
8163 requires the option
8164 .Fl \&\&R
8166 .Xr lv 1
8167 the option
8168 .Fl \&\&c
8169 in order to support colours.
8170 Often doing manual adjustments is unnecessary since \*(UA may perform
8171 adjustments dependent on the value of the environment variable
8172 .Ev PAGER
8173 (see there for more).
8177 .It Va contact-mail , contact-web
8178 \*(RO Addresses for contact per email and web, respectively, e.g., for
8179 bug reports, suggestions, or help regarding \*(UA.
8180 The former can be used directly:
8181 .Ql ? eval mail $contact-mail .
8184 .It Va crt
8185 In a(n interactive) terminal session, then if this valued variable is
8186 set it will be used as a threshold to determine how many lines the given
8187 output has to span before it will be displayed via the configured
8188 .Ev PAGER ;
8189 Usage of the
8190 .Ev PAGER
8191 can be forced by setting this to the value
8192 .Ql 0 ,
8193 setting it without a value will deduce the current height of the
8194 terminal screen to compute the treshold (see
8195 .Ev LINES ,
8196 .Va screen
8198 .Xr stty 1 ) .
8199 \*(ID At the moment this uses the count of lines of the message in wire
8200 format, which, dependent on the
8201 .Va mime-encoding
8202 of the message, is unrelated to the number of display lines.
8203 (The software is old and historically the relation was a given thing.)
8206 .It Va customhdr
8207 Define a set of custom headers to be injected into newly composed or
8208 forwarded messages; it is also possible to create custom headers in
8209 compose mode with
8210 .Ic ~^ ,
8211 which can be automated by setting one of the hooks
8212 .Va on-compose-splice
8214 .Va on-compose-splice-shell .
8215 The value is interpreted as a comma-separated list of custom headers to
8216 be injected, to include commas in the header bodies escape them with
8217 reverse solidus.
8218 \*(ID Overwriting of automatically managed headers is neither supported
8219 nor prevented.
8221 .Dl ? set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
8224 .It Va datefield
8225 Controls the appearance of the
8226 .Ql %d
8227 date and time format specification of the
8228 .Va headline
8229 variable, that is used, for example, when viewing the summary of
8230 .Ic headers .
8231 If unset, then the local receiving date is used and displayed
8232 unformatted, otherwise the message sending
8233 .Ql Date: .
8234 It is possible to assign a
8235 .Xr strftime 3
8236 format string and control formatting, but embedding newlines via the
8237 .Ql %n
8238 format is not supported, and will result in display errors.
8239 The default is
8240 .Ql %Y-%m-%d %H:%M ,
8241 and also see
8242 .Va datefield-markout-older .
8245 .It Va datefield-markout-older
8246 Only used in conjunction with
8247 .Va datefield .
8248 Can be used to create a visible distinction of messages dated more than
8249 a day in the future, or older than six months, a concept comparable to the
8250 .Fl \&\&l
8251 option of the POSIX utility
8252 .Xr ls 1 .
8253 If set to the empty string, then the plain month, day and year of the
8254 .Ql Date:
8255 will be displayed, but a
8256 .Xr strftime 3
8257 format string to control formatting can be assigned.
8258 The default is
8259 .Ql %Y-%m-%d .
8262 .It Va debug
8263 \*(BO Enables debug messages and obsoletion warnings, disables the
8264 actual delivery of messages and also implies
8265 .Pf no Va record
8266 as well as
8267 .Pf no Va save .
8270 .It Va disposition-notification-send
8271 \*(BO\*(OP Emit a
8272 .Ql Disposition-Notification-To:
8273 header (RFC 3798) with the message.
8274 This requires the
8275 .Va from
8276 variable to be set.
8277 .\" TODO .It Va disposition-notification-send-HOST
8278 .\"Overrides
8279 .\".Va disposition-notification-send
8280 .\" for SMTP accounts on a specific host.
8281 .\" TODO .It Va disposition-notification-send-USER@HOST
8282 .\"Overrides
8283 .\".Va disposition-notification-send
8284 .\"for a specific account.
8287 .It Va dot
8288 \*(BO When dot is set, a period
8289 .Ql \&.
8290 on a line by itself during message input in (interactive or batch
8291 .Fl # )
8292 compose mode will be treated as end-of-message (in addition to the
8293 normal end-of-file condition).
8294 This behaviour is implied in
8295 .Va posix
8296 mode with a set
8297 .Va ignoreeof .
8300 .It Va dotlock-ignore-error
8301 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as
8302 .Mx -sx
8303 .Sx "primary system mailbox" Ns
8304 es (see, e.g., the notes on
8305 .Sx "Filename transformations" ,
8306 as well as the documentation of
8307 .Ic file )
8308 will be protected with so-called dotlock files\(emthe traditional mail
8309 spool file locking method\(emin addition to system file locking.
8310 Because \*(UA ships with a privilege-separated dotlock creation program
8311 that should always be able to create such a dotlock file there is no
8312 good reason to ignore dotlock file creation errors, and thus these are
8313 fatal unless this variable is set.
8316 .It Va editalong
8317 \*(BO If this variable is set then the editor is started automatically
8318 when a message is composed in interactive mode, as if the
8319 .Ic ~e
8320 .Sx "COMMAND ESCAPES"
8321 had been specified.
8323 .Va editheaders
8324 variable is implied for this automatically spawned editor session.
8327 .It Va editheaders
8328 \*(BO When a message is edited while being composed,
8329 its header is included in the editable text.
8332 .It Va emptystart
8333 \*(BO When entering interactive mode \*(UA normally writes
8334 .Dq \&No mail for user
8335 and exits immediately if a mailbox is empty or does not exist.
8336 If this variable is set \*(UA starts even with an empty or non-existent
8337 mailbox (the latter behaviour furtherly depends upon
8338 .Va bsdcompat ,
8339 though).
8342 .It Va errexit
8343 \*(BO Let each command with a non-0 exit status, including every
8344 .Ic call Ns
8345 ed macro which
8346 .Ic return Ns
8347 s a non-0 status, cause a program exit unless prefixed by
8348 .Cm ignerr
8349 (see
8350 .Sx "Command modifiers" ) .
8351 This also affects
8352 .Sx "COMMAND ESCAPES" ,
8353 but which use a different modifier for ignoring the error.
8354 Please refer to the variable
8355 .Va \&?
8356 for more on this topic.
8359 .It Va escape
8360 The first character of this value defines the escape character for
8361 .Sx "COMMAND ESCAPES"
8362 in compose mode.
8363 The default value is the character tilde
8364 .Ql ~ .
8365 If set to the empty string, command escapes are disabled.
8368 .It Va expandaddr
8369 If not set then file and command pipeline targets are not allowed,
8370 and any such address will be filtered out, giving a warning message.
8371 If set without a value then all possible recipient address
8372 specifications will be accepted \(en see the section
8373 .Sx "On sending mail, and non-interactive mode"
8374 for more on this.
8375 To accept them, but only in interactive mode, or when tilde commands
8376 were enabled explicitly by using one of the command line options
8377 .Fl ~
8379 .Fl # ,
8380 set this to the (case-insensitive) value
8381 .Ql restrict
8382 (it actually acts like
8383 .Ql restrict,-all,+name,+addr ,
8384 so that care for ordering issues must be taken) .
8386 In fact the value is interpreted as a comma-separated list of values.
8387 If it contains
8388 .Ql fail
8389 then the existence of disallowed specifications is treated as a hard
8390 send error instead of only filtering them out.
8391 The remaining values specify whether a specific type of recipient
8392 address specification is allowed (optionally indicated by a plus sign
8393 .Ql +
8394 prefix) or disallowed (prefixed with a hyphen-minus
8395 .Ql - ) .
8396 The value
8397 .Ql all
8398 addresses all possible address specifications,
8399 .Ql file
8400 file targets,
8401 .Ql pipe
8402 command pipeline targets,
8403 .Ql name
8404 plain user names and (MTA) aliases and
8405 .Ql addr
8406 network addresses.
8407 These kind of values are interpreted in the given order, so that
8408 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
8409 will cause hard errors for any non-network address recipient address
8410 unless \*(UA is in interactive mode or has been started with the
8411 .Fl ~
8413 .Fl #
8414 command line option; in the latter case(s) any address may be used, then.
8416 Historically invalid network addressees are silently stripped off.
8417 To change this so that any encountered invalid email address causes
8418 a hard error it must be ensured that
8419 .Ql failinvaddr
8420 is an entry in the above list.
8421 Setting this automatically enables network addressees
8422 (it actually acts like
8423 .Ql failinvaddr,+addr ,
8424 so that care for ordering issues must be taken) .
8427 .It Va expandargv
8428 Unless this variable is set additional
8429 .Va mta
8430 (Mail-Transfer-Agent)
8431 arguments from the command line, as can be given after a
8432 .Fl \&\&-
8433 separator, are ignored due to safety reasons.
8434 However, if set to the special (case-insensitive) value
8435 .Ql fail ,
8436 then the presence of additional MTA arguments is treated as a hard
8437 error that causes \*(UA to exit with failure status.
8438 A lesser strict variant is the otherwise identical
8439 .Ql restrict ,
8440 which does accept such arguments in interactive mode, or if tilde
8441 commands were enabled explicitly by using one of the command line options
8442 .Fl ~
8444 .Fl # .
8447 .It Va features
8448 \*(RO String giving a list of features \*(UA, preceded with a plus sign
8449 .Ql +
8450 if the feature is available, and a hyphen-minus
8451 .Ql -
8452 otherwise.
8453 The output of the command
8454 .Ic version
8455 will include this information in a more pleasant output.
8458 .It Va flipr
8459 \*(BO This setting reverses the meanings of a set of reply commands,
8460 turning the lowercase variants, which by default address all recipients
8461 included in the header of a message
8462 .Pf ( Ic reply , respond , followup )
8463 into the uppercase variants, which by default address the sender only
8464 .Pf ( Ic Reply , Respond , Followup )
8465 and vice versa.
8466 The commands
8467 .Ic replysender , respondsender , followupsender
8468 as well as
8469 .Ic replyall , respondall , followupall
8470 are not affected by the current setting of
8471 .Va flipr .
8474 .It Va folder
8475 The default path under which mailboxes are to be saved:
8476 filenames that begin with the plus sign
8477 .Ql +
8478 will have the plus sign replaced with the value of this variable if set,
8479 otherwise the plus sign will remain unchanged when doing
8480 .Sx "Filename transformations" ;
8481 also see
8482 .Ic file
8483 for more on this topic.
8484 The value supports a subset of transformations itself, and if the
8485 non-empty value does not start with a solidus
8486 .Ql / ,
8487 then the value of
8488 .Ev HOME
8489 will be prefixed automatically.
8490 Once the actual value is evaluated first, the internal variable
8491 .Va folder-resolved
8492 will be updated for caching purposes.
8495 .It Va folder-hook
8496 This variable can be set to the name of a
8497 .Ic define Ns d
8498 macro which will be called whenever a
8499 .Ic file
8500 is opened.
8501 The macro will also be invoked when new mail arrives,
8502 but message lists for commands executed from the macro
8503 only include newly arrived messages then.
8504 .Ic localopts
8505 are activated by default in a folder hook, causing the covered settings
8506 to be reverted once the folder is left again.
8509 .It Va folder-hook-FOLDER
8510 Overrides
8511 .Va folder-hook
8512 for a folder named
8513 .Ql FOLDER .
8514 Unlike other folder specifications, the fully expanded name of a folder,
8515 without metacharacters, is used to avoid ambiguities.
8516 However, if the mailbox resides under
8517 .Va folder
8518 then the usual
8519 .Ql +
8520 specification is tried in addition, e.g., if
8521 .Va \&\&folder
8523 .Dq mail
8524 (and thus relative to the user's home directory) then
8525 .Pa /home/usr1/mail/sent
8526 will be tried as
8527 .Ql folder-hook-/home/usr1/mail/sent
8528 first, but then followed by
8529 .Ql folder-hook-+sent .
8532 .It Va folder-resolved
8533 \*(RO Set to the fully resolved path of
8534 .Va folder
8535 once that evaluation has occurred; rather internal.
8538 .It Va followup-to
8539 \*(BO Controls whether a
8540 .Ql Mail-Followup-To:
8541 header is generated when sending messages to known mailing lists.
8542 Also see
8543 .Va followup-to-honour
8544 and the commands
8545 .Ic mlist , mlsubscribe , reply
8547 .Ic Lreply .
8550 .It Va followup-to-honour
8551 Controls whether a
8552 .Ql Mail-Followup-To:
8553 header is honoured when group-replying to a message via
8554 .Ic reply
8556 .Ic Lreply .
8557 This is a quadoption; if set without a value it defaults to
8558 .Dq yes .
8559 Also see
8560 .Va followup-to
8561 and the commands
8562 .Ic mlist
8564 .Ic mlsubscribe .
8567 .It Va forward-as-attachment
8568 \*(BO Original messages are normally sent as inline text with the
8569 .Ic forward
8570 command,
8571 and only the first part of a multipart message is included.
8572 With this setting enabled messages are sent as unmodified MIME
8573 .Ql message/rfc822
8574 attachments with all of their parts included.
8577 .It Va forward-inject-head
8578 The string to put before the text of a message with the
8579 .Ic forward
8580 command instead of the default
8581 .Dq -------- Original Message -------- .
8582 No heading is put if it is set to the empty string.
8583 This variable is ignored if the
8584 .Va forward-as-attachment
8585 variable is set.
8588 .It Va from
8589 The address (or a list of addresses) to put into the
8590 .Ql From:
8591 field of the message header, quoting RFC 5322:
8592 the author(s) of the message, that is, the mailbox(es) of the person(s)
8593 or system(s) responsible for the writing of the message.
8594 When
8595 .Ic reply Ns
8596 ing to messages these addresses are handled as if they were in the
8597 .Ic alternates
8598 list.
8600 If the machine's hostname is not valid at the Internet (for example at
8601 a dialup machine) then either this variable or
8602 .Va hostname
8603 (\*(IN and with a defined SMTP protocol in
8604 .Va mta
8605 .Va smtp-hostname
8606 adds even more fine-tuning capabilities),
8607 have to be set.
8609 .Va \&\&from
8610 contains more than one address,
8611 setting the
8612 .Va sender
8613 variable is required (according to the standard RFC 5322).
8615 If a file-based MTA is used, then
8616 .Va from
8617 (or, if that contains multiple addresses,
8618 .Va sender )
8619 can nonetheless be enforced to appear as the envelope sender address at
8620 the MTA protocol level (the RFC 5321 reverse-path), either by using the
8621 .Fl r
8622 command line option (with an empty argument; see there for the complete
8623 picture on this topic), or by setting the internal variable
8624 .Va r-option-implicit .
8627 .It Va fullnames
8628 \*(BO When replying to or forwarding a message \*(UA normally removes
8629 the comment and name parts of email addresses.
8630 If this variable is set such stripping is not performed,
8631 and comments, names etc. are retained.
8633 .It Va fwdheading
8634 \*(OB Predecessor of
8635 .Va forward-inject-head .
8638 .It Va header
8639 \*(BO Causes the header summary to be written at startup and after
8640 commands that affect the number of messages or the order of messages in
8641 the current
8642 .Ic folder .
8643 Unless in
8644 .Ev POSIXLY_CORRECT
8645 mode a header summary will also be displayed on folder changes.
8646 The command line option
8647 .Fl N
8648 can be used to set
8649 .Pf no Va header .
8653 .It Va headline
8654 A format string to use for the summary of
8655 .Ic headers ,
8656 similar to the ones used for
8657 .Xr printf 3
8658 formats.
8659 Format specifiers in the given string start with a percent sign
8660 .Ql %
8661 and may be followed by an optional decimal number indicating the field
8662 width \(em if that is negative, the field is to be left-aligned.
8663 Valid format specifiers are:
8666 .Bl -tag -compact -width ".It Ql _%%_"
8667 .It Ql %%
8668 A plain percent sign.
8669 .It Ql %>
8670 .Dq Dotmark :
8671 a space character but for the current message
8672 .Pf ( Dq dot ) ,
8673 for which it expands to
8674 .Ql > .
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 \*(OP The spam score of the message, as has been classified via the
8683 command
8684 .Ic spamrate .
8685 Shows only a replacement character if there is no spam support.
8686 .It Ql %a
8687 Message attribute character (status flag); the actual content can be
8688 adjusted by setting
8689 .Va attrlist .
8690 .It Ql %d
8691 The date found in the
8692 .Ql From:
8693 header of the message when
8694 .Va datefield
8695 is set (the default), otherwise the date when the message was received.
8696 Formatting can be controlled by assigning a
8697 .Xr strftime 3
8698 format string to
8699 .Va datefield .
8700 .It Ql %e
8701 The indenting level in threaded mode.
8702 .It Ql %f
8703 The address of the message sender.
8704 .It Ql %i
8705 The message thread tree structure.
8706 (Note that this format does not support a field width.)
8707 .It Ql %l
8708 The number of lines of the message, if available.
8709 .It Ql %m
8710 Message number.
8711 .It Ql %o
8712 The number of octets (bytes) in the message, if available.
8713 .It Ql %s
8714 Message subject (if any).
8715 .It Ql %S
8716 Message subject (if any) in double quotes.
8717 .It Ql \&%T
8718 Message recipient flags: is the addressee of the message a known or
8719 subscribed mailing list \(en see
8720 .Ic mlist
8722 .Ic mlsubscribe .
8723 .It Ql %t
8724 The position in threaded/sorted order.
8727 The default is
8728 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
8730 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
8732 .Va bsdcompat
8733 is set.
8734 Also see
8735 .Va attrlist
8737 .Va headline-bidi .
8741 .It Va headline-bidi
8742 Bidirectional text requires special treatment when displaying headers,
8743 because numbers (in dates or for file sizes etc.) will not affect the
8744 current text direction, in effect resulting in ugly line layouts when
8745 arabic or other right-to-left text is to be displayed.
8746 On the other hand only a minority of terminals is capable to correctly
8747 handle direction changes, so that user interaction is necessary for
8748 acceptable results.
8749 Note that extended host system support is required nonetheless, e.g.,
8750 detection of the terminal character set is one precondition;
8751 and this feature only works in an Unicode (i.e., UTF-8) locale.
8753 In general setting this variable will cause \*(UA to encapsulate text
8754 fields that may occur when displaying
8755 .Va headline
8756 (and some other fields, like dynamic expansions in
8757 .Va prompt )
8758 with special Unicode control sequences;
8759 it is possible to fine-tune the terminal support level by assigning
8760 a value:
8761 no value (or any value other than
8762 .Ql 1 ,
8763 .Ql 2
8765 .Ql 3 )
8766 will make \*(UA assume that the terminal is capable to properly deal
8767 with Unicode version 6.3, in which case text is embedded in a pair of
8768 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
8769 characters.
8770 In addition no space on the line is reserved for these characters.
8772 Weaker support is chosen by using the value
8773 .Ql 1
8774 (Unicode 6.3, but reserve the room of two spaces for writing the control
8775 sequences onto the line).
8776 The values
8777 .Ql 2
8779 .Ql 3
8780 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
8781 again reserves room for two spaces in addition.
8784 .It Va history-file
8785 \*(OP If a line editor is available then this can be set to
8786 name the (expandable) path of the location of a permanent history file.
8787 Also see
8788 .Va history-size .
8791 .It Va history-gabby
8792 \*(BO\*(OP Add more entries to the history as is normally done.
8795 .It Va history-gabby-persist
8796 \*(BO\*(OP \*(UA's own MLE will not save the additional
8797 .Va history-gabby
8798 entries in persistent storage unless this variable is set.
8799 On the other hand it will not loose the knowledge of whether
8800 a persistent entry was gabby or not.
8801 Also see
8802 .Va history-file .
8805 .It Va history-size
8806 \*(OP Setting this variable imposes a limit on the number of concurrent
8807 history entries.
8808 If set to the value 0 then no further history entries will be added, and
8809 loading and incorporation of the
8810 .Va history-file
8811 upon program startup can also be suppressed by doing this.
8812 Runtime changes will not be reflected, but will affect the number of
8813 entries saved to permanent storage.
8816 .It Va hold
8817 \*(BO This setting controls whether messages are held in the system
8818 .Va inbox ,
8819 and it is set by default.
8822 .It Va hostname
8823 Use this string as hostname when expanding local addresses instead of
8824 the value obtained from
8825 .Xr uname 3
8827 .Xr getaddrinfo 3 .
8828 It is used, e.g., in
8829 .Ql Message-ID:
8831 .Ql From:
8832 fields, as well as when generating
8833 .Ql Content-ID:
8834 MIME part related unique ID fields.
8835 Setting it to the empty string will cause the normal hostname to be
8836 used, but nonetheless enables creation of said ID fields.
8837 \*(IN in conjunction with the built-in SMTP
8838 .Va mta
8839 .Va smtp-hostname
8840 also influences the results:
8841 one should produce some test messages with the desired combination of
8842 .Va \&\&hostname ,
8843 and/or
8844 .Va from ,
8845 .Va sender
8846 etc. first.
8849 .It Va idna-disable
8850 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
8851 names according to the rules of IDNA (internationalized domain names
8852 for applications).
8853 Since the IDNA code assumes that domain names are specified with the
8854 .Va ttycharset
8855 character set, an UTF-8 locale charset is required to represent all
8856 possible international domain names (before conversion, that is).
8859 .It Va ifs
8860 The input field separator that is used (\*(ID by some functions) to
8861 determine where to split input data.
8863 .Bl -tag -compact -width ".It MMM"
8864 .It 1.
8865 Unsetting is treated as assigning the default value,
8866 .Ql \& \et\en .
8867 .It 2.
8868 If set to the empty value, no field splitting will be performed.
8869 .It 3.
8870 If set to a non-empty value, all whitespace characters are extracted
8871 and assigned to the variable
8872 .Va ifs-ws .
8875 .Bl -tag -compact -width ".It MMM"
8876 .It a.
8877 .Va \&\&ifs-ws
8878 will be ignored at the beginning and end of input.
8879 Diverging from POSIX shells default whitespace is removed in addition,
8880 which is owed to the entirely different line content extraction rules.
8881 .It b.
8882 Each occurrence of a character of
8883 .Va \&\&ifs
8884 will cause field-splitting, any adjacent
8885 .Va \&\&ifs-ws
8886 characters will be skipped.
8890 .It Va ifs-ws
8891 \*(RO Automatically deduced from the whitespace characters in
8892 .Va ifs .
8895 .It Va ignore
8896 \*(BO Ignore interrupt signals from the terminal while entering
8897 messages; instead echo them as
8898 .Ql @
8899 characters and discard the current line.
8902 .It Va ignoreeof
8903 \*(BO Ignore end-of-file conditions
8904 .Pf ( Ql control-D )
8905 in compose mode on message input and in interactive command input.
8906 If set an interactive command input session can only be left by
8907 explicitly using one of the commands
8908 .Ic exit
8910 .Ic quit ,
8911 and message input in compose mode can only be terminated by entering
8912 a period
8913 .Ql \&.
8914 on a line by itself or by using the
8915 .Ic ~.
8916 .Sx "COMMAND ESCAPES" ;
8917 Setting this implies the behaviour that
8918 .Va dot
8919 describes in
8920 .Va posix
8921 mode.
8924 .It Va inbox
8925 If this is set to a non-empty string it will specify the users
8926 .Mx -sx
8927 .Sx "primary system mailbox" ,
8928 overriding
8929 .Ev MAIL
8930 and the system-dependent default, and (thus) be used to replace
8931 .Ql %
8932 when doing
8933 .Sx "Filename transformations" ;
8934 also see
8935 .Ic file
8936 for more on this topic.
8937 The value supports a subset of transformations itself.
8940 .It Va indentprefix
8941 String used by the
8942 .Ic ~m , ~M
8944 .Ic ~R
8945 .Sx "COMMAND ESCAPES"
8946 and by the
8947 .Va quote
8948 option for indenting messages,
8949 in place of the normal tabulator character
8950 .Ql ^I ,
8951 which is the default.
8952 Be sure to quote the value if it contains spaces or tabs.
8955 .It Va keep
8956 \*(BO If set, an empty
8957 .Mx -sx
8958 .Sx "primary system mailbox"
8959 file is not removed.
8960 Note that, in conjunction with
8961 .Ev POSIXLY_CORRECT
8962 any empty file will be removed unless this variable is set.
8963 This may improve the interoperability with other mail user agents
8964 when using a common folder directory, and prevents malicious users
8965 from creating fake mailboxes in a world-writable spool directory.
8966 \*(ID Only local regular (MBOX) files are covered, Maildir or other
8967 mailbox types will never be removed, even if empty.
8970 .It Va keep-content-length
8971 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
8972 be told to keep the
8973 .Ql Content-Length:
8975 .Ql Lines:
8976 header fields that some MUAs generate by setting this variable.
8977 Since \*(UA does neither use nor update these non-standardized header
8978 fields (which in itself shows one of their conceptual problems),
8979 stripping them should increase interoperability in between MUAs that
8980 work with with same mailbox files.
8981 Note that, if this is not set but
8982 .Va writebackedited ,
8983 as below, is, a possibly performed automatic stripping of these header
8984 fields already marks the message as being modified.
8985 \*(ID At some future time \*(UA will be capable to rewrite and apply an
8986 .Va mime-encoding
8987 to modified messages, and then those fields will be stripped silently.
8990 .It Va keepsave
8991 \*(BO When a message is saved it is usually discarded from the
8992 originating folder when \*(UA is quit.
8993 This setting causes all saved message to be retained.
8996 .It Va line-editor-disable
8997 \*(BO Turn off any enhanced line editing capabilities (see
8998 .Sx "On terminal control and line editor"
8999 for more).
9002 .It Va line-editor-no-defaults
9003 \*(BO\*(OP Do not establish any default key binding.
9006 .It Va log-prefix
9007 Error log message prefix string
9008 .Pf ( Ql "\*(uA: " ) .
9011 .It Va mailbox-display
9012 \*(RO The name of the current mailbox
9013 .Pf ( Ic file ) ,
9014 possibly abbreviated for display purposes.
9017 .It Va mailbox-resolved
9018 \*(RO The fully resolved path of the current mailbox.
9021 .It Va mailx-extra-rc
9022 An additional startup file that is loaded as the last of the
9023 .Sx "Resource files" .
9024 Use this file for commands that are not understood by other POSIX
9025 .Xr mailx 1
9026 implementations, i.e., mostly anything which is not covered by
9027 .Sx "Initial settings" .
9030 .It Va markanswered
9031 \*(BO When a message is replied to and this variable is set,
9032 it is marked as having been
9033 .Ic answered .
9034 See the section
9035 .Sx "Message states" .
9038 .It Va mbox-rfc4155
9039 \*(BO When opening MBOX mailbox databases \*(UA by default uses tolerant
9040 POSIX rules for detecting message boundaries (so-called
9041 .Ql From_
9042 lines) due to compatibility reasons, instead of the stricter rules that
9043 have been standardized in RFC 4155.
9044 This behaviour can be switched to the stricter RFC 4155 rules by
9045 setting this variable.
9046 (This is never necessary for any message newly generated by \*(UA,
9047 it only applies to messages generated by buggy or malicious MUAs, or may
9048 occur in old MBOX databases: \*(UA itself will choose a proper
9049 .Va mime-encoding
9050 to avoid false interpretation of
9051 .Ql From_
9052 content lines in the MBOX database.)
9054 This may temporarily be handy when \*(UA complains about invalid
9055 .Ql From_
9056 lines when opening a MBOX: in this case setting this variable and
9057 re-opening the mailbox in question may correct the result.
9058 If so, copying the entire mailbox to some other file, as in
9059 .Ql copy * SOME-FILE ,
9060 will perform proper, all-compatible
9061 .Ql From_
9062 quoting for all detected messages, resulting in a valid MBOX mailbox.
9063 Finally the variable can be unset again:
9064 .Bd -literal -offset indent
9065 define mboxfix {
9066   localopts yes; wysh set mbox-rfc4155;\e
9067     wysh File "${1}"; eval copy * "${2}"
9069 call mboxfix /tmp/bad.mbox /tmp/good.mbox
9073 .It Va memdebug
9074 \*(BO Internal development variable.
9077 .It Va message-id-disable
9078 \*(BO By setting this variable the generation of
9079 .Ql Message-ID:
9080 can be completely suppressed, effectively leaving this task up to the
9081 .Va mta
9082 (Mail-Transfer-Agent) or the SMTP server.
9083 (According to RFC 5321 a SMTP server is not required to add this
9084 field by itself, so it should be ensured that it accepts messages without
9085 .Ql Message-ID . )
9086 This variable also affects automatic generation of
9087 .Va Content-ID:
9088 MIME header fields.
9091 .It Va message-inject-head
9092 A string to put at the beginning of each new message.
9093 The escape sequences tabulator
9094 .Ql \et
9095 and newline
9096 .Ql \en
9097 are understood.
9100 .It Va message-inject-tail
9101 A string to put at the end of each new message.
9102 The escape sequences tabulator
9103 .Ql \et
9104 and newline
9105 .Ql \en
9106 are understood.
9109 .It Va metoo
9110 \*(BO Usually, when an
9111 .Ic alias
9112 expansion contains the sender, the sender is removed from the expansion.
9113 Setting this option suppresses these removals.
9114 Note that a set
9115 .Va metoo
9116 also causes a
9117 .Ql -m
9118 option to be passed through to the
9119 .Va mta
9120 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
9121 this flag, no MTA is known which does not support it (for historical
9122 compatibility).
9125 .It Va mime-allow-text-controls
9126 \*(BO When sending messages, each part of the message is MIME-inspected
9127 in order to classify the
9128 .Ql Content-Type:
9130 .Ql Content-Transfer-Encoding:
9131 (see
9132 .Va mime-encoding )
9133 that is required to send this part over mail transport, i.e.,
9134 a computation rather similar to what the
9135 .Xr file 1
9136 command produces when used with the
9137 .Ql --mime
9138 option.
9140 This classification however treats text files which are encoded in
9141 UTF-16 (seen for HTML files) and similar character sets as binary
9142 octet-streams, forcefully changing any
9143 .Ql text/plain
9145 .Ql text/html
9146 specification to
9147 .Ql application/octet-stream :
9148 If that actually happens a yet unset charset MIME parameter is set to
9149 .Ql binary ,
9150 effectively making it impossible for the receiving MUA to automatically
9151 interpret the contents of the part.
9153 If this variable is set, and the data was unambiguously identified as
9154 text data at first glance (by a
9155 .Ql .txt
9157 .Ql .html
9158 file extension), then the original
9159 .Ql Content-Type:
9160 will not be overwritten.
9163 .It Va mime-alternative-favour-rich
9164 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
9165 HTML) will be preferred in favour of included plain text versions when
9166 displaying messages, provided that a handler exists which produces
9167 output that can be (re)integrated into \*(UA's normal visual display.
9168 (E.g., at the time of this writing some newsletters ship their full
9169 content only in the rich HTML part, whereas the plain text part only
9170 contains topic subjects.)
9173 .It Va mime-counter-evidence
9174 Normally the
9175 .Ql Content-Type:
9176 field is used to decide how to handle MIME parts.
9177 Some MUAs, however, do not use
9178 .Sx "The mime.types files"
9179 (also see
9180 .Sx "HTML mail and MIME attachments" )
9181 or a similar mechanism to correctly classify content, but specify an
9182 unspecific MIME type
9183 .Pf ( Ql application/octet-stream )
9184 even for plain text attachments.
9185 If this variable is set then \*(UA will try to re-classify such MIME
9186 message parts, if possible, for example via a possibly existing
9187 attachment filename.
9188 A non-empty value may also be given, in which case a number is expected,
9189 actually a carrier of bits.
9190 Creating the bit-carrying number is a simple addition:
9191 .Bd -literal -offset indent
9192 ? !echo Value should be set to $((2 + 4 + 8))
9193 Value should be set to 14
9196 .Bl -bullet -compact
9198 If bit two is set (2) then the detected
9199 .Ic mimetype
9200 will be carried along with the message and be used for deciding which
9201 MIME handler is to be used, for example;
9202 when displaying such a MIME part the part-info will indicate the
9203 overridden content-type by showing a plus sign
9204 .Ql + .
9206 If bit three is set (4) then the counter-evidence is always produced
9207 and a positive result will be used as the MIME type, even forcefully
9208 overriding the parts given MIME type.
9210 If bit four is set (8) then as a last resort the actual content of
9211 .Ql application/octet-stream
9212 parts will be inspected, so that data which looks like plain text can be
9213 treated as such.
9217 .It Va mime-encoding
9218 The MIME
9219 .Ql Content-Transfer-Encoding
9220 to use in outgoing text messages and message parts, where applicable.
9221 (7-bit clean text messages are sent as-is, without a transfer encoding.)
9222 Valid values are:
9224 .Bl -tag -compact -width ".It Ql _%%_"
9225 .It Ql 8bit
9226 .Pf (Or\0 Ql 8b . )
9227 8-bit transport effectively causes the raw data be passed through
9228 unchanged, but may cause problems when transferring mail messages over
9229 channels that are not ESMTP (RFC 1869) compliant.
9230 Also, several input data constructs are not allowed by the
9231 specifications and may cause a different transfer-encoding to be used.
9232 .It Ql quoted-printable
9233 .Pf (Or\0 Ql qp . )
9234 Quoted-printable encoding is 7-bit clean and has the property that ASCII
9235 characters are passed through unchanged, so that an english message can
9236 be read as-is; it is also acceptible for other single-byte locales that
9237 share many characters with ASCII, like, e.g., ISO-8859-1.
9238 The encoding will cause a large overhead for messages in other character
9239 sets: e.g., it will require up to twelve (12) bytes to encode a single
9240 UTF-8 character of four (4) bytes.
9241 .It Ql base64
9242 .Pf (Or\0 Ql b64 . )
9243 The default encoding, it is 7-bit clean and will always be used for
9244 binary data.
9245 This encoding has a constant input:output ratio of 3:4, regardless of
9246 the character set of the input data it will encode three bytes of input
9247 to four bytes of output.
9248 This transfer-encoding is not human readable without performing
9249 a decoding step.
9253 .It Va mimetypes-load-control
9254 Can be used to control which of
9255 .Sx "The mime.types files"
9256 are loaded: if the letter
9257 .Ql u
9258 is part of the option value, then the user's personal
9259 .Pa ~/.mime.types
9260 file will be loaded (if it exists); likewise the letter
9261 .Ql s
9262 controls loading of the system wide
9263 .Pa /etc/mime.types ;
9264 directives found in the user file take precedence, letter matching is
9265 case-insensitive.
9266 If this variable is not set \*(UA will try to load both files.
9267 Incorporation of the \*(UA-built-in MIME types cannot be suppressed,
9268 but they will be matched last (the order can be listed via
9269 .Ic mimetype ) .
9271 More sources can be specified by using a different syntax: if the
9272 value string contains an equals sign
9273 .Ql =
9274 then it is instead parsed as a comma-separated list of the described
9275 letters plus
9276 .Ql f=FILENAME
9277 pairs; the given filenames will be expanded and loaded, and their
9278 content may use the extended syntax that is described in the section
9279 .Sx "The mime.types files" .
9280 Directives found in such files always take precedence (are prepended to
9281 the MIME type cache).
9285 .It Va mta
9286 To choose an alternate Mail-Transfer-Agent, set this option to either
9287 the full pathname of an executable (optionally prefixed with a
9288 .Ql file://
9289 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
9291 .Dl smtps?://[user[:password]@]server[:port]
9293 (\*(OU:
9294 .Ql [smtp://]server[:port] . )
9295 The default has been chosen at compile time.
9296 All supported data transfers are executed in child processes, which
9297 run asynchronously and without supervision unless either the
9298 .Va sendwait
9299 or the
9300 .Va verbose
9301 variable is set.
9302 If such a child receives a TERM signal, it will abort and
9303 .Va save
9304 the message to
9305 .Ev DEAD ,
9306 if so configured.
9309 For a file-based MTA it may be necessary to set
9310 .Va mta-argv0
9311 in in order to choose the right target of a modern
9312 .Xr mailwrapper 8
9313 environment.
9314 It will be passed command line arguments from several possible sources:
9315 from the variable
9316 .Va mta-arguments
9317 if set, from the command line if given and the variable
9318 .Va expandargv
9319 allows their use.
9320 Argument processing of the MTA will be terminated with a
9321 .Fl \&\&-
9322 separator.
9325 The otherwise occurring implicit usage of the following MTA command
9326 line arguments can be disabled by setting the boolean variable
9327 .Va mta-no-default-arguments
9328 (which will also disable passing
9329 .Fl \&\&-
9330 to the MTA):
9331 .Fl \&\&i
9332 (for not treating a line with only a dot
9333 .Ql \&.
9334 character as the end of input),
9335 .Fl \&\&m
9336 (shall the variable
9337 .Va metoo
9338 be set) and
9339 .Fl \&\&v
9340 (if the
9341 .Va verbose
9342 variable is set); in conjunction with the
9343 .Fl r
9344 command line option \*(UA will also (not) pass
9345 .Fl \&\&f
9346 as well as possibly
9347 .Fl \&\&F .
9350 \*(OPally \*(UA can send mail over SMTP network connections to a single
9351 defined SMTP smart host by specifying a SMTP URL as the value (see
9352 .Sx "On URL syntax and credential lookup" ) .
9353 Note that with some mail providers it may be necessary to set the
9354 .Va smtp-hostname
9355 variable in order to use a specific combination of
9356 .Va from ,
9357 .Va hostname
9359 .Va mta .
9360 \*(UA also supports forwarding of all network traffic over a specified
9361 .Va socks-proxy .
9362 The following SMTP variants may be used:
9364 .Bl -bullet
9366 The plain SMTP protocol (RFC 5321) that normally lives on the
9367 server port 25 and requires setting the
9368 .Va smtp-use-starttls
9369 variable to enter a SSL/TLS encrypted session state.
9370 Assign a value like \*(IN
9371 .Ql smtp://[user[:password]@]server[:port]
9372 (\*(OU
9373 .Ql smtp://server[:port] )
9374 to choose this protocol.
9376 The so-called SMTPS which is supposed to live on server port 465
9377 and is automatically SSL/TLS secured.
9378 Unfortunately it never became a standardized protocol and may thus not
9379 be supported by your hosts network service database
9380 \(en in fact the port number has already been reassigned to other
9381 protocols!
9383 SMTPS is nonetheless a commonly offered protocol and thus can be
9384 chosen by assigning a value like \*(IN
9385 .Ql smtps://[user[:password]@]server[:port]
9386 (\*(OU
9387 .Ql smtps://server[:port] ) ;
9388 due to the mentioned problems it is usually necessary to explicitly
9389 specify the port as
9390 .Ql :465 ,
9391 however.
9393 Finally there is the SUBMISSION protocol (RFC 6409), which usually
9394 lives on server port 587 and is practically identically to the SMTP
9395 protocol from \*(UA's point of view beside that; it requires setting the
9396 .Va smtp-use-starttls
9397 variable to enter a SSL/TLS secured session state.
9398 Assign a value like \*(IN
9399 .Ql submission://[user[:password]@]server[:port]
9400 (\*(OU
9401 .Ql submission://server[:port] ) .
9406 .It Va mta-arguments
9407 Arguments to pass through to a file-based
9408 .Va mta
9409 can be given via this variable, which is parsed according to
9410 .Sx "Shell-style argument quoting"
9411 into an array of arguments, and which will be joined onto MTA options
9412 from other sources, and then passed individually to the MTA:
9413 .Ql ? wysh set mta-arguments='-t -X \&"/tmp/my log\&"' .
9416 .It Va mta-no-default-arguments
9417 \*(BO Unless this variable is set \*(UA will pass some well known
9418 standard command line options to a file-based
9419 .Va mta
9420 (Mail-Transfer-Agent), see there for more.
9423 .It Va mta-argv0
9424 Many systems use a so-called
9425 .Xr mailwrapper 8
9426 environment to ensure compatibility with
9427 .Xr sendmail 1 .
9428 This works by inspecting the name that was used to invoke the mail
9429 delivery system.
9430 If this variable is set then the mailwrapper (the program that is
9431 actually executed when calling the file-based
9432 .Va mta )
9433 will treat its contents as that name.
9435 .Mx Va netrc-lookup
9436 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
9437 \*(BO\*(IN\*(OP Used to control usage of the users
9438 .Pa .netrc
9439 file for lookup of account credentials, as documented in the section
9440 .Sx "On URL syntax and credential lookup"
9441 and for the command
9442 .Ic netrc ;
9443 the section
9444 .Sx "The .netrc file"
9445 documents the file format.
9446 Also see
9447 .Va netrc-pipe .
9450 .It Va netrc-pipe
9451 \*(IN\*(OP When
9452 .Pa .netrc
9453 is loaded (see
9454 .Ic netrc
9456 .Va netrc-lookup )
9457 then \*(UA will read the output of a shell pipe instead of the users
9458 .Pa .netrc
9459 file if this variable is set (to the desired shell command).
9460 This can be used to, e.g., store
9461 .Pa .netrc
9462 in encrypted form:
9463 .Ql ? set netrc-pipe='gpg -qd ~/.netrc.pgp' .
9466 .It Va newfolders
9467 If this variable has the value
9468 .Ql maildir ,
9469 newly created local folders will be in Maildir instead of MBOX format.
9472 .It Va newmail
9473 Checks for new mail in the current folder each time the prompt is shown.
9474 A Maildir folder must be re-scanned to determine if new mail has arrived.
9475 If this variable is set to the special value
9476 .Ql nopoll
9477 then a Maildir folder will not be rescanned completely, but only
9478 timestamp changes are detected.
9481 .It Va outfolder
9482 \*(BO Causes the filename given in the
9483 .Va record
9484 variable
9485 and the sender-based filenames for the
9486 .Ic Copy
9488 .Ic Save
9489 commands to be interpreted relative to the directory given in the
9490 .Va folder
9491 variable rather than to the current directory,
9492 unless it is set to an absolute pathname.
9495 .It Va on-compose-cleanup
9496 Macro hook which will be called after the message has been sent (or not,
9497 in case of failures), as the very last step before unrolling compose mode
9498 .Ic localopts .
9499 This hook is run even in case of fatal errors, and it is advisable to
9500 perform only absolutely necessary actions, like cleaning up
9501 .Ic alternates ,
9502 for example.
9503 For compose mode hooks that may affect the message content please see
9504 .Va on-compose-enter , on-compose-leave , on-compose-splice .
9505 \*(ID This hook exists only because
9506 .Ic alias , alternates , commandalias , shortcut ,
9507 to name a few, are currently not covered by
9508 .Ic localopts
9509 or a similar mechanism: any changes applied in compose mode will
9510 continue to be in effect thereafter.
9514 .It Va on-compose-enter , on-compose-leave
9515 Macro hooks which will be called before compose mode is entered,
9516 and after composing has been finished (but before the
9517 .Va signature
9518 is injected, etc.), respectively.
9519 .Ic localopts
9520 are enabled for these hooks, causing any setting to be forgotten after
9521 the message has been sent;
9522 .Va on-compose-cleanup
9523 can be used to perform any other necessary cleanup.
9524 The following (read-only) variables will be set temporarily during
9525 execution of the macros to represent the according message headers, or
9526 the empty string for non-existent; they correspond to accoding virtual
9527 temporary message headers that can be accessed via
9528 .Ic ~^ ,
9529 one of the
9530 .Sx "COMMAND ESCAPES" :
9532 .Bl -tag -compact -width ".It Va mailx_subject"
9533 .It Va mailx-command
9534 The command that generates the message.
9535 .It Va mailx-subject
9536 The subject.
9537 .It Va mailx-from
9538 .Va from .
9539 .It Va mailx-sender
9540 .Va sender .
9541 .It Va mailx-to , mailx-cc , mailx-bcc
9542 The list of receiver addresses as a space-separated list.
9543 .It Va mailx-raw-to , mailx-raw-cc , mailx-raw-bcc
9544 The list of receiver addresses before any mangling (due to, e.g.,
9545 .Ic alternates ,
9546 .Ic alias
9547 .Va recipients-in-cc )
9548 as a space-separated list.
9549 .It Va mailx-orig-from
9550 When replying, forwarding or resending, this will be set to the
9551 .Ql From:
9552 of the given message.
9553 .It Va mailx-orig-to , mailx-orig-cc , mailx-orig-bcc
9554 When replying, forwarding or resending, this will be set to the
9555 receivers of the given message.
9561 .It Va on-compose-splice , on-compose-splice-shell
9562 These hooks run once the normal compose mode is finished, but before the
9563 .Va on-compose-leave
9564 macro hook is called, the
9565 .Va signature
9566 is injected etc.
9567 Both hooks will be executed in a subprocess, with their input and output
9568 connected to \*(UA such that they can act as if they would be an
9569 interactive user.
9570 The difference in between them is that the latter is a
9571 .Ev SHELL
9572 command, whereas the former is a normal \*(UA macro, but which is
9573 restricted to a small set of commands (the
9574 .Va verbose
9575 output of, e.g.,
9576 .Ic list
9577 will indicate said capability).
9578 .Ic localopts
9579 are enabled for these hooks (in the parent process), causing any setting
9580 to be forgotten after the message has been sent;
9581 .Va on-compose-cleanup
9582 can be used to perform other cleanup as necessary.
9585 During execution of these hooks \*(UA will temporarily forget whether it
9586 has been started in interactive mode, (a restricted set of)
9587 .Sx "COMMAND ESCAPES"
9588 will always be available, and for guaranteed reproducibilities sake
9589 .Va escape
9591 .Va ifs
9592 will be set to their defaults.
9593 The compose mode command
9594 .Ic ~^
9595 has been especially designed for scriptability (via these hooks).
9596 The first line the hook will read on its standard input is the protocol
9597 version of said command escape, currently
9598 .Dq 0 0 1 :
9599 backward incompatible protocol changes have to be expected.
9602 Care must be taken to avoid deadlocks and other false control flow:
9603 if both involved processes wait for more input to happen at the
9604 same time, or one does not expect more input but the other is stuck
9605 waiting for consumption of its output, etc.
9606 There is no automatic synchronization of the hook: it will not be
9607 stopped automatically just because it, e.g., emits
9608 .Ql ~x .
9609 The hooks will however receive a termination signal if the parent enters
9610 an error condition.
9611 \*(ID Protection against and interaction with signals is not yet given;
9612 it is likely that in the future these scripts will be placed in an
9613 isolated session, which is signalled in its entirety as necessary.
9615 .Bd -literal -offset indent
9616 wysh set on-compose-splice-shell=$'\e
9617   read version;\e
9618   printf "hello $version!  Headers: ";\e
9619   echo \e'~^header list\e';\e
9620   read status result;\e
9621   echo "status=$status result=$result";\e
9622   '
9624 set on-compose-splice=ocsm
9625 define ocsm {
9626   read ver
9627   echo Splice protocol version is $ver
9628   echo '~^h l'; read hl; vput vexpr es substring "${hl}" 0 1
9629   if [ "$es" != 2 ]
9630     echoerr 'Cannot read header list'; echo '~x'; xit
9631   endif
9632   if [ "$hl" @i!% ' cc' ]
9633     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
9634       vput vexpr es substring "${es}" 0 1
9635     if [ "$es" != 2 ]
9636       echoerr 'Cannot insert Cc: header'; echo '~x'
9637     endif
9638   endif
9644 .It Va on-resend-cleanup
9645 \*(ID Identical to
9646 .Va on-compose-cleanup ,
9647 but is only triggered by
9648 .Ic resend .
9651 .It Va on-resend-enter
9652 \*(ID Identical to
9653 .Va on-compose-enter ,
9654 but is only triggered by
9655 .Ic resend .
9658 .It Va page
9659 \*(BO If set, each message feed through the command given for
9660 .Ic pipe
9661 is followed by a formfeed character
9662 .Ql \ef .
9664 .Mx Va password
9665 .It Va password-USER@HOST , password-HOST , password
9666 \*(IN Variable chain that sets a password, which is used in case none has
9667 been given in the protocol and account-specific URL;
9668 as a last resort \*(UA will ask for a password on the user's terminal if
9669 the authentication method requires a password.
9670 Specifying passwords in a startup file is generally a security risk;
9671 the file should be readable by the invoking user only.
9673 .It Va password-USER@HOST
9674 \*(OU (see the chain above for \*(IN)
9675 Set the password for
9676 .Ql USER
9677 when connecting to
9678 .Ql HOST .
9679 If no such variable is defined for a host,
9680 the user will be asked for a password on standard input.
9681 Specifying passwords in a startup file is generally a security risk;
9682 the file should be readable by the invoking user only.
9685 .It Va piperaw
9686 \*(BO Send messages to the
9687 .Ic pipe
9688 command without performing MIME and character set conversions.
9692 .It Va pipe-TYPE/SUBTYPE
9693 When a MIME message part of type
9694 .Ql TYPE/SUBTYPE
9695 (case-insensitive) is displayed or quoted,
9696 its text is filtered through the value of this variable interpreted as
9697 a shell command.
9698 Note that only parts which can be displayed inline as plain text (see
9699 .Cd copiousoutput )
9700 are displayed unless otherwise noted, other MIME parts will only be
9701 considered by and for the command
9702 .Ic mimeview .
9705 The special value commercial at
9706 .Ql @
9707 forces interpretation of the message part as plain text, e.g.,
9708 .Ql set pipe-application/xml=@
9709 will henceforth display XML
9710 .Dq as is .
9711 (The same could also be achieved by adding a MIME type marker with the
9712 .Ic mimetype
9713 command.
9714 And \*(OPally MIME type handlers may be defined via
9715 .Sx "The Mailcap files"
9716 \(em these directives,
9717 .Cd copiousoutput
9718 has already been used, should be referred to for further documentation.
9721 The commercial at
9722 .Ql @
9723 can in fact be used as a trigger character to adjust usage and behaviour
9724 of a following shell command specification more thoroughly by appending
9725 more special characters which refer to further mailcap directives, e.g.,
9726 the following hypothetical command specification could be used:
9728 .Bd -literal -offset indent
9729 ? set pipe-X/Y='@!++=@vim ${MAILX_FILENAME_TEMPORARY}'
9733 .Bl -tag -compact -width ".It Ql __"
9734 .It Ql *
9735 The command produces plain text to be integrated in \*(UAs output:
9736 .Cd copiousoutput .
9738 .It Ql #
9739 If set the handler will not be invoked when a message is to be quoted,
9740 but only when it will be displayed:
9741 .Cd x-mailx-noquote .
9743 .It Ql &
9744 Run the command asynchronously, i.e., without blocking \*(UA:
9745 .Cd x-mailx-async .
9747 .It Ql \&!
9748 The command must be run on an interactive terminal, \*(UA will
9749 temporarily release the terminal to it:
9750 .Cd needsterminal .
9752 .It Ql +
9753 Request creation of a zero-sized temporary file, the absolute pathname
9754 of which will be made accessible via the environment variable
9755 .Ev MAILX_FILENAME_TEMPORARY :
9756 .Cd x-mailx-tmpfile .
9757 If given twice then the file will be unlinked automatically by \*(UA
9758 when the command loop is entered again at latest:
9759 .Cd x-mailx-tmpfile-unlink .
9761 .It Ql =
9762 Normally the MIME part content is passed to the handler via standard
9763 input; if this flag is set then the data will instead be written into
9764 .Ev MAILX_FILENAME_TEMPORARY
9765 .Pf ( Cd x-mailx-tmpfile-fill ) ,
9766 the creation of which is implied; note however that in order to cause
9767 deletion of the temporary file you still have to use two plus signs
9768 .Ql ++
9769 explicitly!
9771 .It Ql @
9772 To avoid ambiguities with normal shell command content you can use
9773 another commercial at to forcefully terminate interpretation of
9774 remaining characters.
9775 (Any character not in this list will have the same effect.)
9779 Some information about the MIME part to be displayed is embedded into
9780 the environment of the shell command:
9783 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
9785 .It Ev MAILX_CONTENT
9786 The MIME content-type of the part, if known, the empty string otherwise.
9789 .It Ev MAILX_CONTENT_EVIDENCE
9791 .Va mime-counter-evidence
9792 includes the carry-around-bit (2), then this will be set to the detected
9793 MIME content-type; not only then identical to
9794 .Ev \&\&MAILX_CONTENT
9795 otherwise.
9798 .It Ev MAILX_FILENAME
9799 The filename, if any is set, the empty string otherwise.
9802 .It Ev MAILX_FILENAME_GENERATED
9803 A random string.
9806 .It Ev MAILX_FILENAME_TEMPORARY
9807 If temporary file creation has been requested through the command prefix
9808 this variable will be set and contain the absolute pathname of the
9809 temporary file.
9814 .It Va pipe-EXTENSION
9815 This is identical to
9816 .Va pipe-TYPE/SUBTYPE
9817 except that
9818 .Ql EXTENSION
9819 (normalized to lowercase using character mappings of the ASCII charset)
9820 names a file extension, e.g.,
9821 .Ql xhtml .
9822 Handlers registered using this method take precedence.
9824 .Mx Va pop3-auth
9825 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
9826 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
9827 The only possible value as of now is
9828 .Ql plain ,
9829 which is thus the default.
9832 .Mx Va pop3-bulk-load
9833 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
9834 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
9835 the messages, and only requests the message bodies on user request.
9836 For the POP3 protocol this means that the message headers will be
9837 downloaded twice.
9838 If this variable is set then \*(UA will download only complete messages
9839 from the given POP3 server(s) instead.
9841 .Mx Va pop3-keepalive
9842 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
9843 \*(OP POP3 servers close the connection after a period of inactivity;
9844 the standard requires this to be at least 10 minutes,
9845 but practical experience may vary.
9846 Setting this variable to a numeric value greater than
9847 .Ql 0
9848 causes a
9849 .Ql NOOP
9850 command to be sent each value seconds if no other operation is performed.
9852 .Mx Va pop3-no-apop
9853 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
9854 \*(BO\*(OP Unless this variable is set the
9855 .Ql APOP
9856 authentication method will be used when connecting to a POP3 server that
9857 advertises support.
9858 The advantage of
9859 .Ql APOP
9860 is that the password is not sent in clear text over the wire and that
9861 only a single packet is sent for the user/password tuple.
9862 Note that
9863 .Va pop3-no-apop-HOST
9864 requires \*(IN.
9866 .Mx Va pop3-use-starttls
9867 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
9868 \*(BO\*(OP Causes \*(UA to issue a
9869 .Ql STLS
9870 command to make an unencrypted POP3 session SSL/TLS encrypted.
9871 This functionality is not supported by all servers,
9872 and is not used if the session is already encrypted by the POP3S method.
9873 Note that
9874 .Va pop3-use-starttls-HOST
9875 requires \*(IN.
9879 .It Va posix
9880 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
9881 where that deviates from standardized behaviour.
9882 It will be set implicitly before the
9883 .Sx "Resource files"
9884 are loaded if the environment variable
9885 .Ev POSIXLY_CORRECT
9886 is set, and adjusting any of those two will be reflected by the other
9887 one implicitly.
9888 The following behaviour is covered and enforced by this mechanism:
9891 .Bl -bullet -compact
9893 In non-interactive mode, any error encountered while loading resource
9894 files during program startup will cause a program exit, whereas in
9895 interactive mode such errors will stop loading of the currently loaded
9896 (stack of) file(s, i.e., recursively).
9897 These exits can be circumvented on a per-command base by using
9898 .Cm ignerr ,
9899 one of the
9900 .Sx "Command modifiers" ,
9901 for each command which shall be allowed to fail.
9904 .Ic alternates
9905 will replace the list of alternate addresses instead of appending to it.
9908 Upon changing the active
9909 .Ic file
9910 no summary of
9911 .Ic headers
9912 will be displayed even if
9913 .Va header
9914 is set.
9917 Setting
9918 .Va ignoreeof
9919 implies the behaviour described by
9920 .Va dot .
9923 The variable
9924 .Va keep
9925 is extended to cover any empty mailbox, not only empty
9926 .Mx -sx
9927 .Sx "primary system mailbox" Ns
9928 es: they will be removed when they are left in empty state otherwise.
9933 .It Va print-alternatives
9934 \*(BO When a MIME message part of type
9935 .Ql multipart/alternative
9936 is displayed and it contains a subpart of type
9937 .Ql text/plain ,
9938 other parts are normally discarded.
9939 Setting this variable causes all subparts to be displayed,
9940 just as if the surrounding part was of type
9941 .Ql multipart/mixed .
9944 .It Va prompt
9945 The string used as a prompt in interactive mode.
9946 Whenever the variable is evaluated the value is expanded as via
9947 dollar-single-quote expansion (see
9948 .Sx "Shell-style argument quoting" ) .
9949 This (post-assignment, i.e., second) expansion can be used to embed
9950 status information, for example
9951 .Va \&? ,
9952 .Va \&! ,
9953 .Va account
9955 .Va mailbox-display .
9957 In order to embed characters which should not be counted when
9958 calculating the visual width of the resulting string, enclose the
9959 characters of interest in a pair of reverse solidus escaped brackets:
9960 .Ql \e[\eE[0m\e] ;
9961 a slot for coloured prompts is also available with the \*(OPal command
9962 .Ic colour .
9963 Prompting may be prevented by setting this to the null string
9964 (a.k.a.\|
9965 .Ql set noprompt ) .
9968 .It Va prompt2
9969 This string is used for secondary prompts, but is otherwise identical to
9970 .Va prompt .
9971 The default is
9972 .Ql ..\0 .
9975 .It Va quiet
9976 \*(BO Suppresses the printing of the version when first invoked.
9979 .It Va quote
9980 If set, \*(UA starts a replying message with the original message
9981 prefixed by the value of the variable
9982 .Va indentprefix .
9983 Normally, a heading consisting of
9984 .Dq Fromheaderfield wrote:
9985 is put before the quotation.
9986 If the string
9987 .Ql noheading
9988 is assigned to the
9989 .Va \&\&quote
9990 variable, this heading is omitted.
9991 If the string
9992 .Ql headers
9993 is assigned, only the headers selected by the
9994 .Ql type
9995 .Ic headerpick
9996 selection are put above the message body,
9997 thus
9998 .Va \&\&quote
9999 acts like an automatic
10000 .Pf ` Ic ~m Ns '
10001 .Sx "COMMAND ESCAPES"
10002 command, then.
10003 If the string
10004 .Ql allheaders
10005 is assigned, all headers are put above the message body and all MIME
10006 parts are included, making
10007 .Va \&\&quote
10008 act like an automatic
10009 .Pf ` Ic ~M Ns '
10010 command; also see
10011 .Va quote-as-attachment .
10014 .It Va quote-as-attachment
10015 \*(BO Add the original message in its entirety as a
10016 .Ql message/rfc822
10017 MIME attachment when replying to a message.
10018 Note this works regardless of the setting of
10019 .Va quote .
10022 .It Va quote-fold
10023 \*(OP Can be set in addition to
10024 .Va indentprefix .
10025 Setting this turns on a more fancy quotation algorithm in that leading
10026 quotation characters are compressed and overlong lines are folded.
10027 .Va \&\&quote-fold
10028 can be set to either one or two (space separated) numeric values,
10029 which are interpreted as the maximum (goal) and the minimum line length,
10030 respectively, in a spirit rather equal to the
10031 .Xr fmt 1
10032 program, but line-, not paragraph-based.
10033 If not set explicitly the minimum will reflect the goal algorithmically.
10034 The goal cannot be smaller than the length of
10035 .Va indentprefix
10036 plus some additional pad.
10037 Necessary adjustments take place silently.
10040 .It Va r-option-implicit
10041 \*(BO Setting this option evaluates the contents of
10042 .Va from
10043 (or, if that contains multiple addresses,
10044 .Va sender )
10045 and passes the results onto the used (file-based) MTA as described for the
10046 .Fl r
10047 option (empty argument case).
10050 .It Va recipients-in-cc
10051 \*(BO When doing a
10052 .Ic reply ,
10053 the original
10054 .Ql From:
10056 .Ql To:
10057 are by default merged into the new
10058 .Ql To: .
10059 If this variable is set, only the original
10060 .Ql From:
10061 ends in the new
10062 .Ql To: ,
10063 the rest is merged into
10064 .Ql Cc: .
10067 .It Va record
10068 Unless this variable is defined, no copies of outgoing mail will be saved.
10069 If defined it gives the pathname, subject to the usual
10070 .Sx "Filename transformations" ,
10071 of a folder where all new, replied-to or forwarded messages are saved:
10072 when saving to this folder fails the message is not sent, but instead
10073 .Va save Ns
10074 d to
10075 .Ev DEAD .
10076 The standard defines that relative (fully expanded) paths are to be
10077 interpreted relative to the current directory
10078 .Pf ( Ic cwd ) ,
10079 to force interpretation relative to
10080 .Va folder
10081 .Va outfolder
10082 needs to be set in addition.
10085 .It Va record-files
10086 \*(BO If this variable is set the meaning of
10087 .Va record
10088 will be extended to cover messages which target only file and pipe
10089 recipients (see
10090 .Va expandaddr ) .
10091 These address types will not appear in recipient lists unless
10092 .Va add-file-recipients
10093 is also set.
10096 .It Va record-resent
10097 \*(BO If this variable is set the meaning of
10098 .Va record
10099 will be extended to also cover the
10100 .Ic resend
10102 .Ic Resend
10103 commands.
10106 .It Va reply-in-same-charset
10107 \*(BO If this variable is set \*(UA first tries to use the same
10108 character set of the original message for replies.
10109 If this fails, the mechanism described in
10110 .Sx "Character sets"
10111 is evaluated as usual.
10114 .It Va reply-strings
10115 Can be set to a comma-separated list of (case-insensitive according to
10116 ASCII rules) strings which shall be recognized in addition to the
10117 built-in strings as
10118 .Ql Subject:
10119 reply message indicators \(en built-in are
10120 .Ql Re: ,
10121 which is mandated by RFC 5322, as well as the german
10122 .Ql Aw: ,
10123 .Ql Antw: ,
10124 and the
10125 .Ql Wg:
10126 which often has been seen in the wild;
10127 I.e., the separating colon has to be specified explicitly.
10130 .It Va reply-to
10131 A list of addresses to put into the
10132 .Ql Reply-To:
10133 field of the message header.
10134 Members of this list are handled as if they were in the
10135 .Ic alternates
10136 list.
10138 .It Va replyto
10139 \*(OB Variant of
10140 .Va reply-to .
10143 .It Va reply-to-honour
10144 Controls whether a
10145 .Ql Reply-To:
10146 header is honoured when replying to a message via
10147 .Ic reply
10149 .Ic Lreply .
10150 This is a quadoption; if set without a value it defaults to
10151 .Dq yes .
10154 .It Va rfc822-body-from_
10155 \*(BO This variable can be used to force displaying a so-called
10156 .Ql From_
10157 line for messages that are embedded into an envelope mail via the
10158 .Ql message/rfc822
10159 MIME mechanism, for more visual convenience.
10162 .It Va save
10163 \*(BO Enable saving of (partial) messages in
10164 .Ev DEAD
10165 upon interrupt or delivery error.
10168 .It Va screen
10169 The number of lines that represents a
10170 .Dq screenful
10171 of lines, used in
10172 .Ic headers
10173 summary display,
10174 .Ic from
10175 .Ic search Ns
10176 ing, message
10177 .Ic top Ns
10178 line display and scrolling via
10179 .Ic z .
10180 If this variable is not set \*(UA falls back to a calculation based upon
10181 the detected terminal window size and the baud rate: the faster the
10182 terminal, the more will be shown.
10183 Overall screen dimensions and pager usage is influenced by the
10184 environment variables
10185 .Ev COLUMNS
10187 .Ev LINES
10188 and the variable
10189 .Va crt .
10192 .It Va searchheaders
10193 \*(BO Expand message-list specifiers in the form
10194 .Ql /x:y
10195 to all messages containing the substring
10196 .Dq y
10197 in the header field
10198 .Ql x .
10199 The string search is case insensitive.
10202 .It Va sendcharsets
10203 \*(OP A comma-separated list of character set names that can be used in
10204 outgoing internet mail.
10205 The value of the variable
10206 .Va charset-8bit
10207 is automatically appended to this list of character sets.
10208 If no character set conversion capabilities are compiled into \*(UA then
10209 the only supported charset is
10210 .Va ttycharset .
10211 Also see
10212 .Va sendcharsets-else-ttycharset
10213 and refer to the section
10214 .Sx "Character sets"
10215 for the complete picture of character set conversion in \*(UA.
10218 .It Va sendcharsets-else-ttycharset
10219 \*(BO\*(OP If this variable is set, but
10220 .Va sendcharsets
10221 is not, then \*(UA acts as if
10222 .Va sendcharsets
10223 had been set to the value of the variable
10224 .Va ttycharset .
10225 In effect this combination passes through the message data in the
10226 character set of the current locale encoding:
10227 therefore mail message text will be (assumed to be) in ISO-8859-1
10228 encoding when send from within a ISO-8859-1 locale, and in UTF-8
10229 encoding when send from within an UTF-8 locale.
10231 The 8-bit fallback
10232 .Va charset-8bit
10233 never comes into play as
10234 .Va ttycharset
10235 is implicitly assumed to be 8-bit and capable to represent all files the
10236 user may specify (as is the case when no character set conversion
10237 support is available in \*(UA and the only supported character set is
10238 .Va ttycharset :
10239 .Sx "Character sets" ) .
10240 This might be a problem for scripts which use the suggested
10241 .Ql LC_ALL=C
10242 setting, since in this case the character set is US-ASCII by definition,
10243 so that it is better to also override
10244 .Va ttycharset ,
10245 then.
10248 .It Va sender
10249 An address that is put into the
10250 .Ql Sender:
10251 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
10252 responsible for the actual transmission of the message.
10253 This field should normally not be used unless the
10254 .Va from
10255 field contains more than one address, on which case it is required.
10257 .Va \&\&sender
10258 address is handled as if it were in the
10259 .Ic alternates
10260 list; also see
10261 .Fl r ,
10262 .Va r-option-implicit .
10264 .It Va sendmail
10265 \*(OB Predecessor of
10266 .Va mta .
10268 .It Va sendmail-arguments
10269 \*(OB Predecessor of
10270 .Va mta-arguments .
10272 .It Va sendmail-no-default-arguments
10273 \*(OB\*(BO Predecessor of
10274 .Va mta-no-default-arguments .
10276 .It Va sendmail-progname
10277 \*(OB Predecessor of
10278 .Va mta-argv0 .
10281 .It Va sendwait
10282 \*(BO When sending a message wait until the
10283 .Va mta
10284 (including the built-in SMTP one) exits before accepting further commands.
10285 .Sy Only
10286 with this variable set errors reported by the MTA will be recognizable!
10287 If the MTA returns a non-zero exit status,
10288 the exit status of \*(UA will also be non-zero.
10291 .It Va showlast
10292 \*(BO This setting causes \*(UA to start at the last message
10293 instead of the first one when opening a mail folder.
10296 .It Va showname
10297 \*(BO Causes \*(UA to use the sender's real name instead of the plain
10298 address in the header field summary and in message specifications.
10301 .It Va showto
10302 \*(BO Causes the recipient of the message to be shown in the header
10303 summary if the message was sent by the user.
10306 .It Va Sign
10307 The string to expand
10308 .Ic ~A
10309 to (see
10310 .Sx "COMMAND ESCAPES" ) .
10313 .It Va sign
10314 The string to expand
10315 .Ic ~a
10316 to (see
10317 .Sx "COMMAND ESCAPES" ) .
10320 .It Va signature
10321 Must correspond to the name of a readable file if set.
10322 The file's content is then appended to each singlepart message
10323 and to the first part of each multipart message.
10324 Be warned that there is no possibility to edit the signature for an
10325 individual message.
10328 .It Va skipemptybody
10329 \*(BO If an outgoing message does not contain any text in its first or
10330 only message part, do not send it but discard it silently (see also the
10331 command line option
10332 .Fl E ) .
10336 .It Va smime-ca-dir , smime-ca-file
10337 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10338 Enhanced Mail) format as a directory and a file, respectively, for the
10339 purpose of verification of S/MIME signed messages.
10340 It is possible to set both, the file will be loaded immediately, the
10341 directory will be searched whenever no match has yet been found.
10342 The set of CA certificates which are built into the SSL/TLS library can
10343 be explicitly turned off by setting
10344 .Va smime-ca-no-defaults ,
10345 and further fine-tuning is possible via
10346 .Va smime-ca-flags .
10349 .It Va smime-ca-flags
10350 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10351 storage, and the certificate verification that is used.
10352 The actual values and their meanings are documented for
10353 .Va ssl-ca-flags .
10356 .It Va smime-ca-no-defaults
10357 \*(BO\*(OP Do not load the default CA locations that are built into the
10358 used to SSL/TLS library to verify S/MIME signed messages.
10360 .Mx Va smime-cipher
10361 .It Va smime-cipher-USER@HOST , smime-cipher
10362 \*(OP Specifies the cipher to use when generating S/MIME encrypted
10363 messages (for the specified account).
10364 RFC 5751 mandates a default of
10365 .Ql aes128
10366 (AES-128 CBC).
10367 Possible values are (case-insensitive and) in decreasing cipher strength:
10368 .Ql aes256
10369 (AES-256 CBC),
10370 .Ql aes192
10371 (AES-192 CBC),
10372 .Ql aes128
10373 (AES-128 CBC),
10374 .Ql des3
10375 (DES EDE3 CBC, 168 bits; default if
10376 .Ql aes128
10377 is not available) and
10378 .Ql des
10379 (DES CBC, 56 bits).
10381 The actually available cipher algorithms depend on the cryptographic
10382 library that \*(UA uses.
10383 \*(OP Support for more cipher algorithms may be available through
10384 dynamic loading via, e.g.,
10385 .Xr EVP_get_cipherbyname 3
10386 (OpenSSL) if \*(UA has been compiled to support this.
10389 .It Va smime-crl-dir
10390 \*(OP Specifies a directory that contains files with CRLs in PEM format
10391 to use when verifying S/MIME messages.
10394 .It Va smime-crl-file
10395 \*(OP Specifies a file that contains a CRL in PEM format to use when
10396 verifying S/MIME messages.
10399 .It Va smime-encrypt-USER@HOST
10400 \*(OP If this variable is set, messages send to the given receiver are
10401 encrypted before sending.
10402 The value of the variable must be set to the name of a file that
10403 contains a certificate in PEM format.
10405 If a message is sent to multiple recipients,
10406 each of them for whom a corresponding variable is set will receive an
10407 individually encrypted message;
10408 other recipients will continue to receive the message in plain text
10409 unless the
10410 .Va smime-force-encryption
10411 variable is set.
10412 It is recommended to sign encrypted messages, i.e., to also set the
10413 .Va smime-sign
10414 variable.
10417 .It Va smime-force-encryption
10418 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
10421 .It Va smime-sign
10422 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
10423 and include the user's certificate as a MIME attachment.
10424 Signing a message enables a recipient to verify that the sender used
10425 a valid certificate,
10426 that the email addresses in the certificate match those in the message
10427 header and that the message content has not been altered.
10428 It does not change the message text,
10429 and people will be able to read the message as usual.
10430 Also see
10431 .Va smime-sign-cert , smime-sign-include-certs
10433 .Va smime-sign-message-digest .
10435 .Mx Va smime-sign-cert
10436 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
10437 \*(OP Points to a file in PEM format.
10438 For the purpose of signing and decryption this file needs to contain the
10439 user's private key, followed by his certificate.
10441 For message signing
10442 .Ql USER@HOST
10443 is always derived from the value of
10444 .Va from
10445 (or, if that contains multiple addresses,
10446 .Va sender ) .
10447 For the purpose of encryption the recipient's public encryption key
10448 (certificate) is expected; the command
10449 .Ic certsave
10450 can be used to save certificates of signed messages (the section
10451 .Sx "Signed and encrypted messages with S/MIME"
10452 gives some details).
10453 This mode of operation is usually driven by the specialized form.
10455 When decrypting messages the account is derived from the recipient
10456 fields
10457 .Pf ( Ql To:
10459 .Ql Cc: )
10460 of the message, which are searched for addresses for which such
10461 a variable is set.
10462 \*(UA always uses the first address that matches,
10463 so if the same message is sent to more than one of the user's addresses
10464 using different encryption keys, decryption might fail.
10466 For signing and decryption purposes it is possible to use encrypted
10467 keys, and the pseudo-host(s)
10468 .Ql USER@HOST.smime-cert-key
10469 for the private key
10470 (and
10471 .Ql USER@HOST.smime-cert-cert
10472 for the certificate stored in the same file)
10473 will be used for performing any necessary password lookup,
10474 therefore the lookup can be automatized via the mechanisms described in
10475 .Sx "On URL syntax and credential lookup" .
10476 For example, the hypothetical address
10477 .Ql bob@exam.ple
10478 could be driven with a private key / certificate pair path defined in
10479 .Va \&\&smime-sign-cert-bob@exam.ple ,
10480 and needed passwords would then be looked up via the pseudo hosts
10481 .Ql bob@exam.ple.smime-cert-key
10482 (and
10483 .Ql bob@exam.ple.smime-cert-cert ) .
10484 To include intermediate certificates, use
10485 .Va smime-sign-include-certs .
10487 .Mx Va smime-sign-include-certs
10488 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
10489 \*(OP If used, this is supposed to a consist of a comma-separated list
10490 of files, each of which containing a single certificate in PEM format to
10491 be included in the S/MIME message in addition to the
10492 .Va smime-sign-cert
10493 certificate.
10494 This can be used to include intermediate certificates of the certificate
10495 authority, in order to allow the receiver's S/MIME implementation to
10496 perform a verification of the entire certificate chain, starting from
10497 a local root certificate, over the intermediate certificates, down to the
10498 .Va smime-sign-cert .
10499 Even though top level certificates may also be included in the chain,
10500 they won't be used for the verification on the receiver's side.
10502 For the purpose of the mechanisms involved here,
10503 .Ql USER@HOST
10504 refers to the content of the internal variable
10505 .Va from
10506 (or, if that contains multiple addresses,
10507 .Va sender ) .
10508 The pseudo-host
10509 .Ql USER@HOST.smime-include-certs
10510 will be used for performing password lookups for these certificates,
10511 shall they have been given one, therefore the lookup can be automatized
10512 via the mechanisms described in
10513 .Sx "On URL syntax and credential lookup" .
10515 .Mx Va smime-sign-message-digest
10516 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
10517 \*(OP Specifies the message digest to use when signing S/MIME messages.
10518 RFC 5751 mandates a default of
10519 .Ql sha1 .
10520 Possible values are (case-insensitive and) in decreasing cipher strength:
10521 .Ql sha512 ,
10522 .Ql sha384 ,
10523 .Ql sha256 ,
10524 .Ql sha224
10526 .Ql md5 .
10528 The actually available message digest algorithms depend on the
10529 cryptographic library that \*(UA uses.
10530 \*(OP Support for more message digest algorithms may be available
10531 through dynamic loading via, e.g.,
10532 .Xr EVP_get_digestbyname 3
10533 (OpenSSL) if \*(UA has been compiled to support this.
10534 Remember that for this
10535 .Ql USER@HOST
10536 refers to the variable
10537 .Va from
10538 (or, if that contains multiple addresses,
10539 .Va sender ) .
10541 .It Va smtp
10542 \*(OB\*(OP To use the built-in SMTP transport, specify a SMTP URL in
10543 .Va mta .
10544 \*(ID For compatibility reasons a set
10545 .Va smtp
10546 is used in preference of
10547 .Va mta .
10549 .Mx Va smtp-auth
10550 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
10551 \*(OP Variable chain that controls the SMTP
10552 .Va mta
10553 authentication method, possible values are
10554 .Ql none
10555 (\*(OU default),
10556 .Ql plain
10557 (\*(IN default),
10558 .Ql login
10559 as well as the \*(OPal methods
10560 .Ql cram-md5
10562 .Ql gssapi .
10564 .Ql none
10565 method does not need any user credentials,
10566 .Ql gssapi
10567 requires a user name and all other methods require a user name and
10568 a password.
10569 See \*(IN
10570 .Va mta ,
10571 .Va user
10573 .Va password
10574 (\*(OU
10575 .Va smtp-auth-password
10577 .Va smtp-auth-user ) .
10578 Note that
10579 .Va smtp-auth-HOST
10580 is \*(IN.
10581 \*(OU: Note for
10582 .Va smtp-auth-USER@HOST :
10583 may override dependent on sender address in the variable
10584 .Va from .
10586 .It Va smtp-auth-password
10587 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
10588 If the authentication method requires a password, but neither
10589 .Va smtp-auth-password
10590 nor a matching
10591 .Va smtp-auth-password-USER@HOST
10592 can be found,
10593 \*(UA will ask for a password on the user's terminal.
10595 .It Va smtp-auth-password-USER@HOST
10596 \*(OU Overrides
10597 .Va smtp-auth-password
10598 for specific values of sender addresses, dependent upon the variable
10599 .Va from .
10601 .It Va smtp-auth-user
10602 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
10603 If the authentication method requires a user name, but neither
10604 .Va smtp-auth-user
10605 nor a matching
10606 .Va smtp-auth-user-USER@HOST
10607 can be found,
10608 \*(UA will ask for a user name on the user's terminal.
10610 .It Va smtp-auth-user-USER@HOST
10611 \*(OU Overrides
10612 .Va smtp-auth-user
10613 for specific values of sender addresses, dependent upon the variable
10614 .Va from .
10617 .It Va smtp-hostname
10618 \*(OP\*(IN Normally \*(UA uses the variable
10619 .Va from
10620 to derive the necessary
10621 .Ql USER@HOST
10622 information in order to issue a
10623 .Ql MAIL FROM:<>
10624 SMTP
10625 .Va mta
10626 command.
10627 Setting
10628 .Va smtp-hostname
10629 can be used to use the
10630 .Ql USER
10631 from the SMTP account
10632 .Pf ( Va mta
10633 or the
10634 .Va user
10635 variable chain)
10636 and the
10637 .Ql HOST
10638 from the content of this variable (or, if that is the empty string,
10639 .Va hostname
10640 or the local hostname as a last resort).
10641 This often allows using an address that is itself valid but hosted by
10642 a provider other than which (in
10643 .Va from )
10644 is about to send the message.
10645 Setting this variable also influences generated
10646 .Ql Message-ID:
10648 .Ql Content-ID:
10649 header fields.
10651 .Mx Va smtp-use-starttls
10652 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
10653 \*(BO\*(OP Causes \*(UA to issue a
10654 .Ql STARTTLS
10655 command to make an SMTP
10656 .Va mta
10657 session SSL/TLS encrypted, i.e., to enable transport layer security.
10659 .Mx Va socks-proxy
10660 .It Va socks-proxy-USER@HOST , socks-proxy-HOST , socks-proxy
10661 \*(OP If this is set to the hostname (SOCKS URL) of a SOCKS5 server then
10662 \*(UA will proxy all of its network activities through it.
10663 This can be used to proxy SMTP, POP3 etc. network traffic through the
10664 Tor anonymizer, for example.
10665 The following would create a local SOCKS proxy on port 10000 that
10666 forwards to the machine
10667 .Ql HOST ,
10668 and from which the network traffic is actually instantiated:
10669 .Bd -literal -offset indent
10670 # Create local proxy server in terminal 1 forwarding to HOST
10671 $ ssh -D 10000 USER@HOST
10672 # Then, start a client that uses it in terminal 2
10673 $ \*(uA -Ssocks-proxy-USER@HOST=localhost:10000
10677 .It Va spam-interface
10678 \*(OP In order to use any of the spam-related commands (like, e.g.,
10679 .Ic spamrate )
10680 the desired spam interface must be defined by setting this variable.
10681 Please refer to the manual section
10682 .Sx "Handling spam"
10683 for the complete picture of spam handling in \*(UA.
10684 All or none of the following interfaces may be available:
10686 .Bl -tag -width ".It Ql _ilte_"
10687 .It Ql spamc
10688 Interaction with
10689 .Xr spamc 1
10690 from the
10691 .Xr spamassassin 1
10692 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
10693 suite.
10694 Different to the generic filter interface \*(UA will automatically add
10695 the correct arguments for a given command and has the necessary
10696 knowledge to parse the program's output.
10697 A default value for
10698 .Va spamc-command
10699 will have been compiled into the \*(UA binary if
10700 .Xr spamc 1
10701 has been found in
10702 .Ev PATH
10703 during compilation.
10704 Shall it be necessary to define a specific connection type (rather than
10705 using a configuration file for that), the variable
10706 .Va spamc-arguments
10707 can be used as in, e.g.,
10708 .Ql -d server.example.com -p 783 .
10709 It is also possible to specify a per-user configuration via
10710 .Va spamc-user .
10711 Note that this interface does not inspect the
10712 .Ql is-spam
10713 flag of a message for the command
10714 .Ic spamforget .
10716 .It Ql filter
10717 generic spam filter support via freely configurable hooks.
10718 This interface is meant for programs like
10719 .Xr bogofilter 1
10720 and requires according behaviour in respect to the hooks' exit
10721 status for at least the command
10722 .Ic spamrate
10723 .Pf ( Ql 0
10724 meaning a message is spam,
10725 .Ql 1
10726 for non-spam,
10727 .Ql 2
10728 for unsure and any other return value indicating a hard error);
10729 since the hooks can include shell code snippets diverting behaviour
10730 can be intercepted as necessary.
10731 The hooks are
10732 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
10733   spamfilter-rate
10735 .Va spamfilter-spam ;
10736 the manual section
10737 .Sx "Handling spam"
10738 contains examples for some programs.
10739 The process environment of the hooks will have the variable
10740 .Ev MAILX_FILENAME_GENERATED
10741 set.
10742 Note that spam score support for
10743 .Ic spamrate
10744 is not supported unless the \*(OPtional regular expression support is
10745 available and the
10746 .Va spamfilter-rate-scanscore
10747 variable is set.
10752 .It Va spam-maxsize
10753 \*(OP Messages that exceed this size will not be passed through to the
10754 configured
10755 .Va spam-interface .
10756 If unset or 0, the default of 420000 bytes is used.
10759 .It Va spamc-command
10760 \*(OP The path to the
10761 .Xr spamc 1
10762 program for the
10763 .Ql spamc
10764 .Va spam-interface .
10765 Note that the path is not expanded, but used
10766 .Dq as is .
10767 A fallback path will have been compiled into the \*(UA binary if the
10768 executable had been found during compilation.
10771 .It Va spamc-arguments
10772 \*(OP Even though \*(UA deals with most arguments for the
10773 .Ql spamc
10774 .Va spam-interface
10775 automatically, it may at least sometimes be desirable to specify
10776 connection-related ones via this variable, e.g.,
10777 .Ql -d server.example.com -p 783 .
10780 .It Va spamc-user
10781 \*(OP Specify a username for per-user configuration files for the
10782 .Ql spamc
10783 .Va spam-interface .
10784 If this is set to the empty string then \*(UA will use the name of the
10785 current
10786 .Va user .
10793 .It Va spamfilter-ham , spamfilter-noham , \
10794   spamfilter-nospam , spamfilter-rate , spamfilter-spam
10795 \*(OP Command and argument hooks for the
10796 .Ql filter
10797 .Va spam-interface .
10798 The manual section
10799 .Sx "Handling spam"
10800 contains examples for some programs.
10803 .It Va spamfilter-rate-scanscore
10804 \*(OP Because of the generic nature of the
10805 .Ql filter
10806 .Va spam-interface
10807 spam scores are not supported for it by default, but if the \*(OPnal
10808 regular expression support is available then setting this variable can
10809 be used to overcome this restriction.
10810 It is interpreted as follows: first a number (digits) is parsed that
10811 must be followed by a semicolon
10812 .Ql \&;
10813 and an extended regular expression.
10814 Then the latter is used to parse the first output line of the
10815 .Va spamfilter-rate
10816 hook, and, in case the evaluation is successful, the group that has been
10817 specified via the number is interpreted as a floating point scan score.
10821 .It Va ssl-ca-dir , ssl-ca-file
10822 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
10823 Enhanced Mail) format as a directory and a file, respectively, for the
10824 purpose of verification of SSL/TLS server certificates.
10825 It is possible to set both, the file will be loaded immediately, the
10826 directory will be searched whenever no match has yet been found.
10827 The set of CA certificates which are built into the SSL/TLS library can
10828 be explicitly turned off by setting
10829 .Va ssl-ca-no-defaults ,
10830 and further fine-tuning is possible via
10831 .Va ssl-ca-flags ;
10832 also see
10833 .Xr SSL_CTX_load_verify_locations 3
10834 for more information.
10835 \*(UA will try to use the TLS/SNI (ServerNameIndication) extension when
10836 establishing TLS connections to servers identified with hostnames.
10840 .It Va ssl-ca-flags
10841 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
10842 storage, and the certificate verification that is used (also see
10843 .Va ssl-verify ) .
10844 The value is expected to consist of a comma-separated list of
10845 configuration directives, with any intervening whitespace being ignored.
10846 The directives directly map to flags that can be passed to
10847 .Xr X509_STORE_set_flags 3 ,
10848 which are usually defined in a file
10849 .Pa openssl/x509_vfy.h ,
10850 and the availability of which depends on the used SSL/TLS library
10851 version: a directive without mapping is ignored (error log subject to
10852 .Va debug ) .
10853 Directives currently understood (case-insensitively) include:
10856 .Bl -tag -compact -width ".It Cd BaNg"
10857 .It Cd no-alt-chains
10858 If the initial chain is not trusted, do not attempt to build an
10859 alternative chain.
10860 Setting this flag will make OpenSSL certificate verification match that
10861 of older OpenSSL versions, before automatic building and checking of
10862 alternative chains has been implemented; also see
10863 .Cd trusted-first .
10864 .It Cd no-check-time
10865 Do not check certificate/CRL validity against current time.
10866 .It Cd partial-chain
10867 By default partial, incomplete chains which cannot be verified up to the
10868 chain top, a self-signed root certificate, will not verify.
10869 With this flag set, a chain succeeds to verify if at least one signing
10870 certificate of the chain is in any of the configured trusted stores of
10871 CA certificates.
10872 The OpenSSL manual page
10873 .Xr SSL_CTX_load_verify_locations 3
10874 gives some advise how to manage your own trusted store of CA certificates.
10875 .It Cd strict
10876 Disable workarounds for broken certificates.
10877 .It Cd trusted-first
10878 Try building a chain using issuers in the trusted store first to avoid
10879 problems with server-sent legacy intermediate certificates.
10880 Newer versions of OpenSSL support alternative chain checking and enable
10881 it by default, resulting in the same behaviour; also see
10882 .Cd no-alt-chains .
10887 .It Va ssl-ca-no-defaults
10888 \*(BO\*(OP Do not load the default CA locations that are built into the
10889 used to SSL/TLS library to verify SSL/TLS server certificates.
10891 .Mx Va ssl-cert
10892 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
10893 \*(OP Variable chain that sets the filename for a SSL/TLS client
10894 certificate required by some servers.
10895 This is a direct interface to the
10896 .Ql Certificate
10897 slot of the
10898 .Xr SSL_CONF_cmd 3
10899 function of the OpenSSL library, if available.
10901 .Mx Va ssl-cipher-list
10902 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
10903 \*(OP Specifies a list of ciphers for SSL/TLS connections.
10904 This is a direct interface to the
10905 .Ql CipherString
10906 slot of the
10907 .Xr SSL_CONF_cmd 3
10908 function of the OpenSSL library, if available; see
10909 .Xr ciphers 1
10911 .Xr SSL_CTX_set_cipher_list 3
10912 for more information.
10913 By default \*(UA does not set a list of ciphers, in effect using a
10914 .Va ssl-protocol
10915 specific cipher (protocol standards ship with a list of acceptable
10916 ciphers), possibly cramped to what the actually used SSL/TLS library
10917 supports \(en the manual section
10918 .Sx "An example configuration"
10919 also contains a SSL/TLS use case.
10922 .It Va ssl-config-file
10923 \*(OP If this variable is set \*(UA will call
10924 .Xr CONF_modules_load_file 3
10925 to allow OpenSSL to be configured according to the host system wide
10926 security settings.
10927 If a non-empty value is given then this will be used to specify the
10928 configuration file to be used instead of the global OpenSSL default;
10929 note that in this case it is an error if the file cannot be loaded.
10930 The application name will always be passed as
10931 .Dq \*(uA .
10933 .Mx Va ssl-curves
10934 .It Va ssl-curves-USER@HOST , ssl-curves-HOST , ssl-curves
10935 \*(OP Specifies a list of supported curves for SSL/TLS connections.
10936 This is a direct interface to the
10937 .Ql Curves
10938 slot of the
10939 .Xr SSL_CONF_cmd 3
10940 function of the OpenSSL library, if available; see
10941 .Xr SSL_CTX_set1_curves_list 3
10942 for more information.
10943 By default \*(UA does not set a list of curves.
10947 .It Va ssl-crl-dir , ssl-crl-file
10948 \*(OP Specify a directory / a file, respectively that contains a CRL in
10949 PEM format to use when verifying SSL/TLS server certificates.
10951 .Mx Va ssl-key
10952 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
10953 \*(OP Variable chain that sets the filename for the private key of
10954 a SSL/TLS client certificate.
10955 If unset, the name of the certificate file is used.
10956 The file is expected to be in PEM format.
10957 This is a direct interface to the
10958 .Ql PrivateKey
10959 slot of the
10960 .Xr SSL_CONF_cmd 3
10961 function of the OpenSSL library, if available.
10963 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
10964 \*(OB\*(OP Please use the newer and more flexible
10965 .Va ssl-protocol
10966 instead: if both values are set,
10967 .Va ssl-protocol
10968 will take precedence!
10969 Can be set to the following values, the actually used
10970 .Va ssl-protocol
10971 specification to which it is mapped is shown in parenthesis:
10972 .Ql tls1.2
10973 .Pf ( Ql -ALL, TLSv1.2 ) ,
10974 .Ql tls1.1
10975 .Pf ( Ql -ALL, TLSv1.1 ) ,
10976 .Ql tls1
10977 .Pf ( Ql -ALL, TLSv1 )
10979 .Ql ssl3
10980 .Pf ( Ql -ALL, SSLv3 ) ;
10981 the special value
10982 .Ql auto
10983 is mapped to
10984 .Ql ALL, -SSLv2
10985 and thus includes the SSLv3 protocol.
10986 Note that SSLv2 is no longer supported at all.
10988 .Mx Va ssl-protocol
10989 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
10990 \*(OP Specify the used SSL/TLS protocol.
10991 This is a direct interface to the
10992 .Ql Protocol
10993 slot of the
10994 .Xr SSL_CONF_cmd 3
10995 function of the OpenSSL library, if available;
10996 otherwise an \*(UA internal parser is used which understands the
10997 following subset of (case-insensitive) command strings:
10998 .Ql SSLv3 ,
10999 .Ql TLSv1 ,
11000 .Ql TLSv1.1
11002 .Ql TLSv1.2 ,
11003 as well as the special value
11004 .Ql ALL .
11005 Multiple specifications may be given via a comma-separated list which
11006 ignores any whitespace.
11007 An optional
11008 .Ql +
11009 plus sign prefix will enable a protocol, a
11010 .Ql -
11011 hyphen-minus prefix will disable it, so that
11012 .Ql -ALL, TLSv1.2
11013 will enable only the TLSv1.2 protocol.
11015 It depends upon the used TLS/SSL library which protocols are actually
11016 supported and which protocols are used if
11017 .Va ssl-protocol
11018 is not set, but note that SSLv2 is no longer supported at all and
11019 actively disabled.
11020 Especially for older protocols explicitly securing
11021 .Va ssl-cipher-list
11022 may be worthwile, see
11023 .Sx "An example configuration" .
11026 .It Va ssl-rand-egd
11027 \*(OP Gives the pathname to an entropy daemon socket, see
11028 .Xr RAND_egd 3 .
11029 Not all SSL/TLS libraries support this.
11032 .It Va ssl-rand-file
11033 \*(OP Gives the filename to a file with random entropy data, see
11034 .Xr RAND_load_file 3 .
11035 If this variable is not set, or set to the empty string, or if the
11036 .Sx "Filename transformations"
11037 fail, then
11038 .Xr RAND_file_name 3
11039 will be used to create the filename if, and only if,
11040 .Xr RAND_status 3
11041 documents that the SSL PRNG is not yet sufficiently seeded.
11042 If \*(UA successfully seeded the SSL PRNG then it will update the file
11043 .Pf ( Xr RAND_write_file 3 ) .
11044 This variable is only used if
11045 .Va ssl-rand-egd
11046 is not set (or not supported by the SSL/TLS library).
11048 .Mx Va ssl-verify
11049 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
11050 \*(OP Variable chain that sets the action to be performed if an error
11051 occurs during SSL/TLS server certificate validation against the
11052 specified or default trust stores
11053 .Va ssl-ca-dir ,
11054 .Va ssl-ca-file ,
11055 or the SSL/TLS library built-in defaults (unless usage disallowed via
11056 .Va ssl-ca-no-defaults ) ,
11057 and as fine-tuned via
11058 .Va ssl-ca-flags .
11059 Valid (case-insensitive) values are
11060 .Ql strict
11061 (fail and close connection immediately),
11062 .Ql ask
11063 (ask whether to continue on standard input),
11064 .Ql warn
11065 (show a warning and continue),
11066 .Ql ignore
11067 (do not perform validation).
11068 The default is
11069 .Ql ask .
11072 .It Va stealthmua
11073 If only set without an assigned value, then this setting inhibits the
11074 generation of the
11075 .Ql Message-ID: ,
11076 .Ql Content-ID:
11078 .Ql User-Agent:
11079 header fields that include obvious references to \*(UA.
11080 There are two pitfalls associated with this:
11081 First, the message id of outgoing messages is not known anymore.
11082 Second, an expert may still use the remaining information in the header
11083 to track down the originating mail user agent.
11084 If set to the value
11085 .Ql noagent ,
11086 then the mentioned
11087 .Ql Message-ID:
11089 .Ql Content-ID:
11090 suppression does not occur.
11094 .It Va termcap
11095 (\*(OP) This specifies a comma-separated list of
11096 .Lb libterminfo
11097 and/or
11098 .Lb libtermcap
11099 capabilities (see
11100 .Sx "On terminal control and line editor" ,
11101 escape commas with reverse solidus) to be used to overwrite or define
11102 entries.
11103 .Sy Note
11104 this variable will only be queried once at program startup and can
11105 thus only be specified in resource files or on the command line.
11108 String capabilities form
11109 .Ql cap=value
11110 pairs and are expected unless noted otherwise.
11111 Numerics have to be notated as
11112 .Ql cap#number
11113 where the number is expected in normal decimal notation.
11114 Finally, booleans do not have any value but indicate a true or false
11115 state simply by being defined or not; this indeed means that \*(UA
11116 does not support undefining an existing boolean.
11117 String capability values will undergo some expansions before use:
11118 for one notations like
11119 .Ql ^LETTER
11120 stand for
11121 .Ql control-LETTER ,
11122 and for clarification purposes
11123 .Ql \eE
11124 can be used to specify
11125 .Ql escape
11126 (the control notation
11127 .Ql ^[
11128 could lead to misreadings when a left bracket follows, which it does for
11129 the standard CSI sequence);
11130 finally three letter octal sequences, as in
11131 .Ql \e061 ,
11132 are supported.
11133 To specify that a terminal supports 256-colours, and to define sequences
11134 that home the cursor and produce an audible bell, one might write:
11136 .Bd -literal -offset indent
11137 ? set termcap='Co#256,home=\eE[H,bel=^G'
11141 The following terminal capabilities are or may be meaningful for the
11142 operation of the built-in line editor or \*(UA in general:
11145 .Bl -tag -compact -width ".It Cd yay"
11146 .\" HAVE_COLOUR
11147 .It Cd colors Ns \0or Cd Co
11148 .Cd max_colors :
11149 numeric capability specifying the maximum number of colours.
11150 Note that \*(UA does not actually care about the terminal beside that,
11151 but always emits ANSI / ISO 6429 escape sequences.
11153 .\" HAVE_TERMCAP
11154 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
11155 .Cd exit_ca_mode
11157 .Cd enter_ca_mode ,
11158 respectively: exit and enter the alternative screen ca-mode,
11159 effectively turning \*(UA into a fullscreen application.
11160 This must be enabled explicitly by setting
11161 .Va termcap-ca-mode .
11163 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
11164 .Cd keypad_xmit
11166 .Cd keypad_local ,
11167 respectively: enable and disable the keypad.
11168 This is always enabled if available, because it seems even keyboards
11169 without keypads generate other key codes for, e.g., cursor keys in that
11170 case, and only if enabled we see the codes that we are interested in.
11172 .It Cd ed Ns \0or Cd cd
11173 .Cd clr_eos :
11174 clear the screen.
11176 .It Cd clear Ns \0or Cd cl
11177 .Cd clear_screen :
11178 clear the screen and home cursor.
11179 (Will be simulated via
11180 .Cd ho
11181 plus
11182 .Cd cd . )
11184 .It Cd home Ns \0or Cd ho
11185 .Cd cursor_home :
11186 home cursor.
11188 .\" HAVE_MLE
11189 .It Cd el Ns \0or Cd ce
11190 .Cd clr_eol :
11191 clear to the end of line.
11192 (Will be simulated via
11193 .Cd ch
11194 plus repetitions of space characters.)
11196 .It Cd hpa Ns \0or Cd ch
11197 .Cd column_address :
11198 move the cursor (to the given column parameter) in the current row.
11199 (Will be simulated via
11200 .Cd cr
11201 plus
11202 .Cd nd . )
11204 .It Cd cr
11205 .Cd carriage_return :
11206 move to the first column in the current row.
11207 The default built-in fallback is
11208 .Ql \er .
11210 .It Cd cub1 Ns \0or Cd le
11211 .Cd cursor_left :
11212 move the cursor left one space (non-destructively).
11213 The default built-in fallback is
11214 .Ql \eb .
11216 .It Cd cuf1 Ns \0or Cd nd
11217 .Cd cursor_right :
11218 move the cursor right one space (non-destructively).
11219 The default built-in fallback is
11220 .Ql \eE[C ,
11221 which is used by most terminals.
11222 Less often occur
11223 .Ql \eEC
11225 .Ql \eEOC .
11229 Many more capabilities which describe key-sequences are documented for
11230 .Ic bind .
11234 .It Va termcap-ca-mode
11235 \*(OP Allow usage of the
11236 .Cd exit_ca_mode
11238 .Cd enter_ca_mode
11239 terminal capabilities, effectively turning \*(UA into a fullscreen
11240 application, as documented for
11241 .Va termcap .
11242 .Sy Note
11243 this variable will only be queried once at program startup and can
11244 thus only be specified in resource files or on the command line.
11247 .It Va termcap-disable
11248 \*(OP Disable any interaction with a terminal control library.
11249 If set only some generic fallback built-ins and possibly the content of
11250 .Va termcap
11251 describe the terminal to \*(UA.
11252 .Sy Note
11253 this variable will only be queried once at program startup and can
11254 thus only be specified in resource files or on the command line.
11257 .It Va toplines
11258 If defined, gives the number of lines of a message to be displayed
11259 with the command
11260 .Ic top ;
11261 if unset, the first five lines are printed, if set to 0 the variable
11262 .Va screen
11263 is inspected.
11264 If the value is negative then its absolute value will be used for
11265 unsigned right shifting (see
11266 .Ic vexpr )
11268 .Va screen
11269 height.
11272 .It Va topsqueeze
11273 \*(BO If set then the
11274 .Ic top
11275 command series will strip adjacent empty lines and quotations.
11278 .It Va ttycharset
11279 The character set of the terminal \*(UA operates on,
11280 and the one and only supported character set that \*(UA can use if no
11281 character set conversion capabilities have been compiled into it,
11282 in which case it defaults to ISO-8859-1 unless it can deduce a value
11283 from the locale specified in the
11284 .Ev LC_CTYPE
11285 environment variable (if supported, see there for more).
11286 It defaults to UTF-8 if conversion is available.
11287 Refer to the section
11288 .Sx "Character sets"
11289 for the complete picture about character sets.
11292 .It Va typescript-mode
11293 \*(BO A special multiplex variable that disables all variables and
11294 settings which result in behaviour that interferes with running \*(UA in
11295 .Xr script 1 ,
11296 e.g., it sets
11297 .Va colour-disable ,
11298 .Va line-editor-disable
11299 and (before startup completed only)
11300 .Va termcap-disable .
11301 Unsetting it does not restore the former state of the covered settings.
11304 .It Va umask
11305 For a safety-by-default policy \*(UA sets its process
11306 .Xr umask 2
11308 .Ql 0077 ,
11309 but this variable can be used to override that:
11310 set it to an empty value to do not change the (current) setting (on
11311 startup), otherwise the process file mode creation mask is updated to
11312 the new value.
11313 Child processes inherit the process file mode creation mask.
11315 .Mx Va user
11316 .It Va user-HOST , user
11317 \*(IN Variable chain that sets a global fallback user name, which is
11318 used in case none has been given in the protocol and account-specific
11319 URL.
11320 This variable defaults to the name of the user who runs \*(UA.
11323 .It Va v15-compat
11324 \*(BO Setting this enables upward compatibility with \*(UA
11325 version 15.0 in respect to which configuration options are available and
11326 how they are handled.
11327 This manual uses \*(IN and \*(OU to refer to the new and the old way of
11328 doing things, respectively.
11331 .It Va verbose
11332 \*(BO This setting, also controllable via the command line option
11333 .Fl v ,
11334 causes \*(UA to be more verbose, e.g., it will display obsoletion
11335 warnings and SSL/TLS certificate chains.
11336 Even though marked \*(BO this option may be set twice in order to
11337 increase the level of verbosity even more, in which case even details of
11338 the actual message delivery and protocol conversations are shown.
11339 A single
11340 .Pf no Va verbose
11341 is sufficient to disable verbosity as such.
11348 .It Va version , version-date , version-major , version-minor , version-update
11349 \*(RO \*(UA version information: the first variable contains a string
11350 containing the complete version identification, the latter three contain
11351 only digits: the major, minor and update version numbers.
11352 The date is in ISO 8601 notation.
11353 The output of the command
11354 .Ic version
11355 will include this information.
11358 .It Va writebackedited
11359 If this variable is set messages modified using the
11360 .Ic edit
11362 .Ic visual
11363 commands are written back to the current folder when it is quit;
11364 it is only honoured for writable folders in MBOX format, though.
11365 Note that the editor will be pointed to the raw message content in that
11366 case, i.e., neither MIME decoding nor decryption will have been
11367 performed, and proper RFC 4155
11368 .Ql From_
11369 quoting of newly added or edited content is also left as an excercise to
11370 the user.
11372 .\" }}} (Variables)
11374 .\" }}} (INTERNAL VARIABLES)
11377 .\" .Sh ENVIRONMENT {{{
11378 .Sh ENVIRONMENT
11380 The term
11381 .Dq environment variable
11382 should be considered an indication that these variables are either
11383 standardized as vivid parts of process environments, or that they are
11384 commonly found in there.
11385 The process environment is inherited from the
11386 .Xr sh 1
11387 once \*(UA is started, and unless otherwise explicitly noted handling of
11388 the following variables transparently integrates into that of the
11389 .Sx "INTERNAL VARIABLES"
11390 from \*(UA's point of view.
11391 This means that, e.g., they can be managed via
11392 .Ic set
11394 .Ic unset ,
11395 causing automatic program environment updates (to be inherited by
11396 newly created child processes).
11399 In order to transparently integrate other environment variables equally
11400 they need to be imported (linked) with the command
11401 .Ic environ .
11402 This command can also be used to set and unset non-integrated
11403 environment variables from scratch, sufficient system support provided.
11404 The following example, applicable to a POSIX shell, sets the
11405 .Ev COLUMNS
11406 environment variable for \*(UA only, and beforehand exports the
11407 .Ev EDITOR
11408 in order to affect any further processing in the running shell:
11410 .Bd -literal -offset indent
11411 $ EDITOR="vim -u ${HOME}/.vimrc"
11412 $ export EDITOR
11413 $ COLUMNS=80 \*(uA -R
11416 .Bl -tag -width ".It Ev BaNg"
11418 .It Ev COLUMNS
11419 The user's preferred width in column positions for the terminal screen
11420 or window.
11421 Queried and used once on program startup, actively managed for child
11422 processes and the MLE (see
11423 .Sx "On terminal control and line editor" )
11424 in interactive mode thereafter.
11425 Ignored in non-interactive mode, which always uses 80 columns, unless in
11426 .fl #
11427 batch mode.
11430 .It Ev DEAD
11431 The name of the (mailbox)
11432 .Ic file
11433 to use for saving aborted messages if
11434 .Va save
11435 is set; this defaults to
11436 .Pa dead.letter
11437 in the user's
11438 .Ev HOME
11439 directory.
11440 If the variable
11441 .Va debug
11442 is set no output will be generated, otherwise the contents of the file
11443 will be replaced.
11446 .It Ev EDITOR
11447 Pathname of the text editor to use in the
11448 .Ic edit
11449 command and
11450 .Ic ~e
11451 .Sx "COMMAND ESCAPES" .
11452 A default editor is used if this value is not defined.
11455 .It Ev HOME
11456 The user's home directory.
11457 This variable is only used when it resides in the process environment.
11458 The calling user's home directory will be used instead if this directory
11459 does not exist, is not accessible or cannot be read.
11460 (No test for being writable is performed to allow usage by
11461 non-privileged users within read-only jails, but dependent on the
11462 variable settings this directory is a default write target, e.g. for
11463 .Ev DEAD ,
11464 .Ev MBOX
11465 and more.)
11470 .It Ev LC_ALL , LC_CTYPE , LANG
11471 \*(OP The (names in lookup order of the)
11472 .Xr locale 7
11473 (and / or see
11474 .Xr setlocale 3 )
11475 which indicates the used
11476 .Sx "Character sets" .
11477 Runtime changes trigger automatic updates of the entire locale system,
11478 updating and overwriting also a
11479 .Va ttycharset
11480 set by the user.
11483 .It Ev LINES
11484 The user's preferred number of lines on a page or the vertical screen
11485 or window size in lines.
11486 Queried and used once on program startup, actively managed for child
11487 processes in interactive mode thereafter.
11488 Ignored in non-interactive mode, which always uses 24 lines, unless in
11489 .fl #
11490 batch mode.
11493 .It Ev LISTER
11494 Pathname of the directory lister to use in the
11495 .Ic folders
11496 command when operating on local mailboxes.
11497 Default is
11498 .Xr ls 1
11499 (path search through
11500 .Ev SHELL ) .
11503 .It Ev LOGNAME
11504 Upon startup \*(UA will actively ensure that this variable refers to the
11505 name of the user who runs \*(UA, in order to be able to pass a verified
11506 name to any newly created child process.
11509 .It Ev MAIL
11510 Is used as the users
11511 .Mx -sx
11512 .Sx "primary system mailbox"
11513 unless
11514 .Va inbox
11515 is set.
11516 This is assumed to be an absolute pathname.
11519 .It Ev MAILCAPS
11520 \*(OP Overrides the default path search for
11521 .Sx "The Mailcap files" ,
11522 which is defined in the standard RFC 1524 as
11523 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
11524 .\" TODO we should have a mailcaps-default virtual RDONLY option!
11525 (\*(UA makes it a configuration option, however.)
11526 Note this is not a search path, but a path search.
11529 .It Ev MAILRC
11530 Is used as a startup file instead of
11531 .Pa \*(ur
11532 if set.
11533 When \*(UA scripts are invoked on behalf of other users,
11534 either this variable should be set to
11535 .Pa /dev/null
11536 or the
11537 .Fl \&:
11538 command line option should be used in order to avoid side-effects from
11539 reading their configuration files.
11540 This variable is only used when it resides in the process environment.
11543 .It Ev MAILX_NO_SYSTEM_RC
11544 If this variable is set then reading of
11545 .Pa \*(UR
11546 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
11547 had been started up with the option
11548 .Fl \&:
11549 (and according argument) or
11550 .Fl n .
11551 This variable is only used when it resides in the process environment.
11554 .It Ev MBOX
11555 The name of the users
11556 .Mx -sx
11557 .Sx "secondary mailbox"
11558 file.
11559 A logical subset of the special
11560 .Sx "Filename transformations"
11561 (also see
11562 .Ic file )
11563 are supported.
11564 The default is
11565 .Pa ~/mbox .
11566 Traditionally this MBOX is used as the file to save messages from the
11567 .Mx -sx
11568 .Sx "primary system mailbox"
11569 that have been read.
11570 Also see
11571 .Sx "Message states" .
11574 .It Ev NETRC
11575 \*(IN\*(OP This variable overrides the default location of the user's
11576 .Pa ~/.netrc
11577 file.
11580 .It Ev PAGER
11581 Pathname of the program to use for backing the command
11582 .Ic more ,
11583 and when the
11584 .Va crt
11585 variable enforces usage of a pager for output.
11586 The default paginator is
11587 .Xr more 1
11588 (path search through
11589 .Ev SHELL ) .
11591 \*(UA inspects the contents of this variable: if its contains the string
11592 .Dq less
11593 then a non-existing environment variable
11594 .Va LESS
11595 will be set to
11596 .Ql FRXi ,
11597 .Ql FRi
11599 .Ql Ri ,
11600 dependent on whether terminal control support is available and whether
11601 that supports full (alternative) screen mode or not (also see
11602 .Sx "On terminal control and line editor" ) .
11603 Likewise for
11604 .Dq lv
11605 .Va LV
11606 will optionally be set to
11607 .Dq -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