C****Y BSD signal handling! Try improve ^C stability..
[s-mailx.git] / nail.1
blob8e314e9e972e759d2a857bf420505137fab5cf81
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(1): v14.9.0-pre3 / 2016-12-31
35 .Dd Dec 31, 2016
36 .ds VV \\%v14.9.0-pre3
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 .Nm \*(uA
74 .Bk -words
75 .Op Fl BdEFintv~
76 .Op Fl \&: Ar spec
77 .Op Fl A Ar account
78 .Op Fl a Ar attachment
79 .Op Fl b Ar bcc-addr
80 .Op Fl c Ar cc-addr
81 .Op Fl M Ar type | Fl m Ar file | Fl q Ar file | Fl t
82 .Op Fl r Ar from-addr
83 .Op Fl S Ar var Ns Op Ns = Ns Ar value
84 .Op Fl s Ar subject
85 .Op Fl X Ar cmd
86 .Op Fl \&.
87 .Ar to-addr ...
88 .Op Fl Fl \~ Ns Ar mta-option ...
89 .Ek
90 .Nm \*(uA
91 .Bk -words
92 .Op Fl BdEeHiNnRv~
93 .Op Fl \&: Ar spec
94 .Op Fl A Ar account
95 .Op Fl L Ar spec-list
96 .Op Fl r Ar from-addr
97 .Op Fl S Ar var Ns Op Ns = Ns Ar value
98 .Op Fl u Ar user
99 .Op Fl X Ar cmd
100 .Op Fl Fl \~ Ns Ar mta-option ...
102 .Nm \*(uA
103 .Bk -words
104 .Op Fl BdEeHiNnRv~#
105 .Op Fl \&: Ar spec
106 .Op Fl A Ar account
107 .Fl f
108 .Op Fl L Ar spec-list
109 .Op Fl r Ar from-addr
110 .Op Fl S Ar var Ns Op Ns = Ns Ar value
111 .Op Fl X Ar cmd
112 .Op Ar file
113 .Op Fl Fl \~ Ns Ar mta-option ...
115 .\" }}}
118 .Mx -toc -tree html pdf ps xhtml
121 .\" .Sh DESCRIPTION {{{
122 .Sh DESCRIPTION
124 .Bd -filled -compact -offset indent
125 .Sy Compatibility note:
126 S-nail (\*(UA) will wrap up into \%S-mailx in v15.0 (circa 2018).
127 Backward incompatibility has to be expected \(en
128 .Sx COMMANDS
129 will use
130 .Sx "Shell-style argument quoting"
131 rules, for example, and shell metacharacters will become meaningful.
132 New and old behaviour is flagged \*(IN and \*(OU, and setting
133 .Va v15-compat ,
134 one of the many
135 .Sx "INTERNAL VARIABLES" ,
136 will choose new behaviour when applicable.
137 \*(OB flags what will vanish, and enabling
138 .Fl d
140 .Fl v
141 enables obsoletion warnings.
145 \*(UA provides a simple and friendly environment for sending and
146 receiving mail.
147 It is intended to provide the functionality of the POSIX
148 .Xr mailx 1
149 command, but is MIME capable and optionally offers extensions for
150 line editing, S/MIME, SMTP and POP3, among others.
151 \*(UA divides incoming mail into its constituent messages and allows
152 the user to deal with them in any order.
153 It offers many
154 .Sx COMMANDS
156 .Sx "INTERNAL VARIABLES"
157 for manipulating messages and sending mail.
158 It provides the user simple editing capabilities to ease the composition
159 of outgoing messages, and increasingly powerful and reliable
160 non-interactive scripting capabilities.
162 .\" .Ss "Options" {{{
163 .Ss "Options"
165 .Bl -tag -width ".It Fl BaNg"
167 .It Fl \&: Ar spec
168 Explicitly control which of the
169 .Sx "Resource files"
170 shall be loaded: if the letter
171 .Ql s
172 is (case-insensitively) part of the
173 .Ar spec
174 then the system wide
175 .Pa \*(UR
176 is loaded, likewise the letter
177 .Ql u
178 controls loading of the user's personal
179 .Pa \*(ur
180 file, whereas the letters
181 .Ql -
183 .Ql /
184 explicitly forbid loading of any resource files.
185 This option should be used by scripts: to avoid environmental noise they
186 should
187 .Dq detach
188 from any configuration files and create a script-local environment,
189 explicitly setting any of the desired
190 .Sx "INTERNAL VARIABLES"
192 .Fl S .
193 This option overrides
194 .Fl n .
197 .It Fl A Ar account
198 Executes an
199 .Ic account
200 command for the given user email
201 .Ar account
202 after program startup is complete (all resource files are loaded, any
203 .Fl S
204 setting is being established; only
205 .Fl X
206 commands have not been evaluated yet).
207 Being a special incarnation of
208 .Ic define Ns d
209 macros for the purpose of bundling longer-lived settings, activating
210 such an email account also switches to the accounts
211 .Mx -sx
212 .Sx "primary system mailbox"
213 (most likely the
214 .Va inbox ) .
217 .It Fl a Ar file Ns Op Ar =input-charset Ns Op Ar #output-charset
218 Attach
219 .Ar file
220 to the message (for compose mode opportunities refer to
221 .Ic ~@
223 .Ic ~^ ) .
224 .Sx "Filename transformations"
225 (also see
226 .Ic file )
227 will be performed, but shell word expansion is restricted to the tilde
228 .Ql ~ .
229 Shall
230 .Ar file
231 not be accessible but contain a
232 .Ql =
233 character, then anything before the
234 .Ql =
235 will be used as the filename, anything thereafter as a character set
236 specification.
238 If an input character set is specified,
239 .Mx -ix "character set specification"
240 but no output character set, then the given input character set is fixed
241 as-is, and no conversion will be applied;
242 giving the special string hyphen-minus
243 .Ql -
244 will be treated as if
245 .Va ttycharset
246 has been specified (the default).
247 If an output character set has also been given then the conversion will
248 be performed exactly as specified and on-the-fly, not considering the
249 file's type and content.
250 As an exception, if the output character set is specified as hyphen-minus
251 .Ql - ,
252 then the default conversion algorithm (see
253 .Sx "Character sets" )
254 is applied (therefore no conversion is performed on-the-fly,
255 .Ar file
256 will be MIME-classified and its contents will be inspected first).
257 It is an error to specify anything but
258 .Ql -
259 if no character set conversion is available
260 .Pf ( Va features
261 does not include the term
262 .Ql +iconv ) .
265 .It Fl B
266 (\*(OB: \*(UA will always use line-buffered output, to gain
267 line-buffered input even in batch mode enable batch mode via
268 .Fl # . )
271 .It Fl b Ar addr
272 Send a blind carbon copy to
273 .Ar addr Ns
274 ess, if the setting of
275 .Va expandaddr ,
276 one of the
277 .Sx "INTERNAL VARIABLES" ,
278 allows.
279 The option may be used multiple times.
280 Also see the section
281 .Sx "On sending mail, and non-interactive mode" .
284 .It Fl c Ar addr
285 Send carbon copies to the given receiver, if so allowed by
286 .Va expandaddr .
287 May be used multiple times.
290 .It Fl d
291 .Ic set
292 the internal variable
293 .Va debug
294 which enables debug messages and disables message delivery,
295 among others; effectively turns almost any operation into a dry-run.
298 .It Fl E
299 .Ic set
300 .Va skipemptybody
301 and thus discard messages with an empty message part body.
302 This command line option is \*(OB.
305 .It Fl e
306 Just check if mail is present (in the specified or system
307 .Va inbox ) :
308 if yes, return an exit status of zero, a non-zero value otherwise.
309 To restrict the set of mails to consider in this evaluation a message
310 specification can be added with the option
311 .Fl L .
314 .It Fl F
315 Save the message to send in a file named after the local part of the
316 first recipient's address (instead of in
317 .Va record Ns ).
320 .It Fl f
321 Read in the contents of the user's
322 .Mx -sx
323 .Sx "secondary mailbox"
324 .Ev MBOX
325 (or the specified file) for processing;
326 when \*(UA is quit, it writes undeleted messages back to this file
327 (but be aware of the
328 .Va hold
329 option).
330 The optional
331 .Ar file
332 argument will undergo some special
333 .Sx "Filename transformations"
334 (also see
335 .Ic file ) .
336 Note that
337 .Ar file
338 is not a argument to the flag
339 .Fl \&\&f ,
340 but is instead taken from the command line after option processing has
341 been completed.
342 In order to use a
343 .Ar file
344 that starts with a hyphen-minus, prefix with a relative path, as in
345 .Ql ./-hyphenbox.mbox .
348 .It Fl H
349 Display a summary of the
350 .Ic headers
351 of all messages in the specified mailbox or system
352 .Va inbox
353 and exit.
354 A configurable summary view is available via the
355 .Fl L
356 option.
359 .It Fl h
360 Show a short usage summary.
361 Because of widespread use a
362 .Fl Fl help
363 argument will have the same effect.
366 .It Fl i
367 .Ic set
368 .Va ignore
369 to ignore tty interrupt signals.
372 .It Fl L Ar spec-list
373 Display a summary of all
374 .Ic headers
375 of only those messages in the specified mailbox or the system
376 .Va inbox
377 that match the given
378 .Ar spec-list ,
379 then exit.
380 See the section
381 .Sx "Specifying messages"
382 for the format of
383 .Ar spec-list .
384 If the
385 .Fl e
386 (\*(OB or
387 .Fl H )
388 option has been given in addition no header summary is produced,
389 but \*(UA will instead indicate via its exit status whether
390 .Ar spec-list
391 matched any messages
392 .Pf ( Ql 0 )
393 or not
394 .Pf ( Ql 1 ) ;
395 note that any verbose output is suppressed in this mode and must instead
396 be enabled explicitly (e.g., by using the option
397 .Fl v ) .
400 .It Fl M Ar type
401 Special send mode that will flag standard input with the MIME
402 .Ql Content-Type:
403 set to the given
404 .Ar type
405 and use it as the main message body.
406 \*(ID Using this option will bypass processing of
407 .Va message-inject-head ,
408 .Va signature
410 .Va message-inject-tail .
411 Also see
412 .Fl q , m , t .
415 .It Fl m Ar file
416 Special send mode that will MIME classify the specified
417 .Ar file
418 and use it as the main message body.
419 \*(ID Using this option will bypass processing of
420 .Va message-inject-head ,
421 .Va signature
423 .Va message-inject-tail .
424 Also see
425 .Fl q , M , t .
428 .It Fl N
429 inhibit the initial display of message headers when reading mail or
430 editing a mail folder by calling
431 .Ic unset
432 for the internal variable
433 .Va header .
436 .It Fl n
437 Standard flag that inhibits reading the system wide
438 .Pa \*(UR
439 upon startup.
440 The option
441 .Fl \&:
442 allows more control over the startup sequence; also see
443 .Sx "Resource files" .
446 .It Fl q Ar file
447 Special send mode that will initialize the message body with the
448 contents of the specified
449 .Ar file ,
450 which may be standard input
451 .Ql -
452 only in non-interactive context.
453 Also see
454 .Fl M , m , t .
457 .It Fl R
458 Any folder opened will be in read-only mode.
462 .It Fl r Ar from-addr
463 The source address that appears in the
464 .Ql From:
465 .Pf ( Va from )
466 header of a message (or in the
467 .Ql Sender:
468 .Pf ( Va sender )
469 header if the former contains multiple addresses) is not used for
470 relaying and delegating a message over the wire via SMTP, but instead an
471 envelope will enwrap the message content and provide the necessary
472 information (i.e., the RFC 5321 reverse-path, also used to report, e.g.,
473 delivery errors) to transmit the message to its destination(s).
474 Whereas said headers and internal variables will be used by \*(UA to
475 create the envelope if the builtin SMTP
476 .Va mta
477 (Mail-Transfer-Agent) is used, a file-based MTA will instead use the
478 identity of the message-originating user.
480 This command line option can be used to specify the reverse-path, to be
481 passed to a file-based
482 .Va mta
483 when a message is sent, via
484 .Ql -f Ar from-addr .
485 Shall
486 .Ar from-addr
487 include a user name, then the address components will be separated and
488 the name part will be passed to a file-based
489 .Va mta
490 individually via
491 .Ql -F Ar name .
492 The given
493 .Ar from-addr
494 is also assigned to the internal variable
495 .Va from .
496 Many default installations and sites disallow explicit overriding of the
497 user identity which could be adjusted by this option, unless either
498 .Va mta
499 has been configured accordingly, or the user is member of a group with
500 special privileges, respectively.
502 If an empty string is passed as
503 .Ar from-addr
504 then the content of the variable
505 .Va from
506 (or, if that contains multiple addresses,
507 .Va sender )
508 will be evaluated and used for this purpose whenever the file-based
509 .Va mta
510 is contacted.
511 Note that \*(UA by default, without
512 .Fl \&\&r
513 that is, neither passes
514 .Fl \&\&f
516 .Fl \&\&F
517 command line options to a file-based MTA by itself, unless this
518 automatic deduction is enforced by
519 .Ic set Ns
520 ing the internal variable
521 .Va r-option-implicit .
525 .It Fl S Ar var Ns Op = Ns value
526 .Ic set
527 the internal
528 .Ar var Ns
529 iable and, in case of a non-boolean variable which has a value, assign
530 .Ar value
531 to it.
532 Even though
533 .Sx "INTERNAL VARIABLES"
534 .Ic \&\&set
536 .Fl S
537 may be overwritten from within resource files,
538 the command line setting will be reestablished after all resource files
539 have been loaded.
542 .It Fl s Ar subject
543 Specify the subject of the message to be sent.
544 Newline (NL) and carriage-return (CR) bytes are invalid and will be
545 normalized to space (SP) characters.
548 .It Fl t
549 The message given (on standard input) is expected to contain, separated
550 from the message body by an empty line, a message header with
551 .Ql To: ,
552 .Ql Cc: ,
554 .Ql Bcc:
555 fields giving its recipients, which will be added to any recipients
556 specified on the command line.
557 If a message subject is specified via
558 .Ql Subject:
559 then it will be used in favour of one given on the command line.
561 Also understood are
562 .Ql Reply-To:
563 (possibly overriding
564 .Va replyto ) ,
565 .Ql Sender:
566 .Pf ( Va sender ) ,
567 .Ql From:
568 .Pf ( Va from
569 and / or option
570 .Fl r ) .
571 .Ql Message-ID: ,
572 .Ql In-Reply-To: ,
573 .Ql References:
575 .Ql Mail-Followup-To: ,
576 by default created automatically dependent on message context, will
577 be used if specified (a special address massage will however still occur
578 for the latter).
579 Any other custom header field (also see
580 .Va customhdr ,
581 .Ic ~^ )
582 is passed through entirely
583 unchanged, and in conjunction with the option
584 .Fl ~
585 it is possible to embed
586 .Sx "COMMAND ESCAPES" .
587 Also see
588 .Fl M , m , q .
591 .It Fl u Ar user
592 Initially read the
593 .Mx -sx
594 .Sx "primary system mailbox"
596 .Ar user ,
597 appropriate privileges presumed; effectively identical to
598 .Ql -f %user .
601 .It Fl V
602 Show \*(UA's
603 .Va version
604 and exit.
605 The command
606 .Ic version
607 will also show the list of
608 .Va features :
609 .Ql $ \*(uA -Xversion -Xx .
612 .It Fl v
613 .Ic set Ns
614 ting the internal variable
615 .Va verbose
616 enables display of some informational context messages.
617 Using it twice increases the level of verbosity.
620 .It Fl X Ar cmd
621 Add the given (or multiple for a multiline argument)
622 .Ar cmd
623 to the list of commands to be executed,
624 as a last step of program startup, before normal operation starts.
625 This is the only possibility to execute commands in non-interactive mode
626 when reading startup files is actively prohibited.
627 The commands will be evaluated as a unit, just as via
628 .Ic source .
629 Correlates with
630 .Fl #
632 .Va batch-exit-on-error .
635 .It Fl ~
636 Enable
637 .Sx "COMMAND ESCAPES"
638 even if not in interactive mode.
639 This can be used to, e.g., automatically format the composed message
640 text before sending the message:
641 .Bd -literal -offset indent
642 $ ( echo 'line    one. Word.     Word2.'; \e
643     echo '~| /usr/bin/fmt -tuw66' ) |\e
644   LC_ALL=C \*(uA -:/ -Sttycharset=utf-8 -d~ bob@exam.ple
648 .It Fl #
649 Enables batch mode.
650 In batch mode the full set of commands is available, just like in
651 interactive mode, standard input is made line buffered, and diverse
652 .Sx "INTERNAL VARIABLES"
653 are adjusted for batch necessities, e.g., it
654 .Ic set Ns
656 .Va emptystart ,
657 .Pf no Va header ,
658 .Va quiet ,
659 .Va sendwait ,
660 .Va typescript-mode
661 as well as
662 .Ev MAIL ,
663 .Ev MBOX
665 .Va inbox
666 (the latter three to
667 .Pa /dev/null ) ;
668 processing of
669 .Sx "COMMAND ESCAPES"
670 is enabled in compose mode.
671 The following prepares an email message in a batched dry run:
672 .Bd -literal -offset indent
673 $ LC_ALL=C printf 'm bob\en~s ubject\enText\en~.\enx\en' | \e
674   LC_ALL=C \*(uA -:/ -d# -X'alias bob bob@exam.ple'
678 .It Fl \&.
679 This flag forces termination of option processing in order to prevent
680 .Dq option injection
681 (attacks).
682 It also forcefully puts \*(UA into send mode, see
683 .Sx "On sending mail, and non-interactive mode" .
687 Any given
688 .Bk -words
689 .Ar to-addr ...
691 argument, as well as all receivers established by the command line options
692 .Fl b
694 .Fl c ,
695 are subject to checks established via
696 .Va expandaddr ,
697 one of the
698 .Sx "INTERNAL VARIABLES" .
699 .Bk -words
700 .Op Ar mta-option ...
702 arguments that are given at the end of the command line after a
703 .Ql --
704 separator will be passed through to a file-based
705 .Va mta
706 (Mail-Transfer-Agent) and persist for an entire (interactive) session
707 \(en if the setting of the internal variable
708 .Va expandargv
709 allows their recognition; no such constraints apply to the variable
710 .Va mta-arguments .
711 .\" }}}
713 .\" .Ss "A starter" {{{
714 .Ss "A starter"
716 \*(UA is a direct descendant of
718 Mail, a successor of the Research
720 mail which
721 .Dq was there from the start
722 according to
723 .Sx HISTORY .
724 It thus represents the user side of the
726 mail system, whereas the system side (Mail-Transfer-Agent, MTA) was
727 traditionally taken by
728 .Xr sendmail 8 ,
729 and most MTAs provide a binary of this name for compatibility purposes.
730 If the \*(OPal SMTP
731 .Va mta
732 is included in the
733 .Va features
734 of \*(UA then the system side is not a mandatory precondition for mail
735 delivery.
738 Because \*(UA strives for compliance with POSIX
739 .Xr mailx 1
740 it is likely that some configuration settings have to be adjusted before
741 using it is a smooth experience.
742 The default global
743 .Pa \*(UR
744 resource file bends those standard imposed settings of the
745 .Sx "INTERNAL VARIABLES"
746 a bit towards more user friendliness and safety, however, e.g., it
747 .Ic set Ns s
748 .Va hold
750 .Va keepsave
751 in order to suppress the automatic moving of messages to the
752 .Mx -sx
753 .Sx "secondary mailbox"
754 .Ev MBOX
755 that would otherwise occur (see
756 .Sx "Message states" ) ,
758 .Va keep
759 to not remove empty system (MBOX) mailbox files in order not to mangle
760 file permissions when files eventually get recreated \(en
761 \*(UA will remove all empty (MBOX) mailbox files unless this variable is
762 set whenever
763 .Va posix
764 .Pf ( Ev POSIXLY_CORRECT )
765 mode has been enabled.
766 The file mode creation mask is explicitly managed via
767 .Va umask .
770 It also enables
771 .Va sendwait
772 in order to synchronize \*(UA with the exit status report of the used
773 .Va mta
774 when sending mails.
775 It sets
776 .Va emptystart
777 to enter interactive startup even if the initial mailbox is empty,
778 .Va editheaders
779 to allow editing of headers as well as
780 .Va fullnames
781 to not strip down addresses in compose mode, and
782 .Va quote
783 to include the message that is being responded to when
784 .Ic reply Ns
785 ing.
786 The section
787 .Sx EXAMPLES
788 contains some more complete configuration examples.
789 .\" }}}
791 .\" .Ss "On sending mail, and non-interactive mode" {{{
792 .Ss "On sending mail, and non-interactive mode"
794 To send a message to one or more people, using a local or a builtin
795 .Va mta
796 (Mail-Transfer-Agent) transport to actually deliver the generated mail
797 message, \*(UA can be invoked with arguments which are the names of
798 people to whom the mail will be sent, and the command line options
799 .Fl b
801 .Fl c
802 can be used to add (blind) carbon copy receivers:
804 .Bd -literal -offset indent
805 # Via sendmail(1)
806 $ \*(uA -s ubject -a ttach.txt bill@exam.ple
808 # But... try it in an isolated dry-run mode (-d) first
809 $ LC_ALL=C \*(uA -d -:/ -Ssendwait \e
810    -b bcc@exam.ple -c cc@exam.ple \e
811    -. '(Lovely) Bob <bob@exam.ple>' eric@exam.ple
813 # With SMTP
814 $ LC_ALL=C \*(uA -d -:/ -Sv15-compat -Ssendwait \e
815     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=none \e
816     -S from=scriptreply@exam.ple \e
817     -a /etc/mail.rc \e
818     -. eric@exam.ple
822 If standard input is a terminal rather than the message to be sent,
823 the user is expected to type in the message contents.
824 In this compose mode \*(UA treats lines beginning with the character
825 .Ql ~
826 special \(en these are so-called
827 .Sx "COMMAND ESCAPES" ,
828 which can be used to read in files, process shell commands, add and edit
829 attachments and more; e.g., the command escape
830 .Ic ~e
831 will start the text editor to revise the message in its current state,
832 .Ic ~h
833 allows editing of the most important message headers, with
834 .Ic ~^
835 custom headers can be created (more specifically than with
836 .Va customhdr ) .
837 .Ic ~?
838 gives an overview of most other available command escapes.
839 Typing
840 .Ql control-D
841 .Pf ( Ql ^D )
842 at the beginning of an empty line leaves compose mode and causes the
843 message to be sent, whereas typing
844 .Ql control-C
845 .Pf ( Ql ^C )
846 twice will abort the current letter (saving its contents in the file
847 denoted by
848 .Ev DEAD
849 unless
850 .Pf no Va save
851 is set).
854 A number of
855 .Sx ENVIRONMENT
857 .Sx "INTERNAL VARIABLES"
858 can be used to alter default behavior.
859 E.g., messages are sent asynchronously, without supervision, unless the
860 internal variable
861 .Va sendwait
862 is set, therefore send errors will not be recognizable until then.
863 .Ic set Ns
864 ting (also via
865 .Fl S )
866 .Va editalong
867 will automatically startup a text editor when compose mode is entered,
868 .Va editheaders
869 allows editing of headers additionally to plain body content, whereas
870 .Va askcc
872 .Va askbcc
873 will cause the user to be prompted actively for (blind) carbon-copy
874 recipients, respectively, if the given list is empty.
875 .Va on-compose-enter
877 .Va on-compose-leave
878 hook variables may be set to
879 .Ic define Ns
880 d macros to automatically adjust some settings dependent
881 on receiver, sender or subject contexts, and via the
882 .Va on-compose-splice-shell
883 as well as
884 .Va on-compose-splice
885 variables, the latter also to be set to a
886 .Ic define Ns
887 d macro, increasingly powerful mechanisms to perform automated message
888 adjustments are available.
891 Especially for 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; saving a copy of sent messages in a
906 .Va record
907 mailbox may be desirable \(en as for most mailbox
908 .Ic file
909 targets the value will undergo
910 .Sx "Filename transformations" .
911 Defining user email
912 .Ic account Ns s
913 for the purpose of arranging a complete environment of settings that can
914 be switched to with a single command or command line option may be
915 useful (the section
916 .Sx EXAMPLES
917 contains example configurations for sending messages via some of the
918 well-known public mail providers and also gives a compact overview on
919 how to setup a secure SSL/TLS environment).
920 Performing some
921 .Fl d
923 .Va debug
924 sandbox dry-run tests first will prove correctness.
927 The section
928 .Sx "On URL syntax and credential lookup"
929 will spread light on the different ways of how to specify user email
930 account credentials, the
931 .Ql USER@HOST
932 variable chains, and accessing protocol-specific resources,
933 the section
934 .Sx "Character sets"
935 goes into the details of character encoding and how to use them for
936 representing messages and MIME part contents by specifying them in
937 .Va sendcharsets ,
938 and reading the section
939 .Sx "The mime.types files"
940 should help to understand how the MIME-type of outgoing attachments are
941 classified, and what can be done for fine-tuning.
942 Over the wire an intermediate, configurable
943 .Pf content-transfer-\: Va encoding
944 may be applied to the raw message part data.
947 Message recipients (as specified on the command line or defined in
948 .Ql To: ,
949 .Ql Cc:
951 .Ql Bcc: )
952 may not only be email addressees but can also be names of mailboxes and
953 even complete shell command pipe specifications.
954 If the variable
955 .Va expandaddr
956 is not set then only network addresses (see
957 .Xr mailaddr 7
958 for a description of mail addresses) and plain user names (including MTA
959 aliases) may be used, other types will be filtered out, giving a warning
960 message.
961 The command
962 .Ic addrcodec
963 can be used to generate standard compliant network addresses.
965 .\" When changing any of the following adjust any RECIPIENTADDRSPEC;
966 .\" grep the latter for the complete picture
968 If the variable
969 .Va expandaddr
970 is set then extended recipient addresses will optionally be accepted:
971 Any name which starts with a vertical bar
972 .Ql |
973 character specifies a command pipe \(en the command string following the
974 .Ql |
975 is executed and the message is sent to its standard input;
976 Likewise, any name that starts with the character solidus
977 .Ql /
978 or the character sequence dot solidus
979 .Ql ./
980 is treated as a file, regardless of the remaining content;
981 likewise a name that solely consists of a hyphen-minus
982 .Ql - .
983 Any other name which contains a commercial at
984 .Ql @
985 character is treated as a network address;
986 Any other name which starts with a plus sign
987 .Ql +
988 character specifies a mailbox name;
989 Any other name which contains a solidus
990 .Ql /
991 character but no exclamation mark
992 .Ql \&!
993 or percent sign
994 .Ql %
995 character before also specifies a mailbox name;
996 What remains is treated as a network address.
998 .Bd -literal -offset indent
999 $ echo bla | \*(uA -Sexpandaddr -s test ./mbox.mbox
1000 $ echo bla | \*(uA -Sexpandaddr -s test '|cat >> ./mbox.mbox'
1001 $ echo safe | LC_ALL=C \e
1002     \*(uA -:/ -Sv15-compat -Ssendwait \e
1003       -Sexpandaddr=fail,-all,+addr,failinvaddr -s test \e
1004       -. bob@exam.ple
1008 It is possible to create personal distribution lists via the
1009 .Ic alias
1010 command, so that, for instance, the user can send mail to
1011 .Ql cohorts
1012 and have it go to a group of people.
1013 These aliases have nothing in common with the system wide aliases that
1014 may be used by the MTA, which are subject to the
1015 .Ql name
1016 constraint of
1017 .Va expandaddr
1018 and are often tracked in a file
1019 .Pa /etc/aliases
1020 (and documented in
1021 .Xr aliases 5
1023 .Xr sendmail 1 ) .
1024 Personal aliases will be expanded by \*(UA before the message is sent,
1025 and are thus a convenient alternative to specifying each addressee by
1026 itself; they correlate with the active set of
1027 .Ic alternates
1028 and are subject to
1029 .Va metoo
1030 filtering.
1033 .Dl alias cohorts bill jkf mark kridle@ucbcory ~/mail/cohorts.mbox
1036 To avoid environmental noise scripts should
1037 .Dq detach
1038 \*(UA from any configuration files and create a script-local
1039 environment, ideally with the command line options
1040 .Fl \&:
1041 to disable any configuration file in conjunction with repetitions of
1042 .Fl S
1043 to specify variables:
1045 .Bd -literal -offset indent
1046 $ env LC_ALL=C \*(uA -:/ \e
1047     -Sv15-compat -Ssendwait -Sttycharset=utf-8 \e
1048     -Sexpandaddr=fail,-all,failinvaddr \e
1049     -S mta=smtps://mylogin@exam.ple:465 -Ssmtp-auth=login \e
1050     -S from=scriptreply@exam.ple \e
1051     -s 'Subject to go' -a attachment_file \e
1052     -. 'Recipient 1 <rec1@exam.ple>' rec2@exam.ple \e
1053     < content_file
1057 As shown, scripts can
1058 .Dq fake
1059 a locale environment, the above specifies the all-compatible 7-bit clean
1060 .Ev LC_ALL
1061 .Dq C ,
1062 but will nonetheless take and send UTF-8 in the message text by using
1063 .Va ttycharset .
1064 In interactive mode, which is introduced in the next section, messages
1065 can be sent by calling the
1066 .Ic mail
1067 command with a list of recipient addresses \(em the semantics are
1068 completely identical to non-interactive message sending:
1070 .Bd -literal -offset indent
1071 $ \*(uA -d -Squiet -Semptystart
1072 "/var/spool/mail/user": 0 messages
1073 ? mail "Recipient 1 <rec1@exam.ple>", rec2@exam.ple
1074 ? # Will do the right thing (tm)
1075 ? m rec1@exam.ple rec2@exam.ple
1077 .\" }}}
1079 .\" .Ss "On reading mail, and interactive mode" {{{
1080 .Ss "On reading mail, and interactive mode"
1082 When invoked without addressees \*(UA enters interactive mode in which
1083 mails may be read.
1084 When used like that the user's system
1085 .Va inbox
1086 (see the command
1087 .Ic file
1088 for an in-depth description of the different mailbox types that exist)
1089 is read in and a one line header of each message therein is displayed.
1090 The visual style of this summary of
1091 .Ic headers
1092 can be adjusted through the variable
1093 .Va headline
1094 and the possible sorting criterion via
1095 .Va autosort .
1096 Scrolling through
1097 .Va screen Ns
1098 fuls of
1099 .Ic headers
1100 can be performed with the command
1101 .Ic z .
1102 If the initially opened mailbox is empty \*(UA will instead exit
1103 immediately (after displaying a message) unless the variable
1104 .Va emptystart
1105 is set.
1108 At the
1109 .Va prompt
1110 the command
1111 .Ic list
1112 will give a listing of all available commands and
1113 .Ic help
1114 will give a summary of some common ones.
1115 If the \*(OPal documentation strings are available one can type
1116 .Ql help X
1117 .Pf "(or " Ql ?X )
1118 and see the actual expansion of
1119 .Ql X
1120 and what its purpose is, i.e., commands can be abbreviated
1121 (note that POSIX defines some abbreviations, so that the alphabetical
1122 order of commands does not necessarily relate to the abbreviations; it is
1123 possible to define overwrites with the
1124 .Ic ghost
1125 command, however).
1126 These commands can also produce a more
1127 .Va verbose
1128 output.
1131 Messages are given numbers (starting at 1) which uniquely identify
1132 messages; the current message \(en the
1133 .Dq dot
1134 \(en will either be the first new message, or the first unread message,
1135 or the first message of the mailbox; the internal variable
1136 .Va showlast
1137 will instead cause usage of the last message for this purpose.
1138 The command
1139 .Ic headers
1140 will display a
1141 .Va screen Ns
1142 ful of header summaries containing the
1143 .Dq dot ,
1144 whereas
1145 .Ic from
1146 will display only the summaries of the given messages, defaulting to the
1147 .Dq dot .
1150 Message content can be displayed with the command
1151 .Ic type
1152 .Pf ( Ql t ,
1153 alias
1154 .Ic print ) .
1155 Here the variable
1156 .Va crt
1157 controls whether and when \*(UA will use the configured
1158 .Ev PAGER
1159 for display instead of directly writing to the user terminal
1160 .Va screen ,
1161 the sole difference to the command
1162 .Ic more ,
1163 which will always use the
1164 .Ev PAGER .
1165 The command
1166 .Ic top
1167 will instead only show the first
1168 .Va toplines
1169 of a message (maybe even compressed if
1170 .Va topsqueeze
1171 is set).
1174 By default the current message
1175 .Pf ( Dq dot )
1176 is displayed, but like with many other commands it is possible to give
1177 a fancy message specification (see
1178 .Sx "Specifying messages" ) ,
1179 e.g.,
1180 .Ql t:u
1181 will display all unread messages,
1182 .Ql t.
1183 will display the
1184 .Dq dot ,
1185 .Ql t 1 5
1186 will type the messages 1 and 5,
1187 .Ql t 1-5
1188 will type the messages 1 through 5, and
1189 .Ql t-
1191 .Ql t+
1192 will display the last and the next message, respectively.
1193 The command
1194 .Ic search
1195 (a more substantial alias for
1196 .Ic from )
1197 will display a header summary of the given message specification list
1198 instead of their content, e.g., the following will search for subjects:
1201 .Dl from "'@Some subject to search for'"
1204 In the default setup all header fields of a message will be
1205 .Ic type Ns
1206 d, but fields can be white- or blacklisted for a variety of
1207 applications by using the command
1208 .Ic headerpick ,
1209 e.g., to restrict display to a very restricted set:
1210 .Ql Ic \:headerpick Cd \:type retain Ar \:from to cc subject .
1211 In order to display all header fields of a message regardless of
1212 currently active ignore or retain lists, use the commands
1213 .Ic Type
1215 .Ic Top .
1216 Note that historically the global
1217 .Pa \*(UR
1218 not only adjusts the list of displayed headers, but also sets
1219 .Va crt .
1222 Dependent upon the configuration a line editor (see the section
1223 .Sx "On terminal control and line editor" )
1224 aims at making user experience with the many
1225 .Sx COMMANDS
1226 a bit nicer.
1227 When reading the system
1228 .Va inbox
1229 or when
1230 .Fl f
1232 .Ic file )
1233 specified a mailbox explicitly prefixed with the special
1234 .Ql %:
1235 modifier (propagating the mailbox to a
1236 .Mx -sx
1237 .Sx "primary system mailbox" ) ,
1238 then messages which have been read will be moved to a
1239 .Mx -sx
1240 .Sx "secondary mailbox" ,
1241 the users
1242 .Ev MBOX
1243 file, automatically when the mailbox is left, either by changing the
1244 active mailbox or by quitting \*(UA (also see
1245 .Sx "Message states" )
1246 \(en this automatic moving from a system or primary to the secondary
1247 mailbox is not performed when the variable
1248 .Va hold
1249 is set.
1252 After examining a message the user can also
1253 .Ic delete Ql d
1254 the message,
1255 .Ic reply Ql r
1256 to the sender and all recipients or
1257 .Ic Reply Ql R
1258 exclusively to the sender(s).
1259 Messages can also be
1260 .Ic forward Ns
1261 ed (shorter alias is
1262 .Ic fwd Ns ).
1263 Note that when replying to or forwarding a message recipient addresses
1264 will be stripped from comments and names unless the internal variable
1265 .Va fullnames
1266 is set.
1267 Deletion causes \*(UA to forget about the message;
1268 This is not irreversible, though, one can
1269 .Ic undelete Ql u
1270 the message by giving its number,
1271 or the \*(UA session can be ended by giving the
1272 .Ic exit Ql x
1273 command.
1276 To end a mail processing session one may either issue
1277 .Ic quit Ql q
1278 to cause a full program exit, which possibly includes
1279 automatic moving of read messages to the
1280 .Mx -sx
1281 .Sx "secondary mailbox"
1282 .Ev MBOX
1283 as well as updating the \*(OPal line editor
1284 .Va history-file ,
1285 or use the command
1286 .Ic exit Ql x
1287 instead in order to prevent any of these actions.
1288 .\" }}}
1290 .\" .Ss "HTML mail and MIME attachments" {{{
1291 .Ss "HTML mail and MIME attachments"
1293 Messages which are HTML-only get more and more common and of course many
1294 messages come bundled with a bouquet of MIME attachments.
1295 Whereas \*(UA \*(OPally supports a simple HTML-to-text converter to deal
1296 with HTML messages (see
1297 .Sx "The mime.types files" ) ,
1298 it normally cannot deal with any of these itself, but instead programs
1299 need to become registered to deal with specific MIME types or file
1300 extensions.
1301 These programs may either prepare plain text versions of their input
1302 in order to enable \*(UA to display the content on the terminal,
1303 or display the content themselves, for example in a graphical window.
1306 To install an external handler program for a specific MIME type set an
1307 according
1308 .Va pipe-TYPE/SUBTYPE
1309 variable; to instead define a handler for a specific file extension set
1310 the respective
1311 .Va pipe-EXTENSION
1312 variable \(en these handlers take precedence.
1313 \*(OPally \*(UA supports mail user agent configuration as defined in
1314 RFC 1524; this mechanism, documented in the section
1315 .Sx "The Mailcap files" ,
1316 will be queried for display or quote handlers if none of the former two
1317 .\" TODO v15-compat "will be" -> "is"
1318 did; it will be the sole source for handlers of other purpose.
1319 A last source for handlers may be the MIME type definition itself, if
1320 the \*(UA specific type-marker extension was used when defining the type
1321 with the command
1322 .Ic mimetype .
1323 (Many of the builtin MIME types do so by default.)
1326 The variable
1327 .Va mime-counter-evidence
1328 can be set to improve dealing with faulty MIME part declarations as are
1329 often seen in real-life messages.
1330 E.g., to display a HTML message inline (that is, converted to a more
1331 fancy plain text representation than the builtin converter is capable to
1332 produce) with either of the text-mode browsers
1333 .Xr lynx 1
1335 .Xr elinks 1 ,
1336 teach \*(UA about MathML documents and make it display them as plain
1337 text, and to open PDF attachments in an external PDF viewer,
1338 asynchronously and with some other magic attached:
1340 .Bd -literal -offset indent
1341 if [ "$features" !@ +filter-html-tagsoup ]
1342   #set pipe-text/html='elinks -force-html -dump 1'
1343   set pipe-text/html='lynx -stdin -dump -force_html'
1344   # Display HTML as plain text instead
1345   #set pipe-text/html=@
1346 endif
1347 mimetype '@ application/mathml+xml mathml'
1348 wysh set pipe-application/pdf='@&=@ \e
1349   trap "rm -f \e"${MAILX_FILENAME_TEMPORARY}\e"" EXIT;\e
1350   trap "trap \e"\e" INT QUIT TERM; exit 1" INT QUIT TERM;\e
1351   mupdf "${MAILX_FILENAME_TEMPORARY}"'
1355 Note: special care must be taken when using such commands as mail
1356 viruses may be distributed by this method: if messages of type
1357 .Ql application/x-sh
1358 or files with the extension
1359 .Ql .sh
1360 were blindly filtered through the shell, for example, a message sender
1361 could easily execute arbitrary code on the system \*(UA is running on.
1362 For more on MIME, also in respect to sending of messages, see the
1363 sections
1364 .Sx "The mime.types files" ,
1365 .Sx "The Mailcap files"
1366 and the command
1367 .Ic mimetype .
1368 .\" }}}
1370 .\" .Ss "Mailing lists" {{{
1371 .Ss "Mailing lists"
1373 \*(UA offers some support to ease handling of mailing lists.
1374 The command
1375 .Ic mlist
1376 promotes all given arguments to known mailing lists, and
1377 .Ic mlsubscribe
1378 sets their subscription attribute, creating them first as necessary.
1379 (On the other hand
1380 .Ic unmlsubscribe
1381 does not
1382 .Ic unmlist
1383 automatically, but only resets the subscription attribute.)
1384 Using the commands without arguments will show (a subset of) all
1385 currently defined mailing lists.
1387 .Va headline
1388 format
1389 .Ql \&%T
1390 can be used to mark out messages with configured list addresses
1391 in the header display.
1394 \*(OPally mailing lists may also be specified as (extended) regular
1395 expressions, which allows matching of many addresses with a single
1396 expression.
1397 However, all fully qualified list addresses are matched via a fast
1398 dictionary, whereas expressions are placed in (a) list(s) which is
1399 (are) matched sequentially.
1401 .Bd -literal -offset indent
1402 set followup-to followup-to-honour=ask-yes reply-to-honour=ask-yes
1403 wysh mlist a1@b1.c1 a2@b2.c2 '.*@lists\e.c3$'
1404 mlsubscribe a4@b4.c4 exact@lists.c3
1408 The variable
1409 .Va followup-to-honour
1410 will ensure that a
1411 .Ql Mail-\:Followup-\:To:
1412 header is honoured when the message is being replied to (via
1413 .Ic reply
1415 .Ic Lreply )
1417 .Va followup-to
1418 controls whether this header is created when sending mails; it will be
1419 created automatically for a couple of reasons, too, like when the
1420 special
1421 .Dq mailing list specific
1422 respond command
1423 .Ic Lreply
1424 is used, when
1425 .Ic reply
1426 is used to respond to a message with its
1427 .Ql Mail-Followup-To:
1428 being honoured etc.
1431 A difference in between the handling of known and subscribed lists is
1432 that the address of the sender is usually not part of a generated
1433 .Ql Mail-Followup-To:
1434 when addressing the latter, whereas it is for the former kind of lists.
1435 Usually because there are exceptions: say, if multiple lists are
1436 addressed and not all of them are subscribed lists.
1438 For convenience \*(UA will, temporarily, automatically add a list
1439 address that is presented in the
1440 .Ql List-To:
1441 header of a message that is being responded to to the list of known
1442 mailing lists.
1443 Shall that header have existed \*(UA will instead, dependent on the
1444 variable
1445 .Va reply-to-honour ,
1446 use an also set
1447 .Ql Reply-To:
1448 for this purpose in order to accept a list administrators' wish that
1449 is supposed to have been manifested like that (but only if it provides
1450 a single address which resides on the same domain as what is stated in
1451 .Ql List-To: ) .
1452 .\" }}}
1454 .\" .Ss "Resource files" {{{
1455 .Ss "Resource files"
1457 Upon startup \*(UA reads in several resource files:
1459 .Bl -tag -width ".It Pa BaNg"
1461 .It Pa \*(UR
1462 System wide initialization file.
1463 Reading of this file can be suppressed, either by using the
1464 .Fl \&:
1465 (and according argument) or
1466 .Fl n
1467 command line options, or by setting the
1468 .Sx ENVIRONMENT
1469 variable
1470 .Ev MAILX_NO_SYSTEM_RC .
1473 .It Pa \*(ur
1474 File giving initial commands.
1475 A different file can be chosen by setting the
1476 .Sx ENVIRONMENT
1477 variable
1478 .Ev MAILRC .
1479 Reading of this file can be suppressed with the
1480 .Fl \&:
1481 command line option.
1483 .It Va mailx-extra-rc
1484 Can be used to define an optional startup file to be read after all
1485 other resource files.
1486 It can be used to specify settings that are not understood by other
1487 .Xr mailx 1
1488 implementations, for example.
1489 This variable is only honoured when defined in a resource file, e.g.,
1490 it is one of the
1491 .Sx "INTERNAL VARIABLES" .
1495 The content of these files is interpreted as follows:
1498 .Bl -bullet -compact
1500 A lines' leading whitespace is removed.
1502 Empty lines are ignored.
1504 Any other line is interpreted as a command.
1505 It may be spread over multiple input lines if the newline character is
1506 .Dq escaped
1507 by placing a reverse solidus character
1508 .Ql \e
1509 as the last character of the line; whereas any leading whitespace of
1510 follow lines is ignored, trailing whitespace before a escaped newline
1511 remains in the input.
1513 If the line (content) starts with the number sign
1514 .Ql #
1515 then it is a comment-command \(en a real command! \(en and also ignored.
1516 This command is the only form of comment that is understood.
1520 Unless \*(UA is about to enter interactive mode syntax errors that occur
1521 while loading these files are treated as errors and cause program exit.
1522 More files with syntactically equal content can be
1523 .Ic source Ns ed .
1524 The following, saved in a file, would be an examplary content:
1526 .Bd -literal -offset indent
1527  # This line is a comment command.  And y\e
1528     es, it is really continued here.
1529 set debug \e
1530     verbose
1531     set editheaders
1533 .\" }}}
1535 .\" .Ss "Character sets" {{{
1536 .Ss "Character sets"
1538 \*(OP \*(UA detects the character set of the terminal by using
1539 mechanisms that are controlled by the
1540 .Ev LC_CTYPE
1541 locale setting
1542 (the manual for
1543 .Xr setlocale 3
1544 should give an overview); the \*(UA internal variable
1545 .Va ttycharset
1546 will be set to the detected terminal character set accordingly
1547 and will thus show up in the output of the commands
1548 .Ic set
1550 .Ic varshow .
1553 However, a user supplied
1554 .Va ttycharset
1555 value is not overwritten by this detection mechanism: this
1556 .Dq feature
1557 must be used if the detection does not work properly,
1558 and it may be used to adjust the name of the locale character set.
1559 E.g., on BSD systems one may use a locale with the character set
1560 ISO8859-1, which is not a valid name for this character set; to be on
1561 the safe side, one may set
1562 .Va ttycharset
1563 to the correct name, which is ISO-8859-1.
1566 Note that changing the value does not mean much beside that,
1567 since several aspects of the real character set are implied by the
1568 locale environment of the system,
1569 and that stays unaffected by the content of an overwritten
1570 .Va ttycharset
1571 variable.
1572 (This is mostly an issue when interactively using \*(UA, though.
1573 It is actually possible to send mail in a completely
1574 .Dq faked
1575 locale environment, an option that \*(UA's test-suite uses excessively.)
1578 If no character set conversion capabilities have been compiled into
1579 \*(UA
1580 .Pf ( Va features
1581 does not include the term
1582 .Ql +iconv ) ,
1583 then
1584 .Va ttycharset
1585 will be the only supported character set,
1586 it is simply assumed that it can be used to exchange 8-bit messages
1587 (over the wire an intermediate
1588 .Pf content-transfer-\: Va encoding
1589 may be applied),
1590 and the rest of this section does not apply;
1591 it may however still be necessary to explicitly set it if automatic
1592 detection fails, since in that case it defaults to the mentioned
1593 .\" (Keep in SYNC: ./nail.1:"Character sets", ./nail.h:CHARSET_*!)
1594 ISO-8859-1.
1597 When reading messages, their text is converted into
1598 .Va ttycharset
1599 as necessary in order to display them on the users terminal.
1600 Unprintable characters and invalid byte sequences are detected
1601 and replaced by proper substitution characters.
1602 Character set mappings for source character sets can be established with
1603 the command
1604 .Ic charsetalias ,
1605 which may be handy to work around faulty character set catalogues (e.g.,
1606 to add a missing LATIN1 to ISO-8859-1 mapping), or to enforce treatment
1607 of one character set as another one (e.g., to interpret LATIN1 as CP1252).
1608 Also see
1609 .Va charset-unknown-8bit
1610 to deal with another hairy aspect of message interpretation.
1613 When sending messages all their parts and attachments are classified.
1614 Whereas no character set conversion is performed on those parts which
1615 appear to be binary data,
1616 the character set being used must be declared within the MIME header of
1617 an outgoing text part if it contains characters that do not conform to
1618 the set of characters that are allowed by the email standards.
1619 Permissible values for character sets can be declared using the
1620 .Va sendcharsets
1621 variable, and
1622 .Va charset-8bit ,
1623 which defines a catch-all last-resort fallback character set that is
1624 implicitly appended to the list of character sets in
1625 .Va sendcharsets .
1628 When replying to a message and the variable
1629 .Va reply-in-same-charset
1630 is set then the character set of the message being replied to is tried
1631 first (after mapping via
1632 .Ic charsetalias ) .
1633 And it is also possible to make \*(UA work even more closely related to
1634 the current locale setting automatically by using the variable
1635 .Va sendcharsets-else-ttycharset ,
1636 please see there for more information.
1639 All the specified character sets are tried in order unless the
1640 conversion of the part or attachment succeeds.
1641 If none of the tried (8-bit) character sets is capable to represent the
1642 content of the part or attachment,
1643 then the message will not be sent and its text will optionally be
1644 .Va save Ns d
1646 .Ev DEAD .
1647 In general, if the message
1648 .Dq Cannot convert from a to b
1649 appears, either some characters are not appropriate for the currently
1650 selected (terminal) character set,
1651 or the needed conversion is not supported by the system.
1652 In the first case, it is necessary to set an appropriate
1653 .Ev LC_CTYPE
1654 locale and/or the variable
1655 .Va ttycharset .
1658 The best results are usually achieved when \*(UA is run in a UTF-8
1659 locale on a UTF-8 capable terminal, in which case the full Unicode
1660 spectrum of characters is available.
1661 In this setup characters from various countries can be displayed,
1662 while it is still possible to use more simple character sets for sending
1663 to retain maximum compatibility with older mail clients.
1666 On the other hand the POSIX standard defines a locale-independent 7-bit
1667 .Dq portable character set
1668 that should be used when overall portability is an issue, the even more
1669 restricted subset named
1670 .Dq portable filename character set
1671 consisting of A-Z, a-z, 0-9, period
1672 .Ql \&. ,
1673 underscore
1674 .Ql _
1675 and hyphen-minus
1676 .Ql - .
1677 .\" }}}
1679 .\" .Ss "Message states" {{{
1680 .Ss "Message states"
1682 \*(UA differentiates in between several different message states;
1683 the current state will be reflected in header summary displays if
1684 .Va headline
1685 is configured to do so (via the internal variable
1686 .Va attrlist ) ,
1687 and messages can also be selected and be acted upon depending on their
1688 state (see
1689 .Sx "Specifying messages" ) .
1690 When operating on the system
1691 .Va inbox ,
1692 or in any other
1693 .Mx -sx
1694 .Sx "primary system mailbox" ,
1695 special actions, like the automatic moving of messages to the
1696 .Mx -sx
1697 .Sx "secondary mailbox"
1698 .Ev MBOX ,
1699 may be applied when the mailbox is left (also implicitly via
1700 a successful exit of \*(UA, but not if the special command
1701 .Ic exit
1702 is used) \(en however, because this may be irritating to users which
1703 are used to
1704 .Dq more modern
1705 mail-user-agents, the default global
1706 .Pa \*(UR
1707 sets the internal
1708 .Va hold
1710 .Va keepsave
1711 variables in order to suppress this behaviour.
1713 .Bl -hang -width ".It Ql new"
1714 .It Ql new
1715 Message has neither been viewed nor moved to any other state.
1716 Such messages are retained even in the
1717 .Mx -sx
1718 .Sx "primary system mailbox" .
1720 .It Ql unread
1721 Message has neither been viewed nor moved to any other state, but the
1722 message was present already when the mailbox has been opened last:
1723 Such messages are retained even in the
1724 .Mx -sx
1725 .Sx "primary system mailbox" .
1727 .It Ql read
1728 The message has been processed by one of the following commands:
1729 .Ic ~f ,
1730 .Ic ~m ,
1731 .Ic ~F ,
1732 .Ic ~M ,
1733 .Ic copy ,
1734 .Ic mbox ,
1735 .Ic next ,
1736 .Ic pipe  ,
1737 .Ic Print ,
1738 .Ic print ,
1739 .Ic top ,
1740 .Ic Type ,
1741 .Ic type ,
1742 .Ic undelete .
1743 The commands
1744 .Ic dp
1746 .Ic dt
1747 will always try to automatically
1748 .Dq step
1750 .Ic type
1752 .Dq next
1753 logical message, and may thus mark multiple messages as read, the
1754 .Ic delete
1755 command will do so if  the internal variable
1756 .Va autoprint
1757 is set.
1758 Except when the
1759 .Ic exit
1760 command is used, messages that are in a
1761 .Mx -sx
1762 .Sx "primary system mailbox"
1763 and are in
1764 .Ql read
1765 state when the mailbox is left will be saved in the
1766 .Mx -sx
1767 .Sx "secondary mailbox"
1768 .Ev MBOX
1769 unless the internal variable
1770 .Va hold
1771 it set.
1773 .It Ql deleted
1774 The message has been processed by one of the following commands:
1775 .Ic delete ,
1776 .Ic dp ,
1777 .Ic dt .
1778 Only
1779 .Ic undelete
1780 can be used to access such messages.
1782 .It Ql preserved
1783 The message has been processed by a
1784 .Ic preserve
1785 command and it will be retained in its current location.
1787 .It Ql saved
1788 The message has been processed by one of the following commands:
1789 .Ic save
1791 .Ic write .
1792 Unless when the
1793 .Ic exit
1794 command is used, messages that are in a
1795 .Mx -sx
1796 .Sx "primary system mailbox"
1797 and are in
1798 .Ql saved
1799 state when the mailbox is left will be deleted; they will be saved in the
1800 .Mx -sx
1801 .Sx "secondary mailbox"
1802 .Ev MBOX
1803 when the internal variable
1804 .Va keepsave
1805 is set.
1809 In addition to these message states, flags which otherwise have no
1810 technical meaning in the mail system except allowing special ways of
1811 addressing them when
1812 .Sx "Specifying messages"
1813 can be set on messages.
1814 These flags are saved with messages and are thus persistent, and are
1815 portable between a set of widely used MUAs.
1817 .Bl -hang -width ".It Ic answered"
1818 .It Ic answered
1819 Mark messages as having been answered.
1820 .It Ic draft
1821 Mark messages as being a draft.
1822 .It Ic flag
1823 Mark messages which need special attention.
1825 .\" }}}
1827 .\" .Ss "Specifying messages" {{{
1828 .Ss "Specifying messages"
1830 Commands such as
1831 .Ic from ,
1832 .Ic type
1834 .Ic delete
1835 can be given a list of message numbers as arguments to apply to a number
1836 of messages at once.
1837 Thus
1838 .Ql delete 1 2
1839 deletes messages 1 and 2,
1840 whereas
1841 .Ql delete 1-5
1842 will delete the messages 1 through 5.
1843 In sorted or threaded mode (see the
1844 .Ic sort
1845 command),
1846 .Ql delete 1-5
1847 will delete the messages that are located between (and including)
1848 messages 1 through 5 in the sorted/threaded order, as shown in the
1849 .Ic headers
1850 summary.
1851 The following special message names exist:
1854 .Bl -tag -width ".It Ar BaNg"
1855 .It Ar \&.
1856 The current message, the so-called
1857 .Dq dot .
1859 .It Ar \&;
1860 The message that was previously the current message.
1862 .It Ar \&,
1863 The parent message of the current message,
1864 that is the message with the Message-ID given in the
1865 .Ql In-Reply-To:
1866 field or the last entry of the
1867 .Ql References:
1868 field of the current message.
1870 .It Ar -
1871 The next previous undeleted message,
1872 or the next previous deleted message for the
1873 .Ic undelete
1874 command.
1875 In sorted/threaded mode,
1876 the next previous such message in the sorted/threaded order.
1878 .It Ar +
1879 The next undeleted message,
1880 or the next deleted message for the
1881 .Ic undelete
1882 command.
1883 In sorted/threaded mode,
1884 the next such message in the sorted/threaded order.
1886 .It Ar ^
1887 The first undeleted message,
1888 or the first deleted message for the
1889 .Ic undelete
1890 command.
1891 In sorted/threaded mode,
1892 the first such message in the sorted/threaded order.
1894 .It Ar $
1895 The last message.
1896 In sorted/threaded mode,
1897 the last message in the sorted/threaded order.
1899 .It Ar & Ns Ar x
1900 In threaded mode,
1901 selects the message addressed with
1902 .Ar x ,
1903 where
1904 .Ar x
1905 is any other message specification,
1906 and all messages from the thread that begins at it.
1907 Otherwise it is identical to
1908 .Ar x .
1910 .Ar x
1911 is omitted,
1912 the thread beginning with the current message is selected.
1914 .It Ar *
1915 All messages.
1916 .It Ar `
1917 All messages that were included in the
1918 .Sx "Message list arguments"
1919 of the previous command.
1921 .It Ar x-y
1922 An inclusive range of message numbers.
1923 Selectors that may also be used as endpoints include any of
1924 .Ar .;-+^$ .
1926 .It Ar address
1927 A case-insensitive
1928 .Dq any substring matches
1929 search against the
1930 .Ql From:
1931 header, which will match addresses (too) even if
1932 .Va showname
1933 is set (and POSIX says
1934 .Dq any address as shown in a header summary shall be matchable in this form ) ;
1935 However, if the
1936 .Va allnet
1937 variable is set, only the local part of the address is evaluated
1938 for the comparison, not ignoring case, and the setting of
1939 .Va showname
1940 is completely ignored.
1941 For finer control and match boundaries use the
1942 .Ql @
1943 search expression.
1945 .It Ar / Ns Ar string
1946 All messages that contain
1947 .Ar string
1948 in the subject field (case ignored).
1949 See also the
1950 .Va searchheaders
1951 variable.
1953 .Ar string
1954 is empty,
1955 the string from the previous specification of that type is used again.
1957 .It Xo Op Ar @ Ns Ar name-list Ns
1958 .Ar @ Ns Ar expr
1960 All messages that contain the given case-insensitive search
1961 .Ar expr Ns
1962 ession; if the \*(OPal regular expression (see
1963 .Xr re_format 7 )
1964 support is available
1965 .Ar expr
1966 will be interpreted as (an extended) one if any of the
1967 .Dq magical
1968 (extended) regular expression characters is seen: in this case this
1969 should match strings correctly which are in the locale
1970 .Ev LC_CTYPE
1971 encoding.
1972 If the optional
1973 .Ar @ Ns Ar name-list
1974 part is missing, the search is restricted to the subject field body,
1975 but otherwise
1976 .Ar name-list
1977 specifies a comma-separated list of header fields to search, as in
1979 .Dl '@to,from,cc@Someone i ought to know'
1981 In order to search for a string that includes a
1982 .Ql @
1983 (commercial at) character the
1984 .Ar name-list
1985 is effectively non-optional, but may be given as the empty string.
1986 Some special header fields may be abbreviated:
1987 .Ql f ,
1988 .Ql t ,
1989 .Ql c ,
1990 .Ql b
1992 .Ql s
1993 will match
1994 .Ql From ,
1995 .Ql To ,
1996 .Ql Cc ,
1997 .Ql Bcc
1999 .Ql Subject ,
2000 respectively and case-insensitively.
2001 The special names
2002 .Ql header
2004 .Ql <
2005 can be used to search in (all of) the header(s) of the message, and the
2006 special names
2007 .Ql body
2009 .Ql >
2011 .Ql text
2013 .Ql =
2014 can be used to perform full text searches \(en whereas the former
2015 searches only the body, the latter also searches the message header.
2017 This message specification performs full text comparison, but even with
2018 regular expression support it is almost impossible to write a search
2019 expression that savely matches only a specific address domain.
2020 To request that the content of the header is treated as a list of
2021 addresses, and to strip those down to the plain email address which the
2022 search expression is to be matched against, prefix the header name
2023 (abbreviation) with a tilde
2024 .Ql ~ :
2026 .Dl @~f@@a\e.safe\e.domain\e.match$
2028 .It Ar :c
2029 All messages of state
2030 .Ql c ,
2031 where
2032 .Ql c
2033 is one or multiple of the following colon modifiers:
2035 .Bl -tag -compact -width ".It Ar :M"
2036 .It Ar n
2037 .Ql new
2038 messages.
2039 .It Ar o
2040 Old messages (any not in state
2041 .Ql read
2043 .Ql new ) .
2044 .It Ar u
2045 .Ql unread
2046 messages.
2047 .It Ar d
2048 .Ql deleted
2049 messages (for the
2050 .Ic undelete
2052 .Ic from
2053 commands only).
2054 .It Ar r
2055 .Ql read
2056 messages.
2057 .It Ar f
2058 .Ic flag Ns
2059 ged messages.
2060 .It Ar a
2061 .Ic answered
2062 messages (cf. the variable
2063 .Va markanswered ) .
2064 .It Ar t
2065 Messages marked as
2066 .Ic draft .
2067 .It Ar s
2068 \*(OP Messages classified as spam (see
2069 .Sx "Handling spam" . )
2070 .It Ar S
2071 \*(OP Messages with unsure spam classification.
2077 \*(OP IMAP-style SEARCH expressions may also be used.
2078 This addressing mode is available with all types of folders;
2079 \*(UA will perform the search locally as necessary.
2080 Strings must be enclosed by double quotes
2081 .Ql \&"
2082 in their entirety if they contain white space or parentheses;
2083 within the quotes, only reverse solidus
2084 .Ql \e
2085 is recognized as an escape character.
2086 All string searches are case-insensitive.
2087 When the description indicates that the
2088 .Dq envelope
2089 representation of an address field is used,
2090 this means that the search string is checked against both a list
2091 constructed as
2093 .Bd -literal -offset indent
2094 (\*qname\*q \*qsource\*q \*qlocal-part\*q \*qdomain-part\*q)
2098 for each address,
2099 and the addresses without real names from the respective header field.
2100 These search expressions can be nested using parentheses, see below for
2101 examples.
2104 .Bl -tag -compact -width ".It Ar _n_u"
2105 .It Ar ( criterion )
2106 All messages that satisfy the given
2107 .Ar criterion .
2108 .It Ar ( criterion1 criterion2 ... criterionN )
2109 All messages that satisfy all of the given criteria.
2111 .It Ar ( or criterion1 criterion2 )
2112 All messages that satisfy either
2113 .Ar criterion1
2115 .Ar criterion2 ,
2116 or both.
2117 To connect more than two criteria using
2118 .Ql or
2119 specifications have to be nested using additional parentheses,
2120 as with
2121 .Ql (or a (or b c)) ,
2122 since
2123 .Ql (or a b c)
2124 really means
2125 .Ql ((a or b) and c) .
2126 For a simple
2127 .Ql or
2128 operation of independent criteria on the lowest nesting level,
2129 it is possible to achieve similar effects by using three separate
2130 criteria, as with
2131 .Ql (a) (b) (c) .
2133 .It Ar ( not criterion )
2134 All messages that do not satisfy
2135 .Ar criterion .
2136 .It Ar ( bcc \*q Ns Ar string Ns Ar \*q )
2137 All messages that contain
2138 .Ar string
2139 in the envelope representation of the
2140 .Ql Bcc:
2141 field.
2142 .It Ar ( cc \*q Ns Ar string Ns Ar \*q )
2143 All messages that contain
2144 .Ar string
2145 in the envelope representation of the
2146 .Ql Cc:
2147 field.
2148 .It Ar ( from \*q Ns Ar string Ns Ar \*q )
2149 All messages that contain
2150 .Ar string
2151 in the envelope representation of the
2152 .Ql From:
2153 field.
2154 .It Ar ( subject \*q Ns Ar string Ns Ar \*q )
2155 All messages that contain
2156 .Ar string
2157 in the
2158 .Ql Subject:
2159 field.
2160 .It Ar ( to \*q Ns Ar string Ns Ar \*q )
2161 All messages that contain
2162 .Ar string
2163 in the envelope representation of the
2164 .Ql To:
2165 field.
2166 .It Ar ( header name \*q Ns Ar string Ns Ar \*q )
2167 All messages that contain
2168 .Ar string
2169 in the specified
2170 .Ql Name:
2171 field.
2172 .It Ar ( body \*q Ns Ar string Ns Ar \*q )
2173 All messages that contain
2174 .Ar string
2175 in their body.
2176 .It Ar ( text \*q Ns Ar string Ns Ar \*q )
2177 All messages that contain
2178 .Ar string
2179 in their header or body.
2180 .It Ar ( larger size )
2181 All messages that are larger than
2182 .Ar size
2183 (in bytes).
2184 .It Ar ( smaller size )
2185 All messages that are smaller than
2186 .Ar size
2187 (in bytes).
2189 .It Ar ( before date )
2190 All messages that were received before
2191 .Ar date ,
2192 which must be in the form
2193 .Ql d[d]-mon-yyyy ,
2194 where
2195 .Ql d
2196 denotes the day of the month as one or two digits,
2197 .Ql mon
2198 is the name of the month \(en one of
2199 .Ql Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ,
2201 .Ql yyyy
2202 is the year as four digits, e.g.,
2203 .Ql 28-Dec-2012 .
2205 .It Ar ( on date )
2206 All messages that were received on the specified date.
2207 .It Ar ( since date )
2208 All messages that were received since the specified date.
2209 .It Ar ( sentbefore date )
2210 All messages that were sent on the specified date.
2211 .It Ar ( senton date )
2212 All messages that were sent on the specified date.
2213 .It Ar ( sentsince date )
2214 All messages that were sent since the specified date.
2215 .It Ar ()
2216 The same criterion as for the previous search.
2217 This specification cannot be used as part of another criterion.
2218 If the previous command line contained more than one independent
2219 criterion then the last of those criteria is used.
2221 .\" }}}
2223 .\" .Ss "On URL syntax and credential lookup" {{{
2224 .Ss "On URL syntax and credential lookup"
2226 \*(IN For accessing protocol-specific resources usage of Uniform
2227 Resource Locators (URL, RFC 1738) has become omnipresent.
2228 \*(UA expects and understands URLs in the following form;
2229 parts in brackets
2230 .Ql []
2231 denote optional parts, optional either because there also exist other
2232 ways to define the information in question or because support of the
2233 part is protocol-specific (e.g.,
2234 .Ql /path
2235 is used by the IMAP protocol but not by POP3);
2236 If any of
2237 .Ql USER
2239 .Ql PASSWORD
2240 are specified they must be given in URL percent encoded form (RFC 3986;
2241 the command
2242 .Ic urlcodec
2243 may be helpful):
2246 .Dl PROTOCOL://[USER[:PASSWORD]@]server[:port][/path]
2249 Note that these \*(UA URLs most often do not conform to any real
2250 standard, but instead represent a normalized variant of RFC 1738 \(en
2251 they are not used in data exchange but only meant as a compact,
2252 easy-to-use way of defining and representing information in
2253 a well-known notation.
2256 Many internal variables of \*(UA exist in multiple versions, called
2257 variable chains for the rest of this document: the plain
2258 .Ql variable
2259 as well as
2260 .Ql variable-HOST
2262 .Ql variable-USER@HOST .
2263 Here
2264 .Ql HOST
2265 indeed means
2266 .Ql server:port
2267 if a
2268 .Ql port
2269 had been specified in the respective URL, otherwise it refers to the plain
2270 .Ql server .
2271 Also,
2272 .Ql USER
2273 is not truly the
2274 .Ql USER
2275 that had been found when doing the user chain lookup as is described
2276 below, i.e., this
2277 .Ql USER
2278 will never be in URL percent encoded form, whether it came from an URL
2279 or not; i.e., variable chain name extensions of
2280 .Sx "INTERNAL VARIABLES"
2281 must not be URL percent encoded.
2284 For example, whether an hypothetical URL
2285 .Ql smtp://hey%3Ayou@our.house
2286 had been given that includes a user, or whether the URL was
2287 .Ql smtp://our.house
2288 and the user had been found differently, to lookup the variable chain
2289 .Va smtp-use-starttls
2290 \*(UA first looks for whether
2291 .Ql smtp-\:use-\:starttls-\:hey:you@our.house
2292 is defined, then whether
2293 .Ql smtp-\:use-\:starttls-\:our.house
2294 exists before finally ending up looking at the plain variable itself.
2297 \*(UA obeys the following logic scheme when dealing with the
2298 necessary credential information of an account:
2300 .Bl -bullet
2302 If no
2303 .Ql USER
2304 has been given in the URL the variables
2305 .Va user-HOST
2307 .Va user
2308 are looked up; if no such variable(s) can be found then \*(UA will,
2309 when enforced by the \*(OPal variables
2310 .Va netrc-lookup-HOST
2312 .Va netrc-lookup ,
2313 search the users
2314 .Pa .netrc
2315 file for a
2316 .Ql HOST
2317 specific entry which provides a
2318 .Ql login
2319 name: this lookup will only succeed if unambiguous (one possible matching
2320 entry for
2321 .Ql HOST ) .
2322 It is possible to load encrypted
2323 .Pa .netrc
2324 files via
2325 .Va netrc-pipe .
2327 If there is still no
2328 .Ql USER
2329 then \*(UA will fall back to the user who is supposed to run \*(UA,
2330 the identity of which has been fixated during \*(UA startup and is
2331 known to be a valid user on the current host.
2334 Authentication: unless otherwise noted this will lookup the
2335 .Va PROTOCOL-auth-USER@HOST , PROTOCOL-auth-HOST , PROTOCOL-auth
2336 variable chain, falling back to a protocol-specific default should this
2337 have no success.
2340 If no
2341 .Ql PASSWORD
2342 has been given in the URL, then if the
2343 .Ql USER
2344 has been found through the \*(OPal
2345 .Va netrc-lookup
2346 that may have already provided the password, too.
2347 Otherwise the variable chain
2348 .Va password-USER@HOST , password-HOST , password
2349 is looked up and used if existent.
2351 Afterwards the complete \*(OPal variable chain
2352 .Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
2353 is looked up.
2354 If set, the
2355 .Pa .netrc
2356 cache is searched for a password only (multiple user accounts for
2357 a single machine may exist as well as a fallback entry without user
2358 but with a password).
2360 If at that point there is still no password available, but the
2361 (protocols') chosen authentication type requires a password, then in
2362 interactive mode the user will be prompted on the terminal.
2366 .Sy Note:
2367 S/MIME verification works relative to the values found in the
2368 .Ql From:
2370 .Ql Sender: )
2371 header field(s), which means that the values of
2372 .Va smime-sign , smime-sign-cert , smime-sign-include-certs
2374 .Va smime-sign-message-digest
2375 will not be looked up using the
2376 .Ql USER
2378 .Ql HOST
2379 chains from above but instead use the corresponding values from the
2380 message that is being worked on.
2381 In unusual cases multiple and different
2382 .Ql USER
2384 .Ql HOST
2385 combinations may therefore be involved \(en on the other hand those
2386 unusual cases become possible.
2387 The usual case is as short as:
2390 .Dl set mta=smtp://USER:PASS@HOST smtp-use-starttls \e
2391 .Dl \ \ \ \ smime-sign smime-sign-cert=+smime.pair
2394 The section
2395 .Sx EXAMPLES
2396 contains complete example configurations.
2397 .\" }}}
2399 .\" .Ss "On terminal control and line editor" {{{
2400 .Ss "On terminal control and line editor"
2402 \*(OP Terminal control will be realized through one of the standard
2404 libraries, either the
2405 .Lb libtermcap ,
2406 or, alternatively, the
2407 .Lb libterminfo ,
2408 both of which will be initialized to work with the environment variable
2409 .Ev TERM .
2410 Terminal control will enhance or enable interactive usage aspects, e.g.,
2411 .Sx "Coloured display" ,
2412 and extend behaviour of the Mailx-Line-Editor (MLE), which may learn the
2413 byte-sequences of keys like the cursor and function keys, and which will
2414 automatically enter the so-called
2415 .Dq ca-mode
2416 alternative screen shall the terminal support it.
2417 The internal variable
2418 .Va termcap
2419 can be used to overwrite settings or to learn (correct(ed)) keycodes.
2420 Actual interaction with the chosen library can be disabled completely by
2421 setting the internal variable
2422 .Va termcap-disable ;
2423 .Va termcap
2424 will be queried regardless, even if the \*(OPal support for the
2425 libraries has not been enabled at configuration time.
2428 \*(OP The builtin \*(UA Mailx-Line-Editor (MLE) should work in all
2429 environments which comply to the ISO C standard
2430 .St -isoC-amd1 ,
2431 and will support wide glyphs if possible (the necessary functionality
2432 had been removed from ISO C, but was included in
2433 .St -xpg4 ) .
2434 Prevent usage of a line editor in interactive mode by setting the
2435 internal variable
2436 .Va line-editor-disable .
2437 Especially if the \*(OPal terminal control support is missing setting
2438 entries in the internal variable
2439 .Va termcap
2440 will help shall the MLE misbehave, see there for more.
2441 The MLE can support a little bit of
2442 .Ic colour .
2445 \*(OP If the
2446 .Ic history
2447 feature is available then input from line editor prompts will be saved
2448 in a history list that can be searched in and be expanded from.
2449 Such saving can be prevented by prefixing input with any amount of
2450 whitespace.
2451 Aspects of history, like allowed content and maximum size, as well as
2452 whether history shall be saved persistently, can be configured with the
2453 internal variables
2454 .Va history-file ,
2455 .Va history-gabby ,
2456 .Va history-gabby-persist
2458 .Va history-size .
2461 The MLE supports a set of editing and control commands.
2462 By default (as) many (as possible) of these will be assigned to a set of
2463 single-letter control codes, which should work on any terminal (and can
2464 be generated by holding the
2465 .Dq control
2466 key while pressing the key of desire, e.g.,
2467 .Ql control-D ) .
2468 If the \*(OPal
2469 .Ic bind
2470 command is available then the MLE commands can also be accessed freely
2471 by assigning the command name, which is shown in parenthesis in the list
2472 below, to any desired key-sequence, and the MLE will instead and also use
2473 .Ic bind
2474 to establish its builtin key bindings
2475 (more of them if the \*(OPal terminal control is available),
2476 an action which can then be suppressed completely by setting
2477 .Va line-editor-no-defaults .
2478 .Sx "Shell-style argument quoting"
2479 notation is used in the following;
2480 combinations not mentioned either cause job control signals or do not
2481 generate a (unique) keycode:
2485 .Bl -tag -compact -width ".It Ql Ba"
2486 .It Ql \ecA
2487 Go to the start of the line
2489 .Pf ( Cd mle-go-home ) .
2491 .It Ql \ecB
2492 Move the cursor backward one character
2494 .Pf ( Cd mle-go-bwd ) .
2496 .It Ql \ecD
2497 Forward delete the character under the cursor;
2498 quits \*(UA if used on the empty line unless the internal variable
2499 .Va ignoreeof
2500 is set
2502 .Pf ( Cd mle-del-fwd ) .
2504 .It Ql \ecE
2505 Go to the end of the line
2507 .Pf ( Cd mle-go-end ) .
2509 .It Ql \ecF
2510 Move the cursor forward one character
2512 .Pf ( Cd mle-go-fwd ) .
2514 .It Ql \ecG
2515 Cancel current operation, full reset.
2516 If there is an active history search or tabulator expansion then this
2517 command will first reset that, reverting to the former line content;
2518 thus a second reset is needed for a full reset in this case
2520 .Pf ( Cd mle-reset ) .
2522 .It Ql \ecH
2523 Backspace: backward delete one character
2525 .Pf ( Cd mle-del-bwd ) .
2527 .It Ql \ecI
2528 \*(NQ
2529 Horizontal tabulator:
2530 try to expand the word before the cursor, supporting the usual
2531 .Sx "Filename transformations"
2533 .Pf ( Cd mle-complete ) .
2534 This is affected by
2535 .Cd mle-quote-rndtrip .
2537 .It Ql \ecJ
2538 Newline:
2539 commit the current line
2541 .Pf ( Cd mle-commit ) .
2543 .It Ql \ecK
2544 Cut all characters from the cursor to the end of the line
2546 .Pf ( Cd mle-snarf-end ) .
2548 .It Ql \ecL
2549 Repaint the line
2551 .Pf ( Cd mle-repaint ) .
2553 .It Ql \ecN
2554 \*(OP Go to the next history entry
2556 .Pf ( Cd mle-hist-fwd ) .
2558 .It Ql \ecO
2559 (\*(OPally context-dependent) Invokes the command
2560 .Ql Ic dt .
2562 .It Ql \ecP
2563 \*(OP Go to the previous history entry
2565 .Pf ( Cd mle-hist-bwd ) .
2567 .It Ql \ecQ
2568 Toggle roundtrip mode shell quotes, where produced,
2569 on and off
2571 .Pf ( Cd mle-quote-rndtrip ) .
2572 This setting is temporary, and will be forgotten once the command line
2573 is committed; also see
2574 .Ic shcodec .
2576 .It Ql \ecR
2577 \*(OP Complete the current line from (the remaining) older history entries
2579 .Pf ( Cd mle-hist-srch-bwd ) .
2581 .It Ql \ecS
2582 \*(OP Complete the current line from (the remaining) newer history entries
2584 .Pf ( Cd mle-hist-srch-fwd ) .
2586 .It Ql \ecT
2587 Paste the snarf buffer
2589 .Pf ( Cd mle-paste ) .
2591 .It Ql \ecU
2592 The same as
2593 .Ql \ecA
2594 followed by
2595 .Ql \ecK
2597 .Pf ( Cd mle-snarf-line ) .
2599 .It Ql \ecV
2600 Prompts for a Unicode character (its hexadecimal number) to be inserted
2602 .Pf ( Cd mle-prompt-char ) .
2603 Note this command needs to be assigned to a single-letter control code
2604 in order to become recognized and executed during input of
2605 a key-sequence (only three single-letter control codes can be used for
2606 that shortcut purpose); this control code is special-treated and cannot
2607 be part of any other sequence, because any occurrence will perform the
2608 .Cd mle-prompt-char
2609 function immediately.
2611 .It Ql \ecW
2612 Cut the characters from the one preceding the cursor to the preceding
2613 word boundary
2615 .Pf ( Cd mle-snarf-word-bwd ) .
2617 .It Ql \ecX
2618 Move the cursor forward one word boundary
2620 .Pf ( Cd mle-go-word-fwd ) .
2622 .It Ql \ecY
2623 Move the cursor backward one word boundary
2625 .Pf ( Cd mle-go-word-bwd ) .
2627 .It Ql \ec[
2628 Escape: reset a possibly used multibyte character input state machine
2629 and \*(OPally a lingering, incomplete key binding
2631 .Pf ( Cd mle-cancel ) .
2632 This command needs to be assigned to a single-letter control code in
2633 order to become recognized and executed during input of a key-sequence
2634 (only three single-letter control codes can be used for that shortcut
2635 purpose).
2636 This control code may also be part of a multi-byte sequence, but if
2637 a sequence is active and the very control code is currently also an
2638 expected input, then it will first be consumed by the active sequence.
2640 .It Ql \ec\e
2641 (\*(OPally context-dependent) Invokes the command
2642 .Ql Ic z Ns + .
2644 .It Ql \ec]
2645 (\*(OPally context-dependent) Invokes the command
2646 .Ql Ic z Ns $ .
2648 .It Ql \ec^
2649 (\*(OPally context-dependent) Invokes the command
2650 .Ql Ic z Ns 0 .
2652 .It Ql \ec_
2653 Cut the characters from the one after the cursor to the succeeding word
2654 boundary
2656 .Pf ( Cd mle-snarf-word-fwd ) .
2658 .It Ql \ec?
2659 Backspace:
2660 .Cd mle-del-bwd .
2662 .It \(en
2664 .Cd mle-fullreset :
2665 in difference to
2666 .Cd mle-reset
2667 this will immediately reset a possibly active search etc.
2669 .It \(en
2671 .Cd mle-bell :
2672 ring the audible bell.
2674 .\" }}}
2676 .\" .Ss "Coloured display" {{{
2677 .Ss "Coloured display"
2679 \*(OP \*(UA can be configured to support a coloured display and font
2680 attributes by emitting ANSI / ISO 6429 SGR (select graphic rendition)
2681 escape sequences.
2682 Usage of colours and font attributes solely depends upon the
2683 capability of the detected terminal type that is defined by the
2684 environment variable
2685 .Ev TERM
2686 and which can be fine-tuned by the user via the internal variable
2687 .Va termcap .
2690 On top of what \*(UA knows about the terminal the boolean variable
2691 .Va colour-pager
2692 defines whether the actually applicable colour and font attribute
2693 sequences should also be generated when output is going to be paged
2694 through the external program defined by the environment variable
2695 .Ev PAGER
2696 (also see
2697 .Va crt Ns
2699 This is not enabled by default because different pager programs need
2700 different command line switches or other configuration in order to
2701 support those sequences.
2702 \*(UA however knows about some widely used pagers and in a clean
2703 environment it is often enough to simply set
2704 .Va colour-pager ;
2705 please refer to that variable for more on this topic.
2708 If the variable
2709 .Va colour-disable
2710 is set then any active usage of colour and font attribute sequences
2711 is suppressed, but without affecting possibly established
2712 .Ic colour
2713 mappings.
2716 To define and control colours and font attributes a single multiplexer
2717 command family exists:
2718 .Ic colour
2719 shows or defines colour mappings for the given colour type (e.g.,
2720 monochrome) and
2721 .Ic uncolour
2722 can be used to remove mappings of a given colour type.
2723 Since colours are only available in interactive mode, it may make
2724 sense to conditionalize the colour setup by encapsulating it with
2725 .Ic if :
2727 .Bd -literal -offset indent
2728 if terminal && $features =@ +colour
2729   colour iso  view-msginfo  ft=bold,fg=green
2730   colour iso  view-header   ft=bold,fg=red   "from,subject"
2731   colour iso  view-header   fg=red
2733   uncolour iso view-header  from,subject
2734   colour iso  view-header   ft=bold,fg=magenta,bg=cyan
2735   colour 256  view-header   ft=bold,fg=208,bg=230 subject,from
2736   colour mono view-header   ft=bold
2737   colour mono view-header   ft=bold,ft=reverse subject,from
2738 endif
2740 .\" }}}
2741 .\" }}} (DESCRIPTION)
2744 .\" .Sh COMMANDS {{{
2745 .Sh COMMANDS
2747 Each command is typed on a line by itself,
2748 and may take arguments following the command word.
2749 An unquoted reverse solidus
2750 .Ql \e
2751 at the end of a command line
2752 .Dq escapes
2753 the newline character: it is discarded and the next line of input is
2754 used as a follow-up line, with all leading whitespace removed;
2755 once the entire command line is completed, the processing that is
2756 documented in the following begins.
2759 Command names may be abbreviated, in which case the first command that
2760 matches the given prefix will be used.
2761 The command
2762 .Ic list
2763 can be used to show the list of all commands, either alphabetically
2764 sorted or in prefix search order (these do not match, also because the
2765 POSIX standard prescribes a set of abbreviations).
2766 \*(OPally the command
2767 .Ic help
2769 .Ic \&? ) ,
2770 when given an argument, will show a documentation string for the
2771 command matching the expanded argument, as in
2772 .Ql ?t ,
2773 which should be a shorthand of
2774 .Ql ?type ;
2775 with these documentation strings both commands support a more
2776 .Va verbose
2777 listing mode which includes the argument type of the command and other
2778 information which applies; a handy suggestion might thus be:
2780 .Bd -literal -offset indent
2781 ? define __xv {
2782   # Be careful to choose sh(1)ell-style on _entire_ line!
2783   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
2785 ? ghost xv '\ecall __xv'
2786 ? xv help set
2789 .\" .Ss "Command modifiers" {{{
2790 .Ss "Command modifiers"
2792 Commands may be prefixed by one or multiple command modifiers.
2795 .Bl -bullet
2797 The modifier reverse solidus
2799 .Cm \e ,
2800 to be placed first, prevents
2801 .Ic ghost
2802 expansions on the remains of the line, e.g.,
2803 .Ql \eecho
2804 will always evaluate the command
2805 .Ic echo ,
2806 even if a ghost of the same name exists.
2807 .Ic ghost
2808 content may itself contain further command modifiers, including
2809 an initial reverse solidus to prevent further expansions.
2812 The modifier
2814 .Cm ignerr
2815 indicates that any error generated by the following command should be
2816 ignored by the state machine, via, e.g.,
2817 .Va batch-exit-on-error .
2818 .Va \&? ,
2819 one of the many
2820 .Sx "INTERNAL VARIABLES" ,
2821 will be set to the real exit status of the command regardless.
2824 Some commands support the
2826 .Cm vput
2827 modifier: if used, they expect the name of a variable, which can itself
2828 be a variable, i.e., shell expansion is applied, as their first
2829 argument, and will place their computation result in it instead of the
2830 default location (it is usually written to standard output).
2831 The given name will be tested for being a valid
2832 .Xr sh 1
2833 variable name, and may therefore only consist of upper- and lowercase
2834 characters, digits, and the underscore; the hyphen-minus may be used as
2835 a non-portable extension; digits may not be used as first, hyphen-minus
2836 may not be used as last characters.
2837 In addition the name may either not be one of the known
2838 .Sx "INTERNAL VARIABLES" ,
2839 or must otherwise refer to a writable (non-boolean) value variable.
2840 It is a hard error that is tracked in
2841 .Va \&?
2842 if any of these tests fail.
2843 The actual put operation may fail nonetheless, e.g., if the variable
2844 expects a number argument only a number will be accepted.
2845 Some commands may report this as a hard failure in
2846 .Va \&? ,
2847 but most will use the soft exit status
2848 .Va \&!
2849 to indicate these failures.
2852 Last, but not least, the modifier
2854 .Cm wysh
2855 can be used for some old and established commands to choose the new
2856 .Sx "Shell-style argument quoting"
2857 rules over the traditional
2858 .Sx "Old-style argument quoting" .
2860 .\" }}}
2862 .\" .Ss "Message list arguments" {{{
2863 .Ss "Message list arguments"
2865 Some commands expect arguments that represent messages (actually
2866 their symbolic message numbers), as has been documented above under
2867 .Sx "Specifying messages"
2868 already.
2869 If no explicit message list has been specified, the next message
2870 forward that satisfies the command's requirements will be used,
2871 and if there are no messages forward of the current message,
2872 the search proceeds backwards;
2873 if there are no good messages at all to be found, an error message is
2874 shown and the command is aborted.
2875 .\" }}}
2877 .\" .Ss "Old-style argument quoting" {{{
2878 .Ss "Old-style argument quoting"
2880 \*(ID This section documents the old, traditional style of quoting
2881 non-message-list arguments to commands which expect this type of
2882 arguments: whereas still used by the majority of such commands, the new
2883 .Sx "Shell-style argument quoting"
2884 may be available even for those via
2885 .Cm wysh ,
2886 one of the
2887 .Sx "Command modifiers" .
2888 Nonetheless care must be taken, because only new commands have been
2889 designed with all the capabilities of the new quoting rules in mind,
2890 which can, e.g., generate control characters.
2893 .Bl -bullet -offset indent
2895 An argument can be enclosed between paired double-quotes
2896 .Ql """argument"""
2898 single-quotes
2899 .Ql 'argument' ;
2900 any white space, shell word expansion, or reverse solidus characters
2901 (except as described next) within the quotes are treated literally as
2902 part of the argument.
2903 A double-quote will be treated literally within single-quotes and vice
2904 versa.
2905 Inside such a quoted string the actually used quote character can be
2906 used nonetheless by escaping it with a reverse solidus
2907 .Ql \e ,
2908 as in
2909 .Ql """y\e""ou""" .
2912 An argument that is not enclosed in quotes, as above, can usually still
2913 contain space characters if those spaces are reverse solidus escaped, as in
2914 .Ql you\e are .
2917 A reverse solidus outside of the enclosing quotes is discarded
2918 and the following character is treated literally as part of the argument.
2920 .\" }}}
2922 .\" .Ss "Shell-style argument quoting" {{{
2923 .Ss "Shell-style argument quoting"
2925 Commands which don't expect message-list arguments use
2926 .Xr sh 1 Ns
2927 ell-style, and therefore POSIX standardized, argument parsing and
2928 quoting rules.
2929 \*(ID Most new commands only support these new rules and are flagged
2930 \*(NQ, some elder ones can use them with the command modifier
2931 .Cm wysh ;
2932 in the future only this type of argument quoting will remain.
2935 A command line is parsed from left to right and an input token is
2936 completed whenever an unquoted, otherwise ignored, metacharacter is seen.
2937 Metacharacters are vertical bar
2938 .Cm \&| ,
2939 ampersand
2940 .Cm & ,
2941 semicolon
2942 .Cm \&; ,
2943 as well as
2944 .Cm space , tabulator , newline .
2945 The additional metacharacters left and right parenthesis
2946 .Cm \&( , \&)
2947 and less-than and greater-than signs
2948 .Cm < , >
2949 that the
2950 .Xr sh 1
2951 supports are not used, and are treated as ordinary characters: for one
2952 these characters are a vivid part of email addresses, and it also seems
2953 highly unlikely that their function will become meaningful to \*(UA.
2956 Any unquoted number sign
2957 .Ql #
2958 at the beginning of a new token starts a comment that extends to the end
2959 of the line, and therefore ends argument processing.
2960 An unquoted dollar sign
2961 .Ql $
2962 will cause variable expansion of the given name, which must be a valid
2963 .Xr sh 1 Ns
2964 ell-style variable name (see
2965 .Cm vput ) :
2966 .Sx "INTERNAL VARIABLES"
2967 as well as
2968 .Sx ENVIRONMENT
2969 (shell) variables can be accessed through this mechanism, brace
2970 enclosing the name is supported (i.e., to subdivide a token).
2973 Whereas the metacharacters
2974 .Cm space , tabulator , newline
2975 only complete an input token, vertical bar
2976 .Cm \&| ,
2977 ampersand
2978 .Cm &
2979 and semicolon
2980 .Cm \&;
2981 also act as control operators and perform control functions.
2982 For now supported is semicolon
2983 .Cm \&; ,
2984 which terminates a single command, therefore sequencing the command line
2985 and making the remainder of the line a subject to reevaluation.
2986 With sequencing, multiple command argument types and quoting rules may
2987 therefore apply to a single line, which can become problematic before
2988 v15: e.g., the first of the following will cause surprising results.
2991 .Dl ? echo one; set verbose; echo verbose=$verbose.
2992 .Dl ? echo one; wysh set verbose; echo verbose=$verbose.
2995 Quoting is a mechanism that will remove the special meaning of
2996 metacharacters and reserved words, and will prevent expansion.
2997 There are four quoting mechanisms: the escape character, single-quotes,
2998 double-quotes and dollar-single-quotes:
3001 .Bl -bullet -offset indent
3003 The literal value of any character can be preserved by preceding it
3004 with the escape character reverse solidus
3005 .Ql \e .
3008 Arguments which are enclosed in
3009 .Ql 'single-\:quotes'
3010 retain their literal value.
3011 A single-quote cannot occur within single-quotes.
3014 The literal value of all characters enclosed in
3015 .Ql \(dqdouble-\:quotes\(dq
3016 is retained, with the exception of dollar sign
3017 .Ql $ ,
3018 which will cause variable expansion, as above, backquote (grave accent)
3019 .Ql ` ,
3020 (which not yet means anything special), reverse solidus
3021 .Ql \e ,
3022 which will escape any of the characters dollar sign
3023 .Ql $
3024 (to prevent variable expansion), backquote (grave accent)
3025 .Ql ` ,
3026 double-quote
3027 .Ql \(dq
3028 (to prevent ending the quote) and reverse solidus
3029 .Ql \e
3030 (to prevent escaping, i.e., to embed a reverse solidus character as-is),
3031 but has no special meaning otherwise.
3034 Arguments enclosed in
3035 .Ql $'dollar-\:single-\:quotes'
3036 extend normal single quotes in that reverse solidus escape sequences are
3037 expanded as follows:
3039 .Bl -tag -compact -width "Ql \eNNN"
3040 .It Ql \ea
3041 alerts (bell).
3042 .It Ql \eb
3043 emits a backspace.
3044 .It Ql \eE
3045 an escape character.
3046 .It Ql \ee
3047 an escape character.
3048 .It Ql \ef
3049 form feed.
3050 .It Ql \en
3051 new line.
3052 .It Ql \er
3053 carriage return.
3054 .It Ql \et
3055 horizontal tab.
3056 .It Ql \ev
3057 vertical tab.
3058 .It Ql \e\e
3059 emits a reverse solidus character.
3060 .It Ql \e'
3061 single quote.
3062 .It Ql \e"
3063 double quote (escaping is optional).
3064 .It Ql \eNNN
3065 eight-bit byte with the octal value
3066 .Ql NNN
3067 (one to three octal digits), optionally prefixed by an additional
3068 .Ql 0 .
3069 A 0 byte will suppress further output for the quoted argument.
3070 .It Ql \exHH
3071 eight-bit byte with the hexadecimal value
3072 .Ql HH
3073 (one or two hexadecimal characters).
3074 A 0 byte will suppress further output for the quoted argument.
3075 .It Ql \eUHHHHHHHH
3076 the Unicode / ISO-10646 character with the hexadecimal codepoint value
3077 .Ql HHHHHHHH
3078 (one to eight hexadecimal digits) \(em note that Unicode defines the
3079 maximum codepoint ever to be supported as
3080 .Ql 0x10FFFF
3081 (in planes of
3082 .Ql 0xFFFF
3083 characters each).
3084 This escape is only supported in locales which support Unicode (see
3085 .Sx "Character sets" ) ,
3086 in other cases the sequence will remain unexpanded unless the given code
3087 point is ASCII compatible or can be represented in the current locale.
3088 The character NUL will suppress further output for the quoted argument.
3089 .It Ql \euHHHH
3090 Identical to
3091 .Ql \eUHHHHHHHH
3092 except it takes only one to four hexadecimal digits.
3093 .It Ql \ecX
3094 Emits the non-printable (ASCII and compatible) C0 control codes
3095 0 (NUL) to 31 (US), and 127 (DEL).
3096 Printable representations of ASCII control codes can be created by
3097 mapping them to a different part of the ASCII character set, which is
3098 possible by adding the number 64 for the codes 0 to 31, e.g., 7 (BEL) is
3099 .Ql 7 + 64 = 71 = G .
3100 The real operation is a bitwise logical XOR with 64 (bit 7 set, see
3101 .Ic vexpr ) ,
3102 thus also covering code 127 (DEL), which is mapped to 63 (question mark):
3103 .Ql ? vexpr ^ 127 64 .
3105 Whereas historically circumflex notation has often been used for
3106 visualization purposes of control codes, e.g.,
3107 .Ql ^G ,
3108 the reverse solidus notation has been standardized:
3109 .Ql \ecG .
3110 Some control codes also have standardized (ISO 10646, ISO C) aliases,
3111 as shown above (e.g.,
3112 .Ql \ea ,
3113 .Ql \en ,
3114 .Ql \et ) :
3115 whenever such an alias exists it will be used for display purposes.
3116 The control code NUL
3117 .Pf ( Ql \ec@ ,
3118 a non-standard extension) ends argument processing without producing
3119 further output.
3120 .It Ql \e$NAME
3121 Non-standard extension: expand the given variable name, as above.
3122 Brace enclosing the name is supported.
3123 .It Ql \e`{command}
3124 Not yet supported, just to raise awareness: Non-standard extension.
3129 Caveats:
3131 .Bd -literal -offset indent
3132 echo 'Quotes '${HOME}' and 'tokens" differ!"# no comment
3133 echo Quotes ${HOME} and tokens differ! # comment
3134 echo Don"'"t you worry$'\ex21' The sun shines on us. $'\eu263A'
3136 .\" }}}
3138 .\" .Ss "Raw data arguments for codec commands" {{{
3139 .Ss "Raw data arguments for codec commands"
3141 A special set of commands, which all have the string
3142 .Dq codec
3143 in their name, e.g.,
3144 .Ic addrcodec ,
3145 .Ic shcodec ,
3146 .Ic urlcodec ,
3147 take raw string data as input, which means that the content of the
3148 command input line is passed completely unexpanded and otherwise
3149 unchanged: like this the effect of the actual codec is visible without
3150 any noise of possible shell quoting rules etc., i.e., the user can input
3151 one-to-one the desired or questionable data.
3152 To gain a level of expansion, the entire command line can be
3153 .Ic eval Ns
3154 uated first, e.g.,
3156 .Bd -literal -offset indent
3157 ? vput shcodec res encode /usr/Sch\[:o]nes Wetter/heute.txt
3158 ? echo $res
3159 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3160 ? shcodec d $res
3161 $'/usr/Sch\eu00F6nes Wetter/heute.txt'
3162 ? eval shcodec d $res
3163 /usr/Sch\[:o]nes Wetter/heute.txt
3165 .\" }}}
3167 .\" .Ss "Filename transformations" {{{
3168 .Ss "Filename transformations"
3170 Filenames, where expected, and unless documented otherwise, are
3171 subsequently subject to the following filename transformations, in
3172 sequence:
3174 .Bl -bullet -offset indent
3176 If the given name is a registered
3177 .Ic shortcut ,
3178 it will be replaced with the expanded shortcut.
3181 The filename is matched against the following patterns or strings:
3183 .Bl -hang -compact -width ".Ar %user"
3184 .It Ar #
3185 (Number sign) is expanded to the previous file.
3186 .It Ar %
3187 (Percent sign) is replaced by the invoking
3188 .Mx -ix "primary system mailbox"
3189 user's primary system mailbox, which either is the (itself expandable)
3190 .Va inbox
3191 if that is set, the standardized absolute pathname indicated by
3192 .Ev MAIL
3193 if that is set, or a builtin compile-time default otherwise.
3194 .It Ar %user
3195 Expands to the primary system mailbox of
3196 .Ar user
3197 (and never the value of
3198 .Va inbox ,
3199 regardless of its actual setting).
3200 .It Ar &
3201 (Ampersand) is replaced with the invoking users
3202 .Mx -ix "secondary mailbox"
3203 secondary mailbox, the
3204 .Ev MBOX .
3205 .It Ar +file
3206 Refers to a
3207 .Ar file
3208 in the
3209 .Va folder
3210 directory (if that variable is set).
3211 .It Ar %:filespec
3212 Expands to the same value as
3213 .Ar filespec ,
3214 but has special meaning when used with, e.g., the command
3215 .Ic file :
3216 the file will be treated as a primary system mailbox by, e.g., the
3217 .Ic mbox
3219 .Ic save
3220 commands, meaning that messages that have been read in the current
3221 session will be moved to the
3222 .Ev MBOX
3223 mailbox instead of simply being flagged as read.
3227 Meta expansions are applied to the resulting filename, as applicable to
3228 the resulting file access protocol (also see
3229 .Sx "On URL syntax and credential lookup" ) .
3230 If the fully expanded filename results in multiple pathnames and the
3231 command is expecting only one file, an error results.
3233 For the file-protocol, a leading tilde
3234 .Ql ~
3235 character will be replaced by the expansion of
3236 .Ev HOME ,
3237 except when followed by a valid user name, in which case the home
3238 directory of the given user is used instead.
3240 Any occurrence of
3241 .Ql $VARIABLE
3243 .Ql ${VARIABLE} )
3244 will be replaced by the expansion of the variable, if possible;
3245 .Sx "INTERNAL VARIABLES"
3246 as well as
3247 .Sx ENVIRONMENT
3248 (shell) variables can be accessed through this mechanism, and the usual
3249 escape mechanism has to be applied to prevent interpretation.
3251 In interactive context, in order to allow simple value acceptance (via
3252 .Dq ENTER ) ,
3253 arguments will usually be displayed in a properly quoted form, e.g., a file
3254 .Ql diet\e is \ecurd.txt
3255 may be displayed as
3256 .Ql 'diet\e is \ecurd.txt' .
3258 .\" }}}
3260 .\" .Ss "Commands" {{{
3261 .Ss "Commands"
3263 The following commands are available:
3265 .Bl -tag -width ".It Ic BaNg"
3267 .It Ic \&!
3268 Executes the
3269 .Ev SHELL
3270 command which follows, replacing unescaped exclamation marks with the
3271 previously executed command if the internal variable
3272 .Va bang
3273 is set.
3276 .It Ic #
3277 The comment-command causes the entire line to be ignored.
3278 .Sy Note:
3279 this really is a normal command which' purpose is to discard its
3280 arguments, not a
3281 .Dq comment-start
3282 indicating special character, which means that, e.g., trailing comments
3283 on a line are not possible.
3286 .It Ic +
3287 Goes to the next message in sequence and types it
3288 (like
3289 .Dq ENTER ) .
3292 .It Ic -
3293 Display the preceding message, or the n'th previous message if given
3294 a numeric argument n.
3297 .It Ic =
3298 Show the current message number (the
3299 .Dq dot ) .
3302 .It Ic \&?
3303 Show a brief summary of commands.
3304 \*(OP Given an argument a synopsis for the command in question is
3305 shown instead; commands can be abbreviated in general and this command
3306 can be used to see the full expansion of an abbreviation including the
3307 synopsis, try, e.g.,
3308 .Ql ?h ,
3309 .Ql ?hel
3311 .Ql ?help
3312 and see how the output changes.
3313 This mode also supports a more
3314 .Va verbose
3315 output, which will provide the informations documented for
3316 .Ic list .
3319 .It Ic \&|
3320 A synonym for the
3321 .Ic pipe
3322 command.
3325 .It Ic ~
3326 \*(NQ Interprets the remainder of the word as a macro name and passes
3327 it through to the
3328 .Ic call
3329 command; e.g.,
3330 .Ql ~ Ns Ar mymacro
3331 is a shorter synonym for
3332 .Ql call Ar mymacro .
3336 .It Ic account , unaccount
3337 (ac, una) Creates, selects or lists (an) account(s).
3338 Accounts are special incarnations of
3339 .Ic define Ns d
3340 macros and group commands and variable settings which together usually
3341 arrange the environment for the purpose of creating an email account.
3342 Different to normal macros settings which are covered by
3343 .Ic localopts
3344 \(en here by default enabled! \(en will not be reverted before the
3345 .Ic account
3346 is changed again.
3347 The special account
3348 .Ql null
3349 (case-insensitive) always exists, and all but it can be deleted by the
3350 latter command, and in one operation with the special name
3351 .Ql * .
3353 Without arguments a listing of all defined accounts is shown.
3354 With one argument the given account is activated: the system
3355 .Va inbox
3356 of that account will be activated (as via
3357 .Ic file ) ,
3358 a possibly installed
3359 .Va folder-hook
3360 will be run, and the internal variable
3361 .Va account
3362 will be updated.
3363 The two argument form is identical to defining a macro as via
3364 .Ic define :
3365 .Bd -literal -offset indent
3366 account myisp {
3367   set folder=~/mail inbox=+syste.mbox record=+sent.mbox
3368   set from='(My Name) myname@myisp.example'
3369   set mta=smtp://mylogin@smtp.myisp.example
3374 .It Ic addrcodec
3375 Perform email address codec transformations on raw-data argument, rather
3376 according to email standards (RFC 5322; \*(ID will furtherly improve).
3377 Supports
3378 .Cm vput
3379 (see
3380 .Sx "Command modifiers" ) .
3381 The return status is tracked via
3382 .Va \&! .
3383 The first argument must be either
3384 .Ar [+[+]]e[ncode]
3386 .Ar d[ecode]
3387 and specifies the operation to perform on the rest of the line.
3388 Decoding will show how a standard-compliant MUA will display the given
3389 argument, which should be a prepared address.
3390 Please be aware that most MUAs have difficulties with the address
3391 standards, and vary wildly when (comments) in parenthesis,
3392 .Dq double-quoted
3393 strings, or quoted-pairs, as below, become involved.
3394 \*(ID \*(UA currently does not perform decoding when displaying addresses.
3396 Encoding supports three different modes, lesser automated versions can be
3397 chosen by prefixing one or two plus signs: the standard imposes
3398 a special meaning on some characters, which thus have to be transformed
3399 to so-called quoted-pairs by pairing them with a reverse solidus
3400 .Ql \e
3401 in order to remove the special meaning; this might change interpretation
3402 of the entire argument from what has been desired, however!
3403 Specify one plus sign to remark that double quotation marks are not be
3404 turned into quoted-pairs, and two for also leaving any user-specified
3405 reverse solidus alone.
3406 The result will always be valid, if a successful exit status is reported.
3407 \*(ID Addresses need to be specified in between angle brackets
3408 .Ql < ,
3409 .Ql >
3410 if the construct becomes more difficult, otherwise the current parser
3411 will fail; it is not smart enough to guess right.
3412 .Bd -literal -offset indent
3413 ? addrc enc "Hey, you",<diet@exam.ple>\e out\e there
3414 "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3415 ? addrc d "\e"Hey, you\e", \e\e out\e\e there" <diet@exam.ple>
3416 "Hey, you", \e out\e there <diet@exam.ple>
3421 .It Ic alias , unalias
3422 (a, una) Aliases are a method of creating personal distribution lists
3423 that map a single alias name to none to multiple real receivers;
3424 these aliases become expanded after message composing is completed.
3425 The latter command removes the given list of aliases, the special name
3426 .Ql *
3427 will discard all existing aliases.
3428 The former command shows all currently defined aliases when used without
3429 arguments, and with one argument the expansion of the given alias.
3430 With more than one argument, creates or appends to the alias name given
3431 as the first argument the remaining arguments.
3432 Alias names are restricted to alphabetic characters, digits, the
3433 underscore, hyphen-minus, the number sign, colon, commercial at and
3434 period, the last character can also be the dollar sign:
3435 .Ql [[:alnum:]_#:@.-]+$? .
3438 .It Ic alternates
3439 (alt) Manage a list of alternate addresses or names of the active user,
3440 members of which will be removed from recipient lists when replying to
3441 messages (and the
3442 .Va metoo
3443 variable is not set).
3444 Without arguments the current set of alternates is displayed, otherwise
3445 the set of alternate names is replaced by the given arguments, and the
3446 internal variable
3447 .Va alternates
3448 is updated accordingly.
3452 .It Ic answered , unanswered
3453 Take a message lists and mark each message as having been answered,
3454 having not been answered, respectively.
3455 Messages will be marked answered when being
3456 .Ic reply Ns d
3457 to automatically if the
3458 .Va markanswered
3459 variable is set.
3460 See the section
3461 .Sx "Message states" .
3466 .It Ic bind , unbind
3467 \*(OP\*(NQ The bind command extends the MLE (see
3468 .Sx "On terminal control and line editor" )
3469 with freely configurable key bindings.
3470 The latter command removes from the given context the given key binding,
3471 both of which may be specified as a wildcard
3472 .Ql * ,
3473 so that, e.g.,
3474 .Ql unbind * *
3475 will remove all bindings of all contexts.
3476 With one argument the former command shows all key bindings for the
3477 given context, specifying an asterisk
3478 .Ql *
3479 will show the bindings of all contexts; a more verbose listing will be
3480 produced if either of
3481 .Va debug
3483 .Va verbose
3484 are set.
3485 With two or more arguments a binding is (re)established:
3486 the first argument is the context to which the binding shall apply,
3487 the second argument is a comma-separated list of the
3488 .Dq keys
3489 which form the binding, and any remaining arguments form the expansion.
3490 To indicate that a binding shall not be auto-committed, but that the
3491 expansion shall instead be furtherly editable by the user, a commercial at
3492 .Ql @
3493 (that will be removed) can be placed last in the expansion, from which
3494 leading and trailing whitespace will finally be removed.
3495 Reverse solidus cannot be used as the last character of expansion.
3498 Contexts define when a binding applies, i.e., a binding will not be seen
3499 unless the context for which it is defined for is currently active.
3500 This is not true for the shared binding
3501 .Ql base ,
3502 which is the foundation for all other bindings and as such always
3503 applies, its bindings, however, only apply secondarily.
3504 The available contexts are the shared
3505 .Ql base ,
3507 .Ql default
3508 context which is used in all not otherwise documented situations, and
3509 .Ql compose ,
3510 which applies to compose mode only.
3513 .Dq Keys
3514 which form the binding are specified as a comma-separated list of
3515 byte-sequences, where each list entry corresponds to one key(press).
3516 \*(OPally a list entry may, indicated by a leading colon character
3517 .Ql \&: ,
3518 also refer to the name of a terminal capability;
3519 several dozen names will be compiled into \*(UA and may be specified
3520 either by their
3521 .Xr terminfo 5 ,
3522 or, if existing, by their
3523 .Xr termcap 5
3524 name, regardless of the actually used terminal control library.
3525 It is however possible to use any capability, as long as the name is
3526 resolvable by the control library or defined in the internal variable
3527 .Va termcap .
3528 Input sequences are not case-normalized, so that an exact match is
3529 required to update or remove a binding.
3530 Examples:
3532 .Bd -literal -offset indent
3533 bind base $'\eE',d mle-snarf-word-fwd # Esc(ape)
3534 bind base $'\eE',$'\ec?' mle-snarf-word-bwd # Esc, Delete
3535 bind default $'\ecA',:khome,w 'echo An editable binding@'
3536 bind default a,b,c rm -rf / @  # Another editable binding
3537 bind default :kf1 File %
3538 bind compose :kf1 ~e
3542 Note that the entire comma-separated list is first parsed (over) as a
3543 shell-token with whitespace as the field separator, before being parsed
3544 and expanded for real with comma as the field separator, therefore
3545 whitespace needs to be properly quoted, see
3546 .Sx "Shell-style argument quoting" .
3547 Using Unicode reverse solidus escape sequences renders a binding
3548 defunctional if the locale does not support Unicode (see
3549 .Sx "Character sets" ) ,
3550 and using terminal capabilities does so if no terminal control support
3551 is (currently) available.
3554 The following terminal capability names are builtin and can be used in
3555 .Xr terminfo 5
3556 or (if available) the two-letter
3557 .Xr termcap 5
3558 notation regardless of the actually used library.
3559 See the respective manual for a list of capabilities.
3560 The program
3561 .Xr infocmp 1
3562 can be used to show all the capabilities of
3563 .Ev TERM
3564 or the given terminal type;
3565 using the
3566 .Fl \&\&x
3567 flag will also show supported (non-standard) extensions.
3570 .Bl -tag -compact -width kcuuf_or_kcuuf
3571 .It Cd kbs Ns \0or Cd kb
3572 Backspace.
3573 .It Cd kdch1 Ns \0or Cd kD
3574 Delete character.
3575 .It Cd kDC Ns \0or Cd *4
3576 \(em shifted variant.
3577 .It Cd kel Ns \0or Cd kE
3578 Clear to end of line.
3579 .It Cd kext Ns \0or Cd @9
3580 Exit.
3581 .It Cd kich1 Ns \0or Cd kI
3582 Insert character.
3583 .It Cd kIC Ns \0or Cd #3
3584 \(em shifted variant.
3585 .It Cd khome Ns \0or Cd kh
3586 Home.
3587 .It Cd kHOM Ns \0or Cd #2
3588 \(em shifted variant.
3589 .It Cd kend Ns \0or Cd @7
3590 End.
3591 .It Cd knp Ns \0or Cd kN
3592 Next page.
3593 .It Cd kpp Ns \0or Cd kP
3594 Previous page.
3595 .It Cd kcub1 Ns \0or Cd kl
3596 Left cursor (with more modifiers: see below).
3597 .It Cd kLFT Ns \0or Cd #4
3598 \(em shifted variant.
3599 .It Cd kcuf1 Ns \0or Cd kr
3600 Right cursor (ditto).
3601 .It Cd kRIT Ns \0or Cd %i
3602 \(em shifted variant.
3603 .It Cd kcud1 Ns \0or Cd kd
3604 Down cursor (ditto).
3605 .It Cd kDN
3606 \(em shifted variant (only terminfo).
3607 .It Cd kcuu1 Ns \0or Cd ku
3608 Up cursor (ditto).
3609 .It Cd kUP
3610 \(em shifted variant (only terminfo).
3611 .It Cd kf0 Ns \0or Cd k0
3612 Function key 0.
3613 Add one for each function key up to
3614 .Cd kf9
3616 .Cd k9 ,
3617 respectively.
3618 .It Cd kf10 Ns \0or Cd k;
3619 Function key 10.
3620 .It Cd kf11 Ns \0or Cd F1
3621 Function key 11.
3622 Add one for each function key up to
3623 .Cd kf19
3625 .Cd F9 ,
3626 respectively.
3630 Some terminals support key-modifier combination extensions, e.g.,
3631 .Ql Alt+Shift+xy .
3632 For example, the delete key,
3633 .Cd kdch1 :
3634 in its shifted variant, the name is mutated to
3635 .Cd  kDC ,
3636 then a number is appended for the states
3637 .Ql Alt
3638 .Pf ( Cd kDC3 ) ,
3639 .Ql Shift+Alt
3640 .Pf ( Cd kDC4 ) ,
3641 .Ql Control
3642 .Pf ( Cd kDC5 ) ,
3643 .Ql Shift+Control
3644 .Pf ( Cd kDC6 ) ,
3645 .Ql Alt+Control
3646 .Pf ( Cd kDC7 ) ,
3647 finally
3648 .Ql Shift+Alt+Control
3649 .Pf ( Cd kDC8 ) .
3650 The same for the left cursor key,
3651 .Cd kcub1 :
3652 .Cd KLFT , KLFT3 , KLFT4 , KLFT5 , KLFT6 , KLFT7 , KLFT8 .
3655 Key bindings can be removed with the command
3656 .Ic unbind .
3657 It is advisable to use an initial escape or other control character (e.g.,
3658 .Ql \ecA )
3659 for bindings which describe user key combinations (as opposed to purely
3660 terminal capability based ones), in order to avoid ambiguities whether
3661 input belongs to key sequences or not; it also reduces search time.
3662 Adjusting
3663 .Va bind-timeout
3664 may help shall keys and sequences be falsely recognized.
3668 .It Ic call
3669 \*(NQ Calls the given macro, which must have been created via
3670 .Ic define .
3671 Parameters given to macros are implicitly local to the macro's scope, and
3672 may be accessed via the special parameter syntax that is known from the
3673 .Xr sh 1 ,
3674 e.g.,
3675 .Va 1 ,
3676 .Va * ,
3677 .Va @ ,
3678 .Va # .
3679 Positional parameters may be removed by
3680 .Ic shift Ns
3681 ing them off the stack.
3682 Macro execution can be terminated at any time by calling
3683 .Ic return .
3685 Calling macros recursively will at some time excess the stack size
3686 limit, causing a hard program abortion; if recursively calling a macro
3687 is the last command of the current macro, consider to use the command
3688 .Ic xcall ,
3689 which will first release all resources of the current macro before
3690 replacing the current macro with the called one.
3691 Numeric and string operations can be performed via
3692 .Ic vexpr ,
3694 .Ic eval
3695 may be helpful to recreate argument lists.
3696 .Bd -literal -offset indent
3697 define exmac {
3698   echo Parameter 1 of ${#} is ${1}, all: ${*} / ${@}
3699   return 1000 0
3701 call exmac Hello macro exmac!
3705 .It Ic call_if
3706 Identical to
3707 .Ic call
3708 if the given macro has been created via
3709 .Ic define ,
3710 but doesn't fail nor warn if the macro doesn't exist.
3713 .It Ic cd
3714 (ch) Change the working directory to
3715 .Ev HOME
3716 or the given argument.
3717 Synonym for
3718 .Ic chdir .
3721 .It Ic certsave
3722 \*(OP Only applicable to S/MIME signed messages.
3723 Takes a message list and a file name and saves the certificates
3724 contained within the message signatures to the named file in both
3725 human-readable and PEM format.
3726 The certificates can later be used to send encrypted messages to the
3727 respective message senders by setting
3728 .Va smime-encrypt-USER@HOST
3729 variables.
3733 .It Ic charsetalias , uncharsetalias
3734 \*(NQ Manage (character set conversion) character set alias mappings,
3735 as documented in the section
3736 .Sx "Character sets" .
3737 Character set aliases are expanded recursively, but no expansion is
3738 performed on values of the user-settable variables, e.g.,
3739 .Va charset-8bit .
3740 These are effectively no-operations if character set conversion
3741 is not available (i.e., no
3742 .Ql +iconv
3744 .Va features ) .
3745 Without arguments the list of all currently defined aliases is shown.
3746 Otherwise all given arguments are treated as pairs of character sets and
3747 their desired target alias name, creating new or changing already
3748 existing aliases, as necessary.
3750 The latter deletes all aliases given as arguments, the special argument
3751 .Ql *
3752 will remove all aliases.
3755 .It Ic chdir
3756 (ch) Change the working directory to
3757 .Ev HOME
3758 or the given argument.
3759 Synonym for
3760 .Ic cd .
3764 .It Ic collapse , uncollapse
3765 Only applicable to threaded mode.
3766 Takes a message list and makes all replies to these messages invisible
3767 in header summaries, except for
3768 .Ql new
3769 messages and the
3770 .Dq dot .
3771 Also when a message with collapsed replies is displayed,
3772 all of these are automatically uncollapsed.
3773 The latter command undoes collapsing.
3778 .It Ic colour , uncolour
3779 \*(OP\*(NQ Manage colour mappings of and for a
3780 .Sx "Coloured display" .
3781 The type of colour is given as the (case-insensitive) first argument,
3782 which must be one of
3783 .Ql 256
3784 for 256-colour terminals,
3785 .Ql 8 ,
3786 .Ql ansi
3788 .Ql iso
3789 for the standard 8-colour ANSI / ISO 6429 color palette and
3790 .Ql 1
3792 .Ql mono
3793 for monochrome terminals.
3794 Monochrome terminals cannot deal with colours, but only (some) font
3795 attributes.
3798 Without further arguments the list of all currently defined mappings
3799 for the given colour type is shown (as a special case giving
3800 .Ql all
3802 .Ql *
3803 will show the mappings of all types).
3804 Otherwise the second argument defines the mappable slot, and the third
3805 argument a (comma-separated list of) colour and font attribute
3806 specification(s), and the optional fourth argument can be used to
3807 specify a precondition: if conditioned mappings exist they are tested in
3808 (creation) order unless a (case-insensitive) match has been found, and
3809 the default mapping (if any has been established) will only be chosen as
3810 a last resort.
3811 The types of precondition available depend on the mappable slot (see
3812 .Sx "Coloured display"
3813 for some examples), the following of which exist:
3816 Mappings prefixed with
3817 .Ql mle-
3818 are used for the \*(OPal builtin Mailx-Line-Editor (MLE, see
3819 .Sx "On terminal control and line editor" )
3820 and do not support preconditions.
3822 .Bl -tag -compact -width view-partinfo
3823 .It Ar mle-position
3824 This mapping is used for the position indicator that is visible when
3825 a line cannot be fully displayed on the screen.
3826 .It Ar mle-prompt
3827 Used for the
3828 .Va prompt .
3832 Mappings prefixed with
3833 .Ql sum-
3834 are used in header summaries, and they all understand the preconditions
3835 .Ql dot
3836 (the current message) and
3837 .Ql older
3838 for elder messages (only honoured in conjunction with
3839 .Va datefield-markout-older ) .
3841 .Bl -tag -compact -width view-partinfo
3842 .It Ar sum-dotmark
3843 This mapping is used for the
3844 .Dq dotmark
3845 that can be created with the
3846 .Ql %>
3848 .Ql %<
3849 formats of the variable
3850 .Va headline .
3851 .It Ar sum-header
3852 For the complete header summary line except the
3853 .Dq dotmark
3854 and the thread structure.
3855 .It Ar sum-thread
3856 For the thread structure which can be created with the
3857 .Ql %i
3858 format of the variable
3859 .Va headline .
3863 Mappings prefixed with
3864 .Ql view-
3865 are used when displaying messages.
3867 .Bl -tag -compact -width view-partinfo
3868 .It Ar view-from_
3869 This mapping is used for so-called
3870 .Ql From_
3871 lines, which are MBOX file format specific header lines.
3872 .It Ar view-header
3873 For header lines.
3874 A comma-separated list of headers to which the mapping applies may be
3875 given as a precondition; if the \*(OPal regular expression support is
3876 available then if any of the
3877 .Dq magical
3878 (extended) regular expression characters is seen the precondition will
3879 be evaluated as (an extended) one.
3880 .It Ar view-msginfo
3881 For the introductional message info line.
3882 .It Ar view-partinfo
3883 For MIME part info lines.
3887 The following (case-insensitive) colour definitions and font attributes
3888 are understood, multiple of which can be specified in a comma-separated
3889 list:
3891 .Bl -tag -width ft=
3892 .It Ar ft=
3893 a font attribute:
3894 .Ql bold ,
3895 .Ql reverse
3897 .Ql underline .
3898 It is possible (and often applicable) to specify multiple font
3899 attributes for a single mapping.
3901 .It Ar fg=
3902 foreground colour attribute:
3903 .Ql black ,
3904 .Ql blue ,
3905 .Ql green ,
3906 .Ql red ,
3907 .Ql brown ,
3908 .Ql magenta ,
3909 .Ql cyan
3911 .Ql white .
3912 To specify a 256-color mode a decimal number colour specification in
3913 the range 0 to 255, inclusive, is supported, and interpreted as follows:
3915 .Bl -tag -compact -width "999 - 999"
3916 .It 0 - 7
3917 the standard ISO 6429 colors, as above.
3918 .It 8 - 15
3919 high intensity variants of the standard colors.
3920 .It 16 - 231
3921 216 colors in tuples of 6.
3922 .It 232 - 255
3923 grayscale from black to white in 24 steps.
3925 .Bd -literal -offset indent
3926 #!/bin/sh -
3927 fg() { printf "\e033[38;5;${1}m($1)"; }
3928 bg() { printf "\e033[48;5;${1}m($1)"; }
3930 while [ $i -lt 256 ]; do fg $i; i=$(($i + 1)); done
3931 printf "\e033[0m\en"
3933 while [ $i -lt 256 ]; do bg $i; i=$(($i + 1)); done
3934 printf "\e033[0m\en"
3937 .It Ar bg=
3938 background colour attribute (see
3939 .Cd fg=
3940 for possible values).
3944 The command
3945 .Ic \&uncolour
3946 will remove for the given colour type (the special type
3947 .Ql *
3948 selects all) the given mapping; if the optional precondition argument is
3949 given only the exact tuple of mapping and precondition is removed.
3950 The special name
3951 .Ql *
3952 will remove all mappings (no precondition allowed), thus
3953 .Ql uncolour * *
3954 will remove all established mappings.
3958 .It Ic Copy
3959 (C) Copy messages to files whose names are derived from the author of
3960 the respective message and do not mark them as being saved;
3961 otherwise identical to
3962 .Ic Save .
3965 .It Ic copy
3966 (c) Copy messages to the named file and do not mark them as being saved;
3967 otherwise identical to
3968 .Ic save .
3971 .It Ic cwd
3972 Show the name of the current working directory, as reported by
3973 .Xr getcwd 3 .
3974 Supports
3975 .Cm vput
3976 (see
3977 .Sx "Command modifiers" ) .
3978 The return status is tracked via
3979 .Va \&! .
3982 .It Ic Decrypt
3983 \*(OP For unencrypted messages this command is identical to
3984 .Ic Copy ;
3985 Encrypted messages are first decrypted, if possible, and then copied.
3988 .It Ic decrypt
3989 \*(OP For unencrypted messages this command is identical to
3990 .Ic copy ;
3991 Encrypted messages are first decrypted, if possible, and then copied.
3995 .It Ic define , undefine
3996 Without arguments the current list of macros, including their content,
3997 is shown, otherwise a macro is defined, replacing an existing macro of
3998 the same name.
3999 A macro definition is a sequence of commands in the following form:
4000 .Bd -literal -offset indent
4001 define name {
4002   command1
4003   command2
4004   ...
4005   commandN
4009 A defined macro can be invoked explicitly by using the
4010 .Ic call
4012 .Ic ~
4013 commands, or implicitly if a macro hook is triggered, e.g., a
4014 .Va folder-hook .
4015 It is possible to localize adjustments, like creation, deletion and
4016 modification of
4017 .Sx "INTERNAL VARIABLES" ,
4018 by using the
4019 .Ic localopts
4020 command; the scope which is localized depends on how (i.e.,
4021 .Dq as what :
4022 normal macro, folder hook, hook,
4023 .Ic account
4024 switch) the macro is invoked.
4025 Execution of a macro body can be stopped from within by calling
4026 .Ic return .
4027 Inside a
4028 .Ic call Ns
4029 ed macro, given positional parameters can be
4030 .Ic shift Ns
4033 The latter command deletes the given macro, the special name
4034 .Ql *
4035 will discard all existing macros.
4036 Creation and deletion of (a) macro(s) can be performed from within
4037 a running macro.
4041 .It Ic delete , undelete
4042 (d, u) Marks the given message list as being or not being
4043 .Ql deleted ,
4044 respectively; if no argument has been specified then the usual search
4045 for a visible message is performed, as documented for
4046 .Sx "Message list arguments" ,
4047 showing only the next input prompt if the search fails.
4048 Deleted messages will neither be saved in the
4049 .Mx -sx
4050 .Sx "secondary mailbox"
4051 .Ev MBOX
4052 nor will they be available for most other commands.
4053 If the
4054 .Va autoprint
4055 variable is set, the new
4056 .Dq dot
4057 or the last message restored, respectively, is automatically
4058 .Ic type Ns
4059 d; also see
4060 .Ic dp ,
4061 .Ic dt .
4064 .It Ic discard
4065 (di) Identical to
4066 .Ic ignore .
4067 Superseded by the multiplexer
4068 .Ic headerpick .
4072 .It Ic dp , dt
4073 Delete the given messages and automatically
4074 .Ic type
4075 the new
4076 .Dq dot
4077 if one exists, regardless of the setting of
4078 .Va autoprint .
4081 .It Ic dotmove
4082 Move the
4083 .Dq dot
4084 up or down by one message when given
4085 .Ql +
4087 .Ql -
4088 argument, respectively.
4092 .It Ic draft , undraft
4093 Take message lists and mark each given message as being draft, or not
4094 being draft, respectively, as documented in the section
4095 .Sx "Message states" .
4098 .It Ic echo
4099 \*(NQ (ec) Echoes arguments to standard output and writes a trailing
4100 newline, whereas the otherwise identical
4101 .Ic echon
4102 does not.
4103 .Sx "Shell-style argument quoting"
4104 is used,
4105 .Sx "Filename transformations"
4106 are applied to the expanded arguments.
4109 .It Ic echoerr
4110 \*(NQ Identical to
4111 .Ic echo
4112 except that is echoes to standard error.
4113 Also see
4114 .Ic echoerrn .
4117 .It Ic echon
4118 \*(NQ Identical to
4119 .Ic echo ,
4120 but does not write a trailing newline.
4123 .It Ic echoerrn
4124 \*(NQ Identical to
4125 .Ic echoerr ,
4126 but does not write a trailing newline.
4129 .It Ic edit
4130 (e) Point the text editor (as defined in
4131 .Ev EDITOR )
4132 at each message from the given list in turn.
4133 Modified contents are discarded unless the
4134 .Va writebackedited
4135 variable is set.
4138 .It Ic elif
4139 Part of the
4140 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4141 conditional \(em if the condition of a preceding
4142 .Ic if
4143 was false, check the following condition and execute the following block
4144 if it evaluates true.
4147 .It Ic else
4148 (el) Part of the
4149 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4150 conditional \(em if none of the conditions of the preceding
4151 .Ic if
4153 .Ic elif
4154 commands was true, the
4155 .Ic else
4156 block is executed.
4159 .It Ic endif
4160 (en) Marks the end of an
4161 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4162 conditional execution block.
4166 .It Ic environ
4167 \*(NQ \*(UA has a strict notion about which variables are
4168 .Sx "INTERNAL VARIABLES"
4169 and which are managed in the program
4170 .Sx ENVIRONMENT .
4171 Since some of the latter are a vivid part of \*(UAs functioning,
4172 however, they are transparently integrated into the normal handling of
4173 internal variables via
4174 .Ic set
4176 .Ic unset .
4177 To integrate other environment variables of choice into this
4178 transparent handling, and also to export internal variables into the
4179 process environment where they normally are not, a
4180 .Ql link
4181 needs to become established with this command, as in, e.g.,
4184 .Dl environ link PERL5LIB from TZ
4187 Afterwards changing such variables with
4188 .Ic set
4189 will cause automatic updates of the program environment, and therefore
4190 be inherited by newly created child processes.
4191 Sufficient system support provided (it was in BSD as early as 1987, and
4192 is standardized since Y2K) removing such variables with
4193 .Ic unset
4194 will remove them also from the program environment, but in any way
4195 the knowledge they ever have been
4196 .Ql link Ns
4197 ed will be lost.
4198 Note this implies that
4199 .Ic localopts
4200 may cause loss of links.
4203 The command
4204 .Ql unlink
4205 will remove an existing link, but leaves the variables as such intact.
4206 Additionally the subcommands
4207 .Ql set
4209 .Ql unset
4210 are provided, which work exactly the same as the documented commands
4211 .Ic set
4213 .Ic unset ,
4214 but (additionally) link the variable(s) with the program environment and
4215 thus immediately export them to, or remove them from (if possible),
4216 respectively, the program environment.
4220 .It Ic errors
4221 \*(OP Since \*(UA uses the console as a user interface it can happen
4222 that messages scroll by too fast to become recognized.
4223 Optionally an error message ring queue is available which stores
4224 duplicates of any error message and notifies the user in interactive
4225 sessions whenever a new error has occurred.
4226 The queue is finite: if its maximum size is reached any new message
4227 replaces the eldest.
4228 The command
4229 .Ic errors
4230 can be used to manage this message queue: if given
4231 .Ar show
4232 or no argument the queue will be displayed and cleared,
4233 .Ar clear
4234 will only clear all messages from the queue.
4237 .It Ic eval
4238 \*(NQ Construct a command by concatenating the arguments, separated with
4239 a single space character, and then evaluate the result.
4240 This command passes through the status of the evaluated command.
4241 Also see
4242 .Ic call .
4243 .Bd -literal -offset indent
4244 define xverbose {
4245   # Like this, sh(1)ell-stylish from begin to end: works!
4246   # Result status ends up in $!, then
4247   localopts 1;wysh set verbose;ignerr eval "${@}";return ${?}
4249 ghost xv '\ecall xverbose'
4251 # E.g.:
4252 define xxx {
4253   echo "xxx arg <$1>"
4254   shift
4255   if [ $# > 0 ]
4256     \excall xxx "$@"
4257   endif
4259 define yyy {
4260   eval "$@ ' ball"
4262 call yyy '~xxx' "b\e$'\et'u ' "
4263 xxx arg <b      u>
4264 xxx arg <  >
4265 xxx arg <ball>
4269 .It Ic exit
4270 (ex or x) Exit from \*(UA without changing the active mailbox and skip
4271 any saving of messages in the
4272 .Mx -sx
4273 .Sx "secondary mailbox"
4274 .Ev MBOX
4275 as well as a possibly tracked line editor history file.
4278 .It Ic File
4279 (Fi) Like
4280 .Ic file ,
4281 but open the mailbox read-only.
4285 .It Ic file
4286 (fi) The file command switches to a new mailbox.
4287 Without arguments it shows status information of the current mailbox.
4288 If an argument is given, it will write out changes (such as deletions)
4289 the user has made, open a new mailbox and update the internal variables
4290 .Va mailbox-resolved
4292 .Va mailbox-display .
4293 .Sx "Filename transformations"
4294 will be applied to the
4295 .Ar name
4296 argument.
4299 If the name ends with
4300 .Ql .gz ,
4301 .Ql .bz2
4303 .Ql .xz
4304 it is treated as being compressed with
4305 .Xr gzip 1 ,
4306 .Xr bzip2 1
4308 .Xr xz 1 ,
4309 respectively, and transparently handled through an intermediate
4310 (un)compression step (using a temporary file) with the according
4311 facility, sufficient support provided.
4312 Likewise, if the named file does not exist, but a file with one of the
4313 mentioned compression extensions does, then the name is automatically
4314 expanded and the compressed file is used.
4317 Otherwise, if the name ends with an extension for which
4318 .Va file-hook-load-EXTENSION
4320 .Va file-hook-save-EXTENSION
4321 variables are set, then the given hooks will be used to load and save
4322 .Dq name ,
4323 and \*(UA will work with an intermediate temporary file.
4325 MBOX files (flat file-based mailboxes) are generally locked during file
4326 operations in order to avoid inconsistencies due to concurrent
4327 modifications.
4328 \*(OPal Mailbox files which \*(UA treats as the system
4329 .Va inbox
4330 .Pf ( Ev MAIL ) ,
4332 .Mx -sx
4333 .Sx "primary system mailbox" Ns
4334 es in general will also be protected by so-called dotlock files, the
4335 traditional way of mail spool file locking: for any file
4336 .Ql a
4337 a lock file
4338 .Ql a.lock
4339 will be created for the duration of the synchronization \(em
4340 as necessary a privilege-separated dotlock child process will be used
4341 to accommodate for necessary privilege adjustments in order to create
4342 the dotlock file in the same directory
4343 and with the same user and group identities as the file of interest.
4346 \*(UA by default uses tolerant POSIX rules when reading MBOX database
4347 files, but it will detect invalid message boundaries in this mode and
4348 complain (even more with
4349 .Va debug )
4350 if any is seen: in this case
4351 .Va mbox-rfc4155
4352 can be used to create a valid MBOX database from the invalid input.
4356 .Ar name
4357 refers to a directory with the subdirectories
4358 .Ql tmp ,
4359 .Ql new
4361 .Ql cur ,
4362 then it is treated as a folder in
4363 .Dq Maildir
4364 format; \*(ID the variable
4365 .Va newfolders
4366 can be used to control the format of yet non-existent folders.
4367 A name of the form
4370 .Dl \*(IN protocol://[user[:password]@]host[:port][/path]
4371 .Dl \*(OU protocol://[user@]host[:port][/path]
4374 is taken as an Internet mailbox specification.
4375 The \*(OPally supported protocols are
4376 .Ar pop3
4377 (POP3) and
4378 .Ar pop3s
4379 (POP3 with SSL/TLS encrypted transport).
4381 .Ar [/path]
4382 part is valid only for IMAP; there it defaults to
4383 .Ar INBOX .
4384 Also see the section
4385 .Sx "On URL syntax and credential lookup" .
4388 \*(OU If
4389 .Ar user
4390 contains special characters, in particular
4391 .Ql /
4393 .Ql % ,
4394 they must be escaped in URL notation \(en the command
4395 .Ic urlcodec
4396 can be used to show the necessary conversion.
4401 .It Ic flag , unflag
4402 Take message lists and mark the messages as being flagged, or not being
4403 flagged, respectively, for urgent/special attention.
4404 See the section
4405 .Sx "Message states" .
4408 .It Ic folder
4409 (fold) The same as
4410 .Ic file .
4413 .It Ic folders
4414 With no arguments, list the names of the folders in the folder directory.
4415 With an existing folder as an argument,
4416 lists the names of folders below the named folder.
4419 .It Ic Followup
4420 (F) Similar to
4421 .Ic Respond ,
4422 but saves the message in a file named after the local part of the first
4423 recipient's address (instead of in
4424 .Va record Ns ).
4427 .It Ic followup
4428 (fo) Similar to
4429 .Ic respond ,
4430 but saves the message in a file named after the local part of the first
4431 recipient's address (instead of in
4432 .Va record Ns ).
4435 .It Ic followupall
4436 Similar to
4437 .Ic followup ,
4438 but responds to all recipients regardless of the
4439 .Va flipr
4440 variable.
4443 .It Ic followupsender
4444 Similar to
4445 .Ic Followup ,
4446 but responds to the sender only regardless of the
4447 .Va flipr
4448 variable.
4451 .It Ic Forward
4452 Alias for
4453 .Ic Fwd .
4456 .It Ic forward
4457 Alias for
4458 .Ic fwd .
4461 .It Ic from
4462 (f) Takes a list of message specifications and displays a summary of
4463 their message headers, exactly as via
4464 .Ic headers .
4465 An alias of this command is
4466 .Ic search .
4467 Also see
4468 .Sx "Specifying messages" .
4471 .It Ic Fwd
4472 Similar to
4473 .Ic fwd ,
4474 but saves the message in a file named after the local part of the
4475 recipient's address (instead of in
4476 .Va record Ns ).
4479 .It Ic fwd
4480 Takes a message and the address of a recipient
4481 and forwards the message to him.
4482 The text of the original message is included in the new one,
4483 with the value of the
4484 .Va fwdheading
4485 variable preceding it.
4486 To filter the included header fields to the desired subset use the
4487 .Ql foward
4488 slot of the white- and blacklisting command
4489 .Ic headerpick .
4490 Only the first part of a multipart message is included unless
4491 .Va forward-as-attachment ,
4492 and recipient addresses will be stripped from comments, names etc.
4493 unless the internal variable
4494 .Va fullnames
4495 is set .
4498 .It Ic fwdignore
4499 \*(OB Superseded by the multiplexer
4500 .Ic headerpick .
4503 .It Ic fwdretain
4504 \*(OB Superseded by the multiplexer
4505 .Ic headerpick .
4509 .It Ic ghost , unghost
4510 Define or list, and remove, respectively, command aliases.
4511 A ghost can be used everywhere a normal command can be used, but always
4512 takes precedence: any arguments that are given to the command alias are
4513 joined onto the alias content, and the resulting string forms the
4514 command line that is, in effect, executed.
4515 The latter command removes all given aliases, the special name
4516 .Ql *
4517 will remove all ghosts.
4518 When used without arguments the former shows a list of all currently
4519 known aliases, with one argument only the expansion of the given one.
4521 With two or more arguments a command alias is defined or updated: the
4522 first argument is the name under which the remaining command line should
4523 be accessible, the content of which can be just about anything.
4524 A ghost may itself expand to another ghost, but to avoid expansion loops
4525 further expansion will be prevented if a ghost refers to itself or if an
4526 expansion depth limit is reached.
4527 Explicit expansion prevention is available via reverse solidus
4528 .Cm \e ,
4530 .Sx "Command modifiers" .
4531 .Bd -literal -offset indent
4532 ? gh xx
4533 \*(uA: `ghost': no such alias: xx
4534 ? gh xx echo hello,
4535 ? gh xx
4536 ghost xx "echo hello,"
4537 ? xx
4538 hello,
4539 ? xx world
4540 hello, world
4546 .It Ic headerpick , unheaderpick
4547 \*(NQ Multiplexer command to manage white- and blacklisting
4548 selections of header fields for a variety of applications.
4549 Without arguments the set of contexts that have settings is displayed.
4550 When given arguments, the first argument is the context to which the
4551 command applies, one of (case-insensitively)
4552 .Ql type
4553 for display purposes (via, e.g.,
4554 .Ic type ) ,
4555 .Ql save
4556 for selecting which headers shall be stored persistently when
4557 .Ic save ,
4558 .Ic copy ,
4559 .Ic move
4560 or even
4561 .Ic decrypt Ns
4562 ing messages (note that MIME related etc. header fields should not be
4563 ignored in order to not destroy usability of the message in this case),
4564 .Ql forward
4565 for stripping down messages when
4566 .Ic forward Ns
4567 ing message (has no effect if
4568 .Va forward-as-attachment
4569 is set), and
4570 .Ql top
4571 for defining user-defined set of fields for the command
4572 .Ic top .
4575 The current settings of the given context are displayed if only the
4576 first argument is given.
4577 A second argument denotes the type of restriction that is to be chosen,
4578 it may be (a case-insensitive prefix of)
4579 .Ql retain
4581 .Ql ignore
4582 for white- and blacklisting purposes, respectively.
4583 Establishing a whitelist suppresses inspection of the corresponding
4584 blacklist.
4585 If no further argument is given the current settings of the given type
4586 will be displayed, otherwise the remaining arguments specify header
4587 fields, which \*(OPally may be given as regular expressions, to be be
4588 added to the given type.
4589 The special wildcard field (asterisk,
4590 .Ql * )
4591 will establish a (fast) shorthand setting which covers all fields.
4593 The latter command always takes three or more arguments and can be used
4594 to remove fields from the given type of list of the given context, the
4595 special argument
4596 .Ql *
4597 will remove all fields.
4601 .It Ic headers
4602 (h) Show the current group of headers, the size of which depends on
4603 the variable
4604 .Va screen
4605 and the style of which can be adjusted with the variable
4606 .Va headline .
4607 If a message-specification is given the group of headers containing the
4608 first message therein is shown and the message at the top of the screen
4609 becomes the new
4610 .Dq dot .
4613 .It Ic help
4614 (hel) A synonym for
4615 .Ic \&? .
4618 .It Ic history
4619 \*(OP Either
4620 .Ar show
4622 .Ar clear
4623 the list of history entries;
4624 a decimal
4625 .Ar NUMBER
4626 argument selects and evaluates the respective history entry,
4627 which will become the new history top; a negative number is used as an
4628 offset to the current command, e.g.,
4629 .Ql -1
4630 will select the last command, the history top.
4631 The default mode if no arguments are given is
4632 .Ar show .
4635 .It Ic hold
4636 (ho, also
4637 .Ic preserve )
4638 Takes a message list and marks each message therein to be saved in the
4639 user's system
4640 .Va inbox
4641 instead of in the
4642 .Mx -sx
4643 .Sx "secondary mailbox"
4644 .Ev MBOX .
4645 Does not override the
4646 .Ic delete
4647 command.
4648 \*(UA deviates from the POSIX standard with this command, because a
4649 .Ic next
4650 command issued after
4651 .Ic hold
4652 will display the following message, not the current one.
4656 .It Ic if
4657 (i) Part of the nestable
4658 .Ic if Ns / Ns Ic elif Ns / Ns Ic else Ns / Ns Ic endif
4659 conditional execution construct \(em if the given condition is true then
4660 the encapsulated block is executed.
4661 POSIX only supports the (case-insensitive) conditions
4662 .Ql r Ns
4663 eceive
4665 .Ql s Ns
4666 end, all remaining conditions are non-portable extensions; note that
4667 falsely specified conditions cause the execution of the entire
4668 conditional construct until the (matching) closing
4669 .Ic endif
4670 command to be suppressed.
4671 The syntax of the nestable
4672 .Ic if
4673 conditional execution construct requires that each condition and syntax
4674 element is surrounded by whitespace.
4676 .Bd -literal -offset indent
4677 if receive
4678   commands ...
4679 else
4680   commands ...
4681 endif
4685 The (case-insensitive) condition
4686 .Ql t Ns
4687 erminal will evaluate to true if the standard input is a terminal, i.e.,
4688 in interactive sessions.
4689 Another condition can be any boolean value (see the section
4690 .Sx "INTERNAL VARIABLES"
4691 for textual boolean representations) to mark an enwrapped block as
4692 .Dq never execute
4694 .Dq always execute .
4695 It is possible to check
4696 .Sx "INTERNAL VARIABLES"
4697 as well as
4698 .Sx ENVIRONMENT
4699 variables for existence or compare their expansion against a user given
4700 value or another variable by using the
4701 .Ql $
4702 .Pf ( Dq variable next )
4703 conditional trigger character;
4704 a variable on the right hand side may be signalled using the same
4705 mechanism.
4706 The variable names may be enclosed in a pair of matching braces.
4709 Integer operators treat the left and right hand side as integral numbers
4710 and compare them arithmetically.
4711 It is an error if any of the operands is not a valid integer, an empty
4712 operand is treated as if it were 0.
4713 Available operators are
4714 .Ql -lt
4715 (less than),
4716 .Ql -le
4717 (less than or equal to),
4718 .Ql -eq
4719 (equal),
4720 .Ql -ne
4721 (not equal),
4722 .Ql -ge
4723 (greater than or equal to), and
4724 .Ql -gt
4725 (greater than).
4728 String operators compare the left and right hand side 8-bit byte-wise,
4729 ignoring case according to the rules of the US-ASCII encoding
4730 (therefore, dependent on the active locale, possibly producing false
4731 results for strings in the locale encoding).
4732 An unset variable is treated as the empty string.
4733 Available operators are
4734 .Ql <
4735 (less than),
4736 .Ql <=
4737 (less than or equal to),
4738 .Ql ==
4739 (equal),
4740 .Ql !=
4741 (not equal),
4742 .Ql >=
4743 (greater than or equal to),
4744 .Ql >
4745 (greater than),
4746 .Ql =@
4747 (is substring of) and
4748 .Ql !@
4749 (is not substring of).
4752 When the \*(OPal regular expression support is available, the additional
4753 string operators
4754 .Ql =~
4756 .Ql !~
4757 can be used.
4758 They treat the right hand side as an extended regular expression that is
4759 matched case-insensitively and according to the active
4760 .Ev LC_CTYPE
4761 locale, meaning that strings in the locale encoding should be matched
4762 correctly.
4765 Conditions can be joined via AND-OR lists (where the AND operator is
4766 .Ql &&
4767 and the OR operator is
4768 .Ql || ) ,
4769 which have equal precedence and will be evaluated with left
4770 associativity, thus using the same syntax that is known for the
4771 .Xr sh 1 .
4772 It is also possible to form groups of conditions and lists by enclosing
4773 them in pairs of brackets
4774 .Ql [\ \&.\&.\&.\ ] ,
4775 which may be interlocked within each other, and also be joined via
4776 AND-OR lists.
4779 The results of individual conditions and entire groups may be modified
4780 via unary operators: the unary operator
4781 .Ql \&!
4782 will reverse the result.
4784 .Bd -literal -offset indent
4785 if $debug
4786   echo *debug* is set
4787 endif
4788 if [ "$ttycharset" == UTF-8 ] || [ "$ttycharset" == UTF8 ]
4789   echo *ttycharset* is set to UTF-8, case-insensitively
4790 endif
4791 set t1=one t2=one
4792 if [ "${t1}" == "${t2}" ]
4793   echo These two variables are equal
4794 endif
4795 # This is a string test, -ge was added for v14.9.0
4796 if [ "$version-major" >= 15 ]
4797   echo Running a new version..
4798   if [ "$features" =@ +regex ]
4799     if [ "$TERM" =~ "^xterm\&.*" ]
4800       echo ..in an X terminal
4801     endif
4802   endif
4803   if [ [ true ] && [ [ "${debug}" != '' ] || \e
4804       [ "$verbose" != '' ] ] ]
4805     echo Noisy, noisy
4806   endif
4807   if true && [ "$debug" != '' ] || [ "${verbose}" != '' ]
4808     echo Left associativity, as is known from the shell
4809   endif
4810   if ! ! true && ! [ ! "$debug" && ! "$verbose" ]
4811     echo Unary operator support
4812   endif
4813 endif
4818 .It Ic ignore
4819 (ig) Identical to
4820 .Ic discard .
4821 Superseded by the multiplexer
4822 .Ic headerpick .
4825 .It Ic list
4826 Shows the names of all available commands, alphabetically sorted.
4827 If given any non-whitespace argument the list will be shown in the order
4828 in which command prefixes are searched.
4829 \*(OP In conjunction with a set variable
4830 .Va verbose
4831 additional information will be provided for each command: the argument
4832 type will be indicated, the documentation string will be shown,
4833 and the set of command flags will show up:
4835 .Bl -tag -compact -width ".It Ql BaNg"
4836 .It Ql "vput modifier"
4837 command supports the command modifier
4838 .Cm vput .
4839 .It Ql "status in *!*"
4840 the soft exit status is tracked in
4841 .Va \&! .
4842 .It Ql "needs box"
4843 commands needs an active mailbox, a
4844 .Ic file .
4845 .It Ql "ok: batch or interactive"
4846 command may only be used in interactive or
4847 .Fl #
4848 batch mode.
4849 .It Ql "ok: send mode"
4850 command can be used in send mode.
4851 .It Ql "not ok: compose mode"
4852 command is not available when in compose-mode.
4853 .It Ql "not ok: during startup"
4854 command cannot be used during program startup, e.g., while loading
4855 .Sx "Resource files" .
4856 .It Ql "ok: in subprocess"
4857 command is allowed to be used when running in a subprocess instance,
4858 e.g., from within a macro that is called via
4859 .Va on-compose-splice .
4863 .It Ic localopts
4864 This command can be used to localize changes to variables, meaning that
4865 their state will be reverted to the former one once the covered scope
4866 is left.
4867 It can only be used inside of macro definition blocks introduced by
4868 .Ic account
4870 .Ic define ,
4871 and is interpreted as a boolean (string, see
4872 .Sx "INTERNAL VARIABLES" ) ;
4874 .Dq covered scope
4875 of an account is left once it is switched off again.
4876 .Bd -literal -offset indent
4877 define temporary_settings {
4878   set possibly_global_option1
4879   localopts on
4880   set local_option1
4881   set local_option2
4882   localopts off
4883   set possibly_global_option2
4887 .Sy Note
4888 that this setting
4889 .Dq stacks up :
4890 i.e., if
4891 .Ql macro1
4892 enables change localization and calls
4893 .Ql macro2 ,
4894 which explicitly resets localization, then any value changes within
4895 .Ql macro2
4896 will still be reverted by
4897 .Ql macro1 !
4898 \*(ID Once the outermost level, the one which enabled localization
4899 first, is left, but no earlier, all adjustments will be unrolled.
4900 \*(ID Likewise worth knowing, if in this example
4901 .Ql macro2
4902 changes to a different
4903 .Ic account
4904 which sets some variables that are yet covered by localizations, their
4905 scope will be extended, and in fact leaving the
4906 .Ic account
4907 will (thus) restore settings in (likely) global scope which actually
4908 were defined in a local, private context.
4911 .It Ic Lreply
4912 Reply to messages that come in via known
4913 .Pf ( Ic mlist )
4914 or subscribed
4915 .Pf ( Ic mlsubscribe )
4916 mailing lists, or pretend to do so (see
4917 .Sx "Mailing lists" ) :
4918 on top of the usual
4919 .Ic reply
4920 functionality this will actively resort and even remove message
4921 recipients in order to generate a message that is supposed to be sent to
4922 a mailing list.
4923 For example it will also implicitly generate a
4924 .Ql Mail-Followup-To:
4925 header if that seems useful, regardless of the setting of the variable
4926 .Va followup-to .
4929 .It Ic Mail
4930 Similar to
4931 .Ic mail ,
4932 but saves the message in a file named after the local part of the first
4933 recipient's address (instead of in
4934 .Va record Ns ).
4937 .It Ic mail
4938 (m) Takes a (list of) recipient address(es) as (an) argument(s),
4939 or asks on standard input if none were given;
4940 then collects the remaining mail content and sends it out.
4943 .It Ic mbox
4944 (mb) The given message list is to be sent to the
4945 .Mx -sx
4946 .Sx "secondary mailbox"
4947 .Ev MBOX
4948 when \*(UA is quit; this is the default action unless the variable
4949 .Va hold
4950 is set.
4951 \*(ID This command can only be used in a
4952 .Mx -sx
4953 .Sx "primary system mailbox" .
4957 .It Ic mimetype , unmimetype
4958 Without any arguments the content of the MIME type cache will displayed.
4959 Otherwise each argument defines a complete MIME type specification of
4960 a type that shall be added (prepended) to the cache.
4961 In any event MIME type sources are loaded first as necessary \(en
4962 .Va mimetypes-load-control
4963 can be used to fine-tune which sources are actually loaded.
4964 Refer to the section on
4965 .Sx "The mime.types files"
4966 for more on MIME type specifications and this topic in general.
4968 The latter command deleted all specifications of the given MIME type, so
4969 .Ql unmimetype text/plain
4970 will remove all registered specifications for the MIME type
4971 .Ql text/plain .
4972 The special name
4973 .Ql *
4974 will discard all existing MIME types, just as will
4975 .Ql reset ,
4976 but which also reenables cache initialization via
4977 .Va mimetypes-load-control .
4981 .It Ic mlist , unmlist
4982 The latter command removes all given mailing-lists, the special name
4983 .Ql *
4984 can be used to remove all registered lists.
4985 The former will list all currently defined mailing lists (and their
4986 attributes, if any) when used without arguments; a more verbose listing
4987 will be produced if either of
4988 .Va debug
4990 .Va verbose
4991 are set.
4992 Otherwise all given arguments will be added and henceforth be recognized
4993 as mailing lists.
4994 If the \*(OPal regular expression support is available then mailing
4995 lists may also be specified as (extended) regular expressions (see
4996 .Xr re_format 7
4997 for more on those).
5001 .It Ic mlsubscribe , unmlsubscribe
5002 The latter command removes the subscription attribute from all given
5003 mailing-lists, the special name
5004 .Ql *
5005 can be used to do so for any registered list.
5006 The former will list all currently defined mailing lists which have
5007 a subscription attribute when used without arguments; a more verbose
5008 listing will be produced if either of
5009 .Va debug
5011 .Va verbose
5012 are set.
5013 Otherwise this attribute will be set for all given mailing lists,
5014 newly creating them as necessary (as via
5015 .Ic mlist ) .
5016 Also see
5017 .Va followup-to .
5020 .It Ic Move
5021 Similar to
5022 .Ic move ,
5023 but moves the messages to a file named after the local part of the
5024 sender address of the first message (instead of in
5025 .Va record Ns ).
5028 .It Ic move
5029 Acts like
5030 .Ic copy
5031 but marks the messages for deletion if they were transferred
5032 successfully.
5035 .It Ic More
5036 Like
5037 .Ic more ,
5038 but also displays header fields which would not pass the
5039 .Ic headerpick
5040 selection, and all MIME parts.
5041 Identical to
5042 .Ic Page .
5045 .It Ic more
5046 Invokes the
5047 .Ev PAGER
5048 on the given messages, even in non-interactive mode and as long as the
5049 standard output is a terminal.
5050 Identical to
5051 .Ic page .
5054 .It Ic netrc
5055 \*(OP When used without arguments or if
5056 .Ar show
5057 has been given the content of the
5058 .Pa .netrc
5059 cache is shown, loading it first as necessary.
5060 If the argument is
5061 .Ar load
5062 then the cache will only be initialized and
5063 .Ar clear
5064 will remove its contents.
5065 Note that \*(UA will try to load the file only once, use
5066 .Ql Ic \&\&netrc Ns \:\0\:clear
5067 to unlock further attempts.
5069 .Va netrc-lookup ,
5070 .Va netrc-pipe
5071 and the section
5072 .Sx "On URL syntax and credential lookup" ;
5073 the section
5074 .Sx "The .netrc file"
5075 documents the file format in detail.
5078 .It Ic newmail
5079 Checks for new mail in the current folder without committing any changes
5080 before.
5081 If new mail is present, a message is shown.
5082 If the
5083 .Va header
5084 variable is set,
5085 the headers of each new message are also shown.
5086 This command is not available for all mailbox types.
5089 .It Ic next
5090 (n) (like
5091 .Ql +
5093 .Dq ENTER )
5094 Goes to the next message in sequence and types it.
5095 With an argument list, types the next matching message.
5098 .It Ic New
5099 Same as
5100 .Ic Unread .
5103 .It Ic new
5104 Same as
5105 .Ic unread .
5108 .It Ic noop
5109 If the current folder is accessed via a network connection, a
5110 .Dq NOOP
5111 command is sent, otherwise no operation is performed.
5114 .It Ic Page
5115 Like
5116 .Ic page ,
5117 but also displays header fields which would not pass the
5118 .Ic headerpick
5119 selection, and all MIME parts.
5120 Identical to
5121 .Ic More .
5124 .It Ic page
5125 Invokes the
5126 .Ev PAGER
5127 on the given messages, even in non-interactive mode and as long as the
5128 standard output is a terminal.
5129 Identical to
5130 .Ic more .
5133 .It Ic Pipe
5134 Like
5135 .Ic pipe
5136 but also pipes header fields which would not pass the
5137 .Ic headerpick
5138 selection, and all parts of MIME
5139 .Ql multipart/alternative
5140 messages.
5143 .It Ic pipe
5144 (pi) Takes a message list and a shell command
5145 and pipes the messages through the command.
5146 Without an argument the current message is piped through the command
5147 given by the
5148 .Va cmd
5149 variable.
5150 If the
5151 .Va page
5152 variable is set,
5153 every message is followed by a formfeed character.
5156 .It Ic preserve
5157 (pre) A synonym for
5158 .Ic hold .
5161 .It Ic Print
5162 (P) Alias for
5163 .Ic Type .
5166 .It Ic print
5167 (p) Research
5169 equivalent of
5170 .Ic type .
5173 .It Ic quit
5174 (q) Terminates the session, saving all undeleted, unsaved messages in
5175 the current
5176 .Mx -sx
5177 .Sx "secondary mailbox"
5178 .Ev MBOX ,
5179 preserving all messages marked with
5180 .Ic hold
5182 .Ic preserve
5183 or never referenced in the system
5184 .Va inbox ,
5185 and removing all other messages from the
5186 .Mx -sx
5187 .Sx "primary system mailbox" .
5188 If new mail has arrived during the session,
5189 the message
5190 .Dq You have new mail
5191 will be shown.
5192 If given while editing a mailbox file with the command line option
5193 .Fl f ,
5194 then the edit file is rewritten.
5195 A return to the shell is effected,
5196 unless the rewrite of edit file fails,
5197 in which case the user can escape with the exit command.
5200 .It Ic read
5201 \*(NQ Read a line from standard input, and assign the splitted and
5202 trimmed line data to the given variables.
5203 The variable names are checked by the same rules as documented for
5204 .Cm vput .
5205 If there are more fields than variables, assign successive fields to the
5206 last given variable.
5207 If there are less fields than variables, assign the empty string to the
5208 remains.
5209 The return status is tracked via
5210 .Va \&! :
5211 even though variable names are checked errors may still happen if it is
5212 tried to set, e.g., strings to variables which expect number settings;
5213 it thus only happens if names are used which have special meaning to \*(UA.
5214 \*(ID This command will likely be extended towards more
5215 .Xr read 1
5216 compatibility: for now splitting always occurs at whitespace, reverse
5217 solidus newline escaping is always supported, and the \*(OPal line
5218 editing features are always available when on an interactive terminal.
5219 .Bd -literal -offset indent
5220 ? read a b c
5221    H  e  l  l  o
5222 ? echo "<$a> <$b> <$c>"
5223 <H> <e> <l  l  o>
5227 .It Ic redirect
5228 Same as
5229 .Ic resend .
5232 .It Ic Redirect
5233 Same as
5234 .Ic Resend .
5237 .It Ic remove
5238 Removes the named files or directories.
5239 If a name refer to a mailbox, e.g., a Maildir mailbox, then a mailbox
5240 type specific removal will be performed, deleting the complete mailbox.
5241 The user is asked for confirmation in interactive mode.
5244 .It Ic rename
5245 Takes the name of an existing folder
5246 and the name for the new folder
5247 and renames the first to the second one.
5248 Both folders must be of the same type.
5251 .It Ic Reply
5252 (R) Reply to originator.
5253 Does not reply to other recipients of the original message.
5254 .Va flipr
5255 will exchange this command with
5256 .Ic reply .
5257 Unless the internal variable
5258 .Va fullnames
5259 is set the recipient address will be stripped from comments, names etc.
5262 .It Ic reply
5263 (r) Take a message and group-responds to it by addressing the sender
5264 and all recipients.
5265 .Va followup-to ,
5266 .Va followup-to-honour ,
5267 .Va reply-to-honour
5268 as well as
5269 .Va recipients-in-cc
5270 influence response behaviour.
5271 The command
5272 .Ic Lreply
5273 offers special support for replying to mailing lists.
5274 Unless the internal variable
5275 .Va fullnames
5276 is set recipient addresses will be stripped from comments, names etc.
5278 .Va flipr
5279 is set the commands
5280 .Ic Reply
5282 .Ic reply
5283 are exchanged.
5286 .It Ic replyall
5287 Similar to
5288 .Ic reply ,
5289 but initiates a group-reply regardless of the value of
5290 .Va flipr .
5293 .It Ic replysender
5294 Similar to
5295 .Ic Reply ,
5296 but responds to the sender only regardless of the value of
5297 .Va flipr .
5300 .It Ic Resend
5301 Like
5302 .Ic resend ,
5303 but does not add any header lines.
5304 This is not a way to hide the sender's identity,
5305 but useful for sending a message again to the same recipients.
5308 .It Ic resend
5309 Takes a list of messages and a user name
5310 and sends each message to the named user.
5311 .Ql Resent-From:
5312 and related header fields are prepended to the new copy of the message.
5315 .It Ic Respond
5316 Same as
5317 .Ic Reply .
5320 .It Ic respond
5321 Same as
5322 .Ic reply .
5325 .It Ic respondall
5326 Same as
5327 .Ic replyall .
5330 .It Ic respondsender
5331 Same as
5332 .Ic replysender .
5335 .It Ic retain
5336 (ret) Superseded by the multiplexer
5337 .Ic headerpick .
5340 .It Ic return
5341 Only available inside the scope of a
5342 .Ic define Ns
5343 d macro or an
5344 .Ic account ,
5345 this will stop evaluation of any further macro content, and return
5346 execution control to the caller.
5347 If no arguments are specified, the return value, which will be stored in
5348 .Va \&! ,
5349 as well as the macro command exit status, which is made available in
5350 .Va \&? ,
5351 are both set to 0.
5352 If only the return value is given the command exit status will be 0.
5353 Both optional parameters must be specified as unsigned (positive)
5354 decimal numbers.
5356 \*(ID Notes: any non-0 command exit status is treated as a hard error
5357 by the state machinery, and will be propagated up and cause, e.g.,
5358 a file inclusion via
5359 .Ic source
5360 to fail; this two argument form likely is a temporary hack that will
5361 vanish in v15.
5364 .It Ic Save
5365 (S) Similar to
5366 .Ic save,
5367 but saves the messages in a file named after the local part of the
5368 sender of the first message instead of (in
5369 .Va record
5370 and) taking a filename argument.
5373 .It Ic save
5374 (s) Takes a message list and a filename and appends each message in turn
5375 to the end of the file.
5376 If no filename is given, the
5377 .Mx -sx
5378 .Sx "secondary mailbox"
5379 .Ev MBOX
5380 is used.
5381 The filename in quotes, followed by the generated character count
5382 is echoed on the user's terminal.
5383 If editing a
5384 .Mx -sx
5385 .Sx "primary system mailbox"
5386 the messages are marked for deletion.
5387 .Sx "Filename transformations"
5388 will be applied.
5391 .It Ic savediscard
5392 \*(OB Superseded by the multiplexer
5393 .Ic headerpick .
5396 .It Ic saveignore
5397 \*(OB Superseded by the multiplexer
5398 .Ic headerpick .
5401 .It Ic saveretain
5402 \*(OB Superseded by the multiplexer
5403 .Ic headerpick .
5406 .It Ic search
5407 Takes a message specification (list) and displays a header summary of
5408 all matching messages, as via
5409 .Ic headers .
5410 This command is an alias of
5411 .Ic from .
5412 Also see
5413 .Sx "Specifying messages" .
5416 .It Ic seen
5417 Takes a message list and marks all messages as having been read.
5422 .It Ic set , unset
5423 (se, \*(NQ uns) The latter commands will delete all given variables,
5424 the former, when used without arguments, will show all variables which
5425 are currently known to \*(UA; a more verbose listing will be produced if
5426 either of
5427 .Va debug
5429 .Va verbose
5430 are set.
5432 Otherwise the given variables (and arguments) are set or adjusted.
5433 Arguments are of the form
5434 .Ql name=value
5435 (no space before or after
5436 .Ql = ) ,
5437 or plain
5438 .Ql name
5439 if there is no value, i.e., a boolean variable.
5440 Quotation marks may be placed around any part of the assignment
5441 statement to quote blanks or tabs, e.g.,
5443 .Dl set indentprefix='->'
5445 If an argument begins with
5446 .Ql no ,
5447 as in
5448 .Ql set nosave ,
5449 the effect is the same as invoking the
5450 .Ic unset
5451 command with the remaining part of the variable
5452 .Pf ( Ql unset save ) .
5455 .Ql name
5456 that is known to map to an environment variable will automatically cause
5457 updates in the program environment (unsetting a variable in the
5458 environment requires corresponding system support) \(em use the command
5459 .Ic environ
5460 for further environmental control.
5461 Also see
5462 .Ic varedit ,
5463 .Ic varshow
5464 and the sections
5465 .Sx "INTERNAL VARIABLES"
5467 .Sx ENVIRONMENT .
5471 .It Ic shcodec
5472 Apply shell quoting rules to the given raw-data arguments.
5473 Supports
5474 .Cm vput
5475 (see
5476 .Sx "Command modifiers" ) .
5477 The return status is tracked via
5478 .Va \&! .
5479 The first argument specifies the operation:
5480 .Ar [+]e[ncode]
5482 .Ar d[ecode]
5483 cause shell quoting to be applied to the remains of the line, and
5484 expanded away thereof, respectively.
5485 If the former is prefixed with a plus-sign, the quoted result will not
5486 be roundtrip enabled, and thus can be decoded only in the very same
5487 environment that was used to perform the encode; also see
5488 .Cd mle-quote-rndtrip .
5491 .It Ic shell
5492 (sh) Invokes an interactive version of the shell.
5496 .It Ic shortcut , unshortcut
5497 Without arguments the list of all currently defined shortcuts is
5498 shown.
5499 Otherwise all given arguments are treated as pairs of shortcuts and
5500 their expansions, creating new or changing already existing shortcuts,
5501 as necessary.
5502 The latter command will remove all given shortcuts, the special name
5503 .Ql *
5504 will remove all registered shortcuts.
5507 .It Ic shift
5508 Only available inside the scope of a
5509 .Ic call Ns
5510 ed macro, this will shift the positional parameters (starting at
5511 .Va 1 )
5512 by the given number (which must be an unsigned, positive, decimal),
5513 or 1 if no argument has been given.
5514 It is an error if the value exceeds the number of positional parameters.
5515 If the given number is 0, no action is performed, successfully.
5518 .It Ic show
5519 Like
5520 .Ic type ,
5521 but performs neither MIME decoding nor decryption, so that the raw
5522 message text is shown.
5525 .It Ic size
5526 (si) Shows the size in characters of each message of the given
5527 message-list.
5530 .It Ic sleep
5531 \*(NQ Sleep for the specified number of seconds (and optionally
5532 milliseconds) interruptably.
5537 .It Ic sort , unsort
5538 The latter command disables sorted or threaded mode, returns to normal
5539 message order and, if the
5540 .Va header
5541 variable is set,
5542 displays a header summary.
5543 The former command shows the current sorting criterion when used without
5544 an argument, but creates a sorted representation of the current folder
5545 otherwise, and changes the
5546 .Ic next
5547 command and the addressing modes such that they refer to messages in
5548 the sorted order.
5549 Message numbers are the same as in regular mode.
5550 If the
5551 .Va header
5552 variable is set,
5553 a header summary in the new order is also displayed.
5554 Automatic folder sorting can be enabled by setting the
5555 .Va autosort
5556 variable, as in, e.g.,
5557 .Ql set autosort=thread .
5558 Possible sorting criterions are:
5561 .Bl -tag -compact -width "subject"
5562 .It Ar date
5563 Sort the messages by their
5564 .Ql Date:
5565 field, that is by the time they were sent.
5566 .It Ar from
5567 Sort messages by the value of their
5568 .Ql From:
5569 field, that is by the address of the sender.
5570 If the
5571 .Va showname
5572 variable is set, the sender's real name (if any) is used.
5573 .It Ar size
5574 Sort the messages by their size.
5575 .It spam
5576 \*(OP Sort the message by their spam score, as has been classified by
5577 .Ic spamrate .
5578 .It Ar status
5579 Sort the messages by their message status.
5580 .It Ar subject
5581 Sort the messages by their subject.
5582 .It Ar thread
5583 Create a threaded display.
5584 .It Ar to
5585 Sort messages by the value of their
5586 .Ql To:
5587 field, that is by the address of the recipient.
5588 If the
5589 .Va showname
5590 variable is set, the recipient's real name (if any) is used.
5595 .It Ic source
5596 \*(NQ (so) The source command reads commands from the given file.
5597 .Sx "Filename transformations"
5598 will be applied.
5599 If the given expanded argument ends with a vertical bar
5600 .Ql |
5601 then the argument will instead be interpreted as a shell command and
5602 \*(UA will read the output generated by it.
5603 Interpretation of commands read is stopped when an error is encountered.
5604 \*(ID Note that
5605 .Ic \&\&source
5606 cannot be used from within macros that execute as
5607 .Va folder-hook Ns s
5609 .Ic account Ns s ,
5610 i.e., it can only be called from macros that were
5611 .Ic call Ns ed .
5614 .It Ic source_if
5615 \*(NQ The difference to
5616 .Ic source
5617 (beside not supporting pipe syntax aka shell command input) is that
5618 this command will not generate an error nor warn if the given file
5619 argument cannot be opened successfully.
5622 .It Ic spamclear
5623 \*(OP Takes a list of messages and clears their
5624 .Ql is-spam
5625 flag.
5628 .It Ic spamforget
5629 \*(OP Takes a list of messages and causes the
5630 .Va spam-interface
5631 to forget it has ever used them to train its Bayesian filter.
5632 Unless otherwise noted the
5633 .Ql is-spam
5634 flag of the message is inspected to chose whether a message shall be
5635 forgotten to be
5636 .Dq ham
5638 .Dq spam .
5641 .It Ic spamham
5642 \*(OP Takes a list of messages and informs the Bayesian filter of the
5643 .Va spam-interface
5644 that they are
5645 .Dq ham .
5646 This also clears the
5647 .Ql is-spam
5648 flag of the messages in question.
5651 .It Ic spamrate
5652 \*(OP Takes a list of messages and rates them using the configured
5653 .Va spam-interface ,
5654 without modifying the messages, but setting their
5655 .Ql is-spam
5656 flag as appropriate; because the spam rating headers are lost the rate
5657 will be forgotten once the mailbox is left.
5658 Refer to the manual section
5659 .Sx "Handling spam"
5660 for the complete picture of spam handling in \*(UA.
5663 .It Ic spamset
5664 \*(OP Takes a list of messages and sets their
5665 .Ql is-spam
5666 flag.
5669 .It Ic spamspam
5670 \*(OP Takes a list of messages and informs the Bayesian filter of the
5671 .Va spam-interface
5672 that they are
5673 .Dq spam .
5674 This also sets the
5675 .Ql is-spam
5676 flag of the messages in question.
5679 .It Ic thread
5680 \*(OB The same as
5681 .Ql sort thread
5682 (consider using a
5683 .Ql ghost
5684 as necessary).
5687 .It Ic Top
5688 Like
5689 .Ic top
5690 but always uses the
5691 .Ic headerpick
5692 .Ql type
5693 slot for white- and blacklisting header fields.
5696 .It Ic top
5697 (to) Takes a message list and types out the first
5698 .Va toplines
5699 lines of each message on the users' terminal.
5700 Unless a special selection has been established for the
5701 .Ql top
5702 slot of the
5703 .Ic headerpick
5704 command, the only header fields that are displayed are
5705 .Ql From: ,
5706 .Ql To: ,
5707 .Ql CC: ,
5709 .Ql Subject: .
5710 .Ic Top
5711 will always use the
5712 .Ql type
5713 .Ic headerpick
5714 selection instead.
5715 It is possible to apply compression to what is displayed by setting
5716 .Va topsqueeze .
5717 Messages are decrypted and converted to the terminal character set
5718 if necessary.
5721 .It Ic touch
5722 (tou) Takes a message list and marks the messages for saving in the
5723 .Mx -sx
5724 .Sx "secondary mailbox"
5725 .Ev MBOX .
5726 \*(UA deviates from the POSIX standard with this command,
5727 as a following
5728 .Ic next
5729 command will display the following message instead of the current one.
5732 .It Ic Type
5733 (T) Like
5734 .Ic type
5735 but also displays header fields which would not pass the
5736 .Ic headerpick
5737 selection, and all parts of MIME
5738 .Ql multipart/alternative
5739 messages.
5742 .It Ic type
5743 (t) Takes a message list and types out each message on the users'
5744 terminal, honouring
5745 .Ic headerpick
5746 selections.
5747 For MIME multipart messages, all parts with a content type of
5748 .Ql text
5750 .Ql message
5751 are shown, the other are hidden except for their headers.
5752 Messages are decrypted and converted to the terminal character set
5753 if necessary.
5755 .It Ic unaccount
5757 .Ic account .
5759 .It Ic unalias
5760 (una) See
5761 .Ic alias .
5763 .It Ic unanswered
5765 .Ic answered .
5767 .It Ic unbind
5769 .Ic bind .
5771 .It Ic uncollapse
5773 .Ic collapse .
5775 .It Ic uncolour
5777 .Ic colour .
5779 .It Ic undefine
5781 .Ic define .
5783 .It Ic undelete
5785 .Ic delete .
5787 .It Ic undraft
5789 .Ic draft .
5791 .It Ic unflag
5793 .Ic flag .
5796 .It Ic unfwdignore
5797 \*(OB Superseded by the multiplexer
5798 .Ic headerpick .
5801 .It Ic unfwdretain
5802 \*(OB Superseded by the multiplexer
5803 .Ic headerpick .
5805 .It Ic unghost
5807 .Ic ghost .
5810 .It Ic unignore
5811 Superseded by the multiplexer
5812 .Ic headerpick .
5814 .It Ic unmimetype
5816 .Ic mimetype .
5818 .It Ic unmlist
5820 .Ic mlist .
5822 .It Ic unmlsubscribe
5824 .Ic mlsubscribe .
5827 .It Ic Unread
5828 Same as
5829 .Ic unread .
5832 .It Ic unread
5833 Takes a message list and marks each message as not having been read.
5836 .It Ic unretain
5837 Superseded by the multiplexer
5838 .Ic headerpick .
5841 .It Ic unsaveignore
5842 \*(OB Superseded by the multiplexer
5843 .Ic headerpick .
5846 .It Ic unsaveretain
5847 \*(OB Superseded by the multiplexer
5848 .Ic headerpick .
5850 .It Ic unset
5851 \*(NQ (uns) See
5852 .Ic set .
5854 .It Ic unshortcut
5856 .Ic shortcut .
5858 .It Ic unsort
5860 .Ic short .
5863 .It Ic unthread
5864 \*(OB
5865 Same as
5866 .Ic unsort .
5869 .It Ic urlcodec
5870 Perform URL percent codec operations on the raw-data argument, rather
5871 according to RFC 3986.
5872 Supports
5873 .Cm vput
5874 (see
5875 .Sx "Command modifiers" ) .
5876 The return status is tracked via
5877 .Va \&! .
5878 This is a character set agnostic and thus locale dependent operation,
5879 and it may decode bytes which are invalid in the current locale, unless
5880 the input solely consists of characters in the portable character set, see
5881 .Sx "Character sets" .
5882 \*(ID This command does not about URLs beside that.
5884 The first argument specifies the operation:
5885 .Ar e[ncode]
5887 .Ar d[ecode]
5888 perform plain URL percent en- and decoding, respectively.
5889 .Ar p[ath]enc[ode]
5891 .Ar p[ath]dec[ode]
5892 perform a slightly modified operation which should be better for
5893 pathnames: it does not allow a tilde
5894 .Ql ~ ,
5895 and will neither accept hyphen-minus
5896 .Ql -
5897 nor dot
5898 .Ql .
5899 as an initial character.
5900 The remains of the line form the URL data which is to be converted.
5903 .It Ic varedit
5904 \*(NQ Edit the values of or create the given variable(s) in the
5905 .Ev EDITOR .
5906 Boolean variables cannot be edited, and variables can also not be
5907 .Ic unset
5908 with this command.
5911 .It Ic varshow
5912 \*(NQ This command produces the same output as the listing mode of
5913 .Ic set ,
5914 including
5915 .Va verbose Ns
5916 ity adjustments, but only for the given variables.
5919 .It Ic verify
5920 \*(OP Takes a message list and verifies each message.
5921 If a message is not a S/MIME signed message,
5922 verification will fail for it.
5923 The verification process checks if the message was signed using a valid
5924 certificate,
5925 if the message sender's email address matches one of those contained
5926 within the certificate,
5927 and if the message content has been altered.
5930 .It Ic version
5931 Shows the
5932 .Va version
5934 .Va features
5935 of \*(UA.
5939 .It Ic vexpr
5940 \*(NQ Evaluate arguments according to a given operator.
5941 This is a multiplexer command which can be used to perform signed 64-bit
5942 numeric calculations as well as string operations.
5943 It uses polish notation, i.e., the operator is the first argument and
5944 defines the number and type, and the meaning of the remaining arguments.
5945 An empty argument is replaced with a 0 if a number is expected.
5946 Supports
5947 .Cm vput
5948 (see
5949 .Sx "Command modifiers" ) .
5950 The return status is tracked via
5951 .Va \&! ,
5952 the result that is shown in case of (soft) errors is
5953 .Ql -1 .
5954 In general only invalid use cases cause hard errors which are reflected in
5955 .Va \&?
5956 and affect the state machine.
5959 Numeric operations work on one or two signed 64-bit integers.
5960 One integer is expected by assignment (equals sign
5961 .Ql = ) ,
5962 which does nothing but parsing the argument, thus detecting validity and
5963 possible overflow conditions, and unary not (tilde
5964 .Ql ~ ) ,
5965 which creates the bitwise complement.
5966 Two integers are used by addition (plus sign
5967 .Ql + ) ,
5968 subtraction (hyphen-minus
5969 .Ql - ) ,
5970 multiplication (asterisk
5971 .Ql * ) ,
5972 division (solidus
5973 .Ql / )
5974 and modulo (percent sign
5975 .Ql % ) ,
5976 as well as for the bitwise operators logical or (vertical bar
5977 .Ql | ,
5978 to be quoted) ,
5979 bitwise and (ampersand
5980 .Ql \&& ,
5981 to be quoted) ,
5982 bitwise xor (circumflex
5983 .Ql ^ ) ,
5984 the bitwise signed left- and right shifts
5985 .Pf ( Ql << ,
5986 .Ql >> ) ,
5987 as well as for the unsigned right shift
5988 .Ql >>> .
5991 All numeric operators can be suffixed with a commercial at
5992 .Ql @ ,
5993 e.g.,
5994 .Ql *@ :
5995 this will turn the operation into a saturated one, which means that
5996 overflow errors and division and modulo by zero are still reflected in
5997 the return status, but the result will linger at the minimum or maximum
5998 possible value, instead of overflowing (or trapping).
5999 For the bitwise shifts, the saturated maximum is 63.
6000 If in saturated mode the overflow occurs during parsing the numbers,
6001 then the actual operation will not be performed but the given maximum
6002 value is used as the result immediately.
6005 String operations that take one argument are
6006 .Ql length ,
6007 which queries the length of the given argument,
6008 .Ql hash ,
6009 which calculates the Chris Torek hash of the given string, and
6010 .Ql file-expand ,
6011 which performs the usual
6012 .Sx "Filename transformations" ,
6013 on its argument, as well as
6014 .Ql random ,
6015 which generates a random string of the given length, or of
6016 .Dv \&\&PATH_MAX
6017 bytes (a constant from
6018 .Pa /usr/include )
6019 if the value 0 is given; the random string will be base64url encoded
6020 according to RFC 4648, and thus be usable as a file name.
6023 String operations with two or more arguments are
6024 .Ql find ,
6025 which searches in the first for the second argument, and shows the
6026 resulting 0-based offset shall it have been found,
6027 .Ql ifind ,
6028 which is identical to
6029 .Ql find ,
6030 but works case-insensitively according to the rules of the ASCII
6031 character set.
6032 .Ql substring
6033 will show a substring of its first argument:
6034 the second argument is the 0-based starting offset, the optional third
6035 argument can be used to specify the length of the desired substring,
6036 by default the entire string is used;
6037 this operation tries to work around faulty arguments, but the (soft)
6038 return status will still reflect them (set
6039 .Va verbose
6040 for error logs).
6043 \*(OP
6044 .Ql regex
6045 will try to match the first argument with the regular expression given
6046 in the second argument, as does
6047 .Ql iregex ,
6048 but which is case-insensitive.
6049 These operators match according to the active
6050 .Ev LC_CTYPE
6051 locale and thus should match correctly strings in the locale encoding.
6052 If the optional third argument has been given then instead of showing
6053 the match offset a replacement operation is performed:
6054 the third argument is treated as if specified via dollar-single-quote
6055 (see
6056 .Sx "Shell-style argument quoting" ) ,
6057 and any occurrence of a positional parameter, e.g.,
6058 .Va 1 ,
6059 is replaced by the corresponding match group of the regular expression.
6061 .Bd -literal -offset indent
6062 ? vexpr -@ +1 -9223372036854775808
6063 ? vput vexpr res ir bananarama (.*)nana(.*) '\e${1}au\e$2'
6064 ? echo $0 $res
6069 .It Ic visual
6070 (v) Takes a message list and invokes the display editor on each message.
6071 Modified contents are discarded unless the
6072 .Va writebackedited
6073 variable is set.
6076 .It Ic write
6077 (w) For conventional messages the body without all headers is written.
6078 The original message is never marked for deletion in the originating
6079 mail folder.
6080 The output is decrypted and converted to its native format as necessary.
6081 If the output file exists, the text is appended.
6082 If a message is in MIME multipart format its first part is written to
6083 the specified file as for conventional messages, handling of the remains
6084 depends on the execution mode.
6085 No special handling of compressed files is performed.
6087 In interactive mode the user is consecutively asked for the filenames of
6088 the processed parts.
6089 For convience saving of each part may be skipped by giving an empty
6090 value, the same result as writing it to
6091 .Pa /dev/null .
6092 Shell piping the part content by specifying a leading vertical bar
6093 .Ql |
6094 character for the filename is supported.
6095 Other user input undergoes the usual
6096 .Sx "Filename transformations" ,
6097 and contents of the destination file are overwritten if the file
6098 previously existed.
6100 \*(ID In non-interactive mode any part which does not specify a filename
6101 is ignored, and suspicious parts of filenames of the remaining parts are
6102 URL percent encoded (as via
6103 .Ic urlencode )
6104 to prevent injection of malicious character sequences, resulting in
6105 a filename that will be written into the current directory.
6106 Existing files will not be overwritten, instead the part number or
6107 a dot are appended after a number sign
6108 .Ql #
6109 to the name until file creation succeeds (or fails due to other
6110 reasons).
6113 .It Ic xcall
6114 \*(NQ This command works only inside of a
6115 .Ic call Ns
6116 ed macro: the sole difference to
6117 .Ic call
6118 is that the new macro is executed in place of the current one, which
6119 will not regain control; all resources of the current macro will be
6120 released before control is given to the replacer.
6123 .It Ic xit
6124 (x) A synonym for
6125 .Ic exit .
6128 .It Ic z
6129 \*(NQ \*(UA presents message headers in
6130 .Va screen Ns
6131 fuls as described under the
6132 .Ic headers
6133 command.
6134 Without arguments this command scrolls to the next window of messages,
6135 likewise if the argument is
6136 .Ql + .
6137 An argument of
6138 .Ql -
6139 scrolls to the last,
6140 .Ql ^
6141 scrolls to the first, and
6142 .Ql $
6143 to the last
6144 .Va \&\&screen
6145 of messages.
6146 A number argument prefixed by
6147 .Ql +
6149 .Ql \-
6150 indicates that the window is calculated in relation to the current
6151 position, and a number without a prefix specifies an absolute position.
6154 .It Ic Z
6155 \*(NQ Similar to
6156 .Ic z ,
6157 but scrolls to the next or previous window that contains at least one
6158 .Ql new
6160 .Ic flag Ns
6161 ged message.
6163 .\" }}}
6164 .\" }}}
6167 .\" .Sh COMMAND ESCAPES {{{
6168 .Sh "COMMAND ESCAPES"
6170 Here is a summary of the command escapes available in compose mode,
6171 which are used to perform special functions when composing messages.
6172 Command escapes are only recognized at the beginning of lines.
6173 The actual escape character can be set via the internal variable
6174 .Va escape ,
6175 it defaults to the tilde
6176 .Ql ~ .
6179 .Bl -tag -width ".It Ic BaNg"
6181 .It Ic ~~ Ar string
6182 Insert the string of text in the message prefaced by a single
6183 .Ql ~ .
6184 (If the escape character has been changed,
6185 that character must be doubled
6186 in order to send it at the beginning of a line.)
6189 .It Ic ~! Ar command
6190 Execute the indicated shell
6191 .Ar command
6192 which follows, replacing unescaped exclamation marks with the previously
6193 executed command if the internal variable
6194 .Va bang
6195 is set, then return to the message.
6198 .It Ic ~.
6199 Same effect as typing the end-of-file character.
6202 .It Ic ~: Ar \*(UA-command Ns \0or Ic ~_ Ar \*(UA-command
6203 Execute the given \*(UA command.
6204 Not all commands, however, are allowed.
6207 .It Ic ~?
6208 Write a summary of command escapes.
6211 .It Ic ~< Ar filename
6212 Identical to
6213 .Ic ~r .
6216 .It Ic ~<! Ar command
6217 .Ar command
6218 is executed using the shell.
6219 Its standard output is inserted into the message.
6222 .It Ic ~@ Op Ar filename...
6223 Append or edit the list of attachments.
6224 A list of
6225 .Ar filename
6226 arguments is expected (see
6227 .Sx "Shell-style argument quoting" ;
6228 any token-separating commas are ignored), to be
6229 interpreted as documented for the command line option
6230 .Fl a ,
6231 with the message number exception as below.
6232 Without
6233 .Ar filename
6234 arguments the attachment list is edited, entry by entry;
6235 if a filename is left empty, that attachment is deleted from the list;
6236 once the end of the list is reached either new attachments may be
6237 entered or the session can be quit by committing an empty
6238 .Dq new
6239 attachment.
6240 For each mode, if a given file name solely consists of the number sign
6241 .Ql #
6242 followed by a valid message number of the currently active mailbox, then
6243 the given message is attached as a MIME
6244 .Ql message/rfc822
6245 part (note the number sign is the comment character and must be quoted).
6248 .It Ic ~A
6249 Inserts the string contained in the
6250 .Va Sign
6251 variable (same as
6252 .Ql Ic ~i Ns \0Sign ) .
6253 \*(OB (Use the
6254 .Cm wysh
6255 prefix when
6256 .Ic set Ns
6257 ting the variable(s) instead!) The escape sequences tabulator
6258 .Ql \et
6259 and newline
6260 .Ql \en
6261 are understood.
6264 .It Ic ~a
6265 Inserts the string contained in the
6266 .Va sign
6267 variable (same as
6268 .Ql Ic ~i Ns \0sign ) .
6269 \*(OB (Use the
6270 .Cm wysh
6271 prefix when
6272 .Ic set Ns
6273 ting the variable(s) instead!) The escape sequences tabulator
6274 .Ql \et
6275 and newline
6276 .Ql \en
6277 are understood.
6280 .It Ic ~b Ar name ...
6281 Add the given names to the list of blind carbon copy recipients.
6284 .It Ic ~c Ar name ...
6285 Add the given names to the list of carbon copy recipients.
6288 .It Ic ~d
6289 Read the file specified by the
6290 .Ev DEAD
6291 variable into the message.
6294 .It Ic ~e
6295 Invoke the text editor on the message collected so far.
6296 After the editing session is finished,
6297 the user may continue appending text to the message.
6300 .It Ic ~F Ar messages
6301 Read the named messages into the message being sent, including all
6302 message headers and MIME parts.
6303 If no messages are specified, read in the current message.
6306 .It Ic ~f Ar messages
6307 Read the named messages into the message being sent.
6308 If no messages are specified, read in the current message.
6309 Strips down the list of header fields according to the
6310 .Ql type
6311 white- and blacklist selection of
6312 .Ic headerpick .
6313 For MIME multipart messages,
6314 only the first displayable part is included.
6317 .It Ic ~H
6318 Edit the message header fields
6319 .Ql From: ,
6320 .Ql Reply-To:
6322 .Ql Sender:
6323 by typing each one in turn and allowing the user to edit the field.
6324 The default values for these fields originate from the
6325 .Va from , replyto
6327 .Va sender
6328 variables.
6331 .It Ic ~h
6332 Edit the message header fields
6333 .Ql To: ,
6334 .Ql Cc: ,
6335 .Ql Bcc:
6337 .Ql Subject:
6338 by typing each one in turn and allowing the user to edit the field.
6341 .It Ic ~i Ar variable
6342 Insert the value of the specified variable into the message,
6343 adding a newline character at the end.
6344 The message remains unaltered if the variable is unset or empty.
6345 \*(OB (Use the
6346 .Cm wysh
6347 prefix when
6348 .Ic set Ns
6349 ting the variable(s) instead!) The escape sequences tabulator
6350 .Ql \et
6351 and newline
6352 .Ql \en
6353 are understood.
6356 .It Ic ~M Ar messages
6357 Read the named messages into the message being sent,
6358 indented by
6359 .Va indentprefix .
6360 If no messages are specified, read the current message.
6363 .It Ic ~m Ar messages
6364 Read the named messages into the message being sent,
6365 indented by
6366 .Va indentprefix .
6367 If no messages are specified, read the current message.
6368 Strips down the list of header fields according to the
6369 .Ql type
6370 white- and blacklist selection of
6371 .Ic headerpick .
6372 For MIME multipart messages,
6373 only the first displayable part is included.
6376 .It Ic ~p
6377 Display the message collected so far,
6378 prefaced by the message header fields
6379 and followed by the attachment list, if any.
6382 .It Ic ~q
6383 Abort the message being sent,
6384 copying it to the file specified by the
6385 .Ev DEAD
6386 variable if
6387 .Va save
6388 is set.
6391 .It Ic ~R Ar filename
6392 Identical to
6393 .Ic ~r ,
6394 but indent each line that has been read by
6395 .Va indentprefix .
6398 .It Ic ~r Ar filename Op Ar HERE-delimiter
6399 Read the named file into the message.
6400 .Ar filename
6401 can also be a hyphen-minus
6402 .Ql - ,
6403 in which case standard input is used, e.g., for pasting purposes.
6404 Only in this latter mode
6405 .Ar HERE-delimiter
6406 may be given: if it is data will be read in until the given
6407 .Ar HERE-delimiter
6408 is seen on a line by itself, and encountering EOF is an error; the
6409 .Ar HERE-delimiter
6410 is a required argument in non-interactive mode;
6411 note that variables expansion is performed on the delimiter.
6414 .It Ic ~s Ar string
6415 Cause the named string to become the current subject field.
6416 Newline (NL) and carriage-return (CR) bytes are invalid and will be
6417 normalized to space (SP) characters.
6420 .It Ic ~t Ar name ...
6421 Add the given name(s) to the direct recipient list.
6424 .It Ic ~U Ar messages
6425 Read in the given / current message(s) excluding all headers, indented by
6426 .Va indentprefix .
6429 .It Ic ~u Ar messages
6430 Read in the given / current message(s), excluding all headers.
6433 .It Ic ~v
6434 Invoke an alternate editor (defined by the
6435 .Ev VISUAL
6436 environment variable) on the message collected so far.
6437 Usually, the alternate editor will be a screen editor.
6438 After the editor is quit,
6439 the user may resume appending text to the end of the message.
6442 .It Ic ~w Ar filename
6443 Write the message onto the named file.
6444 If the file exists,
6445 the message is appended to it.
6448 .It Ic ~x
6449 Same as
6450 .Ic ~q ,
6451 except that the message is not saved at all.
6454 .It Ic ~| Ar command
6455 Pipe the message through the specified filter command.
6456 If the command gives no output or terminates abnormally,
6457 retain the original text of the message.
6458 E.g., the command
6459 .Xr fmt 1
6460 is often used as a rejustifying filter.
6464 .It Ic ~^ Ar cmd Op Ar subcmd Op Ar arg3 Op Ar arg4
6465 Low-level command ment for scripted message access, i.e., for
6466 .Va on-compose-splice-shell
6468 .Va on-compose-splice .
6469 The used protocol is likely subject to changes, and therefore the
6470 mentioned hooks receive the used protocol version as an initial line.
6471 In general the first field of a response line represents a status code
6472 which specifies whether a command was successful or not, whether result
6473 data is to be expected, and if, the format of the result data.
6474 The status codes are:
6477 .Bl -tag -compact -width _210_
6478 .It Ql 210
6479 Status ok; the remains of the line are the result.
6480 .It Ql 211
6481 Status ok; the rest of the line is optionally used for more status.
6482 What follows are lines of result addresses, terminated by an empty line.
6483 The address lines consist of two fields, the first of which is the
6484 plain address, e.g.,
6485 .Ql bob@exam.ple ,
6486 separated by a single ASCII SP space from the second which contains the
6487 unstripped address, even if that is identical to the first field, e.g.,
6488 .Ql (Lovely) Bob <bob@exam.ple> .
6489 .It Ql 212
6490 Status ok; the rest of the line is optionally used for more status.
6491 What follows are lines of furtherly unspecified string content,
6492 terminated by an empty line.
6493 (All the input, including the empty line, must be consumed before
6494 further commands can be issued.)
6495 .It Ql 500
6496 Syntax error; invalid command.
6497 .It Ql 501
6498 Syntax error in parameters or arguments.
6499 .It Ql 505
6500 Error: an argument fails verification.
6501 For example an invalid address has been specified.
6502 .It Ql 506
6503 Error: an otherwise valid argument is rendered invalid due to context.
6504 For example, a second address is added to a header which may consist of
6505 a single address only.
6509 If a command indicates failure then the message will have remained
6510 unmodified.
6511 Most commands can fail with
6512 .Ql 500
6513 if required arguments are missing (false command usage).
6514 The following commands are supported, and, as usual, case-insensitive:
6517 .Bl -hang -width header
6518 .It Ar header
6519 This command allows listing, inspection, and editing of message headers.
6520 The second argument specifies the subcommand to apply, one of:
6523 .Bl -hang -compact -width remove
6524 .It Ar list
6525 Without a third argument a list of all yet existing headers is given via
6526 .Ql 210 ;
6527 this command is the default command of
6528 .Ar header
6529 if no second argument has been given.
6530 A third argument restricts output to the given header only, which may
6531 fail with
6532 .Ql 501
6533 if no such field is defined.
6535 .It Ar show
6536 Shows the content of the header given as the third argument.
6537 Dependent on the header type this may respond with
6538 .Ql 211
6540 .Ql 212 ;
6541 any failure results in
6542 .Ql 501 .
6544 .It Ar remove
6545 This will remove all instances of the header given as the third
6546 argument, reporting
6547 .Ql 210
6548 upon success or
6549 .Ql 501
6550 if no such header can be found.
6552 .It Ar insert
6553 Create a new or an additional instance of the header given in the third
6554 argument, with the header body content as given in the fourth argument
6555 (the remains of the line).
6556 It may return
6557 .Ql 501
6558 if the third argument specifies a free-form header field name that is
6559 invalid, or if body content extraction fails to succeed,
6560 .Ql 505
6561 if any extracted address does not pass syntax and/or security checks, and
6562 .Ql 506
6563 to indicate prevention of excessing a single-instance header \(em note that
6564 .Ql Subject:
6565 can be appended to (a space separator will be added automatically first).
6566 .Ql 210
6567 is returned upon success.
6571 .It Ar attachment
6572 This command allows listing, removal and addition of message attachments.
6573 The second argument specifies the subcommand to apply, one of:
6576 .Bl -hang -compact -width remove
6577 .It Ar list
6578 List all attachments via
6579 .Ql 212 ,
6580 or report
6581 .Ql 501
6582 if no attachments exist.
6583 This command is the default command of
6584 .Ar attachment
6585 if no second argument has been given.
6587 .It Ar remove
6588 This will remove the attachment given as the third argument, and report
6589 .Ql 210
6590 upon success or
6591 .Ql 501
6592 if no such attachment can be found.
6593 If there exists any path component in the given argument, then an exact
6594 match of the path which has been used to create the attachment is used
6595 directly, but if only the basename of that path matches then all
6596 attachments are traversed to find an exact match first, and the removal
6597 occurs afterwards; if multiple basenames match, a
6598 .Ql 506
6599 error occurs.
6600 Message attachments are treated as absolute pathnames.
6602 If no path component exists in the given argument, then all attachments
6603 will be searched for
6604 .Ql filename=
6605 parameter matches as well as for matches of the basename of the path
6606 which has been used when the attachment has been created; multiple
6607 matches result in a
6608 .Ql 506 .
6610 .It Ar remove-at
6611 This will interpret the third argument as a number and remove the
6612 attachment at that list position (counting from one!), reporting
6613 .Ql 210
6614 upon success or
6615 .Ql 505
6616 if the argument is not a number or
6617 .Ql 501
6618 if no such attachment exists.
6620 .It Ar insert
6621 Adds the attachment given as the third argument, specified exactly as
6622 documented for the command line option
6623 .Fl a ,
6624 and supporting the message number extension as documented for
6625 .Ic ~@ .
6626 This reports
6627 .Ql 210
6628 upon success, with the index of the new attachment following,
6629 .Ql 505
6630 if the given file cannot be opened,
6631 .Ql 506
6632 if an on-the-fly performed character set conversion fails, otherwise
6633 .Ql 501
6634 is reported; this is also reported if character set conversion is
6635 requested but not available.
6637 .It Ar attribute
6638 This uses the same search mechanism as described for
6639 .Ar remove
6640 and prints any known attributes of the first found attachment via
6641 .Ql 212
6642 upon success or
6643 .Ql 501
6644 if no such attachment can be found.
6645 The attributes are written as lines of keyword and value tuples, the
6646 keyword being separated from the rest of the line with an ASCII SP space
6647 character.
6649 .It Ar attribute-at
6650 This uses the same search mechanism as described for
6651 .Ar remove-at
6652 and is otherwise identical to
6653 .Ar attribute .
6655 .It Ar attribute-set
6656 This uses the same search mechanism as described for
6657 .Ar remove ,
6658 and will assign the attribute given as the fourth argument, which is
6659 expected to be a value tuple of keyword and other data, separated by
6660 a ASCII SP space or TAB tabulator character.
6661 If the value part is empty, then the given attribute is removed, or
6662 reset to a default value if existence of the attribute is crucial.
6663 It returns via
6664 .Ql 210
6665 upon success, with the index of the found attachment following,
6666 .Ql 505
6667 for message attachments or if the given keyword is invalid, and
6668 .Ql 501
6669 if no such attachment can be found.
6670 The following keywords may be used (case-insensitively):
6672 .Bl -hang -compact -width ".Ql filename"
6673 .It Ql filename
6674 Sets the filename of the MIME part, i.e., the name that is used for
6675 display and when (suggesting a name for) saving (purposes).
6676 .It Ql content-description
6677 Associate some descriptive information to the attachment's content, used
6678 in favour of the plain filename by some MUAs.
6679 .It Ql content-id
6680 May be used for uniquely identifying MIME entities in several contexts;
6681 this expects a special reference address format as defined in RFC 2045
6682 and generates a
6683 .Ql 505
6684 upon address content verification failure.
6685 .It Ql content-type
6686 Specifies the media type and subtype of the part; managed automatically.
6687 .It Ql content-disposition
6688 Automatically set to the string
6689 .Ql attachment .
6692 .It Ar attribute-set-at
6693 This uses the same search mechanism as described for
6694 .Ar remove-at
6695 and is otherwise identical to
6696 .Ar attribute-set .
6702 .\" }}}
6705 .\" .Sh INTERNAL VARIABLES {{{
6706 .Sh "INTERNAL VARIABLES"
6708 Internal \*(UA variables are controlled via the
6709 .Ic set
6711 .Ic unset
6712 commands; prefixing a variable name with the string
6713 .Ql no
6714 and calling
6715 .Ic set
6716 has the same effect as using
6717 .Ic unset :
6718 .Ql unset crt
6720 .Ql set nocrt
6721 do the same thing.
6722 Creation or editing of variables can be performed in the
6723 .Ev EDITOR
6724 with the command
6725 .Ic varedit .
6726 .Ic varshow
6727 will give more insight on the given variable(s), and
6728 .Ic set ,
6729 when called without arguments, will show a listing of all variables.
6730 Both commands support a more
6731 .Va verbose
6732 listing mode.
6733 Some well-known variables will also become inherited from the
6734 program
6735 .Sx ENVIRONMENT
6736 implicitly, others can be explicitly imported with the command
6737 .Ic environ
6738 and henceforth share said properties.
6741 Two different kind of internal variables exist.
6742 There are boolean variables, which can only be in one of the two states
6743 .Dq set
6745 .Dq unset ,
6746 and value variables with a(n optional) string value.
6747 For the latter proper quoting is necessary upon assignment time, the
6748 introduction of the section
6749 .Sx COMMANDS
6750 documents the supported quoting rules.
6752 .Bd -literal -offset indent
6753 wysh set one=val\e 1 two="val 2" \e
6754     three='val "3"' four=$'val \e'4\e''; \e
6755 varshow one two three four; \e
6756 unset one two three four
6760 Dependent upon the actual option the string values will be interpreted
6761 as numbers, colour names, normal text etc., but there also exists
6762 a special kind of string value, the
6763 .Dq boolean string ,
6764 which must either be a decimal integer (in which case
6765 .Ql 0
6766 is false and
6767 .Ql 1
6768 and any other value is true) or any of the (case-insensitive) strings
6769 .Ql off ,
6770 .Ql no ,
6771 .Ql n
6773 .Ql false
6774 for a false boolean and
6775 .Ql on ,
6776 .Ql yes ,
6777 .Ql y
6779 .Ql true
6780 for a true boolean; a special kind of boolean string is the
6781 .Dq quadoption ,
6782 which is a boolean string that can optionally be prefixed with the
6783 (case-insensitive) term
6784 .Ql ask- ,
6785 as in
6786 .Ql ask-yes ,
6787 which causes prompting of the user in interactive mode, with the given
6788 boolean as the default value.
6790 .\" .Ss "Initial settings" {{{
6791 .\" (Keep in SYNC: ./nail.h:okeys, ./nail.rc, ./nail.1:"Initial settings")
6792 .Ss "Initial settings"
6794 The standard POSIX 2008/Cor 2-2016 mandates the following initial
6795 variable settings:
6796 .Pf no Va allnet ,
6797 .Pf no Va append ,
6798 .Va asksub ,
6799 .Pf no Va askbcc ,
6800 .Pf no Va autoprint ,
6801 .Pf no Va bang ,
6802 .Pf no Va cmd ,
6803 .Pf no Va crt ,
6804 .Pf no Va debug ,
6805 .Pf no Va dot ,
6806 .Va escape
6807 set to
6808 .Ql ~ ,
6809 .Pf no Va flipr ,
6810 .Pf no Va folder ,
6811 .Va header ,
6812 .Pf no Va hold ,
6813 .Pf no Va ignore ,
6814 .Pf no Va ignoreeof ,
6815 .Pf no Va keep ,
6816 .Pf no Va keepsave ,
6817 .Pf no Va metoo ,
6818 .Pf no Va outfolder ,
6819 .Pf no Va page ,
6820 .Va prompt
6821 set to
6822 .Ql ?\0 ,
6823 .Pf no Va quiet ,
6824 .Pf no Va record ,
6825 .Va save ,
6826 .Pf no Va sendwait ,
6827 .Pf no Va showto ,
6828 .Pf no Va Sign ,
6829 .Pf no Va sign ,
6830 .Va toplines
6831 set to
6832 .Ql 5 .
6835 Notes: \*(UA does not support the
6836 .Pf no Va onehop
6837 variable \(en use command line options or
6838 .Va mta-arguments
6839 to pass options through to a
6840 .Va mta .
6841 And the default global
6842 .Pa \*(UR
6843 file, which is loaded unless the
6844 .Fl \&:
6845 (with according argument) or
6846 .Fl n
6847 command line options have been used, or the
6848 .Ev MAILX_NO_SYSTEM_RC
6849 environment variable is set (see
6850 .Sx "Resource files" )
6851 bends those initial settings a bit, e.g., it sets the variables
6852 .Va hold ,
6853 .Va keepsave
6855 .Va keep ,
6856 to name a few, establishes a default
6857 .Ic headerpick
6858 selection etc., and should thus be taken into account.
6859 .\" }}}
6861 .\" .Ss "Variables" {{{
6862 .Ss "Variables"
6864 .Bl -tag -width ".It Va BaNg"
6867 .It Va \&?
6868 \*(RO The (hard) exit status of the last command.
6869 This exit status has a meaning for the state machine, in parts
6870 prescribed by the POSIX standard, and, e.g., for
6871 .Cm ignerr
6873 .Va batch-exit-on-error .
6874 This is why \*(UA also knows about a
6875 .Dq soft
6876 exit status, which is tracked in
6877 .Va \&! .
6880 .It Va \&!
6881 \*(RO The so-called
6882 .Dq soft
6883 exit status of the last command, which, different to
6884 .Va \&? ,
6885 has no meaning for the state machine, and can therefore easily transport
6886 different error-indicating values.
6887 It is directly addressable with the command
6888 .Ic return
6889 from within a
6890 .Ic define Ns
6891 d and
6892 .Ic call Ns
6893 ed macro, or an
6894 .Ic account .
6898 .It Va ^
6899 \*(RO This is a multiplexer variable which performs dynamic expansion of
6900 the requested state or condition, of which there are:
6903 .Bl -tag -compact -width ".It Va BaNg"
6907 .It Va ^ERR , ^ERRDOC , ^ERRNAME
6908 The number, documentation, and name of the current
6909 .Xr errno 3 ,
6910 respectively, which is usually set after an error occurred.
6911 \*(ID This machinery is new and is usually reliable only if a command
6912 explicitly states that it manages
6913 .Va \&! .
6914 Each of those variables can be suffixed with a hyphen minus followed by
6915 a name or number, in which case the expansion refers to the given error.
6916 Note this is a direct mapping of (a subset of) the system error values:
6917 .Bd -literal -offset indent
6918 define work {
6919   eval echo \e$1: \e$^ERR-$1: ERR-\e$^ERRNAME-$1: \e$^ERRDOC-$1
6920   vput vexpr i + "$1" 1
6921   if [ $i -lt 16 ]
6922     \excall work $i
6923   end
6925 call work 0
6931 .It Va *
6932 \*(RO Only available inside the scope of a
6933 .Ic call Ns
6934 ed macro, this will expand to all parameters of the macro, separated by
6935 a space character.
6936 \*(ID The special semantics of the equally named special parameter of the
6937 .Xr sh 1
6938 are not yet supported.
6941 .It Va @
6942 \*(RO Only available inside the scope of a
6943 .Ic call Ns
6944 ed macro, this will expand to all parameters of the macro, separated by
6945 a space character.
6946 \*(ID The special semantics of the equally named special parameter of the
6947 .Xr sh 1
6948 are not yet supported.
6951 .It Va #
6952 \*(RO Only available inside the scope of a
6953 .Ic call Ns
6954 ed macro, this will expand to the number of positional parameters in
6955 decimal.
6958 .It Va \&0
6959 \*(RO Available inside the scope of a
6960 .Ic define Ns
6961 d and
6962 .Ic call Ns
6963 ed macro, this expands to the name of the calling macro, or to the empty
6964 string if the macro is running from top-level.
6965 For the \*(OPal regular expression search and replace operator of
6966 .Ic vexpr
6967 this expands to the entire matching expression.
6970 .It Va 1
6971 \*(RO Available inside the scope of a
6972 .Ic define Ns
6973 d and
6974 .Ic call Ns
6975 ed macro, this will access the first positional parameter passed.
6976 All further parameters can be accessed with this syntax, too, e.g.,
6977 .Ql 2 ,
6978 .Ql 3
6979 etc.; positional parameters can be shifted off the stack by calling
6980 .Ic shift .
6981 Positional parameters are also accessible in the \*(OPal regular
6982 expression search and replace expression of
6983 .Ic vexpr .
6986 .It Va account
6987 \*(RO Is set to the active
6988 .Ic account .
6991 .It Va add-file-recipients
6992 \*(BO When file or pipe recipients have been specified,
6993 mention them in the corresponding address fields of the message instead
6994 of silently stripping them from their recipient list.
6995 By default such addressees are not mentioned.
6998 .It Va allnet
6999 \*(BO Causes only the local part to be evaluated
7000 when comparing addresses.
7003 .It Va alternates
7004 \*(RO Is set to the list of
7005 .Ic alternates .
7008 .It Va append
7009 \*(BO Causes messages saved in the
7010 .Mx -sx
7011 .Sx "secondary mailbox"
7012 .Ev MBOX
7013 to be appended to the end rather than prepended.
7014 This should always be set.
7017 .It Va ask
7018 \*(BO Causes \*(UA to prompt for the subject of each message sent.
7019 If the user responds with simply a newline,
7020 no subject field will be sent.
7023 .It Va askatend
7024 \*(BO Causes the prompts for
7025 .Ql Cc:
7027 .Ql Bcc:
7028 lists to appear after the message has been edited.
7031 .It Va askattach
7032 \*(BO If set, \*(UA asks for files to attach at the end of each message,
7033 shall the list be found empty at that time.
7034 An empty line finalizes the list.
7037 .It Va askcc
7038 \*(BO Causes the user to be prompted for carbon copy recipients
7039 (at the end of each message if
7040 .Va askatend
7042 .Va bsdcompat
7043 are set) shall the list be found empty (at that time).
7044 An empty line finalizes the list.
7047 .It Va askbcc
7048 \*(BO Causes the user to be prompted for blind carbon copy
7049 recipients (at the end of each message if
7050 .Va askatend
7052 .Va bsdcompat
7053 are set) shall the list be found empty (at that time).
7054 An empty line finalizes the list.
7057 .It Va asksign
7058 \*(BO\*(OP Causes the user to be prompted if the message is to be
7059 signed at the end of each message.
7061 .Va smime-sign
7062 variable is ignored when this variable is set.
7065 .It Va asksub
7066 \*(BO Alternative name for
7067 .Va ask .
7070 .It Va attrlist
7071 A sequence of characters to display in the
7072 .Ql attribute
7073 column of the
7074 .Va headline
7075 as shown in the display of
7076 .Ic headers ;
7077 each for one type of messages (see
7078 .Sx "Message states" ) ,
7079 with the default being
7080 .Ql NUROSPMFAT+\-$~
7082 .Ql NU\ \ *HMFAT+\-$~
7083 if the
7084 .Va bsdflags
7085 variable is set, in the following order:
7087 .Bl -tag -compact -width ".It Ql _"
7088 .It Ql N
7089 new.
7090 .It Ql U
7091 unread but old.
7092 .It Ql R
7093 new but read.
7094 .It Ql O
7095 read and old.
7096 .It Ql S
7097 saved.
7098 .It Ql P
7099 preserved.
7100 .It Ql M
7101 mboxed.
7102 .It Ql F
7103 flagged.
7104 .It Ql A
7105 answered.
7106 .It Ql T
7107 draft.
7108 .It Ql +
7109 start of a collapsed thread.
7110 .It Ql -
7111 an uncollapsed thread (TODO ignored for now).
7112 .It Ql $
7113 classified as spam.
7114 .It Ql ~
7115 classified as possible spam.
7120 .It Va autobcc
7121 Specifies a list of recipients to which a blind carbon copy of each
7122 outgoing message will be sent automatically.
7125 .It Va autocc
7126 Specifies a list of recipients to which a carbon copy of each outgoing
7127 message will be sent automatically.
7130 .It Va autocollapse
7131 \*(BO Causes threads to be collapsed automatically when threaded mode
7132 is entered (see the
7133 .Ic collapse
7134 command).
7137 .It Va autoprint
7138 \*(BO Enable automatic
7139 .Ic type Ns
7140 ing of a(n existing)
7141 .Dq successive
7142 message after
7143 .Ic delete
7145 .Ic undelete
7146 commands, e.g., the message that becomes the new
7147 .Dq dot
7148 is shown automatically, as via
7149 .Ic dp
7151 .Ic dt .
7154 .It Va autothread
7155 \*(BO\*(OB Causes threaded mode (see the
7156 .Ic thread
7157 command) to be entered automatically when a folder is opened.
7158 The same as
7159 .Ql autosort=thread .
7162 .It Va autosort
7163 Causes sorted mode (see the
7164 .Ic sort
7165 command) to be entered automatically with the value of this variable as
7166 sorting method when a folder is opened, e.g.,
7167 .Ql set autosort=thread .
7170 .It Va bang
7171 \*(BO Enables the substitution of all not (reverse-solidus) escaped
7172 exclamation mark
7173 .Ql \&!
7174 characters by the contents of the last executed command for the
7175 .Ic \&!
7176 shell escape command and
7177 .Ic ~! ,
7178 one of the compose mode
7179 .Sx "COMMAND ESCAPES" .
7180 If this variable is not set no reverse solidus stripping is performed.
7183 .It Va batch-exit-on-error
7184 If the batch mode has been enabled via the
7185 .Fl #
7186 command line option, then this variable will be consulted whenever \*(UA
7187 completes one operation.
7188 It is ment as a convenient alternative to manually testing
7189 .Va \&? .
7190 If any value is set, a number is expected; if it is
7191 .Ql 1
7192 then each failed operation will cause \*(UA to exit.
7194 \*(ID If it is set without a value, then only top-level operations that
7195 happen directly
7196 .Dq on the command-prompt ,
7197 i.e., neither in running macros nor from within source files etc., are
7198 considered, unless a main operation that directly affects the return
7199 value, like, e.g., a failed
7200 .Ic mail
7201 command, is affected; this mode of operation is likely to change in v15,
7202 and tests should be performed to see whether the desired effect is seen.
7205 .It Va bind-timeout
7206 \*(OP Terminals generate multi-byte sequences for certain forms of
7207 input, for example for function and other special keys.
7208 Some terminals however do not write these multi-byte sequences as
7209 a whole, but byte-by-byte, and the latter is what \*(UA actually reads.
7210 This variable specifies the timeout in milliseconds that the MLE (see
7211 .Sx "On terminal control and line editor" )
7212 waits for more bytes to arrive unless it considers a sequence
7213 .Dq complete .
7214 The default is 200.
7217 .It Va bsdannounce
7218 \*(BO Causes automatic display of a header summary after executing a
7219 .Ic file
7220 command, and thus complements the standard variable
7221 .Va header ,
7222 which controls header summary display on program startup.
7223 It is only meaningful if
7224 .Va header
7225 is also set.
7228 .It Va bsdcompat
7229 \*(BO Sets some cosmetical features to traditional BSD style;
7230 has the same affect as setting
7231 .Va askatend
7232 and all other variables prefixed with
7233 .Ql bsd ;
7234 it also changes the behaviour of
7235 .Va emptystart
7236 (which does not exist in BSD).
7239 .It Va bsdflags
7240 \*(BO Changes the letters shown in the first column of a header
7241 summary to traditional BSD style.
7244 .It Va bsdheadline
7245 \*(BO Changes the display of columns in a header summary to traditional
7246 BSD style.
7249 .It Va bsdmsgs
7250 \*(BO Changes some informational messages to traditional BSD style.
7253 .It Va bsdorder
7254 \*(BO Causes the
7255 .Ql Subject:
7256 field to appear immediately after the
7257 .Ql To:
7258 field in message headers and with the
7259 .Ic ~h
7260 .Sx "COMMAND ESCAPES" .
7263 .It Va charset-7bit
7264 The value that should appear in the
7265 .Ql charset=
7266 parameter of
7267 .Ql Content-Type:
7268 MIME header fields when no character set conversion of the message data
7269 was performed.
7270 This defaults to US-ASCII, and the chosen character set should be
7271 US-ASCII compatible.
7274 .It Va charset-8bit
7275 \*(OP The default 8-bit character set that is used as an implicit last
7276 member of the variable
7277 .Va sendcharsets .
7278 This defaults to UTF-8 if character set conversion capabilities are
7279 available, and to ISO-8859-1 otherwise, in which case the only supported
7280 character set is
7281 .Va ttycharset
7282 and this variable is effectively ignored.
7283 Refer to the section
7284 .Sx "Character sets"
7285 for the complete picture of character set conversion in \*(UA.
7288 .It Va charset-unknown-8bit
7289 \*(OP RFC 1428 specifies conditions when internet mail gateways shall
7290 .Dq upgrade
7291 the content of a mail message by using a character set with the name
7292 .Ql unknown-8bit .
7293 Because of the unclassified nature of this character set \*(UA will not
7294 be capable to convert this character set to any other character set.
7295 If this variable is set any message part which uses the character set
7296 .Ql unknown-8bit
7297 is assumed to really be in the character set given in the value,
7298 otherwise the (final) value of
7299 .Va charset-8bit
7300 is used for this purpose.
7302 This variable will also be taken into account if a MIME type (see
7303 .Sx "The mime.types files" )
7304 of a MIME message part that uses the
7305 .Ql binary
7306 character set is forcefully treated as text.
7309 .It Va cmd
7310 The default value for the
7311 .Ic pipe
7312 command.
7315 .It Va colour-disable
7316 \*(BO\*(OP Forcefully disable usage of colours.
7317 Also see the section
7318 .Sx "Coloured display" .
7321 .It Va colour-pager
7322 \*(BO\*(OP Whether colour shall be used for output that is paged through
7323 .Ev PAGER .
7324 Note that pagers may need special command line options, e.g.,
7325 .Xr less 1
7326 requires the option
7327 .Fl \&\&R
7329 .Xr lv 1
7330 the option
7331 .Fl \&\&c
7332 in order to support colours.
7333 Often doing manual adjustments is unnecessary since \*(UA may perform
7334 adjustments dependent on the value of the environment variable
7335 .Ev PAGER
7336 (see there for more).
7339 .It Va crt
7340 In a(n interactive) terminal session, then if this valued variable is
7341 set it will be used as a threshold to determine how many lines the given
7342 output has to span before it will be displayed via the configured
7343 .Ev PAGER ;
7344 Usage of the
7345 .Ev PAGER
7346 can be forced by setting this to the value
7347 .Ql 0 ,
7348 setting it without a value will deduce the current height of the
7349 terminal screen to compute the treshold (see
7350 .Ev LINES ,
7351 .Va screen
7353 .Xr stty 1 ) .
7354 \*(ID At the moment this uses the count of lines of the message in wire
7355 format, which, dependent on the
7356 .Va encoding
7357 of the message, is unrelated to the number of display lines.
7358 (The software is old and historically the relation was a given thing.)
7361 .It Va customhdr
7362 Define a set of custom headers to be injected into newly composed or
7363 forwarded messages; it is also possible to create custom headers in
7364 compose mode with
7365 .Ic ~^ ,
7366 which can be automated by setting one of the hooks
7367 .Va on-compose-splice-shell
7369 .Va on-compose-splice .
7370 The value is interpreted as a comma-separated list of custom headers to
7371 be injected, to include commas in the header bodies escape them with
7372 reverse solidus.
7373 \*(ID Overwriting of automatically managed headers is neither supported
7374 nor prevented.
7376 .Dl set customhdr='Hdr1: Body1-1\e, Body1-2,  Hdr2: Body2'
7379 .It Va datefield
7380 Controls the appearance of the
7381 .Ql %d
7382 date and time format specification of the
7383 .Va headline
7384 variable, that is used, for example, when viewing the summary of
7385 .Ic headers .
7386 If unset, then the local receiving date is used and displayed
7387 unformatted, otherwise the message sending
7388 .Ql Date: .
7389 It is possible to assign a
7390 .Xr strftime 3
7391 format string and control formatting, but embedding newlines via the
7392 .Ql %n
7393 format is not supported, and will result in display errors.
7394 The default is
7395 .Ql %Y-%m-%d %H:%M ,
7396 and also see
7397 .Va datefield-markout-older .
7400 .It Va datefield-markout-older
7401 Only used in conjunction with
7402 .Va datefield .
7403 Can be used to create a visible distinction of messages dated more than
7404 a day in the future, or older than six months, a concept comparable to the
7405 .Fl \&\&l
7406 option of the POSIX utility
7407 .Xr ls 1 .
7408 If set to the empty string, then the plain month, day and year of the
7409 .Ql Date:
7410 will be displayed, but a
7411 .Xr strftime 3
7412 format string to control formatting can be assigned.
7413 The default is
7414 .Ql %Y-%m-%d .
7417 .It Va debug
7418 \*(BO Enables debug messages and obsoletion warnings, disables the
7419 actual delivery of messages and also implies
7420 .Pf no Va record
7421 as well as
7422 .Pf no Va save .
7425 .It Va disposition-notification-send
7426 \*(BO\*(OP Emit a
7427 .Ql Disposition-Notification-To:
7428 header (RFC 3798) with the message.
7429 This requires the
7430 .Va from
7431 variable to be set.
7432 .\" TODO .It Va disposition-notification-send-HOST
7433 .\"Overrides
7434 .\".Va disposition-notification-send
7435 .\" for SMTP accounts on a specific host.
7436 .\" TODO .It Va disposition-notification-send-USER@HOST
7437 .\"Overrides
7438 .\".Va disposition-notification-send
7439 .\"for a specific account.
7442 .It Va dot
7443 \*(BO When dot is set, a period
7444 .Ql \&.
7445 on a line by itself during message input in (interactive) compose mode
7446 will be treated as end-of-message (in addition to the normal end-of-file
7447 condition).
7449 .Va ignoreeof
7450 is set
7451 .Pf no Va dot
7452 is ignored.
7455 .It Va dotlock-ignore-error
7456 \*(BO\*(OP Synchronization of mailboxes which \*(UA treats as
7457 .Mx -sx
7458 .Sx "primary system mailbox" Ns
7459 es (see, e.g., the notes on
7460 .Sx "Filename transformations" ,
7461 as well as the documentation of
7462 .Ic file )
7463 will be protected with so-called dotlock files\(emthe traditional mail
7464 spool file locking method\(emin addition to system file locking.
7465 Because \*(UA ships with a privilege-separated dotlock creation program
7466 that should always be able to create such a dotlock file there is no
7467 good reason to ignore dotlock file creation errors, and thus these are
7468 fatal unless this variable is set.
7471 .It Va editalong
7472 \*(BO If this variable is set then the editor is started automatically
7473 when a message is composed in interactive mode, as if the
7474 .Ic ~e
7475 .Sx "COMMAND ESCAPES"
7476 had been specified.
7478 .Va editheaders
7479 variable is implied for this automatically spawned editor session.
7482 .It Va editheaders
7483 \*(BO When a message is edited while being composed,
7484 its header is included in the editable text.
7486 .Ql To: ,
7487 .Ql Cc: ,
7488 .Ql Bcc: ,
7489 .Ql Subject: ,
7490 .Ql From: ,
7491 .Ql Reply-To:
7493 .Ql Sender:
7494 fields are accepted within the header, other fields are ignored.
7497 .It Va emptystart
7498 \*(BO When entering interactive mode \*(UA normally writes
7499 .Dq \&No mail for user
7500 and exits immediately if a mailbox is empty or does not exist.
7501 If this variable is set \*(UA starts even with an empty or nonexistent
7502 mailbox (the latter behaviour furtherly depends upon
7503 .Va bsdcompat ,
7504 though).
7507 .It Va encoding
7508 The MIME
7509 .Ql Content-Transfer-Encoding
7510 to use in outgoing text messages and message parts, where applicable.
7511 (7-bit clean text messages are sent as-is, without a transfer encoding.)
7512 Valid values are:
7514 .Bl -tag -compact -width "_%%_"
7515 .It Ql 8bit
7516 .Pf (Or\0 Ql 8b . )
7517 8-bit transport effectively causes the raw data be passed through
7518 unchanged, but may cause problems when transferring mail messages over
7519 channels that are not ESMTP (RFC 1869) compliant.
7520 Also, several input data constructs are not allowed by the
7521 specifications and may cause a different transfer-encoding to be used.
7522 .It Ql quoted-printable
7523 .Pf (Or\0 Ql qp . )
7524 Quoted-printable encoding is 7-bit clean and has the property that ASCII
7525 characters are passed through unchanged, so that an english message can
7526 be read as-is; it is also acceptible for other single-byte locales that
7527 share many characters with ASCII, like, e.g., ISO-8859-1.
7528 The encoding will cause a large overhead for messages in other character
7529 sets: e.g., it will require up to twelve (12) bytes to encode a single
7530 UTF-8 character of four (4) bytes.
7531 .It Ql base64
7532 .Pf (Or\0 Ql b64 . )
7533 The default encoding, it is 7-bit clean and will always be used for
7534 binary data.
7535 This encoding has a constant input:output ratio of 3:4, regardless of
7536 the character set of the input data it will encode three bytes of input
7537 to four bytes of output.
7538 This transfer-encoding is not human readable without performing
7539 a decoding step.
7543 .It Va escape
7544 If defined, the first character of the value of this variable
7545 gives the character to use in place of tilde
7546 .Ql ~
7547 to denote
7548 .Sx "COMMAND ESCAPES" .
7549 If set to the empty string, command escapes are disabled.
7552 .It Va expandaddr
7553 If not set then file and command pipeline targets are not allowed,
7554 and any such address will be filtered out, giving a warning message.
7555 If set without a value then all possible recipient address
7556 specifications will be accepted \(en see the section
7557 .Sx "On sending mail, and non-interactive mode"
7558 for more on this.
7559 To accept them, but only in interactive mode, or when tilde commands
7560 were enabled explicitly by using one of the command line options
7561 .Fl ~
7563 .Fl # ,
7564 set this to the (case-insensitive) value
7565 .Ql restrict
7566 (it actually acts like
7567 .Ql restrict,-all,+name,+addr ,
7568 so that care for ordering issues must be taken) .
7570 In fact the value is interpreted as a comma-separated list of values.
7571 If it contains
7572 .Ql fail
7573 then the existence of disallowed specifications is treated as a hard
7574 send error instead of only filtering them out.
7575 The remaining values specify whether a specific type of recipient
7576 address specification is allowed (optionally indicated by a plus sign
7577 .Ql +
7578 prefix) or disallowed (prefixed with a hyphen-minus
7579 .Ql - ) .
7580 The value
7581 .Ql all
7582 addresses all possible address specifications,
7583 .Ql file
7584 file targets,
7585 .Ql pipe
7586 command pipeline targets,
7587 .Ql name
7588 plain user names and (MTA) aliases (\*(OB
7589 .Ql noalias
7590 may be used as an alternative syntax to
7591 .Ql -name )
7593 .Ql addr
7594 network addresses.
7595 These kind of values are interpreted in the given order, so that
7596 .Ql restrict,\:fail,\:+file,\:-all,\:+addr
7597 will cause hard errors for any non-network address recipient address
7598 unless \*(UA is in interactive mode or has been started with the
7599 .Fl ~
7601 .Fl #
7602 command line option; in the latter case(s) any address may be used, then.
7604 Historically invalid network addressees are silently stripped off.
7605 To change this and ensure that any encountered invalid email address
7606 instead causes a hard error, ensure the string
7607 .Ql failinvaddr
7608 is an entry in the above list.
7609 Setting this automatically enables network addressees
7610 (it actually acts like
7611 .Ql failinvaddr,+addr ,
7612 so that care for ordering issues must be taken) .
7615 .It Va expandargv
7616 Unless this variable is set additional
7617 .Va mta
7618 (Mail-Transfer-Agent)
7619 arguments from the command line, as can be given after a
7620 .Fl \&\&-
7621 separator, are ignored due to safety reasons.
7622 However, if set to the special (case-insensitive) value
7623 .Ql fail ,
7624 then the presence of additional MTA arguments is treated as a hard
7625 error that causes \*(UA to exit with failure status.
7626 A lesser strict variant is the otherwise identical
7627 .Ql restrict ,
7628 which does accept such arguments in interactive mode, or if tilde
7629 commands were enabled explicitly by using one of the command line options
7630 .Fl ~
7632 .Fl # .
7635 .It Va features
7636 \*(RO String giving a list of features \*(UA, preceded with a plus sign
7637 .Ql +
7638 if the feature is available, and a hyphen-minus
7639 .Ql -
7640 otherwise.
7641 The output of the command
7642 .Ic version
7643 will include this information.
7646 .It Va flipr
7647 \*(BO This setting reverses the meanings of a set of reply commands,
7648 turning the lowercase variants, which by default address all recipients
7649 included in the header of a message
7650 .Pf ( Ic reply , respond , followup )
7651 into the uppercase variants, which by default address the sender only
7652 .Pf ( Ic Reply , Respond , Followup )
7653 and vice versa.
7654 The commands
7655 .Ic replysender , respondsender , followupsender
7656 as well as
7657 .Ic replyall , respondall , followupall
7658 are not affected by the current setting of
7659 .Va flipr .
7663 .It Va file-hook-load-EXTENSION , file-hook-save-EXTENSION
7664 It is possible to install file hooks which will be used by the
7665 .Ic file
7666 command in order to be able to transparently handle (through an
7667 intermediate temporary file) files with specific
7668 .Ql EXTENSION Ns
7669 s: the variable values can include shell snippets and are expected to
7670 write data to standard output / read data from standard input,
7671 respectively.
7672 \*(ID The variables may not be changed while there is a mailbox
7673 attendant.
7674 .Bd -literal -offset indent
7675 set file-hook-load-xy='echo >&2 XY-LOAD; gzip -cd' \e
7676     file-hook-save-xy='echo >&2 XY-SAVE; gzip -c' \e
7677     record=+null-sent.xy
7681 .It Va folder
7682 The default path under which mailboxes are to be saved:
7683 file names that begin with the plus sign
7684 .Ql +
7685 will have the plus sign replaced with the value of this variable if set,
7686 otherwise the plus sign will remain unchanged when doing
7687 .Sx "Filename transformations" ;
7688 also see
7689 .Ic file
7690 for more on this topic.
7691 The value supports a subset of transformations itself, and if the
7692 non-empty value does not start with a solidus
7693 .Ql / ,
7694 then the value of
7695 .Ev HOME
7696 will be prefixed automatically.
7697 Once the actual value is evaluated first, the internal variable
7698 .Va folder-resolved
7699 will be updated for caching purposes.
7702 .It Va folder-hook
7703 This variable can be set to the name of a
7704 .Ic define Ns d
7705 macro which will be called whenever a
7706 .Ic file
7707 is opened.
7708 The macro will also be invoked when new mail arrives,
7709 but message lists for commands executed from the macro
7710 only include newly arrived messages then.
7711 .Ic localopts
7712 are activated by default in a folder hook, causing the covered settings
7713 to be reverted once the folder is left again.
7715 .Sy \*(ID:
7716 Macro behaviour, including option localization, will change in v15.
7717 One should be aware of that and possibly embed version checks in the
7718 used resource file(s).
7721 .It Va folder-hook-FOLDER
7722 Overrides
7723 .Va folder-hook
7724 for a folder named
7725 .Ql FOLDER .
7726 Unlike other folder specifications, the fully expanded name of a folder,
7727 without metacharacters, is used to avoid ambiguities.
7728 However, if the mailbox resides under
7729 .Va folder
7730 then the usual
7731 .Ql +
7732 specification is tried in addition, e.g., if
7733 .Va \&\&folder
7735 .Dq mail
7736 (and thus relative to the user's home directory) then
7737 .Pa /home/usr1/mail/sent
7738 will be tried as
7739 .Ql folder-hook-/home/usr1/mail/sent
7740 first, but then followed by
7741 .Ql folder-hook-+sent .
7744 .It Va folder-resolved
7745 \*(RO Set to the fully resolved path of
7746 .Va folder
7747 once that evaluation has occurred; rather internal.
7750 .It Va followup-to
7751 \*(BO Controls whether a
7752 .Ql Mail-Followup-To:
7753 header is generated when sending messages to known mailing lists.
7754 Also see
7755 .Va followup-to-honour
7756 and the commands
7757 .Ic mlist , mlsubscribe , reply
7759 .Ic Lreply .
7762 .It Va followup-to-honour
7763 Controls whether a
7764 .Ql Mail-Followup-To:
7765 header is honoured when group-replying to a message via
7766 .Ic reply
7768 .Ic Lreply .
7769 This is a quadoption; if set without a value it defaults to
7770 .Dq yes .
7771 Also see
7772 .Va followup-to
7773 and the commands
7774 .Ic mlist
7776 .Ic mlsubscribe .
7779 .It Va forward-as-attachment
7780 \*(BO Original messages are normally sent as inline text with the
7781 .Ic forward
7782 command,
7783 and only the first part of a multipart message is included.
7784 With this setting enabled messages are sent as unmodified MIME
7785 .Ql message/rfc822
7786 attachments with all of their parts included.
7789 .It Va from
7790 The address (or a list of addresses) to put into the
7791 .Ql From:
7792 field of the message header, quoting RFC 5322:
7793 the author(s) of the message, that is, the mailbox(es) of the person(s)
7794 or system(s) responsible for the writing of the message.
7795 When
7796 .Ic reply Ns
7797 ing to messages these addresses are handled as if they were in the
7798 .Ic alternates
7799 list.
7801 If the machine's hostname is not valid at the Internet (for example at
7802 a dialup machine) then either this variable or
7803 .Va hostname
7804 (\*(IN and with a defined SMTP protocol in
7805 .Va mta
7806 .Va smtp-hostname
7807 adds even more fine-tuning capabilities),
7808 have to be set.
7810 .Va \&\&from
7811 contains more than one address,
7812 setting the
7813 .Va sender
7814 variable is required (according to the standard RFC 5322).
7816 If a file-based MTA is used, then
7817 .Va from
7818 (or, if that contains multiple addresses,
7819 .Va sender )
7820 can nonetheless be enforced to appear as the envelope sender address at
7821 the MTA protocol level (the RFC 5321 reverse-path), either by using the
7822 .Fl r
7823 command line option (with an empty argument; see there for the complete
7824 picture on this topic), or by setting the internal variable
7825 .Va r-option-implicit .
7828 .It Va fullnames
7829 \*(BO When replying to or forwarding a message \*(UA normally removes
7830 the comment and name parts of email addresses.
7831 If this variable is set such stripping is not performed,
7832 and comments, names etc. are retained.
7835 .It Va fwdheading
7836 The string to put before the text of a message with the
7837 .Ic forward
7838 command
7839 (unless the
7840 .Va forward-as-attachment
7841 variable is set).
7842 Defaults to
7843 .Dq -------- Original Message --------
7844 if unset; No heading is put if it is set to the empty string.
7847 .It Va header
7848 \*(BO Causes the header summary to be written at startup and after
7849 commands that affect the number of messages or the order of messages in
7850 the current folder; enabled by default.
7851 The command line option
7852 .Fl N
7853 can be used to set
7854 .Pf no Va header .
7855 The variable
7856 .Va bsdannounce
7857 complements this and controls header summary display on folder changes.
7861 .It Va headline
7862 A format string to use for the summary of
7863 .Ic headers ,
7864 similar to the ones used for
7865 .Xr printf 3
7866 formats.
7867 Format specifiers in the given string start with a percent sign
7868 .Ql %
7869 and may be followed by an optional decimal number indicating the field
7870 width \(em if that is negative, the field is to be left-aligned.
7871 Valid format specifiers are:
7874 .Bl -tag -compact -width "_%%_"
7875 .It Ql %%
7876 A plain percent sign.
7877 .It Ql %>
7878 .Dq Dotmark :
7879 a space character but for the current message
7880 .Pf ( Dq dot ) ,
7881 for which it expands to
7882 .Ql > .
7883 .It Ql %<
7884 .Dq Dotmark :
7885 a space character but for the current message
7886 .Pf ( Dq dot ) ,
7887 for which it expands to
7888 .Ql < .
7889 .It Ql %$
7890 \*(OP The spam score of the message, as has been classified via the
7891 command
7892 .Ic spamrate .
7893 Shows only a replacement character if there is no spam support.
7894 .It Ql %a
7895 Message attribute character (status flag); the actual content can be
7896 adjusted by setting
7897 .Va attrlist .
7898 .It Ql %d
7899 The date found in the
7900 .Ql From:
7901 header of the message when
7902 .Va datefield
7903 is set (the default), otherwise the date when the message was received.
7904 Formatting can be controlled by assigning a
7905 .Xr strftime 3
7906 format string to
7907 .Va datefield .
7908 .It Ql %e
7909 The indenting level in threaded mode.
7910 .It Ql %f
7911 The address of the message sender.
7912 .It Ql %i
7913 The message thread tree structure.
7914 (Note that this format does not support a field width.)
7915 .It Ql %l
7916 The number of lines of the message, if available.
7917 .It Ql %m
7918 Message number.
7919 .It Ql %o
7920 The number of octets (bytes) in the message, if available.
7921 .It Ql %s
7922 Message subject (if any).
7923 .It Ql %S
7924 Message subject (if any) in double quotes.
7925 .It Ql \&%T
7926 Message recipient flags: is the addressee of the message a known or
7927 subscribed mailing list \(en see
7928 .Ic mlist
7930 .Ic mlsubscribe .
7931 .It Ql %t
7932 The position in threaded/sorted order.
7935 The default is
7936 .Ql %>\&%a\&%m\ %-18f\ %16d\ %4l/%\-5o\ %i%-s ,
7938 .Ql %>\&%a\&%m\ %20-f\ \ %16d\ %3l/%\-5o\ %i%-S
7940 .Va bsdcompat
7941 is set.
7942 Also see
7943 .Va attrlist
7945 .Va headline-bidi .
7949 .It Va headline-bidi
7950 Bidirectional text requires special treatment when displaying headers,
7951 because numbers (in dates or for file sizes etc.) will not affect the
7952 current text direction, in effect resulting in ugly line layouts when
7953 arabic or other right-to-left text is to be displayed.
7954 On the other hand only a minority of terminals is capable to correctly
7955 handle direction changes, so that user interaction is necessary for
7956 acceptable results.
7957 Note that extended host system support is required nonetheless, e.g.,
7958 detection of the terminal character set is one precondition;
7959 and this feature only works in an Unicode (i.e., UTF-8) locale.
7961 In general setting this variable will cause \*(UA to encapsulate text
7962 fields that may occur when displaying
7963 .Va headline
7964 (and some other fields, like dynamic expansions in
7965 .Va prompt )
7966 with special Unicode control sequences;
7967 it is possible to fine-tune the terminal support level by assigning
7968 a value:
7969 no value (or any value other than
7970 .Ql 1 ,
7971 .Ql 2
7973 .Ql 3 )
7974 will make \*(UA assume that the terminal is capable to properly deal
7975 with Unicode version 6.3, in which case text is embedded in a pair of
7976 U+2068 (FIRST STRONG ISOLATE) and U+2069 (POP DIRECTIONAL ISOLATE)
7977 characters.
7978 In addition no space on the line is reserved for these characters.
7980 Weaker support is chosen by using the value
7981 .Ql 1
7982 (Unicode 6.3, but reserve the room of two spaces for writing the control
7983 sequences onto the line).
7984 The values
7985 .Ql 2
7987 .Ql 3
7988 select Unicode 1.1 support (U+200E, LEFT-TO-RIGHT MARK); the latter
7989 again reserves room for two spaces in addition.
7992 .It Va history-file
7993 \*(OP If a line editor is available then this can be set to
7994 name the (expandable) path of the location of a permanent history file.
7995 Also see
7996 .Va history-size .
7999 .It Va history-gabby
8000 \*(BO\*(OP Add more entries to the history as is normally done.
8003 .It Va history-gabby-persist
8004 \*(BO\*(OP \*(UA's own MLE will not save the additional
8005 .Va history-gabby
8006 entries in persistent storage unless this variable is set.
8007 On the other hand it will not loose the knowledge of whether
8008 a persistent entry was gabby or not.
8009 Also see
8010 .Va history-file .
8013 .It Va history-size
8014 \*(OP Setting this variable imposes a limit on the number of concurrent
8015 history entries.
8016 If set to the value 0 then no further history entries will be added, and
8017 loading and incorporation of the
8018 .Va history-file
8019 upon program startup can also be suppressed by doing this.
8020 Runtime changes will not be reflected, but will affect the number of
8021 entries saved to permanent storage.
8024 .It Va hold
8025 \*(BO This setting controls whether messages are held in the system
8026 .Va inbox ,
8027 and it is set by default.
8030 .It Va hostname
8031 Use this string as hostname when expanding local addresses instead of
8032 the value obtained from
8033 .Xr uname 3
8035 .Xr getaddrinfo 3 .
8036 It is used, e.g., in
8037 .Ql Message-ID:
8039 .Ql From:
8040 fields, as well as when generating
8041 .Ql Content-ID:
8042 MIME part related unique ID fields.
8043 Setting it to the empty string will cause the normal hostname to be
8044 used, but nonetheless enables creation of said ID fields.
8045 \*(IN in conjunction with the builtin SMTP
8046 .Va mta
8047 .Va smtp-hostname
8048 also influences the results:
8049 one should produce some test messages with the desired combination of
8050 .Va \&\&hostname ,
8051 and/or
8052 .Va from ,
8053 .Va sender
8054 etc. first.
8057 .It Va idna-disable
8058 \*(BO\*(OP Can be used to turn off the automatic conversion of domain
8059 names according to the rules of IDNA (internationalized domain names
8060 for applications).
8061 Since the IDNA code assumes that domain names are specified with the
8062 .Va ttycharset
8063 character set, an UTF-8 locale charset is required to represent all
8064 possible international domain names (before conversion, that is).
8067 .It Va ignore
8068 \*(BO Ignore interrupt signals from the terminal while entering
8069 messages; instead echo them as
8070 .Ql @
8071 characters and discard the current line.
8074 .It Va ignoreeof
8075 \*(BO Ignore end-of-file conditions
8076 .Pf ( Ql control-D )
8077 in compose mode on message input and in interactive command input.
8078 If set an interactive command input session can only be left by
8079 explicitly using one of the commands
8080 .Ic exit
8082 .Ic quit ,
8083 and message input in compose mode can only be terminated by entering
8084 a period
8085 .Ql \&.
8086 on a line by itself or by using the
8087 .Ic ~.
8088 .Sx "COMMAND ESCAPES" ;
8089 .Va ignoreeof
8090 overrides a setting of
8091 .Pf no Va dot .
8094 .It Va inbox
8095 If this is set to a non-empty string it will specify the users
8096 .Mx -sx
8097 .Sx "primary system mailbox" ,
8098 overriding
8099 .Ev MAIL
8100 and the system-dependent default, and (thus) be used to replace
8101 .Ql %
8102 when doing
8103 .Sx "Filename transformations" ;
8104 also see
8105 .Ic file
8106 for more on this topic.
8107 The value supports a subset of transformations itself.
8110 .It Va indentprefix
8111 String used by the
8112 .Ic ~m , ~M
8114 .Ic ~R
8115 .Sx "COMMAND ESCAPES"
8116 and by the
8117 .Va quote
8118 option for indenting messages,
8119 in place of the normal tabulator character
8120 .Ql ^I ,
8121 which is the default.
8122 Be sure to quote the value if it contains spaces or tabs.
8125 .It Va keep
8126 \*(BO If set, an empty
8127 .Mx -sx
8128 .Sx "primary system mailbox"
8129 file is not removed.
8130 Note that, in conjunction with
8131 .Va posix
8132 (and, thus,
8133 .Ev POSIXLY_CORRECT )
8134 any empty file will be removed unless this variable is set.
8135 This may improve the interoperability with other mail user agents
8136 when using a common folder directory, and prevents malicious users
8137 from creating fake mailboxes in a world-writable spool directory.
8138 \*(ID Only local regular (MBOX) files are covered, Maildir or other
8139 mailbox types will never be removed, even if empty.
8142 .It Va keep-content-length
8143 \*(BO When (editing messages and) writing MBOX mailbox files \*(UA can
8144 be told to keep the
8145 .Ql Content-Length:
8147 .Ql Lines:
8148 header fields that some MUAs generate by setting this variable.
8149 Since \*(UA does neither use nor update these non-standardized header
8150 fields (which in itself shows one of their conceptual problems),
8151 stripping them should increase interoperability in between MUAs that
8152 work with with same mailbox files.
8153 Note that, if this is not set but
8154 .Va writebackedited ,
8155 as below, is, a possibly performed automatic stripping of these header
8156 fields already marks the message as being modified.
8159 .It Va keepsave
8160 \*(BO When a message is saved it is usually discarded from the
8161 originating folder when \*(UA is quit.
8162 This setting causes all saved message to be retained.
8165 .It Va line-editor-disable
8166 \*(BO Turn off any enhanced line editing capabilities (see
8167 .Sx "On terminal control and line editor"
8168 for more).
8171 .It Va line-editor-no-defaults
8172 \*(BO\*(OP Do not establish any default key binding.
8175 .It Va mailbox-display
8176 \*(RO The name of the current mailbox
8177 .Pf ( Ic file ) ,
8178 possibly abbreviated for display purposes.
8181 .It Va mailbox-resolved
8182 \*(RO The fully resolved path of the current mailbox.
8185 .It Va mailx-extra-rc
8186 An additional startup file that is loaded as the last of the
8187 .Sx "Resource files" .
8188 Use this file for commands that are not understood by other POSIX
8189 .Xr mailx 1
8190 implementations, i.e., mostly anything which is not covered by
8191 .Sx "Initial settings" .
8194 .It Va markanswered
8195 \*(BO When a message is replied to and this variable is set,
8196 it is marked as having been
8197 .Ic answered .
8198 See the section
8199 .Sx "Message states" .
8202 .It Va mbox-rfc4155
8203 \*(BO If this is set then when opening MBOX mailbox files \*(UA will not
8204 use the tolerant POSIX rules for detecting message boundaries (so-called
8205 .Ql From_
8206 lines), as it does by default for compatibility reasons, but the more
8207 strict rules that have been defined in RFC 4155.
8208 When saving to MBOX mailboxes this indicates when so-called
8209 .Ql From_
8210 quoting is to be applied \(em note this is never necessary for any
8211 message newly generated by \*(UA, it only applies to messages generated
8212 by buggy or malicious MUAs.
8213 (\*(UA will use a proper
8214 .Va encoding
8215 to ensure that
8216 .Ql From_
8217 lines cannot be misinterpreted as message boundaries.)
8219 This should not be set normally, but may be handy when \*(UA complains
8220 about having seen invalid
8221 .Ql From_
8222 lines when opening a MBOX: in this case temporarily setting this
8223 variable, re-opening the mailbox in question, unsetting this variable
8224 again and then invoking
8225 .Ql copy * SOME-FILE
8226 will perform proper, POSIX-compliant
8227 .Ql From_
8228 quoting for all detected messages, resulting in a valid MBOX mailbox.
8231 .It Va memdebug
8232 \*(BO Internal development variable.
8235 .It Va message-id-disable
8236 \*(BO By setting this variable the generation of
8237 .Ql Message-ID:
8238 can be completely suppressed, effectively leaving this task up to the
8239 .Va mta
8240 (Mail-Transfer-Agent) or the SMTP server.
8241 (According to RFC 5321 a SMTP server is not required to add this
8242 field by itself, so it should be ensured that it accepts messages without
8243 .Ql Message-ID . )
8244 This variable also affects automatic generation of
8245 .Va Content-ID:
8246 MIME header fields.
8249 .It Va message-inject-head
8250 A string to put at the beginning of each new message.
8251 The escape sequences tabulator
8252 .Ql \et
8253 and newline
8254 .Ql \en
8255 are understood.
8258 .It Va message-inject-tail
8259 A string to put at the end of each new message.
8260 The escape sequences tabulator
8261 .Ql \et
8262 and newline
8263 .Ql \en
8264 are understood.
8267 .It Va metoo
8268 \*(BO Usually, when an
8269 .Ic alias
8270 expansion contains the sender, the sender is removed from the expansion.
8271 Setting this option suppresses these removals.
8272 Note that a set
8273 .Va metoo
8274 also causes a
8275 .Ql -m
8276 option to be passed through to the
8277 .Va mta
8278 (Mail-Transfer-Agent); though most of the modern MTAs no longer document
8279 this flag, no MTA is known which does not support it (for historical
8280 compatibility).
8283 .It Va mime-allow-text-controls
8284 \*(BO When sending messages, each part of the message is MIME-inspected
8285 in order to classify the
8286 .Ql Content-Type:
8288 .Ql Content-Transfer-Encoding:
8289 (see
8290 .Va encoding )
8291 that is required to send this part over mail transport, i.e.,
8292 a computation rather similar to what the
8293 .Xr file 1
8294 command produces when used with the
8295 .Ql --mime
8296 option.
8298 This classification however treats text files which are encoded in
8299 UTF-16 (seen for HTML files) and similar character sets as binary
8300 octet-streams, forcefully changing any
8301 .Ql text/plain
8303 .Ql text/html
8304 specification to
8305 .Ql application/octet-stream :
8306 If that actually happens a yet unset charset MIME parameter is set to
8307 .Ql binary ,
8308 effectively making it impossible for the receiving MUA to automatically
8309 interpret the contents of the part.
8311 If this variable is set, and the data was unambiguously identified as
8312 text data at first glance (by a
8313 .Ql .txt
8315 .Ql .html
8316 file extension), then the original
8317 .Ql Content-Type:
8318 will not be overwritten.
8321 .It Va mime-alternative-favour-rich
8322 \*(BO If this variable is set then rich MIME alternative parts (e.g.,
8323 HTML) will be preferred in favour of included plain text versions when
8324 displaying messages, provided that a handler exists which produces
8325 output that can be (re)integrated into \*(UA's normal visual display.
8326 (E.g., at the time of this writing some newsletters ship their full
8327 content only in the rich HTML part, whereas the plain text part only
8328 contains topic subjects.)
8331 .It Va mime-counter-evidence
8332 Normally the
8333 .Ql Content-Type:
8334 field is used to decide how to handle MIME parts.
8335 Some MUAs however do not use
8336 .Xr mime.types 5
8337 or a similar mechanism to correctly classify content, but simply specify
8338 .Ql application/octet-stream ,
8339 even for plain text attachments like
8340 .Ql text/diff .
8341 If this variable is set then \*(UA will try to classify such MIME
8342 message parts on its own, if possible, for example via a possibly
8343 existing attachment filename.
8344 A non-empty value may also be given, in which case a number is expected,
8345 actually a carrier of bits.
8346 Creating the bit-carrying number is a simple addition:
8347 .Bd -literal -offset indent
8348 ? !echo Value should be set to $((2 + 4 + 8))
8349 Value should be set to 14
8352 .Bl -bullet -compact
8354 If bit two is set (2) then the detected
8355 .Dq real
8356 content-type will be carried along with the message and be used for
8357 deciding which
8358 .Va pipe-TYPE/SUBTYPE
8359 is responsible for the MIME part, shall that question arise;
8360 when displaying such a MIME part the part-info will indicate the
8361 overridden content-type by showing a plus sign
8362 .Ql + .
8364 If bit three is set (4) then the counter-evidence is always produced
8365 and a positive result will be used as the MIME type, even forcefully
8366 overriding the parts given MIME type.
8368 If bit four is set (8) then as a last resort the actual content of
8369 .Ql application/octet-stream
8370 parts will be inspected, so that data which looks like plain text can be
8371 treated as such.
8375 .It Va mimetypes-load-control
8376 Can be used to control which of the
8377 .Xr mime.types 5
8378 databases are loaded by \*(UA, as furtherly described in the section
8379 .Sx "The mime.types files" .
8380 If the letter
8381 .Ql u
8382 is part of the option value, then the user's personal
8383 .Pa ~/.mime.types
8384 file will be loaded (if it exists); likewise the letter
8385 .Ql s
8386 controls loading of the system wide
8387 .Pa /etc/mime.types ;
8388 directives found in the user file take precedence, letter matching is
8389 case-insensitive.
8390 If this variable is not set \*(UA will try to load both files.
8391 Incorporation of the \*(UA-builtin MIME types cannot be suppressed,
8392 but they will be matched last (the order can be listed via
8393 .Ic mimetype ) .
8395 More sources can be specified by using a different syntax: if the
8396 value string contains an equals sign
8397 .Ql =
8398 then it is instead parsed as a comma-separated list of the described
8399 letters plus
8400 .Ql f=FILENAME
8401 pairs; the given filenames will be expanded and loaded, and their
8402 content may use the extended syntax that is described in the section
8403 .Sx "The mime.types files" .
8404 Directives found in such files always take precedence (are prepended to
8405 the MIME type cache).
8409 .It Va mta
8410 To choose an alternate Mail-Transfer-Agent, set this option to either
8411 the full pathname of an executable (optionally prefixed with a
8412 .Ql file://
8413 protocol indicator), or \*(OPally a SMTP protocol URL, e.g., \*(IN
8415 .Dl smtps?://[user[:password]@]server[:port]
8417 (\*(OU:
8418 .Ql [smtp://]server[:port] . )
8419 The default has been chosen at compie time.
8420 All supported data transfers are executed in child processes, which
8421 run asynchronously, and without supervision, unless either the
8422 .Va sendwait
8423 or the
8424 .Va verbose
8425 variable is set.
8426 If such a child receives a TERM signal, it will abort and
8427 .Va save
8428 the message to
8429 .Ev DEAD ,
8430 if so configured.
8433 For a file-based MTA it may be necessary to set
8434 .Va mta-argv0
8435 in in order to choose the right target of a modern
8436 .Xr mailwrapper 8
8437 environment.
8438 It will be passed command line arguments from several possible sources:
8439 from the variable
8440 .Va mta-arguments
8441 if set, from the command line if given and the variable
8442 .Va expandargv
8443 allows their use.
8444 Argument processing of the MTA will be terminated with a
8445 .Fl \&\&-
8446 separator.
8449 The otherwise occurring implicit usage of the following MTA command
8450 line arguments can be disabled by setting the boolean variable
8451 .Va mta-no-default-arguments
8452 (which will also disable passing
8453 .Fl \&\&-
8454 to the MTA):
8455 .Fl \&\&i
8456 (for not treating a line with only a dot
8457 .Ql \&.
8458 character as the end of input),
8459 .Fl \&\&m
8460 (shall the variable
8461 .Va metoo
8462 be set) and
8463 .Fl \&\&v
8464 (if the
8465 .Va verbose
8466 variable is set); in conjunction with the
8467 .Fl r
8468 command line option \*(UA will also (not) pass
8469 .Fl \&\&f
8470 as well as possibly
8471 .Fl \&\&F .
8474 \*(OP \*(UA can send mail over SMTP network connections to a single
8475 defined SMTP smarthost, the access URL of which has to be assigned to
8476 .Va mta .
8477 To use this mode it is helpful to read
8478 .Sx "On URL syntax and credential lookup" .
8479 It may be necessary to set the
8480 .Va smtp-hostname
8481 variable in order to use a specific combination of
8482 .Va from ,
8483 .Va hostname
8485 .Va mta
8486 with some mail providers.
8489 .Bl -bullet -compact
8491 The plain SMTP protocol (RFC 5321) that normally lives on the
8492 server port 25 and requires setting the
8493 .Va smtp-use-starttls
8494 variable to enter a SSL/TLS encrypted session state.
8495 Assign a value like \*(IN
8496 .Ql smtp://[user[:password]@]server[:port]
8497 (\*(OU
8498 .Ql smtp://server[:port] )
8499 to choose this protocol.
8501 The so-called SMTPS which is supposed to live on server port 465
8502 and is automatically SSL/TLS secured.
8503 Unfortunately it never became a standardized protocol and may thus not
8504 be supported by your hosts network service database
8505 \(en in fact the port number has already been reassigned to other
8506 protocols!
8508 SMTPS is nonetheless a commonly offered protocol and thus can be
8509 chosen by assigning a value like \*(IN
8510 .Ql smtps://[user[:password]@]server[:port]
8511 (\*(OU
8512 .Ql smtps://server[:port] ) ;
8513 due to the mentioned problems it is usually necessary to explicitly
8514 specify the port as
8515 .Ql :465 ,
8516 however.
8518 Finally there is the SUBMISSION protocol (RFC 6409), which usually
8519 lives on server port 587 and is practically identically to the SMTP
8520 protocol from \*(UA's point of view beside that; it requires setting the
8521 .Va smtp-use-starttls
8522 variable to enter a SSL/TLS secured session state.
8523 Assign a value like \*(IN
8524 .Ql submission://[user[:password]@]server[:port]
8525 (\*(OU
8526 .Ql submission://server[:port] ) .
8531 .It Va mta-arguments
8532 Arguments to pass through to a file-based
8533 .Va mta
8534 can be given via this variable, which is parsed according to
8535 .Sx "Shell-style argument quoting"
8536 into an array of arguments, and which will be joined onto MTA options
8537 from other sources, and then passed individually to the MTA:
8539 .Dl wysh set mta-arguments='-t -X \&"/tmp/my log\&"'
8542 .It Va mta-no-default-arguments
8543 \*(BO Unless this variable is set \*(UA will pass some well known
8544 standard command line options to a file-based
8545 .Va mta
8546 (Mail-Transfer-Agent), see there for more.
8549 .It Va mta-argv0
8550 Many systems use a so-called
8551 .Xr mailwrapper 8
8552 environment to ensure compatibility with
8553 .Xr sendmail 1 .
8554 This works by inspecting the name that was used to invoke the mail
8555 delivery system.
8556 If this variable is set then the mailwrapper (the program that is
8557 actually executed when calling the file-based
8558 .Va mta )
8559 will treat its contents as that name.
8560 The default is
8561 .Ql sendmail .
8563 .Mx Va netrc-lookup
8564 .It Va netrc-lookup-USER@HOST , netrc-lookup-HOST , netrc-lookup
8565 \*(BO\*(IN\*(OP Used to control usage of the users
8566 .Pa .netrc
8567 file for lookup of account credentials, as documented in the section
8568 .Sx "On URL syntax and credential lookup"
8569 and for the command
8570 .Ic netrc ;
8571 the section
8572 .Sx "The .netrc file"
8573 documents the file format.
8574 Also see
8575 .Va netrc-pipe .
8578 .It Va netrc-pipe
8579 \*(IN\*(OP When
8580 .Pa .netrc
8581 is loaded (see
8582 .Ic netrc
8584 .Va netrc-lookup )
8585 then \*(UA will read the output of a shell pipe instead of the users
8586 .Pa .netrc
8587 file if this variable is set (to the desired shell command).
8588 This can be used to, e.g., store
8589 .Pa .netrc
8590 in encrypted form:
8592 .Dl set netrc-pipe='gpg -qd ~/.netrc.pgp'
8595 .It Va newfolders
8596 If this variable has the value
8597 .Ql maildir ,
8598 newly created local folders will be in Maildir format.
8601 .It Va newmail
8602 Checks for new mail in the current folder each time the prompt is shown.
8603 A Maildir folder must be re-scanned to determine if new mail has arrived.
8604 If this variable is set to the special value
8605 .Ql nopoll
8606 then a Maildir folder will not be rescanned completely, but only
8607 timestamp changes are detected.
8611 .It Va on-compose-splice-shell , on-compose-splice
8612 These hooks run once the normal compose mode is finished, but before the
8613 .Va on-compose-leave
8614 macro hook is called, the
8615 .Va signature
8616 is injected etc.
8617 Both hooks will be executed in a subprocess, with their input and output
8618 connected to \*(UA such that they can act as if they would be an
8619 interactive user.
8620 The difference in between them is that the former is a
8621 .Ev SHELL
8622 command, whereas the latter is a normal \*(UA macro, but which is
8623 restricted to a small set of commands (the
8624 .Va verbose
8625 output of, e.g.,
8626 .Ic list
8627 will indicate said capability), just enough for the purpose of
8628 controlling the real \*(UA instance sufficiently.
8629 .Ic localopts
8630 are enabled for these hooks (in the parent process), causing any setting
8631 to be forgotten after the message has been sent.
8633 During execution of these hooks \*(UA will temporarily forget whether it
8634 has been started in interactive mode, (a restricted set of)
8635 .Sx "COMMAND ESCAPES"
8636 will always be available, and for guaranteed reproduceabilities sake
8637 .Va escape
8638 will be set to its default.
8639 The compose mode command
8640 .Ic ~^
8641 has been especially designed for scriptability (via these hooks).
8642 The first line the hook will read on its standard input is the protocol
8643 version of said command escape, currently
8644 .Dq 0 0 1 :
8645 backward incompatible protocol changes are to be expected in the
8646 future, and it is advisable to make use of the protocol version.
8647 Care must be taken to avoid deadlocks because of unexpected control
8648 flow: if both involved processes wait for more input to happen at the
8649 same time, or one doesn't expect more input but the other is stuck
8650 waiting for consumption of its output.
8651 .Bd -literal -offset indent
8652 wysh set on-compose-splice-shell=$'\e
8653   read version;\e
8654   printf "hello $version!  Headers: ";\e
8655   echo \e'~^header list\e';\e
8656   read status result;\e
8657   echo "status=$status result=$result";\e
8658   '
8660 set on-compose-splice=ocsm
8661 define ocsm {
8662   read ver
8663   echo Splice protocol version is $ver
8664   echo '~^h l'; read hl; vput vexpr es substr "${hl}" 0 1
8665   if [ "$es" != 2 ]
8666     echoerr 'Cannot read header list'; echo '~x'
8667   endif
8668   if [ "$hl" !@ ' cc' ]
8669     echo '~^h i cc Diet is your <mirr.or>'; read es;\e
8670       vput vexpr es substr "${es}" 0 1
8671     if [ "$es" != 2 ]
8672       echoerr 'Cannot insert Cc: header'; echo '~x'
8673     endif
8674   endif
8680 .It Va on-compose-enter , on-compose-leave
8681 Macro hooks which will be executed before compose mode is entered, and
8682 after composing has been finished (but before the
8683 .Va signature
8684 is injected, etc.), respectively.
8685 .Ic localopts
8686 are enabled for these hooks, causing any setting to be forgotten after
8687 the message has been sent.
8688 The following (read-only) variables will be set temporarily during
8689 execution of the macros:
8691 .Bl -tag -compact -width ".It Va compose_subject"
8692 .It Va compose-from
8693 .Va from .
8694 .It Va compose-sender
8695 .Va sender .
8696 .It Va compose-to , compose-cc , compose-bcc
8697 The list of receiver addresses as a space-separated list.
8698 .It Va compose-subject
8699 The subject.
8703 .It Va outfolder
8704 \*(BO Causes the filename given in the
8705 .Va record
8706 variable
8707 and the sender-based filenames for the
8708 .Ic Copy
8710 .Ic Save
8711 commands to be interpreted relative to the directory given in the
8712 .Va folder
8713 variable rather than to the current directory,
8714 unless it is set to an absolute pathname.
8717 .It Va page
8718 \*(BO If set, each message feed through the command given for
8719 .Ic pipe
8720 is followed by a formfeed character
8721 .Ql \ef .
8723 .Mx Va password
8724 .It Va password-USER@HOST , password-HOST , password
8725 \*(IN Variable chain that sets a password, which is used in case none has
8726 been given in the protocol and account-specific URL;
8727 as a last resort \*(UA will ask for a password on the user's terminal if
8728 the authentication method requires a password.
8729 Specifying passwords in a startup file is generally a security risk;
8730 the file should be readable by the invoking user only.
8732 .It Va password-USER@HOST
8733 \*(OU (see the chain above for \*(IN)
8734 Set the password for
8735 .Ql USER
8736 when connecting to
8737 .Ql HOST .
8738 If no such variable is defined for a host,
8739 the user will be asked for a password on standard input.
8740 Specifying passwords in a startup file is generally a security risk;
8741 the file should be readable by the invoking user only.
8744 .It Va piperaw
8745 \*(BO Send messages to the
8746 .Ic pipe
8747 command without performing MIME and character set conversions.
8751 .It Va pipe-TYPE/SUBTYPE
8752 When a MIME message part of type
8753 .Ql TYPE/SUBTYPE
8754 (case-insensitive) is displayed or quoted,
8755 its text is filtered through the value of this variable interpreted as
8756 a shell command.
8757 The special value
8758 .Ql @
8759 forces interpretation of the message part as plain text, e.g.,
8760 .Ql set pipe-application/xml=@
8761 will henceforth display XML
8762 .Dq as is .
8763 (The same could also be achieved by adding a MIME type marker with the
8764 .Ic mimetype
8765 command.
8766 And \*(OPally MIME type handlers may be defined via
8767 .Sx "The Mailcap files"
8768 \(em corresponding flag strings are shown in parenthesis below.)
8771 The special value
8772 .Ql @
8773 can in fact be used to adjust usage and behaviour of a following shell
8774 command specification by appending trigger characters to it, e.g., the
8775 following hypothetical command specification could be used:
8776 .Bd -literal -offset indent
8777 set pipe-X/Y='@*!++=@vim ${MAILX_FILENAME_TEMPORARY}'
8781 .Bl -tag -compact -width ".It Ql __"
8782 .It Ql *
8783 Simply by using the special
8784 .Ql @
8785 prefix the MIME type (shell command) handler will only be invoked to
8786 display or convert the MIME part if the message is addressed directly
8787 and alone by itself.
8788 Use this trigger to disable this and always invoke the handler
8789 .Pf ( Cd x-mailx-always ) .
8791 .It Ql #
8792 If set the handler will not be invoked when a message is to be quoted,
8793 but only when it will be displayed
8794 .Pf ( Cd x-mailx-noquote ) .
8796 .It Ql &
8797 The command will be run asynchronously, i.e., without blocking \*(UA,
8798 which may be a handy way to display a, e.g., PDF file while also
8799 continuing to read the mail message
8800 .Pf ( Cd x-mailx-async ) .
8801 Asynchronous execution implies
8802 .Ql # .
8804 .It Ql \&!
8805 The command must be run on an interactive terminal, \*(UA will
8806 temporarily release the terminal to it
8807 .Pf ( Cd needsterminal ) .
8808 This flag is mutual exclusive with
8809 .Ql & ,
8810 will only be used in interactive mode and implies
8811 .Ql # .
8813 .It Ql +
8814 Request creation of a zero-sized temporary file, the absolute pathname
8815 of which will be made accessible via the environment variable
8816 .Ev MAILX_FILENAME_TEMPORARY
8817 .Pf ( Cd x-mailx-tmpfile ) .
8818 If this trigger is given twice then the file will be unlinked
8819 automatically by \*(UA when the command loop is entered again at latest
8820 .Pf ( Cd x-mailx-tmpfile-unlink ) .
8821 (Do not use this for asynchronous handlers.)
8823 .It Ql =
8824 Normally the MIME part content is passed to the handler via standard
8825 input; if this flag is set then the data will instead be written into
8826 .Ev MAILX_FILENAME_TEMPORARY
8827 .Pf ( Cd x-mailx-tmpfile-fill ) ,
8828 the creation of which is implied; note however that in order to cause
8829 deletion of the temporary file you still have to use two plus signs
8830 .Ql ++
8831 explicitly!
8833 .It Ql @
8834 To avoid ambiguities with normal shell command content you can use
8835 another commercial at to forcefully terminate interpretation of
8836 remaining characters.
8837 (Any character not in this list will have the same effect.)
8841 Some information about the MIME part to be displayed is embedded into
8842 the environment of the shell command:
8845 .Bl -tag -compact -width ".It Ev _AIL__ILENAME__ENERATED"
8847 .It Ev MAILX_CONTENT
8848 The MIME content-type of the part, if known, the empty string otherwise.
8851 .It Ev MAILX_CONTENT_EVIDENCE
8853 .Va mime-counter-evidence
8854 includes the carry-around-bit (2), then this will be set to the detected
8855 MIME content-type; not only then identical to
8856 .Ev \&\&MAILX_CONTENT
8857 otherwise.
8860 .It Ev MAILX_FILENAME
8861 The filename, if any is set, the empty string otherwise.
8864 .It Ev MAILX_FILENAME_GENERATED
8865 A random string.
8868 .It Ev MAILX_FILENAME_TEMPORARY
8869 If temporary file creation has been requested through the command prefix
8870 this variable will be set and contain the absolute pathname of the
8871 temporary file.
8876 .It Va pipe-EXTENSION
8877 This is identical to
8878 .Va pipe-TYPE/SUBTYPE
8879 except that
8880 .Ql EXTENSION
8881 (normalized to lowercase using character mappings of the ASCII charset)
8882 names a file extension, e.g.,
8883 .Ql xhtml .
8884 Handlers registered using this method take precedence.
8886 .Mx Va pop3-auth
8887 .It Va pop3-auth-USER@HOST , pop3-auth-HOST , pop3-auth
8888 \*(OP\*(IN Variable chain that sets the POP3 authentication method.
8889 The only possible value as of now is
8890 .Ql plain ,
8891 which is thus the default.
8894 .Mx Va pop3-bulk-load
8895 .It Va pop3-bulk-load-USER@HOST , pop3-bulk-load-HOST , pop3-bulk-load
8896 \*(BO\*(OP When accessing a POP3 server \*(UA loads the headers of
8897 the messages, and only requests the message bodies on user request.
8898 For the POP3 protocol this means that the message headers will be
8899 downloaded twice.
8900 If this variable is set then \*(UA will download only complete messages
8901 from the given POP3 server(s) instead.
8903 .Mx Va pop3-keepalive
8904 .It Va pop3-keepalive-USER@HOST , pop3-keepalive-HOST , pop3-keepalive
8905 \*(OP POP3 servers close the connection after a period of inactivity;
8906 the standard requires this to be at least 10 minutes,
8907 but practical experience may vary.
8908 Setting this variable to a numeric value greater than
8909 .Ql 0
8910 causes a
8911 .Ql NOOP
8912 command to be sent each value seconds if no other operation is performed.
8914 .Mx Va pop3-no-apop
8915 .It Va pop3-no-apop-USER@HOST , pop3-no-apop-HOST , pop3-no-apop
8916 \*(BO\*(OP Unless this variable is set the
8917 .Ql APOP
8918 authentication method will be used when connecting to a POP3 server that
8919 advertises support.
8920 The advantage of
8921 .Ql APOP
8922 is that the password is not sent in clear text over the wire and that
8923 only a single packet is sent for the user/password tuple.
8924 Note that
8925 .Va pop3-no-apop-HOST
8926 requires \*(IN.
8928 .Mx Va pop3-use-starttls
8929 .It Va pop3-use-starttls-USER@HOST , pop3-use-starttls-HOST , pop3-use-starttls
8930 \*(BO\*(OP Causes \*(UA to issue a
8931 .Ql STLS
8932 command to make an unencrypted POP3 session SSL/TLS encrypted.
8933 This functionality is not supported by all servers,
8934 and is not used if the session is already encrypted by the POP3S method.
8935 Note that
8936 .Va pop3-use-starttls-HOST
8937 requires \*(IN.
8941 .It Va posix
8942 \*(BO This flag enables POSIX mode, which changes behaviour of \*(UA
8943 where that deviates from standardized behaviour.
8944 It will be set implicitly before the
8945 .Sx "Resource files"
8946 are loaded if the environment variable
8947 .Ev POSIXLY_CORRECT
8948 is set, and adjusting any of those two will be reflected by the other
8949 one implicitly.
8950 The following behaviour is covered and enforced with this mechanism:
8952 .Bl -bullet -compact
8954 In non-interactive mode, any non-ignored error in resource files which
8955 are loaded during program startup will cause a program exit.
8957 The variable
8958 .Va keep
8959 is extended to cover any empty mailbox, not only empty
8960 .Mx -sx
8961 .Sx "primary system mailbox" Ns
8962 es: they will be removed when they are left in empty state otherwise.
8967 .It Va print-alternatives
8968 \*(BO When a MIME message part of type
8969 .Ql multipart/alternative
8970 is displayed and it contains a subpart of type
8971 .Ql text/plain ,
8972 other parts are normally discarded.
8973 Setting this variable causes all subparts to be displayed,
8974 just as if the surrounding part was of type
8975 .Ql multipart/mixed .
8978 .It Va prompt
8979 The string used as a prompt in interactive mode.
8980 Whenever the variable is evaluated the value is expanded as via
8981 dollar-single-quote expansion (see
8982 .Sx "Shell-style argument quoting" ) .
8983 This (post-assignment, i.e., second) expansion can be used to embed
8984 status information, for example
8985 .Va \&? ,
8986 .Va \&! ,
8987 .Va account
8989 .Va mailbox-display .
8991 In order to embed characters which should not be counted when
8992 calculating the visual width of the resulting string, enclose the
8993 characters of interest in a pair of reverse solidus escaped brackets:
8994 .Ql \e[\eE[0m\e] ;
8995 a slot for coloured prompts is also available with the \*(OPal command
8996 .Ic colour .
8997 Prompting may be prevented by setting this to the null string
8998 (a.k.a.\|
8999 .Ql set noprompt ) .
9002 .It Va prompt2
9003 This string is used for secondary prompts, but is otherwise identical to
9004 .Va prompt .
9005 The default is
9006 .Ql ..\0 .
9009 .It Va quiet
9010 \*(BO Suppresses the printing of the version when first invoked.
9013 .It Va quote
9014 If set, \*(UA starts a replying message with the original message
9015 prefixed by the value of the variable
9016 .Va indentprefix .
9017 Normally, a heading consisting of
9018 .Dq Fromheaderfield wrote:
9019 is put before the quotation.
9020 If the string
9021 .Ql noheading
9022 is assigned to the
9023 .Va \&\&quote
9024 variable, this heading is omitted.
9025 If the string
9026 .Ql headers
9027 is assigned, only the headers selected by the
9028 .Ql type
9029 .Ic headerpick
9030 selection are put above the message body,
9031 thus
9032 .Va \&\&quote
9033 acts like an automatic
9034 .Pf ` Ic ~m Ns '
9035 .Sx "COMMAND ESCAPES"
9036 command, then.
9037 If the string
9038 .Ql allheaders
9039 is assigned, all headers are put above the message body and all MIME
9040 parts are included, making
9041 .Va \&\&quote
9042 act like an automatic
9043 .Pf ` Ic ~M Ns '
9044 command; also see
9045 .Va quote-as-attachment .
9048 .It Va quote-as-attachment
9049 \*(BO Add the original message in its entirety as a
9050 .Ql message/rfc822
9051 MIME attachment when replying to a message.
9052 Note this works regardless of the setting of
9053 .Va quote .
9056 .It Va quote-fold
9057 \*(OP Can be set in addition to
9058 .Va indentprefix .
9059 Setting this turns on a more fancy quotation algorithm in that leading
9060 quotation characters are compressed and overlong lines are folded.
9061 .Va \&\&quote-fold
9062 can be set to either one or two (space separated) numeric values,
9063 which are interpreted as the maximum (goal) and the minimum line length,
9064 respectively, in a spirit rather equal to the
9065 .Xr fmt 1
9066 program, but line-, not paragraph-based.
9067 If not set explicitly the minimum will reflect the goal algorithmically.
9068 The goal cannot be smaller than the length of
9069 .Va indentprefix
9070 plus some additional pad.
9071 Necessary adjustments take place silently.
9074 .It Va r-option-implicit
9075 \*(BO Setting this option evaluates the contents of
9076 .Va from
9077 (or, if that contains multiple addresses,
9078 .Va sender )
9079 and passes the results onto the used (file-based) MTA as described for the
9080 .Fl r
9081 option (empty argument case).
9084 .It Va recipients-in-cc
9085 \*(BO On group replies, specify only the sender of the original mail in
9086 .Ql To:
9087 and mention the other recipients in the secondary
9088 .Ql Cc: .
9089 By default all recipients of the original mail will be addressed via
9090 .Ql To: .
9093 .It Va record
9094 If defined, gives the pathname of the folder used to record all outgoing
9095 mail.
9096 If not defined, then outgoing mail is not saved.
9097 When saving to this folder fails the message is not sent,
9098 but instead saved to
9099 .Ev DEAD .
9102 .It Va record-resent
9103 \*(BO If both this variable and the
9104 .Va record
9105 variable are set,
9107 .Ic resend
9109 .Ic Resend
9110 commands save messages to the
9111 .Va record
9112 folder as it is normally only done for newly composed messages.
9115 .It Va reply-in-same-charset
9116 \*(BO If this variable is set \*(UA first tries to use the same
9117 character set of the original message for replies.
9118 If this fails, the mechanism described in
9119 .Sx "Character sets"
9120 is evaluated as usual.
9123 .It Va reply-strings
9124 Can be set to a comma-separated list of (case-insensitive according to
9125 ASCII rules) strings which shall be recognized in addition to the
9126 builtin strings as
9127 .Ql Subject:
9128 reply message indicators \(en builtin are
9129 .Ql Re: ,
9130 which is mandated by RFC 5322, as well as the german
9131 .Ql Aw: ,
9132 .Ql Antw: ,
9133 and the
9134 .Ql Wg:
9135 which often has been seen in the wild;
9136 I.e., the separating colon has to be specified explicitly.
9139 .It Va replyto
9140 A list of addresses to put into the
9141 .Ql Reply-To:
9142 field of the message header.
9143 Members of this list are handled as if they were in the
9144 .Ic alternates
9145 list.
9148 .It Va reply-to-honour
9149 Controls whether a
9150 .Ql Reply-To:
9151 header is honoured when replying to a message via
9152 .Ic reply
9154 .Ic Lreply .
9155 This is a quadoption; if set without a value it defaults to
9156 .Dq yes .
9159 .It Va rfc822-body-from_
9160 \*(BO This variable can be used to force displaying a so-called
9161 .Ql From_
9162 line for messages that are embedded into an envelope mail via the
9163 .Ql message/rfc822
9164 MIME mechanism, for more visual convenience.
9167 .It Va save
9168 \*(BO Enable saving of (partial) messages in
9169 .Ev DEAD
9170 upon interrupt or delivery error.
9173 .It Va screen
9174 The number of lines that represents a
9175 .Dq screenful
9176 of lines, used in
9177 .Ic headers
9178 summary display,
9179 .Ic from
9180 .Ic search Ns
9181 ing, message
9182 .Ic top Ns
9183 line display and scrolling via
9184 .Ic z .
9185 If this variable is not set \*(UA falls back to a calculation based upon
9186 the detected terminal window size and the baud rate: the faster the
9187 terminal, the more will be shown.
9188 Overall screen dimensions and pager usage is influenced by the
9189 environment variables
9190 .Ev COLUMNS
9192 .Ev LINES
9193 and the variable
9194 .Va crt .
9197 .It Va searchheaders
9198 \*(BO Expand message-list specifiers in the form
9199 .Ql /x:y
9200 to all messages containing the substring
9201 .Dq y
9202 in the header field
9203 .Ql x .
9204 The string search is case insensitive.
9207 .It Va sendcharsets
9208 \*(OP A comma-separated list of character set names that can be used in
9209 outgoing internet mail.
9210 The value of the variable
9211 .Va charset-8bit
9212 is automatically appended to this list of character sets.
9213 If no character set conversion capabilities are compiled into \*(UA then
9214 the only supported charset is
9215 .Va ttycharset .
9216 Also see
9217 .Va sendcharsets-else-ttycharset
9218 and refer to the section
9219 .Sx "Character sets"
9220 for the complete picture of character set conversion in \*(UA.
9223 .It Va sendcharsets-else-ttycharset
9224 \*(BO\*(OP If this variable is set, but
9225 .Va sendcharsets
9226 is not, then \*(UA acts as if
9227 .Va sendcharsets
9228 had been set to the value of the variable
9229 .Va ttycharset .
9230 In effect this combination passes through the message data in the
9231 character set of the current locale (given that
9232 .Va ttycharset
9233 has not been set manually), i.e., without converting it to the
9234 .Va charset-8bit
9235 fallback character set.
9236 Thus, mail message text will be in ISO-8859-1 encoding when send from
9237 within a ISO-8859-1 locale, and in UTF-8 encoding when send from within
9238 an UTF-8 locale.
9239 If no character set conversion capabilities are available in \*(UA then
9240 the only supported character set is
9241 .Va ttycharset .
9244 .It Va sender
9245 An address that is put into the
9246 .Ql Sender:
9247 field of outgoing messages, quoting RFC 5322: the mailbox of the agent
9248 responsible for the actual transmission of the message.
9249 This field should normally not be used unless the
9250 .Va from
9251 field contains more than one address, on which case it is required.
9253 .Va \&\&sender
9254 address is handled as if it were in the
9255 .Ic alternates
9256 list; also see
9257 .Fl r ,
9258 .Va r-option-implicit .
9261 .It Va sendmail
9262 \*(OB Predecessor of
9263 .Va mta .
9266 .It Va sendmail-arguments
9267 \*(OB Predecessor of
9268 .Va mta-arguments .
9271 .It Va sendmail-no-default-arguments
9272 \*(OB\*(BO Predecessor of
9273 .Va mta-no-default-arguments .
9276 .It Va sendmail-progname
9277 \*(OB Predecessor of
9278 .Va mta-argv0 .
9281 .It Va sendwait
9282 \*(BO When sending a message wait until the
9283 .Va mta
9284 (including the builtin SMTP one) exits before accepting further commands.
9285 .Sy Only
9286 with this variable set errors reported by the MTA will be recognizable!
9287 If the MTA returns a non-zero exit status,
9288 the exit status of \*(UA will also be non-zero.
9291 .It Va showlast
9292 \*(BO This setting causes \*(UA to start at the last message
9293 instead of the first one when opening a mail folder.
9296 .It Va showname
9297 \*(BO Causes \*(UA to use the sender's real name instead of the plain
9298 address in the header field summary and in message specifications.
9301 .It Va showto
9302 \*(BO Causes the recipient of the message to be shown in the header
9303 summary if the message was sent by the user.
9306 .It Va Sign
9307 The string to expand
9308 .Ic ~A
9309 to (see
9310 .Sx "COMMAND ESCAPES" ) .
9313 .It Va sign
9314 The string to expand
9315 .Ic ~a
9316 to (see
9317 .Sx "COMMAND ESCAPES" ) .
9320 .It Va signature
9321 Must correspond to the name of a readable file if set.
9322 The file's content is then appended to each singlepart message
9323 and to the first part of each multipart message.
9324 Be warned that there is no possibility to edit the signature for an
9325 individual message.
9328 .It Va skipemptybody
9329 \*(BO If an outgoing message does not contain any text in its first or
9330 only message part, do not send it but discard it silently (see also the
9331 command line option
9332 .Fl E ) .
9336 .It Va smime-ca-dir , smime-ca-file
9337 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
9338 Enhanced Mail) format as a directory and a file, respectively, for the
9339 purpose of verification of S/MIME signed messages.
9340 It is possible to set both, the file will be loaded immediately, the
9341 directory will be searched whenever no match has yet been found.
9342 The set of CA certificates which are built into the SSL/TLS library can
9343 be explicitly turned off by setting
9344 .Va smime-ca-no-defaults ,
9345 and further fine-tuning is possible via
9346 .Va smime-ca-flags .
9349 .It Va smime-ca-flags
9350 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
9351 storage, and the certificate verification that is used.
9352 The actual values and their meanings are documented for
9353 .Va ssl-ca-flags .
9356 .It Va smime-ca-no-defaults
9357 \*(BO\*(OP Do not load the default CA locations that are built into the
9358 used to SSL/TLS library to verify S/MIME signed messages.
9360 .Mx Va smime-cipher
9361 .It Va smime-cipher-USER@HOST , smime-cipher
9362 \*(OP Specifies the cipher to use when generating S/MIME encrypted
9363 messages (for the specified account).
9364 RFC 5751 mandates a default of
9365 .Ql aes128
9366 (AES-128 CBC).
9367 Possible values are (case-insensitive and) in decreasing cipher strength:
9368 .Ql aes256
9369 (AES-256 CBC),
9370 .Ql aes192
9371 (AES-192 CBC),
9372 .Ql aes128
9373 (AES-128 CBC),
9374 .Ql des3
9375 (DES EDE3 CBC, 168 bits; default if
9376 .Ql aes128
9377 is not available) and
9378 .Ql des
9379 (DES CBC, 56 bits).
9381 The actually available cipher algorithms depend on the cryptographic
9382 library that \*(UA uses.
9383 \*(OP Support for more cipher algorithms may be available through
9384 dynamic loading via, e.g.,
9385 .Xr EVP_get_cipherbyname 3
9386 (OpenSSL) if \*(UA has been compiled to support this.
9389 .It Va smime-crl-dir
9390 \*(OP Specifies a directory that contains files with CRLs in PEM format
9391 to use when verifying S/MIME messages.
9394 .It Va smime-crl-file
9395 \*(OP Specifies a file that contains a CRL in PEM format to use when
9396 verifying S/MIME messages.
9399 .It Va smime-encrypt-USER@HOST
9400 \*(OP If this variable is set, messages send to the given receiver are
9401 encrypted before sending.
9402 The value of the variable must be set to the name of a file that
9403 contains a certificate in PEM format.
9405 If a message is sent to multiple recipients,
9406 each of them for whom a corresponding variable is set will receive an
9407 individually encrypted message;
9408 other recipients will continue to receive the message in plain text
9409 unless the
9410 .Va smime-force-encryption
9411 variable is set.
9412 It is recommended to sign encrypted messages, i.e., to also set the
9413 .Va smime-sign
9414 variable.
9417 .It Va smime-force-encryption
9418 \*(BO\*(OP Causes \*(UA to refuse sending unencrypted messages.
9421 .It Va smime-sign
9422 \*(BO\*(OP S/MIME sign outgoing messages with the user's private key
9423 and include the user's certificate as a MIME attachment.
9424 Signing a message enables a recipient to verify that the sender used
9425 a valid certificate,
9426 that the email addresses in the certificate match those in the message
9427 header and that the message content has not been altered.
9428 It does not change the message text,
9429 and people will be able to read the message as usual.
9430 Also see
9431 .Va smime-sign-cert , smime-sign-include-certs
9433 .Va smime-sign-message-digest .
9435 .Mx Va smime-sign-cert
9436 .It Va smime-sign-cert-USER@HOST , smime-sign-cert
9437 \*(OP Points to a file in PEM format.
9438 For the purpose of signing and decryption this file needs to contain the
9439 user's private key, followed by his certificate.
9441 For message signing
9442 .Ql USER@HOST
9443 is always derived from the value of
9444 .Va from
9445 (or, if that contains multiple addresses,
9446 .Va sender ) .
9447 For the purpose of encryption the recipient's public encryption key
9448 (certificate) is expected; the command
9449 .Ic certsave
9450 can be used to save certificates of signed messages (the section
9451 .Sx "Signed and encrypted messages with S/MIME"
9452 gives some details).
9453 This mode of operation is usually driven by the specialized form.
9455 When decrypting messages the account is derived from the recipient
9456 fields
9457 .Pf ( Ql To:
9459 .Ql Cc: )
9460 of the message, which are searched for addresses for which such
9461 a variable is set.
9462 \*(UA always uses the first address that matches,
9463 so if the same message is sent to more than one of the user's addresses
9464 using different encryption keys, decryption might fail.
9466 For signing and decryption purposes it is possible to use encrypted
9467 keys, and the pseudo-host(s)
9468 .Ql USER@HOST.smime-cert-key
9469 for the private key
9470 (and
9471 .Ql USER@HOST.smime-cert-cert
9472 for the certificate stored in the same file)
9473 will be used for performing any necessary password lookup,
9474 therefore the lookup can be automatized via the mechanisms described in
9475 .Sx "On URL syntax and credential lookup" .
9476 For example, the hypothetical address
9477 .Ql bob@exam.ple
9478 could be driven with a private key / certificate pair path defined in
9479 .Va \&\&smime-sign-cert-bob@exam.ple ,
9480 and needed passwords would then be looked up via the pseudo hosts
9481 .Ql bob@exam.ple.smime-cert-key
9482 (and
9483 .Ql bob@exam.ple.smime-cert-cert ) .
9484 To include intermediate certificates, use
9485 .Va smime-sign-include-certs .
9487 .Mx Va smime-sign-include-certs
9488 .It Va smime-sign-include-certs-USER@HOST , smime-sign-include-certs
9489 \*(OP If used, this is supposed to a consist of a comma-separated list
9490 of files, each of which containing a single certificate in PEM format to
9491 be included in the S/MIME message in addition to the
9492 .Va smime-sign-cert
9493 certificate.
9494 This can be used to include intermediate certificates of the certificate
9495 authority, in order to allow the receiver's S/MIME implementation to
9496 perform a verification of the entire certificate chain, starting from
9497 a local root certificate, over the intermediate certificates, down to the
9498 .Va smime-sign-cert .
9499 Even though top level certificates may also be included in the chain,
9500 they won't be used for the verification on the receiver's side.
9502 For the purpose of the mechanisms involved here,
9503 .Ql USER@HOST
9504 refers to the content of the internal variable
9505 .Va from
9506 (or, if that contains multiple addresses,
9507 .Va sender ) .
9508 The pseudo-host
9509 .Ql USER@HOST.smime-include-certs
9510 will be used for performing password lookups for these certificates,
9511 shall they have been given one, therefore the lookup can be automatized
9512 via the mechanisms described in
9513 .Sx "On URL syntax and credential lookup" .
9515 .Mx Va smime-sign-message-digest
9516 .It Va smime-sign-message-digest-USER@HOST , smime-sign-message-digest
9517 \*(OP Specifies the message digest to use when signing S/MIME messages.
9518 RFC 5751 mandates a default of
9519 .Ql sha1 .
9520 Possible values are (case-insensitive and) in decreasing cipher strength:
9521 .Ql sha512 ,
9522 .Ql sha384 ,
9523 .Ql sha256 ,
9524 .Ql sha224
9526 .Ql md5 .
9528 The actually available message digest algorithms depend on the
9529 cryptographic library that \*(UA uses.
9530 \*(OP Support for more message digest algorithms may be available
9531 through dynamic loading via, e.g.,
9532 .Xr EVP_get_digestbyname 3
9533 (OpenSSL) if \*(UA has been compiled to support this.
9534 Remember that for this
9535 .Ql USER@HOST
9536 refers to the variable
9537 .Va from
9538 (or, if that contains multiple addresses,
9539 .Va sender ) .
9542 .It Va smtp
9543 \*(OB\*(OP To use the builtin SMTP transport, specify a SMTP URL in
9544 .Va mta .
9545 \*(ID For compatibility reasons a set
9546 .Va smtp
9547 is used in preference of
9548 .Va mta .
9550 .Mx Va smtp-auth
9551 .It Va smtp-auth-USER@HOST , smtp-auth-HOST , smtp-auth
9552 \*(OP Variable chain that controls the SMTP
9553 .Va mta
9554 authentication method, possible values are
9555 .Ql none
9556 (\*(OU default),
9557 .Ql plain
9558 (\*(IN default),
9559 .Ql login
9560 as well as the \*(OPal methods
9561 .Ql cram-md5
9563 .Ql gssapi .
9565 .Ql none
9566 method does not need any user credentials,
9567 .Ql gssapi
9568 requires a user name and all other methods require a user name and
9569 a password.
9570 See \*(IN
9571 .Va mta ,
9572 .Va user
9574 .Va password
9575 (\*(OU
9576 .Va smtp-auth-password
9578 .Va smtp-auth-user ) .
9579 Note that
9580 .Va smtp-auth-HOST
9581 is \*(IN.
9582 \*(OU: Note for
9583 .Va smtp-auth-USER@HOST :
9584 may override dependent on sender address in the variable
9585 .Va from .
9587 .It Va smtp-auth-password
9588 \*(OP\*(OU Sets the global fallback password for SMTP authentication.
9589 If the authentication method requires a password, but neither
9590 .Va smtp-auth-password
9591 nor a matching
9592 .Va smtp-auth-password-USER@HOST
9593 can be found,
9594 \*(UA will ask for a password on the user's terminal.
9596 .It Va smtp-auth-password-USER@HOST
9597 \*(OU Overrides
9598 .Va smtp-auth-password
9599 for specific values of sender addresses, dependent upon the variable
9600 .Va from .
9602 .It Va smtp-auth-user
9603 \*(OP\*(OU Sets the global fallback user name for SMTP authentication.
9604 If the authentication method requires a user name, but neither
9605 .Va smtp-auth-user
9606 nor a matching
9607 .Va smtp-auth-user-USER@HOST
9608 can be found,
9609 \*(UA will ask for a user name on the user's terminal.
9611 .It Va smtp-auth-user-USER@HOST
9612 \*(OU Overrides
9613 .Va smtp-auth-user
9614 for specific values of sender addresses, dependent upon the variable
9615 .Va from .
9618 .It Va smtp-hostname
9619 \*(OP\*(IN Normally \*(UA uses the variable
9620 .Va from
9621 to derive the necessary
9622 .Ql USER@HOST
9623 information in order to issue a
9624 .Ql MAIL FROM:<>
9625 SMTP
9626 .Va mta
9627 command.
9628 Setting
9629 .Va smtp-hostname
9630 can be used to use the
9631 .Ql USER
9632 from the SMTP account
9633 .Pf ( Va mta
9634 or the
9635 .Va user
9636 variable chain)
9637 and the
9638 .Ql HOST
9639 from the content of this variable (or, if that is the empty string,
9640 .Va hostname
9641 or the local hostname as a last resort).
9642 This often allows using an address that is itself valid but hosted by
9643 a provider other than which (in
9644 .Va from )
9645 is about to send the message.
9646 Setting this variable also influences generated
9647 .Ql Message-ID:
9649 .Ql Content-ID:
9650 header fields.
9652 .Mx Va smtp-use-starttls
9653 .It Va smtp-use-starttls-USER@HOST , smtp-use-starttls-HOST , smtp-use-starttls
9654 \*(BO\*(OP Causes \*(UA to issue a
9655 .Ql STARTTLS
9656 command to make an SMTP
9657 .Va mta
9658 session SSL/TLS encrypted, i.e., to enable transport layer security.
9662 .It Va spam-interface
9663 \*(OP In order to use any of the spam-related commands (like, e.g.,
9664 .Ic spamrate )
9665 the desired spam interface must be defined by setting this variable.
9666 Please refer to the manual section
9667 .Sx "Handling spam"
9668 for the complete picture of spam handling in \*(UA.
9669 All or none of the following interfaces may be available:
9671 .Bl -tag -width ".It Ql _ilte_"
9672 .It Ql spamc
9673 Interaction with
9674 .Xr spamc 1
9675 from the
9676 .Xr spamassassin 1
9677 .Pf ( Lk http://spamassassin.apache.org SpamAssassin )
9678 suite.
9679 Different to the generic filter interface \*(UA will automatically add
9680 the correct arguments for a given command and has the necessary
9681 knowledge to parse the program's output.
9682 A default value for
9683 .Va spamc-command
9684 will have been compiled into the \*(UA binary if
9685 .Xr spamc 1
9686 has been found in
9687 .Ev PATH
9688 during compilation.
9689 Shall it be necessary to define a specific connection type (rather than
9690 using a configuration file for that), the variable
9691 .Va spamc-arguments
9692 can be used as in, e.g.,
9693 .Ql -d server.example.com -p 783 .
9694 It is also possible to specify a per-user configuration via
9695 .Va spamc-user .
9696 Note that this interface does not inspect the
9697 .Ql is-spam
9698 flag of a message for the command
9699 .Ic spamforget .
9701 .It Ql filter
9702 generic spam filter support via freely configurable hooks.
9703 This interface is meant for programs like
9704 .Xr bogofilter 1
9705 and requires according behaviour in respect to the hooks' exit
9706 status for at least the command
9707 .Ic spamrate
9708 .Pf ( Ql 0
9709 meaning a message is spam,
9710 .Ql 1
9711 for non-spam,
9712 .Ql 2
9713 for unsure and any other return value indicating a hard error);
9714 since the hooks can include shell code snippets diverting behaviour
9715 can be intercepted as necessary.
9716 The hooks are
9717 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
9718   spamfilter-rate
9720 .Va spamfilter-spam ;
9721 the manual section
9722 .Sx "Handling spam"
9723 contains examples for some programs.
9724 The process environment of the hooks will have the variable
9725 .Ev MAILX_FILENAME_GENERATED
9726 set.
9727 Note that spam score support for
9728 .Ic spamrate
9729 is not supported unless the \*(OPtional regular expression support is
9730 available and the
9731 .Va spamfilter-rate-scanscore
9732 variable is set.
9737 .It Va spam-maxsize
9738 \*(OP Messages that exceed this size will not be passed through to the
9739 configured
9740 .Va spam-interface .
9741 If unset or 0, the default of 420000 bytes is used.
9744 .It Va spamc-command
9745 \*(OP The path to the
9746 .Xr spamc 1
9747 program for the
9748 .Ql spamc
9749 .Va spam-interface .
9750 Note that the path is not expanded, but used
9751 .Dq as is .
9752 A fallback path will have been compiled into the \*(UA binary if the
9753 executable had been found during compilation.
9756 .It Va spamc-arguments
9757 \*(OP Even though \*(UA deals with most arguments for the
9758 .Ql spamc
9759 .Va spam-interface
9760 automatically, it may at least sometimes be desirable to specify
9761 connection-related ones via this variable, e.g.,
9762 .Ql -d server.example.com -p 783 .
9765 .It Va spamc-user
9766 \*(OP Specify a username for per-user configuration files for the
9767 .Ql spamc
9768 .Va spam-interface .
9769 If this is set to the empty string then \*(UA will use the name of the
9770 current
9771 .Va user .
9778 .It Va spamfilter-ham , spamfilter-noham , \
9779   spamfilter-nospam , spamfilter-rate , spamfilter-spam
9780 \*(OP Command and argument hooks for the
9781 .Ql filter
9782 .Va spam-interface .
9783 The manual section
9784 .Sx "Handling spam"
9785 contains examples for some programs.
9788 .It Va spamfilter-rate-scanscore
9789 \*(OP Because of the generic nature of the
9790 .Ql filter
9791 .Va spam-interface
9792 spam scores are not supported for it by default, but if the \*(OPnal
9793 regular expression support is available then setting this variable can
9794 be used to overcome this restriction.
9795 It is interpreted as follows: first a number (digits) is parsed that
9796 must be followed by a semicolon
9797 .Ql \&;
9798 and an extended regular expression.
9799 Then the latter is used to parse the first output line of the
9800 .Va spamfilter-rate
9801 hook, and, in case the evaluation is successful, the group that has been
9802 specified via the number is interpreted as a floating point scan score.
9806 .It Va ssl-ca-dir , ssl-ca-file
9807 \*(OP Specify the location of trusted CA certificates in PEM (Privacy
9808 Enhanced Mail) format as a directory and a file, respectively, for the
9809 purpose of verification of SSL/TLS server certificates.
9810 It is possible to set both, the file will be loaded immediately, the
9811 directory will be searched whenever no match has yet been found.
9812 The set of CA certificates which are built into the SSL/TLS library can
9813 be explicitly turned off by setting
9814 .Va ssl-ca-no-defaults ,
9815 and further fine-tuning is possible via
9816 .Va ssl-ca-flags ;
9817 also see
9818 .Xr SSL_CTX_load_verify_locations 3
9819 for more information.
9823 .It Va ssl-ca-flags
9824 \*(OP Can be used to fine-tune behaviour of the X509 CA certificate
9825 storage, and the certificate verification that is used (also see
9826 .Va ssl-verify ) .
9827 The value is expected to consist of a comma-separated list of
9828 configuration directives, with any intervening whitespace being ignored.
9829 The directives directly map to flags that can be passed to
9830 .Xr X509_STORE_set_flags 3 ,
9831 which are usually defined in a file
9832 .Pa openssl/x509_vfy.h ,
9833 and the availability of which depends on the used SSL/TLS library
9834 version: a directive without mapping is ignored (error log subject to
9835 .Va debug ) .
9836 Directives currently understood (case-insensitively) include:
9839 .Bl -tag -compact -width ".It Cd BaNg"
9840 .It Cd no-alt-chains
9841 If the initial chain is not trusted, do not attempt to build an
9842 alternative chain.
9843 Setting this flag will make OpenSSL certificate verification match that
9844 of older OpenSSL versions, before automatic building and checking of
9845 alternative chains has been implemented; also see
9846 .Cd trusted-first .
9847 .It Cd no-check-time
9848 Do not check certificate/CRL validity against current time.
9849 .It Cd partial-chain
9850 By default partial, incomplete chains which cannot be verified up to the
9851 chain top, a self-signed root certificate, will not verify.
9852 With this flag set, a chain succeeds to verify if at least one signing
9853 certificate of the chain is in any of the configured trusted stores of
9854 CA certificates.
9855 The OpenSSL manual page
9856 .Xr SSL_CTX_load_verify_locations 3
9857 gives some advise how to manage your own trusted store of CA certificates.
9858 .It Cd strict
9859 Disable workarounds for broken certificates.
9860 .It Cd trusted-first
9861 Try building a chain using issuers in the trusted store first to avoid
9862 problems with server-sent legacy intermediate certificates.
9863 Newer versions of OpenSSL support alternative chain checking and enable
9864 it by default, resulting in the same behaviour; also see
9865 .Cd no-alt-chains .
9870 .It Va ssl-ca-no-defaults
9871 \*(BO\*(OP Do not load the default CA locations that are built into the
9872 used to SSL/TLS library to verify SSL/TLS server certificates.
9874 .Mx Va ssl-cert
9875 .It Va ssl-cert-USER@HOST , ssl-cert-HOST , ssl-cert
9876 \*(OP Variable chain that sets the file name for a SSL/TLS client
9877 certificate required by some servers.
9878 This is a direct interface to the
9879 .Ql Certificate
9880 slot of the
9881 .Xr SSL_CONF_cmd 3
9882 function of the OpenSSL library, if available.
9884 .Mx Va ssl-cipher-list
9885 .It Va ssl-cipher-list-USER@HOST , ssl-cipher-list-HOST , ssl-cipher-list
9886 \*(OP Specifies a list of ciphers for SSL/TLS connections.
9887 This is a direct interface to the
9888 .Ql CipherString
9889 slot of the
9890 .Xr SSL_CONF_cmd 3
9891 function of the OpenSSL library, if available; see
9892 .Xr ciphers 1
9893 for more information.
9894 By default \*(UA does not set a list of ciphers, in effect using a
9895 .Va ssl-protocol
9896 specific cipher (protocol standards ship with a list of acceptable
9897 ciphers), possibly cramped to what the actually used SSL/TLS library
9898 supports \(en the manual section
9899 .Sx "An example configuration"
9900 also contains a SSL/TLS use case.
9903 .It Va ssl-config-file
9904 \*(OP If this variable is set \*(UA will call
9905 .Xr CONF_modules_load_file 3
9906 to allow OpenSSL to be configured according to the host system wide
9907 security settings.
9908 If a non-empty value is given then this will be used to specify the
9909 configuration file to be used instead of the global OpenSSL default;
9910 note that in this case it is an error if the file cannot be loaded.
9911 The application name will always be passed as
9912 .Dq \*(uA .
9916 .It Va ssl-crl-dir , ssl-crl-file
9917 \*(OP Specify a directory / a file, respectively that contains a CRL in
9918 PEM format to use when verifying SSL/TLS server certificates.
9920 .Mx Va ssl-key
9921 .It Va ssl-key-USER@HOST , ssl-key-HOST , ssl-key
9922 \*(OP Variable chain that sets the file name for the private key of
9923 a SSL/TLS client certificate.
9924 If unset, the name of the certificate file is used.
9925 The file is expected to be in PEM format.
9926 This is a direct interface to the
9927 .Ql PrivateKey
9928 slot of the
9929 .Xr SSL_CONF_cmd 3
9930 function of the OpenSSL library, if available.
9932 .Mx Va ssl-method
9933 .It Va ssl-method-USER@HOST , ssl-method-HOST , ssl-method
9934 \*(OB\*(OP Please use the newer and more flexible
9935 .Va ssl-protocol
9936 instead: if both values are set,
9937 .Va ssl-protocol
9938 will take precedence!
9939 Can be set to the following values, the actually used
9940 .Va ssl-protocol
9941 specification to which it is mapped is shown in parenthesis:
9942 .Ql tls1.2
9943 .Pf ( Ql -ALL, TLSv1.2 ) ,
9944 .Ql tls1.1
9945 .Pf ( Ql -ALL, TLSv1.1 ) ,
9946 .Ql tls1
9947 .Pf ( Ql -ALL, TLSv1 )
9949 .Ql ssl3
9950 .Pf ( Ql -ALL, SSLv3 ) ;
9951 the special value
9952 .Ql auto
9953 is mapped to
9954 .Ql ALL, -SSLv2
9955 and thus includes the SSLv3 protocol.
9956 Note that SSLv2 is no longer supported at all.
9958 .Mx Va ssl-protocol
9959 .It Va ssl-protocol-USER@HOST , ssl-protocol-HOST , ssl-protocol
9960 \*(OP Specify the used SSL/TLS protocol.
9961 This is a direct interface to the
9962 .Ql Protocol
9963 slot of the
9964 .Xr SSL_CONF_cmd 3
9965 function of the OpenSSL library, if available;
9966 otherwise an \*(UA internal parser is used which understands the
9967 following subset of (case-insensitive) command strings:
9968 .Ql SSLv3 ,
9969 .Ql TLSv1 ,
9970 .Ql TLSv1.1
9972 .Ql TLSv1.2 ,
9973 as well as the special value
9974 .Ql ALL .
9975 Multiple specifications may be given via a comma-separated list which
9976 ignores any whitespace.
9977 An optional
9978 .Ql +
9979 plus sign prefix will enable a protocol, a
9980 .Ql -
9981 hyphen-minus prefix will disable it, so that
9982 .Ql -ALL, TLSv1.2
9983 will enable only the TLSv1.2 protocol.
9985 It depends upon the used TLS/SSL library which protocols are actually
9986 supported and which protocols are used if
9987 .Va ssl-protocol
9988 is not set, but note that SSLv2 is no longer supported at all and
9989 actively disabled.
9990 Especially for older protocols explicitly securing
9991 .Va ssl-cipher-list
9992 may be worthwile, see
9993 .Sx "An example configuration" .
9996 .It Va ssl-rand-egd
9997 \*(OP Gives the pathname to an entropy daemon socket, see
9998 .Xr RAND_egd 3 .
9999 Not all SSL/TLS libraries support this.
10002 .It Va ssl-rand-file
10003 \*(OP Gives the filename to a file with random entropy data, see
10004 .Xr RAND_load_file 3 .
10005 If this variable is not set, or set to the empty string, or if the
10006 .Sx "Filename transformations"
10007 fail, then
10008 .Xr RAND_file_name 3
10009 will be used to create the filename if, and only if,
10010 .Xr RAND_status 3
10011 documents that the SSL PRNG is not yet sufficiently seeded.
10012 If \*(UA successfully seeded the SSL PRNG then it will update the file
10013 .Pf ( Xr RAND_write_file 3 ) .
10014 This variable is only used if
10015 .Va ssl-rand-egd
10016 is not set (or not supported by the SSL/TLS library).
10018 .Mx Va ssl-verify
10019 .It Va ssl-verify-USER@HOST , ssl-verify-HOST , ssl-verify
10020 \*(OP Variable chain that sets the action to be performed if an error
10021 occurs during SSL/TLS server certificate validation against the
10022 specified or default trust stores
10023 .Va ssl-ca-dir ,
10024 .Va ssl-ca-file ,
10025 or the SSL/TLS library builtin defaults (unless usage disallowed via
10026 .Va ssl-ca-no-defaults ) ,
10027 and as fine-tuned via
10028 .Va ssl-ca-flags .
10029 Valid (case-insensitive) values are
10030 .Ql strict
10031 (fail and close connection immediately),
10032 .Ql ask
10033 (ask whether to continue on standard input),
10034 .Ql warn
10035 (show a warning and continue),
10036 .Ql ignore
10037 (do not perform validation).
10038 The default is
10039 .Ql ask .
10042 .It Va stealthmua
10043 If only set without an assigned value, then this setting inhibits the
10044 generation of the
10045 .Ql Message-ID: ,
10046 .Ql Content-ID:
10048 .Ql User-Agent:
10049 header fields that include obvious references to \*(UA.
10050 There are two pitfalls associated with this:
10051 First, the message id of outgoing messages is not known anymore.
10052 Second, an expert may still use the remaining information in the header
10053 to track down the originating mail user agent.
10054 If set to the value
10055 .Ql noagent ,
10056 then the mentioned
10057 .Ql Message-ID:
10059 .Ql Content-ID:
10060 suppression does not occur.
10064 .It Va termcap
10065 (\*(OP) This specifies a comma-separated list of
10066 .Lb libterminfo
10067 and/or
10068 .Lb libtermcap
10069 capabilities (see
10070 .Sx "On terminal control and line editor" ,
10071 escape commas with reverse solidus) to be used to overwrite or define
10072 entries.
10073 Note that this variable will only be queried once at program startup and
10074 can thus only be specified in resource files or on the command line.
10077 String capabilities form
10078 .Ql cap=value
10079 pairs and are expected unless noted otherwise.
10080 Numerics have to be notated as
10081 .Ql cap#number
10082 where the number is expected in normal decimal notation.
10083 Finally, booleans do not have any value but indicate a true or false
10084 state simply by being defined or not; this indeed means that \*(UA
10085 does not support undefining an existing boolean.
10086 String capability values will undergo some expansions before use:
10087 for one notations like
10088 .Ql ^LETTER
10089 stand for
10090 .Ql control-LETTER ,
10091 and for clarification purposes
10092 .Ql \eE
10093 can be used to specify
10094 .Ql escape
10095 (the control notation
10096 .Ql ^[
10097 could lead to misreadings when a left bracket follows, which it does for
10098 the standard CSI sequence);
10099 finally three letter octal sequences, as in
10100 .Ql \e061 ,
10101 are supported.
10102 To specify that a terminal supports 256-colours, and to define sequences
10103 that home the cursor and produce an audible bell, one might write:
10105 .Bd -literal -offset indent
10106 set termcap='Co#256,home=\eE[H,bel=^G'
10110 The following terminal capabilities are or may be meaningful for the
10111 operation of the builtin line editor or \*(UA in general:
10114 .Bl -tag -compact -width yay
10115 .\" HAVE_COLOUR
10116 .It Cd colors Ns \0or Cd Co
10117 .Cd max_colors :
10118 numeric capability specifying the maximum number of colours.
10119 Note that \*(UA does not actually care about the terminal beside that,
10120 but always emits ANSI / ISO 6429 escape sequences.
10122 .\" HAVE_TERMCAP
10123 .It Cd rmcup Ns \0or Cd te Ns \0/ Cd smcup Ns \0or Cd ti
10124 .Cd exit_ca_mode
10126 .Cd enter_ca_mode ,
10127 respectively: exit and enter the alternative screen
10128 .Dq ca-mode ,
10129 effectively turning \*(UA into a fullscreen application.
10130 To disable that, set (at least) one to the empty string.
10132 .It Cd smkx Ns \0or Cd ks Ns \0/ Cd rmkx Ns \0or Cd ke
10133 .Cd keypad_xmit
10135 .Cd keypad_local ,
10136 respectively: enable and disable the keypad.
10137 This is always enabled if available, because it seems even keyboards
10138 without keypads generate other key codes for, e.g., cursor keys in that
10139 case, and only if enabled we see the codes that we are interested in.
10141 .It Cd ed Ns \0or Cd cd
10142 .Cd clr_eos :
10143 clear the screen.
10145 .It Cd clear Ns \0or Cd cl
10146 .Cd clear_screen :
10147 clear the screen and home cursor.
10148 (Will be simulated via
10149 .Cd ho
10150 plus
10151 .Cd cd . )
10153 .It Cd home Ns \0or Cd ho
10154 .Cd cursor_home :
10155 home cursor.
10157 .\" HAVE_MLE
10158 .It Cd el Ns \0or Cd ce
10159 .Cd clr_eol :
10160 clear to the end of line.
10161 (Will be simulated via
10162 .Cd ch
10163 plus repetitions of space characters.)
10165 .It Cd hpa Ns \0or Cd ch
10166 .Cd column_address :
10167 move the cursor (to the given column parameter) in the current row.
10168 (Will be simulated via
10169 .Cd cr
10170 plus
10171 .Cd nd . )
10173 .It Cd cr
10174 .Cd carriage_return :
10175 move to the first column in the current row.
10176 The default builtin fallback is
10177 .Ql \er .
10179 .It Cd cub1 Ns \0or Cd le
10180 .Cd cursor_left :
10181 move the cursor left one space (non-destructively).
10182 The default builtin fallback is
10183 .Ql \eb .
10185 .It Cd cuf1 Ns \0or Cd nd
10186 .Cd cursor_right :
10187 move the cursor right one space (non-destructively).
10188 The default builtin fallback is
10189 .Ql \eE[C ,
10190 which is used by most terminals.
10191 Less often occur
10192 .Ql \eEC
10194 .Ql \eEOC .
10198 Many more capabilities which describe key-sequences are documented for
10199 .Ic bind .
10202 .It Va termcap-disable
10203 \*(OP Disable any interaction with a terminal control library.
10204 If set only some generic fallback builtins and possibly the content of
10205 .Va termcap
10206 describe the terminal to \*(UA.
10207 .Sy Note
10208 that this variable will only be queried once at program startup and can
10209 thus only be specified in resource files or on the command line.
10212 .It Va toplines
10213 If defined, gives the number of lines of a message to be displayed
10214 with the command
10215 .Ic top ;
10216 if unset, the first five lines are printed, if set to 0 the variable
10217 .Va screen
10218 is inspected.
10219 If the value is negative then its absolute value will be used for
10220 unsigned right shifting (see
10221 .Ic vexpr )
10223 .Va screen
10224 height.
10227 .It Va topsqueeze
10228 \*(BO If set then the
10229 .Ic top
10230 command series will strip adjacent empty lines and quotations.
10233 .It Va ttycharset
10234 The character set of the terminal \*(UA operates on,
10235 and the one and only supported character set that \*(UA can use if no
10236 character set conversion capabilities have been compiled into it,
10237 in which case it defaults to ISO-8859-1 unless it can deduce a value
10238 from the
10239 .Ev LC_CTYPE
10240 locale environment.
10241 It defaults to UTF-8 if conversion is available.
10242 Refer to the section
10243 .Sx "Character sets"
10244 for the complete picture about character sets.
10247 .It Va typescript-mode
10248 \*(BO A special multiplex variable that disables all variables and
10249 settings which result in behaviour that interferes with running \*(UA in
10250 .Xr script 1 ,
10251 e.g., it sets
10252 .Va colour-disable ,
10253 .Va line-editor-disable
10254 and (before startup completed only)
10255 .Va termcap-disable .
10256 Unsetting it does not restore the former state of the covered settings.
10259 .It Va umask
10260 For a safety-by-default policy \*(UA sets its process
10261 .Xr umask 2
10263 .Ql 0077 ,
10264 but this variable can be used to override that:
10265 set it to an empty value to do not change the (current) setting,
10266 otherwise the process file mode creation mask is updated to the new value.
10267 Child processes inherit the process file mode creation mask.
10269 .Mx Va user
10270 .It Va user-HOST , user
10271 \*(IN Variable chain that sets a global fallback user name, which is
10272 used in case none has been given in the protocol and account-specific
10273 URL.
10274 This variable defaults to the name of the user who runs \*(UA.
10277 .It Va v15-compat
10278 \*(BO Setting this enables upward compatibility with \*(UA
10279 version 15.0 in respect to which configuration options are available and
10280 how they are handled.
10281 This manual uses \*(IN and \*(OU to refer to the new and the old way of
10282 doing things, respectively.
10285 .It Va verbose
10286 \*(BO This setting, also controllable via the command line option
10287 .Fl v ,
10288 causes \*(UA to be more verbose, e.g., it will display obsoletion
10289 warnings and SSL/TLS certificate chains.
10290 Even though marked \*(BO this option may be set twice in order to
10291 increase the level of verbosity even more, in which case even details of
10292 the actual message delivery and protocol conversations are shown.
10293 A single
10294 .Pf no Va verbose
10295 is sufficient to disable verbosity as such.
10301 .It Va version , version-major , version-minor , version-update
10302 \*(RO \*(UA version information: the first variable contains a string
10303 containing the complete version identification, the latter three contain
10304 only digits: the major, minor and update version numbers.
10305 The output of the command
10306 .Ic version
10307 will include this information.
10310 .It Va writebackedited
10311 If this variable is set messages modified using the
10312 .Ic edit
10314 .Ic visual
10315 commands are written back to the current folder when it is quit;
10316 it is only honoured for writable folders in MBOX format, though.
10317 Note that the editor will be pointed to the raw message content in that
10318 case, i.e., neither MIME decoding nor decryption will have been
10319 performed, and proper RFC 4155
10320 .Ql From_
10321 quoting of newly added or edited content is also left as an excercise to
10322 the user.
10324 .\" }}} (Variables)
10325 .\" }}} (INTERNAL VARIABLES)
10328 .\" .Sh ENVIRONMENT {{{
10329 .Sh ENVIRONMENT
10331 The term
10332 .Dq environment variable
10333 should be considered an indication that these variables are either
10334 standardized as vivid parts of process environments, or that they are
10335 commonly found in there.
10336 The process environment is inherited from the
10337 .Xr sh 1
10338 once \*(UA is started, and unless otherwise explicitly noted handling of
10339 the following variables transparently integrates into that of the
10340 .Sx "INTERNAL VARIABLES"
10341 from \*(UA's point of view.
10342 This means that, e.g., they can be managed via
10343 .Ic set
10345 .Ic unset ,
10346 causing automatic program environment updates (to be inherited by
10347 newly created child processes).
10350 In order to transparently integrate other environment variables equally
10351 they need to be imported (linked) with the command
10352 .Ic environ .
10353 This command can also be used to set and unset non-integrated
10354 environment variables from scratch, sufficient system support provided.
10355 The following example, applicable to a POSIX shell, sets the
10356 .Ev COLUMNS
10357 environment variable for \*(UA only, and beforehand exports the
10358 .Ev EDITOR
10359 in order to affect any further processing in the running shell:
10361 .Bd -literal -offset indent
10362 $ EDITOR="vim -u ${HOME}/.vimrc"
10363 $ export EDITOR
10364 $ COLUMNS=80 \*(uA -R
10367 .Bl -tag -width ".It Ev BaNg"
10369 .It Ev COLUMNS
10370 The user's preferred width in column positions for the terminal screen
10371 or window.
10372 Queried and used once on program startup, actively managed for child
10373 processes and the MLE (see
10374 .Sx "On terminal control and line editor" )
10375 in interactive mode thereafter.
10378 .It Ev DEAD
10379 The name of the (mailbox)
10380 .Ic file
10381 to use for saving aborted messages if
10382 .Va save
10383 is set; this defaults to
10384 .Pa dead.letter
10385 in the user's
10386 .Ev HOME
10387 directory.
10388 If the variable
10389 .Va debug
10390 is set no output will be generated, otherwise the contents of the file
10391 will be replaced.
10394 .It Ev EDITOR
10395 Pathname of the text editor to use in the
10396 .Ic edit
10397 command and
10398 .Ic ~e
10399 .Sx "COMMAND ESCAPES" .
10400 A default editor is used if this value is not defined.
10403 .It Ev HOME
10404 The user's home directory.
10405 This variable is only used when it resides in the process environment.
10412 .It Ev LANG , LC_ALL , LC_COLLATE , LC_CTYPE , LC_MESSAGES
10414 .Xr locale 7
10416 .Sx "Character sets" .
10419 .It Ev LINES
10420 The user's preferred number of lines on a page or the vertical screen
10421 or window size in lines.
10422 Queried and used once on program startup, actively managed for child
10423 processes in interactive mode thereafter.
10426 .It Ev LISTER
10427 Pathname of the directory lister to use in the
10428 .Ic folders
10429 command when operating on local mailboxes.
10430 Default is
10431 .Xr ls 1
10432 (path search through
10433 .Ev SHELL ) .
10436 .It Ev LOGNAME
10437 Upon startup \*(UA will actively ensure that this variable refers to the
10438 name of the user who runs \*(UA, in order to be able to pass a verified
10439 name to any newly created child process.
10442 .It Ev MAIL
10443 Is used as the users
10444 .Mx -sx
10445 .Sx "primary system mailbox"
10446 unless
10447 .Va inbox
10448 is set.
10449 This is assumed to be an absolute pathname.
10452 .It Ev MAILCAPS
10453 \*(OP Overrides the default path search for
10454 .Sx "The Mailcap files" ,
10455 which is defined in the standard RFC 1524 as
10456 .Ql ~/.mailcap:\:/etc/mailcap:\:/usr/etc/mailcap:\:/usr/local/etc/mailcap .
10457 .\" TODO we should have a mailcaps-default virtual RDONLY option!
10458 (\*(UA makes it a configuration option, however.)
10459 Note this is not a search path, but a path search.
10462 .It Ev MAILRC
10463 Is used as a startup file instead of
10464 .Pa \*(ur
10465 if set.
10466 When \*(UA scripts are invoked on behalf of other users,
10467 either this variable should be set to
10468 .Pa /dev/null
10469 or the
10470 .Fl \&:
10471 command line option should be used in order to avoid side-effects from
10472 reading their configuration files.
10473 This variable is only used when it resides in the process environment.
10476 .It Ev MAILX_NO_SYSTEM_RC
10477 If this variable is set then reading of
10478 .Pa \*(UR
10479 at startup is inhibited, i.e., the same effect is achieved as if \*(UA
10480 had been started up with the option
10481 .Fl \&:
10482 (and according argument) or
10483 .Fl n .
10484 This variable is only used when it resides in the process environment.
10487 .It Ev MBOX
10488 The name of the users
10489 .Mx -sx
10490 .Sx "secondary mailbox"
10491 file.
10492 A logical subset of the special
10493 .Sx "Filename transformations"
10494 (also see
10495 .Ic file )
10496 are supported.
10497 The fallback default is
10498 .Pa mbox
10499 in the user's
10500 .Ev HOME
10501 directory.
10502 Traditionally this MBOX is used as the file to save messages from the
10503 .Mx -sx
10504 .Sx "primary system mailbox"
10505 that have been read.
10506 Also see
10507 .Sx "Message states" .
10510 .It Ev NETRC
10511 \*(IN\*(OP This variable overrides the default location of the user's
10512 .Pa .netrc
10513 file.
10516 .It Ev PAGER
10517 Pathname of the program to use for backing the command
10518 .Ic more ,
10519 and when the
10520 .Va crt
10521 variable enforces usage of a pager for output.
10522 The default paginator is
10523 .Xr more 1
10524 (path search through
10525 .Ev SHELL ) .
10527 \*(UA inspects the contents of this variable: if its contains the string
10528 .Dq less
10529 then a non-existing environment variable
10530 .Va LESS
10531 will be set to
10532 .Ql FRXi ,
10533 .Ql FRi
10535 .Ql Ri ,
10536 dependent on whether terminal control support is available and whether
10537 that supports full (alternative) screen mode or not (also see
10538 .Sx "On terminal control and line editor" ) .
10539 Likewise for
10540 .Dq lv
10541 .Va LV
10542 will optionally be set to
10543 .Dq -c .
10544 Alse see
10545 .Va colour-pager .
10548 .It Ev PATH
10549 A colon-separated list of directories that is searched by the shell when
10550 looking for commands, e.g.,
10551 .Ql /bin:/usr/bin:/usr/local/bin .
10554 .It Ev POSIXLY_CORRECT
10555 This variable is automatically looked for upon startup, see
10556 .Va posix
10557 for more.
10560 .It Ev SHELL
10561 The shell to use for the commands
10562 .Ic \&! ,
10563 .Ic shell ,
10565 .Ic ~!
10566 .Sx "COMMAND ESCAPES"
10567 and when starting subprocesses.
10568 A default shell is used if this environment variable is not defined.
10571 .It Ev SOURCE_DATE_EPOCH
10572 If set, this specifies a time in seconds since the Unix epoch
10573 (1970-01-01) to be used in place of the current time.
10574 This is for the sake of reproduceability of tests, to be used during
10575 development or by software packagers.
10578 .It Ev TERM
10579 \*(OP The terminal type for which output is to be prepared.
10580 For extended colour and font control please refer to
10581 .Sx "Coloured display" ,
10582 and for terminal management in general to
10583 .Sx "On terminal control and line editor" .
10586 .It Ev TMPDIR
10587 Used as directory for temporary files instead of
10588 .Pa /tmp ,
10589 if set.
10590 This variable is only used when it resides in the process environment,
10591 but \*(UA will ensure at startup that this environment variable is
10592 updated to contain a usable temporary directory.
10595 .It Ev USER
10596 Identical to
10597 .Ev LOGNAME
10598 (see there), but this variable is not standardized, should therefore not
10599 be used, and is only corrected if already set.
10602 .It Ev VISUAL
10603 Pathname of the text editor to use in the
10604 .Ic visual
10605 command and
10606 .Ic ~v
10607 .Sx "COMMAND ESCAPES" .
10609 .\" }}}
10612 .\" .Sh FILES {{{
10613 .Sh FILES
10615 .Bl -tag -width ".It Pa BaNg"
10616 .It Pa \*(ur
10617 File giving initial commands.
10619 .It Pa \*(UR
10620 System wide initialization file.
10623 .It Pa ~/.mailcap
10624 \*(OP Personal MIME type handler definition file, see
10625 .Sx "The Mailcap files" .
10626 (RFC 1524 location, the actual path is a configuration option.)
10629 .It Pa /etc/mailcap
10630 \*(OP System wide MIME type handler definition file, see
10631 .Sx "The Mailcap files" .
10632 (RFC 1524 location, the actual path is a configuration option.)
10635 .It Pa ~/.mime.types
10636 Personal MIME types, see
10637 .Sx "The mime.types files" .
10640 .It Pa /etc/mime.types
10641 System wide MIME types, see
10642 .Sx "The mime.types files" .
10645 .It Pa ~/.netrc
10646 \*(IN\*(OP The default location of the users
10647 .Pa .netrc
10648 file \(en the section
10649 .Sx "The .netrc file"
10650 documents the file format.
10653 .\" .Ss "The mime.types files" {{{
10654 .Ss "The mime.types files"
10656 When sending messages \*(UA tries to determine the content type of all
10657 attachments.
10658 When displaying message content or attachments \*(UA uses the content
10659 type to decide whether it can directly display data or whether it needs
10660 to deal with content handlers.
10661 It learns about M(ultipurpose) I(nternet) M(ail) E(xtensions) types and
10662 how to treat them by reading
10663 .Pa mime.types
10664 files, the loading of which can be controlled by setting the variable
10665 .Va mimetypes-load-control .
10666 (The command
10667 .Ic mimetype
10668 can also be used to deal with MIME types.)
10669 .Pa mime.types
10670 files have the following syntax:
10673 .Dl type/subtype extension [extension ...]
10676 where
10677 .Ql type/subtype
10678 are strings describing the file contents, and one or multiple
10679 .Ql extension Ns
10680 s, separated by whitespace, name the part of a filename starting after
10681 the last dot (of interest).
10682 Comments may be introduced anywhere on a line with a number sign
10683 .Ql # ,
10684 causing the remaining line to be discarded.
10686 \*(UA also supports an extended, non-portable syntax in specially
10687 crafted files, which can be loaded via the alternative value syntax of
10688 .Va mimetypes-load-control
10689 and prepends an optional
10690 .Ql type-marker :
10693 .Dl [type-marker ]type/subtype extension [extension ...]
10696 The following type markers are supported:
10699 .Bl -tag -compact -width ".It Ar _n_u"
10700 .It Ar @
10701 Treat message parts with this content as plain text.
10702 .It Ar @t@
10703 The same as plain
10704 .Ar @ .
10705 .It Ar @h@
10706 Treat message parts with this content as HTML tagsoup.
10707 If the \*(OPal HTML-tagsoup-to-text converter is not available treat
10708 the content as plain text instead.
10709 .It Ar @H@
10710 Likewise
10711 .Ar @h@
10712 but instead of falling back to plain text require an explicit content
10713 handler to be defined.
10717 Further reading:
10718 for sending messages:
10719 .Ic mimetype ,
10720 .Va mime-allow-text-controls ,
10721 .Va mimetypes-load-control .
10722 For reading etc. messages:
10723 .Sx "HTML mail and MIME attachments" ,
10724 .Sx "The Mailcap files" ,
10725 .Ic mimetype ,
10726 .Va mime-counter-evidence ,
10727 .Va mimetypes-load-control ,
10728 .Va pipe-TYPE/SUBTYPE ,
10729 .Va pipe-EXTENSION .
10730 .\" }}}
10732 .\" .Ss "The Mailcap files" {{{
10733 .Ss "The Mailcap files"
10735 .\" TODO MAILCAP DISABLED
10736 .Sy This feature is not available in v14.9.0, sorry!
10737 RFC 1524 defines a
10738 .Dq User Agent Configuration Mechanism
10739 which \*(UA \*(OPally supports.
10740 It defines a file format to be used to inform mail user agent programs
10741 about the locally-installed facilities for handling various data
10742 formats, i.e., about commands and how they can be used to display, edit
10743 etc. MIME part contents, as well as a default path search that includes
10744 multiple possible locations of
10745 .Dq mailcap
10746 files and the
10747 .Ev MAILCAPS
10748 environment variable that can be used to overwrite that (repeating here
10749 that it is not a search path, but instead a path search specification).
10750 Any existing files will be loaded in sequence, appending any content to
10751 the list of MIME type handler directives.
10754 .Dq Mailcap
10755 files consist of a set of newline separated entries.
10756 Comment lines start with a number sign
10757 .Ql #
10758 (in the first column!) and are ignored.
10759 Empty lines are also ignored.
10760 All other lines form individual entries that must adhere to the syntax
10761 described below.
10762 To extend a single entry (not comment) its line can be continued on
10763 follow lines if newline characters are
10764 .Dq escaped
10765 by preceding them with the reverse solidus character
10766 .Ql \e .
10767 The standard does not specify how leading whitespace of follow lines
10768 is to be treated, therefore \*(UA retains it.
10771 .Dq Mailcap
10772 entries consist of a number of semicolon
10773 .Ql \&;
10774 separated fields, and the reverse solidus
10775 .Ql \e
10776 character can be used to escape any following character including
10777 semicolon and itself.
10778 The first two fields are mandatory and must occur in the specified
10779 order, the remaining fields are optional and may appear in any order.
10780 Leading and trailing whitespace of content is ignored (removed).
10783 The first field defines the MIME
10784 .Ql TYPE/SUBTYPE
10785 the entry is about to handle (case-insensitively, and no reverse solidus
10786 escaping is possible in this field).
10787 If the subtype is specified as an asterisk
10788 .Ql *
10789 the entry is meant to match all subtypes of the named type, e.g.,
10790 .Ql audio/*
10791 would match any audio type.
10792 The second field defines the shell command which shall be used to
10793 .Dq display
10794 MIME parts of the given type; it is implicitly called the
10795 .Cd view
10796 command.
10799 For data
10800 .Dq consuming
10801 shell commands message (MIME part) data is passed via standard input
10802 unless the given shell command includes one or more instances of the
10803 (unquoted) string
10804 .Ql %s ,
10805 in which case these instances will be replaced with a temporary filename
10806 and the data will have been stored in the file that is being pointed to.
10807 Likewise, for data
10808 .Dq producing
10809 shell commands data is assumed to be generated on standard output unless
10810 the given command includes (one ore multiple)
10811 .Ql %s .
10812 In any case any given
10813 .Ql %s
10814 format is replaced with a(n already) properly quoted filename.
10815 Note that when a command makes use of a temporary file via
10816 .Ql %s
10817 then \*(UA will remove it again, as if the
10818 .Cd x-mailx-tmpfile ,
10819 .Cd x-mailx-tmpfile-fill
10821 .Cd x-mailx-tmpfile-unlink
10822 flags had been set; see below for more.
10825 The optional fields either define a shell command or an attribute (flag)
10826 value, the latter being a single word and the former being a keyword
10827 naming the field followed by an equals sign
10828 .Ql =
10829 succeeded by a shell command, and as usual for any
10830 .Dq Mailcap
10831 content any whitespace surrounding the equals sign will be removed, too.
10832 Optional fields include the following:
10835 .Bl -tag -width ".It Cd BaNg"
10836 .It Cd compose
10837 A program that can be used to compose a new body or body part in the
10838 given format.
10839 (Currently unused.)
10841 .It Cd composetyped
10842 Similar to the
10843 .Cd compose
10844 field, but is to be used when the composing program needs to specify the
10845 .Ql Content-type:
10846 header field to be applied to the composed data.
10847 (Currently unused.)
10849 .It Cd edit
10850 A program that can be used to edit a body or body part in the given
10851 format.
10852 (Currently unused.)
10854 .It Cd print
10855 A program that can be used to print a message or body part in the given
10856 format.
10857 (Currently unused.)
10859 .It Cd test
10860 Specifies a program to be run to test some condition, e.g., the machine
10861 architecture, or the window system in use, to determine whether or not
10862 this mailcap entry applies.
10863 If the test fails, a subsequent mailcap entry should be sought; also see
10864 .Cd x-mailx-test-once .
10866 .It Cd needsterminal
10867 This flag field indicates that the given shell command must be run on
10868 an interactive terminal.
10869 \*(UA will temporarily release the terminal to the given command in
10870 interactive mode, in non-interactive mode this entry will be entirely
10871 ignored; this flag implies
10872 .Cd x-mailx-noquote .
10874 .It Cd copiousoutput
10875 A flag field which indicates that the output of the
10876 .Cd view
10877 command will be an extended stream of textual output that can be
10878 (re)integrated into \*(UA's normal visual display.
10879 It is mutually exclusive with
10880 .Cd needsterminal
10881 and implies
10882 .Cd x-mailx-always .
10884 .It Cd textualnewlines
10885 A flag field which indicates that this type of data is line-oriented and
10886 that, if encoded in
10887 .Ql base64 ,
10888 all newlines should be converted to canonical form (CRLF) before
10889 encoding, and will be in that form after decoding.
10890 (Currently unused.)
10892 .It Cd nametemplate
10893 This field gives a file name format, in which
10894 .Ql %s
10895 will be replaced by a random string, the joined combination of which
10896 will be used as the filename denoted by
10897 .Ev MAILX_FILENAME_TEMPORARY .
10898 One could specify that a GIF file being passed to an image viewer should
10899 have a name ending in
10900 .Ql .gif
10901 by using
10902 .Ql nametemplate=%s.gif .
10903 Note that \*(UA ignores the name template unless that solely specifies
10904 a filename suffix that consists of (ASCII) alphabetic and numeric
10905 characters, the underscore and dot only.
10907 .It Cd x11-bitmap
10908 Names a file, in X11 bitmap (xbm) format, which points to an appropriate
10909 icon to be used to visually denote the presence of this kind of data.
10910 This field is not used by \*(UA.
10912 .It Cd description
10913 A textual description that describes this type of data.
10915 .It Cd x-mailx-always
10916 Extension flag field that denotes that the given
10917 .Cd view
10918 command shall be executed even if multiple messages will be displayed
10919 at once.
10920 Normally messages which require external viewers that produce output
10921 which does not integrate into \*(UA's visual display (i.e., do not have
10922 .Cd copiousoutput
10923 set) have to be addressed directly and individually.
10924 (To avoid cases where, e.g., a thousand PDF viewer instances are spawned
10925 in sequence.)
10927 .It Cd x-mailx-even-if-not-interactive
10928 An extension flag test field \(em by default handlers without
10929 .Cd copiousoutput
10930 are entirely ignored in non-interactive mode, but if this flag is set
10931 then their use will be considered.
10932 It is an error if this flag is set for commands that use the flag
10933 .Cd needsterminal .
10935 .It Cd x-mailx-noquote
10936 An extension flag field that indicates that even a
10937 .Cd copiousoutput
10938 .Cd view
10939 command shall not be used to generate message quotes
10940 (as it would be by default).
10942 .It Cd x-mailx-async
10943 Extension flag field that denotes that the given
10944 .Cd view
10945 command shall be executed asynchronously, without blocking \*(UA.
10946 Cannot be used in conjunction with
10947 .Cd needsterminal .
10949 .It Cd x-mailx-test-once
10950 Extension flag which denotes whether the given
10951 .Cd test
10952 command shall be evaluated once only and the (boolean) result be cached.
10953 This is handy if some global unchanging condition is to be queried, like
10954 .Dq running under the X Window System .
10956 .It Cd x-mailx-tmpfile
10957 Extension flag field that requests creation of a zero-sized temporary
10958 file, the name of which is to be placed in the environment variable
10959 .Ev MAILX_FILENAME_TEMPORARY .
10960 It is an error to use this flag with commands that include a
10961 .Ql %s
10962 format.
10964 .It Cd x-mailx-tmpfile-fill
10965 Normally the MIME part content is passed to the handler via standard
10966 input; if this flag is set then the data will instead be written into
10967 the implied
10968 .Cd x-mailx-tmpfile .
10969 In order to cause deletion of the temporary file you will have to set
10970 .Cd x-mailx-tmpfile-unlink
10971 explicitly!
10972 It is an error to use this flag with commands that include a
10973 .Ql %s
10974 format.
10976 .It Cd x-mailx-tmpfile-unlink
10977 Extension flag field that requests that the temporary file shall be
10978 deleted automatically when the command loop is entered again at latest.
10979 (Do not use this for asynchronous handlers.)
10980 It is an error to use this flag with commands that include a
10981 .Ql %s
10982 format, or without also setting
10983 .Cd x-mailx-tmpfile
10985 .Cd x-mailx-tmpfile-fill .
10987 .It Cd x-mailx-tmpfile-keep
10988 Using the string
10989 .Ql %s
10990 implies the three tmpfile related flags above, but if you want, e.g.,
10991 .Cd x-mailx-async
10992 and deal with the temporary file yourself, you can add in this flag to
10993 forcefully ignore
10994 .Cd x-mailx-tmpfile-unlink .
10999 The standard includes the possibility to define any number of additional
11000 entry fields, prefixed by
11001 .Ql x- .
11002 Flag fields apply to the entire
11003 .Dq Mailcap
11004 entry \(em in some unusual cases, this may not be desirable, but
11005 differentiation can be accomplished via separate entries, taking
11006 advantage of the fact that subsequent entries are searched if an earlier
11007 one does not provide enough information.
11008 E.g., if a
11009 .Cd view
11010 command needs to specify the
11011 .Cd needsterminal
11012 flag, but the
11013 .Cd compose
11014 command shall not, the following will help out the latter (with enabled
11015 .Va debug
11016 or an increased
11017 .Va verbose
11018 level \*(UA will show information about handler evaluation):
11020 .Bd -literal -offset indent
11021 application/postscript; ps-to-terminal %s; needsterminal
11022 application/postscript; ps-to-terminal %s; compose=idraw %s
11026 In fields any occurrence of the format string
11027 .Ql %t
11028 will be replaced by the
11029 .Ql TYPE/SUBTYPE
11030 specification.
11031 Named parameters from the
11032 .Ql Content-type:
11033 field may be placed in the command execution line using
11034 .Ql %{
11035 followed by the parameter name and a closing
11036 .Ql }
11037 character.
11038 The entire parameter should appear as a single command line argument,
11039 regardless of embedded spaces; thus:
11041 .Bd -literal -offset indent
11042 # Message
11043 Content-type:  multipart/mixed; boundary=42
11045 # Mailcap file
11046 multipart/*; /usr/local/bin/showmulti \e
11047   %t %{boundary}  ;  composetyped  = /usr/local/bin/makemulti
11049 # Executed shell command
11050 /usr/local/bin/showmulti multipart/mixed 42
11054 .\" TODO v15: Mailcap: %n,%F
11055 Note that \*(UA does not support handlers for multipart MIME parts as
11056 shown in this example (as of today).
11057 \*(UA does not support the additional formats
11058 .Ql %n
11060 .Ql %F .
11061 An example file, also showing how to properly deal with the expansion of
11062 .Ql %s ,
11063 which includes any quotes that are necessary to make it a valid shell
11064 argument by itself and thus will cause undesired behaviour when placed
11065 in additional user-provided quotes:
11067 .Bd -literal -offset indent
11068 # Comment line
11069 text/richtext; richtext %s; copiousoutput
11071 text/x-perl; perl -cWT %s
11073 application/pdf; \e
11074   infile=%s\e; \e
11075     trap "rm -f ${infile}" EXIT\e; \e
11076     trap "exit 75" INT QUIT TERM\e; \e
11077     mupdf %s; \e
11078   x-mailx-async; x-mailx-tmpfile-keep
11080 application/*; echo "This is \e"%t\e" but \e
11081     is 50 \e% Greek to me" \e; < %s head -c 1024 | cat -vET; \e
11082   copiousoutput; x-mailx-noquote
11086 Further reading:
11087 .Sx "HTML mail and MIME attachments" ,
11088 .Sx "The mime.types files" ,
11089 .Ic mimetype ,
11090 .Ev MAILCAPS ,
11091 .Va mime-counter-evidence ,
11092 .Va pipe-TYPE/SUBTYPE ,
11093 .Va pipe-EXTENSION .
11094 .\" }}}
11096 .\" .Ss "The .netrc file" {{{
11097 .Ss "The .netrc file"
11100 .Pa .netrc
11101 file contains user credentials for machine accounts.
11102 The default location in the user's
11103 .Ev HOME
11104 directory may be overridden by the
11105 .Ev NETRC
11106 environment variable.
11107 The file consists of space, tabulator or newline separated tokens.
11108 \*(UA implements a parser that supports a superset of the original BSD
11109 syntax, but users should nonetheless be aware of portability glitches
11110 of that file format, shall their
11111 .Pa .netrc
11112 be usable across multiple programs and platforms:
11115 .Bl -bullet -compact
11117 BSD does not support single, but only double quotation marks, e.g.,
11118 .Ql password="pass with spaces" .
11120 BSD (only?) supports escaping of single characters via a reverse solidus
11121 (e.g., a space can be escaped via
11122 .Ql \e\0 ) ,
11123 in- as well as outside of a quoted string.
11125 BSD does not require a final quotation mark of the last user input token.
11127 The original BSD (Berknet) parser also supported a format which allowed
11128 tokens to be separated with commas \(en whereas at least Hewlett-Packard
11129 still seems to support this syntax, \*(UA does not!
11131 As a non-portable extension some widely-used programs support
11132 shell-style comments: if an input line starts, after any amount of
11133 whitespace, with a number sign
11134 .Ql # ,
11135 then the rest of the line is ignored.
11137 Whereas other programs may require that the
11138 .Pa .netrc
11139 file is accessible by only the user if it contains a
11140 .Cd password
11141 token for any other
11142 .Cd login
11143 than
11144 .Dq anonymous ,
11145 \*(UA will always require these strict permissions.
11149 Of the following list of supported tokens \*(UA only uses (and caches)
11150 .Cd machine ,
11151 .Cd login
11153 .Cd password .
11154 At runtime the command
11155 .Ic netrc
11156 can be used to control \*(UA's
11157 .Pa .netrc
11158 cache.
11160 .Bl -tag -width ".It Cd BaNg"
11161 .It Cd machine Ar name
11162 The hostname of the entries' machine, lowercase-normalized by \*(UA
11163 before use.
11164 Any further file content, until either end-of-file or the occurrence
11165 of another
11166 .Cd machine
11167 or a
11168 .Cd default
11169 first-class token is bound (only related) to the machine
11170 .Ar name .
11172 As an extension that should not be the cause of any worries
11173 \*(UA supports a single wildcard prefix for
11174 .Ar name :
11175 .Bd -literal -offset indent
11176 machine *.example.com login USER password PASS
11177 machine pop3.example.com login USER password PASS
11178 machine smtp.example.com login USER password PASS
11181 which would match
11182 .Ql xy.example.com
11183 as well as
11184 .Ql pop3.example.com ,
11185 but neither
11186 .Ql example.com
11188 .Ql local.smtp.example.com .
11189 Note that in the example neither
11190 .Ql pop3.example.com
11192 .Ql smtp.example.com
11193 will be matched by the wildcard, since the exact matches take
11194 precedence (it is however faster to specify it the other way around).
11196 .It Cd default
11197 This is the same as
11198 .Cd machine
11199 except that it is a fallback entry that is used shall none of the
11200 specified machines match; only one default token may be specified,
11201 and it must be the last first-class token.
11203 .It Cd login Ar name
11204 The user name on the remote machine.
11206 .It Cd password Ar string
11207 The user's password on the remote machine.
11209 .It Cd account Ar string
11210 Supply an additional account password.
11211 This is merely for FTP purposes.
11213 .It Cd macdef Ar name
11214 Define a macro.
11215 A macro is defined with the specified
11216 .Ar name ;
11217 it is formed from all lines beginning with the next line and continuing
11218 until a blank line is (consecutive newline characters are) encountered.
11219 (Note that
11220 .Cd macdef
11221 entries cannot be utilized by multiple machines, too, but must be
11222 defined following the
11223 .Ic machine
11224 they are intended to be used with.)
11225 If a macro named
11226 .Ar init
11227 exists, it is automatically run as the last step of the login process.
11228 This is merely for FTP purposes.
11230 .\" }}}
11232 .\" }}}
11235 .\" .Sh EXAMPLES {{{
11236 .Sh EXAMPLES
11238 .\" .Ss "An example configuration" {{{
11239 .Ss "An example configuration"
11241 .Bd -literal -offset indent
11242 # This example assumes v15.0 compatibility mode
11243 set v15-compat
11245 # Request strict transport security checks!
11246 set ssl-verify=strict
11248 # Where are the up-to-date SSL certificates?
11249 # (Since we manage up-to-date ones explicitly, do not use any,
11250 # possibly outdated, default certificates shipped with OpenSSL)
11251 #set ssl-ca-dir=/etc/ssl/certs
11252 set ssl-ca-file=/etc/ssl/certs/ca-certificates.crt
11253 set ssl-ca-no-defaults
11254 #set ssl-ca-flags=partial-chain
11255 wysh set smime-ca-file="${ssl-ca-file}" \e
11256   smime-ca-no-defaults #smime-ca-flags="${ssl-ca-flags}"
11258 # Do not use protocols older than TLS v1.2.
11259 # Change this only when the remote server does not support it:
11260 # maybe use ssl-protocol-HOST (or -USER@HOST) syntax to define
11261 # such explicit exceptions, then, e.g.
11262 #   set ssl-protocol-exam.ple='-ALL,+TLSv1.1'
11263 set ssl-protocol='-ALL,+TLSv1.2'
11265 # Explicitly define the list of ciphers, which may improve security,
11266 # especially with protocols older than TLS v1.2.  See ciphers(1).
11267 # Including "@STRENGTH" will sort the final list by algorithm strength.
11268 # In reality it is possibly best to only use ssl-cipher-list-HOST
11269 # (or -USER@HOST), as necessary, again..
11270 set ssl-cipher-list=TLSv1.2:!aNULL:!eNULL:@STRENGTH
11271 # TLSv1.2:!aNULL:!eNULL:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:\e
11272     DHE-RSA-AES256-SHA:@STRENGTH
11273 # ALL:!aNULL:!eNULL:!MEDIUM:!LOW:!MD5:!RC4:!EXPORT:@STRENGTH
11275 # Essential setting: select allowed character sets
11276 set sendcharsets=utf-8,iso-8859-1
11278 # A very kind option: when replying to a message, first try to
11279 # use the same encoding that the original poster used herself!
11280 set reply-in-same-charset
11282 # When replying to or forwarding a message the comment and name
11283 # parts of email addresses are removed unless this variable is set
11284 set fullnames
11286 # When sending messages, wait until the Mail-Transfer-Agent finishs.
11287 # Only like this you will be able to see errors reported through the
11288 # exit status of the MTA (including the builtin SMTP one)!
11289 set sendwait
11291 # Only use builtin MIME types, no mime.types(5) files
11292 set mimetypes-load-control
11294 # Default directory where we act in (relative to $HOME)
11295 set folder=mail
11296 # A leading "+" (often) means: under *folder*
11297 # *record* is used to save copies of sent messages
11298 set MBOX=+mbox.mbox record=+sent.mbox DEAD=+dead.txt
11300 # Make "file mymbox" and "file myrec" go to..
11301 shortcut mymbox %:+mbox.mbox myrec +sent.mbox
11303 # Not really optional, e.g., for S/MIME
11304 set from='Your Name <address@exam.ple>'
11306 # It may be necessary to set hostname and/or smtp-hostname
11307 # if the "SERVER" of mta and "domain" of from do not match.
11308 # The `urlencode' command can be used to encode USER and PASS
11309 set mta=(smtps?|submission)://[USER[:PASS]@]SERVER[:PORT] \e
11310   smtp-auth=login/plain... \e
11311   smtp-use-starttls
11313 # Never refuse to start into interactive mode, and more
11314 set emptystart \e
11315   colour-pager crt= \e
11316   followup-to followup-to-honour=ask-yes \e
11317   history-file=+.\*(uAhist history-size=-1 history-gabby \e
11318   mime-counter-evidence=0xE \e
11319   prompt='?\e?!\e![\e${account}#\e${mailbox-display}]? ' \e
11320   reply-to-honour=ask-yes \e
11321   umask=
11323 # Only include the selected header fields when typing messages
11324 headerpick type retain from_ date from to cc subject \e
11325   message-id mail-followup-to reply-to
11326 # ...when forwarding messages
11327 headerpick forward retain subject date from to cc
11328 # ...when saving message, etc.
11329 #headerpick save ignore ^Original-.*$ ^X-.*$
11331 # Some mailing lists
11332 mlist '@xyz-editor\e.xyz$' '@xyzf\e.xyz$'
11333 mlsubscribe '^xfans@xfans\e.xyz$'
11335 # A real life example of a very huge free mail provider
11336 # Instead of directly placing content inside `account',
11337 # we `define' a macro: like that we can switch "accounts"
11338 # from within *on-compose-splice*, for example!
11339 define XooglX {
11340   set folder=~/spool/XooglX inbox=+syste.mbox sent=+sent
11341   set from='Your Name <address@examp.ple>'
11342   set mta=smtp://USER:PASS@smtp.gmXil.com smtp-use-starttls
11344 account XooglX {
11345   \ecall XooglX
11348 # Here is a pretty large one which does not allow sending mails
11349 # if there is a domain name mismatch on the SMTP protocol level,
11350 # which would bite us if the value of from does not match, e.g.,
11351 # for people who have a sXXXXeforge project and want to speak
11352 # with the mailing list under their project account (in from),
11353 # still sending the message through their normal mail provider
11354 define XandeX {
11355   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
11356   set from='Your Name <address@exam.ple>'
11357   set mta=smtps://USER:PASS@smtp.yaXXex.ru:465 \e
11358     hostname=yaXXex.com smtp-hostname=
11360 account XandeX {
11361   \ecall Xandex
11364 # Create some new commands so that, e.g., `ls /tmp' will..
11365 wysh ghost lls '!ls ${LS_COLOR_FLAG} -aFlrS'
11366 wysh ghost llS '!ls ${LS_COLOR_FLAG} -aFlS'
11367 wysh ghost ls '!ls ${LS_COLOR_FLAG} -aFrS'
11368 wysh ghost lS '!ls ${LS_COLOR_FLAG} -aFS'
11369 wysh ghost lla '!ls ${LS_COLOR_FLAG} -aFlr'
11370 wysh ghost llA '!ls ${LS_COLOR_FLAG} -aFl'
11371 wysh ghost la '!ls ${LS_COLOR_FLAG} -aFr'
11372 wysh ghost lA '!ls ${LS_COLOR_FLAG} -aF'
11373 wysh ghost ll '!ls ${LS_COLOR_FLAG} -aFltr'
11374 wysh ghost lL '!ls ${LS_COLOR_FLAG} -aFlt'
11375 wysh ghost l '!ls ${LS_COLOR_FLAG} -aFtr'
11376 wysh ghost L '!ls ${LS_COLOR_FLAG} -aFt'
11378 # We do not support gpg(1) directly yet.  But simple --clearsign'd
11379 # message parts can be dealt with as follows:
11380 define V {
11381   localopts yes
11382   wysh set pipe-text/plain=$'@*#++=@\e
11383     < "${MAILX_FILENAME_TEMPORARY}" awk \e
11384         -v TMPFILE="${MAILX_FILENAME_TEMPORARY}" \e'\e
11385       BEGIN{done=0}\e
11386       /^-----BEGIN PGP SIGNED MESSAGE-----/,/^$/ {\e
11387         if(done++ != 0)\e
11388           next;\e
11389         print "--- GPG --verify ---";\e
11390         system("gpg --verify " TMPFILE " 2>&1");\e
11391         print "--- GPG --verify ---";\e
11392         print "";\e
11393         next;\e
11394       }\e
11395       /^-----BEGIN PGP SIGNATURE-----/,\e
11396           /^-----END PGP SIGNATURE-----/{\e
11397         next;\e
11398       }\e
11399       {print}\e
11400     \e''
11401     print
11403 ghost V '\e'call V
11405 define RK {
11406   !printf 'Key IDs to gpg --recv-keys: ';\e
11407     read keyids;\e
11408     gpg --recv-keys ${keyids};
11410 ghost RK call RK
11414 When storing passwords in
11415 .Pa \*(ur
11416 appropriate permissions should be set on this file with
11417 .Ql $ chmod 0600 \*(ur .
11418 If the \*(OPal
11419 .Va netrc-lookup
11420 is available user credentials can be stored in the central
11421 .Pa .netrc
11422 file instead; e.g., here is a different version of the example account
11423 that sets up SMTP and POP3:
11425 .Bd -literal -offset indent
11426 define XandeX {
11427   set folder=~/spool/XandeX inbox=+syste.mbox sent=+sent
11428   set from='Your Name <address@exam.ple>'
11429   set netrc-lookup
11430   # Load an encrypted ~/.netrc by uncommenting the next line
11431   #set netrc-pipe='gpg -qd ~/.netrc.pgp'
11433   set mta=smtps://smtp.yXXXXx.ru:465 \e
11434       smtp-hostname= hostname=yXXXXx.com
11435   set pop3-keepalive=240 pop3-no-apop-pop.yXXXXx.ru
11436   ghost xp fi pop3s://pop.yXXXXx.ru
11438 account XandeX {
11439   \ecall XandeX
11444 and, in the
11445 .Pa .netrc
11446 file:
11448 .Bd -literal -offset indent
11449 machine *.yXXXXx.ru login USER password PASS
11453 This configuration should now work just fine:
11456 .Dl $ echo text | \*(uA -vv -AXandeX -s Subject user@exam.ple
11457 .\" }}}
11459 .\" .Ss "Signed and encrypted messages with S/MIME" {{{
11460 .Ss "Signed and encrypted messages with S/MIME"
11462 \*(OP S/MIME provides two central mechanisms:
11463 message signing and message encryption.
11464 A signed message contains some data in addition to the regular text.
11465 The data can be used to verify that the message was sent using a valid
11466 certificate, that the sender's address in the message header matches
11467 that in the certificate, and that the message text has not been altered.
11468 Signing a message does not change its regular text;
11469 it can be read regardless of whether the recipient's software is able to
11470 handle S/MIME.
11473 It is thus usually possible to sign all outgoing messages if so desired.
11474 Encryption, in contrast, makes the message text invisible for all people
11475 except those who have access to the secret decryption key.
11476 To encrypt a message, the specific recipient's public encryption key
11477 must be known.
11478 It is therefore not possible to send encrypted mail to people unless their
11479 key has been retrieved from either previous communication or public key
11480 directories.
11481 A message should always be signed before it is encrypted.
11482 Otherwise, it is still possible that the encrypted message text is
11483 altered.
11486 A central concept to S/MIME is that of the certification authority (CA).
11487 A CA is a trusted institution that issues certificates.
11488 For each of these certificates it can be verified that it really
11489 originates from the CA, provided that the CA's own certificate is
11490 previously known.
11491 A set of CA certificates is usually delivered with OpenSSL and installed
11492 on your system.
11493 If you trust the source of your OpenSSL software installation,
11494 this offers reasonable security for S/MIME on the Internet.
11495 Otherwise set
11496 .Va smime-ca-no-defaults
11497 to avoid using the default certificate and point
11498 .Va smime-ca-file
11499 and/or
11500 .Va smime-ca-dir
11501 to a trusted pool of certificates.
11502 In general, a certificate cannot be more secure than the method its CA
11503 certificate has been retrieved with.
11506 The first thing you need for participating in S/MIME message exchange is
11507 your personal certificate, including a private key.
11508 The certificate contains public information, in particular your name and
11509 your email address(es), and the public key that is used by others to
11510 encrypt messages for you,
11511 and to verify signed messages they supposedly received from you.
11512 The certificate is included in each signed message you send.
11513 The private key must be kept secret.
11514 It is used to decrypt messages that were previously encrypted with your
11515 public key, and to sign messages.
11518 For personal use it is recommended that you get a S/MIME certificate
11519 from one of the major CAs on the Internet using your WWW browser.
11520 Many CAs offer such certificates for free.
11521 There is also
11522 .Lk https://www.CAcert.org
11523 which issues client and server certificates to members of their
11524 community for free; their root certificate
11525 .Pf ( Lk https://\:www.cacert.org/\:certs/\:root.crt )
11526 is often not in the default set of trusted CA root certificates, though,
11527 which means you will have to download their root certificate separately
11528 and ensure it is part of our S/MIME certificate validation chain by
11529 including it in
11530 .Va smime-ca-dir
11531 or as a vivid member of the
11532 .Va smime-ca-file .
11533 But let us take a step-by-step tour on how to setup S/MIME with
11534 a certificate from CAcert.org despite this situation!
11537 First of all you will have to become a member of the CAcert.org
11538 community, simply by registrating yourself via the web interface.
11539 Once you are, create and verify all email addresses you want to be able
11540 to create signed and encrypted messages for/with using the corresponding
11541 entries of the web interface.
11542 Now ready to create S/MIME certificates, so let us create a new
11543 .Dq client certificate ,
11544 ensure to include all email addresses that should be covered by the
11545 certificate in the following web form, and also to use your name as the
11546 .Dq common name .
11549 Create a private key and a certificate request on your local computer
11550 (please see the manual pages of the used commands for more in-depth
11551 knowledge on what the used arguments etc. do):
11554 .Dl openssl req -nodes -newkey rsa:4096 -keyout key.pem -out creq.pem
11557 Afterwards copy-and-paste the content of
11558 .Dq creq.pem
11559 into the certificate-request (CSR) field of the web form on the
11560 CAcert.org website (you may need to unfold some
11561 .Dq advanced options
11562 to see the corresponding text field).
11563 This last step will ensure that your private key (which never left your
11564 box) and the certificate belong together (through the public key that
11565 will find its way into the certificate via the certificate-request).
11566 You are now ready and can create your CAcert certified certificate.
11567 Download and store or copy-and-paste it as
11568 .Dq pub.crt .
11571 Yay.
11572 In order to use your new S/MIME setup a combined private key/public key
11573 (certificate) file has to be created:
11576 .Dl cat key.pem pub.crt > ME@HERE.com.paired
11579 This is the file \*(UA will work with.
11580 If you have created your private key with a passphrase then \*(UA will
11581 ask you for it whenever a message is signed or decrypted.
11582 Set the following variables to henceforth use S/MIME (setting
11583 .Va smime-ca-file
11584 is of interest for verification only):
11586 .Bd -literal -offset indent
11587 set smime-ca-file=ALL-TRUSTED-ROOT-CERTS-HERE \e
11588   smime-sign-cert=ME@HERE.com.paired \e
11589   smime-sign-message-digest=SHA256 \e
11590   smime-sign
11594 From each signed message you send, the recipient can fetch your
11595 certificate and use it to send encrypted mail back to you.
11596 Accordingly if somebody sends you a signed message, you can do the same,
11597 and use the
11598 .Ic verify
11599 command to check the validity of the certificate.
11602 Variables of interest for S/MIME signing:
11603 .Va smime-ca-dir ,
11604 .Va smime-ca-file ,
11605 .Va smime-ca-flags ,
11606 .Va smime-ca-no-defaults ,
11607 .Va smime-crl-dir ,
11608 .Va smime-crl-file ,
11609 .Va smime-sign ,
11610 .Va smime-sign-cert ,
11611 .Va smime-sign-include-certs
11613 .Va smime-sign-message-digest .
11616 After it has been verified save the certificate via
11617 .Ic certsave
11618 and tell \*(UA that it should use it for encryption for further
11619 communication with that somebody:
11621 .Bd -literal -offset indent
11622 certsave FILENAME
11623 set smime-encrypt-USER@HOST=FILENAME \e
11624     smime-cipher-USER@HOST=AES256
11628 Additional variables of interest for S/MIME en- and decryption:
11629 .Va smime-cipher
11631 .Va smime-encrypt-USER@HOST .
11634 You should carefully consider if you prefer to store encrypted messages
11635 in decrypted form.
11636 If you do, anybody who has access to your mail folders can read them,
11637 but if you do not, you might be unable to read them yourself later if
11638 you happen to lose your private key.
11640 .Ic decrypt
11641 command saves messages in decrypted form, while the
11642 .Ic save , copy ,
11644 .Ic move
11645 commands leave them encrypted.
11648 Note that neither S/MIME signing nor encryption applies to message
11649 subjects or other header fields yet.
11650 Thus they may not contain sensitive information for encrypted messages,
11651 and cannot be trusted even if the message content has been verified.
11652 When sending signed messages,
11653 it is recommended to repeat any important header information in the
11654 message text.
11655 .\" }}}
11657 .\" .Ss "Using CRLs with S/MIME or SSL/TLS" {{{
11658 .Ss "Using CRLs with S/MIME or SSL/TLS"
11660 \*(OP Certification authorities (CAs) issue certificate revocation
11661 lists (CRLs) on a regular basis.
11662 These lists contain the serial numbers of certificates that have been
11663 declared invalid after they have been issued.
11664 Such usually happens because the private key for the certificate has
11665 been compromised,
11666 because the owner of the certificate has left the organization that is
11667 mentioned in the certificate, etc.
11668 To seriously use S/MIME or SSL/TLS verification,
11669 an up-to-date CRL is required for each trusted CA.
11670 There is otherwise no method to distinguish between valid and
11671 invalidated certificates.
11672 \*(UA currently offers no mechanism to fetch CRLs, nor to access them on
11673 the Internet, so they have to be retrieved by some external mechanism.
11676 \*(UA accepts CRLs in PEM format only;
11677 CRLs in DER format must be converted, like, e.\|g.:
11680 .Dl $ openssl crl \-inform DER \-in crl.der \-out crl.pem
11683 To tell \*(UA about the CRLs, a directory that contains all CRL files
11684 (and no other files) must be created.
11686 .Va smime-crl-dir
11688 .Va ssl-crl-dir
11689 variables, respectively, must then be set to point to that directory.
11690 After that, \*(UA requires a CRL to be present for each CA that is used
11691 to verify a certificate.
11692 .\" }}}
11694 .\" .Ss "Handling spam" {{{
11695 .Ss "Handling spam"
11697 \*(OP \*(UA can make use of several spam interfaces for the purpose of
11698 identification of, and, in general, dealing with spam messages.
11699 A precondition of most commands in order to function is that the
11700 .Va spam-interface
11701 variable is set to one of the supported interfaces.
11702 Once messages have been identified as spam their (volatile)
11703 .Ql is-spam
11704 state can be prompted: the
11705 .Ql Ar :s
11707 .Ql Ar :S
11708 message specifications will address respective messages and their
11709 .Va attrlist
11710 entries will be used when displaying the
11711 .Va headline
11712 in the header display.
11714 .Bl -bullet
11716 .Ic spamrate
11717 rates the given messages and sets their
11718 .Ql is-spam
11719 flag accordingly.
11720 If the spam interface offers spam scores those can also be displayed in
11721 the header display by including the
11722 .Ql %$
11723 format in the
11724 .Va headline
11725 variable.
11727 .Ic spamham ,
11728 .Ic spamspam
11730 .Ic spamforget
11731 will interact with the Bayesian filter of the chosen interface and learn
11732 the given messages as
11733 .Dq ham
11735 .Dq spam ,
11736 respectively; the last command can be used to cause
11737 .Dq unlearning
11738 of messages; it adheres to their current
11739 .Ql is-spam
11740 state and thus reverts previous teachings.
11742 .Ic spamclear
11744 .Ic spamset
11745 will simply set and clear, respectively, the mentioned volatile
11746 .Ql is-spam
11747 message flag, without any interface interaction.
11752 .Xr spamassassin 1
11753 based
11754 .Va spam-interface
11755 .Ql spamc
11756 requires a running instance of the
11757 .Xr spamd 1
11758 server in order to function, started with the option
11759 .Fl -allow-tell
11760 shall Bayesian filter learning be possible.
11762 .Bd -literal -offset indent
11763 $ spamd -i localhost:2142 -i /tmp/.spamsock -d [-L] [-l]
11764 $ spamd --listen=localhost:2142 --listen=/tmp/.spamsock \e
11765     --daemonize [--local] [--allow-tell]
11769 Thereafter \*(UA can make use of these interfaces:
11771 .Bd -literal -offset indent
11772 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
11773     -Sspamc-command=/usr/local/bin/spamc \e
11774     -Sspamc-arguments="-U /tmp/.spamsock" -Sspamc-user=
11776 $ \*(uA -Sspam-interface=spamc -Sspam-maxsize=500000 \e
11777     -Sspamc-command=/usr/local/bin/spamc \e
11778     -Sspamc-arguments="-d localhost -p 2142" -Sspamc-user=
11782 Using the generic filter approach allows usage of programs like
11783 .Xr bogofilter 1 .
11784 Here is an example, requiring it to be accessible via
11785 .Ev PATH :
11787 .Bd -literal -offset indent
11788 $ \*(uA -Sspam-interface=filter -Sspam-maxsize=500000 \e
11789     -Sspamfilter-ham="bogofilter -n" \e
11790     -Sspamfilter-noham="bogofilter -N" \e
11791     -Sspamfilter-nospam="bogofilter -S" \e
11792     -Sspamfilter-rate="bogofilter -TTu 2>/dev/null" \e
11793     -Sspamfilter-spam="bogofilter -s" \e
11794     -Sspamfilter-rate-scanscore="1;^(.+)$"
11798 Because messages must exist on local storage in order to be scored (or
11799 used for Bayesian filter training), it is possibly a good idea to
11800 perform the local spam check last:
11802 .Bd -literal -offset indent
11803 define spamdelhook {
11804   # Server side DCC
11805   spamset (header x-dcc-brand-metrics "bulk")
11806   # Server-side spamassassin(1)
11807   spamset (header x-spam-flag "YES")
11808   del :s # TODO we HAVE to be able to do `spamrate :u ! :sS'
11809   move :S +maybe-spam
11810   spamrate :u
11811   del :s
11812   move :S +maybe-spam
11814 set folder-hook-FOLDER=spamdelhook
11818 See also the documentation for the variables
11819 .Va spam-interface , spam-maxsize ,
11820 .Va spamc-command , spamc-arguments , spamc-user ,
11821 .Va spamfilter-ham , spamfilter-noham , spamfilter-nospam , \
11822   spamfilter-rate
11824 .Va spamfilter-rate-scanscore .
11825 .\" }}}
11826 .\" }}} (Examples)
11829 .\" .Sh "FAQ" {{{
11830 .Sh "FAQ"
11832 In general it is a good idea to turn on
11833 .Va debug
11834 .Pf ( Fl d )
11835 and / or
11836 .Va verbose
11837 .Pf ( Fl v ,
11838 twice) if something does not work well.
11839 Very often a diagnostic message can be produced that leads to the
11840 problems' solution.
11842 .\" .Ss "\*(UA shortly hangs on startup" {{{
11843 .Ss "\*(UA shortly hangs on startup"
11845 This can have two reasons, one is the necessity to wait for a file lock
11846 and cannot be helped, the other being that \*(UA calls the function
11847 .Xr uname 2
11848 in order to query the nodename of the box (sometimes the real one is
11849 needed instead of the one represented by the internal variable
11850 .Va hostname ) .
11851 One may have varying success by ensuring that the real hostname and
11852 .Ql localhost
11853 have entries in
11854 .Pa /etc/hosts ,
11855 or, more generally, that the name service is properly setup \(en
11856 and does
11857 .Xr hostname 1
11858 return the expected value?
11859 Does this local hostname has a domain suffix?
11860 RFC 6762 standardized the link-local top-level domain
11861 .Ql .local ,
11862 try again after adding an (additional) entry with this extension.
11863 .\" }}}
11865 .\" .Ss "\*(UA exits quick, and output is cleared away" {{{
11866 .Ss "\*(UA exits quick, and output is cleared away"
11868 When this happens even with
11869 .Va emptystart
11870 set, then this most likely indicates a problem with the creation of
11871 so-called dotlock files: setting
11872 .Va dotlock-ignore-error
11873 should overcome this situation.
11874 This only avoids symptoms, it does not address the problem, though.
11875 Since the output is cleared away \*(UA has support for
11876 .Sx "On terminal control and line editor" ,
11877 and switches to the
11878 .Dq ca-mode ,
11879 which causes the output clearance: by doing
11880 .Ql set termcap='smcup='
11881 this mode can be suppressed, and by setting
11882 .Va verbose
11883 (twice) the actual problem should be reported.
11884 .\" }}}
11886 .\" .Ss "I cannot login to Google mail aka GMail" {{{
11887 .Ss "I cannot login to Google mail aka GMail"
11889 Since 2014 some free service providers classify programs as
11890 .Dq less secure
11891 unless they use a special authentification method (OAuth 2.0) which
11892 was not standardized for non-HTTP protocol authentication token query
11893 until August 2015 (RFC 7628).
11896 Different to Kerberos / GSSAPI, which is developed since the mid of the
11897 1980s, where a user can easily create a local authentication ticket for
11898 her- and himself with the locally installed
11899 .Xr kinit 1
11900 program, that protocol has no such local part but instead requires
11901 a world-wide-web query to create or fetch a token; since there is no
11902 local cache this query would have to be performed whenever \*(UA is
11903 invoked (in interactive sessions situation may differ).
11906 \*(UA does not support OAuth.
11907 Because of this it is necessary to declare \*(UA a
11908 .Dq less secure app
11909 (on the providers account web page) in order to read and send mail.
11910 However, it also seems possible to take the following steps instead:
11913 .Bl -enum -compact
11915 give the provider the number of a mobile phone,
11917 enable
11918 .Dq 2-Step Verification ,
11920 create an application specific password (16 characters), and
11922 use that special password instead of the real Google account password in
11923 \*(UA (for more on that see the section
11924 .Sx "On URL syntax and credential lookup" ) .
11926 .\" }}}
11928 .\" .Ss "Not \(dqdefunctional\(dq, but the editor key does not work" {{{
11929 .Ss "Not \(dqdefunctional\(dq, but the editor key does not work"
11931 It can happen that the terminal library (see
11932 .Sx "On terminal control and line editor",
11933 .Ic bind ,
11934 .Va termcap )
11935 reports different codes than the terminal really sends, in which case
11936 \*(UA will tell that a key binding is functional, but will not be able to
11937 recognize it because the received data does not match anything expected.
11939 .Va verbose
11940 listing of
11941 .Ic bind Ns
11942 ings will show the byte sequences that are expected.
11945 To overcome the situation, use, e.g., the program
11946 .Xr cat 1 ,
11947 in conjunction with the command line option
11948 .Fl \&\&v ,
11949 if available, to see the byte sequences which are actually produced
11950 by keypresses, and use the variable
11951 .Va termcap
11952 to make \*(UA aware of them.
11953 E.g., the terminal this is typed on produces some false sequences, here
11954 an example showing the shifted home key:
11956 .Bd -literal -offset indent
11957 ? set verbose
11958 ? bind*
11959 # 1B 5B=[ 31=1 3B=; 32=2 48=H
11960   bind base :kHOM z0
11961 ? x
11962 $ cat -v
11963 ^[[H
11964 ? \*(uA -v -Stermcap='kHOM=\eE[H'
11965 ? bind*
11966 # 1B 5B=[ 48=H
11967   bind base :kHOM z0
11969 .\" }}}
11970 .\" }}}
11973 .\" .Sh "SEE ALSO" {{{
11974 .Sh "SEE ALSO"
11976 .Xr bogofilter 1 ,
11977 .Xr gpg 1 ,
11978 .Xr more 1 ,
11979 .Xr newaliases 1 ,
11980 .Xr openssl 1 ,
11981 .Xr sendmail 1 ,
11982 .Xr sh 1 ,
11983 .Xr spamassassin 1 ,
11984 .Xr iconv 3 ,
11985 .Xr setlocale 3 ,
11986 .Xr aliases 5 ,
11987 .Xr termcap 5 ,
11988 .Xr terminfo 5 ,
11989 .Xr locale 7 ,
11990 .Xr mailaddr 7 ,
11991 .Xr re_format 7 ,
11992 .Xr mailwrapper 8 ,
11993 .Xr sendmail 8
11994 .\" }}}
11997 .\" .Sh HISTORY {{{
11998 .Sh HISTORY
12000 M. Douglas McIlroy writes in his article
12001 .Dq A Research UNIX Reader: Annotated Excerpts \
12002 from the Programmer's Manual, 1971-1986
12004 .Xr mail 1
12005 command already appeared in First Edition
12007 in 1971:
12009 .Bd -ragged -offset indent
12010 Electronic mail was there from the start.
12011 Never satisfied with its exact behavior, everybody touched it at one
12012 time or another: to assure the safety of simultaneous access, to improve
12013 privacy, to survive crashes, to exploit uucp, to screen out foreign
12014 freeloaders, or whatever.
12015 Not until v7 did the interface change (Thompson).
12016 Later, as mail became global in its reach, Dave Presotto took charge and
12017 brought order to communications with a grab-bag of external networks
12018 (v8).
12023 Mail was written in 1978 by Kurt Shoens and developed as part of the
12026 distribution until 1995.
12027 Mail has then seen further development in open source
12029 variants, noticeably by Christos Zoulas in
12030 .Pf Net Bx .
12031 Based upon this Nail, later Heirloom Mailx, was developed by Gunnar
12032 Ritter in the years 2000 until 2008.
12033 Since 2012 S-nail is maintained by Steffen (Daode) Nurpmeso.
12034 This man page is derived from
12035 .Dq The Mail Reference Manual
12036 that was originally written by Kurt Shoens.
12037 .\" }}}
12040 .Sh AUTHORS
12042 .An "Kurt Shoens" ,
12043 .An "Edward Wang" ,
12044 .An "Keith Bostic" ,
12045 .An "Christos Zoulas" ,
12046 .An "Gunnar Ritter" ,
12047 .An "Steffen Nurpmeso" Aq Mt s-nail-users@lists.sourceforge.net
12048 (later
12049 .Mt s-mailx@sdaoden.eu ) .
12052 .\" .Sh CAVEATS {{{
12053 .Sh CAVEATS
12055 \*(ID Interrupting an operation via
12056 .Dv \&\&SIGINT
12058 .Ql control-C
12059 from anywhere else but a command prompt is very problematic and likely
12060 to leave the program in an undefined state: many library functions
12061 cannot deal with the
12062 .Fn siglongjmp 3
12063 that this software (still) performs; even though efforts have been taken
12064 to address this, no sooner but in v15 it will have been worked out:
12065 interruptions have not been disabled in order to allow forceful breakage
12066 of hanging network connections, for example (all this is unrelated to
12067 .Va ignore ) .
12070 The SMTP and POP3 protocol support of \*(UA is very basic.
12071 Also, if it fails to contact its upstream SMTP server, it will not make
12072 further attempts to transfer the message at a later time (setting
12073 .Va save
12075 .Va sendwait
12076 may be useful).
12077 If this is a concern, it might be better to set up a local SMTP server
12078 that is capable of message queuing.
12079 .\" }}}
12082 .Sh BUGS
12084 After deleting some message of a POP3 mailbox the header summary falsely
12085 claims that there are no messages to display, one needs to perform
12086 a scroll or dot movement to restore proper state.
12088 In threaded display a power user may encounter crashes very
12089 occasionally (this is may and very).
12091 The file
12092 .Pa TODO
12093 in the source repository lists future directions.
12094 .\" s-ts-mode